patch-2.4.19 linux-2.4.19/drivers/net/7990.c

Next file: linux-2.4.19/drivers/net/7990.h
Previous file: linux-2.4.19/drivers/net/3c509.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/drivers/net/7990.c linux-2.4.19/drivers/net/7990.c
@@ -25,6 +25,7 @@
 #include <linux/string.h>
 #include <linux/delay.h>
 #include <linux/init.h>
+#include <linux/crc32.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
 #include <asm/io.h>
@@ -569,7 +570,7 @@
         struct dev_mc_list *dmi=dev->mc_list;
         char *addrs;
         int i, j, bit, byte;
-        u32 crc, poly = CRC_POLYNOMIAL_LE;
+        u32 crc;
         
         /* set all multicast bits */
         if (dev->flags & IFF_ALLMULTI){ 
@@ -590,21 +591,7 @@
                 if (!(*addrs & 1))
                         continue;
                 
-                crc = 0xffffffff;
-                for (byte = 0; byte < 6; byte++)
-                        for (bit = *addrs++, j = 0; j < 8; j++, bit>>=1)
-                        {
-                                int test;
-
-                                test = ((bit ^ crc) & 0x01);
-                                crc >>= 1;
-
-                                if (test)
-                                {
-                                        crc = crc ^ poly;
-                                }
-                        }
-                
+		crc = ether_crc_le(6, addrs);
                 crc = crc >> 26;
                 mcast_table [crc >> 4] |= 1 << (crc & 0xf);
         }
@@ -643,3 +630,4 @@
 		netif_start_queue (dev);
 }
 
+MODULE_LICENSE("GPL");

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