usb: gadget: f_hid: fix zero length packet transfer for ep0
If the hid transfer with size divisible to EP0 max packet size, it needs to set the req->zero to true, then the usb controller can transfer a zero length packet at the end according to the USB 2.0 spec. Signed-off-by: William Wu <william.wu@rock-chips.com> Change-Id: Iae8c06966efe49c3a33213f9c36dd752633e8bd1
This commit is contained in:
parent
0ca707d005
commit
0bf324da22
1 changed files with 1 additions and 1 deletions
|
|
@ -760,7 +760,7 @@ stall:
|
|||
return -EOPNOTSUPP;
|
||||
|
||||
respond:
|
||||
req->zero = 0;
|
||||
req->zero = ((length % cdev->gadget->ep0->maxpacket) == 0);
|
||||
req->length = length;
|
||||
status = usb_ep_queue(cdev->gadget->ep0, req, GFP_ATOMIC);
|
||||
if (status < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue