summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/if_em_hw.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* match on Intel Alder Lake and Meteor Lake I219 Ethernet idsjsg2021-01-241-1/+10
|
* add kstat support for reading hardware counters.dlg2020-07-131-83/+2
| | | | | | | | | | | | | | | | this replaces the existing counters implementation, which just collected the stats in the softc, but didn't really provide a way for a person to read them. em counters get cleared on read. a lot of them are 32bit, so to avoid overflow the counters are polled and the newly accumulated values are added to some 64 bit counters in software. tested by hrvoje popovski and SAITOH Masanobu ok mpi@ i missed these files when i committed src/sys/dev/pci/if_em.c r1.356. thanks to jsg for pointing this out.
* Use FOREACH_QUEUE() where nothing else is required to support multi-queues.mpi2020-04-221-11/+14
| | | | Tested by Hrvoje Popovski and jmatthew@, ok jmatthew@
* Use queue descriptor instead of hardcoded value when initializing hw.mpi2020-03-081-17/+36
| | | | Tested by Hrvoje Popovski, ok jmatthew@
* Refactoring to prepare multi-queues support, no intended behavior change:mpi2020-02-041-11/+113
| | | | | | | | | | | | | | | | | | - Abstract the allocation/freeing of TX/RX ring into em_dma_malloc(). This will ease the introduction of multiple rings. - Split the 82576 variant out of 82575. The distinction is necessary when it comes to setting multiple queues. - Change multiple TX/RX related macro to take an index argument corresponding to a ring. Currently only the index 0 and 1 are used. - Gather and print more stats counters - Switch to using a function, like FreeBSD, to translate 82542 registers and get rid of a set of defines. Tested by many, thanks! ok mlarkin@, jmatthew@
* match on Intel Comet Lake and Tiger Lake Ethernetjsg2020-01-201-1/+12
|
* Fix previous commit.kettenis2019-09-051-3/+3
| | | | ok millert@, sf@, deraadt@
* em: Fix potential endless loopsf2019-09-051-2/+7
| | | | | | | | | | If the NIC is in some error state (seen on a i219LM when em_read_phy_reg_ex() returns at "MDI Error"), it can happen that we loop endlessly because the loop variable is modified again somewhere down in the call stack. Use a separate variable to make the attach fail with "Hardware Initialization Failed" instead of hanging. yes deraadt@
* em: Add magic delay for HP elitebook 820 G3sf2018-04-291-1/+3
| | | | | | | | Add another magic 1ms delay that seems to help with some remaining "Hardware Initialization Failed" issues on an HP elitebook 820 G3 with i219LM. A printf() at the same place helps, too. ok mikeb@
* em: Make em_get_software_flag() recursivesf2018-04-291-1/+11
| | | | | | | | | | | | The em driver calls em_get_software_flag() recursively, which causes the semaphore to be unlocked too early. Make em_get_software_flag and em_release_software_flag handle this correctly. Freebsd does not do this, but they have a mutex that probably allows them to detect recursive calls to e1000_acquire_swflag_ich8lan(). Reworking the openbsd driver to not recursively get the semaphore would be very invasive. ok mikeb@
* em: Improve access logic for software flagsf2018-04-291-4/+20
| | | | | | | | | | | Some em chips have a semaphore ("software flag") to synchronize access to certain registers between OS and firmware (ME/AMT). Make the logic to get the flag match the logic in freebsd. This includes higher timeouts and waiting for a previous unlock to complete before trying a lock again. ok mikeb@
* em: Add em_check_phy_reset_block() quirksf2018-04-071-4/+13
| | | | | | | Port the logic from freebsd to em_check_phy_reset_block(). A single read does not seem to be reliable. ok mikeb@ jsg@
* em: Increase delay after reset to 20mssf2018-04-071-2/+2
| | | | | | This is the value in freebsd for ich8lan. ok mikeb@ jsg@
* Add untested support for Cannon Lake and Ice Lake Ethernet (pch_cnp).jsg2018-03-161-25/+59
| | | | | Going by changes in FreeBSD and Linux it is almost identical to pch_spt but doesn't need one of the workarounds for a pch_spt specific errata.
* match two more copper i210 idsjsg2018-03-101-1/+3
|
* Add another ICH10 em(4). From John the.cheeze at gmail.jsg2018-03-101-1/+2
|
* em: Disable ultra-low-power mode on bootsf2017-08-121-1/+190
| | | | | | | | | | | | | | | | | | | | | | | With i219V, it sometimes happens that em fails to attach with this error: em0: Hardware Initialization Failed em0: Unable to initialize the hardware This happens always if booting native Windows 10 first and then rebooting into openbsd without switching the laptop off. But it has also been seen in other cases. This change ports the e1000_disable_ulp_lpt_lp() logic from the FreeBSD driver to disable ultra-low-power (ULP) mode. This seems to fix the problem in many (but not all) cases. The code has been merged in a way to make the diff from FreeBSD minimal. For example, the SWFW register is called H2ME on newer chips, so a new define is introduced. Also, the em_toggle_lanphypc_pch_lpt() function is left as separate function even if only used in one place at the moment. ok tom@ "commit it" deraadt@
* Match the Kaby Lake and Lewisburg (Skylake-EP PCH) MACs with I219 PHYs.jsg2017-03-191-1/+6
| | | | Expanded version of a diff from claudio@ who tested on x270 ok kettenis@
* remove duplicated test for em_82574jsg2016-08-231-2/+1
|
* Add support for the Intel i219 network chip to the em(4) driver.bluhm2016-02-181-31/+340
| | | | | from Christian Ehrhardt; input jsg@; OK deraadt@ sthen@ mpi@ jsg@ tested by sthen@ jca@ benno@ bluhm@
* "harware" -> "hardware"mmcc2015-12-141-2/+2
|
* You only need <net/if_dl.h> if you're using LLADDR() or a sockaddr_dl.mpi2015-11-241-2/+1
|
* Add support for the 88E1512/88E1514 phys using the 1512 init sequencejsg2015-09-121-3/+100
| | | | | | from the Intel code in FreeBSD. Tested by Paul Levlin on a machine with I354.
* Fix i217 PHY initializationsf2015-08-051-1/+97
| | | | | | | | | | | | | | | | | Add a workaround for a hardware bug were receiving of packets would stop until the battery of the laptop was removed. The problem could be triggered if the LAN cable was plugged in after the PHY had already been initialized. The workaround is already present in FreeBSD (e1000_ich8lan.c: e1000_lv_jumbo_workaround_ich8lan()) and Linux. The commit messages of b20a7744 and da1e2046 in Linux have some more details. Found and ported from FreeBSD by Valentin Dornauer. Tested by many. ok deraadt@
* fix typo.yuo2015-07-171-3/+3
|
* Add support for em(4) on Teak 3020, a Tolopai (EP80579)dms2015-06-041-4/+199
| | | | | | | based devices. This introduces Realtek PHY into em driver code and is only a temporary solution to the problem. OK deraadt@
* The i211 does not support an external EEPROM only a OTPjsg2015-05-121-1/+149
| | | | | | | Internal Non-Volatile Memory (iNVM). Add support for reading words out of it instead of an EEPROM. From Patrick Wildt with some more offsets added.
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* unifdef INETtedu2014-12-221-3/+1
|
* Implement yet another workaround for the k1 em(4)'s. This time forclaudio2014-11-051-1/+90
| | | | | | | | the i218 which is used in many modern laptops like the X240. This seems to stop the watchdog timeouts triggered by heavy traffic on such systems. Tested by myself, phessler, blambert and Donovan Watteau OK deraadt, brad
* Fewer <netinet/in_systm.h>mpi2014-07-221-3/+1
|
* match on 82580 quad fiber and add untested support forjsg2014-03-101-1/+10
| | | | | DH89XX/Cave Creek PCH which seem to function like a 82580 with some external Marvell PHYs.
* match on more i217/i218 variantsjsg2014-03-101-1/+5
|
* basic i210/i211 support (improved after looking at gollo@ i210 diff on misc)chris2014-02-221-5/+27
| | | | | | tested on Supermicro X10SLL ok jsg@
* Add initial support for i354 MAC and M88E1543 PHY.jsg2014-02-171-2/+8
| | | | | | | Currently treated the same as i350, i354 specific EEE settings and 2.5Gb backplane connections not properly handled yet. Tested by Andrew Lester on a Supermicro A1SRi-2758F.
* use a macro when testing for an ich8 family mac typejsg2013-11-271-187/+32
| | | | no binary change
* Initial support for the integrated Lynx Point and Lynx Point LP Ethernetjsg2013-11-211-72/+221
| | | | | | with external i217 and i218 PHYs. Requires a changed way of detecting the eeprom flash bank from FreeBSD as suggested by Masanobu SAITOH. Thanks to everyone who tested.
* Most network drivers include netinet/in_var.h, but apparently theybluhm2013-08-071-2/+1
| | | | | don't have to. Just remove these include lines. Compiled on amd64 i386 sparc64; OK henning@ mikeb@
* Handle newer fiber adapters the same way as 82575/82576,jsg2013-04-301-8/+8
| | | | | | required to make 82580(i340) and i350 based adapters work. Tested by Rogier Krieger on an i350-F2.
* Remove excessive sys/cdefs.h inclusionderaadt2012-12-051-6/+1
| | | | ok guenther millert kettenis
* Bring in some more pch2/82579 bits from the Intel code in FreeBSD:jsg2012-11-261-41/+168
| | | | | | | | | | | | - modify em_oem_bits_config_pchlan for pch2 - sync pch2 use of gating/ungating hardware phy config - add 82579 phy workarounds - enable Energy Efficient Ethernet on 82579 From Yoshihisa Matsushita based on an earlier diff of mine. Fixes problems some people were seeing with gigabit autoneg on pch2. tested by naddy@ & jasper@, ok mikeb@
* Add support for i350 based devices, based in part on Intel codejsg2012-05-171-8/+84
| | | | | | | | | | in FreeBSD. Workaround the apparently undocumented errata where the CRC is always stripped whether asked to or not, and take the FreeBSD workaround for a known errata when clearing the vlan filter. Thanks to Jens A. Griepentrog for donating a card. ok dlg@ mikeb@
* Limit the kumeran errata to a specific mac/phy combo as done in the Inteljsg2011-11-291-2/+4
| | | | | | code instead of testing only the phy. Fixes autoneg on ich9. From Jonathan Perkin
* A missing part of an if statement meant we were writing outjsg2011-10-191-8/+8
| | | | | | | | garbage when changing snoop related registers on pch2. Rework the code to remove the duplication and hopefully make this sort of thing less likely in future. Found and debugged by pedro. ok markus@
* Add the remaining parts of support for 82580 based devices such asjsg2011-10-051-47/+63
| | | | | | | | | the Intel I340-T4 and HP NC365T and simplify some of the multi port handling while here. Thanks to fredrik danerklint for donating a card, Linden Varley for setting up a test system and everyone who made sure this didn't break their existing em setups.
* remove workaround found in FreeBSD driver but not in Intel's officialdhill2011-05-021-15/+1
| | | | | | | | | driver. Fixes 82578DC from only being able to negotiate at 10baseT. ok jsg@ please commit mikeb@
* Add a workaround for an 82579 hardware bug that can result injsg2011-05-021-1/+36
| | | | | | lost rx packets between the mac and phy. From Laurence Tratt
* Add support for PCH2 (Sandy Bridge) MAC with 82579 PHY.jsg2011-04-221-47/+166
| | | | | | From Laurence Tratt. ok claudio@ deraadt@
* the mechanical part of 82580 support, more to comejsg2011-04-141-3/+57
| | | | ok claudio@
* The backplane version of the 82575EB has no link state -- it's alwayswilliam2011-04-041-6/+24
| | | | | | up. From FreeBSD. ok jsg claudio