diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2011-01-06 09:29:51 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-10 02:44:08 -0500 |
commit | fe46f58fa61f025564a3c1e80b789885cb4b0f30 (patch) | |
tree | 6ec14729d0ccb1df72b4e63574dcadec79f8e496 /drivers | |
parent | e0dc4f125456e57347a6d016bd7209f064135b1d (diff) |
e1000e: use either_crc_le() rather than re-write it
For the 82579 jumbo frame workaround, there is no need to re-write the CRC
calculation functionality already found in the kernel's ether_crc_le().
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/e1000e/e1000.h | 1 | ||||
-rw-r--r-- | drivers/net/e1000e/ich8lan.c | 19 |
2 files changed, 2 insertions, 18 deletions
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index 2c913b8e9116..4b3802ae1082 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/netdevice.h> | 38 | #include <linux/netdevice.h> |
39 | #include <linux/pci.h> | 39 | #include <linux/pci.h> |
40 | #include <linux/pci-aspm.h> | 40 | #include <linux/pci-aspm.h> |
41 | #include <linux/crc32.h> | ||
41 | 42 | ||
42 | #include "hw.h" | 43 | #include "hw.h" |
43 | 44 | ||
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c index 902e4935f3ee..5328a2927731 100644 --- a/drivers/net/e1000e/ich8lan.c +++ b/drivers/net/e1000e/ich8lan.c | |||
@@ -1395,22 +1395,6 @@ void e1000_copy_rx_addrs_to_phy_ich8lan(struct e1000_hw *hw) | |||
1395 | } | 1395 | } |
1396 | } | 1396 | } |
1397 | 1397 | ||
1398 | static u32 e1000_calc_rx_da_crc(u8 mac[]) | ||
1399 | { | ||
1400 | u32 poly = 0xEDB88320; /* Polynomial for 802.3 CRC calculation */ | ||
1401 | u32 i, j, mask, crc; | ||
1402 | |||
1403 | crc = 0xffffffff; | ||
1404 | for (i = 0; i < 6; i++) { | ||
1405 | crc = crc ^ mac[i]; | ||
1406 | for (j = 8; j > 0; j--) { | ||
1407 | mask = (crc & 1) * (-1); | ||
1408 | crc = (crc >> 1) ^ (poly & mask); | ||
1409 | } | ||
1410 | } | ||
1411 | return ~crc; | ||
1412 | } | ||
1413 | |||
1414 | /** | 1398 | /** |
1415 | * e1000_lv_jumbo_workaround_ich8lan - required for jumbo frame operation | 1399 | * e1000_lv_jumbo_workaround_ich8lan - required for jumbo frame operation |
1416 | * with 82579 PHY | 1400 | * with 82579 PHY |
@@ -1453,8 +1437,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
1453 | mac_addr[4] = (addr_high & 0xFF); | 1437 | mac_addr[4] = (addr_high & 0xFF); |
1454 | mac_addr[5] = ((addr_high >> 8) & 0xFF); | 1438 | mac_addr[5] = ((addr_high >> 8) & 0xFF); |
1455 | 1439 | ||
1456 | ew32(PCH_RAICC(i), | 1440 | ew32(PCH_RAICC(i), ~ether_crc_le(ETH_ALEN, mac_addr)); |
1457 | e1000_calc_rx_da_crc(mac_addr)); | ||
1458 | } | 1441 | } |
1459 | 1442 | ||
1460 | /* Write Rx addresses to the PHY */ | 1443 | /* Write Rx addresses to the PHY */ |