qmi_wwan.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597
  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/mii.h>
  16. #include <linux/usb.h>
  17. #include <linux/usb/cdc.h>
  18. #include <linux/usb/usbnet.h>
  19. #include <linux/usb/cdc-wdm.h>
  20. /* This driver supports wwan (3G/LTE/?) devices using a vendor
  21. * specific management protocol called Qualcomm MSM Interface (QMI) -
  22. * in addition to the more common AT commands over serial interface
  23. * management
  24. *
  25. * QMI is wrapped in CDC, using CDC encapsulated commands on the
  26. * control ("master") interface of a two-interface CDC Union
  27. * resembling standard CDC ECM. The devices do not use the control
  28. * interface for any other CDC messages. Most likely because the
  29. * management protocol is used in place of the standard CDC
  30. * notifications NOTIFY_NETWORK_CONNECTION and NOTIFY_SPEED_CHANGE
  31. *
  32. * Alternatively, control and data functions can be combined in a
  33. * single USB interface.
  34. *
  35. * Handling a protocol like QMI is out of the scope for any driver.
  36. * It is exported as a character device using the cdc-wdm driver as
  37. * a subdriver, enabling userspace applications ("modem managers") to
  38. * handle it.
  39. *
  40. * These devices may alternatively/additionally be configured using AT
  41. * commands on a serial interface
  42. */
  43. /* driver specific data */
  44. struct qmi_wwan_state {
  45. struct usb_driver *subdriver;
  46. atomic_t pmcount;
  47. unsigned long unused;
  48. struct usb_interface *control;
  49. struct usb_interface *data;
  50. };
  51. /* using a counter to merge subdriver requests with our own into a combined state */
  52. static int qmi_wwan_manage_power(struct usbnet *dev, int on)
  53. {
  54. struct qmi_wwan_state *info = (void *)&dev->data;
  55. int rv = 0;
  56. dev_dbg(&dev->intf->dev, "%s() pmcount=%d, on=%d\n", __func__, atomic_read(&info->pmcount), on);
  57. if ((on && atomic_add_return(1, &info->pmcount) == 1) || (!on && atomic_dec_and_test(&info->pmcount))) {
  58. /* need autopm_get/put here to ensure the usbcore sees the new value */
  59. rv = usb_autopm_get_interface(dev->intf);
  60. if (rv < 0)
  61. goto err;
  62. dev->intf->needs_remote_wakeup = on;
  63. usb_autopm_put_interface(dev->intf);
  64. }
  65. err:
  66. return rv;
  67. }
  68. static int qmi_wwan_cdc_wdm_manage_power(struct usb_interface *intf, int on)
  69. {
  70. struct usbnet *dev = usb_get_intfdata(intf);
  71. return qmi_wwan_manage_power(dev, on);
  72. }
  73. /* collect all three endpoints and register subdriver */
  74. static int qmi_wwan_register_subdriver(struct usbnet *dev)
  75. {
  76. int rv;
  77. struct usb_driver *subdriver = NULL;
  78. struct qmi_wwan_state *info = (void *)&dev->data;
  79. /* collect bulk endpoints */
  80. rv = usbnet_get_endpoints(dev, info->data);
  81. if (rv < 0)
  82. goto err;
  83. /* update status endpoint if separate control interface */
  84. if (info->control != info->data)
  85. dev->status = &info->control->cur_altsetting->endpoint[0];
  86. /* require interrupt endpoint for subdriver */
  87. if (!dev->status) {
  88. rv = -EINVAL;
  89. goto err;
  90. }
  91. /* for subdriver power management */
  92. atomic_set(&info->pmcount, 0);
  93. /* register subdriver */
  94. subdriver = usb_cdc_wdm_register(info->control, &dev->status->desc, 512, &qmi_wwan_cdc_wdm_manage_power);
  95. if (IS_ERR(subdriver)) {
  96. dev_err(&info->control->dev, "subdriver registration failed\n");
  97. rv = PTR_ERR(subdriver);
  98. goto err;
  99. }
  100. /* prevent usbnet from using status endpoint */
  101. dev->status = NULL;
  102. /* save subdriver struct for suspend/resume wrappers */
  103. info->subdriver = subdriver;
  104. err:
  105. return rv;
  106. }
  107. static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
  108. {
  109. int status = -1;
  110. u8 *buf = intf->cur_altsetting->extra;
  111. int len = intf->cur_altsetting->extralen;
  112. struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc;
  113. struct usb_cdc_union_desc *cdc_union = NULL;
  114. struct usb_cdc_ether_desc *cdc_ether = NULL;
  115. u32 required = 1 << USB_CDC_HEADER_TYPE | 1 << USB_CDC_UNION_TYPE;
  116. u32 found = 0;
  117. struct usb_driver *driver = driver_of(intf);
  118. struct qmi_wwan_state *info = (void *)&dev->data;
  119. BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data) < sizeof(struct qmi_wwan_state)));
  120. /* require a single interrupt status endpoint for subdriver */
  121. if (intf->cur_altsetting->desc.bNumEndpoints != 1)
  122. goto err;
  123. while (len > 3) {
  124. struct usb_descriptor_header *h = (void *)buf;
  125. /* ignore any misplaced descriptors */
  126. if (h->bDescriptorType != USB_DT_CS_INTERFACE)
  127. goto next_desc;
  128. /* buf[2] is CDC descriptor subtype */
  129. switch (buf[2]) {
  130. case USB_CDC_HEADER_TYPE:
  131. if (found & 1 << USB_CDC_HEADER_TYPE) {
  132. dev_dbg(&intf->dev, "extra CDC header\n");
  133. goto err;
  134. }
  135. if (h->bLength != sizeof(struct usb_cdc_header_desc)) {
  136. dev_dbg(&intf->dev, "CDC header len %u\n", h->bLength);
  137. goto err;
  138. }
  139. break;
  140. case USB_CDC_UNION_TYPE:
  141. if (found & 1 << USB_CDC_UNION_TYPE) {
  142. dev_dbg(&intf->dev, "extra CDC union\n");
  143. goto err;
  144. }
  145. if (h->bLength != sizeof(struct usb_cdc_union_desc)) {
  146. dev_dbg(&intf->dev, "CDC union len %u\n", h->bLength);
  147. goto err;
  148. }
  149. cdc_union = (struct usb_cdc_union_desc *)buf;
  150. break;
  151. case USB_CDC_ETHERNET_TYPE:
  152. if (found & 1 << USB_CDC_ETHERNET_TYPE) {
  153. dev_dbg(&intf->dev, "extra CDC ether\n");
  154. goto err;
  155. }
  156. if (h->bLength != sizeof(struct usb_cdc_ether_desc)) {
  157. dev_dbg(&intf->dev, "CDC ether len %u\n", h->bLength);
  158. goto err;
  159. }
  160. cdc_ether = (struct usb_cdc_ether_desc *)buf;
  161. break;
  162. }
  163. /*
  164. * Remember which CDC functional descriptors we've seen. Works
  165. * for all types we care about, of which USB_CDC_ETHERNET_TYPE
  166. * (0x0f) is the highest numbered
  167. */
  168. if (buf[2] < 32)
  169. found |= 1 << buf[2];
  170. next_desc:
  171. len -= h->bLength;
  172. buf += h->bLength;
  173. }
  174. /* did we find all the required ones? */
  175. if ((found & required) != required) {
  176. dev_err(&intf->dev, "CDC functional descriptors missing\n");
  177. goto err;
  178. }
  179. /* verify CDC Union */
  180. if (desc->bInterfaceNumber != cdc_union->bMasterInterface0) {
  181. dev_err(&intf->dev, "bogus CDC Union: master=%u\n", cdc_union->bMasterInterface0);
  182. goto err;
  183. }
  184. /* need to save these for unbind */
  185. info->control = intf;
  186. info->data = usb_ifnum_to_if(dev->udev, cdc_union->bSlaveInterface0);
  187. if (!info->data) {
  188. dev_err(&intf->dev, "bogus CDC Union: slave=%u\n", cdc_union->bSlaveInterface0);
  189. goto err;
  190. }
  191. /* errors aren't fatal - we can live with the dynamic address */
  192. if (cdc_ether) {
  193. dev->hard_mtu = le16_to_cpu(cdc_ether->wMaxSegmentSize);
  194. usbnet_get_ethernet_addr(dev, cdc_ether->iMACAddress);
  195. }
  196. /* claim data interface and set it up */
  197. status = usb_driver_claim_interface(driver, info->data, dev);
  198. if (status < 0)
  199. goto err;
  200. status = qmi_wwan_register_subdriver(dev);
  201. if (status < 0) {
  202. usb_set_intfdata(info->data, NULL);
  203. usb_driver_release_interface(driver, info->data);
  204. }
  205. err:
  206. return status;
  207. }
  208. /* Some devices combine the "control" and "data" functions into a
  209. * single interface with all three endpoints: interrupt + bulk in and
  210. * out
  211. */
  212. static int qmi_wwan_bind_shared(struct usbnet *dev, struct usb_interface *intf)
  213. {
  214. int rv;
  215. struct qmi_wwan_state *info = (void *)&dev->data;
  216. /* ZTE makes devices where the interface descriptors and endpoint
  217. * configurations of two or more interfaces are identical, even
  218. * though the functions are completely different. If set, then
  219. * driver_info->data is a bitmap of acceptable interface numbers
  220. * allowing us to bind to one such interface without binding to
  221. * all of them
  222. */
  223. if (dev->driver_info->data &&
  224. !test_bit(intf->cur_altsetting->desc.bInterfaceNumber, &dev->driver_info->data)) {
  225. dev_info(&intf->dev, "not on our whitelist - ignored");
  226. rv = -ENODEV;
  227. goto err;
  228. }
  229. /* control and data is shared */
  230. info->control = intf;
  231. info->data = intf;
  232. rv = qmi_wwan_register_subdriver(dev);
  233. err:
  234. return rv;
  235. }
  236. static void qmi_wwan_unbind(struct usbnet *dev, struct usb_interface *intf)
  237. {
  238. struct qmi_wwan_state *info = (void *)&dev->data;
  239. struct usb_driver *driver = driver_of(intf);
  240. struct usb_interface *other;
  241. if (info->subdriver && info->subdriver->disconnect)
  242. info->subdriver->disconnect(info->control);
  243. /* allow user to unbind using either control or data */
  244. if (intf == info->control)
  245. other = info->data;
  246. else
  247. other = info->control;
  248. /* only if not shared */
  249. if (other && intf != other) {
  250. usb_set_intfdata(other, NULL);
  251. usb_driver_release_interface(driver, other);
  252. }
  253. info->subdriver = NULL;
  254. info->data = NULL;
  255. info->control = NULL;
  256. }
  257. /* suspend/resume wrappers calling both usbnet and the cdc-wdm
  258. * subdriver if present.
  259. *
  260. * NOTE: cdc-wdm also supports pre/post_reset, but we cannot provide
  261. * wrappers for those without adding usbnet reset support first.
  262. */
  263. static int qmi_wwan_suspend(struct usb_interface *intf, pm_message_t message)
  264. {
  265. struct usbnet *dev = usb_get_intfdata(intf);
  266. struct qmi_wwan_state *info = (void *)&dev->data;
  267. int ret;
  268. ret = usbnet_suspend(intf, message);
  269. if (ret < 0)
  270. goto err;
  271. if (info->subdriver && info->subdriver->suspend)
  272. ret = info->subdriver->suspend(intf, message);
  273. if (ret < 0)
  274. usbnet_resume(intf);
  275. err:
  276. return ret;
  277. }
  278. static int qmi_wwan_resume(struct usb_interface *intf)
  279. {
  280. struct usbnet *dev = usb_get_intfdata(intf);
  281. struct qmi_wwan_state *info = (void *)&dev->data;
  282. int ret = 0;
  283. if (info->subdriver && info->subdriver->resume)
  284. ret = info->subdriver->resume(intf);
  285. if (ret < 0)
  286. goto err;
  287. ret = usbnet_resume(intf);
  288. if (ret < 0 && info->subdriver && info->subdriver->resume && info->subdriver->suspend)
  289. info->subdriver->suspend(intf, PMSG_SUSPEND);
  290. err:
  291. return ret;
  292. }
  293. static const struct driver_info qmi_wwan_info = {
  294. .description = "WWAN/QMI device",
  295. .flags = FLAG_WWAN,
  296. .bind = qmi_wwan_bind,
  297. .unbind = qmi_wwan_unbind,
  298. .manage_power = qmi_wwan_manage_power,
  299. };
  300. static const struct driver_info qmi_wwan_shared = {
  301. .description = "WWAN/QMI device",
  302. .flags = FLAG_WWAN,
  303. .bind = qmi_wwan_bind_shared,
  304. .unbind = qmi_wwan_unbind,
  305. .manage_power = qmi_wwan_manage_power,
  306. };
  307. static const struct driver_info qmi_wwan_force_int0 = {
  308. .description = "Qualcomm WWAN/QMI device",
  309. .flags = FLAG_WWAN,
  310. .bind = qmi_wwan_bind_shared,
  311. .unbind = qmi_wwan_unbind,
  312. .manage_power = qmi_wwan_manage_power,
  313. .data = BIT(0), /* interface whitelist bitmap */
  314. };
  315. static const struct driver_info qmi_wwan_force_int1 = {
  316. .description = "Qualcomm WWAN/QMI device",
  317. .flags = FLAG_WWAN,
  318. .bind = qmi_wwan_bind_shared,
  319. .unbind = qmi_wwan_unbind,
  320. .manage_power = qmi_wwan_manage_power,
  321. .data = BIT(1), /* interface whitelist bitmap */
  322. };
  323. static const struct driver_info qmi_wwan_force_int3 = {
  324. .description = "Qualcomm WWAN/QMI device",
  325. .flags = FLAG_WWAN,
  326. .bind = qmi_wwan_bind_shared,
  327. .unbind = qmi_wwan_unbind,
  328. .manage_power = qmi_wwan_manage_power,
  329. .data = BIT(3), /* interface whitelist bitmap */
  330. };
  331. static const struct driver_info qmi_wwan_force_int4 = {
  332. .description = "Qualcomm WWAN/QMI device",
  333. .flags = FLAG_WWAN,
  334. .bind = qmi_wwan_bind_shared,
  335. .unbind = qmi_wwan_unbind,
  336. .manage_power = qmi_wwan_manage_power,
  337. .data = BIT(4), /* interface whitelist bitmap */
  338. };
  339. /* Sierra Wireless provide equally useless interface descriptors
  340. * Devices in QMI mode can be switched between two different
  341. * configurations:
  342. * a) USB interface #8 is QMI/wwan
  343. * b) USB interfaces #8, #19 and #20 are QMI/wwan
  344. *
  345. * Both configurations provide a number of other interfaces (serial++),
  346. * some of which have the same endpoint configuration as we expect, so
  347. * a whitelist or blacklist is necessary.
  348. *
  349. * FIXME: The below whitelist should include BIT(20). It does not
  350. * because I cannot get it to work...
  351. */
  352. static const struct driver_info qmi_wwan_sierra = {
  353. .description = "Sierra Wireless wwan/QMI device",
  354. .flags = FLAG_WWAN,
  355. .bind = qmi_wwan_bind_shared,
  356. .unbind = qmi_wwan_unbind,
  357. .manage_power = qmi_wwan_manage_power,
  358. .data = BIT(8) | BIT(19), /* interface whitelist bitmap */
  359. };
  360. #define HUAWEI_VENDOR_ID 0x12D1
  361. /* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */
  362. #define QMI_GOBI1K_DEVICE(vend, prod) \
  363. USB_DEVICE(vend, prod), \
  364. .driver_info = (unsigned long)&qmi_wwan_force_int3
  365. /* Gobi 2000 and Gobi 3000 QMI/wwan interface number is 0 according to qcserial */
  366. #define QMI_GOBI_DEVICE(vend, prod) \
  367. USB_DEVICE(vend, prod), \
  368. .driver_info = (unsigned long)&qmi_wwan_force_int0
  369. static const struct usb_device_id products[] = {
  370. { /* Huawei E392, E398 and possibly others sharing both device id and more... */
  371. .match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_INFO,
  372. .idVendor = HUAWEI_VENDOR_ID,
  373. .bInterfaceClass = USB_CLASS_VENDOR_SPEC,
  374. .bInterfaceSubClass = 1,
  375. .bInterfaceProtocol = 9, /* CDC Ethernet *control* interface */
  376. .driver_info = (unsigned long)&qmi_wwan_info,
  377. },
  378. { /* Vodafone/Huawei K5005 (12d1:14c8) and similar modems */
  379. .match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_INFO,
  380. .idVendor = HUAWEI_VENDOR_ID,
  381. .bInterfaceClass = USB_CLASS_VENDOR_SPEC,
  382. .bInterfaceSubClass = 1,
  383. .bInterfaceProtocol = 57, /* CDC Ethernet *control* interface */
  384. .driver_info = (unsigned long)&qmi_wwan_info,
  385. },
  386. { /* Huawei E392, E398 and possibly others in "Windows mode"
  387. * using a combined control and data interface without any CDC
  388. * functional descriptors
  389. */
  390. .match_flags = USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_INT_INFO,
  391. .idVendor = HUAWEI_VENDOR_ID,
  392. .bInterfaceClass = USB_CLASS_VENDOR_SPEC,
  393. .bInterfaceSubClass = 1,
  394. .bInterfaceProtocol = 17,
  395. .driver_info = (unsigned long)&qmi_wwan_shared,
  396. },
  397. { /* Pantech UML290 */
  398. .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
  399. .idVendor = 0x106c,
  400. .idProduct = 0x3718,
  401. .bInterfaceClass = 0xff,
  402. .bInterfaceSubClass = 0xf0,
  403. .bInterfaceProtocol = 0xff,
  404. .driver_info = (unsigned long)&qmi_wwan_shared,
  405. },
  406. { /* ZTE MF820D */
  407. .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
  408. .idVendor = 0x19d2,
  409. .idProduct = 0x0167,
  410. .bInterfaceClass = 0xff,
  411. .bInterfaceSubClass = 0xff,
  412. .bInterfaceProtocol = 0xff,
  413. .driver_info = (unsigned long)&qmi_wwan_force_int4,
  414. },
  415. { /* ZTE (Vodafone) K3520-Z */
  416. .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
  417. .idVendor = 0x19d2,
  418. .idProduct = 0x0055,
  419. .bInterfaceClass = 0xff,
  420. .bInterfaceSubClass = 0xff,
  421. .bInterfaceProtocol = 0xff,
  422. .driver_info = (unsigned long)&qmi_wwan_force_int1,
  423. },
  424. { /* ZTE (Vodafone) K3565-Z */
  425. .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
  426. .idVendor = 0x19d2,
  427. .idProduct = 0x0063,
  428. .bInterfaceClass = 0xff,
  429. .bInterfaceSubClass = 0xff,
  430. .bInterfaceProtocol = 0xff,
  431. .driver_info = (unsigned long)&qmi_wwan_force_int4,
  432. },
  433. { /* ZTE (Vodafone) K3570-Z */
  434. .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
  435. .idVendor = 0x19d2,
  436. .idProduct = 0x1008,
  437. .bInterfaceClass = 0xff,
  438. .bInterfaceSubClass = 0xff,
  439. .bInterfaceProtocol = 0xff,
  440. .driver_info = (unsigned long)&qmi_wwan_force_int4,
  441. },
  442. { /* ZTE (Vodafone) K3571-Z */
  443. .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
  444. .idVendor = 0x19d2,
  445. .idProduct = 0x1010,
  446. .bInterfaceClass = 0xff,
  447. .bInterfaceSubClass = 0xff,
  448. .bInterfaceProtocol = 0xff,
  449. .driver_info = (unsigned long)&qmi_wwan_force_int4,
  450. },
  451. { /* ZTE (Vodafone) K3765-Z */
  452. .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
  453. .idVendor = 0x19d2,
  454. .idProduct = 0x2002,
  455. .bInterfaceClass = 0xff,
  456. .bInterfaceSubClass = 0xff,
  457. .bInterfaceProtocol = 0xff,
  458. .driver_info = (unsigned long)&qmi_wwan_force_int4,
  459. },
  460. { /* ZTE (Vodafone) K4505-Z */
  461. .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
  462. .idVendor = 0x19d2,
  463. .idProduct = 0x0104,
  464. .bInterfaceClass = 0xff,
  465. .bInterfaceSubClass = 0xff,
  466. .bInterfaceProtocol = 0xff,
  467. .driver_info = (unsigned long)&qmi_wwan_force_int4,
  468. },
  469. { /* Sierra Wireless MC77xx in QMI mode */
  470. .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
  471. .idVendor = 0x1199,
  472. .idProduct = 0x68a2,
  473. .bInterfaceClass = 0xff,
  474. .bInterfaceSubClass = 0xff,
  475. .bInterfaceProtocol = 0xff,
  476. .driver_info = (unsigned long)&qmi_wwan_sierra,
  477. },
  478. /* Gobi 1000 devices */
  479. {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
  480. {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */
  481. {QMI_GOBI1K_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */
  482. {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */
  483. {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */
  484. {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel Gobi Modem device */
  485. {QMI_GOBI1K_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */
  486. {QMI_GOBI1K_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */
  487. {QMI_GOBI1K_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */
  488. {QMI_GOBI1K_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */
  489. {QMI_GOBI1K_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */
  490. {QMI_GOBI1K_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */
  491. {QMI_GOBI1K_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */
  492. {QMI_GOBI1K_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */
  493. /* Gobi 2000 and 3000 devices */
  494. {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */
  495. {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */
  496. {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */
  497. {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */
  498. {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */
  499. {QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */
  500. {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */
  501. {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */
  502. {QMI_GOBI_DEVICE(0x05c6, 0x9275)}, /* iRex Technologies Gobi 2000 Modem device (VR307) */
  503. {QMI_GOBI_DEVICE(0x1199, 0x9001)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  504. {QMI_GOBI_DEVICE(0x1199, 0x9002)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  505. {QMI_GOBI_DEVICE(0x1199, 0x9003)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  506. {QMI_GOBI_DEVICE(0x1199, 0x9004)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  507. {QMI_GOBI_DEVICE(0x1199, 0x9005)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  508. {QMI_GOBI_DEVICE(0x1199, 0x9006)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  509. {QMI_GOBI_DEVICE(0x1199, 0x9007)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  510. {QMI_GOBI_DEVICE(0x1199, 0x9008)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  511. {QMI_GOBI_DEVICE(0x1199, 0x9009)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  512. {QMI_GOBI_DEVICE(0x1199, 0x900a)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  513. {QMI_GOBI_DEVICE(0x1199, 0x9011)}, /* Sierra Wireless Gobi 2000 Modem device (MC8305) */
  514. {QMI_GOBI_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */
  515. {QMI_GOBI_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */
  516. {QMI_GOBI_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */
  517. {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */
  518. {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */
  519. { } /* END */
  520. };
  521. MODULE_DEVICE_TABLE(usb, products);
  522. static struct usb_driver qmi_wwan_driver = {
  523. .name = "qmi_wwan",
  524. .id_table = products,
  525. .probe = usbnet_probe,
  526. .disconnect = usbnet_disconnect,
  527. .suspend = qmi_wwan_suspend,
  528. .resume = qmi_wwan_resume,
  529. .reset_resume = qmi_wwan_resume,
  530. .supports_autosuspend = 1,
  531. .disable_hub_initiated_lpm = 1,
  532. };
  533. module_usb_driver(qmi_wwan_driver);
  534. MODULE_AUTHOR("Bjørn Mork <bjorn@mork.no>");
  535. MODULE_DESCRIPTION("Qualcomm MSM Interface (QMI) WWAN driver");
  536. MODULE_LICENSE("GPL");