diff options
Diffstat (limited to 'drivers/net/usb/cdc_ether.c')
-rw-r--r-- | drivers/net/usb/cdc_ether.c | 114 |
1 files changed, 40 insertions, 74 deletions
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index c8cdb7f30adc..b3fe0de40469 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -64,6 +64,11 @@ static int is_wireless_rndis(struct usb_interface_descriptor *desc) | |||
64 | 64 | ||
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | static const u8 mbm_guid[16] = { | ||
68 | 0xa3, 0x17, 0xa8, 0x8b, 0x04, 0x5e, 0x4f, 0x01, | ||
69 | 0xa6, 0x07, 0xc0, 0xff, 0xcb, 0x7e, 0x39, 0x2a, | ||
70 | }; | ||
71 | |||
67 | /* | 72 | /* |
68 | * probes control interface, claims data interface, collects the bulk | 73 | * probes control interface, claims data interface, collects the bulk |
69 | * endpoints, activates data interface (if needed), maybe sets MTU. | 74 | * endpoints, activates data interface (if needed), maybe sets MTU. |
@@ -79,6 +84,8 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) | |||
79 | int status; | 84 | int status; |
80 | int rndis; | 85 | int rndis; |
81 | struct usb_driver *driver = driver_of(intf); | 86 | struct usb_driver *driver = driver_of(intf); |
87 | struct usb_cdc_mdlm_desc *desc = NULL; | ||
88 | struct usb_cdc_mdlm_detail_desc *detail = NULL; | ||
82 | 89 | ||
83 | if (sizeof dev->data < sizeof *info) | 90 | if (sizeof dev->data < sizeof *info) |
84 | return -EDOM; | 91 | return -EDOM; |
@@ -229,6 +236,34 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) | |||
229 | * side link address we were given. | 236 | * side link address we were given. |
230 | */ | 237 | */ |
231 | break; | 238 | break; |
239 | case USB_CDC_MDLM_TYPE: | ||
240 | if (desc) { | ||
241 | dev_dbg(&intf->dev, "extra MDLM descriptor\n"); | ||
242 | goto bad_desc; | ||
243 | } | ||
244 | |||
245 | desc = (void *)buf; | ||
246 | |||
247 | if (desc->bLength != sizeof(*desc)) | ||
248 | goto bad_desc; | ||
249 | |||
250 | if (memcmp(&desc->bGUID, mbm_guid, 16)) | ||
251 | goto bad_desc; | ||
252 | break; | ||
253 | case USB_CDC_MDLM_DETAIL_TYPE: | ||
254 | if (detail) { | ||
255 | dev_dbg(&intf->dev, "extra MDLM detail descriptor\n"); | ||
256 | goto bad_desc; | ||
257 | } | ||
258 | |||
259 | detail = (void *)buf; | ||
260 | |||
261 | if (detail->bGuidDescriptorType == 0) { | ||
262 | if (detail->bLength < (sizeof(*detail) + 1)) | ||
263 | goto bad_desc; | ||
264 | } else | ||
265 | goto bad_desc; | ||
266 | break; | ||
232 | } | 267 | } |
233 | next_desc: | 268 | next_desc: |
234 | len -= buf [0]; /* bLength */ | 269 | len -= buf [0]; /* bLength */ |
@@ -431,6 +466,7 @@ static const struct driver_info mbm_info = { | |||
431 | .bind = cdc_bind, | 466 | .bind = cdc_bind, |
432 | .unbind = usbnet_cdc_unbind, | 467 | .unbind = usbnet_cdc_unbind, |
433 | .status = cdc_status, | 468 | .status = cdc_status, |
469 | .manage_power = cdc_manage_power, | ||
434 | }; | 470 | }; |
435 | 471 | ||
436 | /*-------------------------------------------------------------------------*/ | 472 | /*-------------------------------------------------------------------------*/ |
@@ -542,80 +578,10 @@ static const struct usb_device_id products [] = { | |||
542 | USB_CDC_PROTO_NONE), | 578 | USB_CDC_PROTO_NONE), |
543 | .driver_info = (unsigned long) &cdc_info, | 579 | .driver_info = (unsigned long) &cdc_info, |
544 | }, { | 580 | }, { |
545 | /* Ericsson F3507g */ | 581 | USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM, |
546 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1900, USB_CLASS_COMM, | 582 | USB_CDC_PROTO_NONE), |
547 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | 583 | .driver_info = (unsigned long)&mbm_info, |
548 | .driver_info = (unsigned long) &mbm_info, | 584 | |
549 | }, { | ||
550 | /* Ericsson F3507g ver. 2 */ | ||
551 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1902, USB_CLASS_COMM, | ||
552 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
553 | .driver_info = (unsigned long) &mbm_info, | ||
554 | }, { | ||
555 | /* Ericsson F3607gw */ | ||
556 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1904, USB_CLASS_COMM, | ||
557 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
558 | .driver_info = (unsigned long) &mbm_info, | ||
559 | }, { | ||
560 | /* Ericsson F3607gw ver 2 */ | ||
561 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1905, USB_CLASS_COMM, | ||
562 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
563 | .driver_info = (unsigned long) &mbm_info, | ||
564 | }, { | ||
565 | /* Ericsson F3607gw ver 3 */ | ||
566 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1906, USB_CLASS_COMM, | ||
567 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
568 | .driver_info = (unsigned long) &mbm_info, | ||
569 | }, { | ||
570 | /* Ericsson F3307 */ | ||
571 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x190a, USB_CLASS_COMM, | ||
572 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
573 | .driver_info = (unsigned long) &mbm_info, | ||
574 | }, { | ||
575 | /* Ericsson F3307 ver 2 */ | ||
576 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1909, USB_CLASS_COMM, | ||
577 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
578 | .driver_info = (unsigned long) &mbm_info, | ||
579 | }, { | ||
580 | /* Ericsson C3607w */ | ||
581 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1049, USB_CLASS_COMM, | ||
582 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
583 | .driver_info = (unsigned long) &mbm_info, | ||
584 | }, { | ||
585 | /* Ericsson C3607w ver 2 */ | ||
586 | USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x190b, USB_CLASS_COMM, | ||
587 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
588 | .driver_info = (unsigned long) &mbm_info, | ||
589 | }, { | ||
590 | /* Toshiba F3507g */ | ||
591 | USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x130b, USB_CLASS_COMM, | ||
592 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
593 | .driver_info = (unsigned long) &mbm_info, | ||
594 | }, { | ||
595 | /* Toshiba F3607gw */ | ||
596 | USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x130c, USB_CLASS_COMM, | ||
597 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
598 | .driver_info = (unsigned long) &mbm_info, | ||
599 | }, { | ||
600 | /* Toshiba F3607gw ver 2 */ | ||
601 | USB_DEVICE_AND_INTERFACE_INFO(0x0930, 0x1311, USB_CLASS_COMM, | ||
602 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
603 | .driver_info = (unsigned long) &mbm_info, | ||
604 | }, { | ||
605 | /* Dell F3507g */ | ||
606 | USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8147, USB_CLASS_COMM, | ||
607 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
608 | .driver_info = (unsigned long) &mbm_info, | ||
609 | }, { | ||
610 | /* Dell F3607gw */ | ||
611 | USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8183, USB_CLASS_COMM, | ||
612 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
613 | .driver_info = (unsigned long) &mbm_info, | ||
614 | }, { | ||
615 | /* Dell F3607gw ver 2 */ | ||
616 | USB_DEVICE_AND_INTERFACE_INFO(0x413c, 0x8184, USB_CLASS_COMM, | ||
617 | USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), | ||
618 | .driver_info = (unsigned long) &mbm_info, | ||
619 | }, | 585 | }, |
620 | { }, // END | 586 | { }, // END |
621 | }; | 587 | }; |