Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=49b4f902857c3d8d95b47ae5a8cecb34ae96a3ba
Commit:     49b4f902857c3d8d95b47ae5a8cecb34ae96a3ba
Parent:     86833691c21efba661bd3512d2ebfa0b96c011c5
Author:     David Brownell <[EMAIL PROTECTED]>
AuthorDate: Sun Aug 26 12:44:24 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Tue Sep 11 07:48:16 2007 -0700

    USB: fix serial gadget ACM breakage
    
    Two of the CDC ACM control requests in the serial gadget have never
    been correct, and have been reported to cause serious troubles ... as
    in, soft lockup and maybe watchdog reset (depending on hardware).
    
    This patch makes those request fail cleanly, rather than misbehaving.
    Someone using CDC ACM should fix them according to the FIXME comments
    which now replace the previous bugs.
    
    Signed-off-by: David Brownell <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 drivers/usb/gadget/serial.c |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index 9cd98e7..ce4d2e0 100644
--- a/drivers/usb/gadget/serial.c
+++ b/drivers/usb/gadget/serial.c
@@ -1691,14 +1691,12 @@ static int gs_setup_class(struct usb_gadget *gadget,
 
        switch (ctrl->bRequest) {
        case USB_CDC_REQ_SET_LINE_CODING:
-               ret = min(wLength,
-                       (u16)sizeof(struct usb_cdc_line_coding));
-               if (port) {
-                       spin_lock(&port->port_lock);
-                       memcpy(&port->port_line_coding, req->buf, ret);
-                       spin_unlock(&port->port_lock);
-               }
-               ret = 0;
+               /* FIXME Submit req to read the data; have its completion
+                * handler copy that data to port->port_line_coding (iff
+                * it's valid) and maybe pass it on.  Until then, fail.
+                */
+               printk(KERN_WARNING "gs_setup: set_line_coding "
+                               "unuspported\n");
                break;
 
        case USB_CDC_REQ_GET_LINE_CODING:
@@ -1713,11 +1711,18 @@ static int gs_setup_class(struct usb_gadget *gadget,
                break;
 
        case USB_CDC_REQ_SET_CONTROL_LINE_STATE:
-               ret = 0;
+               /* FIXME Submit req to read the data; have its completion
+                * handler use that to set the state (iff it's valid) and
+                * maybe pass it on.  Until then, fail.
+                */
+               printk(KERN_WARNING "gs_setup: set_control_line_state "
+                               "unuspported\n");
                break;
 
        default:
-               printk(KERN_ERR "gs_setup: unknown class request, type=%02x, 
request=%02x, value=%04x, index=%04x, length=%d\n",
+               printk(KERN_ERR "gs_setup: unknown class request, "
+                               "type=%02x, request=%02x, value=%04x, "
+                               "index=%04x, length=%d\n",
                        ctrl->bRequestType, ctrl->bRequest,
                        wValue, wIndex, wLength);
                break;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to