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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
e28dbb0661
commit
18b7ede5f7
@@ -297,8 +297,7 @@ static int dwc3_gadget_set_ep_config(struct dwc3 *dwc, struct dwc3_ep *dep,
|
||||
params.param1 = DWC3_DEPCFG_XFER_COMPLETE_EN
|
||||
| DWC3_DEPCFG_XFER_NOT_READY_EN;
|
||||
|
||||
if (comp_desc && USB_SS_MAX_STREAMS(comp_desc->bmAttributes)
|
||||
&& usb_endpoint_xfer_bulk(desc)) {
|
||||
if (usb_ss_max_streams(comp_desc) && usb_endpoint_xfer_bulk(desc)) {
|
||||
params.param1 |= DWC3_DEPCFG_STREAM_CAPABLE
|
||||
| DWC3_DEPCFG_STREAM_EVENT_EN;
|
||||
dep->stream_capable = true;
|
||||
|
Reference in New Issue
Block a user