Commit ac350411c7402d3a25a7bddfdd3c489a3f372fd8

Authored by Li Jun
Committed by Ye Li
1 parent aad2dd8b58

MLK-20909 usb: dwc3: gadget: use usb_endpoint_maxp for req length

As endpoint.maxpackt is set at init for super speed, we can't use it
for USB2 connection, we need use the right max packet length according
to connection speed.

Signed-off-by: Li Jun <jun.li@nxp.com>
(cherry picked from commit 9c6bb3684649b4ae6f0275b5ad3799ea5c8f32df)

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

drivers/usb/dwc3/gadget.c
... ... @@ -968,8 +968,8 @@
968 968 * so HACK the request length
969 969 */
970 970 if (dep->direction == 0 &&
971   - req->request.length < dep->endpoint.maxpacket)
972   - req->request.length = dep->endpoint.maxpacket;
  971 + req->request.length < usb_endpoint_maxp(dep->endpoint.desc))
  972 + req->request.length = usb_endpoint_maxp(dep->endpoint.desc);
973 973  
974 974 /*
975 975 * We only add to our list of requests now and