patch-2.4.19 linux-2.4.19/drivers/net/sk98lin/skaddr.c

Next file: linux-2.4.19/drivers/net/sk98lin/skge.c
Previous file: linux-2.4.19/drivers/net/sk98lin/h/skdrv1st.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/drivers/net/sk98lin/skaddr.c linux-2.4.19/drivers/net/sk98lin/skaddr.c
@@ -199,7 +199,6 @@
 /* defines ********************************************************************/
 
 
-#define CRC32_POLY	0xEDB88320UL	/* CRC32-Poly - XMAC: Little Endian */
 #define HASH_BITS	6				/* #bits in hash */
 #define	SK_MC_BIT	0x01
 
@@ -534,18 +533,9 @@
 unsigned SkCrc32McHash(
 unsigned char *pMc)	/* Multicast address */
 {
-	unsigned Idx;
-	unsigned Bit;
-	unsigned Data;
-	unsigned Crc;
-
-	Crc = 0xFFFFFFFFUL;
-	for (Idx = 0; Idx < SK_MAC_ADDR_LEN; Idx++) {
-		Data = *pMc++;
-		for (Bit = 0; Bit < 8; Bit++, Data >>= 1) {
-			Crc = (Crc >> 1) ^ (((Crc ^ Data) & 1) ? CRC32_POLY : 0);
-		}
-	}
+	u32 Crc;
+
+	Crc = ether_crc_le(SK_MAC_ADDR_LEN, pMc);
 
 	return (Crc & ((1 << HASH_BITS) - 1));
 }	/* SkCrc32McHash */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)