patch-2.4.22 linux-2.4.22/drivers/usb/catc.c
Next file: linux-2.4.22/drivers/usb/hid-core.c
Previous file: linux-2.4.22/drivers/usb/ax8817x.c
Back to the patch index
Back to the overall index
- Lines: 57
- Date:
2003-08-25 04:44:42.000000000 -0700
- Orig file:
linux-2.4.21/drivers/usb/catc.c
- Orig date:
2002-11-28 15:53:14.000000000 -0800
diff -urN linux-2.4.21/drivers/usb/catc.c linux-2.4.22/drivers/usb/catc.c
@@ -42,6 +42,7 @@
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/ethtool.h>
+#include <linux/crc32.h>
#include <asm/bitops.h>
#include <asm/uaccess.h>
@@ -62,6 +63,8 @@
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_LICENSE("GPL");
+static const char driver_name[] = "catc";
+
/*
* Some defines.
*/
@@ -596,20 +599,9 @@
* Receive modes. Broadcast, Multicast, Promisc.
*/
-static inline u32 ether_crc_le(int cnt, unsigned char *addr)
-{
- unsigned int crc = 0xffffffff;
- u8 byte, idx, bit;
-
- for (idx = 0; idx < cnt; idx++)
- for (byte = *addr++, bit = 0; bit < 8; bit++, byte >>= 1)
- crc = (crc >> 1) ^ (((crc ^ byte) & 1) ? 0xedb88320U : 0);
- return crc;
-}
-
static void catc_multicast(unsigned char *addr, u8 *multicast)
{
- unsigned int crc = ether_crc_le(6, addr);
+ u32 crc = ether_crc_le(6, addr);
multicast[(crc >> 3) & 0x3f] |= 1 << (crc & 7);
}
@@ -674,7 +666,7 @@
/* get driver info */
case ETHTOOL_GDRVINFO: {
struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO};
- strncpy(info.driver, SHORT_DRIVER_DESC, ETHTOOL_BUSINFO_LEN);
+ strncpy(info.driver, driver_name, ETHTOOL_BUSINFO_LEN);
strncpy(info.version, DRIVER_VERSION, ETHTOOL_BUSINFO_LEN);
sprintf(tmp, "usb%d:%d", catc->usbdev->bus->busnum, catc->usbdev->devnum);
strncpy(info.bus_info, tmp,ETHTOOL_BUSINFO_LEN);
@@ -937,7 +929,7 @@
MODULE_DEVICE_TABLE(usb, catc_id_table);
static struct usb_driver catc_driver = {
- name: "catc",
+ name: driver_name,
probe: catc_probe,
disconnect: catc_disconnect,
id_table: catc_id_table,
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)