qmi_wwan.c 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813
  1. /*
  2. * Copyright (c) 2012 Bjørn Mork <bjorn@mork.no>
  3. *
  4. * The probing code is heavily inspired by cdc_ether, which is:
  5. * Copyright (C) 2003-2005 by David Brownell
  6. * Copyright (C) 2006 by Ole Andre Vadla Ravnas (ActiveSync)
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * version 2 as published by the Free Software Foundation.
  11. */
  12. #include <linux/module.h>
  13. #include <linux/netdevice.h>
  14. #include <linux/ethtool.h>
  15. #include <linux/etherdevice.h>
  16. #include <linux/mii.h>
  17. #include <linux/usb.h>
  18. #include <linux/usb/cdc.h>
  19. #include <linux/usb/usbnet.h>
  20. #include <linux/usb/cdc-wdm.h>
  21. /* This driver supports wwan (3G/LTE/?) devices using a vendor
  22. * specific management protocol called Qualcomm MSM Interface (QMI) -
  23. * in addition to the more common AT commands over serial interface
  24. * management
  25. *
  26. * QMI is wrapped in CDC, using CDC encapsulated commands on the
  27. * control ("master") interface of a two-interface CDC Union
  28. * resembling standard CDC ECM. The devices do not use the control
  29. * interface for any other CDC messages. Most likely because the
  30. * management protocol is used in place of the standard CDC
  31. * notifications NOTIFY_NETWORK_CONNECTION and NOTIFY_SPEED_CHANGE
  32. *
  33. * Alternatively, control and data functions can be combined in a
  34. * single USB interface.
  35. *
  36. * Handling a protocol like QMI is out of the scope for any driver.
  37. * It is exported as a character device using the cdc-wdm driver as
  38. * a subdriver, enabling userspace applications ("modem managers") to
  39. * handle it.
  40. *
  41. * These devices may alternatively/additionally be configured using AT
  42. * commands on a serial interface
  43. */
  44. /* driver specific data */
  45. struct qmi_wwan_state {
  46. struct usb_driver *subdriver;
  47. atomic_t pmcount;
  48. unsigned long unused;
  49. struct usb_interface *control;
  50. struct usb_interface *data;
  51. };
  52. /* default ethernet address used by the modem */
  53. static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3};
  54. /* Make up an ethernet header if the packet doesn't have one.
  55. *
  56. * A firmware bug common among several devices cause them to send raw
  57. * IP packets under some circumstances. There is no way for the
  58. * driver/host to know when this will happen. And even when the bug
  59. * hits, some packets will still arrive with an intact header.
  60. *
  61. * The supported devices are only capably of sending IPv4, IPv6 and
  62. * ARP packets on a point-to-point link. Any packet with an ethernet
  63. * header will have either our address or a broadcast/multicast
  64. * address as destination. ARP packets will always have a header.
  65. *
  66. * This means that this function will reliably add the appropriate
  67. * header iff necessary, provided our hardware address does not start
  68. * with 4 or 6.
  69. *
  70. * Another common firmware bug results in all packets being addressed
  71. * to 00:a0:c6:00:00:00 despite the host address being different.
  72. * This function will also fixup such packets.
  73. */
  74. static int qmi_wwan_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
  75. {
  76. __be16 proto;
  77. /* usbnet rx_complete guarantees that skb->len is at least
  78. * hard_header_len, so we can inspect the dest address without
  79. * checking skb->len
  80. */
  81. switch (skb->data[0] & 0xf0) {
  82. case 0x40:
  83. proto = htons(ETH_P_IP);
  84. break;
  85. case 0x60:
  86. proto = htons(ETH_P_IPV6);
  87. break;
  88. case 0x00:
  89. if (is_multicast_ether_addr(skb->data))
  90. return 1;
  91. /* possibly bogus destination - rewrite just in case */
  92. skb_reset_mac_header(skb);
  93. goto fix_dest;
  94. default:
  95. /* pass along other packets without modifications */
  96. return 1;
  97. }
  98. if (skb_headroom(skb) < ETH_HLEN)
  99. return 0;
  100. skb_push(skb, ETH_HLEN);
  101. skb_reset_mac_header(skb);
  102. eth_hdr(skb)->h_proto = proto;
  103. memset(eth_hdr(skb)->h_source, 0, ETH_ALEN);
  104. fix_dest:
  105. memcpy(eth_hdr(skb)->h_dest, dev->net->dev_addr, ETH_ALEN);
  106. return 1;
  107. }
  108. /* very simplistic detection of IPv4 or IPv6 headers */
  109. static bool possibly_iphdr(const char *data)
  110. {
  111. return (data[0] & 0xd0) == 0x40;
  112. }
  113. /* disallow addresses which may be confused with IP headers */
  114. static int qmi_wwan_mac_addr(struct net_device *dev, void *p)
  115. {
  116. int ret;
  117. struct sockaddr *addr = p;
  118. ret = eth_prepare_mac_addr_change(dev, p);
  119. if (ret < 0)
  120. return ret;
  121. if (possibly_iphdr(addr->sa_data))
  122. return -EADDRNOTAVAIL;
  123. eth_commit_mac_addr_change(dev, p);
  124. return 0;
  125. }
  126. static const struct net_device_ops qmi_wwan_netdev_ops = {
  127. .ndo_open = usbnet_open,
  128. .ndo_stop = usbnet_stop,
  129. .ndo_start_xmit = usbnet_start_xmit,
  130. .ndo_tx_timeout = usbnet_tx_timeout,
  131. .ndo_change_mtu = usbnet_change_mtu,
  132. .ndo_set_mac_address = qmi_wwan_mac_addr,
  133. .ndo_validate_addr = eth_validate_addr,
  134. };
  135. /* using a counter to merge subdriver requests with our own into a combined state */
  136. static int qmi_wwan_manage_power(struct usbnet *dev, int on)
  137. {
  138. struct qmi_wwan_state *info = (void *)&dev->data;
  139. int rv = 0;
  140. dev_dbg(&dev->intf->dev, "%s() pmcount=%d, on=%d\n", __func__, atomic_read(&info->pmcount), on);
  141. if ((on && atomic_add_return(1, &info->pmcount) == 1) || (!on && atomic_dec_and_test(&info->pmcount))) {
  142. /* need autopm_get/put here to ensure the usbcore sees the new value */
  143. rv = usb_autopm_get_interface(dev->intf);
  144. if (rv < 0)
  145. goto err;
  146. dev->intf->needs_remote_wakeup = on;
  147. usb_autopm_put_interface(dev->intf);
  148. }
  149. err:
  150. return rv;
  151. }
  152. static int qmi_wwan_cdc_wdm_manage_power(struct usb_interface *intf, int on)
  153. {
  154. struct usbnet *dev = usb_get_intfdata(intf);
  155. /* can be called while disconnecting */
  156. if (!dev)
  157. return 0;
  158. return qmi_wwan_manage_power(dev, on);
  159. }
  160. /* collect all three endpoints and register subdriver */
  161. static int qmi_wwan_register_subdriver(struct usbnet *dev)
  162. {
  163. int rv;
  164. struct usb_driver *subdriver = NULL;
  165. struct qmi_wwan_state *info = (void *)&dev->data;
  166. /* collect bulk endpoints */
  167. rv = usbnet_get_endpoints(dev, info->data);
  168. if (rv < 0)
  169. goto err;
  170. /* update status endpoint if separate control interface */
  171. if (info->control != info->data)
  172. dev->status = &info->control->cur_altsetting->endpoint[0];
  173. /* require interrupt endpoint for subdriver */
  174. if (!dev->status) {
  175. rv = -EINVAL;
  176. goto err;
  177. }
  178. /* for subdriver power management */
  179. atomic_set(&info->pmcount, 0);
  180. /* register subdriver */
  181. subdriver = usb_cdc_wdm_register(info->control, &dev->status->desc, 4096, &qmi_wwan_cdc_wdm_manage_power);
  182. if (IS_ERR(subdriver)) {
  183. dev_err(&info->control->dev, "subdriver registration failed\n");
  184. rv = PTR_ERR(subdriver);
  185. goto err;
  186. }
  187. /* prevent usbnet from using status endpoint */
  188. dev->status = NULL;
  189. /* save subdriver struct for suspend/resume wrappers */
  190. info->subdriver = subdriver;
  191. err:
  192. return rv;
  193. }
  194. static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
  195. {
  196. int status = -1;
  197. u8 *buf = intf->cur_altsetting->extra;
  198. int len = intf->cur_altsetting->extralen;
  199. struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc;
  200. struct usb_cdc_union_desc *cdc_union = NULL;
  201. struct usb_cdc_ether_desc *cdc_ether = NULL;
  202. u32 found = 0;
  203. struct usb_driver *driver = driver_of(intf);
  204. struct qmi_wwan_state *info = (void *)&dev->data;
  205. BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data) < sizeof(struct qmi_wwan_state)));
  206. /* set up initial state */
  207. info->control = intf;
  208. info->data = intf;
  209. /* and a number of CDC descriptors */
  210. while (len > 3) {
  211. struct usb_descriptor_header *h = (void *)buf;
  212. /* ignore any misplaced descriptors */
  213. if (h->bDescriptorType != USB_DT_CS_INTERFACE)
  214. goto next_desc;
  215. /* buf[2] is CDC descriptor subtype */
  216. switch (buf[2]) {
  217. case USB_CDC_HEADER_TYPE:
  218. if (found & 1 << USB_CDC_HEADER_TYPE) {
  219. dev_dbg(&intf->dev, "extra CDC header\n");
  220. goto err;
  221. }
  222. if (h->bLength != sizeof(struct usb_cdc_header_desc)) {
  223. dev_dbg(&intf->dev, "CDC header len %u\n", h->bLength);
  224. goto err;
  225. }
  226. break;
  227. case USB_CDC_UNION_TYPE:
  228. if (found & 1 << USB_CDC_UNION_TYPE) {
  229. dev_dbg(&intf->dev, "extra CDC union\n");
  230. goto err;
  231. }
  232. if (h->bLength != sizeof(struct usb_cdc_union_desc)) {
  233. dev_dbg(&intf->dev, "CDC union len %u\n", h->bLength);
  234. goto err;
  235. }
  236. cdc_union = (struct usb_cdc_union_desc *)buf;
  237. break;
  238. case USB_CDC_ETHERNET_TYPE:
  239. if (found & 1 << USB_CDC_ETHERNET_TYPE) {
  240. dev_dbg(&intf->dev, "extra CDC ether\n");
  241. goto err;
  242. }
  243. if (h->bLength != sizeof(struct usb_cdc_ether_desc)) {
  244. dev_dbg(&intf->dev, "CDC ether len %u\n", h->bLength);
  245. goto err;
  246. }
  247. cdc_ether = (struct usb_cdc_ether_desc *)buf;
  248. break;
  249. }
  250. /*
  251. * Remember which CDC functional descriptors we've seen. Works
  252. * for all types we care about, of which USB_CDC_ETHERNET_TYPE
  253. * (0x0f) is the highest numbered
  254. */
  255. if (buf[2] < 32)
  256. found |= 1 << buf[2];
  257. next_desc:
  258. len -= h->bLength;
  259. buf += h->bLength;
  260. }
  261. /* Use separate control and data interfaces if we found a CDC Union */
  262. if (cdc_union) {
  263. info->data = usb_ifnum_to_if(dev->udev, cdc_union->bSlaveInterface0);
  264. if (desc->bInterfaceNumber != cdc_union->bMasterInterface0 || !info->data) {
  265. dev_err(&intf->dev, "bogus CDC Union: master=%u, slave=%u\n",
  266. cdc_union->bMasterInterface0, cdc_union->bSlaveInterface0);
  267. goto err;
  268. }
  269. }
  270. /* errors aren't fatal - we can live with the dynamic address */
  271. if (cdc_ether) {
  272. dev->hard_mtu = le16_to_cpu(cdc_ether->wMaxSegmentSize);
  273. usbnet_get_ethernet_addr(dev, cdc_ether->iMACAddress);
  274. }
  275. /* claim data interface and set it up */
  276. if (info->control != info->data) {
  277. status = usb_driver_claim_interface(driver, info->data, dev);
  278. if (status < 0)
  279. goto err;
  280. }
  281. status = qmi_wwan_register_subdriver(dev);
  282. if (status < 0 && info->control != info->data) {
  283. usb_set_intfdata(info->data, NULL);
  284. usb_driver_release_interface(driver, info->data);
  285. }
  286. /* Never use the same address on both ends of the link, even
  287. * if the buggy firmware told us to.
  288. */
  289. if (ether_addr_equal(dev->net->dev_addr, default_modem_addr))
  290. eth_hw_addr_random(dev->net);
  291. /* make MAC addr easily distinguishable from an IP header */
  292. if (possibly_iphdr(dev->net->dev_addr)) {
  293. dev->net->dev_addr[0] |= 0x02; /* set local assignment bit */
  294. dev->net->dev_addr[0] &= 0xbf; /* clear "IP" bit */
  295. }
  296. dev->net->netdev_ops = &qmi_wwan_netdev_ops;
  297. err:
  298. return status;
  299. }
  300. static void qmi_wwan_unbind(struct usbnet *dev, struct usb_interface *intf)
  301. {
  302. struct qmi_wwan_state *info = (void *)&dev->data;
  303. struct usb_driver *driver = driver_of(intf);
  304. struct usb_interface *other;
  305. if (info->subdriver && info->subdriver->disconnect)
  306. info->subdriver->disconnect(info->control);
  307. /* allow user to unbind using either control or data */
  308. if (intf == info->control)
  309. other = info->data;
  310. else
  311. other = info->control;
  312. /* only if not shared */
  313. if (other && intf != other) {
  314. usb_set_intfdata(other, NULL);
  315. usb_driver_release_interface(driver, other);
  316. }
  317. info->subdriver = NULL;
  318. info->data = NULL;
  319. info->control = NULL;
  320. }
  321. /* suspend/resume wrappers calling both usbnet and the cdc-wdm
  322. * subdriver if present.
  323. *
  324. * NOTE: cdc-wdm also supports pre/post_reset, but we cannot provide
  325. * wrappers for those without adding usbnet reset support first.
  326. */
  327. static int qmi_wwan_suspend(struct usb_interface *intf, pm_message_t message)
  328. {
  329. struct usbnet *dev = usb_get_intfdata(intf);
  330. struct qmi_wwan_state *info = (void *)&dev->data;
  331. int ret;
  332. /*
  333. * Both usbnet_suspend() and subdriver->suspend() MUST return 0
  334. * in system sleep context, otherwise, the resume callback has
  335. * to recover device from previous suspend failure.
  336. */
  337. ret = usbnet_suspend(intf, message);
  338. if (ret < 0)
  339. goto err;
  340. if (intf == info->control && info->subdriver && info->subdriver->suspend)
  341. ret = info->subdriver->suspend(intf, message);
  342. if (ret < 0)
  343. usbnet_resume(intf);
  344. err:
  345. return ret;
  346. }
  347. static int qmi_wwan_resume(struct usb_interface *intf)
  348. {
  349. struct usbnet *dev = usb_get_intfdata(intf);
  350. struct qmi_wwan_state *info = (void *)&dev->data;
  351. int ret = 0;
  352. bool callsub = (intf == info->control && info->subdriver && info->subdriver->resume);
  353. if (callsub)
  354. ret = info->subdriver->resume(intf);
  355. if (ret < 0)
  356. goto err;
  357. ret = usbnet_resume(intf);
  358. if (ret < 0 && callsub && info->subdriver->suspend)
  359. info->subdriver->suspend(intf, PMSG_SUSPEND);
  360. err:
  361. return ret;
  362. }
  363. static const struct driver_info qmi_wwan_info = {
  364. .description = "WWAN/QMI device",
  365. .flags = FLAG_WWAN,
  366. .bind = qmi_wwan_bind,
  367. .unbind = qmi_wwan_unbind,
  368. .manage_power = qmi_wwan_manage_power,
  369. .rx_fixup = qmi_wwan_rx_fixup,
  370. };
  371. #define HUAWEI_VENDOR_ID 0x12D1
  372. /* map QMI/wwan function by a fixed interface number */
  373. #define QMI_FIXED_INTF(vend, prod, num) \
  374. USB_DEVICE_INTERFACE_NUMBER(vend, prod, num), \
  375. .driver_info = (unsigned long)&qmi_wwan_info
  376. /* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */
  377. #define QMI_GOBI1K_DEVICE(vend, prod) \
  378. QMI_FIXED_INTF(vend, prod, 3)
  379. /* Gobi 2000/3000 QMI/wwan interface number is 0 according to qcserial */
  380. #define QMI_GOBI_DEVICE(vend, prod) \
  381. QMI_FIXED_INTF(vend, prod, 0)
  382. static const struct usb_device_id products[] = {
  383. /* 1. CDC ECM like devices match on the control interface */
  384. { /* Huawei E392, E398 and possibly others sharing both device id and more... */
  385. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 9),
  386. .driver_info = (unsigned long)&qmi_wwan_info,
  387. },
  388. { /* Vodafone/Huawei K5005 (12d1:14c8) and similar modems */
  389. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 57),
  390. .driver_info = (unsigned long)&qmi_wwan_info,
  391. },
  392. { /* HUAWEI_INTERFACE_NDIS_CONTROL_QUALCOMM */
  393. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x69),
  394. .driver_info = (unsigned long)&qmi_wwan_info,
  395. },
  396. /* 2. Combined interface devices matching on class+protocol */
  397. { /* Huawei E367 and possibly others in "Windows mode" */
  398. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 7),
  399. .driver_info = (unsigned long)&qmi_wwan_info,
  400. },
  401. { /* Huawei E392, E398 and possibly others in "Windows mode" */
  402. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 17),
  403. .driver_info = (unsigned long)&qmi_wwan_info,
  404. },
  405. { /* HUAWEI_NDIS_SINGLE_INTERFACE_VDF */
  406. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x37),
  407. .driver_info = (unsigned long)&qmi_wwan_info,
  408. },
  409. { /* HUAWEI_INTERFACE_NDIS_HW_QUALCOMM */
  410. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x67),
  411. .driver_info = (unsigned long)&qmi_wwan_info,
  412. },
  413. { /* Pantech UML290, P4200 and more */
  414. USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 0xf0, 0xff),
  415. .driver_info = (unsigned long)&qmi_wwan_info,
  416. },
  417. { /* Pantech UML290 - newer firmware */
  418. USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 0xf1, 0xff),
  419. .driver_info = (unsigned long)&qmi_wwan_info,
  420. },
  421. { /* Novatel USB551L and MC551 */
  422. USB_DEVICE_AND_INTERFACE_INFO(0x1410, 0xb001,
  423. USB_CLASS_COMM,
  424. USB_CDC_SUBCLASS_ETHERNET,
  425. USB_CDC_PROTO_NONE),
  426. .driver_info = (unsigned long)&qmi_wwan_info,
  427. },
  428. { /* Novatel E362 */
  429. USB_DEVICE_AND_INTERFACE_INFO(0x1410, 0x9010,
  430. USB_CLASS_COMM,
  431. USB_CDC_SUBCLASS_ETHERNET,
  432. USB_CDC_PROTO_NONE),
  433. .driver_info = (unsigned long)&qmi_wwan_info,
  434. },
  435. { /* Dell Wireless 5800 (Novatel E362) */
  436. USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x8195,
  437. USB_CLASS_COMM,
  438. USB_CDC_SUBCLASS_ETHERNET,
  439. USB_CDC_PROTO_NONE),
  440. .driver_info = (unsigned long)&qmi_wwan_info,
  441. },
  442. { /* Dell Wireless 5800 V2 (Novatel E362) */
  443. USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x8196,
  444. USB_CLASS_COMM,
  445. USB_CDC_SUBCLASS_ETHERNET,
  446. USB_CDC_PROTO_NONE),
  447. .driver_info = (unsigned long)&qmi_wwan_info,
  448. },
  449. { /* Dell Wireless 5804 (Novatel E371) */
  450. USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x819b,
  451. USB_CLASS_COMM,
  452. USB_CDC_SUBCLASS_ETHERNET,
  453. USB_CDC_PROTO_NONE),
  454. .driver_info = (unsigned long)&qmi_wwan_info,
  455. },
  456. { /* ADU960S */
  457. USB_DEVICE_AND_INTERFACE_INFO(0x16d5, 0x650a,
  458. USB_CLASS_COMM,
  459. USB_CDC_SUBCLASS_ETHERNET,
  460. USB_CDC_PROTO_NONE),
  461. .driver_info = (unsigned long)&qmi_wwan_info,
  462. },
  463. /* 3. Combined interface devices matching on interface number */
  464. {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */
  465. {QMI_FIXED_INTF(0x05c6, 0x7000, 0)},
  466. {QMI_FIXED_INTF(0x05c6, 0x7001, 1)},
  467. {QMI_FIXED_INTF(0x05c6, 0x7002, 1)},
  468. {QMI_FIXED_INTF(0x05c6, 0x7101, 1)},
  469. {QMI_FIXED_INTF(0x05c6, 0x7101, 2)},
  470. {QMI_FIXED_INTF(0x05c6, 0x7101, 3)},
  471. {QMI_FIXED_INTF(0x05c6, 0x7102, 1)},
  472. {QMI_FIXED_INTF(0x05c6, 0x7102, 2)},
  473. {QMI_FIXED_INTF(0x05c6, 0x7102, 3)},
  474. {QMI_FIXED_INTF(0x05c6, 0x8000, 7)},
  475. {QMI_FIXED_INTF(0x05c6, 0x8001, 6)},
  476. {QMI_FIXED_INTF(0x05c6, 0x9000, 4)},
  477. {QMI_FIXED_INTF(0x05c6, 0x9003, 4)},
  478. {QMI_FIXED_INTF(0x05c6, 0x9005, 2)},
  479. {QMI_FIXED_INTF(0x05c6, 0x900a, 4)},
  480. {QMI_FIXED_INTF(0x05c6, 0x900b, 2)},
  481. {QMI_FIXED_INTF(0x05c6, 0x900c, 4)},
  482. {QMI_FIXED_INTF(0x05c6, 0x900c, 5)},
  483. {QMI_FIXED_INTF(0x05c6, 0x900c, 6)},
  484. {QMI_FIXED_INTF(0x05c6, 0x900d, 5)},
  485. {QMI_FIXED_INTF(0x05c6, 0x900f, 3)},
  486. {QMI_FIXED_INTF(0x05c6, 0x900f, 4)},
  487. {QMI_FIXED_INTF(0x05c6, 0x900f, 5)},
  488. {QMI_FIXED_INTF(0x05c6, 0x9010, 4)},
  489. {QMI_FIXED_INTF(0x05c6, 0x9010, 5)},
  490. {QMI_FIXED_INTF(0x05c6, 0x9011, 3)},
  491. {QMI_FIXED_INTF(0x05c6, 0x9011, 4)},
  492. {QMI_FIXED_INTF(0x05c6, 0x9021, 1)},
  493. {QMI_FIXED_INTF(0x05c6, 0x9022, 2)},
  494. {QMI_FIXED_INTF(0x05c6, 0x9025, 4)}, /* Alcatel-sbell ASB TL131 TDD LTE (China Mobile) */
  495. {QMI_FIXED_INTF(0x05c6, 0x9026, 3)},
  496. {QMI_FIXED_INTF(0x05c6, 0x902e, 5)},
  497. {QMI_FIXED_INTF(0x05c6, 0x9031, 5)},
  498. {QMI_FIXED_INTF(0x05c6, 0x9032, 4)},
  499. {QMI_FIXED_INTF(0x05c6, 0x9033, 3)},
  500. {QMI_FIXED_INTF(0x05c6, 0x9033, 4)},
  501. {QMI_FIXED_INTF(0x05c6, 0x9033, 5)},
  502. {QMI_FIXED_INTF(0x05c6, 0x9033, 6)},
  503. {QMI_FIXED_INTF(0x05c6, 0x9034, 3)},
  504. {QMI_FIXED_INTF(0x05c6, 0x9034, 4)},
  505. {QMI_FIXED_INTF(0x05c6, 0x9034, 5)},
  506. {QMI_FIXED_INTF(0x05c6, 0x9034, 6)},
  507. {QMI_FIXED_INTF(0x05c6, 0x9034, 7)},
  508. {QMI_FIXED_INTF(0x05c6, 0x9035, 4)},
  509. {QMI_FIXED_INTF(0x05c6, 0x9036, 3)},
  510. {QMI_FIXED_INTF(0x05c6, 0x9037, 5)},
  511. {QMI_FIXED_INTF(0x05c6, 0x9038, 4)},
  512. {QMI_FIXED_INTF(0x05c6, 0x903b, 7)},
  513. {QMI_FIXED_INTF(0x05c6, 0x903c, 6)},
  514. {QMI_FIXED_INTF(0x05c6, 0x903d, 6)},
  515. {QMI_FIXED_INTF(0x05c6, 0x903e, 5)},
  516. {QMI_FIXED_INTF(0x05c6, 0x9043, 3)},
  517. {QMI_FIXED_INTF(0x05c6, 0x9046, 3)},
  518. {QMI_FIXED_INTF(0x05c6, 0x9046, 4)},
  519. {QMI_FIXED_INTF(0x05c6, 0x9046, 5)},
  520. {QMI_FIXED_INTF(0x05c6, 0x9047, 2)},
  521. {QMI_FIXED_INTF(0x05c6, 0x9047, 3)},
  522. {QMI_FIXED_INTF(0x05c6, 0x9047, 4)},
  523. {QMI_FIXED_INTF(0x05c6, 0x9048, 4)},
  524. {QMI_FIXED_INTF(0x05c6, 0x9048, 5)},
  525. {QMI_FIXED_INTF(0x05c6, 0x9048, 6)},
  526. {QMI_FIXED_INTF(0x05c6, 0x9048, 7)},
  527. {QMI_FIXED_INTF(0x05c6, 0x9048, 8)},
  528. {QMI_FIXED_INTF(0x05c6, 0x904c, 5)},
  529. {QMI_FIXED_INTF(0x05c6, 0x904c, 6)},
  530. {QMI_FIXED_INTF(0x05c6, 0x904c, 7)},
  531. {QMI_FIXED_INTF(0x05c6, 0x904c, 8)},
  532. {QMI_FIXED_INTF(0x05c6, 0x9050, 3)},
  533. {QMI_FIXED_INTF(0x05c6, 0x9052, 4)},
  534. {QMI_FIXED_INTF(0x05c6, 0x9053, 6)},
  535. {QMI_FIXED_INTF(0x05c6, 0x9053, 7)},
  536. {QMI_FIXED_INTF(0x05c6, 0x9054, 5)},
  537. {QMI_FIXED_INTF(0x05c6, 0x9054, 6)},
  538. {QMI_FIXED_INTF(0x05c6, 0x9055, 3)},
  539. {QMI_FIXED_INTF(0x05c6, 0x9055, 4)},
  540. {QMI_FIXED_INTF(0x05c6, 0x9055, 5)},
  541. {QMI_FIXED_INTF(0x05c6, 0x9055, 6)},
  542. {QMI_FIXED_INTF(0x05c6, 0x9055, 7)},
  543. {QMI_FIXED_INTF(0x05c6, 0x9056, 3)},
  544. {QMI_FIXED_INTF(0x05c6, 0x9062, 2)},
  545. {QMI_FIXED_INTF(0x05c6, 0x9062, 3)},
  546. {QMI_FIXED_INTF(0x05c6, 0x9062, 4)},
  547. {QMI_FIXED_INTF(0x05c6, 0x9062, 5)},
  548. {QMI_FIXED_INTF(0x05c6, 0x9062, 6)},
  549. {QMI_FIXED_INTF(0x05c6, 0x9062, 7)},
  550. {QMI_FIXED_INTF(0x05c6, 0x9062, 8)},
  551. {QMI_FIXED_INTF(0x05c6, 0x9062, 9)},
  552. {QMI_FIXED_INTF(0x05c6, 0x9064, 3)},
  553. {QMI_FIXED_INTF(0x05c6, 0x9065, 6)},
  554. {QMI_FIXED_INTF(0x05c6, 0x9065, 7)},
  555. {QMI_FIXED_INTF(0x05c6, 0x9066, 5)},
  556. {QMI_FIXED_INTF(0x05c6, 0x9066, 6)},
  557. {QMI_FIXED_INTF(0x05c6, 0x9067, 1)},
  558. {QMI_FIXED_INTF(0x05c6, 0x9068, 2)},
  559. {QMI_FIXED_INTF(0x05c6, 0x9068, 3)},
  560. {QMI_FIXED_INTF(0x05c6, 0x9068, 4)},
  561. {QMI_FIXED_INTF(0x05c6, 0x9068, 5)},
  562. {QMI_FIXED_INTF(0x05c6, 0x9068, 6)},
  563. {QMI_FIXED_INTF(0x05c6, 0x9068, 7)},
  564. {QMI_FIXED_INTF(0x05c6, 0x9069, 5)},
  565. {QMI_FIXED_INTF(0x05c6, 0x9069, 6)},
  566. {QMI_FIXED_INTF(0x05c6, 0x9069, 7)},
  567. {QMI_FIXED_INTF(0x05c6, 0x9069, 8)},
  568. {QMI_FIXED_INTF(0x05c6, 0x9070, 4)},
  569. {QMI_FIXED_INTF(0x05c6, 0x9070, 5)},
  570. {QMI_FIXED_INTF(0x05c6, 0x9075, 5)},
  571. {QMI_FIXED_INTF(0x05c6, 0x9076, 4)},
  572. {QMI_FIXED_INTF(0x05c6, 0x9076, 5)},
  573. {QMI_FIXED_INTF(0x05c6, 0x9076, 6)},
  574. {QMI_FIXED_INTF(0x05c6, 0x9076, 7)},
  575. {QMI_FIXED_INTF(0x05c6, 0x9076, 8)},
  576. {QMI_FIXED_INTF(0x05c6, 0x9077, 3)},
  577. {QMI_FIXED_INTF(0x05c6, 0x9077, 4)},
  578. {QMI_FIXED_INTF(0x05c6, 0x9077, 5)},
  579. {QMI_FIXED_INTF(0x05c6, 0x9077, 6)},
  580. {QMI_FIXED_INTF(0x05c6, 0x9078, 3)},
  581. {QMI_FIXED_INTF(0x05c6, 0x9079, 4)},
  582. {QMI_FIXED_INTF(0x05c6, 0x9079, 5)},
  583. {QMI_FIXED_INTF(0x05c6, 0x9079, 6)},
  584. {QMI_FIXED_INTF(0x05c6, 0x9079, 7)},
  585. {QMI_FIXED_INTF(0x05c6, 0x9079, 8)},
  586. {QMI_FIXED_INTF(0x05c6, 0x9080, 5)},
  587. {QMI_FIXED_INTF(0x05c6, 0x9080, 6)},
  588. {QMI_FIXED_INTF(0x05c6, 0x9080, 7)},
  589. {QMI_FIXED_INTF(0x05c6, 0x9080, 8)},
  590. {QMI_FIXED_INTF(0x05c6, 0x9083, 3)},
  591. {QMI_FIXED_INTF(0x05c6, 0x9084, 4)},
  592. {QMI_FIXED_INTF(0x05c6, 0x920d, 0)},
  593. {QMI_FIXED_INTF(0x05c6, 0x920d, 5)},
  594. {QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */
  595. {QMI_FIXED_INTF(0x12d1, 0x14ac, 1)}, /* Huawei E1820 */
  596. {QMI_FIXED_INTF(0x19d2, 0x0002, 1)},
  597. {QMI_FIXED_INTF(0x19d2, 0x0012, 1)},
  598. {QMI_FIXED_INTF(0x19d2, 0x0017, 3)},
  599. {QMI_FIXED_INTF(0x19d2, 0x0019, 3)}, /* ONDA MT689DC */
  600. {QMI_FIXED_INTF(0x19d2, 0x0021, 4)},
  601. {QMI_FIXED_INTF(0x19d2, 0x0025, 1)},
  602. {QMI_FIXED_INTF(0x19d2, 0x0031, 4)},
  603. {QMI_FIXED_INTF(0x19d2, 0x0042, 4)},
  604. {QMI_FIXED_INTF(0x19d2, 0x0049, 5)},
  605. {QMI_FIXED_INTF(0x19d2, 0x0052, 4)},
  606. {QMI_FIXED_INTF(0x19d2, 0x0055, 1)}, /* ZTE (Vodafone) K3520-Z */
  607. {QMI_FIXED_INTF(0x19d2, 0x0058, 4)},
  608. {QMI_FIXED_INTF(0x19d2, 0x0063, 4)}, /* ZTE (Vodafone) K3565-Z */
  609. {QMI_FIXED_INTF(0x19d2, 0x0104, 4)}, /* ZTE (Vodafone) K4505-Z */
  610. {QMI_FIXED_INTF(0x19d2, 0x0113, 5)},
  611. {QMI_FIXED_INTF(0x19d2, 0x0118, 5)},
  612. {QMI_FIXED_INTF(0x19d2, 0x0121, 5)},
  613. {QMI_FIXED_INTF(0x19d2, 0x0123, 4)},
  614. {QMI_FIXED_INTF(0x19d2, 0x0124, 5)},
  615. {QMI_FIXED_INTF(0x19d2, 0x0125, 6)},
  616. {QMI_FIXED_INTF(0x19d2, 0x0126, 5)},
  617. {QMI_FIXED_INTF(0x19d2, 0x0130, 1)},
  618. {QMI_FIXED_INTF(0x19d2, 0x0133, 3)},
  619. {QMI_FIXED_INTF(0x19d2, 0x0141, 5)},
  620. {QMI_FIXED_INTF(0x19d2, 0x0157, 5)}, /* ZTE MF683 */
  621. {QMI_FIXED_INTF(0x19d2, 0x0158, 3)},
  622. {QMI_FIXED_INTF(0x19d2, 0x0167, 4)}, /* ZTE MF820D */
  623. {QMI_FIXED_INTF(0x19d2, 0x0168, 4)},
  624. {QMI_FIXED_INTF(0x19d2, 0x0176, 3)},
  625. {QMI_FIXED_INTF(0x19d2, 0x0178, 3)},
  626. {QMI_FIXED_INTF(0x19d2, 0x0191, 4)}, /* ZTE EuFi890 */
  627. {QMI_FIXED_INTF(0x19d2, 0x0199, 1)}, /* ZTE MF820S */
  628. {QMI_FIXED_INTF(0x19d2, 0x0200, 1)},
  629. {QMI_FIXED_INTF(0x19d2, 0x0257, 3)}, /* ZTE MF821 */
  630. {QMI_FIXED_INTF(0x19d2, 0x0265, 4)}, /* ONDA MT8205 4G LTE */
  631. {QMI_FIXED_INTF(0x19d2, 0x0284, 4)}, /* ZTE MF880 */
  632. {QMI_FIXED_INTF(0x19d2, 0x0326, 4)}, /* ZTE MF821D */
  633. {QMI_FIXED_INTF(0x19d2, 0x0412, 4)}, /* Telewell TW-LTE 4G */
  634. {QMI_FIXED_INTF(0x19d2, 0x1008, 4)}, /* ZTE (Vodafone) K3570-Z */
  635. {QMI_FIXED_INTF(0x19d2, 0x1010, 4)}, /* ZTE (Vodafone) K3571-Z */
  636. {QMI_FIXED_INTF(0x19d2, 0x1012, 4)},
  637. {QMI_FIXED_INTF(0x19d2, 0x1018, 3)}, /* ZTE (Vodafone) K5006-Z */
  638. {QMI_FIXED_INTF(0x19d2, 0x1021, 2)},
  639. {QMI_FIXED_INTF(0x19d2, 0x1245, 4)},
  640. {QMI_FIXED_INTF(0x19d2, 0x1247, 4)},
  641. {QMI_FIXED_INTF(0x19d2, 0x1252, 4)},
  642. {QMI_FIXED_INTF(0x19d2, 0x1254, 4)},
  643. {QMI_FIXED_INTF(0x19d2, 0x1255, 3)},
  644. {QMI_FIXED_INTF(0x19d2, 0x1255, 4)},
  645. {QMI_FIXED_INTF(0x19d2, 0x1256, 4)},
  646. {QMI_FIXED_INTF(0x19d2, 0x1401, 2)},
  647. {QMI_FIXED_INTF(0x19d2, 0x1402, 2)}, /* ZTE MF60 */
  648. {QMI_FIXED_INTF(0x19d2, 0x1424, 2)},
  649. {QMI_FIXED_INTF(0x19d2, 0x1425, 2)},
  650. {QMI_FIXED_INTF(0x19d2, 0x1426, 2)}, /* ZTE MF91 */
  651. {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */
  652. {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */
  653. {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */
  654. {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */
  655. {QMI_FIXED_INTF(0x1199, 0x68a2, 19)}, /* Sierra Wireless MC7710 in QMI mode */
  656. {QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */
  657. {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */
  658. {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */
  659. {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */
  660. {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */
  661. {QMI_FIXED_INTF(0x0b3c, 0xc005, 6)}, /* Olivetti Olicard 200 */
  662. {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)}, /* Cinterion PLxx */
  663. /* 4. Gobi 1000 devices */
  664. {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
  665. {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */
  666. {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */
  667. {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */
  668. {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel/Verizon USB-1000 */
  669. {QMI_GOBI1K_DEVICE(0x1410, 0xa002)}, /* Novatel Gobi Modem device */
  670. {QMI_GOBI1K_DEVICE(0x1410, 0xa003)}, /* Novatel Gobi Modem device */
  671. {QMI_GOBI1K_DEVICE(0x1410, 0xa004)}, /* Novatel Gobi Modem device */
  672. {QMI_GOBI1K_DEVICE(0x1410, 0xa005)}, /* Novatel Gobi Modem device */
  673. {QMI_GOBI1K_DEVICE(0x1410, 0xa006)}, /* Novatel Gobi Modem device */
  674. {QMI_GOBI1K_DEVICE(0x1410, 0xa007)}, /* Novatel Gobi Modem device */
  675. {QMI_GOBI1K_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */
  676. {QMI_GOBI1K_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */
  677. {QMI_GOBI1K_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */
  678. {QMI_GOBI1K_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */
  679. {QMI_GOBI1K_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */
  680. {QMI_GOBI1K_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */
  681. {QMI_GOBI1K_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */
  682. {QMI_GOBI1K_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */
  683. /* 5. Gobi 2000 and 3000 devices */
  684. {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */
  685. {QMI_GOBI_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */
  686. {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */
  687. {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */
  688. {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */
  689. {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */
  690. {QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */
  691. {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */
  692. {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */
  693. {QMI_GOBI_DEVICE(0x05c6, 0x9275)}, /* iRex Technologies Gobi 2000 Modem device (VR307) */
  694. {QMI_GOBI_DEVICE(0x0af0, 0x8120)}, /* Option GTM681W */
  695. {QMI_GOBI_DEVICE(0x1199, 0x68a5)}, /* Sierra Wireless Modem */
  696. {QMI_GOBI_DEVICE(0x1199, 0x68a9)}, /* Sierra Wireless Modem */
  697. {QMI_GOBI_DEVICE(0x1199, 0x9001)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  698. {QMI_GOBI_DEVICE(0x1199, 0x9002)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  699. {QMI_GOBI_DEVICE(0x1199, 0x9003)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  700. {QMI_GOBI_DEVICE(0x1199, 0x9004)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  701. {QMI_GOBI_DEVICE(0x1199, 0x9005)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  702. {QMI_GOBI_DEVICE(0x1199, 0x9006)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  703. {QMI_GOBI_DEVICE(0x1199, 0x9007)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  704. {QMI_GOBI_DEVICE(0x1199, 0x9008)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  705. {QMI_GOBI_DEVICE(0x1199, 0x9009)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  706. {QMI_GOBI_DEVICE(0x1199, 0x900a)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  707. {QMI_GOBI_DEVICE(0x1199, 0x9011)}, /* Sierra Wireless Gobi 2000 Modem device (MC8305) */
  708. {QMI_GOBI_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */
  709. {QMI_GOBI_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */
  710. {QMI_GOBI_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */
  711. {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */
  712. {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */
  713. {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */
  714. {QMI_GOBI_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */
  715. {QMI_GOBI_DEVICE(0x12d1, 0x14f1)}, /* Sony Gobi 3000 Composite */
  716. {QMI_GOBI_DEVICE(0x1410, 0xa021)}, /* Foxconn Gobi 3000 Modem device (Novatel E396) */
  717. { } /* END */
  718. };
  719. MODULE_DEVICE_TABLE(usb, products);
  720. static int qmi_wwan_probe(struct usb_interface *intf, const struct usb_device_id *prod)
  721. {
  722. struct usb_device_id *id = (struct usb_device_id *)prod;
  723. /* Workaround to enable dynamic IDs. This disables usbnet
  724. * blacklisting functionality. Which, if required, can be
  725. * reimplemented here by using a magic "blacklist" value
  726. * instead of 0 in the static device id table
  727. */
  728. if (!id->driver_info) {
  729. dev_dbg(&intf->dev, "setting defaults for dynamic device id\n");
  730. id->driver_info = (unsigned long)&qmi_wwan_info;
  731. }
  732. return usbnet_probe(intf, id);
  733. }
  734. static struct usb_driver qmi_wwan_driver = {
  735. .name = "qmi_wwan",
  736. .id_table = products,
  737. .probe = qmi_wwan_probe,
  738. .disconnect = usbnet_disconnect,
  739. .suspend = qmi_wwan_suspend,
  740. .resume = qmi_wwan_resume,
  741. .reset_resume = qmi_wwan_resume,
  742. .supports_autosuspend = 1,
  743. .disable_hub_initiated_lpm = 1,
  744. };
  745. module_usb_driver(qmi_wwan_driver);
  746. MODULE_AUTHOR("Bjørn Mork <bjorn@mork.no>");
  747. MODULE_DESCRIPTION("Qualcomm MSM Interface (QMI) WWAN driver");
  748. MODULE_LICENSE("GPL");