usb: fix bug: no response to zero length out control request

This commit is contained in:
lyz
2013-04-24 17:56:24 +08:00
parent 3fcb34e087
commit 6d6f4f61d6
2 changed files with 12 additions and 2 deletions

View File

@@ -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);

View File

@@ -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 */