summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/e1000e/e1000.h
Commit message (Collapse)AuthorAgeFilesLines
* e1000e: Use marco instead of digit for defining e1000_rx_desc_packet_splitWei Yang2013-07-281-3/+0
| | | | | | | | | | | | | In structure e1000_rx_desc_packet_split, the size of wb.upper.length is defined by a digit. This may introduce some problem when the length is changed. This patch use the macro PS_PAGE_BUFFERS for the definition. And move the definition to hw.h. Signed-off-by: Wei Yang <weiyang@linux.vnet.ibm.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: fix scheduling while atomic bugBruce Allan2013-05-071-1/+1
| | | | | | | | | | | | | A scheduling while atomic bug was introduced recently (by commit ce43a2168c59: "e1000e: cleanup USLEEP_RANGE checkpatch checks"). Revert the particular instance of usleep_range() which causes the bug. Reported-by: Maarten Lankhorst <m.b.lankhorst@gmail.com> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* e1000e: EEE capability advertisement not set/disabled as requiredBruce Allan2013-03-281-0/+3
| | | | | | | | | | | | | | | Devices supported by the driver which support EEE (currently 82579, I217 and I218) are advertising EEE capabilities during auto-negotiation even when EEE has been disabled. In addition to not acting as expected, this also caused the EEE status reported by 'ethtool --show-eee' to be wrong when two of these devices are connected back-to-back and EEE is disabled on one. In addition to fixing this issue, the ability for the user to specify which speeds (100 or 1000 full-duplex) to advertise EEE support has been added. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cleanup USLEEP_RANGE checkpatch checksBruce Allan2013-03-081-1/+1
| | | | | | | | | | | | | Resolve strict checkpatch USLEEP_RANGE checks by converting delays and sleeps as described in ./Documentation/timers/timers-howto.txt. Three other violations of the text have also been fixed. CHECK:USLEEP_RANGE: usleep_range is preferred over udelay; see Documentation/timers/timers-howto.txt Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cleanup unusually placed commentsBruce Allan2013-03-081-3/+2
| | | | | | Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cleanup (add/remove) blank lines where appropriateBruce Allan2013-03-081-1/+0
| | | | | | Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cleanup LEADING_SPACE checkpatch warningsBruce Allan2013-03-081-2/+2
| | | | | | | | WARNING:LEADING_SPACE: please, no spaces at the start of a line Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cleanup LONG_LINE checkpatch warningsBruce Allan2013-03-081-2/+4
| | | | | | | | WARNING:LONG_LINE: line over 80 characters Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cosmetic move of #defines and prototypes to the new manage.hBruce Allan2013-02-051-6/+0
| | | | | | | | | | | | | Move #defines, function prototypes and data types which are applicable to all/most devices supported by the driver but are specific to the manageability component of each device to the new manage.h header file. These #defines, function prototypes and data types can be used by other files in the driver and moving them to the manageability-specific file makes it clearer to which component they are applicable. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cosmetic move of #defines and function prototypes to the new nvm.hBruce Allan2013-02-051-12/+0
| | | | | | | | | | | | Move #defines and function prototypes which are applicable to all/most devices supported by the driver and are specific to the NVM component of each device to the new nvm.h header file. These #defines and function prototypes can be used by other files in the driver and moving them to the NVM-specific file makes it clearer to which component they are applicable. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cosmetic move of #defines and function prototypes to the new phy.hBruce Allan2013-02-041-95/+0
| | | | | | | | | | | | Move #defines and function prototypes which are applicable to all/most devices supported by the driver and are specific to the PHY component of each device to the new phy.h header file. These function prototypes can be used by other files in the driver and moving them to the PHY-specific file makes it clearer to which component they are applicable. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cosmetic move of function prototypes to the new mac.hBruce Allan2013-02-041-37/+0
| | | | | | | | | | | | Move prototypes for functions which are applicable to all/most devices supported by the driver and are specific to the MAC component of each device to the new mac.h header file. These function prototypes can be used by other files in the driver and moving them to the MAC-specific file makes it clearer to which component they are applicable. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cosmetic move of #defines and prototypes to the new ich8lan.hBruce Allan2013-02-041-53/+0
| | | | | | | | | | | | | | | Move #defines and function prototypes specific to the ICH/PCH family of devices (ICH8/82562, ICH8/82566, ICH8/82567, ICH9/82562, ICH9/82566, ICH9/82567, ICH10/82567, 82577, 82578, 82579, I217, I218) to the new ich8lan.h header file (the convention for Intel wired ethernet drivers is to use the name of the first device in the family for related file and function names). These defines and function prototypes can be used by other files in the driver and moving them to the ICH/PCH-family-specific file makes it clearer to which devices they are applicable. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cosmetic move of #defines and prototypes to the new 82571.hBruce Allan2013-02-041-4/+0
| | | | | | | | | | | | | | Move #defines and function prototypes specific to the 8257x family of devices (82571, 82572, 82573, 82574, 82583) to the new 82571.h header file (the convention for Intel wired ethernet drivers is to use the name of the first device in the family for related file and function names). These defines and function prototypes can be used by other files in the driver and moving them to the 8257x-family-specific file makes it clearer to which devices they are applicable. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: use generic IEEE MII definitionsBruce Allan2013-01-311-0/+1
| | | | | | | | | | | | | | | | | For standard IEEE MII-compatible transceivers, the kernel has generic register and bit definitions. Use those instead of redundant local defines. Do not replace references of MII_CR_SPEED_10 with BMCR_SPEED10 (0x0000) when it is not necessary (i.e. when it is bitwise OR'ed with another value). Some whitespace issues in the surrounding context of the above changes are also cleaned up. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cleanup: remove unused #defineBruce Allan2013-01-271-3/+0
| | | | | | | | All references to E1000_ERT_2048 have been removed. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cleanup: remove e1000e_commit_phy()Bruce Allan2013-01-271-2/+0
| | | | | | | | | | | | | | Remove the function e1000e_commit_phy() and replace the few calls to it with the same function pointer that it would call. The function pointer is almost always set for the devices that access these code paths so there is no risk of a NULL pointer dereference; for the few instances where the function pointer might not be set (i.e. can be called for the few devices which do not have this function pointer set), check for a valid function pointer. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cleanup: remove e1000_get_cable_length()Bruce Allan2013-01-271-5/+0
| | | | | | | | | Remove the function e1000_get_cable_length() and replace the two calls to it with the same function pointer that it would call. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cleanup: rename e1000_get_cfg_done()Bruce Allan2013-01-271-1/+1
| | | | | | | | | | In keeping with the e1000e driver function naming convention, the subject function is renamed to indicate it is generic, i.e. it is applicable to more than just a single MAC family (e.g. 80003es2lan, 82571, ich8lan). Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: add comment to spinlock_t definitionBruce Allan2013-01-271-1/+1
| | | | | | Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: update copyright dateBruce Allan2013-01-271-1/+1
| | | | | | Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: remove prototype of non-existent functionBruce Allan2013-01-271-2/+0
| | | | | | Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: enable ECC on I217/I218 to catch packet buffer memory errorsBruce Allan2013-01-271-0/+2
| | | | | | | | | | | | | | | | | | | In rare instances, memory errors have been detected in the internal packet buffer memory on I217/I218 when stressed under certain environmental conditions. Enable Error Correcting Code (ECC) in hardware to catch both correctable and uncorrectable errors. Correctable errors will be handled by the hardware. Uncorrectable errors in the packet buffer will cause the packet to be received with an error indication in the buffer descriptor causing the packet to be discarded. If the uncorrectable error is in the descriptor itself, the hardware will stop and interrupt the driver indicating the error. The driver will then reset the hardware in order to clear the error and restart. Both types of errors will be accounted for in statistics counters. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: add support for IEEE-1588 PTPBruce Allan2013-01-271-1/+8
| | | | | | | | | | | | | | Add PTP IEEE-1588 support and make accesible via the PHC subsystem. v2: make e1000e_ptp_clock_info a static const struct per Stephen Hemminger Cc: Stephen Hemminger <stephen@networkplumber.org> Cc: Richard Cochran <richardcochran@gmail.com> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Reviewed-by: Jacob Keller <Jacob.e.keller@intel.com> Acked-by: Richard Cochran <richardcochran@gmail.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: add support for hardware timestamping on some devicesBruce Allan2013-01-181-1/+45
| | | | | | | | | | | | On 82574, 82583, 82579, I217 and I218 add support for hardware time stamping of all or no Rx packets and Tx packets which have the SKBTX_HW_TSTAMP flag set. Update the .get_ts_info ethtool operation to report the supported time stamping modes, and enable and disable hardware time stamping with the SIOCSHWTSTAMP ioctl. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: add ethtool .get_eee/.set_eeeBruce Allan2013-01-181-0/+1
| | | | | | | | | Add the ability to query and set Energy Efficient Ethernet parameters via ethtool for applicable devices. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: unexpected "Reset adapter" message when cable pulledBruce Allan2013-01-151-1/+1
| | | | | | | | | | | | | | | | | When there is heavy traffic and the cable is pulled, the driver must reset the adapter to flush the Tx queue in hardware. This causes the reset path to be scheduled and logs the message "Reset adapter" which could be mis- interpreted as an error by the user. Change how the reset path is invoked for this scenario by using the same method done in an existing work-around for 80003es2lan (i.e. set a flag and if the flag is set in the reset code do not log the "Reset adapter" message since the reset is expected). Re-name the FLAG_RX_RESTART_NOW to FLAG_RESTART_NOW since it is used for resets in both the Rx and Tx specific code. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cosmetic cleanup of commentsBruce Allan2012-12-011-12/+5
| | | | | | | | | | Update comments to conform to the preferred style for networking code as described in ./Documentation/CodingStyle and checked for in the recently added checkpatch NETWORKING_BLOCK_COMMENT_STYLE test. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: Change wthresh to 1 to avoid possible Tx stallsHiroaki SHIMODA2012-10-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch originated from Hiroaki SHIMODA but has been modified by Intel with some minor cleanups and additional commit log text. Denys Fedoryshchenko and others reported Tx stalls on e1000e with BQL enabled. Issue was root caused to hardware delays. They were introduced because some of the e1000e hardware with transmit writeback bursting enabled, waits until the driver does an explict flush OR there are WTHRESH descriptors to write back. Sometimes the delays in question were on the order of seconds, causing visible lag for ssh sessions and unacceptable tx completion latency, especially for BQL enabled kernels. To avoid possible Tx stalls, change WTHRESH back to 1. The current plan is to investigate a method for re-enabling WTHRESH while not harming BQL, but those patches will be later for net-next if they work. please enqueue for stable since v3.3 as this bug was introduced in commit 3f0cfa3bc11e7f00c9994e0f469cbc0e7da7b00c Author: Tom Herbert <therbert@google.com> Date: Mon Nov 28 16:33:16 2011 +0000 e1000e: Support for byte queue limits Changes to e1000e to use byte queue limits. Reported-by: Denys Fedoryshchenko <denys@visp.net.lb> Tested-by: Denys Fedoryshchenko <denys@visp.net.lb> Signed-off-by: Hiroaki SHIMODA <shimoda.hiroaki@gmail.com> CC: eric.dumazet@gmail.com CC: therbert@google.com Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* e1000e: DoS while TSO enabled caused by link partner with small MSSBruce Allan2012-08-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With a low enough MSS on the link partner and TSO enabled locally, the networking stack can periodically send a very large (e.g. 64KB) TCP message for which the driver will attempt to use more Tx descriptors than are available by default in the Tx ring. This is due to a workaround in the code that imposes a limit of only 4 MSS-sized segments per descriptor which appears to be a carry-over from the older e1000 driver and may be applicable only to some older PCI or PCIx parts which are not supported in e1000e. When the driver gets a message that is too large to fit across the configured number of Tx descriptors, it stops the upper stack from queueing any more and gets stuck in this state. After a timeout, the upper stack assumes the adapter is hung and calls the driver to reset it. Remove the unnecessary limitation of using up to only 4 MSS-sized segments per Tx descriptor, and put in a hard failure test to catch when attempting to check for message sizes larger than would fit in the whole Tx ring. Refactor the remaining logic that limits the size of data per Tx descriptor from a seemingly arbitrary 8KB to a limit based on the dynamic size of the Tx packet buffer as described in the hardware specification. Also, fix the logic in the check for space in the Tx ring for the next largest possible packet after the current one has been successfully queued for transmit, and use the appropriate defines for default ring sizes in e1000_probe instead of magic values. This issue goes back to the introduction of e1000e in 2.6.24 when it was split off from e1000. Reported-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Cc: Stable <stable@vger.kernel.org> [2.6.24+] Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* e1000e: Program the correct register for ITR when using MSI-X.Matthew Vick2012-07-141-0/+1
| | | | | | | | | | | | | | When configuring interrupt throttling on 82574 in MSI-X mode, we need to be programming the EITR registers instead of the ITR register. -rc2: Renamed e1000_write_itr() to e1000e_write_itr(), fixed whitespace issues, and removed unnecessary !! operation. -rc3: Reduced the scope of the loop variable in e1000e_write_itr(). Signed-off-by: Matthew Vick <matthew.vick@intel.com> Acked-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: initial support for i217Bruce Allan2012-05-041-0/+2
| | | | | | | | | | i217 is the next-generation LOM that will be available on systems with the Lynx Point Platform Controller Hub (PCH) chipset from Intel. This patch provides the initial support for the device. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cleanup long [read|write]_reg_locked PHY ops function pointersBruce Allan2012-05-031-0/+10
| | | | | | | | | | Calling the locked versions of the read/write PHY ops function pointers often produces excessively long lines. Shorten these as is done with the non-locked versions of the PHY register read/write functions. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: fix .ndo_set_rx_mode for 82579Bruce Allan2012-05-021-1/+1
| | | | | | | | | | | | | | | | | | Secondary unicast and multicast addresses are added to the Receive Address registers (RAR) for most parts supported by the driver. For 82579, there is only one actual RAR and a number of Shared Receive Address registers (SHRAR) that are shared among the driver and f/w which can be reserved and write-protected by the f/w. On this device, use the SHRARs that are not taken by f/w for the additional addresses. Add a MAC ops function pointer infrastructure (similar to other MAC operations in the driver) for setting RARs, introduce a new rar_set function for 82579 and convert the existing code that sets RARs on other devices to a generic rar_set function. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: 82579 potential system hang on stress when ME enabledBruce Allan2012-04-271-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a workaround was added to address a hardware bug in the PCIm2PCI arbiter where a write by the driver of the Transmit/Receive Descriptor Tail register could happen concurrently with a write of any MAC CSR register by the Manageability Engine (ME) which could cause the Tail register to have an incorrect value. The arbiter is supposed to prevent the concurrent writes but there is a bug that can cause the Host (driver) access to be acknowledged later than it should. After further investigation, it was discovered that a driver write access of any MAC CSR register after being idle for some time can be lost when ME is accessing a MAC CSR register. When this happens, no further target access is claimed by the MAC which could hang the system. The workaround to check bit 24 in the FWSM register (set only when ME is accessing a MAC CSR register) and delay for a limited amount of time until it is cleared is now done for all driver writes of MAC CSR registers on 82579 with ME enabled. In the rare case when the driver is writing the Tail register and ME is accessing any MAC CSR register for a duration longer than the maximum delay, write the register and verify it has the correct value before continuing, otherwise reset the device. This patch also moves some pre-existing macros from the hardware-specific header file to the more appropriate generic driver header file. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: prevent oops when adapter is being closed and reset simultaneouslyBruce Allan2012-04-031-0/+6
| | | | | | | | | | When the adapter is closed while it is simultaneously going through a reset, it can cause a null-pointer dereference when the two different code paths simultaneously cleanup up the Tx/Rx resources. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: rename e1000e_reload_nvm() and call as function pointerBruce Allan2012-02-241-1/+1
| | | | | | | | | | Rename e1000e_reload_nvm() to e1000e_reload_nvm_generic() to signify the function is used for more than one MAC-family type, and set and use it as a MAC ops function pointer to be consistent with the driver design. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: rename e1000e_config_collision_dist() and call as function pointerBruce Allan2012-02-241-1/+1
| | | | | | | | | | | Rename e1000e_config_collision_dist() to e1000e_config_collision_dist_generic() to signify the function is used for more than one MAC-family type, and set and use it as a MAC ops function pointer to be consistent with the driver design. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cleanup use of check_reset_block function pointerBruce Allan2012-02-241-5/+0
| | | | | | | | | Replace e1000_check_reset_block() inline function with calls to the PHY ops check_reset_block function pointer. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cleanup use of check_mng_mode function pointerBruce Allan2012-02-241-5/+0
| | | | | | | | | Replace e1000_check_mng_mode() inline function with calls to the MAC ops check_mng_mode function pointer. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cleanup: rename e1000e_setup_link() and call as function pointerBruce Allan2012-02-241-1/+1
| | | | | | | | | | | | Rename e1000e_setup_link() to e1000e_setup_link_generic() to signify the function is used for more than one MAC-family type. The 82571-family has a custom setup_link function which also calls the generic function. The ich8lan-family has a custom function which should just be called via the function pointer. The 80003es2lan-family just uses the generic function. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: cleanup: rename e1000e_id_led_init() and call as function pointerBruce Allan2012-02-241-1/+1
| | | | | | | | | | | | | Rename e1000e_id_led_init() to e1000e_id_led_init_generic() to signify the function is used for more than one MAC-family type. For the ich8lan MAC family, some MACs use the generic function and others use the function e1000_id_led_init_pchlan(). In all cases where e1000e_id_led_init() was called directly, change to call the function pointer to be consistent with the driver design. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: Support RXFCS feature flag.Ben Greear2012-02-241-0/+1
| | | | | | | | | | | | | | This enables enabling/disabling reception of the Ethernet FCS. This can be useful when sniffing packets. For e1000e, enabling RXFCS can change the default behaviour for how the NIC handles CRC. Disabling RXFCS will take the NIC back to defaults, which can be configured as part of the module options. Signed-off-by: Ben Greear <greearb@candelatech.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: update copyright yearBruce Allan2012-01-261-1/+1
| | | | | | Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: disable Early Receive DMA on ICH LOMsBruce Allan2012-01-261-1/+1
| | | | | | | | | | | | Internal stress testing with jumbo frames shows the reliability of ICH9 and ICH10D devices is improved in certain corner cases by disabling the Early Receive feature. To reduce the performance impact caused by disabling this feature, the packet buffer sizes and relevant flow control settings are modified accordingly. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: use default settings for Tx Inter Packet Gap timerBruce Allan2012-01-251-1/+1
| | | | | | | | | | | | | | | | Use the default hardware values for TIPG except for 80003es2lan(*). The code that is removed in this patch is either unnecessarily writing the TIPG register with the hardware default values for some devices (82571/2/3/4) or writing the wrong value for others (ICH/PCH LOMs). The only change in functionality is setting the correct default TIPG for the latter devices. (*) The correct value for 80003es2lan is already set properly in e1000_init_hw_80003es2lan() and e1000_cfg_kmrn_{10_100|1000}_80003es2lan(), and the unused flag FLAG_TIPG_MEDIUM_FOR_80003ESLAN is removed. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: pass pointer to ring struct instead of adapter structBruce Allan2012-01-251-9/+12
| | | | | | | | | For ring-specific functions, pass a pointer to the ring struct instead of a pointer to the adapter struct. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: convert head, tail and itr_register offsets to __iomem pointersBruce Allan2012-01-251-3/+3
| | | | | | | | | | | | | The Tx/Rx head and tail registers and itr_register are always at known addresses based on the __iomem address at which the PCI region (from BAR 0) is mapped and known offsets within the region for each of these registers. Store and use the full address rather than just the region offset to reduce unnecessary address calculations. Also, change current u8 __iomem pointers to void __iomem pointers. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: Avoid wrong check on TX hangJeff Kirsher2011-12-051-0/+1
| | | | | | | | | | | | | | | | | Based on the original patch submitted my Michael Wang <wangyun@linux.vnet.ibm.com>. Descriptors may not be write-back while checking TX hang with flag FLAG2_DMA_BURST on. So when we detect hang, we just flush the descriptor and detect again for once. -v2 change 1 to true and 0 to false and remove extra () CC: Michael Wang <wangyun@linux.vnet.ibm.com> CC: Flavio Leitner <fbl@redhat.com> Acked-by: Jesse Brandeburg <jesse.brandeburg@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
* e1000e: locking bug introduced by commit 67fd4fcbBruce Allan2011-10-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 67fd4fcb (e1000e: convert to stats64) added the ability to update statistics more accurately and on-demand through the net_device_ops .ndo_get_stats64 hook, but introduced a locking bug on 82577/8/9 when linked at half-duplex (seen on kernels with CONFIG_DEBUG_ATOMIC_SLEEP=y and CONFIG_PROVE_LOCKING=y). The commit introduced code paths that caused a mutex to be locked in atomic contexts, e.g. an rcu_read_lock is held when irqbalance reads the stats from /sys/class/net/ethX/statistics causing the mutex to be locked to read the Phy half-duplex statistics registers. The mutex was originally introduced to prevent concurrent accesses of resources (the NVM and Phy) shared by the driver, firmware and hardware a few years back when there was an issue with the NVM getting corrupted. It was later split into two mutexes - one for the NVM and one for the Phy when it was determined the NVM, unlike the Phy, should not be protected by the software/firmware/hardware semaphore (arbitration of which is done in part with the SWFLAG bit in the EXTCNF_CTRL register). This latter semaphore should be sufficient to prevent resource contention of the Phy in the driver (i.e. the mutex for Phy accesses is not needed), but to be sure the mutex is replaced with an atomic bit flag which will warn if any contention is possible. Also add additional debug output to help determine when the sw/fw/hw semaphore is owned by the firmware or hardware. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Reported-by: Francois Romieu <romieu@fr.zoreil.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
OpenPOWER on IntegriCloud