qmi_wwan.c 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2012 Bjørn Mork <bjorn@mork.no>
  4. *
  5. * The probing code is heavily inspired by cdc_ether, which is:
  6. * Copyright (C) 2003-2005 by David Brownell
  7. * Copyright (C) 2006 by Ole Andre Vadla Ravnas (ActiveSync)
  8. */
  9. #include <linux/module.h>
  10. #include <linux/sched/signal.h>
  11. #include <linux/netdevice.h>
  12. #include <linux/ethtool.h>
  13. #include <linux/etherdevice.h>
  14. #include <linux/if_arp.h>
  15. #include <linux/kstrtox.h>
  16. #include <linux/mii.h>
  17. #include <linux/rtnetlink.h>
  18. #include <linux/usb.h>
  19. #include <linux/usb/cdc.h>
  20. #include <linux/usb/usbnet.h>
  21. #include <linux/usb/cdc-wdm.h>
  22. #include <linux/u64_stats_sync.h>
  23. /* This driver supports wwan (3G/LTE/?) devices using a vendor
  24. * specific management protocol called Qualcomm MSM Interface (QMI) -
  25. * in addition to the more common AT commands over serial interface
  26. * management
  27. *
  28. * QMI is wrapped in CDC, using CDC encapsulated commands on the
  29. * control ("master") interface of a two-interface CDC Union
  30. * resembling standard CDC ECM. The devices do not use the control
  31. * interface for any other CDC messages. Most likely because the
  32. * management protocol is used in place of the standard CDC
  33. * notifications NOTIFY_NETWORK_CONNECTION and NOTIFY_SPEED_CHANGE
  34. *
  35. * Alternatively, control and data functions can be combined in a
  36. * single USB interface.
  37. *
  38. * Handling a protocol like QMI is out of the scope for any driver.
  39. * It is exported as a character device using the cdc-wdm driver as
  40. * a subdriver, enabling userspace applications ("modem managers") to
  41. * handle it.
  42. *
  43. * These devices may alternatively/additionally be configured using AT
  44. * commands on a serial interface
  45. */
  46. /* driver specific data */
  47. struct qmi_wwan_state {
  48. struct usb_driver *subdriver;
  49. atomic_t pmcount;
  50. unsigned long flags;
  51. struct usb_interface *control;
  52. struct usb_interface *data;
  53. };
  54. enum qmi_wwan_flags {
  55. QMI_WWAN_FLAG_RAWIP = 1 << 0,
  56. QMI_WWAN_FLAG_MUX = 1 << 1,
  57. QMI_WWAN_FLAG_PASS_THROUGH = 1 << 2,
  58. };
  59. enum qmi_wwan_quirks {
  60. QMI_WWAN_QUIRK_DTR = 1 << 0, /* needs "set DTR" request */
  61. };
  62. struct qmimux_hdr {
  63. u8 pad;
  64. u8 mux_id;
  65. __be16 pkt_len;
  66. };
  67. struct qmimux_priv {
  68. struct net_device *real_dev;
  69. u8 mux_id;
  70. };
  71. static int qmimux_open(struct net_device *dev)
  72. {
  73. struct qmimux_priv *priv = netdev_priv(dev);
  74. struct net_device *real_dev = priv->real_dev;
  75. if (!(priv->real_dev->flags & IFF_UP))
  76. return -ENETDOWN;
  77. if (netif_carrier_ok(real_dev))
  78. netif_carrier_on(dev);
  79. return 0;
  80. }
  81. static int qmimux_stop(struct net_device *dev)
  82. {
  83. netif_carrier_off(dev);
  84. return 0;
  85. }
  86. static netdev_tx_t qmimux_start_xmit(struct sk_buff *skb, struct net_device *dev)
  87. {
  88. struct qmimux_priv *priv = netdev_priv(dev);
  89. unsigned int len = skb->len;
  90. struct qmimux_hdr *hdr;
  91. netdev_tx_t ret;
  92. hdr = skb_push(skb, sizeof(struct qmimux_hdr));
  93. hdr->pad = 0;
  94. hdr->mux_id = priv->mux_id;
  95. hdr->pkt_len = cpu_to_be16(len);
  96. skb->dev = priv->real_dev;
  97. ret = dev_queue_xmit(skb);
  98. if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN))
  99. dev_sw_netstats_tx_add(dev, 1, len);
  100. else
  101. dev->stats.tx_dropped++;
  102. return ret;
  103. }
  104. static const struct net_device_ops qmimux_netdev_ops = {
  105. .ndo_open = qmimux_open,
  106. .ndo_stop = qmimux_stop,
  107. .ndo_start_xmit = qmimux_start_xmit,
  108. };
  109. static void qmimux_setup(struct net_device *dev)
  110. {
  111. dev->header_ops = NULL; /* No header */
  112. dev->type = ARPHRD_NONE;
  113. dev->hard_header_len = 0;
  114. dev->addr_len = 0;
  115. dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
  116. dev->netdev_ops = &qmimux_netdev_ops;
  117. dev->mtu = 1500;
  118. dev->pcpu_stat_type = NETDEV_PCPU_STAT_TSTATS;
  119. dev->needs_free_netdev = true;
  120. }
  121. static struct net_device *qmimux_find_dev(struct usbnet *dev, u8 mux_id)
  122. {
  123. struct qmimux_priv *priv;
  124. struct list_head *iter;
  125. struct net_device *ldev;
  126. rcu_read_lock();
  127. netdev_for_each_upper_dev_rcu(dev->net, ldev, iter) {
  128. priv = netdev_priv(ldev);
  129. if (priv->mux_id == mux_id) {
  130. rcu_read_unlock();
  131. return ldev;
  132. }
  133. }
  134. rcu_read_unlock();
  135. return NULL;
  136. }
  137. static bool qmimux_has_slaves(struct usbnet *dev)
  138. {
  139. return !list_empty(&dev->net->adj_list.upper);
  140. }
  141. static int qmimux_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
  142. {
  143. unsigned int len, offset = 0, pad_len, pkt_len;
  144. struct qmimux_hdr *hdr;
  145. struct net_device *net;
  146. struct sk_buff *skbn;
  147. u8 qmimux_hdr_sz = sizeof(*hdr);
  148. while (offset + qmimux_hdr_sz < skb->len) {
  149. hdr = (struct qmimux_hdr *)(skb->data + offset);
  150. len = be16_to_cpu(hdr->pkt_len);
  151. /* drop the packet, bogus length */
  152. if (offset + len + qmimux_hdr_sz > skb->len)
  153. return 0;
  154. /* control packet, we do not know what to do */
  155. if (hdr->pad & 0x80)
  156. goto skip;
  157. /* extract padding length and check for valid length info */
  158. pad_len = hdr->pad & 0x3f;
  159. if (len == 0 || pad_len >= len)
  160. goto skip;
  161. pkt_len = len - pad_len;
  162. net = qmimux_find_dev(dev, hdr->mux_id);
  163. if (!net)
  164. goto skip;
  165. skbn = netdev_alloc_skb(net, pkt_len + LL_MAX_HEADER);
  166. if (!skbn)
  167. return 0;
  168. switch (skb->data[offset + qmimux_hdr_sz] & 0xf0) {
  169. case 0x40:
  170. skbn->protocol = htons(ETH_P_IP);
  171. break;
  172. case 0x60:
  173. skbn->protocol = htons(ETH_P_IPV6);
  174. break;
  175. default:
  176. /* not ip - do not know what to do */
  177. kfree_skb(skbn);
  178. goto skip;
  179. }
  180. skb_reserve(skbn, LL_MAX_HEADER);
  181. skb_put_data(skbn, skb->data + offset + qmimux_hdr_sz, pkt_len);
  182. if (netif_rx(skbn) != NET_RX_SUCCESS) {
  183. net->stats.rx_errors++;
  184. return 0;
  185. } else {
  186. dev_sw_netstats_rx_add(net, pkt_len);
  187. }
  188. skip:
  189. offset += len + qmimux_hdr_sz;
  190. }
  191. return 1;
  192. }
  193. static ssize_t mux_id_show(struct device *d, struct device_attribute *attr, char *buf)
  194. {
  195. struct net_device *dev = to_net_dev(d);
  196. struct qmimux_priv *priv;
  197. priv = netdev_priv(dev);
  198. return sysfs_emit(buf, "0x%02x\n", priv->mux_id);
  199. }
  200. static DEVICE_ATTR_RO(mux_id);
  201. static struct attribute *qmi_wwan_sysfs_qmimux_attrs[] = {
  202. &dev_attr_mux_id.attr,
  203. NULL,
  204. };
  205. static struct attribute_group qmi_wwan_sysfs_qmimux_attr_group = {
  206. .name = "qmap",
  207. .attrs = qmi_wwan_sysfs_qmimux_attrs,
  208. };
  209. static int qmimux_register_device(struct net_device *real_dev, u8 mux_id)
  210. {
  211. struct net_device *new_dev;
  212. struct qmimux_priv *priv;
  213. int err;
  214. new_dev = alloc_netdev(sizeof(struct qmimux_priv),
  215. "qmimux%d", NET_NAME_UNKNOWN, qmimux_setup);
  216. if (!new_dev)
  217. return -ENOBUFS;
  218. dev_net_set(new_dev, dev_net(real_dev));
  219. priv = netdev_priv(new_dev);
  220. priv->mux_id = mux_id;
  221. priv->real_dev = real_dev;
  222. new_dev->sysfs_groups[0] = &qmi_wwan_sysfs_qmimux_attr_group;
  223. err = register_netdevice(new_dev);
  224. if (err < 0)
  225. goto out_free_newdev;
  226. /* Account for reference in struct qmimux_priv_priv */
  227. dev_hold(real_dev);
  228. err = netdev_upper_dev_link(real_dev, new_dev, NULL);
  229. if (err)
  230. goto out_unregister_netdev;
  231. netif_stacked_transfer_operstate(real_dev, new_dev);
  232. return 0;
  233. out_unregister_netdev:
  234. unregister_netdevice(new_dev);
  235. dev_put(real_dev);
  236. out_free_newdev:
  237. free_netdev(new_dev);
  238. return err;
  239. }
  240. static void qmimux_unregister_device(struct net_device *dev,
  241. struct list_head *head)
  242. {
  243. struct qmimux_priv *priv = netdev_priv(dev);
  244. struct net_device *real_dev = priv->real_dev;
  245. netdev_upper_dev_unlink(real_dev, dev);
  246. unregister_netdevice_queue(dev, head);
  247. /* Get rid of the reference to real_dev */
  248. dev_put(real_dev);
  249. }
  250. static void qmi_wwan_netdev_setup(struct net_device *net)
  251. {
  252. struct usbnet *dev = netdev_priv(net);
  253. struct qmi_wwan_state *info = (void *)&dev->data;
  254. if (info->flags & QMI_WWAN_FLAG_RAWIP) {
  255. net->header_ops = NULL; /* No header */
  256. net->type = ARPHRD_NONE;
  257. net->hard_header_len = 0;
  258. net->addr_len = 0;
  259. net->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
  260. set_bit(EVENT_NO_IP_ALIGN, &dev->flags);
  261. netdev_dbg(net, "mode: raw IP\n");
  262. } else if (!net->header_ops) { /* don't bother if already set */
  263. ether_setup(net);
  264. /* Restoring min/max mtu values set originally by usbnet */
  265. net->min_mtu = 0;
  266. net->max_mtu = ETH_MAX_MTU;
  267. clear_bit(EVENT_NO_IP_ALIGN, &dev->flags);
  268. netdev_dbg(net, "mode: Ethernet\n");
  269. }
  270. /* recalculate buffers after changing hard_header_len */
  271. usbnet_change_mtu(net, net->mtu);
  272. }
  273. static ssize_t raw_ip_show(struct device *d, struct device_attribute *attr, char *buf)
  274. {
  275. struct usbnet *dev = netdev_priv(to_net_dev(d));
  276. struct qmi_wwan_state *info = (void *)&dev->data;
  277. return sprintf(buf, "%c\n", info->flags & QMI_WWAN_FLAG_RAWIP ? 'Y' : 'N');
  278. }
  279. static ssize_t raw_ip_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len)
  280. {
  281. struct usbnet *dev = netdev_priv(to_net_dev(d));
  282. struct qmi_wwan_state *info = (void *)&dev->data;
  283. bool enable;
  284. int ret;
  285. if (kstrtobool(buf, &enable))
  286. return -EINVAL;
  287. /* no change? */
  288. if (enable == (info->flags & QMI_WWAN_FLAG_RAWIP))
  289. return len;
  290. /* ip mode cannot be cleared when pass through mode is set */
  291. if (!enable && (info->flags & QMI_WWAN_FLAG_PASS_THROUGH)) {
  292. netdev_err(dev->net,
  293. "Cannot clear ip mode on pass through device\n");
  294. return -EINVAL;
  295. }
  296. if (!rtnl_trylock())
  297. return restart_syscall();
  298. /* we don't want to modify a running netdev */
  299. if (netif_running(dev->net)) {
  300. netdev_err(dev->net, "Cannot change a running device\n");
  301. ret = -EBUSY;
  302. goto err;
  303. }
  304. /* let other drivers deny the change */
  305. ret = call_netdevice_notifiers(NETDEV_PRE_TYPE_CHANGE, dev->net);
  306. ret = notifier_to_errno(ret);
  307. if (ret) {
  308. netdev_err(dev->net, "Type change was refused\n");
  309. goto err;
  310. }
  311. if (enable)
  312. info->flags |= QMI_WWAN_FLAG_RAWIP;
  313. else
  314. info->flags &= ~QMI_WWAN_FLAG_RAWIP;
  315. qmi_wwan_netdev_setup(dev->net);
  316. call_netdevice_notifiers(NETDEV_POST_TYPE_CHANGE, dev->net);
  317. ret = len;
  318. err:
  319. rtnl_unlock();
  320. return ret;
  321. }
  322. static ssize_t add_mux_show(struct device *d, struct device_attribute *attr, char *buf)
  323. {
  324. struct net_device *dev = to_net_dev(d);
  325. struct qmimux_priv *priv;
  326. struct list_head *iter;
  327. struct net_device *ldev;
  328. ssize_t count = 0;
  329. rcu_read_lock();
  330. netdev_for_each_upper_dev_rcu(dev, ldev, iter) {
  331. priv = netdev_priv(ldev);
  332. count += scnprintf(&buf[count], PAGE_SIZE - count,
  333. "0x%02x\n", priv->mux_id);
  334. }
  335. rcu_read_unlock();
  336. return count;
  337. }
  338. static ssize_t add_mux_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len)
  339. {
  340. struct usbnet *dev = netdev_priv(to_net_dev(d));
  341. struct qmi_wwan_state *info = (void *)&dev->data;
  342. u8 mux_id;
  343. int ret;
  344. if (kstrtou8(buf, 0, &mux_id))
  345. return -EINVAL;
  346. /* mux_id [1 - 254] for compatibility with ip(8) and the rmnet driver */
  347. if (mux_id < 1 || mux_id > 254)
  348. return -EINVAL;
  349. if (!rtnl_trylock())
  350. return restart_syscall();
  351. if (qmimux_find_dev(dev, mux_id)) {
  352. netdev_err(dev->net, "mux_id already present\n");
  353. ret = -EINVAL;
  354. goto err;
  355. }
  356. ret = qmimux_register_device(dev->net, mux_id);
  357. if (!ret) {
  358. info->flags |= QMI_WWAN_FLAG_MUX;
  359. ret = len;
  360. }
  361. err:
  362. rtnl_unlock();
  363. return ret;
  364. }
  365. static ssize_t del_mux_show(struct device *d, struct device_attribute *attr, char *buf)
  366. {
  367. return add_mux_show(d, attr, buf);
  368. }
  369. static ssize_t del_mux_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len)
  370. {
  371. struct usbnet *dev = netdev_priv(to_net_dev(d));
  372. struct qmi_wwan_state *info = (void *)&dev->data;
  373. struct net_device *del_dev;
  374. u8 mux_id;
  375. int ret = 0;
  376. if (kstrtou8(buf, 0, &mux_id))
  377. return -EINVAL;
  378. if (!rtnl_trylock())
  379. return restart_syscall();
  380. del_dev = qmimux_find_dev(dev, mux_id);
  381. if (!del_dev) {
  382. netdev_err(dev->net, "mux_id not present\n");
  383. ret = -EINVAL;
  384. goto err;
  385. }
  386. qmimux_unregister_device(del_dev, NULL);
  387. if (!qmimux_has_slaves(dev))
  388. info->flags &= ~QMI_WWAN_FLAG_MUX;
  389. ret = len;
  390. err:
  391. rtnl_unlock();
  392. return ret;
  393. }
  394. static ssize_t pass_through_show(struct device *d,
  395. struct device_attribute *attr, char *buf)
  396. {
  397. struct usbnet *dev = netdev_priv(to_net_dev(d));
  398. struct qmi_wwan_state *info;
  399. info = (void *)&dev->data;
  400. return sprintf(buf, "%c\n",
  401. info->flags & QMI_WWAN_FLAG_PASS_THROUGH ? 'Y' : 'N');
  402. }
  403. static ssize_t pass_through_store(struct device *d,
  404. struct device_attribute *attr,
  405. const char *buf, size_t len)
  406. {
  407. struct usbnet *dev = netdev_priv(to_net_dev(d));
  408. struct qmi_wwan_state *info;
  409. bool enable;
  410. if (kstrtobool(buf, &enable))
  411. return -EINVAL;
  412. info = (void *)&dev->data;
  413. /* no change? */
  414. if (enable == (info->flags & QMI_WWAN_FLAG_PASS_THROUGH))
  415. return len;
  416. /* pass through mode can be set for raw ip devices only */
  417. if (!(info->flags & QMI_WWAN_FLAG_RAWIP)) {
  418. netdev_err(dev->net,
  419. "Cannot set pass through mode on non ip device\n");
  420. return -EINVAL;
  421. }
  422. if (enable)
  423. info->flags |= QMI_WWAN_FLAG_PASS_THROUGH;
  424. else
  425. info->flags &= ~QMI_WWAN_FLAG_PASS_THROUGH;
  426. return len;
  427. }
  428. static DEVICE_ATTR_RW(raw_ip);
  429. static DEVICE_ATTR_RW(add_mux);
  430. static DEVICE_ATTR_RW(del_mux);
  431. static DEVICE_ATTR_RW(pass_through);
  432. static struct attribute *qmi_wwan_sysfs_attrs[] = {
  433. &dev_attr_raw_ip.attr,
  434. &dev_attr_add_mux.attr,
  435. &dev_attr_del_mux.attr,
  436. &dev_attr_pass_through.attr,
  437. NULL,
  438. };
  439. static struct attribute_group qmi_wwan_sysfs_attr_group = {
  440. .name = "qmi",
  441. .attrs = qmi_wwan_sysfs_attrs,
  442. };
  443. /* default ethernet address used by the modem */
  444. static const u8 default_modem_addr[ETH_ALEN] = {0x02, 0x50, 0xf3};
  445. static const u8 buggy_fw_addr[ETH_ALEN] = {0x00, 0xa0, 0xc6, 0x00, 0x00, 0x00};
  446. /* Make up an ethernet header if the packet doesn't have one.
  447. *
  448. * A firmware bug common among several devices cause them to send raw
  449. * IP packets under some circumstances. There is no way for the
  450. * driver/host to know when this will happen. And even when the bug
  451. * hits, some packets will still arrive with an intact header.
  452. *
  453. * The supported devices are only capably of sending IPv4, IPv6 and
  454. * ARP packets on a point-to-point link. Any packet with an ethernet
  455. * header will have either our address or a broadcast/multicast
  456. * address as destination. ARP packets will always have a header.
  457. *
  458. * This means that this function will reliably add the appropriate
  459. * header iff necessary, provided our hardware address does not start
  460. * with 4 or 6.
  461. *
  462. * Another common firmware bug results in all packets being addressed
  463. * to 00:a0:c6:00:00:00 despite the host address being different.
  464. * This function will also fixup such packets.
  465. */
  466. static int qmi_wwan_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
  467. {
  468. struct qmi_wwan_state *info = (void *)&dev->data;
  469. bool rawip = info->flags & QMI_WWAN_FLAG_RAWIP;
  470. __be16 proto;
  471. /* This check is no longer done by usbnet */
  472. if (skb->len < dev->net->hard_header_len)
  473. return 0;
  474. if (info->flags & QMI_WWAN_FLAG_MUX)
  475. return qmimux_rx_fixup(dev, skb);
  476. if (info->flags & QMI_WWAN_FLAG_PASS_THROUGH) {
  477. skb->protocol = htons(ETH_P_MAP);
  478. return 1;
  479. }
  480. switch (skb->data[0] & 0xf0) {
  481. case 0x40:
  482. proto = htons(ETH_P_IP);
  483. break;
  484. case 0x60:
  485. proto = htons(ETH_P_IPV6);
  486. break;
  487. case 0x00:
  488. if (rawip)
  489. return 0;
  490. if (is_multicast_ether_addr(skb->data))
  491. return 1;
  492. /* possibly bogus destination - rewrite just in case */
  493. skb_reset_mac_header(skb);
  494. goto fix_dest;
  495. default:
  496. if (rawip)
  497. return 0;
  498. /* pass along other packets without modifications */
  499. return 1;
  500. }
  501. if (rawip) {
  502. skb_reset_mac_header(skb);
  503. skb->dev = dev->net; /* normally set by eth_type_trans */
  504. skb->protocol = proto;
  505. return 1;
  506. }
  507. if (skb_headroom(skb) < ETH_HLEN)
  508. return 0;
  509. skb_push(skb, ETH_HLEN);
  510. skb_reset_mac_header(skb);
  511. eth_hdr(skb)->h_proto = proto;
  512. eth_zero_addr(eth_hdr(skb)->h_source);
  513. fix_dest:
  514. memcpy(eth_hdr(skb)->h_dest, dev->net->dev_addr, ETH_ALEN);
  515. return 1;
  516. }
  517. /* very simplistic detection of IPv4 or IPv6 headers */
  518. static bool possibly_iphdr(const char *data)
  519. {
  520. return (data[0] & 0xd0) == 0x40;
  521. }
  522. /* disallow addresses which may be confused with IP headers */
  523. static int qmi_wwan_mac_addr(struct net_device *dev, void *p)
  524. {
  525. int ret;
  526. struct sockaddr *addr = p;
  527. ret = eth_prepare_mac_addr_change(dev, p);
  528. if (ret < 0)
  529. return ret;
  530. if (possibly_iphdr(addr->sa_data))
  531. return -EADDRNOTAVAIL;
  532. eth_commit_mac_addr_change(dev, p);
  533. return 0;
  534. }
  535. static const struct net_device_ops qmi_wwan_netdev_ops = {
  536. .ndo_open = usbnet_open,
  537. .ndo_stop = usbnet_stop,
  538. .ndo_start_xmit = usbnet_start_xmit,
  539. .ndo_tx_timeout = usbnet_tx_timeout,
  540. .ndo_change_mtu = usbnet_change_mtu,
  541. .ndo_set_mac_address = qmi_wwan_mac_addr,
  542. .ndo_validate_addr = eth_validate_addr,
  543. };
  544. /* using a counter to merge subdriver requests with our own into a
  545. * combined state
  546. */
  547. static int qmi_wwan_manage_power(struct usbnet *dev, int on)
  548. {
  549. struct qmi_wwan_state *info = (void *)&dev->data;
  550. int rv;
  551. dev_dbg(&dev->intf->dev, "%s() pmcount=%d, on=%d\n", __func__,
  552. atomic_read(&info->pmcount), on);
  553. if ((on && atomic_add_return(1, &info->pmcount) == 1) ||
  554. (!on && atomic_dec_and_test(&info->pmcount))) {
  555. /* need autopm_get/put here to ensure the usbcore sees
  556. * the new value
  557. */
  558. rv = usb_autopm_get_interface(dev->intf);
  559. dev->intf->needs_remote_wakeup = on;
  560. if (!rv)
  561. usb_autopm_put_interface(dev->intf);
  562. }
  563. return 0;
  564. }
  565. static int qmi_wwan_cdc_wdm_manage_power(struct usb_interface *intf, int on)
  566. {
  567. struct usbnet *dev = usb_get_intfdata(intf);
  568. /* can be called while disconnecting */
  569. if (!dev)
  570. return 0;
  571. return qmi_wwan_manage_power(dev, on);
  572. }
  573. /* collect all three endpoints and register subdriver */
  574. static int qmi_wwan_register_subdriver(struct usbnet *dev)
  575. {
  576. int rv;
  577. struct usb_driver *subdriver = NULL;
  578. struct qmi_wwan_state *info = (void *)&dev->data;
  579. /* collect bulk endpoints */
  580. rv = usbnet_get_endpoints(dev, info->data);
  581. if (rv < 0)
  582. goto err;
  583. /* update status endpoint if separate control interface */
  584. if (info->control != info->data)
  585. dev->status = &info->control->cur_altsetting->endpoint[0];
  586. /* require interrupt endpoint for subdriver */
  587. if (!dev->status) {
  588. rv = -EINVAL;
  589. goto err;
  590. }
  591. /* for subdriver power management */
  592. atomic_set(&info->pmcount, 0);
  593. /* register subdriver */
  594. subdriver = usb_cdc_wdm_register(info->control, &dev->status->desc,
  595. 4096, WWAN_PORT_QMI,
  596. &qmi_wwan_cdc_wdm_manage_power);
  597. if (IS_ERR(subdriver)) {
  598. dev_err(&info->control->dev, "subdriver registration failed\n");
  599. rv = PTR_ERR(subdriver);
  600. goto err;
  601. }
  602. /* prevent usbnet from using status endpoint */
  603. dev->status = NULL;
  604. /* save subdriver struct for suspend/resume wrappers */
  605. info->subdriver = subdriver;
  606. err:
  607. return rv;
  608. }
  609. /* Send CDC SetControlLineState request, setting or clearing the DTR.
  610. * "Required for Autoconnect and 9x30 to wake up" according to the
  611. * GobiNet driver. The requirement has been verified on an MDM9230
  612. * based Sierra Wireless MC7455
  613. */
  614. static int qmi_wwan_change_dtr(struct usbnet *dev, bool on)
  615. {
  616. u8 intf = dev->intf->cur_altsetting->desc.bInterfaceNumber;
  617. return usbnet_write_cmd(dev, USB_CDC_REQ_SET_CONTROL_LINE_STATE,
  618. USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
  619. on ? 0x01 : 0x00, intf, NULL, 0);
  620. }
  621. static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
  622. {
  623. int status;
  624. u8 *buf = intf->cur_altsetting->extra;
  625. int len = intf->cur_altsetting->extralen;
  626. struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc;
  627. struct usb_cdc_union_desc *cdc_union;
  628. struct usb_cdc_ether_desc *cdc_ether;
  629. struct usb_driver *driver = driver_of(intf);
  630. struct qmi_wwan_state *info = (void *)&dev->data;
  631. struct usb_cdc_parsed_header hdr;
  632. BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data) <
  633. sizeof(struct qmi_wwan_state)));
  634. /* set up initial state */
  635. info->control = intf;
  636. info->data = intf;
  637. /* and a number of CDC descriptors */
  638. cdc_parse_cdc_header(&hdr, intf, buf, len);
  639. cdc_union = hdr.usb_cdc_union_desc;
  640. cdc_ether = hdr.usb_cdc_ether_desc;
  641. /* Use separate control and data interfaces if we found a CDC Union */
  642. if (cdc_union) {
  643. info->data = usb_ifnum_to_if(dev->udev,
  644. cdc_union->bSlaveInterface0);
  645. if (desc->bInterfaceNumber != cdc_union->bMasterInterface0 ||
  646. !info->data) {
  647. dev_err(&intf->dev,
  648. "bogus CDC Union: master=%u, slave=%u\n",
  649. cdc_union->bMasterInterface0,
  650. cdc_union->bSlaveInterface0);
  651. /* ignore and continue... */
  652. cdc_union = NULL;
  653. info->data = intf;
  654. }
  655. }
  656. /* errors aren't fatal - we can live with the dynamic address */
  657. if (cdc_ether && cdc_ether->wMaxSegmentSize) {
  658. dev->hard_mtu = le16_to_cpu(cdc_ether->wMaxSegmentSize);
  659. usbnet_get_ethernet_addr(dev, cdc_ether->iMACAddress);
  660. }
  661. /* claim data interface and set it up */
  662. if (info->control != info->data) {
  663. status = usb_driver_claim_interface(driver, info->data, dev);
  664. if (status < 0)
  665. goto err;
  666. }
  667. status = qmi_wwan_register_subdriver(dev);
  668. if (status < 0 && info->control != info->data) {
  669. usb_set_intfdata(info->data, NULL);
  670. usb_driver_release_interface(driver, info->data);
  671. }
  672. /* disabling remote wakeup on MDM9x30 devices has the same
  673. * effect as clearing DTR. The device will not respond to QMI
  674. * requests until we set DTR again. This is similar to a
  675. * QMI_CTL SYNC request, clearing a lot of firmware state
  676. * including the client ID allocations.
  677. *
  678. * Our usage model allows a session to span multiple
  679. * open/close events, so we must prevent the firmware from
  680. * clearing out state the clients might need.
  681. *
  682. * MDM9x30 is the first QMI chipset with USB3 support. Abuse
  683. * this fact to enable the quirk for all USB3 devices.
  684. *
  685. * There are also chipsets with the same "set DTR" requirement
  686. * but without USB3 support. Devices based on these chips
  687. * need a quirk flag in the device ID table.
  688. */
  689. if (dev->driver_info->data & QMI_WWAN_QUIRK_DTR ||
  690. le16_to_cpu(dev->udev->descriptor.bcdUSB) >= 0x0201) {
  691. qmi_wwan_manage_power(dev, 1);
  692. qmi_wwan_change_dtr(dev, true);
  693. }
  694. /* Never use the same address on both ends of the link, even if the
  695. * buggy firmware told us to. Or, if device is assigned the well-known
  696. * buggy firmware MAC address, replace it with a random address,
  697. */
  698. if (ether_addr_equal(dev->net->dev_addr, default_modem_addr) ||
  699. ether_addr_equal(dev->net->dev_addr, buggy_fw_addr))
  700. eth_hw_addr_random(dev->net);
  701. /* make MAC addr easily distinguishable from an IP header */
  702. if (possibly_iphdr(dev->net->dev_addr)) {
  703. u8 addr = dev->net->dev_addr[0];
  704. addr |= 0x02; /* set local assignment bit */
  705. addr &= 0xbf; /* clear "IP" bit */
  706. dev_addr_mod(dev->net, 0, &addr, 1);
  707. }
  708. dev->net->netdev_ops = &qmi_wwan_netdev_ops;
  709. dev->net->sysfs_groups[0] = &qmi_wwan_sysfs_attr_group;
  710. err:
  711. return status;
  712. }
  713. static void qmi_wwan_unbind(struct usbnet *dev, struct usb_interface *intf)
  714. {
  715. struct qmi_wwan_state *info = (void *)&dev->data;
  716. struct usb_driver *driver = driver_of(intf);
  717. struct usb_interface *other;
  718. if (info->subdriver && info->subdriver->disconnect)
  719. info->subdriver->disconnect(info->control);
  720. /* disable MDM9x30 quirk */
  721. if (le16_to_cpu(dev->udev->descriptor.bcdUSB) >= 0x0201) {
  722. qmi_wwan_change_dtr(dev, false);
  723. qmi_wwan_manage_power(dev, 0);
  724. }
  725. /* allow user to unbind using either control or data */
  726. if (intf == info->control)
  727. other = info->data;
  728. else
  729. other = info->control;
  730. /* only if not shared */
  731. if (other && intf != other) {
  732. usb_set_intfdata(other, NULL);
  733. usb_driver_release_interface(driver, other);
  734. }
  735. info->subdriver = NULL;
  736. info->data = NULL;
  737. info->control = NULL;
  738. }
  739. /* suspend/resume wrappers calling both usbnet and the cdc-wdm
  740. * subdriver if present.
  741. *
  742. * NOTE: cdc-wdm also supports pre/post_reset, but we cannot provide
  743. * wrappers for those without adding usbnet reset support first.
  744. */
  745. static int qmi_wwan_suspend(struct usb_interface *intf, pm_message_t message)
  746. {
  747. struct usbnet *dev = usb_get_intfdata(intf);
  748. struct qmi_wwan_state *info = (void *)&dev->data;
  749. int ret;
  750. /* Both usbnet_suspend() and subdriver->suspend() MUST return 0
  751. * in system sleep context, otherwise, the resume callback has
  752. * to recover device from previous suspend failure.
  753. */
  754. ret = usbnet_suspend(intf, message);
  755. if (ret < 0)
  756. goto err;
  757. if (intf == info->control && info->subdriver &&
  758. info->subdriver->suspend)
  759. ret = info->subdriver->suspend(intf, message);
  760. if (ret < 0)
  761. usbnet_resume(intf);
  762. err:
  763. return ret;
  764. }
  765. static int qmi_wwan_resume(struct usb_interface *intf)
  766. {
  767. struct usbnet *dev = usb_get_intfdata(intf);
  768. struct qmi_wwan_state *info = (void *)&dev->data;
  769. int ret = 0;
  770. bool callsub = (intf == info->control && info->subdriver &&
  771. info->subdriver->resume);
  772. if (callsub)
  773. ret = info->subdriver->resume(intf);
  774. if (ret < 0)
  775. goto err;
  776. ret = usbnet_resume(intf);
  777. if (ret < 0 && callsub)
  778. info->subdriver->suspend(intf, PMSG_SUSPEND);
  779. err:
  780. return ret;
  781. }
  782. static const struct driver_info qmi_wwan_info = {
  783. .description = "WWAN/QMI device",
  784. .flags = FLAG_WWAN | FLAG_SEND_ZLP,
  785. .bind = qmi_wwan_bind,
  786. .unbind = qmi_wwan_unbind,
  787. .manage_power = qmi_wwan_manage_power,
  788. .rx_fixup = qmi_wwan_rx_fixup,
  789. };
  790. static const struct driver_info qmi_wwan_info_quirk_dtr = {
  791. .description = "WWAN/QMI device",
  792. .flags = FLAG_WWAN | FLAG_SEND_ZLP,
  793. .bind = qmi_wwan_bind,
  794. .unbind = qmi_wwan_unbind,
  795. .manage_power = qmi_wwan_manage_power,
  796. .rx_fixup = qmi_wwan_rx_fixup,
  797. .data = QMI_WWAN_QUIRK_DTR,
  798. };
  799. #define HUAWEI_VENDOR_ID 0x12D1
  800. /* map QMI/wwan function by a fixed interface number */
  801. #define QMI_FIXED_INTF(vend, prod, num) \
  802. USB_DEVICE_INTERFACE_NUMBER(vend, prod, num), \
  803. .driver_info = (unsigned long)&qmi_wwan_info
  804. /* devices requiring "set DTR" quirk */
  805. #define QMI_QUIRK_SET_DTR(vend, prod, num) \
  806. USB_DEVICE_INTERFACE_NUMBER(vend, prod, num), \
  807. .driver_info = (unsigned long)&qmi_wwan_info_quirk_dtr
  808. /* Gobi 1000 QMI/wwan interface number is 3 according to qcserial */
  809. #define QMI_GOBI1K_DEVICE(vend, prod) \
  810. QMI_FIXED_INTF(vend, prod, 3)
  811. /* Gobi 2000/3000 QMI/wwan interface number is 0 according to qcserial */
  812. #define QMI_GOBI_DEVICE(vend, prod) \
  813. QMI_FIXED_INTF(vend, prod, 0)
  814. /* Many devices have QMI and DIAG functions which are distinguishable
  815. * from other vendor specific functions by class, subclass and
  816. * protocol all being 0xff. The DIAG function has exactly 2 endpoints
  817. * and is silently rejected when probed.
  818. *
  819. * This makes it possible to match dynamically numbered QMI functions
  820. * as seen on e.g. many Quectel modems.
  821. */
  822. #define QMI_MATCH_FF_FF_FF(vend, prod) \
  823. USB_DEVICE_AND_INTERFACE_INFO(vend, prod, USB_CLASS_VENDOR_SPEC, \
  824. USB_SUBCLASS_VENDOR_SPEC, 0xff), \
  825. .driver_info = (unsigned long)&qmi_wwan_info_quirk_dtr
  826. static const struct usb_device_id products[] = {
  827. /* 1. CDC ECM like devices match on the control interface */
  828. { /* Huawei E392, E398 and possibly others sharing both device id and more... */
  829. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 9),
  830. .driver_info = (unsigned long)&qmi_wwan_info,
  831. },
  832. { /* Vodafone/Huawei K5005 (12d1:14c8) and similar modems */
  833. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 57),
  834. .driver_info = (unsigned long)&qmi_wwan_info,
  835. },
  836. { /* HUAWEI_INTERFACE_NDIS_CONTROL_QUALCOMM */
  837. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x69),
  838. .driver_info = (unsigned long)&qmi_wwan_info,
  839. },
  840. { /* Motorola Mapphone devices with MDM6600 */
  841. USB_VENDOR_AND_INTERFACE_INFO(0x22b8, USB_CLASS_VENDOR_SPEC, 0xfb, 0xff),
  842. .driver_info = (unsigned long)&qmi_wwan_info,
  843. },
  844. /* 2. Combined interface devices matching on class+protocol */
  845. { /* Huawei E367 and possibly others in "Windows mode" */
  846. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 7),
  847. .driver_info = (unsigned long)&qmi_wwan_info,
  848. },
  849. { /* Huawei E392, E398 and possibly others in "Windows mode" */
  850. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 1, 17),
  851. .driver_info = (unsigned long)&qmi_wwan_info,
  852. },
  853. { /* HUAWEI_NDIS_SINGLE_INTERFACE_VDF */
  854. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x37),
  855. .driver_info = (unsigned long)&qmi_wwan_info,
  856. },
  857. { /* HUAWEI_INTERFACE_NDIS_HW_QUALCOMM */
  858. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x67),
  859. .driver_info = (unsigned long)&qmi_wwan_info,
  860. },
  861. { /* Pantech UML290, P4200 and more */
  862. USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 0xf0, 0xff),
  863. .driver_info = (unsigned long)&qmi_wwan_info,
  864. },
  865. { /* Pantech UML290 - newer firmware */
  866. USB_VENDOR_AND_INTERFACE_INFO(0x106c, USB_CLASS_VENDOR_SPEC, 0xf1, 0xff),
  867. .driver_info = (unsigned long)&qmi_wwan_info,
  868. },
  869. { /* Novatel USB551L and MC551 */
  870. USB_DEVICE_AND_INTERFACE_INFO(0x1410, 0xb001,
  871. USB_CLASS_COMM,
  872. USB_CDC_SUBCLASS_ETHERNET,
  873. USB_CDC_PROTO_NONE),
  874. .driver_info = (unsigned long)&qmi_wwan_info,
  875. },
  876. { /* Novatel E362 */
  877. USB_DEVICE_AND_INTERFACE_INFO(0x1410, 0x9010,
  878. USB_CLASS_COMM,
  879. USB_CDC_SUBCLASS_ETHERNET,
  880. USB_CDC_PROTO_NONE),
  881. .driver_info = (unsigned long)&qmi_wwan_info,
  882. },
  883. { /* Novatel Expedite E371 */
  884. USB_DEVICE_AND_INTERFACE_INFO(0x1410, 0x9011,
  885. USB_CLASS_COMM,
  886. USB_CDC_SUBCLASS_ETHERNET,
  887. USB_CDC_PROTO_NONE),
  888. .driver_info = (unsigned long)&qmi_wwan_info,
  889. },
  890. { /* Dell Wireless 5800 (Novatel E362) */
  891. USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x8195,
  892. USB_CLASS_COMM,
  893. USB_CDC_SUBCLASS_ETHERNET,
  894. USB_CDC_PROTO_NONE),
  895. .driver_info = (unsigned long)&qmi_wwan_info,
  896. },
  897. { /* Dell Wireless 5800 V2 (Novatel E362) */
  898. USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x8196,
  899. USB_CLASS_COMM,
  900. USB_CDC_SUBCLASS_ETHERNET,
  901. USB_CDC_PROTO_NONE),
  902. .driver_info = (unsigned long)&qmi_wwan_info,
  903. },
  904. { /* Dell Wireless 5804 (Novatel E371) */
  905. USB_DEVICE_AND_INTERFACE_INFO(0x413C, 0x819b,
  906. USB_CLASS_COMM,
  907. USB_CDC_SUBCLASS_ETHERNET,
  908. USB_CDC_PROTO_NONE),
  909. .driver_info = (unsigned long)&qmi_wwan_info,
  910. },
  911. { /* ADU960S */
  912. USB_DEVICE_AND_INTERFACE_INFO(0x16d5, 0x650a,
  913. USB_CLASS_COMM,
  914. USB_CDC_SUBCLASS_ETHERNET,
  915. USB_CDC_PROTO_NONE),
  916. .driver_info = (unsigned long)&qmi_wwan_info,
  917. },
  918. { /* HP lt2523 (Novatel E371) */
  919. USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x421d,
  920. USB_CLASS_COMM,
  921. USB_CDC_SUBCLASS_ETHERNET,
  922. USB_CDC_PROTO_NONE),
  923. .driver_info = (unsigned long)&qmi_wwan_info,
  924. },
  925. { /* HP lt4112 LTE/HSPA+ Gobi 4G Module (Huawei me906e) */
  926. USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7),
  927. .driver_info = (unsigned long)&qmi_wwan_info,
  928. },
  929. {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0122)}, /* Quectel RG650V */
  930. {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */
  931. {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */
  932. {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */
  933. {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0620)}, /* Quectel EM160R-GL */
  934. {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */
  935. {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0801)}, /* Quectel RM520N */
  936. /* 3. Combined interface devices matching on interface number */
  937. {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */
  938. {QMI_FIXED_INTF(0x05c6, 0x6001, 3)}, /* 4G LTE usb-modem U901 */
  939. {QMI_FIXED_INTF(0x05c6, 0x7000, 0)},
  940. {QMI_FIXED_INTF(0x05c6, 0x7001, 1)},
  941. {QMI_FIXED_INTF(0x05c6, 0x7002, 1)},
  942. {QMI_FIXED_INTF(0x05c6, 0x7101, 1)},
  943. {QMI_FIXED_INTF(0x05c6, 0x7101, 2)},
  944. {QMI_FIXED_INTF(0x05c6, 0x7101, 3)},
  945. {QMI_FIXED_INTF(0x05c6, 0x7102, 1)},
  946. {QMI_FIXED_INTF(0x05c6, 0x7102, 2)},
  947. {QMI_FIXED_INTF(0x05c6, 0x7102, 3)},
  948. {QMI_FIXED_INTF(0x05c6, 0x8000, 7)},
  949. {QMI_FIXED_INTF(0x05c6, 0x8001, 6)},
  950. {QMI_FIXED_INTF(0x05c6, 0x9000, 4)},
  951. {QMI_FIXED_INTF(0x05c6, 0x9003, 4)},
  952. {QMI_FIXED_INTF(0x05c6, 0x9005, 2)},
  953. {QMI_FIXED_INTF(0x05c6, 0x900a, 4)},
  954. {QMI_FIXED_INTF(0x05c6, 0x900b, 2)},
  955. {QMI_FIXED_INTF(0x05c6, 0x900c, 4)},
  956. {QMI_FIXED_INTF(0x05c6, 0x900c, 5)},
  957. {QMI_FIXED_INTF(0x05c6, 0x900c, 6)},
  958. {QMI_FIXED_INTF(0x05c6, 0x900d, 5)},
  959. {QMI_FIXED_INTF(0x05c6, 0x900f, 3)},
  960. {QMI_FIXED_INTF(0x05c6, 0x900f, 4)},
  961. {QMI_FIXED_INTF(0x05c6, 0x900f, 5)},
  962. {QMI_FIXED_INTF(0x05c6, 0x9010, 4)},
  963. {QMI_FIXED_INTF(0x05c6, 0x9010, 5)},
  964. {QMI_FIXED_INTF(0x05c6, 0x9011, 3)},
  965. {QMI_FIXED_INTF(0x05c6, 0x9011, 4)},
  966. {QMI_FIXED_INTF(0x05c6, 0x9021, 1)},
  967. {QMI_FIXED_INTF(0x05c6, 0x9022, 2)},
  968. {QMI_QUIRK_SET_DTR(0x05c6, 0x9025, 4)}, /* Alcatel-sbell ASB TL131 TDD LTE (China Mobile) */
  969. {QMI_FIXED_INTF(0x05c6, 0x9026, 3)},
  970. {QMI_FIXED_INTF(0x05c6, 0x902e, 5)},
  971. {QMI_FIXED_INTF(0x05c6, 0x9031, 5)},
  972. {QMI_FIXED_INTF(0x05c6, 0x9032, 4)},
  973. {QMI_FIXED_INTF(0x05c6, 0x9033, 3)},
  974. {QMI_FIXED_INTF(0x05c6, 0x9033, 4)},
  975. {QMI_FIXED_INTF(0x05c6, 0x9033, 5)},
  976. {QMI_FIXED_INTF(0x05c6, 0x9033, 6)},
  977. {QMI_FIXED_INTF(0x05c6, 0x9034, 3)},
  978. {QMI_FIXED_INTF(0x05c6, 0x9034, 4)},
  979. {QMI_FIXED_INTF(0x05c6, 0x9034, 5)},
  980. {QMI_FIXED_INTF(0x05c6, 0x9034, 6)},
  981. {QMI_FIXED_INTF(0x05c6, 0x9034, 7)},
  982. {QMI_FIXED_INTF(0x05c6, 0x9035, 4)},
  983. {QMI_FIXED_INTF(0x05c6, 0x9036, 3)},
  984. {QMI_FIXED_INTF(0x05c6, 0x9037, 5)},
  985. {QMI_FIXED_INTF(0x05c6, 0x9038, 4)},
  986. {QMI_FIXED_INTF(0x05c6, 0x903b, 7)},
  987. {QMI_FIXED_INTF(0x05c6, 0x903c, 6)},
  988. {QMI_FIXED_INTF(0x05c6, 0x903d, 6)},
  989. {QMI_FIXED_INTF(0x05c6, 0x903e, 5)},
  990. {QMI_FIXED_INTF(0x05c6, 0x9043, 3)},
  991. {QMI_FIXED_INTF(0x05c6, 0x9046, 3)},
  992. {QMI_FIXED_INTF(0x05c6, 0x9046, 4)},
  993. {QMI_FIXED_INTF(0x05c6, 0x9046, 5)},
  994. {QMI_FIXED_INTF(0x05c6, 0x9047, 2)},
  995. {QMI_FIXED_INTF(0x05c6, 0x9047, 3)},
  996. {QMI_FIXED_INTF(0x05c6, 0x9047, 4)},
  997. {QMI_FIXED_INTF(0x05c6, 0x9048, 4)},
  998. {QMI_FIXED_INTF(0x05c6, 0x9048, 5)},
  999. {QMI_FIXED_INTF(0x05c6, 0x9048, 6)},
  1000. {QMI_FIXED_INTF(0x05c6, 0x9048, 7)},
  1001. {QMI_FIXED_INTF(0x05c6, 0x9048, 8)},
  1002. {QMI_FIXED_INTF(0x05c6, 0x904c, 5)},
  1003. {QMI_FIXED_INTF(0x05c6, 0x904c, 6)},
  1004. {QMI_FIXED_INTF(0x05c6, 0x904c, 7)},
  1005. {QMI_FIXED_INTF(0x05c6, 0x904c, 8)},
  1006. {QMI_FIXED_INTF(0x05c6, 0x9050, 3)},
  1007. {QMI_FIXED_INTF(0x05c6, 0x9052, 4)},
  1008. {QMI_FIXED_INTF(0x05c6, 0x9053, 6)},
  1009. {QMI_FIXED_INTF(0x05c6, 0x9053, 7)},
  1010. {QMI_FIXED_INTF(0x05c6, 0x9054, 5)},
  1011. {QMI_FIXED_INTF(0x05c6, 0x9054, 6)},
  1012. {QMI_FIXED_INTF(0x05c6, 0x9055, 3)},
  1013. {QMI_FIXED_INTF(0x05c6, 0x9055, 4)},
  1014. {QMI_FIXED_INTF(0x05c6, 0x9055, 5)},
  1015. {QMI_FIXED_INTF(0x05c6, 0x9055, 6)},
  1016. {QMI_FIXED_INTF(0x05c6, 0x9055, 7)},
  1017. {QMI_FIXED_INTF(0x05c6, 0x9056, 3)},
  1018. {QMI_FIXED_INTF(0x05c6, 0x9062, 2)},
  1019. {QMI_FIXED_INTF(0x05c6, 0x9062, 3)},
  1020. {QMI_FIXED_INTF(0x05c6, 0x9062, 4)},
  1021. {QMI_FIXED_INTF(0x05c6, 0x9062, 5)},
  1022. {QMI_FIXED_INTF(0x05c6, 0x9062, 6)},
  1023. {QMI_FIXED_INTF(0x05c6, 0x9062, 7)},
  1024. {QMI_FIXED_INTF(0x05c6, 0x9062, 8)},
  1025. {QMI_FIXED_INTF(0x05c6, 0x9062, 9)},
  1026. {QMI_FIXED_INTF(0x05c6, 0x9064, 3)},
  1027. {QMI_FIXED_INTF(0x05c6, 0x9065, 6)},
  1028. {QMI_FIXED_INTF(0x05c6, 0x9065, 7)},
  1029. {QMI_FIXED_INTF(0x05c6, 0x9066, 5)},
  1030. {QMI_FIXED_INTF(0x05c6, 0x9066, 6)},
  1031. {QMI_FIXED_INTF(0x05c6, 0x9067, 1)},
  1032. {QMI_FIXED_INTF(0x05c6, 0x9068, 2)},
  1033. {QMI_FIXED_INTF(0x05c6, 0x9068, 3)},
  1034. {QMI_FIXED_INTF(0x05c6, 0x9068, 4)},
  1035. {QMI_FIXED_INTF(0x05c6, 0x9068, 5)},
  1036. {QMI_FIXED_INTF(0x05c6, 0x9068, 6)},
  1037. {QMI_FIXED_INTF(0x05c6, 0x9068, 7)},
  1038. {QMI_FIXED_INTF(0x05c6, 0x9069, 5)},
  1039. {QMI_FIXED_INTF(0x05c6, 0x9069, 6)},
  1040. {QMI_FIXED_INTF(0x05c6, 0x9069, 7)},
  1041. {QMI_FIXED_INTF(0x05c6, 0x9069, 8)},
  1042. {QMI_FIXED_INTF(0x05c6, 0x9070, 4)},
  1043. {QMI_FIXED_INTF(0x05c6, 0x9070, 5)},
  1044. {QMI_FIXED_INTF(0x05c6, 0x9075, 5)},
  1045. {QMI_FIXED_INTF(0x05c6, 0x9076, 4)},
  1046. {QMI_FIXED_INTF(0x05c6, 0x9076, 5)},
  1047. {QMI_FIXED_INTF(0x05c6, 0x9076, 6)},
  1048. {QMI_FIXED_INTF(0x05c6, 0x9076, 7)},
  1049. {QMI_FIXED_INTF(0x05c6, 0x9076, 8)},
  1050. {QMI_FIXED_INTF(0x05c6, 0x9077, 3)},
  1051. {QMI_FIXED_INTF(0x05c6, 0x9077, 4)},
  1052. {QMI_FIXED_INTF(0x05c6, 0x9077, 5)},
  1053. {QMI_FIXED_INTF(0x05c6, 0x9077, 6)},
  1054. {QMI_FIXED_INTF(0x05c6, 0x9078, 3)},
  1055. {QMI_FIXED_INTF(0x05c6, 0x9079, 4)},
  1056. {QMI_FIXED_INTF(0x05c6, 0x9079, 5)},
  1057. {QMI_FIXED_INTF(0x05c6, 0x9079, 6)},
  1058. {QMI_FIXED_INTF(0x05c6, 0x9079, 7)},
  1059. {QMI_FIXED_INTF(0x05c6, 0x9079, 8)},
  1060. {QMI_FIXED_INTF(0x05c6, 0x9080, 5)},
  1061. {QMI_FIXED_INTF(0x05c6, 0x9080, 6)},
  1062. {QMI_FIXED_INTF(0x05c6, 0x9080, 7)},
  1063. {QMI_FIXED_INTF(0x05c6, 0x9080, 8)},
  1064. {QMI_FIXED_INTF(0x05c6, 0x9083, 3)},
  1065. {QMI_FIXED_INTF(0x05c6, 0x9084, 4)},
  1066. {QMI_QUIRK_SET_DTR(0x05c6, 0x9091, 2)}, /* Compal RXM-G1 */
  1067. {QMI_FIXED_INTF(0x05c6, 0x90b2, 3)}, /* ublox R410M */
  1068. {QMI_QUIRK_SET_DTR(0x05c6, 0x90db, 2)}, /* Compal RXM-G1 */
  1069. {QMI_FIXED_INTF(0x05c6, 0x920d, 0)},
  1070. {QMI_FIXED_INTF(0x05c6, 0x920d, 5)},
  1071. {QMI_QUIRK_SET_DTR(0x05c6, 0x9625, 4)}, /* YUGA CLM920-NC5 */
  1072. {QMI_FIXED_INTF(0x0846, 0x68a2, 8)},
  1073. {QMI_FIXED_INTF(0x0846, 0x68d3, 8)}, /* Netgear Aircard 779S */
  1074. {QMI_FIXED_INTF(0x12d1, 0x140c, 1)}, /* Huawei E173 */
  1075. {QMI_FIXED_INTF(0x12d1, 0x14ac, 1)}, /* Huawei E1820 */
  1076. {QMI_FIXED_INTF(0x1435, 0x0918, 3)}, /* Wistron NeWeb D16Q1 */
  1077. {QMI_FIXED_INTF(0x1435, 0x0918, 4)}, /* Wistron NeWeb D16Q1 */
  1078. {QMI_FIXED_INTF(0x1435, 0x0918, 5)}, /* Wistron NeWeb D16Q1 */
  1079. {QMI_FIXED_INTF(0x1435, 0x3185, 4)}, /* Wistron NeWeb M18Q5 */
  1080. {QMI_FIXED_INTF(0x1435, 0xd111, 4)}, /* M9615A DM11-1 D51QC */
  1081. {QMI_FIXED_INTF(0x1435, 0xd181, 3)}, /* Wistron NeWeb D18Q1 */
  1082. {QMI_FIXED_INTF(0x1435, 0xd181, 4)}, /* Wistron NeWeb D18Q1 */
  1083. {QMI_FIXED_INTF(0x1435, 0xd181, 5)}, /* Wistron NeWeb D18Q1 */
  1084. {QMI_FIXED_INTF(0x1435, 0xd182, 4)}, /* Wistron NeWeb D18 */
  1085. {QMI_FIXED_INTF(0x1435, 0xd182, 5)}, /* Wistron NeWeb D18 */
  1086. {QMI_FIXED_INTF(0x1435, 0xd191, 4)}, /* Wistron NeWeb D19Q1 */
  1087. {QMI_QUIRK_SET_DTR(0x1508, 0x1001, 4)}, /* Fibocom NL668 series */
  1088. {QMI_FIXED_INTF(0x1690, 0x7588, 4)}, /* ASKEY WWHC050 */
  1089. {QMI_FIXED_INTF(0x16d8, 0x6003, 0)}, /* CMOTech 6003 */
  1090. {QMI_FIXED_INTF(0x16d8, 0x6007, 0)}, /* CMOTech CHE-628S */
  1091. {QMI_FIXED_INTF(0x16d8, 0x6008, 0)}, /* CMOTech CMU-301 */
  1092. {QMI_FIXED_INTF(0x16d8, 0x6280, 0)}, /* CMOTech CHU-628 */
  1093. {QMI_FIXED_INTF(0x16d8, 0x7001, 0)}, /* CMOTech CHU-720S */
  1094. {QMI_FIXED_INTF(0x16d8, 0x7002, 0)}, /* CMOTech 7002 */
  1095. {QMI_FIXED_INTF(0x16d8, 0x7003, 4)}, /* CMOTech CHU-629K */
  1096. {QMI_FIXED_INTF(0x16d8, 0x7004, 3)}, /* CMOTech 7004 */
  1097. {QMI_FIXED_INTF(0x16d8, 0x7006, 5)}, /* CMOTech CGU-629 */
  1098. {QMI_FIXED_INTF(0x16d8, 0x700a, 4)}, /* CMOTech CHU-629S */
  1099. {QMI_FIXED_INTF(0x16d8, 0x7211, 0)}, /* CMOTech CHU-720I */
  1100. {QMI_FIXED_INTF(0x16d8, 0x7212, 0)}, /* CMOTech 7212 */
  1101. {QMI_FIXED_INTF(0x16d8, 0x7213, 0)}, /* CMOTech 7213 */
  1102. {QMI_FIXED_INTF(0x16d8, 0x7251, 1)}, /* CMOTech 7251 */
  1103. {QMI_FIXED_INTF(0x16d8, 0x7252, 1)}, /* CMOTech 7252 */
  1104. {QMI_FIXED_INTF(0x16d8, 0x7253, 1)}, /* CMOTech 7253 */
  1105. {QMI_FIXED_INTF(0x19d2, 0x0002, 1)},
  1106. {QMI_FIXED_INTF(0x19d2, 0x0012, 1)},
  1107. {QMI_FIXED_INTF(0x19d2, 0x0017, 3)},
  1108. {QMI_FIXED_INTF(0x19d2, 0x0019, 3)}, /* ONDA MT689DC */
  1109. {QMI_FIXED_INTF(0x19d2, 0x0021, 4)},
  1110. {QMI_FIXED_INTF(0x19d2, 0x0025, 1)},
  1111. {QMI_FIXED_INTF(0x19d2, 0x0031, 4)},
  1112. {QMI_FIXED_INTF(0x19d2, 0x0042, 4)},
  1113. {QMI_FIXED_INTF(0x19d2, 0x0049, 5)},
  1114. {QMI_FIXED_INTF(0x19d2, 0x0052, 4)},
  1115. {QMI_FIXED_INTF(0x19d2, 0x0055, 1)}, /* ZTE (Vodafone) K3520-Z */
  1116. {QMI_FIXED_INTF(0x19d2, 0x0058, 4)},
  1117. {QMI_FIXED_INTF(0x19d2, 0x0063, 4)}, /* ZTE (Vodafone) K3565-Z */
  1118. {QMI_FIXED_INTF(0x19d2, 0x0104, 4)}, /* ZTE (Vodafone) K4505-Z */
  1119. {QMI_FIXED_INTF(0x19d2, 0x0113, 5)},
  1120. {QMI_FIXED_INTF(0x19d2, 0x0118, 5)},
  1121. {QMI_FIXED_INTF(0x19d2, 0x0121, 5)},
  1122. {QMI_FIXED_INTF(0x19d2, 0x0123, 4)},
  1123. {QMI_FIXED_INTF(0x19d2, 0x0124, 5)},
  1124. {QMI_FIXED_INTF(0x19d2, 0x0125, 6)},
  1125. {QMI_FIXED_INTF(0x19d2, 0x0126, 5)},
  1126. {QMI_FIXED_INTF(0x19d2, 0x0130, 1)},
  1127. {QMI_FIXED_INTF(0x19d2, 0x0133, 3)},
  1128. {QMI_FIXED_INTF(0x19d2, 0x0141, 5)},
  1129. {QMI_FIXED_INTF(0x19d2, 0x0157, 5)}, /* ZTE MF683 */
  1130. {QMI_FIXED_INTF(0x19d2, 0x0158, 3)},
  1131. {QMI_FIXED_INTF(0x19d2, 0x0167, 4)}, /* ZTE MF820D */
  1132. {QMI_FIXED_INTF(0x19d2, 0x0168, 4)},
  1133. {QMI_FIXED_INTF(0x19d2, 0x0176, 3)},
  1134. {QMI_FIXED_INTF(0x19d2, 0x0178, 3)},
  1135. {QMI_FIXED_INTF(0x19d2, 0x0189, 4)}, /* ZTE MF290 */
  1136. {QMI_FIXED_INTF(0x19d2, 0x0191, 4)}, /* ZTE EuFi890 */
  1137. {QMI_FIXED_INTF(0x19d2, 0x0199, 1)}, /* ZTE MF820S */
  1138. {QMI_FIXED_INTF(0x19d2, 0x0200, 1)},
  1139. {QMI_FIXED_INTF(0x19d2, 0x0257, 3)}, /* ZTE MF821 */
  1140. {QMI_FIXED_INTF(0x19d2, 0x0265, 4)}, /* ONDA MT8205 4G LTE */
  1141. {QMI_FIXED_INTF(0x19d2, 0x0284, 4)}, /* ZTE MF880 */
  1142. {QMI_FIXED_INTF(0x19d2, 0x0326, 4)}, /* ZTE MF821D */
  1143. {QMI_FIXED_INTF(0x19d2, 0x0396, 3)}, /* ZTE ZM8620 */
  1144. {QMI_FIXED_INTF(0x19d2, 0x0412, 4)}, /* Telewell TW-LTE 4G */
  1145. {QMI_FIXED_INTF(0x19d2, 0x1008, 4)}, /* ZTE (Vodafone) K3570-Z */
  1146. {QMI_FIXED_INTF(0x19d2, 0x1010, 4)}, /* ZTE (Vodafone) K3571-Z */
  1147. {QMI_FIXED_INTF(0x19d2, 0x1012, 4)},
  1148. {QMI_FIXED_INTF(0x19d2, 0x1018, 3)}, /* ZTE (Vodafone) K5006-Z */
  1149. {QMI_FIXED_INTF(0x19d2, 0x1021, 2)},
  1150. {QMI_FIXED_INTF(0x19d2, 0x1245, 4)},
  1151. {QMI_FIXED_INTF(0x19d2, 0x1247, 4)},
  1152. {QMI_FIXED_INTF(0x19d2, 0x1252, 4)},
  1153. {QMI_FIXED_INTF(0x19d2, 0x1254, 4)},
  1154. {QMI_FIXED_INTF(0x19d2, 0x1255, 3)},
  1155. {QMI_FIXED_INTF(0x19d2, 0x1255, 4)},
  1156. {QMI_FIXED_INTF(0x19d2, 0x1256, 4)},
  1157. {QMI_FIXED_INTF(0x19d2, 0x1270, 5)}, /* ZTE MF667 */
  1158. {QMI_FIXED_INTF(0x19d2, 0x1275, 3)}, /* ZTE P685M */
  1159. {QMI_FIXED_INTF(0x19d2, 0x1401, 2)},
  1160. {QMI_FIXED_INTF(0x19d2, 0x1402, 2)}, /* ZTE MF60 */
  1161. {QMI_FIXED_INTF(0x19d2, 0x1424, 2)},
  1162. {QMI_FIXED_INTF(0x19d2, 0x1425, 2)},
  1163. {QMI_FIXED_INTF(0x19d2, 0x1426, 2)}, /* ZTE MF91 */
  1164. {QMI_FIXED_INTF(0x19d2, 0x1428, 2)}, /* Telewell TW-LTE 4G v2 */
  1165. {QMI_FIXED_INTF(0x19d2, 0x1432, 3)}, /* ZTE ME3620 */
  1166. {QMI_FIXED_INTF(0x19d2, 0x1485, 5)}, /* ZTE MF286D */
  1167. {QMI_FIXED_INTF(0x19d2, 0x2002, 4)}, /* ZTE (Vodafone) K3765-Z */
  1168. {QMI_FIXED_INTF(0x2001, 0x7e16, 3)}, /* D-Link DWM-221 */
  1169. {QMI_FIXED_INTF(0x2001, 0x7e19, 4)}, /* D-Link DWM-221 B1 */
  1170. {QMI_FIXED_INTF(0x2001, 0x7e35, 4)}, /* D-Link DWM-222 */
  1171. {QMI_FIXED_INTF(0x2001, 0x7e3d, 4)}, /* D-Link DWM-222 A2 */
  1172. {QMI_FIXED_INTF(0x2020, 0x2031, 4)}, /* Olicard 600 */
  1173. {QMI_FIXED_INTF(0x2020, 0x2033, 4)}, /* BroadMobi BM806U */
  1174. {QMI_QUIRK_SET_DTR(0x2020, 0x2060, 4)}, /* BroadMobi BM818 */
  1175. {QMI_FIXED_INTF(0x0f3d, 0x68a2, 8)}, /* Sierra Wireless MC7700 */
  1176. {QMI_FIXED_INTF(0x114f, 0x68a2, 8)}, /* Sierra Wireless MC7750 */
  1177. {QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */
  1178. {QMI_FIXED_INTF(0x1199, 0x68a2, 19)}, /* Sierra Wireless MC7710 in QMI mode */
  1179. {QMI_QUIRK_SET_DTR(0x1199, 0x68c0, 8)}, /* Sierra Wireless MC7304/MC7354, WP76xx */
  1180. {QMI_QUIRK_SET_DTR(0x1199, 0x68c0, 10)},/* Sierra Wireless MC7304/MC7354 */
  1181. {QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */
  1182. {QMI_FIXED_INTF(0x1199, 0x901f, 8)}, /* Sierra Wireless EM7355 */
  1183. {QMI_FIXED_INTF(0x1199, 0x9041, 8)}, /* Sierra Wireless MC7305/MC7355 */
  1184. {QMI_FIXED_INTF(0x1199, 0x9041, 10)}, /* Sierra Wireless MC7305/MC7355 */
  1185. {QMI_FIXED_INTF(0x1199, 0x9051, 8)}, /* Netgear AirCard 340U */
  1186. {QMI_FIXED_INTF(0x1199, 0x9053, 8)}, /* Sierra Wireless Modem */
  1187. {QMI_FIXED_INTF(0x1199, 0x9054, 8)}, /* Sierra Wireless Modem */
  1188. {QMI_FIXED_INTF(0x1199, 0x9055, 8)}, /* Netgear AirCard 341U */
  1189. {QMI_FIXED_INTF(0x1199, 0x9056, 8)}, /* Sierra Wireless Modem */
  1190. {QMI_FIXED_INTF(0x1199, 0x9057, 8)},
  1191. {QMI_FIXED_INTF(0x1199, 0x9061, 8)}, /* Sierra Wireless Modem */
  1192. {QMI_FIXED_INTF(0x1199, 0x9063, 8)}, /* Sierra Wireless EM7305 */
  1193. {QMI_FIXED_INTF(0x1199, 0x9063, 10)}, /* Sierra Wireless EM7305 */
  1194. {QMI_QUIRK_SET_DTR(0x1199, 0x9071, 8)}, /* Sierra Wireless MC74xx */
  1195. {QMI_QUIRK_SET_DTR(0x1199, 0x9071, 10)},/* Sierra Wireless MC74xx */
  1196. {QMI_QUIRK_SET_DTR(0x1199, 0x9079, 8)}, /* Sierra Wireless EM74xx */
  1197. {QMI_QUIRK_SET_DTR(0x1199, 0x9079, 10)},/* Sierra Wireless EM74xx */
  1198. {QMI_QUIRK_SET_DTR(0x1199, 0x907b, 8)}, /* Sierra Wireless EM74xx */
  1199. {QMI_QUIRK_SET_DTR(0x1199, 0x907b, 10)},/* Sierra Wireless EM74xx */
  1200. {QMI_QUIRK_SET_DTR(0x1199, 0x9091, 8)}, /* Sierra Wireless EM7565 */
  1201. {QMI_QUIRK_SET_DTR(0x1199, 0xc081, 8)}, /* Sierra Wireless EM7590 */
  1202. {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */
  1203. {QMI_FIXED_INTF(0x1bbb, 0x0203, 2)}, /* Alcatel L800MA */
  1204. {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */
  1205. {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */
  1206. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1031, 3)}, /* Telit LE910C1-EUX */
  1207. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1034, 2)}, /* Telit LE910C4-WWX */
  1208. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1037, 4)}, /* Telit LE910C4-WWX */
  1209. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1038, 3)}, /* Telit LE910C4-WWX */
  1210. {QMI_QUIRK_SET_DTR(0x1bc7, 0x103a, 0)}, /* Telit LE910C4-WWX */
  1211. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1040, 2)}, /* Telit LE922A */
  1212. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1050, 2)}, /* Telit FN980 */
  1213. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1057, 2)}, /* Telit FN980 */
  1214. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1060, 2)}, /* Telit LN920 */
  1215. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1070, 2)}, /* Telit FN990A */
  1216. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1077, 2)}, /* Telit FN990A w/audio */
  1217. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1080, 2)}, /* Telit FE990A */
  1218. {QMI_QUIRK_SET_DTR(0x1bc7, 0x10a0, 0)}, /* Telit FN920C04 */
  1219. {QMI_QUIRK_SET_DTR(0x1bc7, 0x10a4, 0)}, /* Telit FN920C04 */
  1220. {QMI_QUIRK_SET_DTR(0x1bc7, 0x10a9, 0)}, /* Telit FN920C04 */
  1221. {QMI_QUIRK_SET_DTR(0x1bc7, 0x10b0, 0)}, /* Telit FE990B */
  1222. {QMI_QUIRK_SET_DTR(0x1bc7, 0x10c0, 0)}, /* Telit FE910C04 */
  1223. {QMI_QUIRK_SET_DTR(0x1bc7, 0x10c4, 0)}, /* Telit FE910C04 */
  1224. {QMI_QUIRK_SET_DTR(0x1bc7, 0x10c8, 0)}, /* Telit FE910C04 */
  1225. {QMI_QUIRK_SET_DTR(0x1bc7, 0x10d0, 0)}, /* Telit FN990B */
  1226. {QMI_FIXED_INTF(0x1bc7, 0x1100, 3)}, /* Telit ME910 */
  1227. {QMI_FIXED_INTF(0x1bc7, 0x1101, 3)}, /* Telit ME910 dual modem */
  1228. {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */
  1229. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1201, 2)}, /* Telit LE920, LE920A4 */
  1230. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1230, 2)}, /* Telit LE910Cx */
  1231. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1250, 0)}, /* Telit LE910Cx */
  1232. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1260, 2)}, /* Telit LE910Cx */
  1233. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1261, 2)}, /* Telit LE910Cx */
  1234. {QMI_QUIRK_SET_DTR(0x1bc7, 0x1900, 1)}, /* Telit LN940 series */
  1235. {QMI_QUIRK_SET_DTR(0x1bc7, 0x3000, 0)}, /* Telit FN912 series */
  1236. {QMI_QUIRK_SET_DTR(0x1bc7, 0x3001, 0)}, /* Telit FN912 series */
  1237. {QMI_FIXED_INTF(0x1c9e, 0x9801, 3)}, /* Telewell TW-3G HSPA+ */
  1238. {QMI_FIXED_INTF(0x1c9e, 0x9803, 4)}, /* Telewell TW-3G HSPA+ */
  1239. {QMI_FIXED_INTF(0x1c9e, 0x9b01, 3)}, /* XS Stick W100-2 from 4G Systems */
  1240. {QMI_QUIRK_SET_DTR(0x1c9e, 0x9b05, 4)}, /* Longsung U8300 */
  1241. {QMI_QUIRK_SET_DTR(0x1c9e, 0x9b3c, 4)}, /* Longsung U9300 */
  1242. {QMI_FIXED_INTF(0x0b3c, 0xc000, 4)}, /* Olivetti Olicard 100 */
  1243. {QMI_FIXED_INTF(0x0b3c, 0xc001, 4)}, /* Olivetti Olicard 120 */
  1244. {QMI_FIXED_INTF(0x0b3c, 0xc002, 4)}, /* Olivetti Olicard 140 */
  1245. {QMI_FIXED_INTF(0x0b3c, 0xc004, 6)}, /* Olivetti Olicard 155 */
  1246. {QMI_FIXED_INTF(0x0b3c, 0xc005, 6)}, /* Olivetti Olicard 200 */
  1247. {QMI_FIXED_INTF(0x0b3c, 0xc00a, 6)}, /* Olivetti Olicard 160 */
  1248. {QMI_FIXED_INTF(0x0b3c, 0xc00b, 4)}, /* Olivetti Olicard 500 */
  1249. {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)}, /* Cinterion PLxx */
  1250. {QMI_QUIRK_SET_DTR(0x1e2d, 0x006f, 8)}, /* Cinterion PLS83/PLS63 */
  1251. {QMI_FIXED_INTF(0x1e2d, 0x0053, 4)}, /* Cinterion PHxx,PXxx */
  1252. {QMI_FIXED_INTF(0x1e2d, 0x0063, 10)}, /* Cinterion ALASxx (1 RmNet) */
  1253. {QMI_FIXED_INTF(0x1e2d, 0x0082, 4)}, /* Cinterion PHxx,PXxx (2 RmNet) */
  1254. {QMI_FIXED_INTF(0x1e2d, 0x0082, 5)}, /* Cinterion PHxx,PXxx (2 RmNet) */
  1255. {QMI_FIXED_INTF(0x1e2d, 0x0083, 4)}, /* Cinterion PHxx,PXxx (1 RmNet + USB Audio)*/
  1256. {QMI_QUIRK_SET_DTR(0x1e2d, 0x00b0, 4)}, /* Cinterion CLS8 */
  1257. {QMI_FIXED_INTF(0x1e2d, 0x00b7, 0)}, /* Cinterion MV31 RmNet */
  1258. {QMI_FIXED_INTF(0x1e2d, 0x00b9, 0)}, /* Cinterion MV31 RmNet based on new baseline */
  1259. {QMI_FIXED_INTF(0x1e2d, 0x00f3, 0)}, /* Cinterion MV32-W-A RmNet */
  1260. {QMI_FIXED_INTF(0x1e2d, 0x00f4, 0)}, /* Cinterion MV32-W-B RmNet */
  1261. {QMI_FIXED_INTF(0x413c, 0x81a2, 8)}, /* Dell Wireless 5806 Gobi(TM) 4G LTE Mobile Broadband Card */
  1262. {QMI_FIXED_INTF(0x413c, 0x81a3, 8)}, /* Dell Wireless 5570 HSPA+ (42Mbps) Mobile Broadband Card */
  1263. {QMI_FIXED_INTF(0x413c, 0x81a4, 8)}, /* Dell Wireless 5570e HSPA+ (42Mbps) Mobile Broadband Card */
  1264. {QMI_FIXED_INTF(0x413c, 0x81a8, 8)}, /* Dell Wireless 5808 Gobi(TM) 4G LTE Mobile Broadband Card */
  1265. {QMI_FIXED_INTF(0x413c, 0x81a9, 8)}, /* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card */
  1266. {QMI_FIXED_INTF(0x413c, 0x81b1, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card */
  1267. {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
  1268. {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */
  1269. {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */
  1270. {QMI_FIXED_INTF(0x413c, 0x81c2, 8)}, /* Dell Wireless 5811e */
  1271. {QMI_FIXED_INTF(0x413c, 0x81cc, 8)}, /* Dell Wireless 5816e */
  1272. {QMI_FIXED_INTF(0x413c, 0x81d7, 0)}, /* Dell Wireless 5821e */
  1273. {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e preproduction config */
  1274. {QMI_FIXED_INTF(0x413c, 0x81e0, 0)}, /* Dell Wireless 5821e with eSIM support*/
  1275. {QMI_FIXED_INTF(0x413c, 0x81e4, 0)}, /* Dell Wireless 5829e with eSIM support*/
  1276. {QMI_FIXED_INTF(0x413c, 0x81e6, 0)}, /* Dell Wireless 5829e */
  1277. {QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */
  1278. {QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */
  1279. {QMI_QUIRK_SET_DTR(0x22de, 0x9051, 2)}, /* Hucom Wireless HM-211S/K */
  1280. {QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */
  1281. {QMI_QUIRK_SET_DTR(0x1e0e, 0x9001, 5)}, /* SIMCom 7100E, 7230E, 7600E ++ */
  1282. {QMI_QUIRK_SET_DTR(0x1e0e, 0x9071, 3)}, /* SIMCom 8230C ++ */
  1283. {QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */
  1284. {QMI_QUIRK_SET_DTR(0x2c7c, 0x0191, 4)}, /* Quectel EG91 */
  1285. {QMI_QUIRK_SET_DTR(0x2c7c, 0x0195, 4)}, /* Quectel EG95 */
  1286. {QMI_FIXED_INTF(0x2c7c, 0x0296, 4)}, /* Quectel BG96 */
  1287. {QMI_QUIRK_SET_DTR(0x2c7c, 0x030e, 4)}, /* Quectel EM05GV2 */
  1288. {QMI_QUIRK_SET_DTR(0x2cb7, 0x0104, 4)}, /* Fibocom NL678 series */
  1289. {QMI_QUIRK_SET_DTR(0x2cb7, 0x0112, 0)}, /* Fibocom FG132 */
  1290. {QMI_FIXED_INTF(0x0489, 0xe0b4, 0)}, /* Foxconn T77W968 LTE */
  1291. {QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/
  1292. {QMI_FIXED_INTF(0x2692, 0x9025, 4)}, /* Cellient MPL200 (rebranded Qualcomm 05c6:9025) */
  1293. {QMI_QUIRK_SET_DTR(0x1546, 0x1312, 4)}, /* u-blox LARA-R6 01B */
  1294. {QMI_QUIRK_SET_DTR(0x1546, 0x1342, 4)}, /* u-blox LARA-L6 */
  1295. {QMI_QUIRK_SET_DTR(0x33f8, 0x0104, 4)}, /* Rolling RW101 RMNET */
  1296. {QMI_FIXED_INTF(0x2dee, 0x4d22, 5)}, /* MeiG Smart SRM825L */
  1297. /* 4. Gobi 1000 devices */
  1298. {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */
  1299. {QMI_GOBI1K_DEVICE(0x03f0, 0x1f1d)}, /* HP un2400 Gobi Modem Device */
  1300. {QMI_GOBI1K_DEVICE(0x04da, 0x250d)}, /* Panasonic Gobi Modem device */
  1301. {QMI_GOBI1K_DEVICE(0x413c, 0x8172)}, /* Dell Gobi Modem device */
  1302. {QMI_GOBI1K_DEVICE(0x1410, 0xa001)}, /* Novatel/Verizon USB-1000 */
  1303. {QMI_GOBI1K_DEVICE(0x1410, 0xa002)}, /* Novatel Gobi Modem device */
  1304. {QMI_GOBI1K_DEVICE(0x1410, 0xa003)}, /* Novatel Gobi Modem device */
  1305. {QMI_GOBI1K_DEVICE(0x1410, 0xa004)}, /* Novatel Gobi Modem device */
  1306. {QMI_GOBI1K_DEVICE(0x1410, 0xa005)}, /* Novatel Gobi Modem device */
  1307. {QMI_GOBI1K_DEVICE(0x1410, 0xa006)}, /* Novatel Gobi Modem device */
  1308. {QMI_GOBI1K_DEVICE(0x1410, 0xa007)}, /* Novatel Gobi Modem device */
  1309. {QMI_GOBI1K_DEVICE(0x0b05, 0x1776)}, /* Asus Gobi Modem device */
  1310. {QMI_GOBI1K_DEVICE(0x19d2, 0xfff3)}, /* ONDA Gobi Modem device */
  1311. {QMI_GOBI1K_DEVICE(0x05c6, 0x9001)}, /* Generic Gobi Modem device */
  1312. {QMI_GOBI1K_DEVICE(0x05c6, 0x9002)}, /* Generic Gobi Modem device */
  1313. {QMI_GOBI1K_DEVICE(0x05c6, 0x9202)}, /* Generic Gobi Modem device */
  1314. {QMI_GOBI1K_DEVICE(0x05c6, 0x9203)}, /* Generic Gobi Modem device */
  1315. {QMI_GOBI1K_DEVICE(0x05c6, 0x9222)}, /* Generic Gobi Modem device */
  1316. {QMI_GOBI1K_DEVICE(0x05c6, 0x9009)}, /* Generic Gobi Modem device */
  1317. /* 5. Gobi 2000 and 3000 devices */
  1318. {QMI_GOBI_DEVICE(0x413c, 0x8186)}, /* Dell Gobi 2000 Modem device (N0218, VU936) */
  1319. {QMI_GOBI_DEVICE(0x413c, 0x8194)}, /* Dell Gobi 3000 Composite */
  1320. {QMI_GOBI_DEVICE(0x05c6, 0x920b)}, /* Generic Gobi 2000 Modem device */
  1321. {QMI_GOBI_DEVICE(0x05c6, 0x9225)}, /* Sony Gobi 2000 Modem device (N0279, VU730) */
  1322. {QMI_GOBI_DEVICE(0x05c6, 0x9245)}, /* Samsung Gobi 2000 Modem device (VL176) */
  1323. {QMI_GOBI_DEVICE(0x03f0, 0x251d)}, /* HP Gobi 2000 Modem device (VP412) */
  1324. {QMI_GOBI_DEVICE(0x05c6, 0x9215)}, /* Acer Gobi 2000 Modem device (VP413) */
  1325. {QMI_FIXED_INTF(0x05c6, 0x9215, 4)}, /* Quectel EC20 Mini PCIe */
  1326. {QMI_GOBI_DEVICE(0x05c6, 0x9265)}, /* Asus Gobi 2000 Modem device (VR305) */
  1327. {QMI_GOBI_DEVICE(0x05c6, 0x9235)}, /* Top Global Gobi 2000 Modem device (VR306) */
  1328. {QMI_GOBI_DEVICE(0x05c6, 0x9275)}, /* iRex Technologies Gobi 2000 Modem device (VR307) */
  1329. {QMI_GOBI_DEVICE(0x0af0, 0x8120)}, /* Option GTM681W */
  1330. {QMI_GOBI_DEVICE(0x1199, 0x68a5)}, /* Sierra Wireless Modem */
  1331. {QMI_GOBI_DEVICE(0x1199, 0x68a9)}, /* Sierra Wireless Modem */
  1332. {QMI_GOBI_DEVICE(0x1199, 0x9001)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  1333. {QMI_GOBI_DEVICE(0x1199, 0x9002)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  1334. {QMI_GOBI_DEVICE(0x1199, 0x9003)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  1335. {QMI_GOBI_DEVICE(0x1199, 0x9004)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  1336. {QMI_GOBI_DEVICE(0x1199, 0x9005)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  1337. {QMI_GOBI_DEVICE(0x1199, 0x9006)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  1338. {QMI_GOBI_DEVICE(0x1199, 0x9007)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  1339. {QMI_GOBI_DEVICE(0x1199, 0x9008)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  1340. {QMI_GOBI_DEVICE(0x1199, 0x9009)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  1341. {QMI_GOBI_DEVICE(0x1199, 0x900a)}, /* Sierra Wireless Gobi 2000 Modem device (VT773) */
  1342. {QMI_GOBI_DEVICE(0x1199, 0x9011)}, /* Sierra Wireless Gobi 2000 Modem device (MC8305) */
  1343. {QMI_GOBI_DEVICE(0x16d8, 0x8002)}, /* CMDTech Gobi 2000 Modem device (VU922) */
  1344. {QMI_GOBI_DEVICE(0x05c6, 0x9205)}, /* Gobi 2000 Modem device */
  1345. {QMI_GOBI_DEVICE(0x1199, 0x9013)}, /* Sierra Wireless Gobi 3000 Modem device (MC8355) */
  1346. {QMI_GOBI_DEVICE(0x03f0, 0x371d)}, /* HP un2430 Mobile Broadband Module */
  1347. {QMI_GOBI_DEVICE(0x1199, 0x9015)}, /* Sierra Wireless Gobi 3000 Modem device */
  1348. {QMI_GOBI_DEVICE(0x1199, 0x9019)}, /* Sierra Wireless Gobi 3000 Modem device */
  1349. {QMI_GOBI_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */
  1350. {QMI_GOBI_DEVICE(0x12d1, 0x14f1)}, /* Sony Gobi 3000 Composite */
  1351. {QMI_GOBI_DEVICE(0x1410, 0xa021)}, /* Foxconn Gobi 3000 Modem device (Novatel E396) */
  1352. { } /* END */
  1353. };
  1354. MODULE_DEVICE_TABLE(usb, products);
  1355. static bool quectel_ec20_detected(struct usb_interface *intf)
  1356. {
  1357. struct usb_device *dev = interface_to_usbdev(intf);
  1358. if (dev->actconfig &&
  1359. le16_to_cpu(dev->descriptor.idVendor) == 0x05c6 &&
  1360. le16_to_cpu(dev->descriptor.idProduct) == 0x9215 &&
  1361. dev->actconfig->desc.bNumInterfaces == 5)
  1362. return true;
  1363. return false;
  1364. }
  1365. static int qmi_wwan_probe(struct usb_interface *intf,
  1366. const struct usb_device_id *prod)
  1367. {
  1368. struct usb_device_id *id = (struct usb_device_id *)prod;
  1369. struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc;
  1370. /* Workaround to enable dynamic IDs. This disables usbnet
  1371. * blacklisting functionality. Which, if required, can be
  1372. * reimplemented here by using a magic "blacklist" value
  1373. * instead of 0 in the static device id table
  1374. */
  1375. if (!id->driver_info) {
  1376. dev_dbg(&intf->dev, "setting defaults for dynamic device id\n");
  1377. id->driver_info = (unsigned long)&qmi_wwan_info;
  1378. }
  1379. /* There are devices where the same interface number can be
  1380. * configured as different functions. We should only bind to
  1381. * vendor specific functions when matching on interface number
  1382. */
  1383. if (id->match_flags & USB_DEVICE_ID_MATCH_INT_NUMBER &&
  1384. desc->bInterfaceClass != USB_CLASS_VENDOR_SPEC) {
  1385. dev_dbg(&intf->dev,
  1386. "Rejecting interface number match for class %02x\n",
  1387. desc->bInterfaceClass);
  1388. return -ENODEV;
  1389. }
  1390. /* Quectel EC20 quirk where we've QMI on interface 4 instead of 0 */
  1391. if (quectel_ec20_detected(intf) && desc->bInterfaceNumber == 0) {
  1392. dev_dbg(&intf->dev, "Quectel EC20 quirk, skipping interface 0\n");
  1393. return -ENODEV;
  1394. }
  1395. /* Several Quectel modems supports dynamic interface configuration, so
  1396. * we need to match on class/subclass/protocol. These values are
  1397. * identical for the diagnostic- and QMI-interface, but bNumEndpoints is
  1398. * different. Ignore the current interface if the number of endpoints
  1399. * equals the number for the diag interface (two).
  1400. */
  1401. if (desc->bNumEndpoints == 2)
  1402. return -ENODEV;
  1403. return usbnet_probe(intf, id);
  1404. }
  1405. static void qmi_wwan_disconnect(struct usb_interface *intf)
  1406. {
  1407. struct usbnet *dev = usb_get_intfdata(intf);
  1408. struct qmi_wwan_state *info;
  1409. struct list_head *iter;
  1410. struct net_device *ldev;
  1411. LIST_HEAD(list);
  1412. /* called twice if separate control and data intf */
  1413. if (!dev)
  1414. return;
  1415. info = (void *)&dev->data;
  1416. if (info->flags & QMI_WWAN_FLAG_MUX) {
  1417. if (!rtnl_trylock()) {
  1418. restart_syscall();
  1419. return;
  1420. }
  1421. rcu_read_lock();
  1422. netdev_for_each_upper_dev_rcu(dev->net, ldev, iter)
  1423. qmimux_unregister_device(ldev, &list);
  1424. rcu_read_unlock();
  1425. unregister_netdevice_many(&list);
  1426. rtnl_unlock();
  1427. info->flags &= ~QMI_WWAN_FLAG_MUX;
  1428. }
  1429. usbnet_disconnect(intf);
  1430. }
  1431. static struct usb_driver qmi_wwan_driver = {
  1432. .name = "qmi_wwan",
  1433. .id_table = products,
  1434. .probe = qmi_wwan_probe,
  1435. .disconnect = qmi_wwan_disconnect,
  1436. .suspend = qmi_wwan_suspend,
  1437. .resume = qmi_wwan_resume,
  1438. .reset_resume = qmi_wwan_resume,
  1439. .supports_autosuspend = 1,
  1440. .disable_hub_initiated_lpm = 1,
  1441. };
  1442. module_usb_driver(qmi_wwan_driver);
  1443. MODULE_AUTHOR("Bjørn Mork <bjorn@mork.no>");
  1444. MODULE_DESCRIPTION("Qualcomm MSM Interface (QMI) WWAN driver");
  1445. MODULE_LICENSE("GPL");