qmi_wwan.c 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830
  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
  136. * combined state
  137. */
  138. static int qmi_wwan_manage_power(struct usbnet *dev, int on)
  139. {
  140. struct qmi_wwan_state *info = (void *)&dev->data;
  141. int rv = 0;
  142. dev_dbg(&dev->intf->dev, "%s() pmcount=%d, on=%d\n", __func__,
  143. atomic_read(&info->pmcount), on);
  144. if ((on && atomic_add_return(1, &info->pmcount) == 1) ||
  145. (!on && atomic_dec_and_test(&info->pmcount))) {
  146. /* need autopm_get/put here to ensure the usbcore sees
  147. * the new value
  148. */
  149. rv = usb_autopm_get_interface(dev->intf);
  150. if (rv < 0)
  151. goto err;
  152. dev->intf->needs_remote_wakeup = on;
  153. usb_autopm_put_interface(dev->intf);
  154. }
  155. err:
  156. return rv;
  157. }
  158. static int qmi_wwan_cdc_wdm_manage_power(struct usb_interface *intf, int on)
  159. {
  160. struct usbnet *dev = usb_get_intfdata(intf);
  161. /* can be called while disconnecting */
  162. if (!dev)
  163. return 0;
  164. return qmi_wwan_manage_power(dev, on);
  165. }
  166. /* collect all three endpoints and register subdriver */
  167. static int qmi_wwan_register_subdriver(struct usbnet *dev)
  168. {
  169. int rv;
  170. struct usb_driver *subdriver = NULL;
  171. struct qmi_wwan_state *info = (void *)&dev->data;
  172. /* collect bulk endpoints */
  173. rv = usbnet_get_endpoints(dev, info->data);
  174. if (rv < 0)
  175. goto err;
  176. /* update status endpoint if separate control interface */
  177. if (info->control != info->data)
  178. dev->status = &info->control->cur_altsetting->endpoint[0];
  179. /* require interrupt endpoint for subdriver */
  180. if (!dev->status) {
  181. rv = -EINVAL;
  182. goto err;
  183. }
  184. /* for subdriver power management */
  185. atomic_set(&info->pmcount, 0);
  186. /* register subdriver */
  187. subdriver = usb_cdc_wdm_register(info->control, &dev->status->desc,
  188. 4096, &qmi_wwan_cdc_wdm_manage_power);
  189. if (IS_ERR(subdriver)) {
  190. dev_err(&info->control->dev, "subdriver registration failed\n");
  191. rv = PTR_ERR(subdriver);
  192. goto err;
  193. }
  194. /* prevent usbnet from using status endpoint */
  195. dev->status = NULL;
  196. /* save subdriver struct for suspend/resume wrappers */
  197. info->subdriver = subdriver;
  198. err:
  199. return rv;
  200. }
  201. static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
  202. {
  203. int status = -1;
  204. u8 *buf = intf->cur_altsetting->extra;
  205. int len = intf->cur_altsetting->extralen;
  206. struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc;
  207. struct usb_cdc_union_desc *cdc_union = NULL;
  208. struct usb_cdc_ether_desc *cdc_ether = NULL;
  209. u32 found = 0;
  210. struct usb_driver *driver = driver_of(intf);
  211. struct qmi_wwan_state *info = (void *)&dev->data;
  212. BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data) <
  213. sizeof(struct qmi_wwan_state)));
  214. /* set up initial state */
  215. info->control = intf;
  216. info->data = intf;
  217. /* and a number of CDC descriptors */
  218. while (len > 3) {
  219. struct usb_descriptor_header *h = (void *)buf;
  220. /* ignore any misplaced descriptors */
  221. if (h->bDescriptorType != USB_DT_CS_INTERFACE)
  222. goto next_desc;
  223. /* buf[2] is CDC descriptor subtype */
  224. switch (buf[2]) {
  225. case USB_CDC_HEADER_TYPE:
  226. if (found & 1 << USB_CDC_HEADER_TYPE) {
  227. dev_dbg(&intf->dev, "extra CDC header\n");
  228. goto err;
  229. }
  230. if (h->bLength != sizeof(struct usb_cdc_header_desc)) {
  231. dev_dbg(&intf->dev, "CDC header len %u\n",
  232. h->bLength);
  233. goto err;
  234. }
  235. break;
  236. case USB_CDC_UNION_TYPE:
  237. if (found & 1 << USB_CDC_UNION_TYPE) {
  238. dev_dbg(&intf->dev, "extra CDC union\n");
  239. goto err;
  240. }
  241. if (h->bLength != sizeof(struct usb_cdc_union_desc)) {
  242. dev_dbg(&intf->dev, "CDC union len %u\n",
  243. h->bLength);
  244. goto err;
  245. }
  246. cdc_union = (struct usb_cdc_union_desc *)buf;
  247. break;
  248. case USB_CDC_ETHERNET_TYPE:
  249. if (found & 1 << USB_CDC_ETHERNET_TYPE) {
  250. dev_dbg(&intf->dev, "extra CDC ether\n");
  251. goto err;
  252. }
  253. if (h->bLength != sizeof(struct usb_cdc_ether_desc)) {
  254. dev_dbg(&intf->dev, "CDC ether len %u\n",
  255. h->bLength);
  256. goto err;
  257. }
  258. cdc_ether = (struct usb_cdc_ether_desc *)buf;
  259. break;
  260. }
  261. /* Remember which CDC functional descriptors we've seen. Works
  262. * for all types we care about, of which USB_CDC_ETHERNET_TYPE
  263. * (0x0f) is the highest numbered
  264. */
  265. if (buf[2] < 32)
  266. found |= 1 << buf[2];
  267. next_desc:
  268. len -= h->bLength;
  269. buf += h->bLength;
  270. }
  271. /* Use separate control and data interfaces if we found a CDC Union */
  272. if (cdc_union) {
  273. info->data = usb_ifnum_to_if(dev->udev,
  274. cdc_union->bSlaveInterface0);
  275. if (desc->bInterfaceNumber != cdc_union->bMasterInterface0 ||
  276. !info->data) {
  277. dev_err(&intf->dev,
  278. "bogus CDC Union: master=%u, slave=%u\n",
  279. cdc_union->bMasterInterface0,
  280. cdc_union->bSlaveInterface0);
  281. goto err;
  282. }
  283. }
  284. /* errors aren't fatal - we can live with the dynamic address */
  285. if (cdc_ether) {
  286. dev->hard_mtu = le16_to_cpu(cdc_ether->wMaxSegmentSize);
  287. usbnet_get_ethernet_addr(dev, cdc_ether->iMACAddress);
  288. }
  289. /* claim data interface and set it up */
  290. if (info->control != info->data) {
  291. status = usb_driver_claim_interface(driver, info->data, dev);
  292. if (status < 0)
  293. goto err;
  294. }
  295. status = qmi_wwan_register_subdriver(dev);
  296. if (status < 0 && info->control != info->data) {
  297. usb_set_intfdata(info->data, NULL);
  298. usb_driver_release_interface(driver, info->data);
  299. }
  300. /* Never use the same address on both ends of the link, even
  301. * if the buggy firmware told us to.
  302. */
  303. if (ether_addr_equal(dev->net->dev_addr, default_modem_addr))
  304. eth_hw_addr_random(dev->net);
  305. /* make MAC addr easily distinguishable from an IP header */
  306. if (possibly_iphdr(dev->net->dev_addr)) {
  307. dev->net->dev_addr[0] |= 0x02; /* set local assignment bit */
  308. dev->net->dev_addr[0] &= 0xbf; /* clear "IP" bit */
  309. }
  310. dev->net->netdev_ops = &qmi_wwan_netdev_ops;
  311. err:
  312. return status;
  313. }
  314. static void qmi_wwan_unbind(struct usbnet *dev, struct usb_interface *intf)
  315. {
  316. struct qmi_wwan_state *info = (void *)&dev->data;
  317. struct usb_driver *driver = driver_of(intf);
  318. struct usb_interface *other;
  319. if (info->subdriver && info->subdriver->disconnect)
  320. info->subdriver->disconnect(info->control);
  321. /* allow user to unbind using either control or data */
  322. if (intf == info->control)
  323. other = info->data;
  324. else
  325. other = info->control;
  326. /* only if not shared */
  327. if (other && intf != other) {
  328. usb_set_intfdata(other, NULL);
  329. usb_driver_release_interface(driver, other);
  330. }
  331. info->subdriver = NULL;
  332. info->data = NULL;
  333. info->control = NULL;
  334. }
  335. /* suspend/resume wrappers calling both usbnet and the cdc-wdm
  336. * subdriver if present.
  337. *
  338. * NOTE: cdc-wdm also supports pre/post_reset, but we cannot provide
  339. * wrappers for those without adding usbnet reset support first.
  340. */
  341. static int qmi_wwan_suspend(struct usb_interface *intf, pm_message_t message)
  342. {
  343. struct usbnet *dev = usb_get_intfdata(intf);
  344. struct qmi_wwan_state *info = (void *)&dev->data;
  345. int ret;
  346. /* Both usbnet_suspend() and subdriver->suspend() MUST return 0
  347. * in system sleep context, otherwise, the resume callback has
  348. * to recover device from previous suspend failure.
  349. */
  350. ret = usbnet_suspend(intf, message);
  351. if (ret < 0)
  352. goto err;
  353. if (intf == info->control && info->subdriver &&
  354. info->subdriver->suspend)
  355. ret = info->subdriver->suspend(intf, message);
  356. if (ret < 0)
  357. usbnet_resume(intf);
  358. err:
  359. return ret;
  360. }
  361. static int qmi_wwan_resume(struct usb_interface *intf)
  362. {
  363. struct usbnet *dev = usb_get_intfdata(intf);
  364. struct qmi_wwan_state *info = (void *)&dev->data;
  365. int ret = 0;
  366. bool callsub = (intf == info->control && info->subdriver &&
  367. info->subdriver->resume);
  368. if (callsub)
  369. ret = info->subdriver->resume(intf);
  370. if (ret < 0)
  371. goto err;
  372. ret = usbnet_resume(intf);
  373. if (ret < 0 && callsub && info->subdriver->suspend)
  374. info->subdriver->suspend(intf, PMSG_SUSPEND);
  375. err:
  376. return ret;
  377. }
  378. static const struct driver_info qmi_wwan_info = {
  379. .description = "WWAN/QMI device",
  380. .flags = FLAG_WWAN,
  381. .bind = qmi_wwan_bind,
  382. .unbind = qmi_wwan_unbind,
  383. .manage_power = qmi_wwan_manage_power,
  384. .rx_fixup = qmi_wwan_rx_fixup,
  385. };
  386. #define HUAWEI_VENDOR_ID 0x12D1
  387. /* map QMI/wwan function by a fixed interface number */
  388. #define QMI_FIXED_INTF(vend, prod, num) \
  389. USB_DEVICE_INTERFACE_NUMBER(vend, prod, num), \
  390. .driver_info = (unsigned long)&qmi_wwan_info
  391. /* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */
  392. #define QMI_GOBI1K_DEVICE(vend, prod) \
  393. QMI_FIXED_INTF(vend, prod, 3)
  394. /* Gobi 2000/3000 QMI/wwan interface number is 0 according to qcserial */
  395. #define QMI_GOBI_DEVICE(vend, prod) \
  396. QMI_FIXED_INTF(vend, prod, 0)
  397. static const struct usb_device_id products[] = {
  398. /* 1. CDC ECM like devices match on the control interface */
  399. { /* Huawei E392, E398 and possibly others sharing both device id and more... */
  400. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 9),
  401. .driver_info = (unsigned long)&qmi_wwan_info,
  402. },
  403. { /* Vodafone/Huawei K5005 (12d1:14c8) and similar modems */
  404. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 57),
  405. .driver_info = (unsigned long)&qmi_wwan_info,
  406. },
  407. { /* HUAWEI_INTERFACE_NDIS_CONTROL_QUALCOMM */
  408. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x69),
  409. .driver_info = (unsigned long)&qmi_wwan_info,
  410. },
  411. /* 2. Combined interface devices matching on class+protocol */
  412. { /* Huawei E367 and possibly others in "Windows mode" */
  413. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 7),
  414. .driver_info = (unsigned long)&qmi_wwan_info,
  415. },
  416. { /* Huawei E392, E398 and possibly others in "Windows mode" */
  417. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 17),
  418. .driver_info = (unsigned long)&qmi_wwan_info,
  419. },
  420. { /* HUAWEI_NDIS_SINGLE_INTERFACE_VDF */
  421. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x37),
  422. .driver_info = (unsigned long)&qmi_wwan_info,
  423. },
  424. { /* HUAWEI_INTERFACE_NDIS_HW_QUALCOMM */
  425. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x67),
  426. .driver_info = (unsigned long)&qmi_wwan_info,
  427. },
  428. { /* Pantech UML290, P4200 and more */
  429. USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 0xf0, 0xff),
  430. .driver_info = (unsigned long)&qmi_wwan_info,
  431. },
  432. { /* Pantech UML290 - newer firmware */
  433. USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 0xf1, 0xff),
  434. .driver_info = (unsigned long)&qmi_wwan_info,
  435. },
  436. { /* Novatel USB551L and MC551 */
  437. USB_DEVICE_AND_INTERFACE_INFO(0x1410, 0xb001,
  438. USB_CLASS_COMM,
  439. USB_CDC_SUBCLASS_ETHERNET,
  440. USB_CDC_PROTO_NONE),
  441. .driver_info = (unsigned long)&qmi_wwan_info,
  442. },
  443. { /* Novatel E362 */
  444. USB_DEVICE_AND_INTERFACE_INFO(0x1410, 0x9010,
  445. USB_CLASS_COMM,
  446. USB_CDC_SUBCLASS_ETHERNET,
  447. USB_CDC_PROTO_NONE),
  448. .driver_info = (unsigned long)&qmi_wwan_info,
  449. },
  450. { /* Dell Wireless 5800 (Novatel E362) */
  451. USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x8195,
  452. USB_CLASS_COMM,
  453. USB_CDC_SUBCLASS_ETHERNET,
  454. USB_CDC_PROTO_NONE),
  455. .driver_info = (unsigned long)&qmi_wwan_info,
  456. },
  457. { /* Dell Wireless 5800 V2 (Novatel E362) */
  458. USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x8196,
  459. USB_CLASS_COMM,
  460. USB_CDC_SUBCLASS_ETHERNET,
  461. USB_CDC_PROTO_NONE),
  462. .driver_info = (unsigned long)&qmi_wwan_info,
  463. },
  464. { /* Dell Wireless 5804 (Novatel E371) */
  465. USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x819b,
  466. USB_CLASS_COMM,
  467. USB_CDC_SUBCLASS_ETHERNET,
  468. USB_CDC_PROTO_NONE),
  469. .driver_info = (unsigned long)&qmi_wwan_info,
  470. },
  471. { /* ADU960S */
  472. USB_DEVICE_AND_INTERFACE_INFO(0x16d5, 0x650a,
  473. USB_CLASS_COMM,
  474. USB_CDC_SUBCLASS_ETHERNET,
  475. USB_CDC_PROTO_NONE),
  476. .driver_info = (unsigned long)&qmi_wwan_info,
  477. },
  478. /* 3. Combined interface devices matching on interface number */
  479. {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */
  480. {QMI_FIXED_INTF(0x05c6, 0x7000, 0)},
  481. {QMI_FIXED_INTF(0x05c6, 0x7001, 1)},
  482. {QMI_FIXED_INTF(0x05c6, 0x7002, 1)},
  483. {QMI_FIXED_INTF(0x05c6, 0x7101, 1)},
  484. {QMI_FIXED_INTF(0x05c6, 0x7101, 2)},
  485. {QMI_FIXED_INTF(0x05c6, 0x7101, 3)},
  486. {QMI_FIXED_INTF(0x05c6, 0x7102, 1)},
  487. {QMI_FIXED_INTF(0x05c6, 0x7102, 2)},
  488. {QMI_FIXED_INTF(0x05c6, 0x7102, 3)},
  489. {QMI_FIXED_INTF(0x05c6, 0x8000, 7)},
  490. {QMI_FIXED_INTF(0x05c6, 0x8001, 6)},
  491. {QMI_FIXED_INTF(0x05c6, 0x9000, 4)},
  492. {QMI_FIXED_INTF(0x05c6, 0x9003, 4)},
  493. {QMI_FIXED_INTF(0x05c6, 0x9005, 2)},
  494. {QMI_FIXED_INTF(0x05c6, 0x900a, 4)},
  495. {QMI_FIXED_INTF(0x05c6, 0x900b, 2)},
  496. {QMI_FIXED_INTF(0x05c6, 0x900c, 4)},
  497. {QMI_FIXED_INTF(0x05c6, 0x900c, 5)},
  498. {QMI_FIXED_INTF(0x05c6, 0x900c, 6)},
  499. {QMI_FIXED_INTF(0x05c6, 0x900d, 5)},
  500. {QMI_FIXED_INTF(0x05c6, 0x900f, 3)},
  501. {QMI_FIXED_INTF(0x05c6, 0x900f, 4)},
  502. {QMI_FIXED_INTF(0x05c6, 0x900f, 5)},
  503. {QMI_FIXED_INTF(0x05c6, 0x9010, 4)},
  504. {QMI_FIXED_INTF(0x05c6, 0x9010, 5)},
  505. {QMI_FIXED_INTF(0x05c6, 0x9011, 3)},
  506. {QMI_FIXED_INTF(0x05c6, 0x9011, 4)},
  507. {QMI_FIXED_INTF(0x05c6, 0x9021, 1)},
  508. {QMI_FIXED_INTF(0x05c6, 0x9022, 2)},
  509. {QMI_FIXED_INTF(0x05c6, 0x9025, 4)}, /* Alcatel-sbell ASB TL131 TDD LTE (China Mobile) */
  510. {QMI_FIXED_INTF(0x05c6, 0x9026, 3)},
  511. {QMI_FIXED_INTF(0x05c6, 0x902e, 5)},
  512. {QMI_FIXED_INTF(0x05c6, 0x9031, 5)},
  513. {QMI_FIXED_INTF(0x05c6, 0x9032, 4)},
  514. {QMI_FIXED_INTF(0x05c6, 0x9033, 3)},
  515. {QMI_FIXED_INTF(0x05c6, 0x9033, 4)},
  516. {QMI_FIXED_INTF(0x05c6, 0x9033, 5)},
  517. {QMI_FIXED_INTF(0x05c6, 0x9033, 6)},
  518. {QMI_FIXED_INTF(0x05c6, 0x9034, 3)},
  519. {QMI_FIXED_INTF(0x05c6, 0x9034, 4)},
  520. {QMI_FIXED_INTF(0x05c6, 0x9034, 5)},
  521. {QMI_FIXED_INTF(0x05c6, 0x9034, 6)},
  522. {QMI_FIXED_INTF(0x05c6, 0x9034, 7)},
  523. {QMI_FIXED_INTF(0x05c6, 0x9035, 4)},
  524. {QMI_FIXED_INTF(0x05c6, 0x9036, 3)},
  525. {QMI_FIXED_INTF(0x05c6, 0x9037, 5)},
  526. {QMI_FIXED_INTF(0x05c6, 0x9038, 4)},
  527. {QMI_FIXED_INTF(0x05c6, 0x903b, 7)},
  528. {QMI_FIXED_INTF(0x05c6, 0x903c, 6)},
  529. {QMI_FIXED_INTF(0x05c6, 0x903d, 6)},
  530. {QMI_FIXED_INTF(0x05c6, 0x903e, 5)},
  531. {QMI_FIXED_INTF(0x05c6, 0x9043, 3)},
  532. {QMI_FIXED_INTF(0x05c6, 0x9046, 3)},
  533. {QMI_FIXED_INTF(0x05c6, 0x9046, 4)},
  534. {QMI_FIXED_INTF(0x05c6, 0x9046, 5)},
  535. {QMI_FIXED_INTF(0x05c6, 0x9047, 2)},
  536. {QMI_FIXED_INTF(0x05c6, 0x9047, 3)},
  537. {QMI_FIXED_INTF(0x05c6, 0x9047, 4)},
  538. {QMI_FIXED_INTF(0x05c6, 0x9048, 4)},
  539. {QMI_FIXED_INTF(0x05c6, 0x9048, 5)},
  540. {QMI_FIXED_INTF(0x05c6, 0x9048, 6)},
  541. {QMI_FIXED_INTF(0x05c6, 0x9048, 7)},
  542. {QMI_FIXED_INTF(0x05c6, 0x9048, 8)},
  543. {QMI_FIXED_INTF(0x05c6, 0x904c, 5)},
  544. {QMI_FIXED_INTF(0x05c6, 0x904c, 6)},
  545. {QMI_FIXED_INTF(0x05c6, 0x904c, 7)},
  546. {QMI_FIXED_INTF(0x05c6, 0x904c, 8)},
  547. {QMI_FIXED_INTF(0x05c6, 0x9050, 3)},
  548. {QMI_FIXED_INTF(0x05c6, 0x9052, 4)},
  549. {QMI_FIXED_INTF(0x05c6, 0x9053, 6)},
  550. {QMI_FIXED_INTF(0x05c6, 0x9053, 7)},
  551. {QMI_FIXED_INTF(0x05c6, 0x9054, 5)},
  552. {QMI_FIXED_INTF(0x05c6, 0x9054, 6)},
  553. {QMI_FIXED_INTF(0x05c6, 0x9055, 3)},
  554. {QMI_FIXED_INTF(0x05c6, 0x9055, 4)},
  555. {QMI_FIXED_INTF(0x05c6, 0x9055, 5)},
  556. {QMI_FIXED_INTF(0x05c6, 0x9055, 6)},
  557. {QMI_FIXED_INTF(0x05c6, 0x9055, 7)},
  558. {QMI_FIXED_INTF(0x05c6, 0x9056, 3)},
  559. {QMI_FIXED_INTF(0x05c6, 0x9062, 2)},
  560. {QMI_FIXED_INTF(0x05c6, 0x9062, 3)},
  561. {QMI_FIXED_INTF(0x05c6, 0x9062, 4)},
  562. {QMI_FIXED_INTF(0x05c6, 0x9062, 5)},
  563. {QMI_FIXED_INTF(0x05c6, 0x9062, 6)},
  564. {QMI_FIXED_INTF(0x05c6, 0x9062, 7)},
  565. {QMI_FIXED_INTF(0x05c6, 0x9062, 8)},
  566. {QMI_FIXED_INTF(0x05c6, 0x9062, 9)},
  567. {QMI_FIXED_INTF(0x05c6, 0x9064, 3)},
  568. {QMI_FIXED_INTF(0x05c6, 0x9065, 6)},
  569. {QMI_FIXED_INTF(0x05c6, 0x9065, 7)},
  570. {QMI_FIXED_INTF(0x05c6, 0x9066, 5)},
  571. {QMI_FIXED_INTF(0x05c6, 0x9066, 6)},
  572. {QMI_FIXED_INTF(0x05c6, 0x9067, 1)},
  573. {QMI_FIXED_INTF(0x05c6, 0x9068, 2)},
  574. {QMI_FIXED_INTF(0x05c6, 0x9068, 3)},
  575. {QMI_FIXED_INTF(0x05c6, 0x9068, 4)},
  576. {QMI_FIXED_INTF(0x05c6, 0x9068, 5)},
  577. {QMI_FIXED_INTF(0x05c6, 0x9068, 6)},
  578. {QMI_FIXED_INTF(0x05c6, 0x9068, 7)},
  579. {QMI_FIXED_INTF(0x05c6, 0x9069, 5)},
  580. {QMI_FIXED_INTF(0x05c6, 0x9069, 6)},
  581. {QMI_FIXED_INTF(0x05c6, 0x9069, 7)},
  582. {QMI_FIXED_INTF(0x05c6, 0x9069, 8)},
  583. {QMI_FIXED_INTF(0x05c6, 0x9070, 4)},
  584. {QMI_FIXED_INTF(0x05c6, 0x9070, 5)},
  585. {QMI_FIXED_INTF(0x05c6, 0x9075, 5)},
  586. {QMI_FIXED_INTF(0x05c6, 0x9076, 4)},
  587. {QMI_FIXED_INTF(0x05c6, 0x9076, 5)},
  588. {QMI_FIXED_INTF(0x05c6, 0x9076, 6)},
  589. {QMI_FIXED_INTF(0x05c6, 0x9076, 7)},
  590. {QMI_FIXED_INTF(0x05c6, 0x9076, 8)},
  591. {QMI_FIXED_INTF(0x05c6, 0x9077, 3)},
  592. {QMI_FIXED_INTF(0x05c6, 0x9077, 4)},
  593. {QMI_FIXED_INTF(0x05c6, 0x9077, 5)},
  594. {QMI_FIXED_INTF(0x05c6, 0x9077, 6)},
  595. {QMI_FIXED_INTF(0x05c6, 0x9078, 3)},
  596. {QMI_FIXED_INTF(0x05c6, 0x9079, 4)},
  597. {QMI_FIXED_INTF(0x05c6, 0x9079, 5)},
  598. {QMI_FIXED_INTF(0x05c6, 0x9079, 6)},
  599. {QMI_FIXED_INTF(0x05c6, 0x9079, 7)},
  600. {QMI_FIXED_INTF(0x05c6, 0x9079, 8)},
  601. {QMI_FIXED_INTF(0x05c6, 0x9080, 5)},
  602. {QMI_FIXED_INTF(0x05c6, 0x9080, 6)},
  603. {QMI_FIXED_INTF(0x05c6, 0x9080, 7)},
  604. {QMI_FIXED_INTF(0x05c6, 0x9080, 8)},
  605. {QMI_FIXED_INTF(0x05c6, 0x9083, 3)},
  606. {QMI_FIXED_INTF(0x05c6, 0x9084, 4)},
  607. {QMI_FIXED_INTF(0x05c6, 0x920d, 0)},
  608. {QMI_FIXED_INTF(0x05c6, 0x920d, 5)},
  609. {QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */
  610. {QMI_FIXED_INTF(0x12d1, 0x14ac, 1)}, /* Huawei E1820 */
  611. {QMI_FIXED_INTF(0x19d2, 0x0002, 1)},
  612. {QMI_FIXED_INTF(0x19d2, 0x0012, 1)},
  613. {QMI_FIXED_INTF(0x19d2, 0x0017, 3)},
  614. {QMI_FIXED_INTF(0x19d2, 0x0019, 3)}, /* ONDA MT689DC */
  615. {QMI_FIXED_INTF(0x19d2, 0x0021, 4)},
  616. {QMI_FIXED_INTF(0x19d2, 0x0025, 1)},
  617. {QMI_FIXED_INTF(0x19d2, 0x0031, 4)},
  618. {QMI_FIXED_INTF(0x19d2, 0x0042, 4)},
  619. {QMI_FIXED_INTF(0x19d2, 0x0049, 5)},
  620. {QMI_FIXED_INTF(0x19d2, 0x0052, 4)},
  621. {QMI_FIXED_INTF(0x19d2, 0x0055, 1)}, /* ZTE (Vodafone) K3520-Z */
  622. {QMI_FIXED_INTF(0x19d2, 0x0058, 4)},
  623. {QMI_FIXED_INTF(0x19d2, 0x0063, 4)}, /* ZTE (Vodafone) K3565-Z */
  624. {QMI_FIXED_INTF(0x19d2, 0x0104, 4)}, /* ZTE (Vodafone) K4505-Z */
  625. {QMI_FIXED_INTF(0x19d2, 0x0113, 5)},
  626. {QMI_FIXED_INTF(0x19d2, 0x0118, 5)},
  627. {QMI_FIXED_INTF(0x19d2, 0x0121, 5)},
  628. {QMI_FIXED_INTF(0x19d2, 0x0123, 4)},
  629. {QMI_FIXED_INTF(0x19d2, 0x0124, 5)},
  630. {QMI_FIXED_INTF(0x19d2, 0x0125, 6)},
  631. {QMI_FIXED_INTF(0x19d2, 0x0126, 5)},
  632. {QMI_FIXED_INTF(0x19d2, 0x0130, 1)},
  633. {QMI_FIXED_INTF(0x19d2, 0x0133, 3)},
  634. {QMI_FIXED_INTF(0x19d2, 0x0141, 5)},
  635. {QMI_FIXED_INTF(0x19d2, 0x0157, 5)}, /* ZTE MF683 */
  636. {QMI_FIXED_INTF(0x19d2, 0x0158, 3)},
  637. {QMI_FIXED_INTF(0x19d2, 0x0167, 4)}, /* ZTE MF820D */
  638. {QMI_FIXED_INTF(0x19d2, 0x0168, 4)},
  639. {QMI_FIXED_INTF(0x19d2, 0x0176, 3)},
  640. {QMI_FIXED_INTF(0x19d2, 0x0178, 3)},
  641. {QMI_FIXED_INTF(0x19d2, 0x0191, 4)}, /* ZTE EuFi890 */
  642. {QMI_FIXED_INTF(0x19d2, 0x0199, 1)}, /* ZTE MF820S */
  643. {QMI_FIXED_INTF(0x19d2, 0x0200, 1)},
  644. {QMI_FIXED_INTF(0x19d2, 0x0257, 3)}, /* ZTE MF821 */
  645. {QMI_FIXED_INTF(0x19d2, 0x0265, 4)}, /* ONDA MT8205 4G LTE */
  646. {QMI_FIXED_INTF(0x19d2, 0x0284, 4)}, /* ZTE MF880 */
  647. {QMI_FIXED_INTF(0x19d2, 0x0326, 4)}, /* ZTE MF821D */
  648. {QMI_FIXED_INTF(0x19d2, 0x0412, 4)}, /* Telewell TW-LTE 4G */
  649. {QMI_FIXED_INTF(0x19d2, 0x1008, 4)}, /* ZTE (Vodafone) K3570-Z */
  650. {QMI_FIXED_INTF(0x19d2, 0x1010, 4)}, /* ZTE (Vodafone) K3571-Z */
  651. {QMI_FIXED_INTF(0x19d2, 0x1012, 4)},
  652. {QMI_FIXED_INTF(0x19d2, 0x1018, 3)}, /* ZTE (Vodafone) K5006-Z */
  653. {QMI_FIXED_INTF(0x19d2, 0x1021, 2)},
  654. {QMI_FIXED_INTF(0x19d2, 0x1245, 4)},
  655. {QMI_FIXED_INTF(0x19d2, 0x1247, 4)},
  656. {QMI_FIXED_INTF(0x19d2, 0x1252, 4)},
  657. {QMI_FIXED_INTF(0x19d2, 0x1254, 4)},
  658. {QMI_FIXED_INTF(0x19d2, 0x1255, 3)},
  659. {QMI_FIXED_INTF(0x19d2, 0x1255, 4)},
  660. {QMI_FIXED_INTF(0x19d2, 0x1256, 4)},
  661. {QMI_FIXED_INTF(0x19d2, 0x1401, 2)},
  662. {QMI_FIXED_INTF(0x19d2, 0x1402, 2)}, /* ZTE MF60 */
  663. {QMI_FIXED_INTF(0x19d2, 0x1424, 2)},
  664. {QMI_FIXED_INTF(0x19d2, 0x1425, 2)},
  665. {QMI_FIXED_INTF(0x19d2, 0x1426, 2)}, /* ZTE MF91 */
  666. {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */
  667. {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */
  668. {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */
  669. {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */
  670. {QMI_FIXED_INTF(0x1199, 0x68a2, 19)}, /* Sierra Wireless MC7710 in QMI mode */
  671. {QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */
  672. {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */
  673. {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */
  674. {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */
  675. {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */
  676. {QMI_FIXED_INTF(0x1bc7, 0x1201, 2)}, /* Telit LE920 */
  677. {QMI_FIXED_INTF(0x0b3c, 0xc005, 6)}, /* Olivetti Olicard 200 */
  678. {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)}, /* Cinterion PLxx */
  679. /* 4. Gobi 1000 devices */
  680. {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
  681. {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */
  682. {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */
  683. {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */
  684. {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel/Verizon USB-1000 */
  685. {QMI_GOBI1K_DEVICE(0x1410, 0xa002)}, /* Novatel Gobi Modem device */
  686. {QMI_GOBI1K_DEVICE(0x1410, 0xa003)}, /* Novatel Gobi Modem device */
  687. {QMI_GOBI1K_DEVICE(0x1410, 0xa004)}, /* Novatel Gobi Modem device */
  688. {QMI_GOBI1K_DEVICE(0x1410, 0xa005)}, /* Novatel Gobi Modem device */
  689. {QMI_GOBI1K_DEVICE(0x1410, 0xa006)}, /* Novatel Gobi Modem device */
  690. {QMI_GOBI1K_DEVICE(0x1410, 0xa007)}, /* Novatel Gobi Modem device */
  691. {QMI_GOBI1K_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */
  692. {QMI_GOBI1K_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */
  693. {QMI_GOBI1K_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */
  694. {QMI_GOBI1K_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */
  695. {QMI_GOBI1K_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */
  696. {QMI_GOBI1K_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */
  697. {QMI_GOBI1K_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */
  698. {QMI_GOBI1K_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */
  699. /* 5. Gobi 2000 and 3000 devices */
  700. {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */
  701. {QMI_GOBI_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */
  702. {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */
  703. {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */
  704. {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */
  705. {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */
  706. {QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */
  707. {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */
  708. {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */
  709. {QMI_GOBI_DEVICE(0x05c6, 0x9275)}, /* iRex Technologies Gobi 2000 Modem device (VR307) */
  710. {QMI_GOBI_DEVICE(0x0af0, 0x8120)}, /* Option GTM681W */
  711. {QMI_GOBI_DEVICE(0x1199, 0x68a5)}, /* Sierra Wireless Modem */
  712. {QMI_GOBI_DEVICE(0x1199, 0x68a9)}, /* Sierra Wireless Modem */
  713. {QMI_GOBI_DEVICE(0x1199, 0x9001)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  714. {QMI_GOBI_DEVICE(0x1199, 0x9002)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  715. {QMI_GOBI_DEVICE(0x1199, 0x9003)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  716. {QMI_GOBI_DEVICE(0x1199, 0x9004)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  717. {QMI_GOBI_DEVICE(0x1199, 0x9005)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  718. {QMI_GOBI_DEVICE(0x1199, 0x9006)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  719. {QMI_GOBI_DEVICE(0x1199, 0x9007)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  720. {QMI_GOBI_DEVICE(0x1199, 0x9008)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  721. {QMI_GOBI_DEVICE(0x1199, 0x9009)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  722. {QMI_GOBI_DEVICE(0x1199, 0x900a)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  723. {QMI_GOBI_DEVICE(0x1199, 0x9011)}, /* Sierra Wireless Gobi 2000 Modem device (MC8305) */
  724. {QMI_GOBI_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */
  725. {QMI_GOBI_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */
  726. {QMI_GOBI_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */
  727. {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */
  728. {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */
  729. {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */
  730. {QMI_GOBI_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */
  731. {QMI_GOBI_DEVICE(0x12d1, 0x14f1)}, /* Sony Gobi 3000 Composite */
  732. {QMI_GOBI_DEVICE(0x1410, 0xa021)}, /* Foxconn Gobi 3000 Modem device (Novatel E396) */
  733. { } /* END */
  734. };
  735. MODULE_DEVICE_TABLE(usb, products);
  736. static int qmi_wwan_probe(struct usb_interface *intf,
  737. const struct usb_device_id *prod)
  738. {
  739. struct usb_device_id *id = (struct usb_device_id *)prod;
  740. /* Workaround to enable dynamic IDs. This disables usbnet
  741. * blacklisting functionality. Which, if required, can be
  742. * reimplemented here by using a magic "blacklist" value
  743. * instead of 0 in the static device id table
  744. */
  745. if (!id->driver_info) {
  746. dev_dbg(&intf->dev, "setting defaults for dynamic device id\n");
  747. id->driver_info = (unsigned long)&qmi_wwan_info;
  748. }
  749. return usbnet_probe(intf, id);
  750. }
  751. static struct usb_driver qmi_wwan_driver = {
  752. .name = "qmi_wwan",
  753. .id_table = products,
  754. .probe = qmi_wwan_probe,
  755. .disconnect = usbnet_disconnect,
  756. .suspend = qmi_wwan_suspend,
  757. .resume = qmi_wwan_resume,
  758. .reset_resume = qmi_wwan_resume,
  759. .supports_autosuspend = 1,
  760. .disable_hub_initiated_lpm = 1,
  761. };
  762. module_usb_driver(qmi_wwan_driver);
  763. MODULE_AUTHOR("Bjørn Mork <bjorn@mork.no>");
  764. MODULE_DESCRIPTION("Qualcomm MSM Interface (QMI) WWAN driver");
  765. MODULE_LICENSE("GPL");