diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/core/config.c | 17 | ||||
-rw-r--r-- | drivers/usb/host/ehci-q.c | 16 |
2 files changed, 32 insertions, 1 deletions
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index a92122a216bc..568244c99bdc 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c | |||
@@ -145,6 +145,23 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum, | |||
145 | endpoint->desc.wMaxPacketSize = cpu_to_le16(8); | 145 | endpoint->desc.wMaxPacketSize = cpu_to_le16(8); |
146 | } | 146 | } |
147 | 147 | ||
148 | /* | ||
149 | * Some buggy high speed devices have bulk endpoints using | ||
150 | * maxpacket sizes other than 512. High speed HCDs may not | ||
151 | * be able to handle that particular bug, so let's warn... | ||
152 | */ | ||
153 | if (to_usb_device(ddev)->speed == USB_SPEED_HIGH | ||
154 | && usb_endpoint_xfer_bulk(d)) { | ||
155 | unsigned maxp; | ||
156 | |||
157 | maxp = le16_to_cpu(endpoint->desc.wMaxPacketSize) & 0x07ff; | ||
158 | if (maxp != 512) | ||
159 | dev_warn(ddev, "config %d interface %d altsetting %d " | ||
160 | "bulk endpoint 0x%X has invalid maxpacket %d\n", | ||
161 | cfgno, inum, asnum, d->bEndpointAddress, | ||
162 | maxp); | ||
163 | } | ||
164 | |||
148 | /* Skip over any Class Specific or Vendor Specific descriptors; | 165 | /* Skip over any Class Specific or Vendor Specific descriptors; |
149 | * find the next endpoint or interface descriptor */ | 166 | * find the next endpoint or interface descriptor */ |
150 | endpoint->extra = buffer; | 167 | endpoint->extra = buffer; |
diff --git a/drivers/usb/host/ehci-q.c b/drivers/usb/host/ehci-q.c index 2e49de820b14..c0e752cffc68 100644 --- a/drivers/usb/host/ehci-q.c +++ b/drivers/usb/host/ehci-q.c | |||
@@ -657,6 +657,14 @@ qh_make ( | |||
657 | type = usb_pipetype (urb->pipe); | 657 | type = usb_pipetype (urb->pipe); |
658 | maxp = usb_maxpacket (urb->dev, urb->pipe, !is_input); | 658 | maxp = usb_maxpacket (urb->dev, urb->pipe, !is_input); |
659 | 659 | ||
660 | /* 1024 byte maxpacket is a hardware ceiling. High bandwidth | ||
661 | * acts like up to 3KB, but is built from smaller packets. | ||
662 | */ | ||
663 | if (max_packet(maxp) > 1024) { | ||
664 | ehci_dbg(ehci, "bogus qh maxpacket %d\n", max_packet(maxp)); | ||
665 | goto done; | ||
666 | } | ||
667 | |||
660 | /* Compute interrupt scheduling parameters just once, and save. | 668 | /* Compute interrupt scheduling parameters just once, and save. |
661 | * - allowing for high bandwidth, how many nsec/uframe are used? | 669 | * - allowing for high bandwidth, how many nsec/uframe are used? |
662 | * - split transactions need a second CSPLIT uframe; same question | 670 | * - split transactions need a second CSPLIT uframe; same question |
@@ -757,7 +765,13 @@ qh_make ( | |||
757 | info2 |= (EHCI_TUNE_MULT_HS << 30); | 765 | info2 |= (EHCI_TUNE_MULT_HS << 30); |
758 | } else if (type == PIPE_BULK) { | 766 | } else if (type == PIPE_BULK) { |
759 | info1 |= (EHCI_TUNE_RL_HS << 28); | 767 | info1 |= (EHCI_TUNE_RL_HS << 28); |
760 | info1 |= 512 << 16; /* usb2 fixed maxpacket */ | 768 | /* The USB spec says that high speed bulk endpoints |
769 | * always use 512 byte maxpacket. But some device | ||
770 | * vendors decided to ignore that, and MSFT is happy | ||
771 | * to help them do so. So now people expect to use | ||
772 | * such nonconformant devices with Linux too; sigh. | ||
773 | */ | ||
774 | info1 |= max_packet(maxp) << 16; | ||
761 | info2 |= (EHCI_TUNE_MULT_HS << 30); | 775 | info2 |= (EHCI_TUNE_MULT_HS << 30); |
762 | } else { /* PIPE_INTERRUPT */ | 776 | } else { /* PIPE_INTERRUPT */ |
763 | info1 |= max_packet (maxp) << 16; | 777 | info1 |= max_packet (maxp) << 16; |