Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280956
b: refs/heads/master
c: 18b7ede
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Balbi authored and Greg Kroah-Hartman committed Jan 4, 2012
1 parent 4fbe26b commit a6af193
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e28dbb0661ca49ada2d6a307a1ec93dd75d515e0
refs/heads/master: 18b7ede5f7ee2092aedcb578d3ac30bd5d4fc23c
3 changes: 1 addition & 2 deletions trunk/drivers/usb/dwc3/gadget.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/usb/host/xhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2799,8 +2799,7 @@ static int xhci_calculate_streams_and_bitmask(struct xhci_hcd *xhci,
if (ret < 0)
return ret;

max_streams = USB_SS_MAX_STREAMS(
eps[i]->ss_ep_comp.bmAttributes);
max_streams = usb_ss_max_streams(&eps[i]->ss_ep_comp);
if (max_streams < (*num_streams - 1)) {
xhci_dbg(xhci, "Ep 0x%x only supports %u stream IDs.\n",
eps[i]->desc.bEndpointAddress,
Expand Down
20 changes: 19 additions & 1 deletion trunk/include/linux/usb/ch9.h
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,26 @@ struct usb_ss_ep_comp_descriptor {
} __attribute__ ((packed));

#define USB_DT_SS_EP_COMP_SIZE 6

/* Bits 4:0 of bmAttributes if this is a bulk endpoint */
#define USB_SS_MAX_STREAMS(p) (1 << ((p) & 0x1f))
static inline int
usb_ss_max_streams(const struct usb_ss_ep_comp_descriptor *comp)
{
int max_streams;

if (!comp)
return 0;

max_streams = comp->bmAttributes & 0x1f;

if (!max_streams)
return 0;

max_streams = 1 << max_streams;

return max_streams;
}

/* Bits 1:0 of bmAttributes if this is an isoc endpoint */
#define USB_SS_MULT(p) (1 + ((p) & 0x3))

Expand Down

0 comments on commit a6af193

Please sign in to comment.