From: jeffrey.t.kirsher@intel.com
To: davem@davemloft.net
To: davem@davemloft.net
Cc: Bruce Allan <bruce.w.allan@intel.com>,
netdev@vger.kernel.org, gosp@redhat.com, bphilips@novell.com,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 04/12] e1000e: use either_crc_le() rather than re-write it
Date: Thu, 6 Jan 2011 16:29:51 -0800 [thread overview]
Message-ID: <1294360199-9860-5-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1294360199-9860-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Bruce Allan <bruce.w.allan@intel.com>
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>
---
drivers/net/e1000e/e1000.h | 1 +
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 2c913b8..4b3802a 100644
--- a/drivers/net/e1000e/e1000.h
+++ b/drivers/net/e1000e/e1000.h
@@ -38,6 +38,7 @@
#include <linux/netdevice.h>
#include <linux/pci.h>
#include <linux/pci-aspm.h>
+#include <linux/crc32.h>
#include "hw.h"
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index 902e493..5328a292 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)
}
}
-static u32 e1000_calc_rx_da_crc(u8 mac[])
-{
- u32 poly = 0xEDB88320; /* Polynomial for 802.3 CRC calculation */
- u32 i, j, mask, crc;
-
- crc = 0xffffffff;
- for (i = 0; i < 6; i++) {
- crc = crc ^ mac[i];
- for (j = 8; j > 0; j--) {
- mask = (crc & 1) * (-1);
- crc = (crc >> 1) ^ (poly & mask);
- }
- }
- return ~crc;
-}
-
/**
* e1000_lv_jumbo_workaround_ich8lan - required for jumbo frame operation
* with 82579 PHY
@@ -1453,8 +1437,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
mac_addr[4] = (addr_high & 0xFF);
mac_addr[5] = ((addr_high >> 8) & 0xFF);
- ew32(PCH_RAICC(i),
- e1000_calc_rx_da_crc(mac_addr));
+ ew32(PCH_RAICC(i), ~ether_crc_le(ETH_ALEN, mac_addr));
}
/* Write Rx addresses to the PHY */
--
1.7.3.4
next prev parent reply other threads:[~2011-01-07 0:30 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-07 0:29 [net-next 00/12][pull-request] Intel Wired LAN Driver Updates jeffrey.t.kirsher
2011-01-07 0:29 ` [net-next 01/12] e1000e: cleanup variables set but not used jeffrey.t.kirsher
2011-01-07 0:29 ` [net-next 02/12] e1000e: convert calls of ops.[read|write]_reg to e1e_[r|w]phy jeffrey.t.kirsher
2011-01-07 0:29 ` [net-next 03/12] e1000e: properly bounds-check string functions jeffrey.t.kirsher
2011-01-07 0:48 ` Ben Hutchings
2011-01-07 0:29 ` jeffrey.t.kirsher [this message]
2011-01-07 0:29 ` [net-next 05/12] e1000e: power off PHY after reset when interface is down jeffrey.t.kirsher
2011-01-07 0:29 ` [net-next 06/12] e1000e: add custom set_d[0|3]_lplu_state function pointer for 82574 jeffrey.t.kirsher
2011-01-07 0:29 ` [net-next 07/12] e1000: Add support for the CE4100 reference platform jeffrey.t.kirsher
2011-01-10 12:44 ` Florian Fainelli
2011-01-07 0:29 ` [net-next 08/12] ixgb: convert to new VLAN model jeffrey.t.kirsher
2011-01-07 15:41 ` Jesse Gross
2011-01-07 19:30 ` Tantilov, Emil S
2011-01-24 0:25 ` Tantilov, Emil S
2011-01-25 17:22 ` Jesse Gross
2011-01-25 18:20 ` Tantilov, Emil S
2011-01-27 3:53 ` Jesse Gross
2011-01-27 4:18 ` Ben Hutchings
2011-03-08 1:31 ` Jesse Gross
2011-03-08 2:30 ` Jeff Kirsher
2011-01-07 0:29 ` [net-next 09/12] ixgbe: make sure per Rx queue is disabled before unmapping the receive buffer jeffrey.t.kirsher
2011-01-07 0:29 ` [net-next 10/12] ixgbe: cleanup flow director hash computation to improve performance jeffrey.t.kirsher
2011-01-07 0:29 ` [net-next 11/12] ixgbe: further flow director performance optimizations jeffrey.t.kirsher
2011-01-07 0:29 ` [net-next 12/12] ixgbe: update ntuple filter configuration jeffrey.t.kirsher
2011-01-07 1:02 ` Ben Hutchings
2011-01-07 4:12 ` Alexander Duyck
2011-01-07 0:37 ` [net-next 00/12][pull-request] Intel Wired LAN Driver Updates Jeff Kirsher
2011-01-10 7:45 ` David Miller
2011-01-07 21:15 ` [rfc] Creating drivers/net/ethernet Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1294360199-9860-5-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=bphilips@novell.com \
--cc=bruce.w.allan@intel.com \
--cc=davem@davemloft.net \
--cc=gosp@redhat.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).