diff options
author | Andiry Xu <andiry.xu@amd.com> | 2010-11-11 04:43:57 -0500 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2010-11-11 13:47:08 -0500 |
commit | dc07c91b9b4067022210e68d914a6890a4d70622 (patch) | |
tree | 181d91f6e4a66c8c0fa6fa58f19008f3e0b9392d /drivers/usb/host/xhci.h | |
parent | 74bb844af8ec6a4c360b1fc7feb139801c0cacfd (diff) |
xHCI: fix wMaxPacketSize mask
USB2.0 spec 9.6.6 says: For all endpoints, bit 10..0 specify the maximum
packet size(in bytes).
So the wMaxPacketSize mask should be 0x7ff rather than 0x3ff.
This patch should be queued for the stable tree. The bug in
xhci_endpoint_init() was present as far back as 2.6.31, and the bug in
xhci_get_max_esit_payload() was present when the function was introduced
in 2.6.34.
Reported-by: Sander Eikelenboom <linux@eikelenboom.it>
Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
Diffstat (limited to 'drivers/usb/host/xhci.h')
-rw-r--r-- | drivers/usb/host/xhci.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 93d3bf4d213c..85e65647d445 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -621,6 +621,11 @@ struct xhci_ep_ctx { | |||
621 | #define MAX_PACKET_MASK (0xffff << 16) | 621 | #define MAX_PACKET_MASK (0xffff << 16) |
622 | #define MAX_PACKET_DECODED(p) (((p) >> 16) & 0xffff) | 622 | #define MAX_PACKET_DECODED(p) (((p) >> 16) & 0xffff) |
623 | 623 | ||
624 | /* Get max packet size from ep desc. Bit 10..0 specify the max packet size. | ||
625 | * USB2.0 spec 9.6.6. | ||
626 | */ | ||
627 | #define GET_MAX_PACKET(p) ((p) & 0x7ff) | ||
628 | |||
624 | /* tx_info bitmasks */ | 629 | /* tx_info bitmasks */ |
625 | #define AVG_TRB_LENGTH_FOR_EP(p) ((p) & 0xffff) | 630 | #define AVG_TRB_LENGTH_FOR_EP(p) ((p) & 0xffff) |
626 | #define MAX_ESIT_PAYLOAD_FOR_EP(p) (((p) & 0xffff) << 16) | 631 | #define MAX_ESIT_PAYLOAD_FOR_EP(p) (((p) & 0xffff) << 16) |