2 * Copyright (c) 2001 Vojtech Pavlik
4 * CATC EL1210A NetMate USB Ethernet driver
11 * Old chipset support added by Simon Evans <spse@secret.org.uk> 2002
12 * - adds support for Belkin F5U011
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or
19 * (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30 * Should you need to contact me, the author, you can do so either by
31 * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
32 * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
35 #include <linux/init.h>
36 #include <linux/module.h>
37 #include <linux/kernel.h>
38 #include <linux/string.h>
39 #include <linux/slab.h>
40 #include <linux/netdevice.h>
41 #include <linux/etherdevice.h>
42 #include <linux/skbuff.h>
43 #include <linux/spinlock.h>
44 #include <linux/ethtool.h>
45 #include <linux/crc32.h>
46 #include <asm/bitops.h>
47 #include <asm/uaccess.h>
51 #include <linux/usb.h>
54 * Version information.
57 #define DRIVER_VERSION "v2.8"
58 #define DRIVER_AUTHOR "Vojtech Pavlik <vojtech@suse.cz>"
59 #define DRIVER_DESC "CATC EL1210A NetMate USB Ethernet driver"
60 #define SHORT_DRIVER_DESC "EL1210A NetMate USB Ethernet"
62 MODULE_AUTHOR(DRIVER_AUTHOR);
63 MODULE_DESCRIPTION(DRIVER_DESC);
64 MODULE_LICENSE("GPL");
66 static const char driver_name[] = "catc";
72 #define STATS_UPDATE (HZ) /* Time between stats updates */
73 #define TX_TIMEOUT (5*HZ) /* Max time the queue can be stopped */
74 #define PKT_SZ 1536 /* Max Ethernet packet size */
75 #define RX_MAX_BURST 15 /* Max packets per rx buffer (> 0, < 16) */
76 #define TX_MAX_BURST 15 /* Max full sized packets per tx buffer (> 0) */
77 #define CTRL_QUEUE 16 /* Max control requests in flight (power of two) */
78 #define RX_PKT_SZ 1600 /* Max size of receive packet for F5U011 */
84 enum control_requests {
89 SetRxMode = 0xf5, /* F5U011 only */
101 enum register_offsets {
127 OpWin95bugfix = 0x40,
131 enum rx_filter_bits {
137 AltRxPromisc = 0x20, /* F5U011 uses different bit */
158 #define CTRL_RUNNING 0
163 struct net_device *netdev;
164 struct usb_device *usbdev;
166 struct net_device_stats stats;
169 unsigned int tx_ptr, tx_idx;
170 unsigned int ctrl_head, ctrl_tail;
171 spinlock_t tx_lock, ctrl_lock;
173 u8 tx_buf[2][TX_MAX_BURST * (PKT_SZ + 2)];
174 u8 rx_buf[RX_MAX_BURST * (PKT_SZ + 2)];
177 struct usb_ctrlrequest ctrl_dr;
179 struct timer_list timer;
182 unsigned long last_stats;
193 void (*callback)(struct catc *catc, struct ctrl_queue *q);
194 } ctrl_queue[CTRL_QUEUE];
196 struct urb tx_urb, rx_urb, irq_urb, ctrl_urb;
198 u8 is_f5u011; /* Set if device is an F5U011 */
199 u8 rxmode[2]; /* Used for F5U011 */
200 atomic_t recq_sz; /* Used for F5U011 - counter of waiting rx packets */
207 #define catc_get_mac(catc, mac) catc_ctrl_msg(catc, USB_DIR_IN, GetMac, 0, 0, mac, 6)
208 #define catc_reset(catc) catc_ctrl_msg(catc, USB_DIR_OUT, Reset, 0, 0, NULL, 0)
209 #define catc_set_reg(catc, reg, val) catc_ctrl_msg(catc, USB_DIR_OUT, SetReg, val, reg, NULL, 0)
210 #define catc_get_reg(catc, reg, buf) catc_ctrl_msg(catc, USB_DIR_IN, GetReg, 0, reg, buf, 1)
211 #define catc_write_mem(catc, addr, buf, size) catc_ctrl_msg(catc, USB_DIR_OUT, WriteMem, 0, addr, buf, size)
212 #define catc_read_mem(catc, addr, buf, size) catc_ctrl_msg(catc, USB_DIR_IN, ReadMem, 0, addr, buf, size)
214 #define f5u011_rxmode(catc, rxmode) catc_ctrl_msg(catc, USB_DIR_OUT, SetRxMode, 0, 1, rxmode, 2)
215 #define f5u011_rxmode_async(catc, rxmode) catc_ctrl_async(catc, USB_DIR_OUT, SetRxMode, 0, 1, &rxmode, 2, NULL)
216 #define f5u011_mchash_async(catc, hash) catc_ctrl_async(catc, USB_DIR_OUT, SetRxMode, 0, 2, &hash, 8, NULL)
218 #define catc_set_reg_async(catc, reg, val) catc_ctrl_async(catc, USB_DIR_OUT, SetReg, val, reg, NULL, 0, NULL)
219 #define catc_get_reg_async(catc, reg, cb) catc_ctrl_async(catc, USB_DIR_IN, GetReg, 0, reg, NULL, 1, cb)
220 #define catc_write_mem_async(catc, addr, buf, size) catc_ctrl_async(catc, USB_DIR_OUT, WriteMem, 0, addr, buf, size, NULL)
226 static void catc_rx_done(struct urb *urb)
228 struct catc *catc = urb->context;
229 u8 *pkt_start = urb->transfer_buffer;
231 int pkt_len, pkt_offset = 0;
233 if (!catc->is_f5u011) {
234 clear_bit(RX_RUNNING, &catc->flags);
239 dbg("rx_done, status %d, length %d", urb->status, urb->actual_length);
244 if(!catc->is_f5u011) {
245 pkt_len = le16_to_cpup((u16*)pkt_start);
246 if (pkt_len > urb->actual_length) {
247 catc->stats.rx_length_errors++;
248 catc->stats.rx_errors++;
252 pkt_len = urb->actual_length;
255 if (!(skb = dev_alloc_skb(pkt_len)))
258 skb->dev = catc->netdev;
259 eth_copy_and_sum(skb, pkt_start + pkt_offset, pkt_len, 0);
260 skb_put(skb, pkt_len);
262 skb->protocol = eth_type_trans(skb, catc->netdev);
265 catc->stats.rx_packets++;
266 catc->stats.rx_bytes += pkt_len;
268 /* F5U011 only does one packet per RX */
271 pkt_start += (((pkt_len + 1) >> 6) + 1) << 6;
273 } while (pkt_start - (u8 *) urb->transfer_buffer < urb->actual_length);
275 catc->netdev->last_rx = jiffies;
277 if (catc->is_f5u011) {
278 if (atomic_read(&catc->recq_sz)) {
280 atomic_dec(&catc->recq_sz);
281 dbg("getting extra packet");
282 urb->dev = catc->usbdev;
283 if ((status = usb_submit_urb(urb)) < 0) {
284 dbg("submit(rx_urb) status %d", status);
287 clear_bit(RX_RUNNING, &catc->flags);
292 static void catc_irq_done(struct urb *urb)
294 struct catc *catc = urb->context;
295 u8 *data = urb->transfer_buffer;
297 unsigned int hasdata = 0, linksts = LinkNoChange;
299 if (!catc->is_f5u011) {
300 hasdata = data[1] & 0x80;
303 else if (data[1] & 0x20)
306 hasdata = (unsigned int)(be16_to_cpup((u16*)data) & 0x0fff);
309 else if (data[0] == 0xA0)
314 dbg("irq_done, status %d, data %02x %02x.", urb->status, data[0], data[1]);
318 if (linksts == LinkGood) {
319 netif_carrier_on(catc->netdev);
323 if (linksts == LinkBad) {
324 netif_carrier_off(catc->netdev);
329 if (test_and_set_bit(RX_RUNNING, &catc->flags)) {
331 atomic_inc(&catc->recq_sz);
333 catc->rx_urb.dev = catc->usbdev;
334 if ((status = usb_submit_urb(&catc->rx_urb)) < 0) {
335 err("submit(rx_urb) status %d", status);
345 static void catc_tx_run(struct catc *catc)
350 catc->tx_ptr = (catc->tx_ptr + 63) & ~63;
352 catc->tx_urb.transfer_buffer_length = catc->tx_ptr;
353 catc->tx_urb.transfer_buffer = catc->tx_buf[catc->tx_idx];
354 catc->tx_urb.dev = catc->usbdev;
356 if ((status = usb_submit_urb(&catc->tx_urb)) < 0)
357 err("submit(tx_urb), status %d", status);
359 catc->tx_idx = !catc->tx_idx;
362 catc->netdev->trans_start = jiffies;
365 static void catc_tx_done(struct urb *urb)
367 struct catc *catc = urb->context;
370 if (urb->status == -ECONNRESET) {
372 urb->transfer_flags &= ~USB_ASYNC_UNLINK;
374 catc->netdev->trans_start = jiffies;
375 catc->stats.tx_errors++;
376 clear_bit(TX_RUNNING, &catc->flags);
377 netif_wake_queue(catc->netdev);
382 dbg("tx_done, status %d, length %d", urb->status, urb->actual_length);
386 spin_lock_irqsave(&catc->tx_lock, flags);
391 clear_bit(TX_RUNNING, &catc->flags);
393 netif_wake_queue(catc->netdev);
395 spin_unlock_irqrestore(&catc->tx_lock, flags);
398 static int catc_hard_start_xmit(struct sk_buff *skb, struct net_device *netdev)
400 struct catc *catc = netdev->priv;
404 spin_lock_irqsave(&catc->tx_lock, flags);
406 catc->tx_ptr = (((catc->tx_ptr - 1) >> 6) + 1) << 6;
407 tx_buf = catc->tx_buf[catc->tx_idx] + catc->tx_ptr;
408 *((u16*)tx_buf) = (catc->is_f5u011) ?
409 cpu_to_be16((u16)skb->len) : cpu_to_le16((u16)skb->len);
410 memcpy(tx_buf + 2, skb->data, skb->len);
411 catc->tx_ptr += skb->len + 2;
413 if (!test_and_set_bit(TX_RUNNING, &catc->flags))
416 if ((catc->is_f5u011 && catc->tx_ptr)
417 || (catc->tx_ptr >= ((TX_MAX_BURST - 1) * (PKT_SZ + 2))))
418 netif_stop_queue(netdev);
420 spin_unlock_irqrestore(&catc->tx_lock, flags);
422 catc->stats.tx_bytes += skb->len;
423 catc->stats.tx_packets++;
430 static void catc_tx_timeout(struct net_device *netdev)
432 struct catc *catc = netdev->priv;
434 warn("Transmit timed out.");
435 catc->tx_urb.transfer_flags |= USB_ASYNC_UNLINK;
436 usb_unlink_urb(&catc->tx_urb);
443 static int catc_ctrl_msg(struct catc *catc, u8 dir, u8 request, u16 value, u16 index, void *buf, int len)
445 int retval = usb_control_msg(catc->usbdev,
446 dir ? usb_rcvctrlpipe(catc->usbdev, 0) : usb_sndctrlpipe(catc->usbdev, 0),
447 request, 0x40 | dir, value, index, buf, len, HZ);
448 return retval < 0 ? retval : 0;
451 static void catc_ctrl_run(struct catc *catc)
453 struct ctrl_queue *q = catc->ctrl_queue + catc->ctrl_tail;
454 struct usb_device *usbdev = catc->usbdev;
455 struct urb *urb = &catc->ctrl_urb;
456 struct usb_ctrlrequest *dr = &catc->ctrl_dr;
459 dr->bRequest = q->request;
460 dr->bRequestType = 0x40 | q->dir;
461 dr->wValue = cpu_to_le16(q->value);
462 dr->wIndex = cpu_to_le16(q->index);
463 dr->wLength = cpu_to_le16(q->len);
465 urb->pipe = q->dir ? usb_rcvctrlpipe(usbdev, 0) : usb_sndctrlpipe(usbdev, 0);
466 urb->transfer_buffer_length = q->len;
467 urb->transfer_buffer = catc->ctrl_buf;
468 urb->setup_packet = (void *) dr;
471 if (!q->dir && q->buf && q->len)
472 memcpy(catc->ctrl_buf, q->buf, q->len);
474 if ((status = usb_submit_urb(&catc->ctrl_urb)))
475 err("submit(ctrl_urb) status %d", status);
478 static void catc_ctrl_done(struct urb *urb)
480 struct catc *catc = urb->context;
481 struct ctrl_queue *q;
485 dbg("ctrl_done, status %d, len %d.", urb->status, urb->actual_length);
487 spin_lock_irqsave(&catc->ctrl_lock, flags);
489 q = catc->ctrl_queue + catc->ctrl_tail;
492 if (q->buf && q->len)
493 memcpy(q->buf, catc->ctrl_buf, q->len);
495 q->buf = catc->ctrl_buf;
499 q->callback(catc, q);
501 catc->ctrl_tail = (catc->ctrl_tail + 1) & (CTRL_QUEUE - 1);
503 if (catc->ctrl_head != catc->ctrl_tail)
506 clear_bit(CTRL_RUNNING, &catc->flags);
508 spin_unlock_irqrestore(&catc->ctrl_lock, flags);
511 static int catc_ctrl_async(struct catc *catc, u8 dir, u8 request, u16 value,
512 u16 index, void *buf, int len, void (*callback)(struct catc *catc, struct ctrl_queue *q))
514 struct ctrl_queue *q;
518 spin_lock_irqsave(&catc->ctrl_lock, flags);
520 q = catc->ctrl_queue + catc->ctrl_head;
523 q->request = request;
528 q->callback = callback;
530 catc->ctrl_head = (catc->ctrl_head + 1) & (CTRL_QUEUE - 1);
532 if (catc->ctrl_head == catc->ctrl_tail) {
533 err("ctrl queue full");
534 catc->ctrl_tail = (catc->ctrl_tail + 1) & (CTRL_QUEUE - 1);
538 if (!test_and_set_bit(CTRL_RUNNING, &catc->flags))
541 spin_unlock_irqrestore(&catc->ctrl_lock, flags);
550 static void catc_stats_done(struct catc *catc, struct ctrl_queue *q)
552 int index = q->index - EthStats;
555 catc->stats_buf[index] = *((char *)q->buf);
560 data = ((u16)catc->stats_buf[index] << 8) | catc->stats_buf[index + 1];
561 last = catc->stats_vals[index >> 1];
566 catc->stats.collisions += data - last;
569 catc->stats.tx_aborted_errors += data - last;
570 catc->stats.tx_errors += data - last;
573 catc->stats.rx_frame_errors += data - last;
574 catc->stats.rx_errors += data - last;
578 catc->stats_vals[index >> 1] = data;
581 static void catc_stats_timer(unsigned long data)
583 struct catc *catc = (void *) data;
586 for (i = 0; i < 8; i++)
587 catc_get_reg_async(catc, EthStats + 7 - i, catc_stats_done);
589 mod_timer(&catc->timer, jiffies + STATS_UPDATE);
592 static struct net_device_stats *catc_get_stats(struct net_device *netdev)
594 struct catc *catc = netdev->priv;
599 * Receive modes. Broadcast, Multicast, Promisc.
602 static void catc_multicast(unsigned char *addr, u8 *multicast)
604 u32 crc = ether_crc_le(6, addr);
605 multicast[(crc >> 3) & 0x3f] |= 1 << (crc & 7);
608 static void catc_set_multicast_list(struct net_device *netdev)
610 struct catc *catc = netdev->priv;
611 struct dev_mc_list *mc;
613 u8 rx = RxEnable | RxPolarity | RxMultiCast;
616 memset(broadcast, 0xff, 6);
617 memset(catc->multicast, 0, 64);
619 catc_multicast(broadcast, catc->multicast);
620 catc_multicast(netdev->dev_addr, catc->multicast);
622 if (netdev->flags & IFF_PROMISC) {
623 memset(catc->multicast, 0xff, 64);
624 rx |= (!catc->is_f5u011) ? RxPromisc : AltRxPromisc;
627 if (netdev->flags & IFF_ALLMULTI) {
628 memset(catc->multicast, 0xff, 64);
630 for (i = 0, mc = netdev->mc_list; mc && i < netdev->mc_count; i++, mc = mc->next) {
631 u32 crc = ether_crc_le(6, mc->dmi_addr);
632 if (!catc->is_f5u011) {
633 catc->multicast[(crc >> 3) & 0x3f] |= 1 << (crc & 7);
635 catc->multicast[7-(crc >> 29)] |= 1 << ((crc >> 26) & 7);
639 if (!catc->is_f5u011) {
640 catc_set_reg_async(catc, RxUnit, rx);
641 catc_write_mem_async(catc, 0xfa80, catc->multicast, 64);
643 f5u011_mchash_async(catc, catc->multicast);
644 if (catc->rxmode[0] != rx) {
645 catc->rxmode[0] = rx;
646 dbg("Setting RX mode to %2.2X %2.2X", catc->rxmode[0],
648 f5u011_rxmode_async(catc, catc->rxmode);
656 static int netdev_ethtool_ioctl(struct net_device *dev, void *useraddr)
658 struct catc *catc = dev->priv;
662 if (get_user(cmd, (u32 *)useraddr))
666 /* get driver info */
667 case ETHTOOL_GDRVINFO: {
668 struct ethtool_drvinfo info = {ETHTOOL_GDRVINFO};
669 strncpy(info.driver, driver_name, ETHTOOL_BUSINFO_LEN);
670 strncpy(info.version, DRIVER_VERSION, ETHTOOL_BUSINFO_LEN);
671 sprintf(tmp, "usb%d:%d", catc->usbdev->bus->busnum, catc->usbdev->devnum);
672 strncpy(info.bus_info, tmp,ETHTOOL_BUSINFO_LEN);
673 if (copy_to_user(useraddr, &info, sizeof(info)))
680 if (catc->is_f5u011) {
681 struct ethtool_cmd ecmd = {
683 SUPPORTED_10baseT_Half | SUPPORTED_TP,
684 ADVERTISED_10baseT_Half | ADVERTISED_TP,
694 if (copy_to_user(useraddr, &ecmd, sizeof(ecmd)))
701 /* get link status */
702 case ETHTOOL_GLINK: {
703 struct ethtool_value edata = {ETHTOOL_GLINK};
704 edata.data = netif_carrier_ok(dev);
705 if (copy_to_user(useraddr, &edata, sizeof(edata)))
710 /* Note that the ethtool user space code requires EOPNOTSUPP */
714 static int catc_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
718 return netdev_ethtool_ioctl(dev, (void *) rq->ifr_data);
720 return -ENOTTY; /* Apparently this is the standard ioctl errno */
729 static int catc_open(struct net_device *netdev)
731 struct catc *catc = netdev->priv;
734 catc->irq_urb.dev = catc->usbdev;
735 if ((status = usb_submit_urb(&catc->irq_urb)) < 0) {
736 err("submit(irq_urb) status %d", status);
740 netif_start_queue(netdev);
742 if (!catc->is_f5u011)
743 mod_timer(&catc->timer, jiffies + STATS_UPDATE);
748 static int catc_stop(struct net_device *netdev)
750 struct catc *catc = netdev->priv;
752 netif_stop_queue(netdev);
754 if (!catc->is_f5u011)
755 del_timer_sync(&catc->timer);
757 usb_unlink_urb(&catc->rx_urb);
758 usb_unlink_urb(&catc->tx_urb);
759 usb_unlink_urb(&catc->irq_urb);
760 usb_unlink_urb(&catc->ctrl_urb);
766 * USB probe, disconnect.
769 static void *catc_probe(struct usb_device *usbdev, unsigned int ifnum, const struct usb_device_id *id)
771 struct net_device *netdev;
776 if (usb_set_interface(usbdev, ifnum, 1)) {
777 err("Can't set altsetting 1.");
781 catc = kmalloc(sizeof(struct catc), GFP_KERNEL);
785 memset(catc, 0, sizeof(struct catc));
787 netdev = init_etherdev(0, 0);
793 netdev->open = catc_open;
794 netdev->hard_start_xmit = catc_hard_start_xmit;
795 netdev->stop = catc_stop;
796 netdev->get_stats = catc_get_stats;
797 netdev->tx_timeout = catc_tx_timeout;
798 netdev->watchdog_timeo = TX_TIMEOUT;
799 netdev->set_multicast_list = catc_set_multicast_list;
800 netdev->do_ioctl = catc_ioctl;
803 catc->usbdev = usbdev;
804 catc->netdev = netdev;
806 catc->tx_lock = SPIN_LOCK_UNLOCKED;
807 catc->ctrl_lock = SPIN_LOCK_UNLOCKED;
809 init_timer(&catc->timer);
810 catc->timer.data = (long) catc;
811 catc->timer.function = catc_stats_timer;
813 /* The F5U011 has the same vendor/product as the netmate
814 * but a device version of 0x130
816 if (usbdev->descriptor.idVendor == 0x0423 &&
817 usbdev->descriptor.idProduct == 0xa &&
818 catc->usbdev->descriptor.bcdDevice == 0x0130) {
819 dbg("Testing for f5u011");
821 atomic_set(&catc->recq_sz, 0);
824 pktsz = RX_MAX_BURST * (PKT_SZ + 2);
827 FILL_CONTROL_URB(&catc->ctrl_urb, usbdev, usb_sndctrlpipe(usbdev, 0),
828 NULL, NULL, 0, catc_ctrl_done, catc);
830 FILL_BULK_URB(&catc->tx_urb, usbdev, usb_sndbulkpipe(usbdev, 1),
831 NULL, 0, catc_tx_done, catc);
833 FILL_BULK_URB(&catc->rx_urb, usbdev, usb_rcvbulkpipe(usbdev, 1),
834 catc->rx_buf, pktsz, catc_rx_done, catc);
836 FILL_INT_URB(&catc->irq_urb, usbdev, usb_rcvintpipe(usbdev, 2),
837 catc->irq_buf, 2, catc_irq_done, catc, 1);
839 if (!catc->is_f5u011) {
840 dbg("Checking memory size\n");
843 catc_write_mem(catc, 0x7a80, &i, 4);
845 catc_write_mem(catc, 0xfa80, &i, 4);
846 catc_read_mem(catc, 0x7a80, &i, 4);
850 catc_set_reg(catc, TxBufCount, 8);
851 catc_set_reg(catc, RxBufCount, 32);
855 warn("Couldn't detect memory size, assuming 32k");
857 catc_set_reg(catc, TxBufCount, 4);
858 catc_set_reg(catc, RxBufCount, 16);
863 dbg("Getting MAC from SEEROM.");
865 catc_get_mac(catc, netdev->dev_addr);
867 dbg("Setting MAC into registers.");
869 for (i = 0; i < 6; i++)
870 catc_set_reg(catc, StationAddr0 - i, netdev->dev_addr[i]);
872 dbg("Filling the multicast list.");
874 memset(broadcast, 0xff, 6);
875 catc_multicast(broadcast, catc->multicast);
876 catc_multicast(netdev->dev_addr, catc->multicast);
877 catc_write_mem(catc, 0xfa80, catc->multicast, 64);
879 dbg("Clearing error counters.");
881 for (i = 0; i < 8; i++)
882 catc_set_reg(catc, EthStats + i, 0);
883 catc->last_stats = jiffies;
887 catc_set_reg(catc, MaxBurst, RX_MAX_BURST);
888 catc_set_reg(catc, OpModes, OpTxMerge | OpRxMerge | OpLenInclude | Op3MemWaits);
889 catc_set_reg(catc, LEDCtrl, LEDLink);
890 catc_set_reg(catc, RxUnit, RxEnable | RxPolarity | RxMultiCast);
892 dbg("Performing reset\n");
894 catc_get_mac(catc, netdev->dev_addr);
896 dbg("Setting RX Mode");
897 catc->rxmode[0] = RxEnable | RxPolarity | RxMultiCast;
899 f5u011_rxmode(catc, catc->rxmode);
902 printk(KERN_INFO "%s: %s USB Ethernet at usb%d:%d.%d, ",
903 netdev->name, (catc->is_f5u011) ? "Belkin F5U011" : "CATC EL1210A NetMate",
904 usbdev->bus->busnum, usbdev->devnum, ifnum);
905 for (i = 0; i < 5; i++) printk("%2.2x:", netdev->dev_addr[i]);
906 printk("%2.2x.\n", netdev->dev_addr[i]);
910 static void catc_disconnect(struct usb_device *usbdev, void *dev_ptr)
912 struct catc *catc = dev_ptr;
913 unregister_netdev(catc->netdev);
919 * Module functions and tables.
922 static struct usb_device_id catc_id_table [] = {
923 { USB_DEVICE(0x0423, 0xa) }, /* CATC Netmate, Belkin F5U011 */
924 { USB_DEVICE(0x0423, 0xc) }, /* CATC Netmate II, Belkin F5U111 */
925 { USB_DEVICE(0x08d1, 0x1) }, /* smartBridges smartNIC */
929 MODULE_DEVICE_TABLE(usb, catc_id_table);
931 static struct usb_driver catc_driver = {
934 disconnect: catc_disconnect,
935 id_table: catc_id_table,
938 static int __init catc_init(void)
940 info(DRIVER_VERSION " " DRIVER_DESC);
941 usb_register(&catc_driver);
945 static void __exit catc_exit(void)
947 usb_deregister(&catc_driver);
950 module_init(catc_init);
951 module_exit(catc_exit);