qmi_wwan.c 19 KB

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