aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2007-06-08 15:25:02 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-12 19:34:31 -0400
commit60aac1ec26b960fe77bf600457bc6c06f8aa7db4 (patch)
tree04f9c9efa42391e85c9590f9859dedc9650ef3c7 /drivers/usb
parent52f6b5e1f15fa8c06efa69a4b5faa69c04707c92 (diff)
USB: Handle bogus low-speed Bulk endpoints
A noticeable number of low-speed devices mistakenly include descriptors for Bulk endpoints, which is forbidden by the USB spec. In an attempt to make such devices more usable, this patch (as924) converts the descriptors to Interrupt with an interval of 1 ms. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/config.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index dd3482328ad2..9152e12dcf71 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -124,6 +124,21 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
124 endpoint->desc.bInterval = n; 124 endpoint->desc.bInterval = n;
125 } 125 }
126 126
127 /* Some buggy low-speed devices have Bulk endpoints, which is
128 * explicitly forbidden by the USB spec. In an attempt to make
129 * them usable, we will try treating them as Interrupt endpoints.
130 */
131 if (to_usb_device(ddev)->speed == USB_SPEED_LOW &&
132 usb_endpoint_xfer_bulk(d)) {
133 dev_warn(ddev, "config %d interface %d altsetting %d "
134 "endpoint 0x%X is Bulk; changing to Interrupt\n",
135 cfgno, inum, asnum, d->bEndpointAddress);
136 endpoint->desc.bmAttributes = USB_ENDPOINT_XFER_INT;
137 endpoint->desc.bInterval = 1;
138 if (le16_to_cpu(endpoint->desc.wMaxPacketSize) > 8)
139 endpoint->desc.wMaxPacketSize = cpu_to_le16(8);
140 }
141
127 /* Skip over any Class Specific or Vendor Specific descriptors; 142 /* Skip over any Class Specific or Vendor Specific descriptors;
128 * find the next endpoint or interface descriptor */ 143 * find the next endpoint or interface descriptor */
129 endpoint->extra = buffer; 144 endpoint->extra = buffer;