usb: XHCI: Handle ZLP data properly in control transfers
USB control transfers can contain an optional IN data stage, in which
case the xHCI driver would queue an additional TRB. The interrupt on
short packet (ISP) bit is set so that the host controller driver can
update the URB's actual_length field if packet is received has length
less than the queued buffer.
A zero-length packet (ZLP) received during the data stage is a special
case of a short packet but is currently not handled properly since during
the subsequent status stage the driver ends up overwriting the
actual_length field with transfer_buffer_length, which was the original
buffer length. A function driver will then incorrectly interpret the
completed URB as being of full length.
Fix this by setting a flag when a ZLP is received in the data stage so
that the urb->actual_length remains 0 and does not get overwritten in
the status stage.
Change-Id: Ie2e5c55c2296d89c496f2c803b0050ff5c5831a1
Signed-off-by:
Hemant Kumar <hemantk@codeaurora.org>
Loading
Please register or sign in to comment