asix_devices.c 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116
  1. /*
  2. * ASIX AX8817X based USB 2.0 Ethernet Devices
  3. * Copyright (C) 2003-2006 David Hollis <dhollis@davehollis.com>
  4. * Copyright (C) 2005 Phil Chang <pchang23@sbcglobal.net>
  5. * Copyright (C) 2006 James Painter <jamie.painter@iname.com>
  6. * Copyright (c) 2002-2003 TiVo Inc.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #include "asix.h"
  22. #define PHY_MODE_MARVELL 0x0000
  23. #define MII_MARVELL_LED_CTRL 0x0018
  24. #define MII_MARVELL_STATUS 0x001b
  25. #define MII_MARVELL_CTRL 0x0014
  26. #define MARVELL_LED_MANUAL 0x0019
  27. #define MARVELL_STATUS_HWCFG 0x0004
  28. #define MARVELL_CTRL_TXDELAY 0x0002
  29. #define MARVELL_CTRL_RXDELAY 0x0080
  30. #define PHY_MODE_RTL8211CL 0x000C
  31. struct ax88172_int_data {
  32. __le16 res1;
  33. u8 link;
  34. __le16 res2;
  35. u8 status;
  36. __le16 res3;
  37. } __packed;
  38. static void asix_status(struct usbnet *dev, struct urb *urb)
  39. {
  40. struct ax88172_int_data *event;
  41. int link;
  42. if (urb->actual_length < 8)
  43. return;
  44. event = urb->transfer_buffer;
  45. link = event->link & 0x01;
  46. if (netif_carrier_ok(dev->net) != link) {
  47. usbnet_link_change(dev, link, 1);
  48. netdev_dbg(dev->net, "Link Status is: %d\n", link);
  49. }
  50. }
  51. static void asix_set_netdev_dev_addr(struct usbnet *dev, u8 *addr)
  52. {
  53. if (is_valid_ether_addr(addr)) {
  54. memcpy(dev->net->dev_addr, addr, ETH_ALEN);
  55. } else {
  56. netdev_info(dev->net, "invalid hw address, using random\n");
  57. eth_hw_addr_random(dev->net);
  58. }
  59. }
  60. /* Get the PHY Identifier from the PHYSID1 & PHYSID2 MII registers */
  61. static u32 asix_get_phyid(struct usbnet *dev)
  62. {
  63. int phy_reg;
  64. u32 phy_id;
  65. int i;
  66. /* Poll for the rare case the FW or phy isn't ready yet. */
  67. for (i = 0; i < 100; i++) {
  68. phy_reg = asix_mdio_read(dev->net, dev->mii.phy_id, MII_PHYSID1);
  69. if (phy_reg != 0 && phy_reg != 0xFFFF)
  70. break;
  71. mdelay(1);
  72. }
  73. if (phy_reg <= 0 || phy_reg == 0xFFFF)
  74. return 0;
  75. phy_id = (phy_reg & 0xffff) << 16;
  76. phy_reg = asix_mdio_read(dev->net, dev->mii.phy_id, MII_PHYSID2);
  77. if (phy_reg < 0)
  78. return 0;
  79. phy_id |= (phy_reg & 0xffff);
  80. return phy_id;
  81. }
  82. static u32 asix_get_link(struct net_device *net)
  83. {
  84. struct usbnet *dev = netdev_priv(net);
  85. return mii_link_ok(&dev->mii);
  86. }
  87. static int asix_ioctl (struct net_device *net, struct ifreq *rq, int cmd)
  88. {
  89. struct usbnet *dev = netdev_priv(net);
  90. return generic_mii_ioctl(&dev->mii, if_mii(rq), cmd, NULL);
  91. }
  92. /* We need to override some ethtool_ops so we require our
  93. own structure so we don't interfere with other usbnet
  94. devices that may be connected at the same time. */
  95. static const struct ethtool_ops ax88172_ethtool_ops = {
  96. .get_drvinfo = asix_get_drvinfo,
  97. .get_link = asix_get_link,
  98. .get_msglevel = usbnet_get_msglevel,
  99. .set_msglevel = usbnet_set_msglevel,
  100. .get_wol = asix_get_wol,
  101. .set_wol = asix_set_wol,
  102. .get_eeprom_len = asix_get_eeprom_len,
  103. .get_eeprom = asix_get_eeprom,
  104. .set_eeprom = asix_set_eeprom,
  105. .get_settings = usbnet_get_settings,
  106. .set_settings = usbnet_set_settings,
  107. .nway_reset = usbnet_nway_reset,
  108. };
  109. static void ax88172_set_multicast(struct net_device *net)
  110. {
  111. struct usbnet *dev = netdev_priv(net);
  112. struct asix_data *data = (struct asix_data *)&dev->data;
  113. u8 rx_ctl = 0x8c;
  114. if (net->flags & IFF_PROMISC) {
  115. rx_ctl |= 0x01;
  116. } else if (net->flags & IFF_ALLMULTI ||
  117. netdev_mc_count(net) > AX_MAX_MCAST) {
  118. rx_ctl |= 0x02;
  119. } else if (netdev_mc_empty(net)) {
  120. /* just broadcast and directed */
  121. } else {
  122. /* We use the 20 byte dev->data
  123. * for our 8 byte filter buffer
  124. * to avoid allocating memory that
  125. * is tricky to free later */
  126. struct netdev_hw_addr *ha;
  127. u32 crc_bits;
  128. memset(data->multi_filter, 0, AX_MCAST_FILTER_SIZE);
  129. /* Build the multicast hash filter. */
  130. netdev_for_each_mc_addr(ha, net) {
  131. crc_bits = ether_crc(ETH_ALEN, ha->addr) >> 26;
  132. data->multi_filter[crc_bits >> 3] |=
  133. 1 << (crc_bits & 7);
  134. }
  135. asix_write_cmd_async(dev, AX_CMD_WRITE_MULTI_FILTER, 0, 0,
  136. AX_MCAST_FILTER_SIZE, data->multi_filter);
  137. rx_ctl |= 0x10;
  138. }
  139. asix_write_cmd_async(dev, AX_CMD_WRITE_RX_CTL, rx_ctl, 0, 0, NULL);
  140. }
  141. static int ax88172_link_reset(struct usbnet *dev)
  142. {
  143. u8 mode;
  144. struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
  145. mii_check_media(&dev->mii, 1, 1);
  146. mii_ethtool_gset(&dev->mii, &ecmd);
  147. mode = AX88172_MEDIUM_DEFAULT;
  148. if (ecmd.duplex != DUPLEX_FULL)
  149. mode |= ~AX88172_MEDIUM_FD;
  150. netdev_dbg(dev->net, "ax88172_link_reset() speed: %u duplex: %d setting mode to 0x%04x\n",
  151. ethtool_cmd_speed(&ecmd), ecmd.duplex, mode);
  152. asix_write_medium_mode(dev, mode);
  153. return 0;
  154. }
  155. static const struct net_device_ops ax88172_netdev_ops = {
  156. .ndo_open = usbnet_open,
  157. .ndo_stop = usbnet_stop,
  158. .ndo_start_xmit = usbnet_start_xmit,
  159. .ndo_tx_timeout = usbnet_tx_timeout,
  160. .ndo_change_mtu = usbnet_change_mtu,
  161. .ndo_set_mac_address = eth_mac_addr,
  162. .ndo_validate_addr = eth_validate_addr,
  163. .ndo_do_ioctl = asix_ioctl,
  164. .ndo_set_rx_mode = ax88172_set_multicast,
  165. };
  166. static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
  167. {
  168. int ret = 0;
  169. u8 buf[ETH_ALEN];
  170. int i;
  171. unsigned long gpio_bits = dev->driver_info->data;
  172. usbnet_get_endpoints(dev,intf);
  173. /* Toggle the GPIOs in a manufacturer/model specific way */
  174. for (i = 2; i >= 0; i--) {
  175. ret = asix_write_cmd(dev, AX_CMD_WRITE_GPIOS,
  176. (gpio_bits >> (i * 8)) & 0xff, 0, 0, NULL);
  177. if (ret < 0)
  178. goto out;
  179. msleep(5);
  180. }
  181. ret = asix_write_rx_ctl(dev, 0x80);
  182. if (ret < 0)
  183. goto out;
  184. /* Get the MAC address */
  185. ret = asix_read_cmd(dev, AX88172_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf);
  186. if (ret < 0) {
  187. netdev_dbg(dev->net, "read AX_CMD_READ_NODE_ID failed: %d\n",
  188. ret);
  189. goto out;
  190. }
  191. asix_set_netdev_dev_addr(dev, buf);
  192. /* Initialize MII structure */
  193. dev->mii.dev = dev->net;
  194. dev->mii.mdio_read = asix_mdio_read;
  195. dev->mii.mdio_write = asix_mdio_write;
  196. dev->mii.phy_id_mask = 0x3f;
  197. dev->mii.reg_num_mask = 0x1f;
  198. dev->mii.phy_id = asix_get_phy_addr(dev);
  199. dev->net->netdev_ops = &ax88172_netdev_ops;
  200. dev->net->ethtool_ops = &ax88172_ethtool_ops;
  201. dev->net->needed_headroom = 4; /* cf asix_tx_fixup() */
  202. dev->net->needed_tailroom = 4; /* cf asix_tx_fixup() */
  203. asix_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
  204. asix_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
  205. ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP);
  206. mii_nway_restart(&dev->mii);
  207. return 0;
  208. out:
  209. return ret;
  210. }
  211. static const struct ethtool_ops ax88772_ethtool_ops = {
  212. .get_drvinfo = asix_get_drvinfo,
  213. .get_link = asix_get_link,
  214. .get_msglevel = usbnet_get_msglevel,
  215. .set_msglevel = usbnet_set_msglevel,
  216. .get_wol = asix_get_wol,
  217. .set_wol = asix_set_wol,
  218. .get_eeprom_len = asix_get_eeprom_len,
  219. .get_eeprom = asix_get_eeprom,
  220. .set_eeprom = asix_set_eeprom,
  221. .get_settings = usbnet_get_settings,
  222. .set_settings = usbnet_set_settings,
  223. .nway_reset = usbnet_nway_reset,
  224. };
  225. static int ax88772_link_reset(struct usbnet *dev)
  226. {
  227. u16 mode;
  228. struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
  229. mii_check_media(&dev->mii, 1, 1);
  230. mii_ethtool_gset(&dev->mii, &ecmd);
  231. mode = AX88772_MEDIUM_DEFAULT;
  232. if (ethtool_cmd_speed(&ecmd) != SPEED_100)
  233. mode &= ~AX_MEDIUM_PS;
  234. if (ecmd.duplex != DUPLEX_FULL)
  235. mode &= ~AX_MEDIUM_FD;
  236. netdev_dbg(dev->net, "ax88772_link_reset() speed: %u duplex: %d setting mode to 0x%04x\n",
  237. ethtool_cmd_speed(&ecmd), ecmd.duplex, mode);
  238. asix_write_medium_mode(dev, mode);
  239. return 0;
  240. }
  241. static int ax88772_reset(struct usbnet *dev)
  242. {
  243. struct asix_data *data = (struct asix_data *)&dev->data;
  244. int ret, embd_phy;
  245. u16 rx_ctl;
  246. ret = asix_write_gpio(dev,
  247. AX_GPIO_RSE | AX_GPIO_GPO_2 | AX_GPIO_GPO2EN, 5);
  248. if (ret < 0)
  249. goto out;
  250. embd_phy = ((asix_get_phy_addr(dev) & 0x1f) == 0x10 ? 1 : 0);
  251. ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, embd_phy, 0, 0, NULL);
  252. if (ret < 0) {
  253. netdev_dbg(dev->net, "Select PHY #1 failed: %d\n", ret);
  254. goto out;
  255. }
  256. ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL);
  257. if (ret < 0)
  258. goto out;
  259. msleep(150);
  260. ret = asix_sw_reset(dev, AX_SWRESET_CLEAR);
  261. if (ret < 0)
  262. goto out;
  263. msleep(150);
  264. if (embd_phy) {
  265. ret = asix_sw_reset(dev, AX_SWRESET_IPRL);
  266. if (ret < 0)
  267. goto out;
  268. } else {
  269. ret = asix_sw_reset(dev, AX_SWRESET_PRTE);
  270. if (ret < 0)
  271. goto out;
  272. }
  273. msleep(150);
  274. rx_ctl = asix_read_rx_ctl(dev);
  275. netdev_dbg(dev->net, "RX_CTL is 0x%04x after software reset\n", rx_ctl);
  276. ret = asix_write_rx_ctl(dev, 0x0000);
  277. if (ret < 0)
  278. goto out;
  279. rx_ctl = asix_read_rx_ctl(dev);
  280. netdev_dbg(dev->net, "RX_CTL is 0x%04x setting to 0x0000\n", rx_ctl);
  281. ret = asix_sw_reset(dev, AX_SWRESET_PRL);
  282. if (ret < 0)
  283. goto out;
  284. msleep(150);
  285. ret = asix_sw_reset(dev, AX_SWRESET_IPRL | AX_SWRESET_PRL);
  286. if (ret < 0)
  287. goto out;
  288. msleep(150);
  289. asix_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
  290. asix_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
  291. ADVERTISE_ALL | ADVERTISE_CSMA);
  292. mii_nway_restart(&dev->mii);
  293. ret = asix_write_medium_mode(dev, AX88772_MEDIUM_DEFAULT);
  294. if (ret < 0)
  295. goto out;
  296. ret = asix_write_cmd(dev, AX_CMD_WRITE_IPG0,
  297. AX88772_IPG0_DEFAULT | AX88772_IPG1_DEFAULT,
  298. AX88772_IPG2_DEFAULT, 0, NULL);
  299. if (ret < 0) {
  300. netdev_dbg(dev->net, "Write IPG,IPG1,IPG2 failed: %d\n", ret);
  301. goto out;
  302. }
  303. /* Rewrite MAC address */
  304. memcpy(data->mac_addr, dev->net->dev_addr, ETH_ALEN);
  305. ret = asix_write_cmd(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,
  306. data->mac_addr);
  307. if (ret < 0)
  308. goto out;
  309. /* Set RX_CTL to default values with 2k buffer, and enable cactus */
  310. ret = asix_write_rx_ctl(dev, AX_DEFAULT_RX_CTL);
  311. if (ret < 0)
  312. goto out;
  313. rx_ctl = asix_read_rx_ctl(dev);
  314. netdev_dbg(dev->net, "RX_CTL is 0x%04x after all initializations\n",
  315. rx_ctl);
  316. rx_ctl = asix_read_medium_status(dev);
  317. netdev_dbg(dev->net,
  318. "Medium Status is 0x%04x after all initializations\n",
  319. rx_ctl);
  320. return 0;
  321. out:
  322. return ret;
  323. }
  324. static const struct net_device_ops ax88772_netdev_ops = {
  325. .ndo_open = usbnet_open,
  326. .ndo_stop = usbnet_stop,
  327. .ndo_start_xmit = usbnet_start_xmit,
  328. .ndo_tx_timeout = usbnet_tx_timeout,
  329. .ndo_change_mtu = usbnet_change_mtu,
  330. .ndo_set_mac_address = asix_set_mac_address,
  331. .ndo_validate_addr = eth_validate_addr,
  332. .ndo_do_ioctl = asix_ioctl,
  333. .ndo_set_rx_mode = asix_set_multicast,
  334. };
  335. static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
  336. {
  337. int ret, embd_phy, i;
  338. u8 buf[ETH_ALEN];
  339. u32 phyid;
  340. usbnet_get_endpoints(dev,intf);
  341. /* Get the MAC address */
  342. if (dev->driver_info->data & FLAG_EEPROM_MAC) {
  343. for (i = 0; i < (ETH_ALEN >> 1); i++) {
  344. ret = asix_read_cmd(dev, AX_CMD_READ_EEPROM, 0x04 + i,
  345. 0, 2, buf + i * 2);
  346. if (ret < 0)
  347. break;
  348. }
  349. } else {
  350. ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID,
  351. 0, 0, ETH_ALEN, buf);
  352. }
  353. if (ret < 0) {
  354. netdev_dbg(dev->net, "Failed to read MAC address: %d\n", ret);
  355. return ret;
  356. }
  357. asix_set_netdev_dev_addr(dev, buf);
  358. /* Initialize MII structure */
  359. dev->mii.dev = dev->net;
  360. dev->mii.mdio_read = asix_mdio_read;
  361. dev->mii.mdio_write = asix_mdio_write;
  362. dev->mii.phy_id_mask = 0x1f;
  363. dev->mii.reg_num_mask = 0x1f;
  364. dev->mii.phy_id = asix_get_phy_addr(dev);
  365. dev->net->netdev_ops = &ax88772_netdev_ops;
  366. dev->net->ethtool_ops = &ax88772_ethtool_ops;
  367. dev->net->needed_headroom = 4; /* cf asix_tx_fixup() */
  368. dev->net->needed_tailroom = 4; /* cf asix_tx_fixup() */
  369. embd_phy = ((dev->mii.phy_id & 0x1f) == 0x10 ? 1 : 0);
  370. /* Reset the PHY to normal operation mode */
  371. ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, embd_phy, 0, 0, NULL);
  372. if (ret < 0) {
  373. netdev_dbg(dev->net, "Select PHY #1 failed: %d\n", ret);
  374. return ret;
  375. }
  376. ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL);
  377. if (ret < 0)
  378. return ret;
  379. msleep(150);
  380. ret = asix_sw_reset(dev, AX_SWRESET_CLEAR);
  381. if (ret < 0)
  382. return ret;
  383. msleep(150);
  384. ret = asix_sw_reset(dev, embd_phy ? AX_SWRESET_IPRL : AX_SWRESET_PRTE);
  385. /* Read PHYID register *AFTER* the PHY was reset properly */
  386. phyid = asix_get_phyid(dev);
  387. netdev_dbg(dev->net, "PHYID=0x%08x\n", phyid);
  388. /* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
  389. if (dev->driver_info->flags & FLAG_FRAMING_AX) {
  390. /* hard_mtu is still the default - the device does not support
  391. jumbo eth frames */
  392. dev->rx_urb_size = 2048;
  393. }
  394. dev->driver_priv = kzalloc(sizeof(struct asix_common_private), GFP_KERNEL);
  395. if (!dev->driver_priv)
  396. return -ENOMEM;
  397. return 0;
  398. }
  399. static void ax88772_unbind(struct usbnet *dev, struct usb_interface *intf)
  400. {
  401. if (dev->driver_priv)
  402. kfree(dev->driver_priv);
  403. }
  404. static const struct ethtool_ops ax88178_ethtool_ops = {
  405. .get_drvinfo = asix_get_drvinfo,
  406. .get_link = asix_get_link,
  407. .get_msglevel = usbnet_get_msglevel,
  408. .set_msglevel = usbnet_set_msglevel,
  409. .get_wol = asix_get_wol,
  410. .set_wol = asix_set_wol,
  411. .get_eeprom_len = asix_get_eeprom_len,
  412. .get_eeprom = asix_get_eeprom,
  413. .set_eeprom = asix_set_eeprom,
  414. .get_settings = usbnet_get_settings,
  415. .set_settings = usbnet_set_settings,
  416. .nway_reset = usbnet_nway_reset,
  417. };
  418. static int marvell_phy_init(struct usbnet *dev)
  419. {
  420. struct asix_data *data = (struct asix_data *)&dev->data;
  421. u16 reg;
  422. netdev_dbg(dev->net, "marvell_phy_init()\n");
  423. reg = asix_mdio_read(dev->net, dev->mii.phy_id, MII_MARVELL_STATUS);
  424. netdev_dbg(dev->net, "MII_MARVELL_STATUS = 0x%04x\n", reg);
  425. asix_mdio_write(dev->net, dev->mii.phy_id, MII_MARVELL_CTRL,
  426. MARVELL_CTRL_RXDELAY | MARVELL_CTRL_TXDELAY);
  427. if (data->ledmode) {
  428. reg = asix_mdio_read(dev->net, dev->mii.phy_id,
  429. MII_MARVELL_LED_CTRL);
  430. netdev_dbg(dev->net, "MII_MARVELL_LED_CTRL (1) = 0x%04x\n", reg);
  431. reg &= 0xf8ff;
  432. reg |= (1 + 0x0100);
  433. asix_mdio_write(dev->net, dev->mii.phy_id,
  434. MII_MARVELL_LED_CTRL, reg);
  435. reg = asix_mdio_read(dev->net, dev->mii.phy_id,
  436. MII_MARVELL_LED_CTRL);
  437. netdev_dbg(dev->net, "MII_MARVELL_LED_CTRL (2) = 0x%04x\n", reg);
  438. reg &= 0xfc0f;
  439. }
  440. return 0;
  441. }
  442. static int rtl8211cl_phy_init(struct usbnet *dev)
  443. {
  444. struct asix_data *data = (struct asix_data *)&dev->data;
  445. netdev_dbg(dev->net, "rtl8211cl_phy_init()\n");
  446. asix_mdio_write (dev->net, dev->mii.phy_id, 0x1f, 0x0005);
  447. asix_mdio_write (dev->net, dev->mii.phy_id, 0x0c, 0);
  448. asix_mdio_write (dev->net, dev->mii.phy_id, 0x01,
  449. asix_mdio_read (dev->net, dev->mii.phy_id, 0x01) | 0x0080);
  450. asix_mdio_write (dev->net, dev->mii.phy_id, 0x1f, 0);
  451. if (data->ledmode == 12) {
  452. asix_mdio_write (dev->net, dev->mii.phy_id, 0x1f, 0x0002);
  453. asix_mdio_write (dev->net, dev->mii.phy_id, 0x1a, 0x00cb);
  454. asix_mdio_write (dev->net, dev->mii.phy_id, 0x1f, 0);
  455. }
  456. return 0;
  457. }
  458. static int marvell_led_status(struct usbnet *dev, u16 speed)
  459. {
  460. u16 reg = asix_mdio_read(dev->net, dev->mii.phy_id, MARVELL_LED_MANUAL);
  461. netdev_dbg(dev->net, "marvell_led_status() read 0x%04x\n", reg);
  462. /* Clear out the center LED bits - 0x03F0 */
  463. reg &= 0xfc0f;
  464. switch (speed) {
  465. case SPEED_1000:
  466. reg |= 0x03e0;
  467. break;
  468. case SPEED_100:
  469. reg |= 0x03b0;
  470. break;
  471. default:
  472. reg |= 0x02f0;
  473. }
  474. netdev_dbg(dev->net, "marvell_led_status() writing 0x%04x\n", reg);
  475. asix_mdio_write(dev->net, dev->mii.phy_id, MARVELL_LED_MANUAL, reg);
  476. return 0;
  477. }
  478. static int ax88178_reset(struct usbnet *dev)
  479. {
  480. struct asix_data *data = (struct asix_data *)&dev->data;
  481. int ret;
  482. __le16 eeprom;
  483. u8 status;
  484. int gpio0 = 0;
  485. u32 phyid;
  486. asix_read_cmd(dev, AX_CMD_READ_GPIOS, 0, 0, 1, &status);
  487. netdev_dbg(dev->net, "GPIO Status: 0x%04x\n", status);
  488. asix_write_cmd(dev, AX_CMD_WRITE_ENABLE, 0, 0, 0, NULL);
  489. asix_read_cmd(dev, AX_CMD_READ_EEPROM, 0x0017, 0, 2, &eeprom);
  490. asix_write_cmd(dev, AX_CMD_WRITE_DISABLE, 0, 0, 0, NULL);
  491. netdev_dbg(dev->net, "EEPROM index 0x17 is 0x%04x\n", eeprom);
  492. if (eeprom == cpu_to_le16(0xffff)) {
  493. data->phymode = PHY_MODE_MARVELL;
  494. data->ledmode = 0;
  495. gpio0 = 1;
  496. } else {
  497. data->phymode = le16_to_cpu(eeprom) & 0x7F;
  498. data->ledmode = le16_to_cpu(eeprom) >> 8;
  499. gpio0 = (le16_to_cpu(eeprom) & 0x80) ? 0 : 1;
  500. }
  501. netdev_dbg(dev->net, "GPIO0: %d, PhyMode: %d\n", gpio0, data->phymode);
  502. /* Power up external GigaPHY through AX88178 GPIO pin */
  503. asix_write_gpio(dev, AX_GPIO_RSE | AX_GPIO_GPO_1 | AX_GPIO_GPO1EN, 40);
  504. if ((le16_to_cpu(eeprom) >> 8) != 1) {
  505. asix_write_gpio(dev, 0x003c, 30);
  506. asix_write_gpio(dev, 0x001c, 300);
  507. asix_write_gpio(dev, 0x003c, 30);
  508. } else {
  509. netdev_dbg(dev->net, "gpio phymode == 1 path\n");
  510. asix_write_gpio(dev, AX_GPIO_GPO1EN, 30);
  511. asix_write_gpio(dev, AX_GPIO_GPO1EN | AX_GPIO_GPO_1, 30);
  512. }
  513. /* Read PHYID register *AFTER* powering up PHY */
  514. phyid = asix_get_phyid(dev);
  515. netdev_dbg(dev->net, "PHYID=0x%08x\n", phyid);
  516. /* Set AX88178 to enable MII/GMII/RGMII interface for external PHY */
  517. asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, 0, 0, 0, NULL);
  518. asix_sw_reset(dev, 0);
  519. msleep(150);
  520. asix_sw_reset(dev, AX_SWRESET_PRL | AX_SWRESET_IPPD);
  521. msleep(150);
  522. asix_write_rx_ctl(dev, 0);
  523. if (data->phymode == PHY_MODE_MARVELL) {
  524. marvell_phy_init(dev);
  525. msleep(60);
  526. } else if (data->phymode == PHY_MODE_RTL8211CL)
  527. rtl8211cl_phy_init(dev);
  528. asix_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR,
  529. BMCR_RESET | BMCR_ANENABLE);
  530. asix_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
  531. ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP);
  532. asix_mdio_write(dev->net, dev->mii.phy_id, MII_CTRL1000,
  533. ADVERTISE_1000FULL);
  534. mii_nway_restart(&dev->mii);
  535. ret = asix_write_medium_mode(dev, AX88178_MEDIUM_DEFAULT);
  536. if (ret < 0)
  537. return ret;
  538. /* Rewrite MAC address */
  539. memcpy(data->mac_addr, dev->net->dev_addr, ETH_ALEN);
  540. ret = asix_write_cmd(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,
  541. data->mac_addr);
  542. if (ret < 0)
  543. return ret;
  544. ret = asix_write_rx_ctl(dev, AX_DEFAULT_RX_CTL);
  545. if (ret < 0)
  546. return ret;
  547. return 0;
  548. }
  549. static int ax88178_link_reset(struct usbnet *dev)
  550. {
  551. u16 mode;
  552. struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
  553. struct asix_data *data = (struct asix_data *)&dev->data;
  554. u32 speed;
  555. netdev_dbg(dev->net, "ax88178_link_reset()\n");
  556. mii_check_media(&dev->mii, 1, 1);
  557. mii_ethtool_gset(&dev->mii, &ecmd);
  558. mode = AX88178_MEDIUM_DEFAULT;
  559. speed = ethtool_cmd_speed(&ecmd);
  560. if (speed == SPEED_1000)
  561. mode |= AX_MEDIUM_GM;
  562. else if (speed == SPEED_100)
  563. mode |= AX_MEDIUM_PS;
  564. else
  565. mode &= ~(AX_MEDIUM_PS | AX_MEDIUM_GM);
  566. mode |= AX_MEDIUM_ENCK;
  567. if (ecmd.duplex == DUPLEX_FULL)
  568. mode |= AX_MEDIUM_FD;
  569. else
  570. mode &= ~AX_MEDIUM_FD;
  571. netdev_dbg(dev->net, "ax88178_link_reset() speed: %u duplex: %d setting mode to 0x%04x\n",
  572. speed, ecmd.duplex, mode);
  573. asix_write_medium_mode(dev, mode);
  574. if (data->phymode == PHY_MODE_MARVELL && data->ledmode)
  575. marvell_led_status(dev, speed);
  576. return 0;
  577. }
  578. static void ax88178_set_mfb(struct usbnet *dev)
  579. {
  580. u16 mfb = AX_RX_CTL_MFB_16384;
  581. u16 rxctl;
  582. u16 medium;
  583. int old_rx_urb_size = dev->rx_urb_size;
  584. if (dev->hard_mtu < 2048) {
  585. dev->rx_urb_size = 2048;
  586. mfb = AX_RX_CTL_MFB_2048;
  587. } else if (dev->hard_mtu < 4096) {
  588. dev->rx_urb_size = 4096;
  589. mfb = AX_RX_CTL_MFB_4096;
  590. } else if (dev->hard_mtu < 8192) {
  591. dev->rx_urb_size = 8192;
  592. mfb = AX_RX_CTL_MFB_8192;
  593. } else if (dev->hard_mtu < 16384) {
  594. dev->rx_urb_size = 16384;
  595. mfb = AX_RX_CTL_MFB_16384;
  596. }
  597. rxctl = asix_read_rx_ctl(dev);
  598. asix_write_rx_ctl(dev, (rxctl & ~AX_RX_CTL_MFB_16384) | mfb);
  599. medium = asix_read_medium_status(dev);
  600. if (dev->net->mtu > 1500)
  601. medium |= AX_MEDIUM_JFE;
  602. else
  603. medium &= ~AX_MEDIUM_JFE;
  604. asix_write_medium_mode(dev, medium);
  605. if (dev->rx_urb_size > old_rx_urb_size)
  606. usbnet_unlink_rx_urbs(dev);
  607. }
  608. static int ax88178_change_mtu(struct net_device *net, int new_mtu)
  609. {
  610. struct usbnet *dev = netdev_priv(net);
  611. int ll_mtu = new_mtu + net->hard_header_len + 4;
  612. netdev_dbg(dev->net, "ax88178_change_mtu() new_mtu=%d\n", new_mtu);
  613. if (new_mtu <= 0 || ll_mtu > 16384)
  614. return -EINVAL;
  615. if ((ll_mtu % dev->maxpacket) == 0)
  616. return -EDOM;
  617. net->mtu = new_mtu;
  618. dev->hard_mtu = net->mtu + net->hard_header_len;
  619. ax88178_set_mfb(dev);
  620. /* max qlen depend on hard_mtu and rx_urb_size */
  621. usbnet_update_max_qlen(dev);
  622. return 0;
  623. }
  624. static const struct net_device_ops ax88178_netdev_ops = {
  625. .ndo_open = usbnet_open,
  626. .ndo_stop = usbnet_stop,
  627. .ndo_start_xmit = usbnet_start_xmit,
  628. .ndo_tx_timeout = usbnet_tx_timeout,
  629. .ndo_set_mac_address = asix_set_mac_address,
  630. .ndo_validate_addr = eth_validate_addr,
  631. .ndo_set_rx_mode = asix_set_multicast,
  632. .ndo_do_ioctl = asix_ioctl,
  633. .ndo_change_mtu = ax88178_change_mtu,
  634. };
  635. static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
  636. {
  637. int ret;
  638. u8 buf[ETH_ALEN];
  639. usbnet_get_endpoints(dev,intf);
  640. /* Get the MAC address */
  641. ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID, 0, 0, ETH_ALEN, buf);
  642. if (ret < 0) {
  643. netdev_dbg(dev->net, "Failed to read MAC address: %d\n", ret);
  644. return ret;
  645. }
  646. asix_set_netdev_dev_addr(dev, buf);
  647. /* Initialize MII structure */
  648. dev->mii.dev = dev->net;
  649. dev->mii.mdio_read = asix_mdio_read;
  650. dev->mii.mdio_write = asix_mdio_write;
  651. dev->mii.phy_id_mask = 0x1f;
  652. dev->mii.reg_num_mask = 0xff;
  653. dev->mii.supports_gmii = 1;
  654. dev->mii.phy_id = asix_get_phy_addr(dev);
  655. dev->net->netdev_ops = &ax88178_netdev_ops;
  656. dev->net->ethtool_ops = &ax88178_ethtool_ops;
  657. /* Blink LEDS so users know driver saw dongle */
  658. asix_sw_reset(dev, 0);
  659. msleep(150);
  660. asix_sw_reset(dev, AX_SWRESET_PRL | AX_SWRESET_IPPD);
  661. msleep(150);
  662. /* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
  663. if (dev->driver_info->flags & FLAG_FRAMING_AX) {
  664. /* hard_mtu is still the default - the device does not support
  665. jumbo eth frames */
  666. dev->rx_urb_size = 2048;
  667. }
  668. dev->driver_priv = kzalloc(sizeof(struct asix_common_private), GFP_KERNEL);
  669. if (!dev->driver_priv)
  670. return -ENOMEM;
  671. return 0;
  672. }
  673. static const struct driver_info ax8817x_info = {
  674. .description = "ASIX AX8817x USB 2.0 Ethernet",
  675. .bind = ax88172_bind,
  676. .status = asix_status,
  677. .link_reset = ax88172_link_reset,
  678. .reset = ax88172_link_reset,
  679. .flags = FLAG_ETHER | FLAG_LINK_INTR,
  680. .data = 0x00130103,
  681. };
  682. static const struct driver_info dlink_dub_e100_info = {
  683. .description = "DLink DUB-E100 USB Ethernet",
  684. .bind = ax88172_bind,
  685. .status = asix_status,
  686. .link_reset = ax88172_link_reset,
  687. .reset = ax88172_link_reset,
  688. .flags = FLAG_ETHER | FLAG_LINK_INTR,
  689. .data = 0x009f9d9f,
  690. };
  691. static const struct driver_info netgear_fa120_info = {
  692. .description = "Netgear FA-120 USB Ethernet",
  693. .bind = ax88172_bind,
  694. .status = asix_status,
  695. .link_reset = ax88172_link_reset,
  696. .reset = ax88172_link_reset,
  697. .flags = FLAG_ETHER | FLAG_LINK_INTR,
  698. .data = 0x00130103,
  699. };
  700. static const struct driver_info hawking_uf200_info = {
  701. .description = "Hawking UF200 USB Ethernet",
  702. .bind = ax88172_bind,
  703. .status = asix_status,
  704. .link_reset = ax88172_link_reset,
  705. .reset = ax88172_link_reset,
  706. .flags = FLAG_ETHER | FLAG_LINK_INTR,
  707. .data = 0x001f1d1f,
  708. };
  709. static const struct driver_info ax88772_info = {
  710. .description = "ASIX AX88772 USB 2.0 Ethernet",
  711. .bind = ax88772_bind,
  712. .unbind = ax88772_unbind,
  713. .status = asix_status,
  714. .link_reset = ax88772_link_reset,
  715. .reset = ax88772_reset,
  716. .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR | FLAG_MULTI_PACKET,
  717. .rx_fixup = asix_rx_fixup_common,
  718. .tx_fixup = asix_tx_fixup,
  719. };
  720. static const struct driver_info ax88772b_info = {
  721. .description = "ASIX AX88772B USB 2.0 Ethernet",
  722. .bind = ax88772_bind,
  723. .unbind = ax88772_unbind,
  724. .status = asix_status,
  725. .link_reset = ax88772_link_reset,
  726. .reset = ax88772_reset,
  727. .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR |
  728. FLAG_MULTI_PACKET,
  729. .rx_fixup = asix_rx_fixup_common,
  730. .tx_fixup = asix_tx_fixup,
  731. .data = FLAG_EEPROM_MAC,
  732. };
  733. static const struct driver_info ax88178_info = {
  734. .description = "ASIX AX88178 USB 2.0 Ethernet",
  735. .bind = ax88178_bind,
  736. .unbind = ax88772_unbind,
  737. .status = asix_status,
  738. .link_reset = ax88178_link_reset,
  739. .reset = ax88178_reset,
  740. .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR |
  741. FLAG_MULTI_PACKET,
  742. .rx_fixup = asix_rx_fixup_common,
  743. .tx_fixup = asix_tx_fixup,
  744. };
  745. /*
  746. * USBLINK 20F9 "USB 2.0 LAN" USB ethernet adapter, typically found in
  747. * no-name packaging.
  748. * USB device strings are:
  749. * 1: Manufacturer: USBLINK
  750. * 2: Product: HG20F9 USB2.0
  751. * 3: Serial: 000003
  752. * Appears to be compatible with Asix 88772B.
  753. */
  754. static const struct driver_info hg20f9_info = {
  755. .description = "HG20F9 USB 2.0 Ethernet",
  756. .bind = ax88772_bind,
  757. .unbind = ax88772_unbind,
  758. .status = asix_status,
  759. .link_reset = ax88772_link_reset,
  760. .reset = ax88772_reset,
  761. .flags = FLAG_ETHER | FLAG_FRAMING_AX | FLAG_LINK_INTR |
  762. FLAG_MULTI_PACKET,
  763. .rx_fixup = asix_rx_fixup_common,
  764. .tx_fixup = asix_tx_fixup,
  765. .data = FLAG_EEPROM_MAC,
  766. };
  767. static const struct usb_device_id products [] = {
  768. {
  769. // Linksys USB200M
  770. USB_DEVICE (0x077b, 0x2226),
  771. .driver_info = (unsigned long) &ax8817x_info,
  772. }, {
  773. // Netgear FA120
  774. USB_DEVICE (0x0846, 0x1040),
  775. .driver_info = (unsigned long) &netgear_fa120_info,
  776. }, {
  777. // DLink DUB-E100
  778. USB_DEVICE (0x2001, 0x1a00),
  779. .driver_info = (unsigned long) &dlink_dub_e100_info,
  780. }, {
  781. // Intellinet, ST Lab USB Ethernet
  782. USB_DEVICE (0x0b95, 0x1720),
  783. .driver_info = (unsigned long) &ax8817x_info,
  784. }, {
  785. // Hawking UF200, TrendNet TU2-ET100
  786. USB_DEVICE (0x07b8, 0x420a),
  787. .driver_info = (unsigned long) &hawking_uf200_info,
  788. }, {
  789. // Billionton Systems, USB2AR
  790. USB_DEVICE (0x08dd, 0x90ff),
  791. .driver_info = (unsigned long) &ax8817x_info,
  792. }, {
  793. // ATEN UC210T
  794. USB_DEVICE (0x0557, 0x2009),
  795. .driver_info = (unsigned long) &ax8817x_info,
  796. }, {
  797. // Buffalo LUA-U2-KTX
  798. USB_DEVICE (0x0411, 0x003d),
  799. .driver_info = (unsigned long) &ax8817x_info,
  800. }, {
  801. // Buffalo LUA-U2-GT 10/100/1000
  802. USB_DEVICE (0x0411, 0x006e),
  803. .driver_info = (unsigned long) &ax88178_info,
  804. }, {
  805. // Sitecom LN-029 "USB 2.0 10/100 Ethernet adapter"
  806. USB_DEVICE (0x6189, 0x182d),
  807. .driver_info = (unsigned long) &ax8817x_info,
  808. }, {
  809. // Sitecom LN-031 "USB 2.0 10/100/1000 Ethernet adapter"
  810. USB_DEVICE (0x0df6, 0x0056),
  811. .driver_info = (unsigned long) &ax88178_info,
  812. }, {
  813. // corega FEther USB2-TX
  814. USB_DEVICE (0x07aa, 0x0017),
  815. .driver_info = (unsigned long) &ax8817x_info,
  816. }, {
  817. // Surecom EP-1427X-2
  818. USB_DEVICE (0x1189, 0x0893),
  819. .driver_info = (unsigned long) &ax8817x_info,
  820. }, {
  821. // goodway corp usb gwusb2e
  822. USB_DEVICE (0x1631, 0x6200),
  823. .driver_info = (unsigned long) &ax8817x_info,
  824. }, {
  825. // JVC MP-PRX1 Port Replicator
  826. USB_DEVICE (0x04f1, 0x3008),
  827. .driver_info = (unsigned long) &ax8817x_info,
  828. }, {
  829. // Lenovo U2L100P 10/100
  830. USB_DEVICE (0x17ef, 0x7203),
  831. .driver_info = (unsigned long) &ax88772_info,
  832. }, {
  833. // ASIX AX88772B 10/100
  834. USB_DEVICE (0x0b95, 0x772b),
  835. .driver_info = (unsigned long) &ax88772b_info,
  836. }, {
  837. // ASIX AX88772 10/100
  838. USB_DEVICE (0x0b95, 0x7720),
  839. .driver_info = (unsigned long) &ax88772_info,
  840. }, {
  841. // ASIX AX88178 10/100/1000
  842. USB_DEVICE (0x0b95, 0x1780),
  843. .driver_info = (unsigned long) &ax88178_info,
  844. }, {
  845. // Logitec LAN-GTJ/U2A
  846. USB_DEVICE (0x0789, 0x0160),
  847. .driver_info = (unsigned long) &ax88178_info,
  848. }, {
  849. // Linksys USB200M Rev 2
  850. USB_DEVICE (0x13b1, 0x0018),
  851. .driver_info = (unsigned long) &ax88772_info,
  852. }, {
  853. // 0Q0 cable ethernet
  854. USB_DEVICE (0x1557, 0x7720),
  855. .driver_info = (unsigned long) &ax88772_info,
  856. }, {
  857. // DLink DUB-E100 H/W Ver B1
  858. USB_DEVICE (0x07d1, 0x3c05),
  859. .driver_info = (unsigned long) &ax88772_info,
  860. }, {
  861. // DLink DUB-E100 H/W Ver B1 Alternate
  862. USB_DEVICE (0x2001, 0x3c05),
  863. .driver_info = (unsigned long) &ax88772_info,
  864. }, {
  865. // DLink DUB-E100 H/W Ver C1
  866. USB_DEVICE (0x2001, 0x1a02),
  867. .driver_info = (unsigned long) &ax88772_info,
  868. }, {
  869. // Linksys USB1000
  870. USB_DEVICE (0x1737, 0x0039),
  871. .driver_info = (unsigned long) &ax88178_info,
  872. }, {
  873. // IO-DATA ETG-US2
  874. USB_DEVICE (0x04bb, 0x0930),
  875. .driver_info = (unsigned long) &ax88178_info,
  876. }, {
  877. // Belkin F5D5055
  878. USB_DEVICE(0x050d, 0x5055),
  879. .driver_info = (unsigned long) &ax88178_info,
  880. }, {
  881. // Apple USB Ethernet Adapter
  882. USB_DEVICE(0x05ac, 0x1402),
  883. .driver_info = (unsigned long) &ax88772_info,
  884. }, {
  885. // Cables-to-Go USB Ethernet Adapter
  886. USB_DEVICE(0x0b95, 0x772a),
  887. .driver_info = (unsigned long) &ax88772_info,
  888. }, {
  889. // ABOCOM for pci
  890. USB_DEVICE(0x14ea, 0xab11),
  891. .driver_info = (unsigned long) &ax88178_info,
  892. }, {
  893. // ASIX 88772a
  894. USB_DEVICE(0x0db0, 0xa877),
  895. .driver_info = (unsigned long) &ax88772_info,
  896. }, {
  897. // Asus USB Ethernet Adapter
  898. USB_DEVICE (0x0b95, 0x7e2b),
  899. .driver_info = (unsigned long) &ax88772_info,
  900. }, {
  901. /* ASIX 88172a demo board */
  902. USB_DEVICE(0x0b95, 0x172a),
  903. .driver_info = (unsigned long) &ax88172a_info,
  904. }, {
  905. /*
  906. * USBLINK HG20F9 "USB 2.0 LAN"
  907. * Appears to have gazumped Linksys's manufacturer ID but
  908. * doesn't (yet) conflict with any known Linksys product.
  909. */
  910. USB_DEVICE(0x066b, 0x20f9),
  911. .driver_info = (unsigned long) &hg20f9_info,
  912. },
  913. { }, // END
  914. };
  915. MODULE_DEVICE_TABLE(usb, products);
  916. static struct usb_driver asix_driver = {
  917. .name = DRIVER_NAME,
  918. .id_table = products,
  919. .probe = usbnet_probe,
  920. .suspend = usbnet_suspend,
  921. .resume = usbnet_resume,
  922. .disconnect = usbnet_disconnect,
  923. .supports_autosuspend = 1,
  924. .disable_hub_initiated_lpm = 1,
  925. };
  926. module_usb_driver(asix_driver);
  927. MODULE_AUTHOR("David Hollis");
  928. MODULE_VERSION(DRIVER_VERSION);
  929. MODULE_DESCRIPTION("ASIX AX8817X based USB 2.0 Ethernet Devices");
  930. MODULE_LICENSE("GPL");