aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2010-10-14 15:25:21 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 13:22:14 -0400
commit56626a72a47bf3e50875d960d6b5f17b9bee0ab2 (patch)
tree1bcc6ca5c2df4cac875a646bc45d1e26f4bfdf22 /drivers/usb
parent5535b1d5f8885695c6ded783c692e3c0d0eda8ca (diff)
USB: accept some invalid ep0-maxpacket values
A few devices (such as the RCA VR5220 voice recorder) are so non-compliant with the USB spec that they have invalid maxpacket sizes for endpoint 0. Nevertheless, as long as we can safely use them, we may as well do so. This patch (as1432) softens our acceptance criterion by allowing high-speed devices to have ep0-maxpacket sizes other than 64. A warning is printed in the system log when this happens, and the existing error message is clarified. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Reported-by: James <bjlockie@lockie.ca> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/hub.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 7f82c48a0bae..27115b45edc5 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2861,13 +2861,16 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1,
2861 else 2861 else
2862 i = udev->descriptor.bMaxPacketSize0; 2862 i = udev->descriptor.bMaxPacketSize0;
2863 if (le16_to_cpu(udev->ep0.desc.wMaxPacketSize) != i) { 2863 if (le16_to_cpu(udev->ep0.desc.wMaxPacketSize) != i) {
2864 if (udev->speed != USB_SPEED_FULL || 2864 if (udev->speed == USB_SPEED_LOW ||
2865 !(i == 8 || i == 16 || i == 32 || i == 64)) { 2865 !(i == 8 || i == 16 || i == 32 || i == 64)) {
2866 dev_err(&udev->dev, "ep0 maxpacket = %d\n", i); 2866 dev_err(&udev->dev, "Invalid ep0 maxpacket: %d\n", i);
2867 retval = -EMSGSIZE; 2867 retval = -EMSGSIZE;
2868 goto fail; 2868 goto fail;
2869 } 2869 }
2870 dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i); 2870 if (udev->speed == USB_SPEED_FULL)
2871 dev_dbg(&udev->dev, "ep0 maxpacket = %d\n", i);
2872 else
2873 dev_warn(&udev->dev, "Using ep0 maxpacket: %d\n", i);
2871 udev->ep0.desc.wMaxPacketSize = cpu_to_le16(i); 2874 udev->ep0.desc.wMaxPacketSize = cpu_to_le16(i);
2872 usb_ep0_reinit(udev); 2875 usb_ep0_reinit(udev);
2873 } 2876 }