Re: [PATCH v2 05/11] usb:hsotg:samsung: Sending ZLP packet for IN EP0 transfers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 05-03-2012 15:11, Lukasz Majewski wrote:

When sent data length is equal to maximum packet size (MPS
= 64B for EP0), then a ZLP packet shall be sent to indicate
end of the transfer to a USB host.

Tested with:
- DFU gadget (various size of the sent data - also packet = MPS)
- Ethernet gadget (CDC and RNDIS)
- Multi Function Gadget (g_multi)

HW:
- Samsung's C210 Universal rev.0

Signed-off-by: Lukasz Majewski<l.majewski@xxxxxxxxxxx>
Signed-off-by: Kyungmin Park<kyungmin.park@xxxxxxxxxxx>
---
  drivers/usb/gadget/s3c-hsotg.c |   26 ++++++++++++++++++++++++--
  1 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c
index 0492c20..89e49ce 100644
--- a/drivers/usb/gadget/s3c-hsotg.c
+++ b/drivers/usb/gadget/s3c-hsotg.c
[...]
@@ -1829,9 +1839,21 @@ static void s3c_hsotg_complete_in(struct s3c_hsotg *hsotg,
  			__func__, hs_req->req.actual, size_done);

  	hs_req->req.actual = size_done;
+	dev_dbg(hsotg->dev, "req->length:%d req->actual:%d\n",
+		hs_req->req.length, hs_req->req.actual);

-	/* if we did all of the transfer, and there is more data left
-	 * around, then try restarting the rest of the request */
+	/* Check if dealing with Maximum Packet Size(MPS) IN transfer (EP0)
+	 * When req.lenght == ep.maxpacket then send IN ZLP packet to
+	 * inform host that no more data is available.
+	 */
+	if (hs_req->req.length == hs_req->req.actual&&  hs_ep->index == 0
+	&&  hs_req->req.length == hs_ep->ep.maxpacket) {

   Not 'hs_req->req.length % hs_ep->ep.maxpacket == 0'?

WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux