usb: ch9: fix up MaxStreams helper
commit9f3657ac7841b871c5d2dc8ab51fb08080ae67b1
authorFelipe Balbi <balbi@ti.com>
Mon, 2 Jan 2012 11:35:41 +0000 (2 13:35 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 12 Jan 2012 19:35:33 +0000 (12 11:35 -0800)
tree0c4ec4d85a036dd1e61a6867c76dc49f8e519891
parent9f1efce9d1265de3888ddb4a91cb6d5b14536ff2
usb: ch9: fix up MaxStreams helper

commit 18b7ede5f7ee2092aedcb578d3ac30bd5d4fc23c upstream.

[ removed the dwc3 portion of the patch as it didn't apply to
older kernels - gregkh]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/host/xhci.c
include/linux/usb/ch9.h