qmi_wwan.c 33 KB

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