1 /*
2 * Davicom DM96xx USB 10/100Mbps ethernet devices
3 *
4 * Peter Korsgaard <jacmet@sunsite.dk>
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11 //#define DEBUG
12
13 #include <linux/module.h>
14 #include <linux/sched.h>
15 #include <linux/stddef.h>
16 #include <linux/netdevice.h>
17 #include <linux/etherdevice.h>
18 #include <linux/ethtool.h>
19 #include <linux/mii.h>
20 #include <linux/usb.h>
21 #include <linux/crc32.h>
22 #include <linux/usb/usbnet.h>
23 #include <linux/slab.h>
24
25 /* datasheet:
26 http://ptm2.cc.utu.fi/ftp/network/cards/DM9601/From_NET/DM9601-DS-P01-930914.pdf
27 */
28
29 /* control requests */
30 #define DM_READ_REGS 0x00
31 #define DM_WRITE_REGS 0x01
32 #define DM_READ_MEMS 0x02
33 #define DM_WRITE_REG 0x03
34 #define DM_WRITE_MEMS 0x05
35 #define DM_WRITE_MEM 0x07
36
37 /* registers */
38 #define DM_NET_CTRL 0x00
39 #define DM_RX_CTRL 0x05
40 #define DM_SHARED_CTRL 0x0b
41 #define DM_SHARED_ADDR 0x0c
42 #define DM_SHARED_DATA 0x0d /* low + high */
43 #define DM_PHY_ADDR 0x10 /* 6 bytes */
44 #define DM_MCAST_ADDR 0x16 /* 8 bytes */
45 #define DM_GPR_CTRL 0x1e
46 #define DM_GPR_DATA 0x1f
47 #define DM_CHIP_ID 0x2c
48 #define DM_MODE_CTRL 0x91 /* only on dm9620 */
49
50 /* chip id values */
51 #define ID_DM9601 0
52 #define ID_DM9620 1
53
54 #define DM_MAX_MCAST 64
55 #define DM_MCAST_SIZE 8
56 #define DM_EEPROM_LEN 256
57 #define DM_TX_OVERHEAD 2 /* 2 byte header */
58 #define DM_RX_OVERHEAD 7 /* 3 byte header + 4 byte crc tail */
59 #define DM_TIMEOUT 1000
60
dm_read(struct usbnet * dev,u8 reg,u16 length,void * data)61 static int dm_read(struct usbnet *dev, u8 reg, u16 length, void *data)
62 {
63 int err;
64 err = usbnet_read_cmd(dev, DM_READ_REGS,
65 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
66 0, reg, data, length);
67 if(err != length && err >= 0)
68 err = -EINVAL;
69 return err;
70 }
71
dm_read_reg(struct usbnet * dev,u8 reg,u8 * value)72 static int dm_read_reg(struct usbnet *dev, u8 reg, u8 *value)
73 {
74 return dm_read(dev, reg, 1, value);
75 }
76
dm_write(struct usbnet * dev,u8 reg,u16 length,void * data)77 static int dm_write(struct usbnet *dev, u8 reg, u16 length, void *data)
78 {
79 int err;
80 err = usbnet_write_cmd(dev, DM_WRITE_REGS,
81 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
82 0, reg, data, length);
83
84 if (err >= 0 && err < length)
85 err = -EINVAL;
86 return err;
87 }
88
dm_write_reg(struct usbnet * dev,u8 reg,u8 value)89 static int dm_write_reg(struct usbnet *dev, u8 reg, u8 value)
90 {
91 return usbnet_write_cmd(dev, DM_WRITE_REG,
92 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
93 value, reg, NULL, 0);
94 }
95
dm_write_async(struct usbnet * dev,u8 reg,u16 length,void * data)96 static void dm_write_async(struct usbnet *dev, u8 reg, u16 length, void *data)
97 {
98 usbnet_write_cmd_async(dev, DM_WRITE_REGS,
99 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
100 0, reg, data, length);
101 }
102
dm_write_reg_async(struct usbnet * dev,u8 reg,u8 value)103 static void dm_write_reg_async(struct usbnet *dev, u8 reg, u8 value)
104 {
105 usbnet_write_cmd_async(dev, DM_WRITE_REG,
106 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
107 value, reg, NULL, 0);
108 }
109
dm_read_shared_word(struct usbnet * dev,int phy,u8 reg,__le16 * value)110 static int dm_read_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 *value)
111 {
112 int ret, i;
113
114 mutex_lock(&dev->phy_mutex);
115
116 dm_write_reg(dev, DM_SHARED_ADDR, phy ? (reg | 0x40) : reg);
117 dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0xc : 0x4);
118
119 for (i = 0; i < DM_TIMEOUT; i++) {
120 u8 tmp = 0;
121
122 udelay(1);
123 ret = dm_read_reg(dev, DM_SHARED_CTRL, &tmp);
124 if (ret < 0)
125 goto out;
126
127 /* ready */
128 if ((tmp & 1) == 0)
129 break;
130 }
131
132 if (i == DM_TIMEOUT) {
133 netdev_err(dev->net, "%s read timed out!\n", phy ? "phy" : "eeprom");
134 ret = -EIO;
135 goto out;
136 }
137
138 dm_write_reg(dev, DM_SHARED_CTRL, 0x0);
139 ret = dm_read(dev, DM_SHARED_DATA, 2, value);
140
141 netdev_dbg(dev->net, "read shared %d 0x%02x returned 0x%04x, %d\n",
142 phy, reg, *value, ret);
143
144 out:
145 mutex_unlock(&dev->phy_mutex);
146 return ret;
147 }
148
dm_write_shared_word(struct usbnet * dev,int phy,u8 reg,__le16 value)149 static int dm_write_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 value)
150 {
151 int ret, i;
152
153 mutex_lock(&dev->phy_mutex);
154
155 ret = dm_write(dev, DM_SHARED_DATA, 2, &value);
156 if (ret < 0)
157 goto out;
158
159 dm_write_reg(dev, DM_SHARED_ADDR, phy ? (reg | 0x40) : reg);
160 dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0x1a : 0x12);
161
162 for (i = 0; i < DM_TIMEOUT; i++) {
163 u8 tmp = 0;
164
165 udelay(1);
166 ret = dm_read_reg(dev, DM_SHARED_CTRL, &tmp);
167 if (ret < 0)
168 goto out;
169
170 /* ready */
171 if ((tmp & 1) == 0)
172 break;
173 }
174
175 if (i == DM_TIMEOUT) {
176 netdev_err(dev->net, "%s write timed out!\n", phy ? "phy" : "eeprom");
177 ret = -EIO;
178 goto out;
179 }
180
181 dm_write_reg(dev, DM_SHARED_CTRL, 0x0);
182
183 out:
184 mutex_unlock(&dev->phy_mutex);
185 return ret;
186 }
187
dm_read_eeprom_word(struct usbnet * dev,u8 offset,void * value)188 static int dm_read_eeprom_word(struct usbnet *dev, u8 offset, void *value)
189 {
190 return dm_read_shared_word(dev, 0, offset, value);
191 }
192
193
194
dm9601_get_eeprom_len(struct net_device * dev)195 static int dm9601_get_eeprom_len(struct net_device *dev)
196 {
197 return DM_EEPROM_LEN;
198 }
199
dm9601_get_eeprom(struct net_device * net,struct ethtool_eeprom * eeprom,u8 * data)200 static int dm9601_get_eeprom(struct net_device *net,
201 struct ethtool_eeprom *eeprom, u8 * data)
202 {
203 struct usbnet *dev = netdev_priv(net);
204 __le16 *ebuf = (__le16 *) data;
205 int i;
206
207 /* access is 16bit */
208 if ((eeprom->offset % 2) || (eeprom->len % 2))
209 return -EINVAL;
210
211 for (i = 0; i < eeprom->len / 2; i++) {
212 if (dm_read_eeprom_word(dev, eeprom->offset / 2 + i,
213 &ebuf[i]) < 0)
214 return -EINVAL;
215 }
216 return 0;
217 }
218
dm9601_mdio_read(struct net_device * netdev,int phy_id,int loc)219 static int dm9601_mdio_read(struct net_device *netdev, int phy_id, int loc)
220 {
221 struct usbnet *dev = netdev_priv(netdev);
222
223 __le16 res;
224 int err;
225
226 if (phy_id) {
227 netdev_dbg(dev->net, "Only internal phy supported\n");
228 return 0;
229 }
230
231 err = dm_read_shared_word(dev, 1, loc, &res);
232 if (err < 0) {
233 netdev_err(dev->net, "MDIO read error: %d\n", err);
234 return 0;
235 }
236
237 netdev_dbg(dev->net,
238 "dm9601_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x\n",
239 phy_id, loc, le16_to_cpu(res));
240
241 return le16_to_cpu(res);
242 }
243
dm9601_mdio_write(struct net_device * netdev,int phy_id,int loc,int val)244 static void dm9601_mdio_write(struct net_device *netdev, int phy_id, int loc,
245 int val)
246 {
247 struct usbnet *dev = netdev_priv(netdev);
248 __le16 res = cpu_to_le16(val);
249
250 if (phy_id) {
251 netdev_dbg(dev->net, "Only internal phy supported\n");
252 return;
253 }
254
255 netdev_dbg(dev->net, "dm9601_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x\n",
256 phy_id, loc, val);
257
258 dm_write_shared_word(dev, 1, loc, res);
259 }
260
dm9601_get_drvinfo(struct net_device * net,struct ethtool_drvinfo * info)261 static void dm9601_get_drvinfo(struct net_device *net,
262 struct ethtool_drvinfo *info)
263 {
264 /* Inherit standard device info */
265 usbnet_get_drvinfo(net, info);
266 }
267
dm9601_get_link(struct net_device * net)268 static u32 dm9601_get_link(struct net_device *net)
269 {
270 struct usbnet *dev = netdev_priv(net);
271
272 return mii_link_ok(&dev->mii);
273 }
274
dm9601_ioctl(struct net_device * net,struct ifreq * rq,int cmd)275 static int dm9601_ioctl(struct net_device *net, struct ifreq *rq, int cmd)
276 {
277 struct usbnet *dev = netdev_priv(net);
278
279 return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
280 }
281
282 static const struct ethtool_ops dm9601_ethtool_ops = {
283 .get_drvinfo = dm9601_get_drvinfo,
284 .get_link = dm9601_get_link,
285 .get_msglevel = usbnet_get_msglevel,
286 .set_msglevel = usbnet_set_msglevel,
287 .get_eeprom_len = dm9601_get_eeprom_len,
288 .get_eeprom = dm9601_get_eeprom,
289 .nway_reset = usbnet_nway_reset,
290 .get_link_ksettings = usbnet_get_link_ksettings,
291 .set_link_ksettings = usbnet_set_link_ksettings,
292 };
293
dm9601_set_multicast(struct net_device * net)294 static void dm9601_set_multicast(struct net_device *net)
295 {
296 struct usbnet *dev = netdev_priv(net);
297 /* We use the 20 byte dev->data for our 8 byte filter buffer
298 * to avoid allocating memory that is tricky to free later */
299 u8 *hashes = (u8 *) & dev->data;
300 u8 rx_ctl = 0x31;
301
302 memset(hashes, 0x00, DM_MCAST_SIZE);
303 hashes[DM_MCAST_SIZE - 1] |= 0x80; /* broadcast address */
304
305 if (net->flags & IFF_PROMISC) {
306 rx_ctl |= 0x02;
307 } else if (net->flags & IFF_ALLMULTI ||
308 netdev_mc_count(net) > DM_MAX_MCAST) {
309 rx_ctl |= 0x08;
310 } else if (!netdev_mc_empty(net)) {
311 struct netdev_hw_addr *ha;
312
313 netdev_for_each_mc_addr(ha, net) {
314 u32 crc = ether_crc(ETH_ALEN, ha->addr) >> 26;
315 hashes[crc >> 3] |= 1 << (crc & 0x7);
316 }
317 }
318
319 dm_write_async(dev, DM_MCAST_ADDR, DM_MCAST_SIZE, hashes);
320 dm_write_reg_async(dev, DM_RX_CTRL, rx_ctl);
321 }
322
__dm9601_set_mac_address(struct usbnet * dev)323 static void __dm9601_set_mac_address(struct usbnet *dev)
324 {
325 dm_write_async(dev, DM_PHY_ADDR, ETH_ALEN, dev->net->dev_addr);
326 }
327
dm9601_set_mac_address(struct net_device * net,void * p)328 static int dm9601_set_mac_address(struct net_device *net, void *p)
329 {
330 struct sockaddr *addr = p;
331 struct usbnet *dev = netdev_priv(net);
332
333 if (!is_valid_ether_addr(addr->sa_data)) {
334 dev_err(&net->dev, "not setting invalid mac address %pM\n",
335 addr->sa_data);
336 return -EINVAL;
337 }
338
339 memcpy(net->dev_addr, addr->sa_data, net->addr_len);
340 __dm9601_set_mac_address(dev);
341
342 return 0;
343 }
344
345 static const struct net_device_ops dm9601_netdev_ops = {
346 .ndo_open = usbnet_open,
347 .ndo_stop = usbnet_stop,
348 .ndo_start_xmit = usbnet_start_xmit,
349 .ndo_tx_timeout = usbnet_tx_timeout,
350 .ndo_change_mtu = usbnet_change_mtu,
351 .ndo_get_stats64 = usbnet_get_stats64,
352 .ndo_validate_addr = eth_validate_addr,
353 .ndo_do_ioctl = dm9601_ioctl,
354 .ndo_set_rx_mode = dm9601_set_multicast,
355 .ndo_set_mac_address = dm9601_set_mac_address,
356 };
357
dm9601_bind(struct usbnet * dev,struct usb_interface * intf)358 static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
359 {
360 int ret;
361 u8 mac[ETH_ALEN], id;
362
363 ret = usbnet_get_endpoints(dev, intf);
364 if (ret)
365 goto out;
366
367 dev->net->netdev_ops = &dm9601_netdev_ops;
368 dev->net->ethtool_ops = &dm9601_ethtool_ops;
369 dev->net->hard_header_len += DM_TX_OVERHEAD;
370 dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
371
372 /* dm9620/21a require room for 4 byte padding, even in dm9601
373 * mode, so we need +1 to be able to receive full size
374 * ethernet frames.
375 */
376 dev->rx_urb_size = dev->net->mtu + ETH_HLEN + DM_RX_OVERHEAD + 1;
377
378 dev->mii.dev = dev->net;
379 dev->mii.mdio_read = dm9601_mdio_read;
380 dev->mii.mdio_write = dm9601_mdio_write;
381 dev->mii.phy_id_mask = 0x1f;
382 dev->mii.reg_num_mask = 0x1f;
383
384 /* reset */
385 dm_write_reg(dev, DM_NET_CTRL, 1);
386 udelay(20);
387
388 /* read MAC */
389 if (dm_read(dev, DM_PHY_ADDR, ETH_ALEN, mac) < 0) {
390 printk(KERN_ERR "Error reading MAC address\n");
391 ret = -ENODEV;
392 goto out;
393 }
394
395 /*
396 * Overwrite the auto-generated address only with good ones.
397 */
398 if (is_valid_ether_addr(mac))
399 memcpy(dev->net->dev_addr, mac, ETH_ALEN);
400 else {
401 printk(KERN_WARNING
402 "dm9601: No valid MAC address in EEPROM, using %pM\n",
403 dev->net->dev_addr);
404 __dm9601_set_mac_address(dev);
405 }
406
407 if (dm_read_reg(dev, DM_CHIP_ID, &id) < 0) {
408 netdev_err(dev->net, "Error reading chip ID\n");
409 ret = -ENODEV;
410 goto out;
411 }
412
413 /* put dm9620 devices in dm9601 mode */
414 if (id == ID_DM9620) {
415 u8 mode;
416
417 if (dm_read_reg(dev, DM_MODE_CTRL, &mode) < 0) {
418 netdev_err(dev->net, "Error reading MODE_CTRL\n");
419 ret = -ENODEV;
420 goto out;
421 }
422 dm_write_reg(dev, DM_MODE_CTRL, mode & 0x7f);
423 }
424
425 /* power up phy */
426 dm_write_reg(dev, DM_GPR_CTRL, 1);
427 dm_write_reg(dev, DM_GPR_DATA, 0);
428
429 /* receive broadcast packets */
430 dm9601_set_multicast(dev->net);
431
432 dm9601_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
433 dm9601_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
434 ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP);
435 mii_nway_restart(&dev->mii);
436
437 out:
438 return ret;
439 }
440
dm9601_rx_fixup(struct usbnet * dev,struct sk_buff * skb)441 static int dm9601_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
442 {
443 u8 status;
444 int len;
445
446 /* format:
447 b1: rx status
448 b2: packet length (incl crc) low
449 b3: packet length (incl crc) high
450 b4..n-4: packet data
451 bn-3..bn: ethernet crc
452 */
453
454 if (unlikely(skb->len < DM_RX_OVERHEAD)) {
455 dev_err(&dev->udev->dev, "unexpected tiny rx frame\n");
456 return 0;
457 }
458
459 status = skb->data[0];
460 len = (skb->data[1] | (skb->data[2] << 8)) - 4;
461
462 if (unlikely(status & 0xbf)) {
463 if (status & 0x01) dev->net->stats.rx_fifo_errors++;
464 if (status & 0x02) dev->net->stats.rx_crc_errors++;
465 if (status & 0x04) dev->net->stats.rx_frame_errors++;
466 if (status & 0x20) dev->net->stats.rx_missed_errors++;
467 if (status & 0x90) dev->net->stats.rx_length_errors++;
468 return 0;
469 }
470
471 skb_pull(skb, 3);
472 skb_trim(skb, len);
473
474 return 1;
475 }
476
dm9601_tx_fixup(struct usbnet * dev,struct sk_buff * skb,gfp_t flags)477 static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
478 gfp_t flags)
479 {
480 int len, pad;
481
482 /* format:
483 b1: packet length low
484 b2: packet length high
485 b3..n: packet data
486 */
487
488 len = skb->len + DM_TX_OVERHEAD;
489
490 /* workaround for dm962x errata with tx fifo getting out of
491 * sync if a USB bulk transfer retry happens right after a
492 * packet with odd / maxpacket length by adding up to 3 bytes
493 * padding.
494 */
495 while ((len & 1) || !(len % dev->maxpacket))
496 len++;
497
498 len -= DM_TX_OVERHEAD; /* hw header doesn't count as part of length */
499 pad = len - skb->len;
500
501 if (skb_headroom(skb) < DM_TX_OVERHEAD || skb_tailroom(skb) < pad) {
502 struct sk_buff *skb2;
503
504 skb2 = skb_copy_expand(skb, DM_TX_OVERHEAD, pad, flags);
505 dev_kfree_skb_any(skb);
506 skb = skb2;
507 if (!skb)
508 return NULL;
509 }
510
511 __skb_push(skb, DM_TX_OVERHEAD);
512
513 if (pad) {
514 memset(skb->data + skb->len, 0, pad);
515 __skb_put(skb, pad);
516 }
517
518 skb->data[0] = len;
519 skb->data[1] = len >> 8;
520
521 return skb;
522 }
523
dm9601_status(struct usbnet * dev,struct urb * urb)524 static void dm9601_status(struct usbnet *dev, struct urb *urb)
525 {
526 int link;
527 u8 *buf;
528
529 /* format:
530 b0: net status
531 b1: tx status 1
532 b2: tx status 2
533 b3: rx status
534 b4: rx overflow
535 b5: rx count
536 b6: tx count
537 b7: gpr
538 */
539
540 if (urb->actual_length < 8)
541 return;
542
543 buf = urb->transfer_buffer;
544
545 link = !!(buf[0] & 0x40);
546 if (netif_carrier_ok(dev->net) != link) {
547 usbnet_link_change(dev, link, 1);
548 netdev_dbg(dev->net, "Link Status is: %d\n", link);
549 }
550 }
551
dm9601_link_reset(struct usbnet * dev)552 static int dm9601_link_reset(struct usbnet *dev)
553 {
554 struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
555
556 mii_check_media(&dev->mii, 1, 1);
557 mii_ethtool_gset(&dev->mii, &ecmd);
558
559 netdev_dbg(dev->net, "link_reset() speed: %u duplex: %d\n",
560 ethtool_cmd_speed(&ecmd), ecmd.duplex);
561
562 return 0;
563 }
564
565 static const struct driver_info dm9601_info = {
566 .description = "Davicom DM96xx USB 10/100 Ethernet",
567 .flags = FLAG_ETHER | FLAG_LINK_INTR,
568 .bind = dm9601_bind,
569 .rx_fixup = dm9601_rx_fixup,
570 .tx_fixup = dm9601_tx_fixup,
571 .status = dm9601_status,
572 .link_reset = dm9601_link_reset,
573 .reset = dm9601_link_reset,
574 };
575
576 static const struct usb_device_id products[] = {
577 {
578 USB_DEVICE(0x07aa, 0x9601), /* Corega FEther USB-TXC */
579 .driver_info = (unsigned long)&dm9601_info,
580 },
581 {
582 USB_DEVICE(0x0a46, 0x9601), /* Davicom USB-100 */
583 .driver_info = (unsigned long)&dm9601_info,
584 },
585 {
586 USB_DEVICE(0x0a46, 0x6688), /* ZT6688 USB NIC */
587 .driver_info = (unsigned long)&dm9601_info,
588 },
589 {
590 USB_DEVICE(0x0a46, 0x0268), /* ShanTou ST268 USB NIC */
591 .driver_info = (unsigned long)&dm9601_info,
592 },
593 {
594 USB_DEVICE(0x0a46, 0x8515), /* ADMtek ADM8515 USB NIC */
595 .driver_info = (unsigned long)&dm9601_info,
596 },
597 {
598 USB_DEVICE(0x0a47, 0x9601), /* Hirose USB-100 */
599 .driver_info = (unsigned long)&dm9601_info,
600 },
601 {
602 USB_DEVICE(0x0fe6, 0x8101), /* DM9601 USB to Fast Ethernet Adapter */
603 .driver_info = (unsigned long)&dm9601_info,
604 },
605 {
606 USB_DEVICE(0x0fe6, 0x9700), /* DM9601 USB to Fast Ethernet Adapter */
607 .driver_info = (unsigned long)&dm9601_info,
608 },
609 {
610 USB_DEVICE(0x0a46, 0x9000), /* DM9000E */
611 .driver_info = (unsigned long)&dm9601_info,
612 },
613 {
614 USB_DEVICE(0x0a46, 0x9620), /* DM9620 USB to Fast Ethernet Adapter */
615 .driver_info = (unsigned long)&dm9601_info,
616 },
617 {
618 USB_DEVICE(0x0a46, 0x9621), /* DM9621A USB to Fast Ethernet Adapter */
619 .driver_info = (unsigned long)&dm9601_info,
620 },
621 {
622 USB_DEVICE(0x0a46, 0x9622), /* DM9622 USB to Fast Ethernet Adapter */
623 .driver_info = (unsigned long)&dm9601_info,
624 },
625 {
626 USB_DEVICE(0x0a46, 0x0269), /* DM962OA USB to Fast Ethernet Adapter */
627 .driver_info = (unsigned long)&dm9601_info,
628 },
629 {
630 USB_DEVICE(0x0a46, 0x1269), /* DM9621A USB to Fast Ethernet Adapter */
631 .driver_info = (unsigned long)&dm9601_info,
632 },
633 {
634 USB_DEVICE(0x0586, 0x3427), /* ZyXEL Keenetic Plus DSL xDSL modem */
635 .driver_info = (unsigned long)&dm9601_info,
636 },
637 {}, // END
638 };
639
640 MODULE_DEVICE_TABLE(usb, products);
641
642 static struct usb_driver dm9601_driver = {
643 .name = "dm9601",
644 .id_table = products,
645 .probe = usbnet_probe,
646 .disconnect = usbnet_disconnect,
647 .suspend = usbnet_suspend,
648 .resume = usbnet_resume,
649 .disable_hub_initiated_lpm = 1,
650 };
651
652 module_usb_driver(dm9601_driver);
653
654 MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>");
655 MODULE_DESCRIPTION("Davicom DM96xx USB 10/100 ethernet devices");
656 MODULE_LICENSE("GPL");
657