diff options
Diffstat (limited to 'drivers/net/usb/cdc_ether.c')
-rw-r--r-- | drivers/net/usb/cdc_ether.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index b3b3c05903a1..5512a1038721 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -179,10 +179,8 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) | |||
179 | * probed with) and a slave/data interface; union | 179 | * probed with) and a slave/data interface; union |
180 | * descriptors sort this all out. | 180 | * descriptors sort this all out. |
181 | */ | 181 | */ |
182 | info->control = usb_ifnum_to_if(dev->udev, | 182 | info->control = usb_ifnum_to_if(dev->udev, info->u->bMasterInterface0); |
183 | info->u->bMasterInterface0); | 183 | info->data = usb_ifnum_to_if(dev->udev, info->u->bSlaveInterface0); |
184 | info->data = usb_ifnum_to_if(dev->udev, | ||
185 | info->u->bSlaveInterface0); | ||
186 | if (!info->control || !info->data) { | 184 | if (!info->control || !info->data) { |
187 | dev_dbg(&intf->dev, | 185 | dev_dbg(&intf->dev, |
188 | "master #%u/%p slave #%u/%p\n", | 186 | "master #%u/%p slave #%u/%p\n", |
@@ -216,18 +214,16 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) | |||
216 | /* a data interface altsetting does the real i/o */ | 214 | /* a data interface altsetting does the real i/o */ |
217 | d = &info->data->cur_altsetting->desc; | 215 | d = &info->data->cur_altsetting->desc; |
218 | if (d->bInterfaceClass != USB_CLASS_CDC_DATA) { | 216 | if (d->bInterfaceClass != USB_CLASS_CDC_DATA) { |
219 | dev_dbg(&intf->dev, "slave class %u\n", | 217 | dev_dbg(&intf->dev, "slave class %u\n", d->bInterfaceClass); |
220 | d->bInterfaceClass); | ||
221 | goto bad_desc; | 218 | goto bad_desc; |
222 | } | 219 | } |
223 | skip: | 220 | skip: |
224 | if ( rndis && | 221 | if (rndis && header.usb_cdc_acm_descriptor && |
225 | header.usb_cdc_acm_descriptor && | 222 | header.usb_cdc_acm_descriptor->bmCapabilities) { |
226 | header.usb_cdc_acm_descriptor->bmCapabilities) { | 223 | dev_dbg(&intf->dev, |
227 | dev_dbg(&intf->dev, | 224 | "ACM capabilities %02x, not really RNDIS?\n", |
228 | "ACM capabilities %02x, not really RNDIS?\n", | 225 | header.usb_cdc_acm_descriptor->bmCapabilities); |
229 | header.usb_cdc_acm_descriptor->bmCapabilities); | 226 | goto bad_desc; |
230 | goto bad_desc; | ||
231 | } | 227 | } |
232 | 228 | ||
233 | if (header.usb_cdc_ether_desc && info->ether->wMaxSegmentSize) { | 229 | if (header.usb_cdc_ether_desc && info->ether->wMaxSegmentSize) { |
@@ -238,7 +234,7 @@ skip: | |||
238 | } | 234 | } |
239 | 235 | ||
240 | if (header.usb_cdc_mdlm_desc && | 236 | if (header.usb_cdc_mdlm_desc && |
241 | memcmp(header.usb_cdc_mdlm_desc->bGUID, mbm_guid, 16)) { | 237 | memcmp(header.usb_cdc_mdlm_desc->bGUID, mbm_guid, 16)) { |
242 | dev_dbg(&intf->dev, "GUID doesn't match\n"); | 238 | dev_dbg(&intf->dev, "GUID doesn't match\n"); |
243 | goto bad_desc; | 239 | goto bad_desc; |
244 | } | 240 | } |
@@ -302,7 +298,7 @@ skip: | |||
302 | if (info->control->cur_altsetting->desc.bNumEndpoints == 1) { | 298 | if (info->control->cur_altsetting->desc.bNumEndpoints == 1) { |
303 | struct usb_endpoint_descriptor *desc; | 299 | struct usb_endpoint_descriptor *desc; |
304 | 300 | ||
305 | dev->status = &info->control->cur_altsetting->endpoint [0]; | 301 | dev->status = &info->control->cur_altsetting->endpoint[0]; |
306 | desc = &dev->status->desc; | 302 | desc = &dev->status->desc; |
307 | if (!usb_endpoint_is_int_in(desc) || | 303 | if (!usb_endpoint_is_int_in(desc) || |
308 | (le16_to_cpu(desc->wMaxPacketSize) | 304 | (le16_to_cpu(desc->wMaxPacketSize) |
@@ -847,6 +843,14 @@ static const struct usb_device_id products[] = { | |||
847 | .driver_info = 0, | 843 | .driver_info = 0, |
848 | }, | 844 | }, |
849 | 845 | ||
846 | /* USB-C 3.1 to 5GBASE-T Ethernet Adapter (based on AQC111U) */ | ||
847 | { | ||
848 | USB_DEVICE_AND_INTERFACE_INFO(0x20f4, 0xe05a, USB_CLASS_COMM, | ||
849 | USB_CDC_SUBCLASS_ETHERNET, | ||
850 | USB_CDC_PROTO_NONE), | ||
851 | .driver_info = 0, | ||
852 | }, | ||
853 | |||
850 | /* WHITELIST!!! | 854 | /* WHITELIST!!! |
851 | * | 855 | * |
852 | * CDC Ether uses two interfaces, not necessarily consecutive. | 856 | * CDC Ether uses two interfaces, not necessarily consecutive. |