History log of /drivers/net/ethernet/intel/e1000e/mac.c
Revision Date Author Comments
4145ce0f59691820ea7e2c2be5d1c34aab61560e 20-Jul-2014 Fabian Frederick <fabf@skynet.be> e1000e: remove unnecessary break after return

Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: David S. Miller <davem@davemloft.net>
b3e5bf1ff32cbc58c56675498565020460c683cd 06-May-2014 David Ertman <davidx.m.ertman@intel.com> e1000e: Failure to write SHRA turns on PROMISC mode

Previously, the check to turn on promiscuous mode only took into account
the total number of SHared Receive Address (SHRA) registers and if the
request was for a register within that range. It is possible that the
Management Engine might have locked a number of SHRA and not allowed a
new address to be written to the requested register.

Add a function to determine the number of unlocked SHRA registers. Then
determine if the number of registers available is sufficient for our needs,
if not then return -ENOMEM so that UNICAST PROMISC mode is activated.

Since the method by which ME claims SHRA registers is non-deterministic,
also add a return value to the function attempting to write an address
to a SHRA, and return a -E1000_ERR_CONFIG if the write fails. The error
will be passed up the function chain and allow the driver to also set
UNICAST PROMISC when this happens.

Cc: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: Dave Ertman <davidx.m.ertman@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
e78b80b1079e1269ca57c28abda790555b546a5f 04-Feb-2014 David Ertman <davidx.m.ertman@intel.com> e1000e: Cleanup - Update GPL header and Copyright

This patch is to update the GPL header by removing the portion that
refers to the Free Software Foundation address.

Change the copyright date for 2014.

Reformat the header comments to conform to kernel networking coding norms

Signed-off-by: Dave Ertman <davidx.m.ertman@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
86a80eab8ced2454bae954b681797c692afe2ea2 06-Mar-2013 Bruce Allan <bruce.w.allan@intel.com> e1000e: fix LED blink logic for designs with LEDs driven by cathode

When the LEDs are driven by cathode, the bit logic is reversed. Use the
LED Invert bit to invert the logic. Cleanup use of a magic number and
change the for loop increment to reduce the number of shifts.

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>
ce43a2168c59bc47b5f0c1825fd5f9a2a9e3b447 20-Feb-2013 Bruce Allan <bruce.w.allan@intel.com> e1000e: cleanup USLEEP_RANGE checkpatch checks

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>
c2ade1a41d69b8b734dd9947bf7ec25bb2fd2f33 16-Jan-2013 Bruce Allan <bruce.w.allan@intel.com> e1000e: use generic IEEE MII definitions

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>
8bb628697fb05172f10a0960385b8369be15cb6c 16-Jan-2013 Bruce Allan <bruce.w.allan@intel.com> e1000e: resolve -Wunused-parameter compile warnings

Remove the unused parameter when possible, otherwise use __always_unused
attribute.

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>
55c5f55e524cec35b5931df16936118dc6c0837b 12-Jan-2013 Bruce Allan <bruce.w.allan@intel.com> e1000e: cleanup some whitespace and indentation issues

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>
70806a7fd1ae8942675bb2d415899e9e64440505 05-Jan-2013 Bruce Allan <bruce.w.allan@intel.com> e1000e: cleanup: do not assign a variable a value when not necessary

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>
bf67044bf86d9b5613cdba9d7d04deb4ea08892e 01-Jan-2013 Bruce Allan <bruce.w.allan@intel.com> e1000e: update copyright date

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>
1241f29fa3c6fa95f20e3e77452f8d6d60deae7a 05-Dec-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: SerDes autoneg flow control

Enables flow control to be set in SerDes autoneg mode. This is what is
done for copper, but relies on a different set of register/bit checks
since this is all done within the Mac registers.

