aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorJonas Sjöquist <jonas.sjoquist@ericsson.com>2010-04-22 21:07:45 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-30 19:27:36 -0400
commit21851264120b0bd1f953328cb131abcfa9305bc3 (patch)
tree0c2e2cb447f51508aa50bdd738b93b91a298a790 /drivers/net/usb
parent81a2e36df7de8bf9417de67f9d54b4f740072ed0 (diff)
cdc_ether: Identify MBM devices by GUID in MDLM descriptor
This patch removes vid/pid for Ericsson MBM devices from the whitelist set of devices. The MBM devices are instead identified by GUID. In order for cdc_ether to handle these devices the GUID in the MDLM descriptor is tested. All MBM devices currently handled by cdc_ether as well as future CDC Ethernet MBM devices can be identified by the GUID. This is the same solution used in Carl Nordbeck's mbm driver, http://kerneltrap.org/mailarchive/linux-usb/2008/11/17/4141384/thread I post this as RFC to get feedback on however cdc_ether is the correct place to do the binding, or if it should be done in a separate driver, e.g. zaurus. Signed-off-by: Jonas Sjöquist <jonas.sjoquist@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/cdc_ether.c113
1 files changed, 39 insertions, 74 deletions
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index c8cdb7f30adc..811b2dc423d1 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
67static 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 }
233next_desc: 268next_desc:
234 len -= buf [0]; /* bLength */ 269 len -= buf [0]; /* bLength */
@@ -542,80 +577,10 @@ static const struct usb_device_id products [] = {
542 USB_CDC_PROTO_NONE), 577 USB_CDC_PROTO_NONE),
543 .driver_info = (unsigned long) &cdc_info, 578 .driver_info = (unsigned long) &cdc_info,
544}, { 579}, {
545 /* Ericsson F3507g */ 580 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_MDLM,
546 USB_DEVICE_AND_INTERFACE_INFO(0x0bdb, 0x1900, USB_CLASS_COMM, 581 USB_CDC_PROTO_NONE),
547 USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE), 582 .driver_info = (unsigned long)&mbm_info,
548 .driver_info = (unsigned long) &mbm_info, 583
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}, 584},
620 { }, // END 585 { }, // END
621}; 586};