Commit 090b9011 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

USB: gadget: fix rndis regression

Restore some code that was wrongly dropped from the RNDIS
driver, and caused interop problems observed with OpenMoko.

The issue is with hardware which needs help conforming to part
of the USB 2.0 spec (section 8.5.3.2); some can automagically
send a ZLP in response to an unexpected IN, but not all chips
will do that.  We don't need to check the packet length ourselves
the way earlier code did, since the UDC must already check it.
But we do need to tell the UDC when it must force a short packet
termination of the data stage.

(Based on a patch from Aric D. Blumer <aric at sdgsystems.com>)
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1662e3a7
...@@ -437,7 +437,7 @@ rndis_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl) ...@@ -437,7 +437,7 @@ rndis_setup(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
DBG(cdev, "rndis req%02x.%02x v%04x i%04x l%d\n", DBG(cdev, "rndis req%02x.%02x v%04x i%04x l%d\n",
ctrl->bRequestType, ctrl->bRequest, ctrl->bRequestType, ctrl->bRequest,
w_value, w_index, w_length); w_value, w_index, w_length);
req->zero = 0; req->zero = (value < w_length);
req->length = value; req->length = value;
value = usb_ep_queue(cdev->gadget->ep0, req, GFP_ATOMIC); value = usb_ep_queue(cdev->gadget->ep0, req, GFP_ATOMIC);
if (value < 0) if (value < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment