Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * CDC Ethernet based networking peripherals
0004  * Copyright (C) 2003-2005 by David Brownell
0005  * Copyright (C) 2006 by Ole Andre Vadla Ravnas (ActiveSync)
0006  */
0007 
0008 // #define  DEBUG           // error path messages, extra info
0009 // #define  VERBOSE         // more; success messages
0010 
0011 #include <linux/module.h>
0012 #include <linux/netdevice.h>
0013 #include <linux/etherdevice.h>
0014 #include <linux/ethtool.h>
0015 #include <linux/workqueue.h>
0016 #include <linux/mii.h>
0017 #include <linux/usb.h>
0018 #include <linux/usb/cdc.h>
0019 #include <linux/usb/usbnet.h>
0020 
0021 
0022 #if IS_ENABLED(CONFIG_USB_NET_RNDIS_HOST)
0023 
0024 static int is_rndis(struct usb_interface_descriptor *desc)
0025 {
0026     return (desc->bInterfaceClass == USB_CLASS_COMM &&
0027         desc->bInterfaceSubClass == 2 &&
0028         desc->bInterfaceProtocol == 0xff);
0029 }
0030 
0031 static int is_activesync(struct usb_interface_descriptor *desc)
0032 {
0033     return (desc->bInterfaceClass == USB_CLASS_MISC &&
0034         desc->bInterfaceSubClass == 1 &&
0035         desc->bInterfaceProtocol == 1);
0036 }
0037 
0038 static int is_wireless_rndis(struct usb_interface_descriptor *desc)
0039 {
0040     return (desc->bInterfaceClass == USB_CLASS_WIRELESS_CONTROLLER &&
0041         desc->bInterfaceSubClass == 1 &&
0042         desc->bInterfaceProtocol == 3);
0043 }
0044 
0045 static int is_novatel_rndis(struct usb_interface_descriptor *desc)
0046 {
0047     return (desc->bInterfaceClass == USB_CLASS_MISC &&
0048         desc->bInterfaceSubClass == 4 &&
0049         desc->bInterfaceProtocol == 1);
0050 }
0051 
0052 #else
0053 
0054 #define is_rndis(desc)      0
0055 #define is_activesync(desc) 0
0056 #define is_wireless_rndis(desc) 0
0057 #define is_novatel_rndis(desc)  0
0058 
0059 #endif
0060 
0061 static const u8 mbm_guid[16] = {
0062     0xa3, 0x17, 0xa8, 0x8b, 0x04, 0x5e, 0x4f, 0x01,
0063     0xa6, 0x07, 0xc0, 0xff, 0xcb, 0x7e, 0x39, 0x2a,
0064 };
0065 
0066 void usbnet_cdc_update_filter(struct usbnet *dev)
0067 {
0068     struct net_device   *net = dev->net;
0069 
0070     u16 cdc_filter = USB_CDC_PACKET_TYPE_DIRECTED
0071             | USB_CDC_PACKET_TYPE_BROADCAST;
0072 
0073     /* filtering on the device is an optional feature and not worth
0074      * the hassle so we just roughly care about snooping and if any
0075      * multicast is requested, we take every multicast
0076      */
0077     if (net->flags & IFF_PROMISC)
0078         cdc_filter |= USB_CDC_PACKET_TYPE_PROMISCUOUS;
0079     if (!netdev_mc_empty(net) || (net->flags & IFF_ALLMULTI))
0080         cdc_filter |= USB_CDC_PACKET_TYPE_ALL_MULTICAST;
0081 
0082     usb_control_msg(dev->udev,
0083             usb_sndctrlpipe(dev->udev, 0),
0084             USB_CDC_SET_ETHERNET_PACKET_FILTER,
0085             USB_TYPE_CLASS | USB_RECIP_INTERFACE,
0086             cdc_filter,
0087             dev->intf->cur_altsetting->desc.bInterfaceNumber,
0088             NULL,
0089             0,
0090             USB_CTRL_SET_TIMEOUT
0091         );
0092 }
0093 EXPORT_SYMBOL_GPL(usbnet_cdc_update_filter);
0094 
0095 /* We need to override usbnet_*_link_ksettings in bind() */
0096 static const struct ethtool_ops cdc_ether_ethtool_ops = {
0097     .get_link       = usbnet_get_link,
0098     .nway_reset     = usbnet_nway_reset,
0099     .get_drvinfo        = usbnet_get_drvinfo,
0100     .get_msglevel       = usbnet_get_msglevel,
0101     .set_msglevel       = usbnet_set_msglevel,
0102     .get_ts_info        = ethtool_op_get_ts_info,
0103     .get_link_ksettings = usbnet_get_link_ksettings_internal,
0104     .set_link_ksettings = NULL,
0105 };
0106 
0107 /* probes control interface, claims data interface, collects the bulk
0108  * endpoints, activates data interface (if needed), maybe sets MTU.
0109  * all pure cdc, except for certain firmware workarounds, and knowing
0110  * that rndis uses one different rule.
0111  */
0112 int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
0113 {
0114     u8              *buf = intf->cur_altsetting->extra;
0115     int             len = intf->cur_altsetting->extralen;
0116     struct usb_interface_descriptor *d;
0117     struct cdc_state        *info = (void *) &dev->data;
0118     int             status;
0119     int             rndis;
0120     bool                android_rndis_quirk = false;
0121     struct usb_driver       *driver = driver_of(intf);
0122     struct usb_cdc_parsed_header header;
0123 
0124     if (sizeof(dev->data) < sizeof(*info))
0125         return -EDOM;
0126 
0127     /* expect strict spec conformance for the descriptors, but
0128      * cope with firmware which stores them in the wrong place
0129      */
0130     if (len == 0 && dev->udev->actconfig->extralen) {
0131         /* Motorola SB4100 (and others: Brad Hards says it's
0132          * from a Broadcom design) put CDC descriptors here
0133          */
0134         buf = dev->udev->actconfig->extra;
0135         len = dev->udev->actconfig->extralen;
0136         dev_dbg(&intf->dev, "CDC descriptors on config\n");
0137     }
0138 
0139     /* Maybe CDC descriptors are after the endpoint?  This bug has
0140      * been seen on some 2Wire Inc RNDIS-ish products.
0141      */
0142     if (len == 0) {
0143         struct usb_host_endpoint    *hep;
0144 
0145         hep = intf->cur_altsetting->endpoint;
0146         if (hep) {
0147             buf = hep->extra;
0148             len = hep->extralen;
0149         }
0150         if (len)
0151             dev_dbg(&intf->dev,
0152                 "CDC descriptors on endpoint\n");
0153     }
0154 
0155     /* this assumes that if there's a non-RNDIS vendor variant
0156      * of cdc-acm, it'll fail RNDIS requests cleanly.
0157      */
0158     rndis = (is_rndis(&intf->cur_altsetting->desc) ||
0159          is_activesync(&intf->cur_altsetting->desc) ||
0160          is_wireless_rndis(&intf->cur_altsetting->desc) ||
0161          is_novatel_rndis(&intf->cur_altsetting->desc));
0162 
0163     memset(info, 0, sizeof(*info));
0164     info->control = intf;
0165 
0166     cdc_parse_cdc_header(&header, intf, buf, len);
0167 
0168     info->u = header.usb_cdc_union_desc;
0169     info->header = header.usb_cdc_header_desc;
0170     info->ether = header.usb_cdc_ether_desc;
0171     if (!info->u) {
0172         if (rndis)
0173             goto skip;
0174         else /* in that case a quirk is mandatory */
0175             goto bad_desc;
0176     }
0177     /* we need a master/control interface (what we're
0178      * probed with) and a slave/data interface; union
0179      * descriptors sort this all out.
0180      */
0181     info->control = usb_ifnum_to_if(dev->udev, info->u->bMasterInterface0);
0182     info->data = usb_ifnum_to_if(dev->udev, info->u->bSlaveInterface0);
0183     if (!info->control || !info->data) {
0184         dev_dbg(&intf->dev,
0185             "master #%u/%p slave #%u/%p\n",
0186             info->u->bMasterInterface0,
0187             info->control,
0188             info->u->bSlaveInterface0,
0189             info->data);
0190         /* fall back to hard-wiring for RNDIS */
0191         if (rndis) {
0192             android_rndis_quirk = true;
0193             goto skip;
0194         }
0195         goto bad_desc;
0196     }
0197     if (info->control != intf) {
0198         dev_dbg(&intf->dev, "bogus CDC Union\n");
0199         /* Ambit USB Cable Modem (and maybe others)
0200          * interchanges master and slave interface.
0201          */
0202         if (info->data == intf) {
0203             info->data = info->control;
0204             info->control = intf;
0205         } else
0206             goto bad_desc;
0207     }
0208 
0209     /* some devices merge these - skip class check */
0210     if (info->control == info->data)
0211         goto skip;
0212 
0213     /* a data interface altsetting does the real i/o */
0214     d = &info->data->cur_altsetting->desc;
0215     if (d->bInterfaceClass != USB_CLASS_CDC_DATA) {
0216         dev_dbg(&intf->dev, "slave class %u\n", d->bInterfaceClass);
0217         goto bad_desc;
0218     }
0219 skip:
0220     /* Communication class functions with bmCapabilities are not
0221      * RNDIS.  But some Wireless class RNDIS functions use
0222      * bmCapabilities for their own purpose. The failsafe is
0223      * therefore applied only to Communication class RNDIS
0224      * functions.  The rndis test is redundant, but a cheap
0225      * optimization.
0226      */
0227     if (rndis && is_rndis(&intf->cur_altsetting->desc) &&
0228         header.usb_cdc_acm_descriptor &&
0229         header.usb_cdc_acm_descriptor->bmCapabilities) {
0230         dev_dbg(&intf->dev,
0231             "ACM capabilities %02x, not really RNDIS?\n",
0232             header.usb_cdc_acm_descriptor->bmCapabilities);
0233         goto bad_desc;
0234     }
0235 
0236     if (header.usb_cdc_ether_desc && info->ether->wMaxSegmentSize) {
0237         dev->hard_mtu = le16_to_cpu(info->ether->wMaxSegmentSize);
0238         /* because of Zaurus, we may be ignoring the host
0239          * side link address we were given.
0240          */
0241     }
0242 
0243     if (header.usb_cdc_mdlm_desc &&
0244         memcmp(header.usb_cdc_mdlm_desc->bGUID, mbm_guid, 16)) {
0245         dev_dbg(&intf->dev, "GUID doesn't match\n");
0246         goto bad_desc;
0247     }
0248 
0249     if (header.usb_cdc_mdlm_detail_desc &&
0250         header.usb_cdc_mdlm_detail_desc->bLength <
0251             (sizeof(struct usb_cdc_mdlm_detail_desc) + 1)) {
0252         dev_dbg(&intf->dev, "Descriptor too short\n");
0253         goto bad_desc;
0254     }
0255 
0256 
0257 
0258     /* Microsoft ActiveSync based and some regular RNDIS devices lack the
0259      * CDC descriptors, so we'll hard-wire the interfaces and not check
0260      * for descriptors.
0261      *
0262      * Some Android RNDIS devices have a CDC Union descriptor pointing
0263      * to non-existing interfaces.  Ignore that and attempt the same
0264      * hard-wired 0 and 1 interfaces.
0265      */
0266     if (rndis && (!info->u || android_rndis_quirk)) {
0267         info->control = usb_ifnum_to_if(dev->udev, 0);
0268         info->data = usb_ifnum_to_if(dev->udev, 1);
0269         if (!info->control || !info->data || info->control != intf) {
0270             dev_dbg(&intf->dev,
0271                 "rndis: master #0/%p slave #1/%p\n",
0272                 info->control,
0273                 info->data);
0274             goto bad_desc;
0275         }
0276 
0277     } else if (!info->header || (!rndis && !info->ether)) {
0278         dev_dbg(&intf->dev, "missing cdc %s%s%sdescriptor\n",
0279             info->header ? "" : "header ",
0280             info->u ? "" : "union ",
0281             info->ether ? "" : "ether ");
0282         goto bad_desc;
0283     }
0284 
0285     /* claim data interface and set it up ... with side effects.
0286      * network traffic can't flow until an altsetting is enabled.
0287      */
0288     if (info->data != info->control) {
0289         status = usb_driver_claim_interface(driver, info->data, dev);
0290         if (status < 0)
0291             return status;
0292     }
0293     status = usbnet_get_endpoints(dev, info->data);
0294     if (status < 0) {
0295         /* ensure immediate exit from usbnet_disconnect */
0296         usb_set_intfdata(info->data, NULL);
0297         if (info->data != info->control)
0298             usb_driver_release_interface(driver, info->data);
0299         return status;
0300     }
0301 
0302     /* status endpoint: optional for CDC Ethernet, not RNDIS (or ACM) */
0303     if (info->data != info->control)
0304         dev->status = NULL;
0305     if (info->control->cur_altsetting->desc.bNumEndpoints == 1) {
0306         struct usb_endpoint_descriptor  *desc;
0307 
0308         dev->status = &info->control->cur_altsetting->endpoint[0];
0309         desc = &dev->status->desc;
0310         if (!usb_endpoint_is_int_in(desc) ||
0311             (le16_to_cpu(desc->wMaxPacketSize)
0312              < sizeof(struct usb_cdc_notification)) ||
0313             !desc->bInterval) {
0314             dev_dbg(&intf->dev, "bad notification endpoint\n");
0315             dev->status = NULL;
0316         }
0317     }
0318     if (rndis && !dev->status) {
0319         dev_dbg(&intf->dev, "missing RNDIS status endpoint\n");
0320         usb_set_intfdata(info->data, NULL);
0321         usb_driver_release_interface(driver, info->data);
0322         return -ENODEV;
0323     }
0324 
0325     /* override ethtool_ops */
0326     dev->net->ethtool_ops = &cdc_ether_ethtool_ops;
0327 
0328     return 0;
0329 
0330 bad_desc:
0331     dev_info(&dev->udev->dev, "bad CDC descriptors\n");
0332     return -ENODEV;
0333 }
0334 EXPORT_SYMBOL_GPL(usbnet_generic_cdc_bind);
0335 
0336 
0337 /* like usbnet_generic_cdc_bind() but handles filter initialization
0338  * correctly
0339  */
0340 int usbnet_ether_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
0341 {
0342     int rv;
0343 
0344     rv = usbnet_generic_cdc_bind(dev, intf);
0345     if (rv < 0)
0346         goto bail_out;
0347 
0348     /* Some devices don't initialise properly. In particular
0349      * the packet filter is not reset. There are devices that
0350      * don't do reset all the way. So the packet filter should
0351      * be set to a sane initial value.
0352      */
0353     usbnet_cdc_update_filter(dev);
0354 
0355 bail_out:
0356     return rv;
0357 }
0358 EXPORT_SYMBOL_GPL(usbnet_ether_cdc_bind);
0359 
0360 void usbnet_cdc_unbind(struct usbnet *dev, struct usb_interface *intf)
0361 {
0362     struct cdc_state        *info = (void *) &dev->data;
0363     struct usb_driver       *driver = driver_of(intf);
0364 
0365     /* combined interface - nothing  to do */
0366     if (info->data == info->control)
0367         return;
0368 
0369     /* disconnect master --> disconnect slave */
0370     if (intf == info->control && info->data) {
0371         /* ensure immediate exit from usbnet_disconnect */
0372         usb_set_intfdata(info->data, NULL);
0373         usb_driver_release_interface(driver, info->data);
0374         info->data = NULL;
0375     }
0376 
0377     /* and vice versa (just in case) */
0378     else if (intf == info->data && info->control) {
0379         /* ensure immediate exit from usbnet_disconnect */
0380         usb_set_intfdata(info->control, NULL);
0381         usb_driver_release_interface(driver, info->control);
0382         info->control = NULL;
0383     }
0384 }
0385 EXPORT_SYMBOL_GPL(usbnet_cdc_unbind);
0386 
0387 /* Communications Device Class, Ethernet Control model
0388  *
0389  * Takes two interfaces.  The DATA interface is inactive till an altsetting
0390  * is selected.  Configuration data includes class descriptors.  There's
0391  * an optional status endpoint on the control interface.
0392  *
0393  * This should interop with whatever the 2.4 "CDCEther.c" driver
0394  * (by Brad Hards) talked with, with more functionality.
0395  */
0396 
0397 static void speed_change(struct usbnet *dev, __le32 *speeds)
0398 {
0399     dev->tx_speed = __le32_to_cpu(speeds[0]);
0400     dev->rx_speed = __le32_to_cpu(speeds[1]);
0401 }
0402 
0403 void usbnet_cdc_status(struct usbnet *dev, struct urb *urb)
0404 {
0405     struct usb_cdc_notification *event;
0406 
0407     if (urb->actual_length < sizeof(*event))
0408         return;
0409 
0410     /* SPEED_CHANGE can get split into two 8-byte packets */
0411     if (test_and_clear_bit(EVENT_STS_SPLIT, &dev->flags)) {
0412         speed_change(dev, (__le32 *) urb->transfer_buffer);
0413         return;
0414     }
0415 
0416     event = urb->transfer_buffer;
0417     switch (event->bNotificationType) {
0418     case USB_CDC_NOTIFY_NETWORK_CONNECTION:
0419         netif_dbg(dev, timer, dev->net, "CDC: carrier %s\n",
0420               event->wValue ? "on" : "off");
0421         usbnet_link_change(dev, !!event->wValue, 0);
0422         break;
0423     case USB_CDC_NOTIFY_SPEED_CHANGE:   /* tx/rx rates */
0424         netif_dbg(dev, timer, dev->net, "CDC: speed change (len %d)\n",
0425               urb->actual_length);
0426         if (urb->actual_length != (sizeof(*event) + 8))
0427             set_bit(EVENT_STS_SPLIT, &dev->flags);
0428         else
0429             speed_change(dev, (__le32 *) &event[1]);
0430         break;
0431     /* USB_CDC_NOTIFY_RESPONSE_AVAILABLE can happen too (e.g. RNDIS),
0432      * but there are no standard formats for the response data.
0433      */
0434     default:
0435         netdev_err(dev->net, "CDC: unexpected notification %02x!\n",
0436                event->bNotificationType);
0437         break;
0438     }
0439 }
0440 EXPORT_SYMBOL_GPL(usbnet_cdc_status);
0441 
0442 int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
0443 {
0444     int             status;
0445     struct cdc_state        *info = (void *) &dev->data;
0446 
0447     BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data)
0448             < sizeof(struct cdc_state)));
0449 
0450     status = usbnet_ether_cdc_bind(dev, intf);
0451     if (status < 0)
0452         return status;
0453 
0454     status = usbnet_get_ethernet_addr(dev, info->ether->iMACAddress);
0455     if (status < 0) {
0456         usb_set_intfdata(info->data, NULL);
0457         usb_driver_release_interface(driver_of(intf), info->data);
0458         return status;
0459     }
0460 
0461     return 0;
0462 }
0463 EXPORT_SYMBOL_GPL(usbnet_cdc_bind);
0464 
0465 static int usbnet_cdc_zte_bind(struct usbnet *dev, struct usb_interface *intf)
0466 {
0467     int status = usbnet_cdc_bind(dev, intf);
0468 
0469     if (!status && (dev->net->dev_addr[0] & 0x02))
0470         eth_hw_addr_random(dev->net);
0471 
0472     return status;
0473 }
0474 
0475 /* Make sure packets have correct destination MAC address
0476  *
0477  * A firmware bug observed on some devices (ZTE MF823/831/910) is that the
0478  * device sends packets with a static, bogus, random MAC address (event if
0479  * device MAC address has been updated). Always set MAC address to that of the
0480  * device.
0481  */
0482 int usbnet_cdc_zte_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
0483 {
0484     if (skb->len < ETH_HLEN || !(skb->data[0] & 0x02))
0485         return 1;
0486 
0487     skb_reset_mac_header(skb);
0488     ether_addr_copy(eth_hdr(skb)->h_dest, dev->net->dev_addr);
0489 
0490     return 1;
0491 }
0492 EXPORT_SYMBOL_GPL(usbnet_cdc_zte_rx_fixup);
0493 
0494 /* Ensure correct link state
0495  *
0496  * Some devices (ZTE MF823/831/910) export two carrier on notifications when
0497  * connected. This causes the link state to be incorrect. Work around this by
0498  * always setting the state to off, then on.
0499  */
0500 static void usbnet_cdc_zte_status(struct usbnet *dev, struct urb *urb)
0501 {
0502     struct usb_cdc_notification *event;
0503 
0504     if (urb->actual_length < sizeof(*event))
0505         return;
0506 
0507     event = urb->transfer_buffer;
0508 
0509     if (event->bNotificationType != USB_CDC_NOTIFY_NETWORK_CONNECTION) {
0510         usbnet_cdc_status(dev, urb);
0511         return;
0512     }
0513 
0514     netif_dbg(dev, timer, dev->net, "CDC: carrier %s\n",
0515           event->wValue ? "on" : "off");
0516 
0517     if (event->wValue &&
0518         netif_carrier_ok(dev->net))
0519         netif_carrier_off(dev->net);
0520 
0521     usbnet_link_change(dev, !!event->wValue, 0);
0522 }
0523 
0524 static const struct driver_info cdc_info = {
0525     .description =  "CDC Ethernet Device",
0526     .flags =    FLAG_ETHER | FLAG_POINTTOPOINT,
0527     .bind =     usbnet_cdc_bind,
0528     .unbind =   usbnet_cdc_unbind,
0529     .status =   usbnet_cdc_status,
0530     .set_rx_mode =  usbnet_cdc_update_filter,
0531     .manage_power = usbnet_manage_power,
0532 };
0533 
0534 static const struct driver_info zte_cdc_info = {
0535     .description =  "ZTE CDC Ethernet Device",
0536     .flags =    FLAG_ETHER | FLAG_POINTTOPOINT,
0537     .bind =     usbnet_cdc_zte_bind,
0538     .unbind =   usbnet_cdc_unbind,
0539     .status =   usbnet_cdc_zte_status,
0540     .set_rx_mode =  usbnet_cdc_update_filter,
0541     .manage_power = usbnet_manage_power,
0542     .rx_fixup = usbnet_cdc_zte_rx_fixup,
0543 };
0544 
0545 static const struct driver_info wwan_info = {
0546     .description =  "Mobile Broadband Network Device",
0547     .flags =    FLAG_WWAN,
0548     .bind =     usbnet_cdc_bind,
0549     .unbind =   usbnet_cdc_unbind,
0550     .status =   usbnet_cdc_status,
0551     .set_rx_mode =  usbnet_cdc_update_filter,
0552     .manage_power = usbnet_manage_power,
0553 };
0554 
0555 /*-------------------------------------------------------------------------*/
0556 
0557 #define HUAWEI_VENDOR_ID    0x12D1
0558 #define NOVATEL_VENDOR_ID   0x1410
0559 #define ZTE_VENDOR_ID       0x19D2
0560 #define DELL_VENDOR_ID      0x413C
0561 #define REALTEK_VENDOR_ID   0x0bda
0562 #define SAMSUNG_VENDOR_ID   0x04e8
0563 #define LENOVO_VENDOR_ID    0x17ef
0564 #define LINKSYS_VENDOR_ID   0x13b1
0565 #define NVIDIA_VENDOR_ID    0x0955
0566 #define HP_VENDOR_ID        0x03f0
0567 #define MICROSOFT_VENDOR_ID 0x045e
0568 #define UBLOX_VENDOR_ID     0x1546
0569 #define TPLINK_VENDOR_ID    0x2357
0570 #define AQUANTIA_VENDOR_ID  0x2eca
0571 #define ASIX_VENDOR_ID      0x0b95
0572 
0573 static const struct usb_device_id   products[] = {
0574 /* BLACKLIST !!
0575  *
0576  * First blacklist any products that are egregiously nonconformant
0577  * with the CDC Ethernet specs.  Minor braindamage we cope with; when
0578  * they're not even trying, needing a separate driver is only the first
0579  * of the differences to show up.
0580  */
0581 
0582 #define ZAURUS_MASTER_INTERFACE \
0583     .bInterfaceClass    = USB_CLASS_COMM, \
0584     .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, \
0585     .bInterfaceProtocol = USB_CDC_PROTO_NONE
0586 
0587 #define ZAURUS_FAKE_INTERFACE \
0588     .bInterfaceClass    = USB_CLASS_COMM, \
0589     .bInterfaceSubClass = USB_CDC_SUBCLASS_MDLM, \
0590     .bInterfaceProtocol = USB_CDC_PROTO_NONE
0591 
0592 /* SA-1100 based Sharp Zaurus ("collie"), or compatible;
0593  * wire-incompatible with true CDC Ethernet implementations.
0594  * (And, it seems, needlessly so...)
0595  */
0596 {
0597     .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
0598               | USB_DEVICE_ID_MATCH_DEVICE,
0599     .idVendor       = 0x04DD,
0600     .idProduct      = 0x8004,
0601     ZAURUS_MASTER_INTERFACE,
0602     .driver_info        = 0,
0603 },
0604 
0605 /* PXA-25x based Sharp Zaurii.  Note that it seems some of these
0606  * (later models especially) may have shipped only with firmware
0607  * advertising false "CDC MDLM" compatibility ... but we're not
0608  * clear which models did that, so for now let's assume the worst.
0609  */
0610 {
0611     .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
0612               | USB_DEVICE_ID_MATCH_DEVICE,
0613     .idVendor       = 0x04DD,
0614     .idProduct      = 0x8005,   /* A-300 */
0615     ZAURUS_MASTER_INTERFACE,
0616     .driver_info        = 0,
0617 }, {
0618     .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
0619               | USB_DEVICE_ID_MATCH_DEVICE,
0620     .idVendor       = 0x04DD,
0621     .idProduct      = 0x8006,   /* B-500/SL-5600 */
0622     ZAURUS_MASTER_INTERFACE,
0623     .driver_info        = 0,
0624 }, {
0625     .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
0626               | USB_DEVICE_ID_MATCH_DEVICE,
0627     .idVendor       = 0x04DD,
0628     .idProduct      = 0x8007,   /* C-700 */
0629     ZAURUS_MASTER_INTERFACE,
0630     .driver_info        = 0,
0631 }, {
0632     .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
0633          | USB_DEVICE_ID_MATCH_DEVICE,
0634     .idVendor               = 0x04DD,
0635     .idProduct              = 0x9031,   /* C-750 C-760 */
0636     ZAURUS_MASTER_INTERFACE,
0637     .driver_info        = 0,
0638 }, {
0639     .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
0640          | USB_DEVICE_ID_MATCH_DEVICE,
0641     .idVendor               = 0x04DD,
0642     .idProduct              = 0x9032,   /* SL-6000 */
0643     ZAURUS_MASTER_INTERFACE,
0644     .driver_info        = 0,
0645 }, {
0646     .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
0647          | USB_DEVICE_ID_MATCH_DEVICE,
0648     .idVendor               = 0x04DD,
0649     .idProduct              = 0x9032,   /* SL-6000 */
0650     ZAURUS_FAKE_INTERFACE,
0651     .driver_info        = 0,
0652 }, {
0653     .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
0654          | USB_DEVICE_ID_MATCH_DEVICE,
0655     .idVendor               = 0x04DD,
0656     /* reported with some C860 units */
0657     .idProduct              = 0x9050,   /* C-860 */
0658     ZAURUS_MASTER_INTERFACE,
0659     .driver_info        = 0,
0660 },
0661 
0662 /* Olympus has some models with a Zaurus-compatible option.
0663  * R-1000 uses a FreeScale i.MXL cpu (ARMv4T)
0664  */
0665 {
0666     .match_flags    =   USB_DEVICE_ID_MATCH_INT_INFO
0667          | USB_DEVICE_ID_MATCH_DEVICE,
0668     .idVendor               = 0x07B4,
0669     .idProduct              = 0x0F02,   /* R-1000 */
0670     ZAURUS_MASTER_INTERFACE,
0671     .driver_info        = 0,
0672 },
0673 
0674 /* LG Electronics VL600 wants additional headers on every frame */
0675 {
0676     USB_DEVICE_AND_INTERFACE_INFO(0x1004, 0x61aa, USB_CLASS_COMM,
0677             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0678     .driver_info = 0,
0679 },
0680 
0681 /* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */
0682 {
0683     USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM,
0684             USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
0685     .driver_info        = 0,
0686 },
0687 
0688 /* Novatel USB551L and MC551 - handled by qmi_wwan */
0689 {
0690     USB_DEVICE_AND_INTERFACE_INFO(NOVATEL_VENDOR_ID, 0xB001, USB_CLASS_COMM,
0691             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0692     .driver_info = 0,
0693 },
0694 
0695 /* Novatel E362 - handled by qmi_wwan */
0696 {
0697     USB_DEVICE_AND_INTERFACE_INFO(NOVATEL_VENDOR_ID, 0x9010, USB_CLASS_COMM,
0698             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0699     .driver_info = 0,
0700 },
0701 
0702 /* Dell Wireless 5800 (Novatel E362) - handled by qmi_wwan */
0703 {
0704     USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x8195, USB_CLASS_COMM,
0705             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0706     .driver_info = 0,
0707 },
0708 
0709 /* Dell Wireless 5800 (Novatel E362) - handled by qmi_wwan */
0710 {
0711     USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x8196, USB_CLASS_COMM,
0712             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0713     .driver_info = 0,
0714 },
0715 
0716 /* Dell Wireless 5804 (Novatel E371) - handled by qmi_wwan */
0717 {
0718     USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x819b, USB_CLASS_COMM,
0719             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0720     .driver_info = 0,
0721 },
0722 
0723 /* Novatel Expedite E371 - handled by qmi_wwan */
0724 {
0725     USB_DEVICE_AND_INTERFACE_INFO(NOVATEL_VENDOR_ID, 0x9011, USB_CLASS_COMM,
0726             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0727     .driver_info = 0,
0728 },
0729 
0730 /* HP lt2523 (Novatel E371) - handled by qmi_wwan */
0731 {
0732     USB_DEVICE_AND_INTERFACE_INFO(HP_VENDOR_ID, 0x421d, USB_CLASS_COMM,
0733                       USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0734     .driver_info = 0,
0735 },
0736 
0737 /* AnyDATA ADU960S - handled by qmi_wwan */
0738 {
0739     USB_DEVICE_AND_INTERFACE_INFO(0x16d5, 0x650a, USB_CLASS_COMM,
0740             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0741     .driver_info = 0,
0742 },
0743 
0744 /* Huawei E1820 - handled by qmi_wwan */
0745 {
0746     USB_DEVICE_INTERFACE_NUMBER(HUAWEI_VENDOR_ID, 0x14ac, 1),
0747     .driver_info = 0,
0748 },
0749 
0750 /* Realtek RTL8152 Based USB 2.0 Ethernet Adapters */
0751 {
0752     USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8152, USB_CLASS_COMM,
0753             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0754     .driver_info = 0,
0755 },
0756 
0757 /* Realtek RTL8153 Based USB 3.0 Ethernet Adapters */
0758 {
0759     USB_DEVICE_AND_INTERFACE_INFO(REALTEK_VENDOR_ID, 0x8153, USB_CLASS_COMM,
0760             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0761     .driver_info = 0,
0762 },
0763 
0764 /* Samsung USB Ethernet Adapters */
0765 {
0766     USB_DEVICE_AND_INTERFACE_INFO(SAMSUNG_VENDOR_ID, 0xa101, USB_CLASS_COMM,
0767             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0768     .driver_info = 0,
0769 },
0770 
0771 #if IS_ENABLED(CONFIG_USB_RTL8152)
0772 /* Linksys USB3GIGV1 Ethernet Adapter */
0773 {
0774     USB_DEVICE_AND_INTERFACE_INFO(LINKSYS_VENDOR_ID, 0x0041, USB_CLASS_COMM,
0775             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0776     .driver_info = 0,
0777 },
0778 #endif
0779 
0780 /* Lenovo ThinkPad OneLink+ Dock (based on Realtek RTL8153) */
0781 {
0782     USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3054, USB_CLASS_COMM,
0783             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0784     .driver_info = 0,
0785 },
0786 
0787 /* ThinkPad USB-C Dock (based on Realtek RTL8153) */
0788 {
0789     USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3062, USB_CLASS_COMM,
0790             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0791     .driver_info = 0,
0792 },
0793 
0794 /* ThinkPad Thunderbolt 3 Dock (based on Realtek RTL8153) */
0795 {
0796     USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3069, USB_CLASS_COMM,
0797             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0798     .driver_info = 0,
0799 },
0800 
0801 /* ThinkPad Thunderbolt 3 Dock Gen 2 (based on Realtek RTL8153) */
0802 {
0803     USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3082, USB_CLASS_COMM,
0804             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0805     .driver_info = 0,
0806 },
0807 
0808 /* Lenovo Thinkpad USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */
0809 {
0810     USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x7205, USB_CLASS_COMM,
0811             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0812     .driver_info = 0,
0813 },
0814 
0815 /* Lenovo USB C to Ethernet Adapter (based on Realtek RTL8153) */
0816 {
0817     USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x720c, USB_CLASS_COMM,
0818             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0819     .driver_info = 0,
0820 },
0821 
0822 /* Lenovo USB-C Travel Hub (based on Realtek RTL8153) */
0823 {
0824     USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x7214, USB_CLASS_COMM,
0825             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0826     .driver_info = 0,
0827 },
0828 
0829 /* Lenovo Powered USB-C Travel Hub (4X90S92381, based on Realtek RTL8153) */
0830 {
0831     USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x721e, USB_CLASS_COMM,
0832             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0833     .driver_info = 0,
0834 },
0835 
0836 /* ThinkPad USB-C Dock Gen 2 (based on Realtek RTL8153) */
0837 {
0838     USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0xa387, USB_CLASS_COMM,
0839             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0840     .driver_info = 0,
0841 },
0842 
0843 /* NVIDIA Tegra USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */
0844 {
0845     USB_DEVICE_AND_INTERFACE_INFO(NVIDIA_VENDOR_ID, 0x09ff, USB_CLASS_COMM,
0846             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0847     .driver_info = 0,
0848 },
0849 
0850 /* Microsoft Surface 2 dock (based on Realtek RTL8152) */
0851 {
0852     USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07ab, USB_CLASS_COMM,
0853             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0854     .driver_info = 0,
0855 },
0856 
0857 /* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153) */
0858 {
0859     USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07c6, USB_CLASS_COMM,
0860             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0861     .driver_info = 0,
0862 },
0863 
0864 /* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153B) */
0865 {
0866     USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x0927, USB_CLASS_COMM,
0867             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0868     .driver_info = 0,
0869 },
0870 
0871 /* TP-LINK UE300 USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */
0872 {
0873     USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, 0x0601, USB_CLASS_COMM,
0874             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0875     .driver_info = 0,
0876 },
0877 
0878 /* Aquantia AQtion USB to 5GbE Controller (based on AQC111U) */
0879 {
0880     USB_DEVICE_AND_INTERFACE_INFO(AQUANTIA_VENDOR_ID, 0xc101,
0881                       USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,
0882                       USB_CDC_PROTO_NONE),
0883     .driver_info = 0,
0884 },
0885 
0886 /* ASIX USB 3.1 Gen1 to 5G Multi-Gigabit Ethernet Adapter(based on AQC111U) */
0887 {
0888     USB_DEVICE_AND_INTERFACE_INFO(ASIX_VENDOR_ID, 0x2790, USB_CLASS_COMM,
0889                       USB_CDC_SUBCLASS_ETHERNET,
0890                       USB_CDC_PROTO_NONE),
0891     .driver_info = 0,
0892 },
0893 
0894 /* ASIX USB 3.1 Gen1 to 2.5G Multi-Gigabit Ethernet Adapter(based on AQC112U) */
0895 {
0896     USB_DEVICE_AND_INTERFACE_INFO(ASIX_VENDOR_ID, 0x2791, USB_CLASS_COMM,
0897                       USB_CDC_SUBCLASS_ETHERNET,
0898                       USB_CDC_PROTO_NONE),
0899     .driver_info = 0,
0900 },
0901 
0902 /* USB-C 3.1 to 5GBASE-T Ethernet Adapter (based on AQC111U) */
0903 {
0904     USB_DEVICE_AND_INTERFACE_INFO(0x20f4, 0xe05a, USB_CLASS_COMM,
0905                       USB_CDC_SUBCLASS_ETHERNET,
0906                       USB_CDC_PROTO_NONE),
0907     .driver_info = 0,
0908 },
0909 
0910 /* QNAP QNA-UC5G1T USB to 5GbE Adapter (based on AQC111U) */
0911 {
0912     USB_DEVICE_AND_INTERFACE_INFO(0x1c04, 0x0015, USB_CLASS_COMM,
0913                       USB_CDC_SUBCLASS_ETHERNET,
0914                       USB_CDC_PROTO_NONE),
0915     .driver_info = 0,
0916 },
0917 
0918 /* WHITELIST!!!
0919  *
0920  * CDC Ether uses two interfaces, not necessarily consecutive.
0921  * We match the main interface, ignoring the optional device
0922  * class so we could handle devices that aren't exclusively
0923  * CDC ether.
0924  *
0925  * NOTE:  this match must come AFTER entries blacklisting devices
0926  * because of bugs/quirks in a given product (like Zaurus, above).
0927  */
0928 {
0929     /* ZTE (Vodafone) K3805-Z */
0930     USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1003, USB_CLASS_COMM,
0931                       USB_CDC_SUBCLASS_ETHERNET,
0932                       USB_CDC_PROTO_NONE),
0933     .driver_info = (unsigned long)&wwan_info,
0934 }, {
0935     /* ZTE (Vodafone) K3806-Z */
0936     USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1015, USB_CLASS_COMM,
0937                       USB_CDC_SUBCLASS_ETHERNET,
0938                       USB_CDC_PROTO_NONE),
0939     .driver_info = (unsigned long)&wwan_info,
0940 }, {
0941     /* ZTE (Vodafone) K4510-Z */
0942     USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1173, USB_CLASS_COMM,
0943                       USB_CDC_SUBCLASS_ETHERNET,
0944                       USB_CDC_PROTO_NONE),
0945     .driver_info = (unsigned long)&wwan_info,
0946 }, {
0947     /* ZTE (Vodafone) K3770-Z */
0948     USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1177, USB_CLASS_COMM,
0949                       USB_CDC_SUBCLASS_ETHERNET,
0950                       USB_CDC_PROTO_NONE),
0951     .driver_info = (unsigned long)&wwan_info,
0952 }, {
0953     /* ZTE (Vodafone) K3772-Z */
0954     USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1181, USB_CLASS_COMM,
0955                       USB_CDC_SUBCLASS_ETHERNET,
0956                       USB_CDC_PROTO_NONE),
0957     .driver_info = (unsigned long)&wwan_info,
0958 }, {
0959     /* Telit modules */
0960     USB_VENDOR_AND_INTERFACE_INFO(0x1bc7, USB_CLASS_COMM,
0961             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0962     .driver_info = (kernel_ulong_t) &wwan_info,
0963 }, {
0964     /* Dell DW5580 modules */
0965     USB_DEVICE_AND_INTERFACE_INFO(DELL_VENDOR_ID, 0x81ba, USB_CLASS_COMM,
0966             USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
0967     .driver_info = (kernel_ulong_t)&wwan_info,
0968 }, {
0969     /* Huawei ME906 and ME909 */
0970     USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x15c1, USB_CLASS_COMM,
0971                       USB_CDC_SUBCLASS_ETHERNET,
0972                       USB_CDC_PROTO_NONE),
0973     .driver_info = (unsigned long)&wwan_info,
0974 }, {
0975     /* ZTE modules */
0976     USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, USB_CLASS_COMM,
0977                       USB_CDC_SUBCLASS_ETHERNET,
0978                       USB_CDC_PROTO_NONE),
0979     .driver_info = (unsigned long)&zte_cdc_info,
0980 }, {
0981     /* U-blox TOBY-L2 */
0982     USB_DEVICE_AND_INTERFACE_INFO(UBLOX_VENDOR_ID, 0x1143, USB_CLASS_COMM,
0983                       USB_CDC_SUBCLASS_ETHERNET,
0984                       USB_CDC_PROTO_NONE),
0985     .driver_info = (unsigned long)&wwan_info,
0986 }, {
0987     /* U-blox SARA-U2 */
0988     USB_DEVICE_AND_INTERFACE_INFO(UBLOX_VENDOR_ID, 0x1104, USB_CLASS_COMM,
0989                       USB_CDC_SUBCLASS_ETHERNET,
0990                       USB_CDC_PROTO_NONE),
0991     .driver_info = (unsigned long)&wwan_info,
0992 }, {
0993     /* Cinterion PLS8 modem by GEMALTO */
0994     USB_DEVICE_AND_INTERFACE_INFO(0x1e2d, 0x0061, USB_CLASS_COMM,
0995                       USB_CDC_SUBCLASS_ETHERNET,
0996                       USB_CDC_PROTO_NONE),
0997     .driver_info = (unsigned long)&wwan_info,
0998 }, {
0999     /* Cinterion AHS3 modem by GEMALTO */
1000     USB_DEVICE_AND_INTERFACE_INFO(0x1e2d, 0x0055, USB_CLASS_COMM,
1001                       USB_CDC_SUBCLASS_ETHERNET,
1002                       USB_CDC_PROTO_NONE),
1003     .driver_info = (unsigned long)&wwan_info,
1004 }, {
1005     /* Cinterion PLS83/PLS63 modem by GEMALTO/THALES */
1006     USB_DEVICE_AND_INTERFACE_INFO(0x1e2d, 0x0069, USB_CLASS_COMM,
1007                       USB_CDC_SUBCLASS_ETHERNET,
1008                       USB_CDC_PROTO_NONE),
1009     .driver_info = (unsigned long)&wwan_info,
1010 }, {
1011     USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,
1012             USB_CDC_PROTO_NONE),
1013     .driver_info = (unsigned long) &cdc_info,
1014 }, {
1015     USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM,
1016             USB_CDC_PROTO_NONE),
1017     .driver_info = (unsigned long)&wwan_info,
1018 
1019 }, {
1020     /* Various Huawei modems with a network port like the UMG1831 */
1021     USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_COMM,
1022                       USB_CDC_SUBCLASS_ETHERNET, 255),
1023     .driver_info = (unsigned long)&wwan_info,
1024 },
1025     { },        /* END */
1026 };
1027 MODULE_DEVICE_TABLE(usb, products);
1028 
1029 static struct usb_driver cdc_driver = {
1030     .name =     "cdc_ether",
1031     .id_table = products,
1032     .probe =    usbnet_probe,
1033     .disconnect =   usbnet_disconnect,
1034     .suspend =  usbnet_suspend,
1035     .resume =   usbnet_resume,
1036     .reset_resume = usbnet_resume,
1037     .supports_autosuspend = 1,
1038     .disable_hub_initiated_lpm = 1,
1039 };
1040 
1041 module_usb_driver(cdc_driver);
1042 
1043 MODULE_AUTHOR("David Brownell");
1044 MODULE_DESCRIPTION("USB CDC Ethernet devices");
1045 MODULE_LICENSE("GPL");