mirror of
https://github.com/torvalds/linux.git
synced 2024-12-23 11:21:33 +00:00
usb: gadget: dummy_hcd: initialize max_streams early
While playing with uasp I noticed that it does not work with dummy_hcd. The problem is that uasp requires a stream capable endpoint which it is requesting at bind time like every other gadget. dummy_hcd however initializes the max_stream value after connect once it knows if it runs at SS or not. I don't think that it is might be wrong to initialize the stream capability even at HS speed. The gadget may not use this descriptor at HS speed so it should not cause any damage. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
dcd6c92267
commit
c688419141
@ -800,17 +800,10 @@ static int dummy_set_selfpowered (struct usb_gadget *_gadget, int value)
|
|||||||
|
|
||||||
static void dummy_udc_udpate_ep0(struct dummy *dum)
|
static void dummy_udc_udpate_ep0(struct dummy *dum)
|
||||||
{
|
{
|
||||||
u32 i;
|
if (dum->gadget.speed == USB_SPEED_SUPER)
|
||||||
|
|
||||||
if (dum->gadget.speed == USB_SPEED_SUPER) {
|
|
||||||
for (i = 0; i < DUMMY_ENDPOINTS; i++)
|
|
||||||
dum->ep[i].ep.max_streams = 0x10;
|
|
||||||
dum->ep[0].ep.maxpacket = 9;
|
dum->ep[0].ep.maxpacket = 9;
|
||||||
} else {
|
else
|
||||||
for (i = 0; i < DUMMY_ENDPOINTS; i++)
|
|
||||||
dum->ep[i].ep.max_streams = 0;
|
|
||||||
dum->ep[0].ep.maxpacket = 64;
|
dum->ep[0].ep.maxpacket = 64;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dummy_pullup (struct usb_gadget *_gadget, int value)
|
static int dummy_pullup (struct usb_gadget *_gadget, int value)
|
||||||
@ -954,6 +947,7 @@ static void init_dummy_udc_hw(struct dummy *dum)
|
|||||||
ep->halted = ep->wedged = ep->already_seen =
|
ep->halted = ep->wedged = ep->already_seen =
|
||||||
ep->setup_stage = 0;
|
ep->setup_stage = 0;
|
||||||
ep->ep.maxpacket = ~0;
|
ep->ep.maxpacket = ~0;
|
||||||
|
ep->ep.max_streams = 16;
|
||||||
ep->last_io = jiffies;
|
ep->last_io = jiffies;
|
||||||
ep->gadget = &dum->gadget;
|
ep->gadget = &dum->gadget;
|
||||||
ep->desc = NULL;
|
ep->desc = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user