usb: fix bug: no response to zero length out control request
authorlyz <lyz@rock-chips.com>
Wed, 24 Apr 2013 09:56:24 +0000 (17:56 +0800)
committerlyz <lyz@rock-chips.com>
Fri, 26 Apr 2013 06:36:16 +0000 (14:36 +0800)
drivers/usb/dwc_otg/dwc_otg_pcd.c
drivers/usb/dwc_otg/dwc_otg_pcd_intr.c

index 06b00d9c43442887d96530cca9a9e446e74448ad..ba9516bc9c0e82e0c965fa0b69d109f88a9357d3 100755 (executable)
@@ -662,7 +662,13 @@ static int dwc_otg_pcd_ep_queue(struct usb_ep *_ep,
                                        pcd->ep0state = EP0_STATUS;
                                }
                                break;
-                                               
+                               
+                       case EP0_STATUS:
+                               DWC_DEBUGPL(DBG_PCD,
+                                           "%s ep0: EP0_IN_STATUS_PHASE\n",
+                                           __func__);
+                               break;
+                               
                        default:
                                DWC_DEBUGPL(DBG_ANY, "ep0: odd state %d\n", 
                                                                                        pcd->ep0state);
index 5e1a7ccf4e6ad89260f4e605fa6bd5cb54ed93be..7f207908d14570de82ca900c2ae1610ca72d3ea2 100755 (executable)
@@ -1486,7 +1486,11 @@ static inline void pcd_setup( dwc_otg_pcd_t *_pcd )
                ep0->dwc_ep.is_in = 0;
                _pcd->ep0state = EP0_OUT_DATA_PHASE;
        }
-
+    if (ctrl.wLength == 0) 
+       {                
+               ep0->dwc_ep.is_in = 1;
+               _pcd->ep0state = EP0_STATUS;
+       } 
        if ((ctrl.bRequestType & USB_TYPE_MASK) != USB_TYPE_STANDARD) 
        {
                /* handle non-standard (class/vendor) requests in the gadget driver */