usb: gadget: f_hid: fix zero length packet transfer

If the hid transfer with size divisible to EPs 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: Ia63060b4551d30821beaf494c1ccd7dfb3b6ca22
This commit is contained in:
William Wu
2022-01-24 20:35:32 +08:00
committed by Tao Huang
parent 47e0b52d12
commit 0ca707d005

View File

@@ -489,7 +489,7 @@ try_again:
}
req->status = 0;
req->zero = 0;
req->zero = ((count % hidg->in_ep->maxpacket) == 0);
req->length = count;
req->complete = f_hidg_req_complete;
req->context = hidg;