Commit d9d1babe authored by Stefan Becker's avatar Stefan Becker Committed by Greg Kroah-Hartman

[PATCH] USB: Patch to cdc-acm.c to detect ACM part of USB WMC devices

parent effb49b4
...@@ -548,7 +548,7 @@ static int acm_probe (struct usb_interface *intf, ...@@ -548,7 +548,7 @@ static int acm_probe (struct usb_interface *intf,
struct usb_host_config *cfacm; struct usb_host_config *cfacm;
struct usb_host_interface *ifcom, *ifdata; struct usb_host_interface *ifcom, *ifdata;
struct usb_endpoint_descriptor *epctrl, *epread, *epwrite; struct usb_endpoint_descriptor *epctrl, *epread, *epwrite;
int readsize, ctrlsize, minor, i; int readsize, ctrlsize, minor, i, j;
unsigned char *buf; unsigned char *buf;
dev = interface_to_usbdev (intf); dev = interface_to_usbdev (intf);
...@@ -558,23 +558,25 @@ static int acm_probe (struct usb_interface *intf, ...@@ -558,23 +558,25 @@ static int acm_probe (struct usb_interface *intf,
dbg("probing config %d", cfacm->desc.bConfigurationValue); dbg("probing config %d", cfacm->desc.bConfigurationValue);
if (cfacm->desc.bNumInterfaces != 2 || for (j = 0; j < cfacm->desc.bNumInterfaces - 1; j++) {
usb_interface_claimed(cfacm->interface + 0) ||
usb_interface_claimed(cfacm->interface + 1)) if (usb_interface_claimed(cfacm->interface + j) ||
usb_interface_claimed(cfacm->interface + j + 1))
continue; continue;
ifcom = cfacm->interface[0].altsetting + 0; ifcom = cfacm->interface[j].altsetting + 0;
ifdata = cfacm->interface[1].altsetting + 0; ifdata = cfacm->interface[j + 1].altsetting + 0;
if (ifdata->desc.bInterfaceClass != 10 || ifdata->desc.bNumEndpoints < 2) { if (ifdata->desc.bInterfaceClass != 10 || ifdata->desc.bNumEndpoints < 2) {
ifcom = cfacm->interface[1].altsetting + 0; ifcom = cfacm->interface[j + 1].altsetting + 0;
ifdata = cfacm->interface[0].altsetting + 0; ifdata = cfacm->interface[j].altsetting + 0;
if (ifdata->desc.bInterfaceClass != 10 || ifdata->desc.bNumEndpoints < 2) if (ifdata->desc.bInterfaceClass != 10 || ifdata->desc.bNumEndpoints < 2)
continue; continue;
} }
if (ifcom->desc.bInterfaceClass != 2 || ifcom->desc.bInterfaceSubClass != 2 || if (ifcom->desc.bInterfaceClass != 2 || ifcom->desc.bInterfaceSubClass != 2 ||
ifcom->desc.bInterfaceProtocol != 1 || ifcom->desc.bNumEndpoints < 1) ifcom->desc.bInterfaceProtocol < 1 || ifcom->desc.bInterfaceProtocol > 6 ||
ifcom->desc.bNumEndpoints < 1)
continue; continue;
epctrl = &ifcom->endpoint[0].desc; epctrl = &ifcom->endpoint[0].desc;
...@@ -608,7 +610,7 @@ static int acm_probe (struct usb_interface *intf, ...@@ -608,7 +610,7 @@ static int acm_probe (struct usb_interface *intf,
ctrlsize = epctrl->wMaxPacketSize; ctrlsize = epctrl->wMaxPacketSize;
readsize = epread->wMaxPacketSize; readsize = epread->wMaxPacketSize;
acm->writesize = epwrite->wMaxPacketSize; acm->writesize = epwrite->wMaxPacketSize;
acm->iface = cfacm->interface; acm->iface = cfacm->interface + j;
acm->minor = minor; acm->minor = minor;
acm->dev = dev; acm->dev = dev;
...@@ -673,6 +675,7 @@ static int acm_probe (struct usb_interface *intf, ...@@ -673,6 +675,7 @@ static int acm_probe (struct usb_interface *intf,
usb_set_intfdata (intf, acm); usb_set_intfdata (intf, acm);
return 0; return 0;
} }
}
return -EIO; return -EIO;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment