diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2006-05-01 15:37:09 +0200 |
---|---|---|
committer | Stephen Hemminger <shemminger@osdl.org> | 2006-05-08 16:00:47 -0700 |
commit | 8cd35da094bed8a41eb722c1d03eab24d57bf706 (patch) | |
tree | 1cff48eb5261048d9f6f5bf90c5f34b4fbbfd0cb /drivers/net/au1000_eth.c | |
parent | 6d4b0f617d577975108ccc7e3b0c7dbe50144df6 (diff) | |
download | lwn-8cd35da094bed8a41eb722c1d03eab24d57bf706.tar.gz lwn-8cd35da094bed8a41eb722c1d03eab24d57bf706.zip |
au1000_eth.c: use ether_crc() from <linux/crc32.h>
since the au1000 driver already selects the CRC32 routines, simply replace
the internal ether_crc() implementation with the semantically equivalent
one from <linux/crc32.h>
Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Diffstat (limited to 'drivers/net/au1000_eth.c')
-rw-r--r-- | drivers/net/au1000_eth.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index 1363083b4d83..14dbad14afb6 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c @@ -52,6 +52,7 @@ #include <linux/mii.h> #include <linux/skbuff.h> #include <linux/delay.h> +#include <linux/crc32.h> #include <asm/mipsregs.h> #include <asm/irq.h> #include <asm/io.h> @@ -2070,23 +2071,6 @@ static void au1000_tx_timeout(struct net_device *dev) netif_wake_queue(dev); } - -static unsigned const ethernet_polynomial = 0x04c11db7U; -static inline u32 ether_crc(int length, unsigned char *data) -{ - int crc = -1; - - while(--length >= 0) { - unsigned char current_octet = *data++; - int bit; - for (bit = 0; bit < 8; bit++, current_octet >>= 1) - crc = (crc << 1) ^ - ((crc < 0) ^ (current_octet & 1) ? - ethernet_polynomial : 0); - } - return crc; -} - static void set_rx_mode(struct net_device *dev) { struct au1000_private *aup = (struct au1000_private *) dev->priv; |