ipheth.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. /*
  2. * ipheth.c - Apple iPhone USB Ethernet driver
  3. *
  4. * Copyright (c) 2009 Diego Giagio <diego@giagio.com>
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of GIAGIO.COM nor the names of its contributors
  16. * may be used to endorse or promote products derived from this software
  17. * without specific prior written permission.
  18. *
  19. * Alternatively, provided that this notice is retained in full, this
  20. * software may be distributed under the terms of the GNU General
  21. * Public License ("GPL") version 2, in which case the provisions of the
  22. * GPL apply INSTEAD OF those given above.
  23. *
  24. * The provided data structures and external interfaces from this code
  25. * are not restricted to be used by modules with a GPL compatible license.
  26. *
  27. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  28. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  29. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  30. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  31. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  32. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  33. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  34. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  35. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  36. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  37. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
  38. * DAMAGE.
  39. *
  40. *
  41. * Attention: iPhone device must be paired, otherwise it won't respond to our
  42. * driver. For more info: http://giagio.com/wiki/moin.cgi/iPhoneEthernetDriver
  43. *
  44. */
  45. #include <linux/kernel.h>
  46. #include <linux/errno.h>
  47. #include <linux/init.h>
  48. #include <linux/slab.h>
  49. #include <linux/module.h>
  50. #include <linux/netdevice.h>
  51. #include <linux/etherdevice.h>
  52. #include <linux/ethtool.h>
  53. #include <linux/usb.h>
  54. #include <linux/workqueue.h>
  55. #define USB_VENDOR_APPLE 0x05ac
  56. #define USB_PRODUCT_IPHONE 0x1290
  57. #define USB_PRODUCT_IPHONE_3G 0x1292
  58. #define USB_PRODUCT_IPHONE_3GS 0x1294
  59. #define USB_PRODUCT_IPHONE_4 0x1297
  60. #define USB_PRODUCT_IPAD 0x129a
  61. #define USB_PRODUCT_IPHONE_4_VZW 0x129c
  62. #define USB_PRODUCT_IPHONE_4S 0x12a0
  63. #define USB_PRODUCT_IPHONE_5 0x12a8
  64. #define IPHETH_USBINTF_CLASS 255
  65. #define IPHETH_USBINTF_SUBCLASS 253
  66. #define IPHETH_USBINTF_PROTO 1
  67. #define IPHETH_BUF_SIZE 1516
  68. #define IPHETH_IP_ALIGN 2 /* padding at front of URB */
  69. #define IPHETH_TX_TIMEOUT (5 * HZ)
  70. #define IPHETH_INTFNUM 2
  71. #define IPHETH_ALT_INTFNUM 1
  72. #define IPHETH_CTRL_ENDP 0x00
  73. #define IPHETH_CTRL_BUF_SIZE 0x40
  74. #define IPHETH_CTRL_TIMEOUT (5 * HZ)
  75. #define IPHETH_CMD_GET_MACADDR 0x00
  76. #define IPHETH_CMD_CARRIER_CHECK 0x45
  77. #define IPHETH_CARRIER_CHECK_TIMEOUT round_jiffies_relative(1 * HZ)
  78. #define IPHETH_CARRIER_ON 0x04
  79. static struct usb_device_id ipheth_table[] = {
  80. { USB_DEVICE_AND_INTERFACE_INFO(
  81. USB_VENDOR_APPLE, USB_PRODUCT_IPHONE,
  82. IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
  83. IPHETH_USBINTF_PROTO) },
  84. { USB_DEVICE_AND_INTERFACE_INFO(
  85. USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_3G,
  86. IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
  87. IPHETH_USBINTF_PROTO) },
  88. { USB_DEVICE_AND_INTERFACE_INFO(
  89. USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_3GS,
  90. IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
  91. IPHETH_USBINTF_PROTO) },
  92. { USB_DEVICE_AND_INTERFACE_INFO(
  93. USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4,
  94. IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
  95. IPHETH_USBINTF_PROTO) },
  96. { USB_DEVICE_AND_INTERFACE_INFO(
  97. USB_VENDOR_APPLE, USB_PRODUCT_IPAD,
  98. IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
  99. IPHETH_USBINTF_PROTO) },
  100. { USB_DEVICE_AND_INTERFACE_INFO(
  101. USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW,
  102. IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
  103. IPHETH_USBINTF_PROTO) },
  104. { USB_DEVICE_AND_INTERFACE_INFO(
  105. USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4S,
  106. IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
  107. IPHETH_USBINTF_PROTO) },
  108. { USB_DEVICE_AND_INTERFACE_INFO(
  109. USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_5,
  110. IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
  111. IPHETH_USBINTF_PROTO) },
  112. { }
  113. };
  114. MODULE_DEVICE_TABLE(usb, ipheth_table);
  115. struct ipheth_device {
  116. struct usb_device *udev;
  117. struct usb_interface *intf;
  118. struct net_device *net;
  119. struct sk_buff *tx_skb;
  120. struct urb *tx_urb;
  121. struct urb *rx_urb;
  122. unsigned char *tx_buf;
  123. unsigned char *rx_buf;
  124. unsigned char *ctrl_buf;
  125. u8 bulk_in;
  126. u8 bulk_out;
  127. struct delayed_work carrier_work;
  128. };
  129. static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags);
  130. static int ipheth_alloc_urbs(struct ipheth_device *iphone)
  131. {
  132. struct urb *tx_urb = NULL;
  133. struct urb *rx_urb = NULL;
  134. u8 *tx_buf = NULL;
  135. u8 *rx_buf = NULL;
  136. tx_urb = usb_alloc_urb(0, GFP_KERNEL);
  137. if (tx_urb == NULL)
  138. goto error_nomem;
  139. rx_urb = usb_alloc_urb(0, GFP_KERNEL);
  140. if (rx_urb == NULL)
  141. goto free_tx_urb;
  142. tx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE,
  143. GFP_KERNEL, &tx_urb->transfer_dma);
  144. if (tx_buf == NULL)
  145. goto free_rx_urb;
  146. rx_buf = usb_alloc_coherent(iphone->udev, IPHETH_BUF_SIZE,
  147. GFP_KERNEL, &rx_urb->transfer_dma);
  148. if (rx_buf == NULL)
  149. goto free_tx_buf;
  150. iphone->tx_urb = tx_urb;
  151. iphone->rx_urb = rx_urb;
  152. iphone->tx_buf = tx_buf;
  153. iphone->rx_buf = rx_buf;
  154. return 0;
  155. free_tx_buf:
  156. usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, tx_buf,
  157. tx_urb->transfer_dma);
  158. free_rx_urb:
  159. usb_free_urb(rx_urb);
  160. free_tx_urb:
  161. usb_free_urb(tx_urb);
  162. error_nomem:
  163. return -ENOMEM;
  164. }
  165. static void ipheth_free_urbs(struct ipheth_device *iphone)
  166. {
  167. usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->rx_buf,
  168. iphone->rx_urb->transfer_dma);
  169. usb_free_coherent(iphone->udev, IPHETH_BUF_SIZE, iphone->tx_buf,
  170. iphone->tx_urb->transfer_dma);
  171. usb_free_urb(iphone->rx_urb);
  172. usb_free_urb(iphone->tx_urb);
  173. }
  174. static void ipheth_kill_urbs(struct ipheth_device *dev)
  175. {
  176. usb_kill_urb(dev->tx_urb);
  177. usb_kill_urb(dev->rx_urb);
  178. }
  179. static void ipheth_rcvbulk_callback(struct urb *urb)
  180. {
  181. struct ipheth_device *dev;
  182. struct sk_buff *skb;
  183. int status;
  184. char *buf;
  185. int len;
  186. dev = urb->context;
  187. if (dev == NULL)
  188. return;
  189. status = urb->status;
  190. switch (status) {
  191. case -ENOENT:
  192. case -ECONNRESET:
  193. case -ESHUTDOWN:
  194. return;
  195. case 0:
  196. break;
  197. default:
  198. dev_err(&dev->intf->dev, "%s: urb status: %d\n",
  199. __func__, status);
  200. return;
  201. }
  202. if (urb->actual_length <= IPHETH_IP_ALIGN) {
  203. dev->net->stats.rx_length_errors++;
  204. return;
  205. }
  206. len = urb->actual_length - IPHETH_IP_ALIGN;
  207. buf = urb->transfer_buffer + IPHETH_IP_ALIGN;
  208. skb = dev_alloc_skb(len);
  209. if (!skb) {
  210. dev_err(&dev->intf->dev, "%s: dev_alloc_skb: -ENOMEM\n",
  211. __func__);
  212. dev->net->stats.rx_dropped++;
  213. return;
  214. }
  215. memcpy(skb_put(skb, len), buf, len);
  216. skb->dev = dev->net;
  217. skb->protocol = eth_type_trans(skb, dev->net);
  218. dev->net->stats.rx_packets++;
  219. dev->net->stats.rx_bytes += len;
  220. netif_rx(skb);
  221. ipheth_rx_submit(dev, GFP_ATOMIC);
  222. }
  223. static void ipheth_sndbulk_callback(struct urb *urb)
  224. {
  225. struct ipheth_device *dev;
  226. int status = urb->status;
  227. dev = urb->context;
  228. if (dev == NULL)
  229. return;
  230. if (status != 0 &&
  231. status != -ENOENT &&
  232. status != -ECONNRESET &&
  233. status != -ESHUTDOWN)
  234. dev_err(&dev->intf->dev, "%s: urb status: %d\n",
  235. __func__, status);
  236. dev_kfree_skb_irq(dev->tx_skb);
  237. netif_wake_queue(dev->net);
  238. }
  239. static int ipheth_carrier_set(struct ipheth_device *dev)
  240. {
  241. struct usb_device *udev = dev->udev;
  242. int retval;
  243. retval = usb_control_msg(udev,
  244. usb_rcvctrlpipe(udev, IPHETH_CTRL_ENDP),
  245. IPHETH_CMD_CARRIER_CHECK, /* request */
  246. 0xc0, /* request type */
  247. 0x00, /* value */
  248. 0x02, /* index */
  249. dev->ctrl_buf, IPHETH_CTRL_BUF_SIZE,
  250. IPHETH_CTRL_TIMEOUT);
  251. if (retval < 0) {
  252. dev_err(&dev->intf->dev, "%s: usb_control_msg: %d\n",
  253. __func__, retval);
  254. return retval;
  255. }
  256. if (dev->ctrl_buf[0] == IPHETH_CARRIER_ON)
  257. netif_carrier_on(dev->net);
  258. else
  259. netif_carrier_off(dev->net);
  260. return 0;
  261. }
  262. static void ipheth_carrier_check_work(struct work_struct *work)
  263. {
  264. struct ipheth_device *dev = container_of(work, struct ipheth_device,
  265. carrier_work.work);
  266. ipheth_carrier_set(dev);
  267. schedule_delayed_work(&dev->carrier_work, IPHETH_CARRIER_CHECK_TIMEOUT);
  268. }
  269. static int ipheth_get_macaddr(struct ipheth_device *dev)
  270. {
  271. struct usb_device *udev = dev->udev;
  272. struct net_device *net = dev->net;
  273. int retval;
  274. retval = usb_control_msg(udev,
  275. usb_rcvctrlpipe(udev, IPHETH_CTRL_ENDP),
  276. IPHETH_CMD_GET_MACADDR, /* request */
  277. 0xc0, /* request type */
  278. 0x00, /* value */
  279. 0x02, /* index */
  280. dev->ctrl_buf,
  281. IPHETH_CTRL_BUF_SIZE,
  282. IPHETH_CTRL_TIMEOUT);
  283. if (retval < 0) {
  284. dev_err(&dev->intf->dev, "%s: usb_control_msg: %d\n",
  285. __func__, retval);
  286. } else if (retval < ETH_ALEN) {
  287. dev_err(&dev->intf->dev,
  288. "%s: usb_control_msg: short packet: %d bytes\n",
  289. __func__, retval);
  290. retval = -EINVAL;
  291. } else {
  292. memcpy(net->dev_addr, dev->ctrl_buf, ETH_ALEN);
  293. retval = 0;
  294. }
  295. return retval;
  296. }
  297. static int ipheth_rx_submit(struct ipheth_device *dev, gfp_t mem_flags)
  298. {
  299. struct usb_device *udev = dev->udev;
  300. int retval;
  301. usb_fill_bulk_urb(dev->rx_urb, udev,
  302. usb_rcvbulkpipe(udev, dev->bulk_in),
  303. dev->rx_buf, IPHETH_BUF_SIZE,
  304. ipheth_rcvbulk_callback,
  305. dev);
  306. dev->rx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
  307. retval = usb_submit_urb(dev->rx_urb, mem_flags);
  308. if (retval)
  309. dev_err(&dev->intf->dev, "%s: usb_submit_urb: %d\n",
  310. __func__, retval);
  311. return retval;
  312. }
  313. static int ipheth_open(struct net_device *net)
  314. {
  315. struct ipheth_device *dev = netdev_priv(net);
  316. struct usb_device *udev = dev->udev;
  317. int retval = 0;
  318. usb_set_interface(udev, IPHETH_INTFNUM, IPHETH_ALT_INTFNUM);
  319. retval = ipheth_carrier_set(dev);
  320. if (retval)
  321. return retval;
  322. retval = ipheth_rx_submit(dev, GFP_KERNEL);
  323. if (retval)
  324. return retval;
  325. schedule_delayed_work(&dev->carrier_work, IPHETH_CARRIER_CHECK_TIMEOUT);
  326. netif_start_queue(net);
  327. return retval;
  328. }
  329. static int ipheth_close(struct net_device *net)
  330. {
  331. struct ipheth_device *dev = netdev_priv(net);
  332. cancel_delayed_work_sync(&dev->carrier_work);
  333. netif_stop_queue(net);
  334. return 0;
  335. }
  336. static int ipheth_tx(struct sk_buff *skb, struct net_device *net)
  337. {
  338. struct ipheth_device *dev = netdev_priv(net);
  339. struct usb_device *udev = dev->udev;
  340. int retval;
  341. /* Paranoid */
  342. if (skb->len > IPHETH_BUF_SIZE) {
  343. WARN(1, "%s: skb too large: %d bytes\n", __func__, skb->len);
  344. dev->net->stats.tx_dropped++;
  345. dev_kfree_skb_irq(skb);
  346. return NETDEV_TX_OK;
  347. }
  348. memcpy(dev->tx_buf, skb->data, skb->len);
  349. if (skb->len < IPHETH_BUF_SIZE)
  350. memset(dev->tx_buf + skb->len, 0, IPHETH_BUF_SIZE - skb->len);
  351. usb_fill_bulk_urb(dev->tx_urb, udev,
  352. usb_sndbulkpipe(udev, dev->bulk_out),
  353. dev->tx_buf, IPHETH_BUF_SIZE,
  354. ipheth_sndbulk_callback,
  355. dev);
  356. dev->tx_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
  357. retval = usb_submit_urb(dev->tx_urb, GFP_ATOMIC);
  358. if (retval) {
  359. dev_err(&dev->intf->dev, "%s: usb_submit_urb: %d\n",
  360. __func__, retval);
  361. dev->net->stats.tx_errors++;
  362. dev_kfree_skb_irq(skb);
  363. } else {
  364. dev->tx_skb = skb;
  365. dev->net->stats.tx_packets++;
  366. dev->net->stats.tx_bytes += skb->len;
  367. netif_stop_queue(net);
  368. }
  369. return NETDEV_TX_OK;
  370. }
  371. static void ipheth_tx_timeout(struct net_device *net)
  372. {
  373. struct ipheth_device *dev = netdev_priv(net);
  374. dev_err(&dev->intf->dev, "%s: TX timeout\n", __func__);
  375. dev->net->stats.tx_errors++;
  376. usb_unlink_urb(dev->tx_urb);
  377. }
  378. static u32 ipheth_ethtool_op_get_link(struct net_device *net)
  379. {
  380. struct ipheth_device *dev = netdev_priv(net);
  381. return netif_carrier_ok(dev->net);
  382. }
  383. static const struct ethtool_ops ops = {
  384. .get_link = ipheth_ethtool_op_get_link
  385. };
  386. static const struct net_device_ops ipheth_netdev_ops = {
  387. .ndo_open = ipheth_open,
  388. .ndo_stop = ipheth_close,
  389. .ndo_start_xmit = ipheth_tx,
  390. .ndo_tx_timeout = ipheth_tx_timeout,
  391. };
  392. static int ipheth_probe(struct usb_interface *intf,
  393. const struct usb_device_id *id)
  394. {
  395. struct usb_device *udev = interface_to_usbdev(intf);
  396. struct usb_host_interface *hintf;
  397. struct usb_endpoint_descriptor *endp;
  398. struct ipheth_device *dev;
  399. struct net_device *netdev;
  400. int i;
  401. int retval;
  402. netdev = alloc_etherdev(sizeof(struct ipheth_device));
  403. if (!netdev)
  404. return -ENOMEM;
  405. netdev->netdev_ops = &ipheth_netdev_ops;
  406. netdev->watchdog_timeo = IPHETH_TX_TIMEOUT;
  407. strcpy(netdev->name, "eth%d");
  408. dev = netdev_priv(netdev);
  409. dev->udev = udev;
  410. dev->net = netdev;
  411. dev->intf = intf;
  412. /* Set up endpoints */
  413. hintf = usb_altnum_to_altsetting(intf, IPHETH_ALT_INTFNUM);
  414. if (hintf == NULL) {
  415. retval = -ENODEV;
  416. dev_err(&intf->dev, "Unable to find alternate settings interface\n");
  417. goto err_endpoints;
  418. }
  419. for (i = 0; i < hintf->desc.bNumEndpoints; i++) {
  420. endp = &hintf->endpoint[i].desc;
  421. if (usb_endpoint_is_bulk_in(endp))
  422. dev->bulk_in = endp->bEndpointAddress;
  423. else if (usb_endpoint_is_bulk_out(endp))
  424. dev->bulk_out = endp->bEndpointAddress;
  425. }
  426. if (!(dev->bulk_in && dev->bulk_out)) {
  427. retval = -ENODEV;
  428. dev_err(&intf->dev, "Unable to find endpoints\n");
  429. goto err_endpoints;
  430. }
  431. dev->ctrl_buf = kmalloc(IPHETH_CTRL_BUF_SIZE, GFP_KERNEL);
  432. if (dev->ctrl_buf == NULL) {
  433. retval = -ENOMEM;
  434. goto err_alloc_ctrl_buf;
  435. }
  436. retval = ipheth_get_macaddr(dev);
  437. if (retval)
  438. goto err_get_macaddr;
  439. INIT_DELAYED_WORK(&dev->carrier_work, ipheth_carrier_check_work);
  440. retval = ipheth_alloc_urbs(dev);
  441. if (retval) {
  442. dev_err(&intf->dev, "error allocating urbs: %d\n", retval);
  443. goto err_alloc_urbs;
  444. }
  445. usb_set_intfdata(intf, dev);
  446. SET_NETDEV_DEV(netdev, &intf->dev);
  447. SET_ETHTOOL_OPS(netdev, &ops);
  448. retval = register_netdev(netdev);
  449. if (retval) {
  450. dev_err(&intf->dev, "error registering netdev: %d\n", retval);
  451. retval = -EIO;
  452. goto err_register_netdev;
  453. }
  454. dev_info(&intf->dev, "Apple iPhone USB Ethernet device attached\n");
  455. return 0;
  456. err_register_netdev:
  457. ipheth_free_urbs(dev);
  458. err_alloc_urbs:
  459. err_get_macaddr:
  460. err_alloc_ctrl_buf:
  461. kfree(dev->ctrl_buf);
  462. err_endpoints:
  463. free_netdev(netdev);
  464. return retval;
  465. }
  466. static void ipheth_disconnect(struct usb_interface *intf)
  467. {
  468. struct ipheth_device *dev;
  469. dev = usb_get_intfdata(intf);
  470. if (dev != NULL) {
  471. unregister_netdev(dev->net);
  472. ipheth_kill_urbs(dev);
  473. ipheth_free_urbs(dev);
  474. kfree(dev->ctrl_buf);
  475. free_netdev(dev->net);
  476. }
  477. usb_set_intfdata(intf, NULL);
  478. dev_info(&intf->dev, "Apple iPhone USB Ethernet now disconnected\n");
  479. }
  480. static struct usb_driver ipheth_driver = {
  481. .name = "ipheth",
  482. .probe = ipheth_probe,
  483. .disconnect = ipheth_disconnect,
  484. .id_table = ipheth_table,
  485. .disable_hub_initiated_lpm = 1,
  486. };
  487. module_usb_driver(ipheth_driver);
  488. MODULE_AUTHOR("Diego Giagio <diego@giagio.com>");
  489. MODULE_DESCRIPTION("Apple iPhone USB Ethernet driver");
  490. MODULE_LICENSE("Dual BSD/GPL");