aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/e1000e/ethtool.c
AgeCommit message (Collapse)AuthorFilesLines
2013-09-13e1000e: fix overrun of PHY RAR arrayDavid Ertman1-0/+8
When copying the MAC RAR registers to PHY there is an error in the calculation of the rar_entry_count, which causes a write of unknown/ undefined register space in the MAC to unknown/undefined register space in the PHY. This patch fixes the overrun with writing to the PHY RAR and also fixes the ethtool offline register tests so that the correctly addressed registers have the appropriate bitmasks for R/W and RO bits for affected parts. Shawn Rader gets credit for finding and fixing the register overrun. Signed-off-by: Dave Ertman <[email protected]> CC: Shawn Rader <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-08-22e1000e: resolve checkpatch JIFFIES_COMPARISON warningBruce Allan1-1/+1
WARNING:JIFFIES_COMPARISON: Comparing jiffies is almost always wrong; prefer time_after, time_before and friends Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-07-28e1000e: ethtool unnecessarily takes device out of RPM suspendBruce Allan1-28/+77
A previous patch (commit e60b22c5b7 e1000e: fix accessing to suspended device) added .begin and .complete ethtool driver callbacks so that the device was resumed from Runtime Power Management (RPM) suspend state for all ethtool operations. This is overkill for operations which do not need to access any registers in the device. This patch makes it so that the device is taken out of RPM suspend only for those ethtool operations that must access device registers. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-05-21e1000e: cleanup whitespaceBruce Allan1-17/+17
Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-28e1000e: EEE capability advertisement not set/disabled as requiredBruce Allan1-44/+19
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 <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-12Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-0/+13
Conflicts: drivers/net/ethernet/intel/e1000e/netdev.c Minor conflict in e1000e, a line that got fixed in 'net' has been removed in 'net-next'. Signed-off-by: David S. Miller <[email protected]>
2013-03-08e1000e: cleanup - move defines to appropriate header fileBruce Allan1-4/+2
Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-08e1000e: cleanup USLEEP_RANGE checkpatch checksBruce Allan1-5/+5
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 <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-08e1000e: cleanup unnecessary line breaksBruce Allan1-8/+4
Cuddle broken lines where appropriate. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-08e1000e: cleanup formatting of static structsBruce Allan1-1/+2
Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-08e1000e: cleanup unusually placed commentsBruce Allan1-6/+9
Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-08e1000e: cleanup (add/remove) blank lines where appropriateBruce Allan1-0/+2
Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-08e1000e: cleanup SPACING checkpatch checksBruce Allan1-8/+8
CHECK:SPACING: No space is necessary after a cast CHECK:SPACING: space prohibited before semicolon Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-08e1000e: cleanup PARENTHESIS_ALIGNMENT checkpatch checksBruce Allan1-31/+40
CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-08e1000e: cleanup LONG_LINE checkpatch warningsBruce Allan1-1/+2
WARNING:LONG_LINE: line over 80 characters Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-08e1000e: cleanup SPACING checkpatch errors and warningsBruce Allan1-1/+1
ERROR:SPACING: spaces prohibited around that ':' (ctx:WxV) ERROR:SPACING: need consistent spacing around '-' (ctx:WxV) ERROR:SPACING: space required after that ',' (ctx:VxV) ERROR:SPACING: spaces required around that '=' (ctx:VxV) WARNING:SPACING: missing space after enum definition and some similar spacing issues not reported by checkpatch. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-08e1000e: cleanup CODE_INDENT checkpatch errorsBruce Allan1-20/+17
ERROR:CODE_INDENT: code indent should use tabs where possible Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-03-07e1000e: fix accessing to suspended deviceKonstantin Khlebnikov1-0/+13
This patch fixes some annoying messages like 'Error reading PHY register' and 'Hardware Erorr' and saves several seconds on reboot. Cc: Bruce Allan <[email protected]> Signed-off-by: Konstantin Khlebnikov <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Tested-by: Borislav Petkov <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-02-05e1000e: cleanup checkpatch braces checksBruce Allan1-3/+2
Resolve the following strict checkpatch checks: CHECK:BRACES: Blank lines aren't necessary after an open brace '{' CHECK:BRACES: Blank lines aren't necessary before a close brace '}' CHECK:BRACES: braces {} should be used on all arms of this statement Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-02-04e1000e: cosmetic move of #defines and function prototypes to the new phy.hBruce Allan1-1/+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 <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-31e1000e: use generic IEEE MII definitionsBruce Allan1-12/+12
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 <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-31e1000e: resolve -Wunused-parameter compile warningsBruce Allan1-7/+9
Remove the unused parameter when possible, otherwise use __always_unused attribute. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-27e1000e: cleanup: remove e1000e_commit_phy()Bruce Allan1-2/+3
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 <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-27e1000e: cleanup: do not assign a variable a value when not necessaryBruce Allan1-1/+1
Static analysis with cppcheck has shown a few instances of a variable being reassigned a value before the old one has been used. None of these ever require the old value to be used so remove the old values. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-27e1000e: update copyright dateBruce Allan1-1/+1
Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-27e1000e: enable ECC on I217/I218 to catch packet buffer memory errorsBruce Allan1-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 <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-27e1000e: add support for IEEE-1588 PTPBruce Allan1-0/+12
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 <[email protected]> Cc: Richard Cochran <[email protected]> Signed-off-by: Bruce Allan <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Acked-by: Richard Cochran <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-27e1000e: fix ethtool offline register test for I217Bruce Allan1-8/+17
The SHRAH[9] register on I217 has a different R/W bit-mask than RAR and SHRAL/H registers. Set R/W bit-mask appropriately for SHRAH[9] when testing the R/W ability of the register. Also, fix the error message log format so that it does not provide misleading information (i.e. the logged register address could be incorrect). Signed-off-by: Bruce Allan <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-18e1000e: add support for hardware timestamping on some devicesBruce Allan1-1/+24
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 <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-18e1000e: add ethtool .get_eee/.set_eeeBruce Allan1-0/+134
Add the ability to query and set Energy Efficient Ethernet parameters via ethtool for applicable devices. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2013-01-16e1000e: cleanup redundant statistics counterBruce Allan1-1/+0
rx_long_byte_count can be removed since it is duplicated in rx_bytes Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-12-01e1000e: cosmetic cleanup of commentsBruce Allan1-45/+24
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 <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-08-30e1000e: cleanup strict checkpatch checkBruce Allan1-1/+2
CHECK: multiple assignments should be avoided Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-08-21e1000e: implement MDI/MDI-X controlJesse Brandeburg1-2/+39
Some users report issues with link failing when connected to certain switches. This gives the user the ability to control the MDI state from the driver, allowing users to work around some improperly behaving switches. Forcing in this driver is for now only allowed when auto-neg is enabled. This is in regards to the related ethtool app patch and bugzilla.kernel.org bug 11998 Signed-off-by: Jesse Brandeburg <[email protected]> CC: [email protected] CC: [email protected] CC: [email protected] CC: [email protected] Tested-by: Aaron Brown [email protected] Signed-off-by: Jeff Kirsher <[email protected]>
2012-07-22e1000e: advertise transmit time stampingRichard Cochran1-0/+1
This driver now offers software transmit time stamping, so it should advertise that fact via ethtool. Compile tested only. Signed-off-by: Richard Cochran <[email protected]> Cc: Willem de Bruijn <[email protected]> Cc: Jeff Kirsher <[email protected]> Cc: [email protected] Signed-off-by: David S. Miller <[email protected]>
2012-07-14e1000e: Program the correct register for ITR when using MSI-X.Matthew Vick1-3/+2
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 <[email protected]> Acked-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-06-05e1000e: test for valid check_reset_block function pointerBruce Allan1-2/+4
commit 44abd5c12767a8c567dc4e45fd9aec3b13ca85e0 introduced NULL pointer dereferences when attempting to access the check_reset_block function pointer on 8257x and 80003es2lan non-copper devices. This fix should be applied back through 3.4. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-05-04e1000e: initial support for i217Bruce Allan1-2/+15
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 <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-04-14e1000e: cleanup remaining strings split across multiple linesBruce Allan1-11/+8
Now that split strings generate checkpatch warnings (per Chapter 2 of Documentation/CodingStyle to make it easier to grep the code for the string) cleanup the remaining instances of them in the driver. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-04-04e1000e: cleanup indexed register arraysBruce Allan1-26/+26
Some Rx and Tx specific registers are arrays indexed by the queue number. For clarity, specify the intended queue rather than obscuring it behind a define. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-02-24e1000e: cleanup use of check_reset_block function pointerBruce Allan1-2/+4
Replace e1000_check_reset_block() inline function with calls to the PHY ops check_reset_block function pointer. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-02-10e1000e: remove unnecessary parenthesesBruce Allan1-2/+2
Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-02-07e1000e: fix sparse warnings with -D__CHECK_ENDIAN__Bruce Allan1-1/+1
Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-02-07e1000e: cleanup e1000_set_phys_idBruce Allan1-2/+2
Use the existing hw pointer. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-02-07e1000e: cleanup - check return values consistentlyBruce Allan1-1/+1
The majority of the e1000e code checks most function return values using a test like 'if (ret_val)' or 'if (!ret_val)' but there are a few instances of 'if (ret_val == 0)'. This patch converts the latter to the former for consistency. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-01-26e1000e: update copyright yearBruce Allan1-1/+1
Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-01-26e1000e: Need to include vmalloc.hDavid S. Miller1-0/+1
Otherwise (on sparc64): drivers/net/ethernet/intel/e1000e/ethtool.c:657:3: error: implicit declaration of function 'vmalloc' [-Werror=implicit-function-declaration] Signed-off-by: David S. Miller <[email protected]>
2012-01-25e1000e: re-factor ethtool get/set ring parameterBruce Allan1-59/+77
Make it more like how igb does it, with some additional error checking. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-01-25e1000e: pass pointer to ring struct instead of adapter structBruce Allan1-5/+5
For ring-specific functions, pass a pointer to the ring struct instead of a pointer to the adapter struct. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
2012-01-25e1000e: add Receive Packet Steering (RPS) supportBruce Allan1-0/+48
Enable RPS by default. Disallow jumbo frames when both receive checksum and receive hashing are enabled because the hardware cannot do both IP payload checksum (enabled when receive checksum is enabled when using packet split which is used for jumbo frames) and provide RSS hash at the same time. v2: added ethtool command to query flow hashing behavior per Ben Hutchings and changed the type of rsskey to cleanup the setting of the register array and avoid unnecessary casts (as pointed out by Joe Perches). The long error messages are not changed since there is nothing in the kernel ./Documentation that suggests the preferred method for dealing with long messages other than to never break strings; leaving them as-is for now. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Jeff Pieper <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>