cdc_ether.c 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072
  1. // SPDX-License-Identifier: GPL-2.0-or-later
  2. /*
  3. * CDC Ethernet based networking peripherals
  4. * Copyright (C) 2003-2005 by David Brownell
  5. * Copyright (C) 2006 by Ole Andre Vadla Ravnas (ActiveSync)
  6. */
  7. // #define DEBUG // error path messages, extra info
  8. // #define VERBOSE // more; success messages
  9. #include <linux/module.h>
  10. #include <linux/netdevice.h>
  11. #include <linux/etherdevice.h>
  12. #include <linux/ethtool.h>
  13. #include <linux/workqueue.h>
  14. #include <linux/mii.h>
  15. #include <linux/usb.h>
  16. #include <linux/usb/cdc.h>
  17. #include <linux/usb/usbnet.h>
  18. #if IS_ENABLED(CONFIG_USB_NET_RNDIS_HOST)
  19. static int is_rndis(struct usb_interface_descriptor *desc)
  20. {
  21. return (desc->bInterfaceClass == USB_CLASS_COMM &&
  22. desc->bInterfaceSubClass == 2 &&
  23. desc->bInterfaceProtocol == 0xff);
  24. }
  25. static int is_activesync(struct usb_interface_descriptor *desc)
  26. {
  27. return (desc->bInterfaceClass == USB_CLASS_MISC &&
  28. desc->bInterfaceSubClass == 1 &&
  29. desc->bInterfaceProtocol == 1);
  30. }
  31. static int is_wireless_rndis(struct usb_interface_descriptor *desc)
  32. {
  33. return (desc->bInterfaceClass == USB_CLASS_WIRELESS_CONTROLLER &&
  34. desc->bInterfaceSubClass == 1 &&
  35. desc->bInterfaceProtocol == 3);
  36. }
  37. static int is_novatel_rndis(struct usb_interface_descriptor *desc)
  38. {
  39. return (desc->bInterfaceClass == USB_CLASS_MISC &&
  40. desc->bInterfaceSubClass == 4 &&
  41. desc->bInterfaceProtocol == 1);
  42. }
  43. #else
  44. #define is_rndis(desc) 0
  45. #define is_activesync(desc) 0
  46. #define is_wireless_rndis(desc) 0
  47. #define is_novatel_rndis(desc) 0
  48. #endif
  49. static const u8 mbm_guid[16] = {
  50. 0xa3, 0x17, 0xa8, 0x8b, 0x04, 0x5e, 0x4f, 0x01,
  51. 0xa6, 0x07, 0xc0, 0xff, 0xcb, 0x7e, 0x39, 0x2a,
  52. };
  53. void usbnet_cdc_update_filter(struct usbnet *dev)
  54. {
  55. struct net_device *net = dev->net;
  56. u16 cdc_filter = USB_CDC_PACKET_TYPE_DIRECTED
  57. | USB_CDC_PACKET_TYPE_BROADCAST;
  58. /* filtering on the device is an optional feature and not worth
  59. * the hassle so we just roughly care about snooping and if any
  60. * multicast is requested, we take every multicast
  61. */
  62. if (net->flags & IFF_PROMISC)
  63. cdc_filter |= USB_CDC_PACKET_TYPE_PROMISCUOUS;
  64. if (!netdev_mc_empty(net) || (net->flags & IFF_ALLMULTI))
  65. cdc_filter |= USB_CDC_PACKET_TYPE_ALL_MULTICAST;
  66. usb_control_msg(dev->udev,
  67. usb_sndctrlpipe(dev->udev, 0),
  68. USB_CDC_SET_ETHERNET_PACKET_FILTER,
  69. USB_TYPE_CLASS | USB_RECIP_INTERFACE,
  70. cdc_filter,
  71. dev->intf->cur_altsetting->desc.bInterfaceNumber,
  72. NULL,
  73. 0,
  74. USB_CTRL_SET_TIMEOUT
  75. );
  76. }
  77. EXPORT_SYMBOL_GPL(usbnet_cdc_update_filter);
  78. /* We need to override usbnet_*_link_ksettings in bind() */
  79. static const struct ethtool_ops cdc_ether_ethtool_ops = {
  80. .get_link = usbnet_get_link,
  81. .nway_reset = usbnet_nway_reset,
  82. .get_drvinfo = usbnet_get_drvinfo,
  83. .get_msglevel = usbnet_get_msglevel,
  84. .set_msglevel = usbnet_set_msglevel,
  85. .get_ts_info = ethtool_op_get_ts_info,
  86. .get_link_ksettings = usbnet_get_link_ksettings_internal,
  87. .set_link_ksettings = NULL,
  88. };
  89. /* probes control interface, claims data interface, collects the bulk
  90. * endpoints, activates data interface (if needed), maybe sets MTU.
  91. * all pure cdc, except for certain firmware workarounds, and knowing
  92. * that rndis uses one different rule.
  93. */
  94. int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
  95. {
  96. u8 *buf = intf->cur_altsetting->extra;
  97. int len = intf->cur_altsetting->extralen;
  98. struct usb_interface_descriptor *d;
  99. struct cdc_state *info = (void *) &dev->data;
  100. int status;
  101. int rndis;
  102. bool android_rndis_quirk = false;
  103. struct usb_driver *driver = driver_of(intf);
  104. struct usb_cdc_parsed_header header;
  105. if (sizeof(dev->data) < sizeof(*info))
  106. return -EDOM;
  107. /* expect strict spec conformance for the descriptors, but
  108. * cope with firmware which stores them in the wrong place
  109. */
  110. if (len == 0 && dev->udev->actconfig->extralen) {
  111. /* Motorola SB4100 (and others: Brad Hards says it's
  112. * from a Broadcom design) put CDC descriptors here
  113. */
  114. buf = dev->udev->actconfig->extra;
  115. len = dev->udev->actconfig->extralen;
  116. dev_dbg(&intf->dev, "CDC descriptors on config\n");
  117. }
  118. /* Maybe CDC descriptors are after the endpoint? This bug has
  119. * been seen on some 2Wire Inc RNDIS-ish products.
  120. */
  121. if (len == 0) {
  122. struct usb_host_endpoint *hep;
  123. hep = intf->cur_altsetting->endpoint;
  124. if (hep) {
  125. buf = hep->extra;
  126. len = hep->extralen;
  127. }
  128. if (len)
  129. dev_dbg(&intf->dev,
  130. "CDC descriptors on endpoint\n");
  131. }
  132. /* this assumes that if there's a non-RNDIS vendor variant
  133. * of cdc-acm, it'll fail RNDIS requests cleanly.
  134. */
  135. rndis = (is_rndis(&intf->cur_altsetting->desc) ||
  136. is_activesync(&intf->cur_altsetting->desc) ||
  137. is_wireless_rndis(&intf->cur_altsetting->desc) ||
  138. is_novatel_rndis(&intf->cur_altsetting->desc));
  139. memset(info, 0, sizeof(*info));
  140. info->control = intf;
  141. cdc_parse_cdc_header(&header, intf, buf, len);
  142. info->u = header.usb_cdc_union_desc;
  143. info->header = header.usb_cdc_header_desc;
  144. info->ether = header.usb_cdc_ether_desc;
  145. if (!info->u) {
  146. if (rndis)
  147. goto skip;
  148. else /* in that case a quirk is mandatory */
  149. goto bad_desc;
  150. }
  151. /* we need a master/control interface (what we're
  152. * probed with) and a slave/data interface; union
  153. * descriptors sort this all out.
  154. */
  155. info->control = usb_ifnum_to_if(dev->udev, info->u->bMasterInterface0);
  156. info->data = usb_ifnum_to_if(dev->udev, info->u->bSlaveInterface0);
  157. if (!info->control || !info->data) {
  158. dev_dbg(&intf->dev,
  159. "master #%u/%p slave #%u/%p\n",
  160. info->u->bMasterInterface0,
  161. info->control,
  162. info->u->bSlaveInterface0,
  163. info->data);
  164. /* fall back to hard-wiring for RNDIS */
  165. if (rndis) {
  166. android_rndis_quirk = true;
  167. goto skip;
  168. }
  169. goto bad_desc;
  170. }
  171. if (info->control != intf) {
  172. dev_dbg(&intf->dev, "bogus CDC Union\n");
  173. /* Ambit USB Cable Modem (and maybe others)
  174. * interchanges master and slave interface.
  175. */
  176. if (info->data == intf) {
  177. info->data = info->control;
  178. info->control = intf;
  179. } else
  180. goto bad_desc;
  181. }
  182. /* some devices merge these - skip class check */
  183. if (info->control == info->data)
  184. goto skip;
  185. /* a data interface altsetting does the real i/o */
  186. d = &info->data->cur_altsetting->desc;
  187. if (d->bInterfaceClass != USB_CLASS_CDC_DATA) {
  188. dev_dbg(&intf->dev, "slave class %u\n", d->bInterfaceClass);
  189. goto bad_desc;
  190. }
  191. skip:
  192. /* Communication class functions with bmCapabilities are not
  193. * RNDIS. But some Wireless class RNDIS functions use
  194. * bmCapabilities for their own purpose. The failsafe is
  195. * therefore applied only to Communication class RNDIS
  196. * functions. The rndis test is redundant, but a cheap
  197. * optimization.
  198. */
  199. if (rndis && is_rndis(&intf->cur_altsetting->desc) &&
  200. header.usb_cdc_acm_descriptor &&
  201. header.usb_cdc_acm_descriptor->bmCapabilities) {
  202. dev_dbg(&intf->dev,
  203. "ACM capabilities %02x, not really RNDIS?\n",
  204. header.usb_cdc_acm_descriptor->bmCapabilities);
  205. goto bad_desc;
  206. }
  207. if (header.usb_cdc_ether_desc && info->ether->wMaxSegmentSize) {
  208. dev->hard_mtu = le16_to_cpu(info->ether->wMaxSegmentSize);
  209. /* because of Zaurus, we may be ignoring the host
  210. * side link address we were given.
  211. */
  212. }
  213. if (header.usb_cdc_mdlm_desc &&
  214. memcmp(header.usb_cdc_mdlm_desc->bGUID, mbm_guid, 16)) {
  215. dev_dbg(&intf->dev, "GUID doesn't match\n");
  216. goto bad_desc;
  217. }
  218. if (header.usb_cdc_mdlm_detail_desc &&
  219. header.usb_cdc_mdlm_detail_desc->bLength <
  220. (sizeof(struct usb_cdc_mdlm_detail_desc) + 1)) {
  221. dev_dbg(&intf->dev, "Descriptor too short\n");
  222. goto bad_desc;
  223. }
  224. /* Microsoft ActiveSync based and some regular RNDIS devices lack the
  225. * CDC descriptors, so we'll hard-wire the interfaces and not check
  226. * for descriptors.
  227. *
  228. * Some Android RNDIS devices have a CDC Union descriptor pointing
  229. * to non-existing interfaces. Ignore that and attempt the same
  230. * hard-wired 0 and 1 interfaces.
  231. */
  232. if (rndis && (!info->u || android_rndis_quirk)) {
  233. info->control = usb_ifnum_to_if(dev->udev, 0);
  234. info->data = usb_ifnum_to_if(dev->udev, 1);
  235. if (!info->control || !info->data || info->control != intf) {
  236. dev_dbg(&intf->dev,
  237. "rndis: master #0/%p slave #1/%p\n",
  238. info->control,
  239. info->data);
  240. goto bad_desc;
  241. }
  242. } else if (!info->header || (!rndis && !info->ether)) {
  243. dev_dbg(&intf->dev, "missing cdc %s%s%sdescriptor\n",
  244. info->header ? "" : "header ",
  245. info->u ? "" : "union ",
  246. info->ether ? "" : "ether ");
  247. goto bad_desc;
  248. }
  249. /* claim data interface and set it up ... with side effects.
  250. * network traffic can't flow until an altsetting is enabled.
  251. */
  252. if (info->data != info->control) {
  253. status = usb_driver_claim_interface(driver, info->data, dev);
  254. if (status < 0)
  255. return status;
  256. }
  257. status = usbnet_get_endpoints(dev, info->data);
  258. if (status < 0) {
  259. /* ensure immediate exit from usbnet_disconnect */
  260. usb_set_intfdata(info->data, NULL);
  261. if (info->data != info->control)
  262. usb_driver_release_interface(driver, info->data);
  263. return status;
  264. }
  265. /* status endpoint: optional for CDC Ethernet, not RNDIS (or ACM) */
  266. if (info->data != info->control)
  267. dev->status = NULL;
  268. if (info->control->cur_altsetting->desc.bNumEndpoints == 1) {
  269. struct usb_endpoint_descriptor *desc;
  270. dev->status = &info->control->cur_altsetting->endpoint[0];
  271. desc = &dev->status->desc;
  272. if (!usb_endpoint_is_int_in(desc) ||
  273. (le16_to_cpu(desc->wMaxPacketSize)
  274. < sizeof(struct usb_cdc_notification)) ||
  275. !desc->bInterval) {
  276. dev_dbg(&intf->dev, "bad notification endpoint\n");
  277. dev->status = NULL;
  278. }
  279. }
  280. if (rndis && !dev->status) {
  281. dev_dbg(&intf->dev, "missing RNDIS status endpoint\n");
  282. usb_set_intfdata(info->data, NULL);
  283. usb_driver_release_interface(driver, info->data);
  284. return -ENODEV;
  285. }
  286. /* override ethtool_ops */
  287. dev->net->ethtool_ops = &cdc_ether_ethtool_ops;
  288. return 0;
  289. bad_desc:
  290. dev_info(&dev->udev->dev, "bad CDC descriptors\n");
  291. return -ENODEV;
  292. }
  293. EXPORT_SYMBOL_GPL(usbnet_generic_cdc_bind);
  294. /* like usbnet_generic_cdc_bind() but handles filter initialization
  295. * correctly
  296. */
  297. int usbnet_ether_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
  298. {
  299. int rv;
  300. rv = usbnet_generic_cdc_bind(dev, intf);
  301. if (rv < 0)
  302. goto bail_out;
  303. /* Some devices don't initialise properly. In particular
  304. * the packet filter is not reset. There are devices that
  305. * don't do reset all the way. So the packet filter should
  306. * be set to a sane initial value.
  307. */
  308. usbnet_cdc_update_filter(dev);
  309. bail_out:
  310. return rv;
  311. }
  312. EXPORT_SYMBOL_GPL(usbnet_ether_cdc_bind);
  313. void usbnet_cdc_unbind(struct usbnet *dev, struct usb_interface *intf)
  314. {
  315. struct cdc_state *info = (void *) &dev->data;
  316. struct usb_driver *driver = driver_of(intf);
  317. /* combined interface - nothing to do */
  318. if (info->data == info->control)
  319. return;
  320. /* disconnect master --> disconnect slave */
  321. if (intf == info->control && info->data) {
  322. /* ensure immediate exit from usbnet_disconnect */
  323. usb_set_intfdata(info->data, NULL);
  324. usb_driver_release_interface(driver, info->data);
  325. info->data = NULL;
  326. }
  327. /* and vice versa (just in case) */
  328. else if (intf == info->data && info->control) {
  329. /* ensure immediate exit from usbnet_disconnect */
  330. usb_set_intfdata(info->control, NULL);
  331. usb_driver_release_interface(driver, info->control);
  332. info->control = NULL;
  333. }
  334. }
  335. EXPORT_SYMBOL_GPL(usbnet_cdc_unbind);
  336. /* Communications Device Class, Ethernet Control model
  337. *
  338. * Takes two interfaces. The DATA interface is inactive till an altsetting
  339. * is selected. Configuration data includes class descriptors. There's
  340. * an optional status endpoint on the control interface.
  341. *
  342. * This should interop with whatever the 2.4 "CDCEther.c" driver
  343. * (by Brad Hards) talked with, with more functionality.
  344. */
  345. static void speed_change(struct usbnet *dev, __le32 *speeds)
  346. {
  347. dev->tx_speed = __le32_to_cpu(speeds[0]);
  348. dev->rx_speed = __le32_to_cpu(speeds[1]);
  349. }
  350. void usbnet_cdc_status(struct usbnet *dev, struct urb *urb)
  351. {
  352. struct usb_cdc_notification *event;
  353. if (urb->actual_length < sizeof(*event))
  354. return;
  355. /* SPEED_CHANGE can get split into two 8-byte packets */
  356. if (test_and_clear_bit(EVENT_STS_SPLIT, &dev->flags)) {
  357. speed_change(dev, (__le32 *) urb->transfer_buffer);
  358. return;
  359. }
  360. event = urb->transfer_buffer;
  361. switch (event->bNotificationType) {
  362. case USB_CDC_NOTIFY_NETWORK_CONNECTION:
  363. netif_dbg(dev, timer, dev->net, "CDC: carrier %s\n",
  364. event->wValue ? "on" : "off");
  365. usbnet_link_change(dev, !!event->wValue, 0);
  366. break;
  367. case USB_CDC_NOTIFY_SPEED_CHANGE: /* tx/rx rates */
  368. netif_dbg(dev, timer, dev->net, "CDC: speed change (len %d)\n",
  369. urb->actual_length);
  370. if (urb->actual_length != (sizeof(*event) + 8))
  371. set_bit(EVENT_STS_SPLIT, &dev->flags);
  372. else
  373. speed_change(dev, (__le32 *) &event[1]);
  374. break;
  375. /* USB_CDC_NOTIFY_RESPONSE_AVAILABLE can happen too (e.g. RNDIS),
  376. * but there are no standard formats for the response data.
  377. */
  378. default:
  379. netdev_err(dev->net, "CDC: unexpected notification %02x!\n",
  380. event->bNotificationType);
  381. break;
  382. }
  383. }
  384. EXPORT_SYMBOL_GPL(usbnet_cdc_status);
  385. int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
  386. {
  387. int status;
  388. struct cdc_state *info = (void *) &dev->data;
  389. BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data)
  390. < sizeof(struct cdc_state)));
  391. status = usbnet_ether_cdc_bind(dev, intf);
  392. if (status < 0)
  393. return status;
  394. status = usbnet_get_ethernet_addr(dev, info->ether->iMACAddress);
  395. if (status < 0) {
  396. usb_set_intfdata(info->data, NULL);
  397. usb_driver_release_interface(driver_of(intf), info->data);
  398. return status;
  399. }
  400. return 0;
  401. }
  402. EXPORT_SYMBOL_GPL(usbnet_cdc_bind);
  403. static int usbnet_cdc_zte_bind(struct usbnet *dev, struct usb_interface *intf)
  404. {
  405. int status = usbnet_cdc_bind(dev, intf);
  406. if (!status && (dev->net->dev_addr[0] & 0x02))
  407. eth_hw_addr_random(dev->net);
  408. return status;
  409. }
  410. /* Make sure packets have correct destination MAC address
  411. *
  412. * A firmware bug observed on some devices (ZTE MF823/831/910) is that the
  413. * device sends packets with a static, bogus, random MAC address (event if
  414. * device MAC address has been updated). Always set MAC address to that of the
  415. * device.
  416. */
  417. int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
  418. {
  419. if (skb->len < ETH_HLEN || !(skb->data[0] & 0x02))
  420. return 1;
  421. skb_reset_mac_header(skb);
  422. ether_addr_copy(eth_hdr(skb)->h_dest, dev->net->dev_addr);
  423. return 1;
  424. }
  425. EXPORT_SYMBOL_GPL(usbnet_cdc_zte_rx_fixup);
  426. /* Ensure correct link state
  427. *
  428. * Some devices (ZTE MF823/831/910) export two carrier on notifications when
  429. * connected. This causes the link state to be incorrect. Work around this by
  430. * always setting the state to off, then on.
  431. */
  432. static void usbnet_cdc_zte_status(struct usbnet *dev, struct urb *urb)
  433. {
  434. struct usb_cdc_notification *event;
  435. if (urb->actual_length < sizeof(*event))
  436. return;
  437. event = urb->transfer_buffer;
  438. if (event->bNotificationType != USB_CDC_NOTIFY_NETWORK_CONNECTION) {
  439. usbnet_cdc_status(dev, urb);
  440. return;
  441. }
  442. netif_dbg(dev, timer, dev->net, "CDC: carrier %s\n",
  443. event->wValue ? "on" : "off");
  444. if (event->wValue &&
  445. netif_carrier_ok(dev->net))
  446. netif_carrier_off(dev->net);
  447. usbnet_link_change(dev, !!event->wValue, 0);
  448. }
  449. static const struct driver_info cdc_info = {
  450. .description = "CDC Ethernet Device",
  451. .flags = FLAG_ETHER | FLAG_POINTTOPOINT,
  452. .bind = usbnet_cdc_bind,
  453. .unbind = usbnet_cdc_unbind,
  454. .status = usbnet_cdc_status,
  455. .set_rx_mode = usbnet_cdc_update_filter,
  456. .manage_power = usbnet_manage_power,
  457. };
  458. static const struct driver_info zte_cdc_info = {
  459. .description = "ZTE CDC Ethernet Device",
  460. .flags = FLAG_ETHER | FLAG_POINTTOPOINT,
  461. .bind = usbnet_cdc_zte_bind,
  462. .unbind = usbnet_cdc_unbind,
  463. .status = usbnet_cdc_zte_status,
  464. .set_rx_mode = usbnet_cdc_update_filter,
  465. .manage_power = usbnet_manage_power,
  466. .rx_fixup = usbnet_cdc_zte_rx_fixup,
  467. };
  468. static const struct driver_info wwan_info = {
  469. .description = "Mobile Broadband Network Device",
  470. .flags = FLAG_WWAN,
  471. .bind = usbnet_cdc_bind,
  472. .unbind = usbnet_cdc_unbind,
  473. .status = usbnet_cdc_status,
  474. .set_rx_mode = usbnet_cdc_update_filter,
  475. .manage_power = usbnet_manage_power,
  476. };
  477. /*-------------------------------------------------------------------------*/
  478. #define HUAWEI_VENDOR_ID 0x12D1
  479. #define NOVATEL_VENDOR_ID 0x1410
  480. #define ZTE_VENDOR_ID 0x19D2
  481. #define DELL_VENDOR_ID 0x413C
  482. #define REALTEK_VENDOR_ID 0x0bda
  483. #define SAMSUNG_VENDOR_ID 0x04e8
  484. #define LENOVO_VENDOR_ID 0x17ef
  485. #define LINKSYS_VENDOR_ID 0x13b1
  486. #define NVIDIA_VENDOR_ID 0x0955
  487. #define HP_VENDOR_ID 0x03f0
  488. #define MICROSOFT_VENDOR_ID 0x045e
  489. #define UBLOX_VENDOR_ID 0x1546
  490. #define TPLINK_VENDOR_ID 0x2357
  491. #define AQUANTIA_VENDOR_ID 0x2eca
  492. #define ASIX_VENDOR_ID 0x0b95
  493. static const struct usb_device_id products[] = {
  494. /* BLACKLIST !!
  495. *
  496. * First blacklist any products that are egregiously nonconformant
  497. * with the CDC Ethernet specs. Minor braindamage we cope with; when
  498. * they're not even trying, needing a separate driver is only the first
  499. * of the differences to show up.
  500. */
  501. #define ZAURUS_MASTER_INTERFACE \
  502. .bInterfaceClass = USB_CLASS_COMM, \
  503. .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \
  504. .bInterfaceProtocol = USB_CDC_PROTO_NONE
  505. #define ZAURUS_FAKE_INTERFACE \
  506. .bInterfaceClass = USB_CLASS_COMM, \
  507. .bInterfaceSubClass = USB_CDC_SUBCLASS_MDLM, \
  508. .bInterfaceProtocol = USB_CDC_PROTO_NONE
  509. /* SA-1100 based Sharp Zaurus ("collie"), or compatible;
  510. * wire-incompatible with true CDC Ethernet implementations.
  511. * (And, it seems, needlessly so...)
  512. */
  513. {
  514. .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
  515. | USB_DEVICE_ID_MATCH_DEVICE,
  516. .idVendor = 0x04DD,
  517. .idProduct = 0x8004,
  518. ZAURUS_MASTER_INTERFACE,
  519. .driver_info = 0,
  520. },
  521. /* PXA-25x based Sharp Zaurii. Note that it seems some of these
  522. * (later models especially) may have shipped only with firmware
  523. * advertising false "CDC MDLM" compatibility ... but we're not
  524. * clear which models did that, so for now let's assume the worst.
  525. */
  526. {
  527. .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
  528. | USB_DEVICE_ID_MATCH_DEVICE,
  529. .idVendor = 0x04DD,
  530. .idProduct = 0x8005, /* A-300 */
  531. ZAURUS_MASTER_INTERFACE,
  532. .driver_info = 0,
  533. }, {
  534. .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
  535. | USB_DEVICE_ID_MATCH_DEVICE,
  536. .idVendor = 0x04DD,
  537. .idProduct = 0x8005, /* A-300 */
  538. ZAURUS_FAKE_INTERFACE,
  539. .driver_info = 0,
  540. }, {
  541. .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
  542. | USB_DEVICE_ID_MATCH_DEVICE,
  543. .idVendor = 0x04DD,
  544. .idProduct = 0x8006, /* B-500/SL-5600 */
  545. ZAURUS_MASTER_INTERFACE,
  546. .driver_info = 0,
  547. }, {
  548. .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
  549. | USB_DEVICE_ID_MATCH_DEVICE,
  550. .idVendor = 0x04DD,
  551. .idProduct = 0x8006, /* B-500/SL-5600 */
  552. ZAURUS_FAKE_INTERFACE,
  553. .driver_info = 0,
  554. }, {
  555. .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
  556. | USB_DEVICE_ID_MATCH_DEVICE,
  557. .idVendor = 0x04DD,
  558. .idProduct = 0x8007, /* C-700 */
  559. ZAURUS_MASTER_INTERFACE,
  560. .driver_info = 0,
  561. }, {
  562. .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
  563. | USB_DEVICE_ID_MATCH_DEVICE,
  564. .idVendor = 0x04DD,
  565. .idProduct = 0x8007, /* C-700 */
  566. ZAURUS_FAKE_INTERFACE,
  567. .driver_info = 0,
  568. }, {
  569. .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
  570. | USB_DEVICE_ID_MATCH_DEVICE,
  571. .idVendor = 0x04DD,
  572. .idProduct = 0x9031, /* C-750 C-760 */
  573. ZAURUS_MASTER_INTERFACE,
  574. .driver_info = 0,
  575. }, {
  576. .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
  577. | USB_DEVICE_ID_MATCH_DEVICE,
  578. .idVendor = 0x04DD,
  579. .idProduct = 0x9032, /* SL-6000 */
  580. ZAURUS_MASTER_INTERFACE,
  581. .driver_info = 0,
  582. }, {
  583. .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
  584. | USB_DEVICE_ID_MATCH_DEVICE,
  585. .idVendor = 0x04DD,
  586. .idProduct = 0x9032, /* SL-6000 */
  587. ZAURUS_FAKE_INTERFACE,
  588. .driver_info = 0,
  589. }, {
  590. .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
  591. | USB_DEVICE_ID_MATCH_DEVICE,
  592. .idVendor = 0x04DD,
  593. /* reported with some C860 units */
  594. .idProduct = 0x9050, /* C-860 */
  595. ZAURUS_MASTER_INTERFACE,
  596. .driver_info = 0,
  597. },
  598. /* Olympus has some models with a Zaurus-compatible option.
  599. * R-1000 uses a FreeScale i.MXL cpu (ARMv4T)
  600. */
  601. {
  602. .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
  603. | USB_DEVICE_ID_MATCH_DEVICE,
  604. .idVendor = 0x07B4,
  605. .idProduct = 0x0F02, /* R-1000 */
  606. ZAURUS_MASTER_INTERFACE,
  607. .driver_info = 0,
  608. },
  609. /* LG Electronics VL600 wants additional headers on every frame */
  610. {
  611. USB_DEVICE_AND_INTERFACE_INFO(0x1004, 0x61aa, USB_CLASS_COMM,
  612. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  613. .driver_info = 0,
  614. },
  615. /* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */
  616. {
  617. USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM,
  618. USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
  619. .driver_info = 0,
  620. },
  621. /* Novatel USB551L and MC551 - handled by qmi_wwan */
  622. {
  623. USB_DEVICE_AND_INTERFACE_INFO(NOVATEL_VENDOR_ID, 0xB001, USB_CLASS_COMM,
  624. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  625. .driver_info = 0,
  626. },
  627. /* Novatel E362 - handled by qmi_wwan */
  628. {
  629. USB_DEVICE_AND_INTERFACE_INFO(NOVATEL_VENDOR_ID, 0x9010, USB_CLASS_COMM,
  630. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  631. .driver_info = 0,
  632. },
  633. /* Dell Wireless 5800 (Novatel E362) - handled by qmi_wwan */
  634. {
  635. USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x8195, USB_CLASS_COMM,
  636. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  637. .driver_info = 0,
  638. },
  639. /* Dell Wireless 5800 (Novatel E362) - handled by qmi_wwan */
  640. {
  641. USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x8196, USB_CLASS_COMM,
  642. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  643. .driver_info = 0,
  644. },
  645. /* Dell Wireless 5804 (Novatel E371) - handled by qmi_wwan */
  646. {
  647. USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x819b, USB_CLASS_COMM,
  648. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  649. .driver_info = 0,
  650. },
  651. /* Novatel Expedite E371 - handled by qmi_wwan */
  652. {
  653. USB_DEVICE_AND_INTERFACE_INFO(NOVATEL_VENDOR_ID, 0x9011, USB_CLASS_COMM,
  654. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  655. .driver_info = 0,
  656. },
  657. /* HP lt2523 (Novatel E371) - handled by qmi_wwan */
  658. {
  659. USB_DEVICE_AND_INTERFACE_INFO(HP_VENDOR_ID, 0x421d, USB_CLASS_COMM,
  660. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  661. .driver_info = 0,
  662. },
  663. /* AnyDATA ADU960S - handled by qmi_wwan */
  664. {
  665. USB_DEVICE_AND_INTERFACE_INFO(0x16d5, 0x650a, USB_CLASS_COMM,
  666. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  667. .driver_info = 0,
  668. },
  669. /* Huawei E1820 - handled by qmi_wwan */
  670. {
  671. USB_DEVICE_INTERFACE_NUMBER(HUAWEI_VENDOR_ID, 0x14ac, 1),
  672. .driver_info = 0,
  673. },
  674. /* Realtek RTL8152 Based USB 2.0 Ethernet Adapters */
  675. {
  676. USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM,
  677. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  678. .driver_info = 0,
  679. },
  680. /* Realtek RTL8153 Based USB 3.0 Ethernet Adapters */
  681. {
  682. USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM,
  683. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  684. .driver_info = 0,
  685. },
  686. /* Samsung USB Ethernet Adapters */
  687. {
  688. USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, 0xa101, USB_CLASS_COMM,
  689. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  690. .driver_info = 0,
  691. },
  692. #if IS_ENABLED(CONFIG_USB_RTL8152)
  693. /* Linksys USB3GIGV1 Ethernet Adapter */
  694. {
  695. USB_DEVICE_AND_INTERFACE_INFO(LINKSYS_VENDOR_ID, 0x0041, USB_CLASS_COMM,
  696. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  697. .driver_info = 0,
  698. },
  699. #endif
  700. /* Lenovo ThinkPad OneLink+ Dock (based on Realtek RTL8153) */
  701. {
  702. USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3054, USB_CLASS_COMM,
  703. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  704. .driver_info = 0,
  705. },
  706. /* ThinkPad USB-C Dock (based on Realtek RTL8153) */
  707. {
  708. USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3062, USB_CLASS_COMM,
  709. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  710. .driver_info = 0,
  711. },
  712. /* ThinkPad Thunderbolt 3 Dock (based on Realtek RTL8153) */
  713. {
  714. USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3069, USB_CLASS_COMM,
  715. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  716. .driver_info = 0,
  717. },
  718. /* ThinkPad Thunderbolt 3 Dock Gen 2 (based on Realtek RTL8153) */
  719. {
  720. USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3082, USB_CLASS_COMM,
  721. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  722. .driver_info = 0,
  723. },
  724. /* Lenovo Thinkpad USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */
  725. {
  726. USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x7205, USB_CLASS_COMM,
  727. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  728. .driver_info = 0,
  729. },
  730. /* Lenovo USB C to Ethernet Adapter (based on Realtek RTL8153) */
  731. {
  732. USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x720c, USB_CLASS_COMM,
  733. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  734. .driver_info = 0,
  735. },
  736. /* Lenovo USB-C Travel Hub (based on Realtek RTL8153) */
  737. {
  738. USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x7214, USB_CLASS_COMM,
  739. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  740. .driver_info = 0,
  741. },
  742. /* Lenovo Powered USB-C Travel Hub (4X90S92381, based on Realtek RTL8153) */
  743. {
  744. USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x721e, USB_CLASS_COMM,
  745. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  746. .driver_info = 0,
  747. },
  748. /* ThinkPad USB-C Dock Gen 2 (based on Realtek RTL8153) */
  749. {
  750. USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0xa387, USB_CLASS_COMM,
  751. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  752. .driver_info = 0,
  753. },
  754. /* NVIDIA Tegra USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */
  755. {
  756. USB_DEVICE_AND_INTERFACE_INFO(NVIDIA_VENDOR_ID, 0x09ff, USB_CLASS_COMM,
  757. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  758. .driver_info = 0,
  759. },
  760. /* Microsoft Surface 2 dock (based on Realtek RTL8152) */
  761. {
  762. USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07ab, USB_CLASS_COMM,
  763. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  764. .driver_info = 0,
  765. },
  766. /* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153) */
  767. {
  768. USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07c6, USB_CLASS_COMM,
  769. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  770. .driver_info = 0,
  771. },
  772. /* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153B) */
  773. {
  774. USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x0927, USB_CLASS_COMM,
  775. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  776. .driver_info = 0,
  777. },
  778. /* TP-LINK UE300 USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */
  779. {
  780. USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, 0x0601, USB_CLASS_COMM,
  781. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  782. .driver_info = 0,
  783. },
  784. /* Aquantia AQtion USB to 5GbE Controller (based on AQC111U) */
  785. {
  786. USB_DEVICE_AND_INTERFACE_INFO(AQUANTIA_VENDOR_ID, 0xc101,
  787. USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,
  788. USB_CDC_PROTO_NONE),
  789. .driver_info = 0,
  790. },
  791. /* ASIX USB 3.1 Gen1 to 5G Multi-Gigabit Ethernet Adapter(based on AQC111U) */
  792. {
  793. USB_DEVICE_AND_INTERFACE_INFO(ASIX_VENDOR_ID, 0x2790, USB_CLASS_COMM,
  794. USB_CDC_SUBCLASS_ETHERNET,
  795. USB_CDC_PROTO_NONE),
  796. .driver_info = 0,
  797. },
  798. /* ASIX USB 3.1 Gen1 to 2.5G Multi-Gigabit Ethernet Adapter(based on AQC112U) */
  799. {
  800. USB_DEVICE_AND_INTERFACE_INFO(ASIX_VENDOR_ID, 0x2791, USB_CLASS_COMM,
  801. USB_CDC_SUBCLASS_ETHERNET,
  802. USB_CDC_PROTO_NONE),
  803. .driver_info = 0,
  804. },
  805. /* USB-C 3.1 to 5GBASE-T Ethernet Adapter (based on AQC111U) */
  806. {
  807. USB_DEVICE_AND_INTERFACE_INFO(0x20f4, 0xe05a, USB_CLASS_COMM,
  808. USB_CDC_SUBCLASS_ETHERNET,
  809. USB_CDC_PROTO_NONE),
  810. .driver_info = 0,
  811. },
  812. /* QNAP QNA-UC5G1T USB to 5GbE Adapter (based on AQC111U) */
  813. {
  814. USB_DEVICE_AND_INTERFACE_INFO(0x1c04, 0x0015, USB_CLASS_COMM,
  815. USB_CDC_SUBCLASS_ETHERNET,
  816. USB_CDC_PROTO_NONE),
  817. .driver_info = 0,
  818. },
  819. /* WHITELIST!!!
  820. *
  821. * CDC Ether uses two interfaces, not necessarily consecutive.
  822. * We match the main interface, ignoring the optional device
  823. * class so we could handle devices that aren't exclusively
  824. * CDC ether.
  825. *
  826. * NOTE: this match must come AFTER entries blacklisting devices
  827. * because of bugs/quirks in a given product (like Zaurus, above).
  828. */
  829. {
  830. /* ZTE (Vodafone) K3805-Z */
  831. USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1003, USB_CLASS_COMM,
  832. USB_CDC_SUBCLASS_ETHERNET,
  833. USB_CDC_PROTO_NONE),
  834. .driver_info = (unsigned long)&wwan_info,
  835. }, {
  836. /* ZTE (Vodafone) K3806-Z */
  837. USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1015, USB_CLASS_COMM,
  838. USB_CDC_SUBCLASS_ETHERNET,
  839. USB_CDC_PROTO_NONE),
  840. .driver_info = (unsigned long)&wwan_info,
  841. }, {
  842. /* ZTE (Vodafone) K4510-Z */
  843. USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1173, USB_CLASS_COMM,
  844. USB_CDC_SUBCLASS_ETHERNET,
  845. USB_CDC_PROTO_NONE),
  846. .driver_info = (unsigned long)&wwan_info,
  847. }, {
  848. /* ZTE (Vodafone) K3770-Z */
  849. USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1177, USB_CLASS_COMM,
  850. USB_CDC_SUBCLASS_ETHERNET,
  851. USB_CDC_PROTO_NONE),
  852. .driver_info = (unsigned long)&wwan_info,
  853. }, {
  854. /* ZTE (Vodafone) K3772-Z */
  855. USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1181, USB_CLASS_COMM,
  856. USB_CDC_SUBCLASS_ETHERNET,
  857. USB_CDC_PROTO_NONE),
  858. .driver_info = (unsigned long)&wwan_info,
  859. }, {
  860. /* Telit modules */
  861. USB_VENDOR_AND_INTERFACE_INFO(0x1bc7, USB_CLASS_COMM,
  862. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  863. .driver_info = (kernel_ulong_t) &wwan_info,
  864. }, {
  865. /* Dell DW5580 modules */
  866. USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x81ba, USB_CLASS_COMM,
  867. USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
  868. .driver_info = (kernel_ulong_t)&wwan_info,
  869. }, {
  870. /* Huawei ME906 and ME909 */
  871. USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x15c1, USB_CLASS_COMM,
  872. USB_CDC_SUBCLASS_ETHERNET,
  873. USB_CDC_PROTO_NONE),
  874. .driver_info = (unsigned long)&wwan_info,
  875. }, {
  876. /* ZTE modules */
  877. USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, USB_CLASS_COMM,
  878. USB_CDC_SUBCLASS_ETHERNET,
  879. USB_CDC_PROTO_NONE),
  880. .driver_info = (unsigned long)&zte_cdc_info,
  881. }, {
  882. /* U-blox TOBY-L2 */
  883. USB_DEVICE_AND_INTERFACE_INFO(UBLOX_VENDOR_ID, 0x1143, USB_CLASS_COMM,
  884. USB_CDC_SUBCLASS_ETHERNET,
  885. USB_CDC_PROTO_NONE),
  886. .driver_info = (unsigned long)&wwan_info,
  887. }, {
  888. /* U-blox SARA-U2 */
  889. USB_DEVICE_AND_INTERFACE_INFO(UBLOX_VENDOR_ID, 0x1104, USB_CLASS_COMM,
  890. USB_CDC_SUBCLASS_ETHERNET,
  891. USB_CDC_PROTO_NONE),
  892. .driver_info = (unsigned long)&wwan_info,
  893. }, {
  894. /* Cinterion PLS8 modem by GEMALTO */
  895. USB_DEVICE_AND_INTERFACE_INFO(0x1e2d, 0x0061, USB_CLASS_COMM,
  896. USB_CDC_SUBCLASS_ETHERNET,
  897. USB_CDC_PROTO_NONE),
  898. .driver_info = (unsigned long)&wwan_info,
  899. }, {
  900. /* Cinterion AHS3 modem by GEMALTO */
  901. USB_DEVICE_AND_INTERFACE_INFO(0x1e2d, 0x0055, USB_CLASS_COMM,
  902. USB_CDC_SUBCLASS_ETHERNET,
  903. USB_CDC_PROTO_NONE),
  904. .driver_info = (unsigned long)&wwan_info,
  905. }, {
  906. /* Cinterion PLS62-W modem by GEMALTO/THALES */
  907. USB_DEVICE_AND_INTERFACE_INFO(0x1e2d, 0x005b, USB_CLASS_COMM,
  908. USB_CDC_SUBCLASS_ETHERNET,
  909. USB_CDC_PROTO_NONE),
  910. .driver_info = (unsigned long)&wwan_info,
  911. }, {
  912. /* Cinterion PLS83/PLS63 modem by GEMALTO/THALES */
  913. USB_DEVICE_AND_INTERFACE_INFO(0x1e2d, 0x0069, USB_CLASS_COMM,
  914. USB_CDC_SUBCLASS_ETHERNET,
  915. USB_CDC_PROTO_NONE),
  916. .driver_info = (unsigned long)&wwan_info,
  917. }, {
  918. USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,
  919. USB_CDC_PROTO_NONE),
  920. .driver_info = (unsigned long) &cdc_info,
  921. }, {
  922. USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM,
  923. USB_CDC_PROTO_NONE),
  924. .driver_info = (unsigned long)&wwan_info,
  925. }, {
  926. /* Various Huawei modems with a network port like the UMG1831 */
  927. USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_COMM,
  928. USB_CDC_SUBCLASS_ETHERNET, 255),
  929. .driver_info = (unsigned long)&wwan_info,
  930. },
  931. { }, /* END */
  932. };
  933. MODULE_DEVICE_TABLE(usb, products);
  934. static struct usb_driver cdc_driver = {
  935. .name = "cdc_ether",
  936. .id_table = products,
  937. .probe = usbnet_probe,
  938. .disconnect = usbnet_disconnect,
  939. .suspend = usbnet_suspend,
  940. .resume = usbnet_resume,
  941. .reset_resume = usbnet_resume,
  942. .supports_autosuspend = 1,
  943. .disable_hub_initiated_lpm = 1,
  944. };
  945. module_usb_driver(cdc_driver);
  946. MODULE_AUTHOR("David Brownell");
  947. MODULE_DESCRIPTION("USB CDC Ethernet devices");
  948. MODULE_LICENSE("GPL");