aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2007-08-26 15:44:24 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-09-11 10:48:16 -0400
commit49b4f902857c3d8d95b47ae5a8cecb34ae96a3ba (patch)
tree8398d8c1acdd99035cdad0cfd2b78030db86078a /drivers
parent86833691c21efba661bd3512d2ebfa0b96c011c5 (diff)
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 <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/serial.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c
index 9cd98e73dc1d..ce4d2e09633d 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,
1691 1691
1692 switch (ctrl->bRequest) { 1692 switch (ctrl->bRequest) {
1693 case USB_CDC_REQ_SET_LINE_CODING: 1693 case USB_CDC_REQ_SET_LINE_CODING:
1694 ret = min(wLength, 1694 /* FIXME Submit req to read the data; have its completion
1695 (u16)sizeof(struct usb_cdc_line_coding)); 1695 * handler copy that data to port->port_line_coding (iff
1696 if (port) { 1696 * it's valid) and maybe pass it on. Until then, fail.
1697 spin_lock(&port->port_lock); 1697 */
1698 memcpy(&port->port_line_coding, req->buf, ret); 1698 printk(KERN_WARNING "gs_setup: set_line_coding "
1699 spin_unlock(&port->port_lock); 1699 "unuspported\n");
1700 }
1701 ret = 0;
1702 break; 1700 break;
1703 1701
1704 case USB_CDC_REQ_GET_LINE_CODING: 1702 case USB_CDC_REQ_GET_LINE_CODING:
@@ -1713,11 +1711,18 @@ static int gs_setup_class(struct usb_gadget *gadget,
1713 break; 1711 break;
1714 1712
1715 case USB_CDC_REQ_SET_CONTROL_LINE_STATE: 1713 case USB_CDC_REQ_SET_CONTROL_LINE_STATE:
1716 ret = 0; 1714 /* FIXME Submit req to read the data; have its completion
1715 * handler use that to set the state (iff it's valid) and
1716 * maybe pass it on. Until then, fail.
1717 */
1718 printk(KERN_WARNING "gs_setup: set_control_line_state "
1719 "unuspported\n");
1717 break; 1720 break;
1718 1721
1719 default: 1722 default:
1720 printk(KERN_ERR "gs_setup: unknown class request, type=%02x, request=%02x, value=%04x, index=%04x, length=%d\n", 1723 printk(KERN_ERR "gs_setup: unknown class request, "
1724 "type=%02x, request=%02x, value=%04x, "
1725 "index=%04x, length=%d\n",
1721 ctrl->bRequestType, ctrl->bRequest, 1726 ctrl->bRequestType, ctrl->bRequest,
1722 wValue, wIndex, wLength); 1727 wValue, wIndex, wLength);
1723 break; 1728 break;