qmi_wwan.c 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902
  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. static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00};
  55. /* Make up an ethernet header if the packet doesn't have one.
  56. *
  57. * A firmware bug common among several devices cause them to send raw
  58. * IP packets under some circumstances. There is no way for the
  59. * driver/host to know when this will happen. And even when the bug
  60. * hits, some packets will still arrive with an intact header.
  61. *
  62. * The supported devices are only capably of sending IPv4, IPv6 and
  63. * ARP packets on a point-to-point link. Any packet with an ethernet
  64. * header will have either our address or a broadcast/multicast
  65. * address as destination. ARP packets will always have a header.
  66. *
  67. * This means that this function will reliably add the appropriate
  68. * header iff necessary, provided our hardware address does not start
  69. * with 4 or 6.
  70. *
  71. * Another common firmware bug results in all packets being addressed
  72. * to 00:a0:c6:00:00:00 despite the host address being different.
  73. * This function will also fixup such packets.
  74. */
  75. static int qmi_wwan_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
  76. {
  77. __be16 proto;
  78. /* This check is no longer done by usbnet */
  79. if (skb->len < dev->net->hard_header_len)
  80. return 0;
  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. eth_zero_addr(eth_hdr(skb)->h_source);
  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;
  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. dev->intf->needs_remote_wakeup = on;
  151. if (!rv)
  152. usb_autopm_put_interface(dev->intf);
  153. }
  154. return 0;
  155. }
  156. static int qmi_wwan_cdc_wdm_manage_power(struct usb_interface *intf, int on)
  157. {
  158. struct usbnet *dev = usb_get_intfdata(intf);
  159. /* can be called while disconnecting */
  160. if (!dev)
  161. return 0;
  162. return qmi_wwan_manage_power(dev, on);
  163. }
  164. /* collect all three endpoints and register subdriver */
  165. static int qmi_wwan_register_subdriver(struct usbnet *dev)
  166. {
  167. int rv;
  168. struct usb_driver *subdriver = NULL;
  169. struct qmi_wwan_state *info = (void *)&dev->data;
  170. /* collect bulk endpoints */
  171. rv = usbnet_get_endpoints(dev, info->data);
  172. if (rv < 0)
  173. goto err;
  174. /* update status endpoint if separate control interface */
  175. if (info->control != info->data)
  176. dev->status = &info->control->cur_altsetting->endpoint[0];
  177. /* require interrupt endpoint for subdriver */
  178. if (!dev->status) {
  179. rv = -EINVAL;
  180. goto err;
  181. }
  182. /* for subdriver power management */
  183. atomic_set(&info->pmcount, 0);
  184. /* register subdriver */
  185. subdriver = usb_cdc_wdm_register(info->control, &dev->status->desc,
  186. 4096, &qmi_wwan_cdc_wdm_manage_power);
  187. if (IS_ERR(subdriver)) {
  188. dev_err(&info->control->dev, "subdriver registration failed\n");
  189. rv = PTR_ERR(subdriver);
  190. goto err;
  191. }
  192. /* prevent usbnet from using status endpoint */
  193. dev->status = NULL;
  194. /* save subdriver struct for suspend/resume wrappers */
  195. info->subdriver = subdriver;
  196. err:
  197. return rv;
  198. }
  199. static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
  200. {
  201. int status = -1;
  202. u8 *buf = intf->cur_altsetting->extra;
  203. int len = intf->cur_altsetting->extralen;
  204. struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc;
  205. struct usb_cdc_union_desc *cdc_union;
  206. struct usb_cdc_ether_desc *cdc_ether;
  207. struct usb_driver *driver = driver_of(intf);
  208. struct qmi_wwan_state *info = (void *)&dev->data;
  209. struct usb_cdc_parsed_header hdr;
  210. BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data) <
  211. sizeof(struct qmi_wwan_state)));
  212. /* set up initial state */
  213. info->control = intf;
  214. info->data = intf;
  215. /* and a number of CDC descriptors */
  216. cdc_parse_cdc_header(&hdr, intf, buf, len);
  217. cdc_union = hdr.usb_cdc_union_desc;
  218. cdc_ether = hdr.usb_cdc_ether_desc;
  219. /* Use separate control and data interfaces if we found a CDC Union */
  220. if (cdc_union) {
  221. info->data = usb_ifnum_to_if(dev->udev,
  222. cdc_union->bSlaveInterface0);
  223. if (desc->bInterfaceNumber != cdc_union->bMasterInterface0 ||
  224. !info->data) {
  225. dev_err(&intf->dev,
  226. "bogus CDC Union: master=%u, slave=%u\n",
  227. cdc_union->bMasterInterface0,
  228. cdc_union->bSlaveInterface0);
  229. goto err;
  230. }
  231. }
  232. /* errors aren't fatal - we can live with the dynamic address */
  233. if (cdc_ether && cdc_ether->wMaxSegmentSize) {
  234. dev->hard_mtu = le16_to_cpu(cdc_ether->wMaxSegmentSize);
  235. usbnet_get_ethernet_addr(dev, cdc_ether->iMACAddress);
  236. }
  237. /* claim data interface and set it up */
  238. if (info->control != info->data) {
  239. status = usb_driver_claim_interface(driver, info->data, dev);
  240. if (status < 0)
  241. goto err;
  242. }
  243. status = qmi_wwan_register_subdriver(dev);
  244. if (status < 0 && info->control != info->data) {
  245. usb_set_intfdata(info->data, NULL);
  246. usb_driver_release_interface(driver, info->data);
  247. }
  248. /* Never use the same address on both ends of the link, even if the
  249. * buggy firmware told us to. Or, if device is assigned the well-known
  250. * buggy firmware MAC address, replace it with a random address,
  251. */
  252. if (ether_addr_equal(dev->net->dev_addr, default_modem_addr) ||
  253. ether_addr_equal(dev->net->dev_addr, buggy_fw_addr))
  254. eth_hw_addr_random(dev->net);
  255. /* make MAC addr easily distinguishable from an IP header */
  256. if (possibly_iphdr(dev->net->dev_addr)) {
  257. dev->net->dev_addr[0] |= 0x02; /* set local assignment bit */
  258. dev->net->dev_addr[0] &= 0xbf; /* clear "IP" bit */
  259. }
  260. dev->net->netdev_ops = &qmi_wwan_netdev_ops;
  261. err:
  262. return status;
  263. }
  264. static void qmi_wwan_unbind(struct usbnet *dev, struct usb_interface *intf)
  265. {
  266. struct qmi_wwan_state *info = (void *)&dev->data;
  267. struct usb_driver *driver = driver_of(intf);
  268. struct usb_interface *other;
  269. if (info->subdriver && info->subdriver->disconnect)
  270. info->subdriver->disconnect(info->control);
  271. /* allow user to unbind using either control or data */
  272. if (intf == info->control)
  273. other = info->data;
  274. else
  275. other = info->control;
  276. /* only if not shared */
  277. if (other && intf != other) {
  278. usb_set_intfdata(other, NULL);
  279. usb_driver_release_interface(driver, other);
  280. }
  281. info->subdriver = NULL;
  282. info->data = NULL;
  283. info->control = NULL;
  284. }
  285. /* suspend/resume wrappers calling both usbnet and the cdc-wdm
  286. * subdriver if present.
  287. *
  288. * NOTE: cdc-wdm also supports pre/post_reset, but we cannot provide
  289. * wrappers for those without adding usbnet reset support first.
  290. */
  291. static int qmi_wwan_suspend(struct usb_interface *intf, pm_message_t message)
  292. {
  293. struct usbnet *dev = usb_get_intfdata(intf);
  294. struct qmi_wwan_state *info = (void *)&dev->data;
  295. int ret;
  296. /* Both usbnet_suspend() and subdriver->suspend() MUST return 0
  297. * in system sleep context, otherwise, the resume callback has
  298. * to recover device from previous suspend failure.
  299. */
  300. ret = usbnet_suspend(intf, message);
  301. if (ret < 0)
  302. goto err;
  303. if (intf == info->control && info->subdriver &&
  304. info->subdriver->suspend)
  305. ret = info->subdriver->suspend(intf, message);
  306. if (ret < 0)
  307. usbnet_resume(intf);
  308. err:
  309. return ret;
  310. }
  311. static int qmi_wwan_resume(struct usb_interface *intf)
  312. {
  313. struct usbnet *dev = usb_get_intfdata(intf);
  314. struct qmi_wwan_state *info = (void *)&dev->data;
  315. int ret = 0;
  316. bool callsub = (intf == info->control && info->subdriver &&
  317. info->subdriver->resume);
  318. if (callsub)
  319. ret = info->subdriver->resume(intf);
  320. if (ret < 0)
  321. goto err;
  322. ret = usbnet_resume(intf);
  323. if (ret < 0 && callsub)
  324. info->subdriver->suspend(intf, PMSG_SUSPEND);
  325. err:
  326. return ret;
  327. }
  328. static const struct driver_info qmi_wwan_info = {
  329. .description = "WWAN/QMI device",
  330. .flags = FLAG_WWAN,
  331. .bind = qmi_wwan_bind,
  332. .unbind = qmi_wwan_unbind,
  333. .manage_power = qmi_wwan_manage_power,
  334. .rx_fixup = qmi_wwan_rx_fixup,
  335. };
  336. #define HUAWEI_VENDOR_ID 0x12D1
  337. /* map QMI/wwan function by a fixed interface number */
  338. #define QMI_FIXED_INTF(vend, prod, num) \
  339. USB_DEVICE_INTERFACE_NUMBER(vend, prod, num), \
  340. .driver_info = (unsigned long)&qmi_wwan_info
  341. /* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */
  342. #define QMI_GOBI1K_DEVICE(vend, prod) \
  343. QMI_FIXED_INTF(vend, prod, 3)
  344. /* Gobi 2000/3000 QMI/wwan interface number is 0 according to qcserial */
  345. #define QMI_GOBI_DEVICE(vend, prod) \
  346. QMI_FIXED_INTF(vend, prod, 0)
  347. static const struct usb_device_id products[] = {
  348. /* 1. CDC ECM like devices match on the control interface */
  349. { /* Huawei E392, E398 and possibly others sharing both device id and more... */
  350. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 9),
  351. .driver_info = (unsigned long)&qmi_wwan_info,
  352. },
  353. { /* Vodafone/Huawei K5005 (12d1:14c8) and similar modems */
  354. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 57),
  355. .driver_info = (unsigned long)&qmi_wwan_info,
  356. },
  357. { /* HUAWEI_INTERFACE_NDIS_CONTROL_QUALCOMM */
  358. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x69),
  359. .driver_info = (unsigned long)&qmi_wwan_info,
  360. },
  361. { /* Motorola Mapphone devices with MDM6600 */
  362. USB_VENDOR_AND_INTERFACE_INFO(0x22b8, USB_CLASS_VENDOR_SPEC, 0xfb, 0xff),
  363. .driver_info = (unsigned long)&qmi_wwan_info,
  364. },
  365. /* 2. Combined interface devices matching on class+protocol */
  366. { /* Huawei E367 and possibly others in "Windows mode" */
  367. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 7),
  368. .driver_info = (unsigned long)&qmi_wwan_info,
  369. },
  370. { /* Huawei E392, E398 and possibly others in "Windows mode" */
  371. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 17),
  372. .driver_info = (unsigned long)&qmi_wwan_info,
  373. },
  374. { /* HUAWEI_NDIS_SINGLE_INTERFACE_VDF */
  375. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x37),
  376. .driver_info = (unsigned long)&qmi_wwan_info,
  377. },
  378. { /* HUAWEI_INTERFACE_NDIS_HW_QUALCOMM */
  379. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x67),
  380. .driver_info = (unsigned long)&qmi_wwan_info,
  381. },
  382. { /* Pantech UML290, P4200 and more */
  383. USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 0xf0, 0xff),
  384. .driver_info = (unsigned long)&qmi_wwan_info,
  385. },
  386. { /* Pantech UML290 - newer firmware */
  387. USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 0xf1, 0xff),
  388. .driver_info = (unsigned long)&qmi_wwan_info,
  389. },
  390. { /* Novatel USB551L and MC551 */
  391. USB_DEVICE_AND_INTERFACE_INFO(0x1410, 0xb001,
  392. USB_CLASS_COMM,
  393. USB_CDC_SUBCLASS_ETHERNET,
  394. USB_CDC_PROTO_NONE),
  395. .driver_info = (unsigned long)&qmi_wwan_info,
  396. },
  397. { /* Novatel E362 */
  398. USB_DEVICE_AND_INTERFACE_INFO(0x1410, 0x9010,
  399. USB_CLASS_COMM,
  400. USB_CDC_SUBCLASS_ETHERNET,
  401. USB_CDC_PROTO_NONE),
  402. .driver_info = (unsigned long)&qmi_wwan_info,
  403. },
  404. { /* Novatel Expedite E371 */
  405. USB_DEVICE_AND_INTERFACE_INFO(0x1410, 0x9011,
  406. USB_CLASS_COMM,
  407. USB_CDC_SUBCLASS_ETHERNET,
  408. USB_CDC_PROTO_NONE),
  409. .driver_info = (unsigned long)&qmi_wwan_info,
  410. },
  411. { /* Dell Wireless 5800 (Novatel E362) */
  412. USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x8195,
  413. USB_CLASS_COMM,
  414. USB_CDC_SUBCLASS_ETHERNET,
  415. USB_CDC_PROTO_NONE),
  416. .driver_info = (unsigned long)&qmi_wwan_info,
  417. },
  418. { /* Dell Wireless 5800 V2 (Novatel E362) */
  419. USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x8196,
  420. USB_CLASS_COMM,
  421. USB_CDC_SUBCLASS_ETHERNET,
  422. USB_CDC_PROTO_NONE),
  423. .driver_info = (unsigned long)&qmi_wwan_info,
  424. },
  425. { /* Dell Wireless 5804 (Novatel E371) */
  426. USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x819b,
  427. USB_CLASS_COMM,
  428. USB_CDC_SUBCLASS_ETHERNET,
  429. USB_CDC_PROTO_NONE),
  430. .driver_info = (unsigned long)&qmi_wwan_info,
  431. },
  432. { /* ADU960S */
  433. USB_DEVICE_AND_INTERFACE_INFO(0x16d5, 0x650a,
  434. USB_CLASS_COMM,
  435. USB_CDC_SUBCLASS_ETHERNET,
  436. USB_CDC_PROTO_NONE),
  437. .driver_info = (unsigned long)&qmi_wwan_info,
  438. },
  439. { /* HP lt2523 (Novatel E371) */
  440. USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x421d,
  441. USB_CLASS_COMM,
  442. USB_CDC_SUBCLASS_ETHERNET,
  443. USB_CDC_PROTO_NONE),
  444. .driver_info = (unsigned long)&qmi_wwan_info,
  445. },
  446. { /* HP lt4112 LTE/HSPA+ Gobi 4G Module (Huawei me906e) */
  447. USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7),
  448. .driver_info = (unsigned long)&qmi_wwan_info,
  449. },
  450. /* 3. Combined interface devices matching on interface number */
  451. {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */
  452. {QMI_FIXED_INTF(0x05c6, 0x6001, 3)}, /* 4G LTE usb-modem U901 */
  453. {QMI_FIXED_INTF(0x05c6, 0x7000, 0)},
  454. {QMI_FIXED_INTF(0x05c6, 0x7001, 1)},
  455. {QMI_FIXED_INTF(0x05c6, 0x7002, 1)},
  456. {QMI_FIXED_INTF(0x05c6, 0x7101, 1)},
  457. {QMI_FIXED_INTF(0x05c6, 0x7101, 2)},
  458. {QMI_FIXED_INTF(0x05c6, 0x7101, 3)},
  459. {QMI_FIXED_INTF(0x05c6, 0x7102, 1)},
  460. {QMI_FIXED_INTF(0x05c6, 0x7102, 2)},
  461. {QMI_FIXED_INTF(0x05c6, 0x7102, 3)},
  462. {QMI_FIXED_INTF(0x05c6, 0x8000, 7)},
  463. {QMI_FIXED_INTF(0x05c6, 0x8001, 6)},
  464. {QMI_FIXED_INTF(0x05c6, 0x9000, 4)},
  465. {QMI_FIXED_INTF(0x05c6, 0x9003, 4)},
  466. {QMI_FIXED_INTF(0x05c6, 0x9005, 2)},
  467. {QMI_FIXED_INTF(0x05c6, 0x900a, 4)},
  468. {QMI_FIXED_INTF(0x05c6, 0x900b, 2)},
  469. {QMI_FIXED_INTF(0x05c6, 0x900c, 4)},
  470. {QMI_FIXED_INTF(0x05c6, 0x900c, 5)},
  471. {QMI_FIXED_INTF(0x05c6, 0x900c, 6)},
  472. {QMI_FIXED_INTF(0x05c6, 0x900d, 5)},
  473. {QMI_FIXED_INTF(0x05c6, 0x900f, 3)},
  474. {QMI_FIXED_INTF(0x05c6, 0x900f, 4)},
  475. {QMI_FIXED_INTF(0x05c6, 0x900f, 5)},
  476. {QMI_FIXED_INTF(0x05c6, 0x9010, 4)},
  477. {QMI_FIXED_INTF(0x05c6, 0x9010, 5)},
  478. {QMI_FIXED_INTF(0x05c6, 0x9011, 3)},
  479. {QMI_FIXED_INTF(0x05c6, 0x9011, 4)},
  480. {QMI_FIXED_INTF(0x05c6, 0x9021, 1)},
  481. {QMI_FIXED_INTF(0x05c6, 0x9022, 2)},
  482. {QMI_FIXED_INTF(0x05c6, 0x9025, 4)}, /* Alcatel-sbell ASB TL131 TDD LTE (China Mobile) */
  483. {QMI_FIXED_INTF(0x05c6, 0x9026, 3)},
  484. {QMI_FIXED_INTF(0x05c6, 0x902e, 5)},
  485. {QMI_FIXED_INTF(0x05c6, 0x9031, 5)},
  486. {QMI_FIXED_INTF(0x05c6, 0x9032, 4)},
  487. {QMI_FIXED_INTF(0x05c6, 0x9033, 3)},
  488. {QMI_FIXED_INTF(0x05c6, 0x9033, 4)},
  489. {QMI_FIXED_INTF(0x05c6, 0x9033, 5)},
  490. {QMI_FIXED_INTF(0x05c6, 0x9033, 6)},
  491. {QMI_FIXED_INTF(0x05c6, 0x9034, 3)},
  492. {QMI_FIXED_INTF(0x05c6, 0x9034, 4)},
  493. {QMI_FIXED_INTF(0x05c6, 0x9034, 5)},
  494. {QMI_FIXED_INTF(0x05c6, 0x9034, 6)},
  495. {QMI_FIXED_INTF(0x05c6, 0x9034, 7)},
  496. {QMI_FIXED_INTF(0x05c6, 0x9035, 4)},
  497. {QMI_FIXED_INTF(0x05c6, 0x9036, 3)},
  498. {QMI_FIXED_INTF(0x05c6, 0x9037, 5)},
  499. {QMI_FIXED_INTF(0x05c6, 0x9038, 4)},
  500. {QMI_FIXED_INTF(0x05c6, 0x903b, 7)},
  501. {QMI_FIXED_INTF(0x05c6, 0x903c, 6)},
  502. {QMI_FIXED_INTF(0x05c6, 0x903d, 6)},
  503. {QMI_FIXED_INTF(0x05c6, 0x903e, 5)},
  504. {QMI_FIXED_INTF(0x05c6, 0x9043, 3)},
  505. {QMI_FIXED_INTF(0x05c6, 0x9046, 3)},
  506. {QMI_FIXED_INTF(0x05c6, 0x9046, 4)},
  507. {QMI_FIXED_INTF(0x05c6, 0x9046, 5)},
  508. {QMI_FIXED_INTF(0x05c6, 0x9047, 2)},
  509. {QMI_FIXED_INTF(0x05c6, 0x9047, 3)},
  510. {QMI_FIXED_INTF(0x05c6, 0x9047, 4)},
  511. {QMI_FIXED_INTF(0x05c6, 0x9048, 4)},
  512. {QMI_FIXED_INTF(0x05c6, 0x9048, 5)},
  513. {QMI_FIXED_INTF(0x05c6, 0x9048, 6)},
  514. {QMI_FIXED_INTF(0x05c6, 0x9048, 7)},
  515. {QMI_FIXED_INTF(0x05c6, 0x9048, 8)},
  516. {QMI_FIXED_INTF(0x05c6, 0x904c, 5)},
  517. {QMI_FIXED_INTF(0x05c6, 0x904c, 6)},
  518. {QMI_FIXED_INTF(0x05c6, 0x904c, 7)},
  519. {QMI_FIXED_INTF(0x05c6, 0x904c, 8)},
  520. {QMI_FIXED_INTF(0x05c6, 0x9050, 3)},
  521. {QMI_FIXED_INTF(0x05c6, 0x9052, 4)},
  522. {QMI_FIXED_INTF(0x05c6, 0x9053, 6)},
  523. {QMI_FIXED_INTF(0x05c6, 0x9053, 7)},
  524. {QMI_FIXED_INTF(0x05c6, 0x9054, 5)},
  525. {QMI_FIXED_INTF(0x05c6, 0x9054, 6)},
  526. {QMI_FIXED_INTF(0x05c6, 0x9055, 3)},
  527. {QMI_FIXED_INTF(0x05c6, 0x9055, 4)},
  528. {QMI_FIXED_INTF(0x05c6, 0x9055, 5)},
  529. {QMI_FIXED_INTF(0x05c6, 0x9055, 6)},
  530. {QMI_FIXED_INTF(0x05c6, 0x9055, 7)},
  531. {QMI_FIXED_INTF(0x05c6, 0x9056, 3)},
  532. {QMI_FIXED_INTF(0x05c6, 0x9062, 2)},
  533. {QMI_FIXED_INTF(0x05c6, 0x9062, 3)},
  534. {QMI_FIXED_INTF(0x05c6, 0x9062, 4)},
  535. {QMI_FIXED_INTF(0x05c6, 0x9062, 5)},
  536. {QMI_FIXED_INTF(0x05c6, 0x9062, 6)},
  537. {QMI_FIXED_INTF(0x05c6, 0x9062, 7)},
  538. {QMI_FIXED_INTF(0x05c6, 0x9062, 8)},
  539. {QMI_FIXED_INTF(0x05c6, 0x9062, 9)},
  540. {QMI_FIXED_INTF(0x05c6, 0x9064, 3)},
  541. {QMI_FIXED_INTF(0x05c6, 0x9065, 6)},
  542. {QMI_FIXED_INTF(0x05c6, 0x9065, 7)},
  543. {QMI_FIXED_INTF(0x05c6, 0x9066, 5)},
  544. {QMI_FIXED_INTF(0x05c6, 0x9066, 6)},
  545. {QMI_FIXED_INTF(0x05c6, 0x9067, 1)},
  546. {QMI_FIXED_INTF(0x05c6, 0x9068, 2)},
  547. {QMI_FIXED_INTF(0x05c6, 0x9068, 3)},
  548. {QMI_FIXED_INTF(0x05c6, 0x9068, 4)},
  549. {QMI_FIXED_INTF(0x05c6, 0x9068, 5)},
  550. {QMI_FIXED_INTF(0x05c6, 0x9068, 6)},
  551. {QMI_FIXED_INTF(0x05c6, 0x9068, 7)},
  552. {QMI_FIXED_INTF(0x05c6, 0x9069, 5)},
  553. {QMI_FIXED_INTF(0x05c6, 0x9069, 6)},
  554. {QMI_FIXED_INTF(0x05c6, 0x9069, 7)},
  555. {QMI_FIXED_INTF(0x05c6, 0x9069, 8)},
  556. {QMI_FIXED_INTF(0x05c6, 0x9070, 4)},
  557. {QMI_FIXED_INTF(0x05c6, 0x9070, 5)},
  558. {QMI_FIXED_INTF(0x05c6, 0x9075, 5)},
  559. {QMI_FIXED_INTF(0x05c6, 0x9076, 4)},
  560. {QMI_FIXED_INTF(0x05c6, 0x9076, 5)},
  561. {QMI_FIXED_INTF(0x05c6, 0x9076, 6)},
  562. {QMI_FIXED_INTF(0x05c6, 0x9076, 7)},
  563. {QMI_FIXED_INTF(0x05c6, 0x9076, 8)},
  564. {QMI_FIXED_INTF(0x05c6, 0x9077, 3)},
  565. {QMI_FIXED_INTF(0x05c6, 0x9077, 4)},
  566. {QMI_FIXED_INTF(0x05c6, 0x9077, 5)},
  567. {QMI_FIXED_INTF(0x05c6, 0x9077, 6)},
  568. {QMI_FIXED_INTF(0x05c6, 0x9078, 3)},
  569. {QMI_FIXED_INTF(0x05c6, 0x9079, 4)},
  570. {QMI_FIXED_INTF(0x05c6, 0x9079, 5)},
  571. {QMI_FIXED_INTF(0x05c6, 0x9079, 6)},
  572. {QMI_FIXED_INTF(0x05c6, 0x9079, 7)},
  573. {QMI_FIXED_INTF(0x05c6, 0x9079, 8)},
  574. {QMI_FIXED_INTF(0x05c6, 0x9080, 5)},
  575. {QMI_FIXED_INTF(0x05c6, 0x9080, 6)},
  576. {QMI_FIXED_INTF(0x05c6, 0x9080, 7)},
  577. {QMI_FIXED_INTF(0x05c6, 0x9080, 8)},
  578. {QMI_FIXED_INTF(0x05c6, 0x9083, 3)},
  579. {QMI_FIXED_INTF(0x05c6, 0x9084, 4)},
  580. {QMI_FIXED_INTF(0x05c6, 0x90b2, 3)}, /* ublox R410M */
  581. {QMI_FIXED_INTF(0x05c6, 0x920d, 0)},
  582. {QMI_FIXED_INTF(0x05c6, 0x920d, 5)},
  583. {QMI_FIXED_INTF(0x0846, 0x68a2, 8)},
  584. {QMI_FIXED_INTF(0x0846, 0x68d3, 8)}, /* Netgear Aircard 779S */
  585. {QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */
  586. {QMI_FIXED_INTF(0x12d1, 0x14ac, 1)}, /* Huawei E1820 */
  587. {QMI_FIXED_INTF(0x1435, 0xd181, 3)}, /* Wistron NeWeb D18Q1 */
  588. {QMI_FIXED_INTF(0x1435, 0xd181, 4)}, /* Wistron NeWeb D18Q1 */
  589. {QMI_FIXED_INTF(0x1435, 0xd181, 5)}, /* Wistron NeWeb D18Q1 */
  590. {QMI_FIXED_INTF(0x16d8, 0x6003, 0)}, /* CMOTech 6003 */
  591. {QMI_FIXED_INTF(0x16d8, 0x6007, 0)}, /* CMOTech CHE-628S */
  592. {QMI_FIXED_INTF(0x16d8, 0x6008, 0)}, /* CMOTech CMU-301 */
  593. {QMI_FIXED_INTF(0x16d8, 0x6280, 0)}, /* CMOTech CHU-628 */
  594. {QMI_FIXED_INTF(0x16d8, 0x7001, 0)}, /* CMOTech CHU-720S */
  595. {QMI_FIXED_INTF(0x16d8, 0x7002, 0)}, /* CMOTech 7002 */
  596. {QMI_FIXED_INTF(0x16d8, 0x7003, 4)}, /* CMOTech CHU-629K */
  597. {QMI_FIXED_INTF(0x16d8, 0x7004, 3)}, /* CMOTech 7004 */
  598. {QMI_FIXED_INTF(0x16d8, 0x7006, 5)}, /* CMOTech CGU-629 */
  599. {QMI_FIXED_INTF(0x16d8, 0x700a, 4)}, /* CMOTech CHU-629S */
  600. {QMI_FIXED_INTF(0x16d8, 0x7211, 0)}, /* CMOTech CHU-720I */
  601. {QMI_FIXED_INTF(0x16d8, 0x7212, 0)}, /* CMOTech 7212 */
  602. {QMI_FIXED_INTF(0x16d8, 0x7213, 0)}, /* CMOTech 7213 */
  603. {QMI_FIXED_INTF(0x16d8, 0x7251, 1)}, /* CMOTech 7251 */
  604. {QMI_FIXED_INTF(0x16d8, 0x7252, 1)}, /* CMOTech 7252 */
  605. {QMI_FIXED_INTF(0x16d8, 0x7253, 1)}, /* CMOTech 7253 */
  606. {QMI_FIXED_INTF(0x19d2, 0x0002, 1)},
  607. {QMI_FIXED_INTF(0x19d2, 0x0012, 1)},
  608. {QMI_FIXED_INTF(0x19d2, 0x0017, 3)},
  609. {QMI_FIXED_INTF(0x19d2, 0x0019, 3)}, /* ONDA MT689DC */
  610. {QMI_FIXED_INTF(0x19d2, 0x0021, 4)},
  611. {QMI_FIXED_INTF(0x19d2, 0x0025, 1)},
  612. {QMI_FIXED_INTF(0x19d2, 0x0031, 4)},
  613. {QMI_FIXED_INTF(0x19d2, 0x0042, 4)},
  614. {QMI_FIXED_INTF(0x19d2, 0x0049, 5)},
  615. {QMI_FIXED_INTF(0x19d2, 0x0052, 4)},
  616. {QMI_FIXED_INTF(0x19d2, 0x0055, 1)}, /* ZTE (Vodafone) K3520-Z */
  617. {QMI_FIXED_INTF(0x19d2, 0x0058, 4)},
  618. {QMI_FIXED_INTF(0x19d2, 0x0063, 4)}, /* ZTE (Vodafone) K3565-Z */
  619. {QMI_FIXED_INTF(0x19d2, 0x0104, 4)}, /* ZTE (Vodafone) K4505-Z */
  620. {QMI_FIXED_INTF(0x19d2, 0x0113, 5)},
  621. {QMI_FIXED_INTF(0x19d2, 0x0118, 5)},
  622. {QMI_FIXED_INTF(0x19d2, 0x0121, 5)},
  623. {QMI_FIXED_INTF(0x19d2, 0x0123, 4)},
  624. {QMI_FIXED_INTF(0x19d2, 0x0124, 5)},
  625. {QMI_FIXED_INTF(0x19d2, 0x0125, 6)},
  626. {QMI_FIXED_INTF(0x19d2, 0x0126, 5)},
  627. {QMI_FIXED_INTF(0x19d2, 0x0130, 1)},
  628. {QMI_FIXED_INTF(0x19d2, 0x0133, 3)},
  629. {QMI_FIXED_INTF(0x19d2, 0x0141, 5)},
  630. {QMI_FIXED_INTF(0x19d2, 0x0157, 5)}, /* ZTE MF683 */
  631. {QMI_FIXED_INTF(0x19d2, 0x0158, 3)},
  632. {QMI_FIXED_INTF(0x19d2, 0x0167, 4)}, /* ZTE MF820D */
  633. {QMI_FIXED_INTF(0x19d2, 0x0168, 4)},
  634. {QMI_FIXED_INTF(0x19d2, 0x0176, 3)},
  635. {QMI_FIXED_INTF(0x19d2, 0x0178, 3)},
  636. {QMI_FIXED_INTF(0x19d2, 0x0191, 4)}, /* ZTE EuFi890 */
  637. {QMI_FIXED_INTF(0x19d2, 0x0199, 1)}, /* ZTE MF820S */
  638. {QMI_FIXED_INTF(0x19d2, 0x0200, 1)},
  639. {QMI_FIXED_INTF(0x19d2, 0x0257, 3)}, /* ZTE MF821 */
  640. {QMI_FIXED_INTF(0x19d2, 0x0265, 4)}, /* ONDA MT8205 4G LTE */
  641. {QMI_FIXED_INTF(0x19d2, 0x0284, 4)}, /* ZTE MF880 */
  642. {QMI_FIXED_INTF(0x19d2, 0x0326, 4)}, /* ZTE MF821D */
  643. {QMI_FIXED_INTF(0x19d2, 0x0412, 4)}, /* Telewell TW-LTE 4G */
  644. {QMI_FIXED_INTF(0x19d2, 0x1008, 4)}, /* ZTE (Vodafone) K3570-Z */
  645. {QMI_FIXED_INTF(0x19d2, 0x1010, 4)}, /* ZTE (Vodafone) K3571-Z */
  646. {QMI_FIXED_INTF(0x19d2, 0x1012, 4)},
  647. {QMI_FIXED_INTF(0x19d2, 0x1018, 3)}, /* ZTE (Vodafone) K5006-Z */
  648. {QMI_FIXED_INTF(0x19d2, 0x1021, 2)},
  649. {QMI_FIXED_INTF(0x19d2, 0x1245, 4)},
  650. {QMI_FIXED_INTF(0x19d2, 0x1247, 4)},
  651. {QMI_FIXED_INTF(0x19d2, 0x1252, 4)},
  652. {QMI_FIXED_INTF(0x19d2, 0x1254, 4)},
  653. {QMI_FIXED_INTF(0x19d2, 0x1255, 3)},
  654. {QMI_FIXED_INTF(0x19d2, 0x1255, 4)},
  655. {QMI_FIXED_INTF(0x19d2, 0x1256, 4)},
  656. {QMI_FIXED_INTF(0x19d2, 0x1270, 5)}, /* ZTE MF667 */
  657. {QMI_FIXED_INTF(0x19d2, 0x1401, 2)},
  658. {QMI_FIXED_INTF(0x19d2, 0x1402, 2)}, /* ZTE MF60 */
  659. {QMI_FIXED_INTF(0x19d2, 0x1424, 2)},
  660. {QMI_FIXED_INTF(0x19d2, 0x1425, 2)},
  661. {QMI_FIXED_INTF(0x19d2, 0x1426, 2)}, /* ZTE MF91 */
  662. {QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */
  663. {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */
  664. {QMI_FIXED_INTF(0x2001, 0x7e19, 4)}, /* D-Link DWM-221 B1 */
  665. {QMI_FIXED_INTF(0x2001, 0x7e35, 4)}, /* D-Link DWM-222 */
  666. {QMI_FIXED_INTF(0x2020, 0x2031, 4)}, /* Olicard 600 */
  667. {QMI_FIXED_INTF(0x2020, 0x2033, 4)}, /* BroadMobi BM806U */
  668. {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */
  669. {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */
  670. {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */
  671. {QMI_FIXED_INTF(0x1199, 0x68a2, 19)}, /* Sierra Wireless MC7710 in QMI mode */
  672. {QMI_FIXED_INTF(0x1199, 0x68c0, 8)}, /* Sierra Wireless MC7304/MC7354 */
  673. {QMI_FIXED_INTF(0x1199, 0x68c0, 10)}, /* Sierra Wireless MC7304/MC7354 */
  674. {QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */
  675. {QMI_FIXED_INTF(0x1199, 0x901f, 8)}, /* Sierra Wireless EM7355 */
  676. {QMI_FIXED_INTF(0x1199, 0x9041, 8)}, /* Sierra Wireless MC7305/MC7355 */
  677. {QMI_FIXED_INTF(0x1199, 0x9041, 10)}, /* Sierra Wireless MC7305/MC7355 */
  678. {QMI_FIXED_INTF(0x1199, 0x9051, 8)}, /* Netgear AirCard 340U */
  679. {QMI_FIXED_INTF(0x1199, 0x9053, 8)}, /* Sierra Wireless Modem */
  680. {QMI_FIXED_INTF(0x1199, 0x9054, 8)}, /* Sierra Wireless Modem */
  681. {QMI_FIXED_INTF(0x1199, 0x9055, 8)}, /* Netgear AirCard 341U */
  682. {QMI_FIXED_INTF(0x1199, 0x9056, 8)}, /* Sierra Wireless Modem */
  683. {QMI_FIXED_INTF(0x1199, 0x9057, 8)},
  684. {QMI_FIXED_INTF(0x1199, 0x9061, 8)}, /* Sierra Wireless Modem */
  685. {QMI_FIXED_INTF(0x1199, 0x9070, 8)}, /* Sierra Wireless MC74xx/EM74xx */
  686. {QMI_FIXED_INTF(0x1199, 0x9070, 10)}, /* Sierra Wireless MC74xx/EM74xx */
  687. {QMI_FIXED_INTF(0x1199, 0x9071, 8)}, /* Sierra Wireless MC74xx */
  688. {QMI_FIXED_INTF(0x1199, 0x9071, 10)}, /* Sierra Wireless MC74xx */
  689. {QMI_FIXED_INTF(0x1199, 0x9079, 8)}, /* Sierra Wireless EM74xx */
  690. {QMI_FIXED_INTF(0x1199, 0x9079, 10)}, /* Sierra Wireless EM74xx */
  691. {QMI_FIXED_INTF(0x1199, 0x907b, 8)}, /* Sierra Wireless EM74xx */
  692. {QMI_FIXED_INTF(0x1199, 0x907b, 10)}, /* Sierra Wireless EM74xx */
  693. {QMI_FIXED_INTF(0x1199, 0x9091, 8)}, /* Sierra Wireless EM7565 */
  694. {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */
  695. {QMI_FIXED_INTF(0x1bbb, 0x0203, 2)}, /* Alcatel L800MA */
  696. {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */
  697. {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */
  698. {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */
  699. {QMI_FIXED_INTF(0x1bc7, 0x1201, 2)}, /* Telit LE920 */
  700. {QMI_FIXED_INTF(0x1c9e, 0x9b01, 3)}, /* XS Stick W100-2 from 4G Systems */
  701. {QMI_FIXED_INTF(0x0b3c, 0xc000, 4)}, /* Olivetti Olicard 100 */
  702. {QMI_FIXED_INTF(0x0b3c, 0xc001, 4)}, /* Olivetti Olicard 120 */
  703. {QMI_FIXED_INTF(0x0b3c, 0xc002, 4)}, /* Olivetti Olicard 140 */
  704. {QMI_FIXED_INTF(0x0b3c, 0xc004, 6)}, /* Olivetti Olicard 155 */
  705. {QMI_FIXED_INTF(0x0b3c, 0xc005, 6)}, /* Olivetti Olicard 200 */
  706. {QMI_FIXED_INTF(0x0b3c, 0xc00a, 6)}, /* Olivetti Olicard 160 */
  707. {QMI_FIXED_INTF(0x0b3c, 0xc00b, 4)}, /* Olivetti Olicard 500 */
  708. {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)}, /* Cinterion PLxx */
  709. {QMI_FIXED_INTF(0x1e2d, 0x0053, 4)}, /* Cinterion PHxx,PXxx */
  710. {QMI_FIXED_INTF(0x413c, 0x81a2, 8)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */
  711. {QMI_FIXED_INTF(0x413c, 0x81a3, 8)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */
  712. {QMI_FIXED_INTF(0x413c, 0x81a4, 8)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */
  713. {QMI_FIXED_INTF(0x413c, 0x81a8, 8)}, /* Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card */
  714. {QMI_FIXED_INTF(0x413c, 0x81a9, 8)}, /* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card */
  715. {QMI_FIXED_INTF(0x413c, 0x81b1, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card */
  716. {QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */
  717. {QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */
  718. {QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */
  719. {QMI_FIXED_INTF(0x1e0e, 0x9001, 5)}, /* SIMCom 7230E */
  720. /* 4. Gobi 1000 devices */
  721. {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
  722. {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */
  723. {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */
  724. {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */
  725. {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel/Verizon USB-1000 */
  726. {QMI_GOBI1K_DEVICE(0x1410, 0xa002)}, /* Novatel Gobi Modem device */
  727. {QMI_GOBI1K_DEVICE(0x1410, 0xa003)}, /* Novatel Gobi Modem device */
  728. {QMI_GOBI1K_DEVICE(0x1410, 0xa004)}, /* Novatel Gobi Modem device */
  729. {QMI_GOBI1K_DEVICE(0x1410, 0xa005)}, /* Novatel Gobi Modem device */
  730. {QMI_GOBI1K_DEVICE(0x1410, 0xa006)}, /* Novatel Gobi Modem device */
  731. {QMI_GOBI1K_DEVICE(0x1410, 0xa007)}, /* Novatel Gobi Modem device */
  732. {QMI_GOBI1K_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */
  733. {QMI_GOBI1K_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */
  734. {QMI_GOBI1K_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */
  735. {QMI_GOBI1K_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */
  736. {QMI_GOBI1K_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */
  737. {QMI_GOBI1K_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */
  738. {QMI_GOBI1K_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */
  739. {QMI_GOBI1K_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */
  740. /* 5. Gobi 2000 and 3000 devices */
  741. {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */
  742. {QMI_GOBI_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */
  743. {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */
  744. {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */
  745. {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */
  746. {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */
  747. {QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */
  748. {QMI_FIXED_INTF(0x05c6, 0x9215, 4)}, /* Quectel EC20 Mini PCIe */
  749. {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */
  750. {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */
  751. {QMI_GOBI_DEVICE(0x05c6, 0x9275)}, /* iRex Technologies Gobi 2000 Modem device (VR307) */
  752. {QMI_GOBI_DEVICE(0x0af0, 0x8120)}, /* Option GTM681W */
  753. {QMI_GOBI_DEVICE(0x1199, 0x68a5)}, /* Sierra Wireless Modem */
  754. {QMI_GOBI_DEVICE(0x1199, 0x68a9)}, /* Sierra Wireless Modem */
  755. {QMI_GOBI_DEVICE(0x1199, 0x9001)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  756. {QMI_GOBI_DEVICE(0x1199, 0x9002)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  757. {QMI_GOBI_DEVICE(0x1199, 0x9003)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  758. {QMI_GOBI_DEVICE(0x1199, 0x9004)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  759. {QMI_GOBI_DEVICE(0x1199, 0x9005)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  760. {QMI_GOBI_DEVICE(0x1199, 0x9006)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  761. {QMI_GOBI_DEVICE(0x1199, 0x9007)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  762. {QMI_GOBI_DEVICE(0x1199, 0x9008)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  763. {QMI_GOBI_DEVICE(0x1199, 0x9009)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  764. {QMI_GOBI_DEVICE(0x1199, 0x900a)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  765. {QMI_GOBI_DEVICE(0x1199, 0x9011)}, /* Sierra Wireless Gobi 2000 Modem device (MC8305) */
  766. {QMI_GOBI_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */
  767. {QMI_GOBI_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */
  768. {QMI_GOBI_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */
  769. {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */
  770. {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */
  771. {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */
  772. {QMI_GOBI_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */
  773. {QMI_GOBI_DEVICE(0x12d1, 0x14f1)}, /* Sony Gobi 3000 Composite */
  774. {QMI_GOBI_DEVICE(0x1410, 0xa021)}, /* Foxconn Gobi 3000 Modem device (Novatel E396) */
  775. { } /* END */
  776. };
  777. MODULE_DEVICE_TABLE(usb, products);
  778. static bool quectel_ec20_detected(struct usb_interface *intf)
  779. {
  780. struct usb_device *dev = interface_to_usbdev(intf);
  781. if (dev->actconfig &&
  782. le16_to_cpu(dev->descriptor.idVendor) == 0x05c6 &&
  783. le16_to_cpu(dev->descriptor.idProduct) == 0x9215 &&
  784. dev->actconfig->desc.bNumInterfaces == 5)
  785. return true;
  786. return false;
  787. }
  788. static int qmi_wwan_probe(struct usb_interface *intf,
  789. const struct usb_device_id *prod)
  790. {
  791. struct usb_device_id *id = (struct usb_device_id *)prod;
  792. struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc;
  793. /* Workaround to enable dynamic IDs. This disables usbnet
  794. * blacklisting functionality. Which, if required, can be
  795. * reimplemented here by using a magic "blacklist" value
  796. * instead of 0 in the static device id table
  797. */
  798. if (!id->driver_info) {
  799. dev_dbg(&intf->dev, "setting defaults for dynamic device id\n");
  800. id->driver_info = (unsigned long)&qmi_wwan_info;
  801. }
  802. /* There are devices where the same interface number can be
  803. * configured as different functions. We should only bind to
  804. * vendor specific functions when matching on interface number
  805. */
  806. if (id->match_flags & USB_DEVICE_ID_MATCH_INT_NUMBER &&
  807. desc->bInterfaceClass != USB_CLASS_VENDOR_SPEC) {
  808. dev_dbg(&intf->dev,
  809. "Rejecting interface number match for class %02x\n",
  810. desc->bInterfaceClass);
  811. return -ENODEV;
  812. }
  813. /* Quectel EC20 quirk where we've QMI on interface 4 instead of 0 */
  814. if (quectel_ec20_detected(intf) && desc->bInterfaceNumber == 0) {
  815. dev_dbg(&intf->dev, "Quectel EC20 quirk, skipping interface 0\n");
  816. return -ENODEV;
  817. }
  818. return usbnet_probe(intf, id);
  819. }
  820. static struct usb_driver qmi_wwan_driver = {
  821. .name = "qmi_wwan",
  822. .id_table = products,
  823. .probe = qmi_wwan_probe,
  824. .disconnect = usbnet_disconnect,
  825. .suspend = qmi_wwan_suspend,
  826. .resume = qmi_wwan_resume,
  827. .reset_resume = qmi_wwan_resume,
  828. .supports_autosuspend = 1,
  829. .disable_hub_initiated_lpm = 1,
  830. };
  831. module_usb_driver(qmi_wwan_driver);
  832. MODULE_AUTHOR("Bjørn Mork <bjorn@mork.no>");
  833. MODULE_DESCRIPTION("Qualcomm MSM Interface (QMI) WWAN driver");
  834. MODULE_LICENSE("GPL");