Remove inapplicable comment in defines.h

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>
e921eb1ac411a32b98fa1a9ccbba1b24fae8de2d 28-Nov-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: cosmetic cleanup of comments

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>
470a54207ccf7045a59df727573bd9d148988582 26-May-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: test for valid check_reset_block function pointer

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 <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
69e1e0197ce739d86ca33fd275962d6cbd1b107a 14-Apr-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: fix .ndo_set_rx_mode for 82579

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>
04499ec4ee945dfad9f0afbdd8d6f8ba12dac6d6 13-Apr-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: cleanup boolean logic

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>
3d3a1676561cfb0dcef0cf5e146ddefbb16f5598 23-Feb-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: cleanup whitespace and indentation

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>
0d37678e16fd4db3cf74fa840e7f98a0b7d40742 22-Feb-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: cleanup - remove unnecessary variable

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>
b20caa80e8c9b0180defb42678209dc0d6c229d2 22-Feb-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: use true/false for boolean send_xon, do not assume always true

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>
b2a50e1a1d16d8e377a0c540de36803197bde3fb 22-Feb-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: cleanup comment in e1000_hash_mc_addr()

Remove reference to non-existant 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>
57cde7630c1911ea7e8e1561cccfde8096e8bcc7 22-Feb-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: rename e1000e_config_collision_dist() and call as function pointer

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>
44abd5c12767a8c567dc4e45fd9aec3b13ca85e0 22-Feb-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: cleanup use of check_reset_block function pointer

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>
1a46b40fbb1dfd698efbc7a9575aa64aed04d568 22-Feb-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: cleanup: rename e1000e_setup_link() and call as function pointer

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>
d1964eb138901286a170de8ed422efd227dd4daf 22-Feb-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: cleanup: rename e1000e_id_led_init() and call as function pointer

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>
5015e53a4cf0c88977120faede7eb02b0459d90e 08-Feb-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: cleanup goto statements to exit points without common work

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>
2a31b37a8956154df099400ba93cd6898a629c6d 08-Feb-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: potentially incorrect return for e1000e_setup_fiber_serdes_link

In the unlikely event that e1000_poll_fiber_serdes_link_generic() is called
and it returns an error, the returned error code value is not propagated to
the caller of e1000e_setup_fiber_serdes_link().

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>
826072555b0dceac44a6e69a0c5be137e829c9d4 08-Feb-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: cleanup: always return 0

These are a few instances of returning a value that can only be 0 so just
use a 'return 0' to make it more obvious.

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>
7eb61d81946ccb61726600c6e8ceefcce9844f02 08-Feb-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: cleanup: remove unnecessary assignments just before returning

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>
07914ee3ccbf93ce688f1aaba15d8b01f19c5d77 31-Jan-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: use true/false for bool autoneg_false

v2 - replaced mac->autoneg_failed == false with !mac->autoneg_failed

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>
668018d74762741c3fe5a54f0eea1bd65dcabd7e 31-Jan-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: remove unnecessary parentheses

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>
fe1e980f24697edb7d4e17cd74bbeae4a0388525 31-Jan-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: remove unnecessary returns from void functions

...and convert some goto's which simply return to just return.

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>
4bcf053baf6b255e8c82c7ecd0d15954adb0379b 31-Jan-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: remove test that is always false

warning: comparison of unsigned expression < 0 is always false

Remove an unnecessary test that is reported when compiling driver with W=1.
The test is unnecessary because Intel wired GbE hardware older (i.e. less)
than 82571 is not supported by this driver.

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>
f5e261e626eb3fe07adf484aaad2ecfc757feba3 01-Jan-2012 Bruce Allan <bruce.w.allan@intel.com> e1000e: update copyright year

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>
fe2ddfb510f9d305a6654c7538c5c8faf326a16c 21-Dec-2011 Bruce Allan <bruce.w.allan@intel.com> e1000e: split lib.c into three more-appropriate files

The generic lib.c file contains code relative to the various MACs, NVM and
Manageability supported by the driver. This patch splits the file into
three which are specific to those areas similar to how the PHY-specific
code is in phy.c and code specific to the 80003es2lan, 8257x, and ichX
MAC families are in their own files. The generic code that is applicable
to all MAC/PHY parts supported by the driver remains in netdev.c, param.c
and ethtool.c files. No change in functionality, just moving code
around for ease of maintenance, with some whitespace and other checkpatch
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>