OSDN Git Service

usb: gadget: dummy_hcd: emulate sending zlp in packet logic
authorIgor Kotrasinski <i.kotrasinsk@samsung.com>
Tue, 15 Sep 2015 14:55:29 +0000 (16:55 +0200)
committerFelipe Balbi <balbi@ti.com>
Mon, 21 Sep 2015 19:42:35 +0000 (14:42 -0500)
commit21c3ee93867694e8c7382ff77b4645b50d3233e9
treeb9c9c718220143a1f8c83399691907b97e324efc
parentb8239dcc03afbd0886c1d9b91ba8fee7c6c9a6cb
usb: gadget: dummy_hcd: emulate sending zlp in packet logic

currently, when a zlp flag is set and an urb/usb_request
buffer is filled without a short packet, transfer() leaves
its status at -EINPROGRESS and does not rescan for short
packet.

In a scenario where ep.maxpacket bytes are copied,
URB_ZERO_PACKET is set, urb buffer is filled and usb_request
buffer is not, transfer() returns with an urb with
-EINPROGRESS status, which dummy_hcd treats as incomplete
transfer.

Check for zlp and rescan appropriately.

Signed-off-by: Igor Kotrasinski <i.kotrasinsk@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc/dummy_hcd.c