summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/e1000e/80003es2lan.c
AgeCommit message (Collapse)AuthorFilesLines
2013-03-08e1000e: cleanup USLEEP_RANGE checkpatch checksBruce Allan1-6/+6
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>
2013-03-08e1000e: cleanup formatting of static structsBruce Allan1-1/+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>
2013-03-08e1000e: cleanup unusually placed commentsBruce Allan1-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>
2013-03-08e1000e: cleanup (add/remove) blank lines where appropriateBruce Allan1-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>
2013-03-08e1000e: cleanup PARENTHESIS_ALIGNMENT checkpatch checksBruce Allan1-22/+17
CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis 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>
2013-03-08e1000e: cleanup CODE_INDENT checkpatch errorsBruce Allan1-35/+38
ERROR:CODE_INDENT: code indent should use tabs where possible 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>
2013-02-05e1000e: cosmetic move of #defines to the new 80003es2lan.hBruce Allan1-63/+0
Move #defines specific to the ESB2/82563 family of devices to the new 80003es2lan.h header file. These defines can be used by other files in the driver and moving them to the 80003es2lan-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>
2013-02-01e1000e: use generic IEEE MII definitionsBruce Allan1-3/+3
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>
2013-02-01e1000e: cleanup some whitespace and indentation issuesBruce Allan1-11/+11
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>
2013-01-28e1000e: cleanup: remove e1000e_commit_phy()Bruce Allan1-1/+1
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>
2013-01-27e1000e: cleanup: do not assign a variable a value when not necessaryBruce Allan1-4/+4
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 <bruce.w.allan@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2013-01-27e1000e: do not ignore variables which get set a valueBruce Allan1-0/+5
Static analysis with cppcheck has shown a few instances of a variable which is assigned a value that is never used. A number of these are the return status of various driver function calls which should be passed back to the caller of the current 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>
2013-01-27e1000e: cleanup: remove unnecessary function prototypesBruce Allan1-5/+4
...and cleanup some whitespace in other prototypes. 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>
2013-01-27e1000e: update copyright dateBruce Allan1-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>
2012-12-01e1000e: cosmetic cleanup of commentsBruce Allan1-43/+23
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>
2012-05-03e1000e: Driver workaround for IPv6 Header Extension Erratum.Matthew Vick1-0/+8
Previously, IPv6 extension header parsing was disabled for all devices supported by e1000e when using packet split mode. However, as per a silicon errata, only certain devices need this restriction and will need to disable IPv6 extension header parsing for all modes. Signed-off-by: Matthew Vick <matthew.vick@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-05-02e1000e: fix .ndo_set_rx_mode for 82579Bruce Allan1-0/+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>
2012-04-27e1000e: Disable Far-End LoopBack following reset on 80003ES2LAN.Matthew Vick1-0/+8
80003ES2LAN has an errata such that far-end loopback may be activated by bit errors producing a reserved symbol. In order to disable far-end loopback quickly enough, disable it immediately following a reset. Signed-off-by: Matthew Vick <matthew.vick@intel.com> Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
2012-04-14e1000e: cleanup boolean logicBruce Allan1-3/+1
Replace occurrences of 'if (<bool expr> == <1|0>)' with 'if ([!]<bool expr>)' Replace occurrences of '<bool var> = (<non-bool expr>) ? true : false' with '<bool var> = <non-bool expr>'. Replace occurrence of '<bool var> = <non-bool expr>' with '<bool var> = !!<non-bool expr>' While the latter replacement is not really necessary, it is done here for consistency and clarity. No functional changes. 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>
2012-02-25e1000e: rename e1000e_reload_nvm() and call as function pointerBruce Allan1-0/+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>
2012-02-25e1000e: rename e1000e_config_collision_dist() and call as function pointerBruce Allan1-0/+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>
2012-02-25e1000e: cleanup use of check_mng_mode function pointerBruce Allan1-1/+1
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>
2012-02-25e1000e: cleanup: rename e1000e_setup_link() and call as function pointerBruce Allan1-2/+2
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>
2012-02-25e1000e: cleanup: rename e1000e_id_led_init() and call as function pointerBruce Allan1-2/+2
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>
2012-02-24e1000e: cosmetic comment changes to make lines less than 80 charactersBruce Allan1-2/+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>
2012-02-24e1000e: cosmetic change to boolean comparisonsBruce Allan1-2/+2
Recent discussions on LKML, kernel-janitors, linux-wireless and netdev have suggested boolean comparisons should use logical operators instead of equality comparisons with true/false. 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>
2012-02-14e1000e: cleanup goto statements to exit points without common workBruce Allan1-12/+6
Per ./Documentation/CodingStyle, goto statements are acceptable for the centralized exiting of functions when there are multiple exit points which share common work such as cleanup. When no common work is required for multiple exit points, the function should just return at these exit points instead of doing an unnecessary jump to a centralized return. This patch cleans up the inappropriate use of goto statements, and removes unnecessary variables (or move to a smaller scope) where possible as a result of the cleanups. 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>
2012-02-14e1000e: cleanup: remove unnecessary assignments just before returningBruce Allan1-7/+3
Just return the appropriate value. 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>
2012-02-14e1000e: potential incorrect return for e1000_setup_copper_link_80003es2lanBruce Allan1-3/+1
In the unlikely event that e1000e_setup_copper_link() returns an error, the returned error code value is not propogated to the caller of e1000_setup_copper_link_80003es2lan(). 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>
2012-02-14e1000e: potentially incorrect return for e1000_cfg_kmrn_10_100_80003es2lanBruce Allan1-3/+1
In the unlikely event that e1e_wphy() returns an error, the returned error code value is not propogated to the caller of e1000_cfg_kmrn_10_100_80003es2lan(). 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>
2012-02-10e1000e: pass pointer to hw struct for e1000_init_mac_params_XXX()Bruce Allan1-4/+3
The e1000_init_mac_params_XXX() functions (where XXX is one of the three MAC-family types 80003es2lan, 82571 and ich8lan) was not meant to require a pointer to the adapter struct but does require a pointer to the hw struct. Pass that pointer in to the functions instead. 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>
2012-02-07e1000e: cleanup e1000_init_mac_params_80003es2lan()Bruce Allan1-21/+7
Combine two switch statements into one, convert a nebulous pointer to one that is a bit more in keeping with the rest of the driver code and remove some dead code (there are no 80003es2lan devices with fiber). No change in functionality, just cosmetic changes. 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>
2012-01-27e1000e: update copyright yearBruce Allan1-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>
2012-01-27e1000e: concatenate long debug strings which span multiple linesBruce Allan1-2/+1
To ease searching for debug message strings, concatenate strings that span multiple lines even if the resulting line exceeds 80 columns; these will not cause checkpatch warnings. Also, add '\n' and remove unnecessary '\r' from a few debug strings. 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>
2012-01-26e1000e: use default settings for Tx Inter Packet Gap timerBruce Allan1-2/+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>
2011-10-05e1000e: make function tables constJeff Kirsher1-4/+4
The initial function and setup tables can be marked as constant. Reported-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
2011-08-27e1000e: convert to netdev features/hw_features APIBruce Allan1-1/+0
Private rx_csum flags are now duplicate of netdev->features & NETIF_F_RXCSUM. Remove those duplicates and use the net_device_ops ndo_set_features. This is based on the original patch submitted by Michał Mirosław <mirq-linux@rere.qmqm.pl> Cc: Michał Mirosław <mirq-linux@rere.qmqm.pl> 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>
2011-08-11intel: Move the Intel wired LAN driversJeff Kirsher1-0/+1516
Moves the Intel wired LAN drivers into drivers/net/ethernet/intel/ and the necessary Kconfig and Makefile changes. Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>