aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAric D. Blumer <aric@sdgsystems.com>2009-03-16 16:28:45 -0600
committerWerner Almesberger <werner@openmoko.org>2009-03-26 00:20:38 -0300
commitf63e59c84aa21d2745f115209bf949eca27008b1 (patch)
treef4764d774d2f1364d5ec46d805e0d486a04c156c /drivers
parent15d8c3d8467d0a697d14d144f95b1c4aaf3dbf10 (diff)
Zero packet length detection for RNDIS fix. Migrated from 2.6.24 series kernel
This patch fixes the issues of RNDIS on the Openmoko Freerunner (and subsequently Windows networking with the Freerunner). It arises from the case where a stall is being issued by the upper level RNDIS driver to the s3c2410_udc.c in the 2.6.28 series driver and it not being handled correctly. This patch changes the RNDIS driver to send zero-length packets instead of a stall, a condition that allowed the udc driver to function correctly in 2.6.24 series kernels. Further investigation into the udc driver is recommended. I am currently looking into it to be able to use the Android ADB gadget driver, which currently has stability issues using the underlying udc on both Linux and Windows (although, it's possible that the Android ADB gadget has problems). Traces and logs of the USB traffic are available upon request. Thanks to Aric at SDG Systems for all of his work on this matter. Regards, Brian Code From de386af349bbfe1ad6d45c810185123975888d8d Mon Sep 17 00:00:00 2001 From: Aric D. Blumer <aric@sdgsystems.com> Date: Mon, 16 Mar 2009 16:04:02 -0600 Subject: [PATCH] Zero packet length detection for RNDIS fix. Migrated from 2.6.24 series kernel Signed-off-by: Aric D. Blumer <aric@sdgsystems.com> Signed-off-by: Brian Code <Brian.Code@koolu.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/f_rndis.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c
index 3a8bb53fc47..d7c7f19b389 100644
--- a/drivers/usb/gadget/f_rndis.c
+++ b/drivers/usb/gadget/f_rndis.c
@@ -437,7 +437,8 @@ invalid:
DBG(cdev, "rndis req%02x.%02x v%04x i%04x l%d\n",
ctrl->bRequestType, ctrl->bRequest,
w_value, w_index, w_length);
- req->zero = 0;
+ req->zero = value < w_length
+ && (value % cdev->gadget->ep0->maxpacket) == 0;
req->length = value;
value = usb_ep_queue(cdev->gadget->ep0, req, GFP_ATOMIC);
if (value < 0)