dm9601.c 15 KB

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