dm9601.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  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. .get_settings = usbnet_get_settings,
  228. .set_settings = usbnet_set_settings,
  229. .nway_reset = usbnet_nway_reset,
  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_validate_addr = eth_validate_addr,
  279. .ndo_do_ioctl = dm9601_ioctl,
  280. .ndo_set_rx_mode = dm9601_set_multicast,
  281. .ndo_set_mac_address = dm9601_set_mac_address,
  282. };
  283. static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
  284. {
  285. int ret;
  286. u8 mac[ETH_ALEN], id;
  287. ret = usbnet_get_endpoints(dev, intf);
  288. if (ret)
  289. goto out;
  290. dev->net->netdev_ops = &dm9601_netdev_ops;
  291. dev->net->ethtool_ops = &dm9601_ethtool_ops;
  292. dev->net->hard_header_len += DM_TX_OVERHEAD;
  293. dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
  294. /* dm9620/21a require room for 4 byte padding, even in dm9601
  295. * mode, so we need +1 to be able to receive full size
  296. * ethernet frames.
  297. */
  298. dev->rx_urb_size = dev->net->mtu + ETH_HLEN + DM_RX_OVERHEAD + 1;
  299. dev->mii.dev = dev->net;
  300. dev->mii.mdio_read = dm9601_mdio_read;
  301. dev->mii.mdio_write = dm9601_mdio_write;
  302. dev->mii.phy_id_mask = 0x1f;
  303. dev->mii.reg_num_mask = 0x1f;
  304. /* reset */
  305. dm_write_reg(dev, DM_NET_CTRL, 1);
  306. udelay(20);
  307. /* read MAC */
  308. if (dm_read(dev, DM_PHY_ADDR, ETH_ALEN, mac) < 0) {
  309. printk(KERN_ERR "Error reading MAC address\n");
  310. ret = -ENODEV;
  311. goto out;
  312. }
  313. /*
  314. * Overwrite the auto-generated address only with good ones.
  315. */
  316. if (is_valid_ether_addr(mac))
  317. memcpy(dev->net->dev_addr, mac, ETH_ALEN);
  318. else {
  319. printk(KERN_WARNING
  320. "dm9601: No valid MAC address in EEPROM, using %pM\n",
  321. dev->net->dev_addr);
  322. __dm9601_set_mac_address(dev);
  323. }
  324. if (dm_read_reg(dev, DM_CHIP_ID, &id) < 0) {
  325. netdev_err(dev->net, "Error reading chip ID\n");
  326. ret = -ENODEV;
  327. goto out;
  328. }
  329. /* put dm9620 devices in dm9601 mode */
  330. if (id == ID_DM9620) {
  331. u8 mode;
  332. if (dm_read_reg(dev, DM_MODE_CTRL, &mode) < 0) {
  333. netdev_err(dev->net, "Error reading MODE_CTRL\n");
  334. ret = -ENODEV;
  335. goto out;
  336. }
  337. dm_write_reg(dev, DM_MODE_CTRL, mode & 0x7f);
  338. }
  339. /* power up phy */
  340. dm_write_reg(dev, DM_GPR_CTRL, 1);
  341. dm_write_reg(dev, DM_GPR_DATA, 0);
  342. /* receive broadcast packets */
  343. dm9601_set_multicast(dev->net);
  344. dm9601_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
  345. dm9601_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
  346. ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP);
  347. mii_nway_restart(&dev->mii);
  348. out:
  349. return ret;
  350. }
  351. static int dm9601_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
  352. {
  353. u8 status;
  354. int len;
  355. /* format:
  356. b1: rx status
  357. b2: packet length (incl crc) low
  358. b3: packet length (incl crc) high
  359. b4..n-4: packet data
  360. bn-3..bn: ethernet crc
  361. */
  362. if (unlikely(skb->len < DM_RX_OVERHEAD)) {
  363. dev_err(&dev->udev->dev, "unexpected tiny rx frame\n");
  364. return 0;
  365. }
  366. status = skb->data[0];
  367. len = (skb->data[1] | (skb->data[2] << 8)) - 4;
  368. if (unlikely(status & 0xbf)) {
  369. if (status & 0x01) dev->net->stats.rx_fifo_errors++;
  370. if (status & 0x02) dev->net->stats.rx_crc_errors++;
  371. if (status & 0x04) dev->net->stats.rx_frame_errors++;
  372. if (status & 0x20) dev->net->stats.rx_missed_errors++;
  373. if (status & 0x90) dev->net->stats.rx_length_errors++;
  374. return 0;
  375. }
  376. skb_pull(skb, 3);
  377. skb_trim(skb, len);
  378. return 1;
  379. }
  380. static struct sk_buff *dm9601_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
  381. gfp_t flags)
  382. {
  383. int len, pad;
  384. /* format:
  385. b1: packet length low
  386. b2: packet length high
  387. b3..n: packet data
  388. */
  389. len = skb->len + DM_TX_OVERHEAD;
  390. /* workaround for dm962x errata with tx fifo getting out of
  391. * sync if a USB bulk transfer retry happens right after a
  392. * packet with odd / maxpacket length by adding up to 3 bytes
  393. * padding.
  394. */
  395. while ((len & 1) || !(len % dev->maxpacket))
  396. len++;
  397. len -= DM_TX_OVERHEAD; /* hw header doesn't count as part of length */
  398. pad = len - skb->len;
  399. if (skb_headroom(skb) < DM_TX_OVERHEAD || skb_tailroom(skb) < pad) {
  400. struct sk_buff *skb2;
  401. skb2 = skb_copy_expand(skb, DM_TX_OVERHEAD, pad, flags);
  402. dev_kfree_skb_any(skb);
  403. skb = skb2;
  404. if (!skb)
  405. return NULL;
  406. }
  407. __skb_push(skb, DM_TX_OVERHEAD);
  408. if (pad) {
  409. memset(skb->data + skb->len, 0, pad);
  410. __skb_put(skb, pad);
  411. }
  412. skb->data[0] = len;
  413. skb->data[1] = len >> 8;
  414. return skb;
  415. }
  416. static void dm9601_status(struct usbnet *dev, struct urb *urb)
  417. {
  418. int link;
  419. u8 *buf;
  420. /* format:
  421. b0: net status
  422. b1: tx status 1
  423. b2: tx status 2
  424. b3: rx status
  425. b4: rx overflow
  426. b5: rx count
  427. b6: tx count
  428. b7: gpr
  429. */
  430. if (urb->actual_length < 8)
  431. return;
  432. buf = urb->transfer_buffer;
  433. link = !!(buf[0] & 0x40);
  434. if (netif_carrier_ok(dev->net) != link) {
  435. usbnet_link_change(dev, link, 1);
  436. netdev_dbg(dev->net, "Link Status is: %d\n", link);
  437. }
  438. }
  439. static int dm9601_link_reset(struct usbnet *dev)
  440. {
  441. struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
  442. mii_check_media(&dev->mii, 1, 1);
  443. mii_ethtool_gset(&dev->mii, &ecmd);
  444. netdev_dbg(dev->net, "link_reset() speed: %u duplex: %d\n",
  445. ethtool_cmd_speed(&ecmd), ecmd.duplex);
  446. return 0;
  447. }
  448. static const struct driver_info dm9601_info = {
  449. .description = "Davicom DM96xx USB 10/100 Ethernet",
  450. .flags = FLAG_ETHER | FLAG_LINK_INTR,
  451. .bind = dm9601_bind,
  452. .rx_fixup = dm9601_rx_fixup,
  453. .tx_fixup = dm9601_tx_fixup,
  454. .status = dm9601_status,
  455. .link_reset = dm9601_link_reset,
  456. .reset = dm9601_link_reset,
  457. };
  458. static const struct usb_device_id products[] = {
  459. {
  460. USB_DEVICE(0x07aa, 0x9601), /* Corega FEther USB-TXC */
  461. .driver_info = (unsigned long)&dm9601_info,
  462. },
  463. {
  464. USB_DEVICE(0x0a46, 0x9601), /* Davicom USB-100 */
  465. .driver_info = (unsigned long)&dm9601_info,
  466. },
  467. {
  468. USB_DEVICE(0x0a46, 0x6688), /* ZT6688 USB NIC */
  469. .driver_info = (unsigned long)&dm9601_info,
  470. },
  471. {
  472. USB_DEVICE(0x0a46, 0x0268), /* ShanTou ST268 USB NIC */
  473. .driver_info = (unsigned long)&dm9601_info,
  474. },
  475. {
  476. USB_DEVICE(0x0a46, 0x8515), /* ADMtek ADM8515 USB NIC */
  477. .driver_info = (unsigned long)&dm9601_info,
  478. },
  479. {
  480. USB_DEVICE(0x0a47, 0x9601), /* Hirose USB-100 */
  481. .driver_info = (unsigned long)&dm9601_info,
  482. },
  483. {
  484. USB_DEVICE(0x0fe6, 0x8101), /* DM9601 USB to Fast Ethernet Adapter */
  485. .driver_info = (unsigned long)&dm9601_info,
  486. },
  487. {
  488. USB_DEVICE(0x0fe6, 0x9700), /* DM9601 USB to Fast Ethernet Adapter */
  489. .driver_info = (unsigned long)&dm9601_info,
  490. },
  491. {
  492. USB_DEVICE(0x0a46, 0x9000), /* DM9000E */
  493. .driver_info = (unsigned long)&dm9601_info,
  494. },
  495. {
  496. USB_DEVICE(0x0a46, 0x9620), /* DM9620 USB to Fast Ethernet Adapter */
  497. .driver_info = (unsigned long)&dm9601_info,
  498. },
  499. {
  500. USB_DEVICE(0x0a46, 0x9621), /* DM9621A USB to Fast Ethernet Adapter */
  501. .driver_info = (unsigned long)&dm9601_info,
  502. },
  503. {
  504. USB_DEVICE(0x0a46, 0x9622), /* DM9622 USB to Fast Ethernet Adapter */
  505. .driver_info = (unsigned long)&dm9601_info,
  506. },
  507. {
  508. USB_DEVICE(0x0a46, 0x0269), /* DM962OA USB to Fast Ethernet Adapter */
  509. .driver_info = (unsigned long)&dm9601_info,
  510. },
  511. {
  512. USB_DEVICE(0x0a46, 0x1269), /* DM9621A USB to Fast Ethernet Adapter */
  513. .driver_info = (unsigned long)&dm9601_info,
  514. },
  515. {}, // END
  516. };
  517. MODULE_DEVICE_TABLE(usb, products);
  518. static struct usb_driver dm9601_driver = {
  519. .name = "dm9601",
  520. .id_table = products,
  521. .probe = usbnet_probe,
  522. .disconnect = usbnet_disconnect,
  523. .suspend = usbnet_suspend,
  524. .resume = usbnet_resume,
  525. .disable_hub_initiated_lpm = 1,
  526. };
  527. module_usb_driver(dm9601_driver);
  528. MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>");
  529. MODULE_DESCRIPTION("Davicom DM96xx USB 10/100 ethernet devices");
  530. MODULE_LICENSE("GPL");