diff options
author | Felipe Balbi <balbi@ti.com> | 2012-01-02 06:35:41 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2012-01-04 18:52:42 -0500 |
commit | 18b7ede5f7ee2092aedcb578d3ac30bd5d4fc23c (patch) | |
tree | a49fe4ec2a86b37c8bed5041b8314c118b1ebead /drivers/usb/host/xhci.c | |
parent | e28dbb0661ca49ada2d6a307a1ec93dd75d515e0 (diff) |
usb: ch9: fix up MaxStreams helper
According to USB 3.0 Specification Table 9-22, if
bmAttributes [4:0] are set to zero, it means "no
streams supported", but the way this helper was
defined on Linux, we will *always* have one stream
which might cause several problems.
For example on DWC3, we would tell the controller
endpoint has streams enabled and yet start transfers
with Stream ID set to 0, which would goof up the host
side.
While doing that, convert the macro to an inline
function due to the different checks we now need.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/xhci.c')
-rw-r--r-- | drivers/usb/host/xhci.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index f3d0b8d96440..dda84756c465 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -2799,8 +2799,7 @@ static int xhci_calculate_streams_and_bitmask(struct xhci_hcd *xhci, | |||
2799 | if (ret < 0) | 2799 | if (ret < 0) |
2800 | return ret; | 2800 | return ret; |
2801 | 2801 | ||
2802 | max_streams = USB_SS_MAX_STREAMS( | 2802 | max_streams = usb_ss_max_streams(&eps[i]->ss_ep_comp); |
2803 | eps[i]->ss_ep_comp.bmAttributes); | ||
2804 | if (max_streams < (*num_streams - 1)) { | 2803 | if (max_streams < (*num_streams - 1)) { |
2805 | xhci_dbg(xhci, "Ep 0x%x only supports %u stream IDs.\n", | 2804 | xhci_dbg(xhci, "Ep 0x%x only supports %u stream IDs.\n", |
2806 | eps[i]->desc.bEndpointAddress, | 2805 | eps[i]->desc.bEndpointAddress, |