9
0
Fork 0

Need to restart write queue after stalled endpoint resumed

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@1092 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2008-10-28 17:19:13 +00:00
parent ba245530fb
commit 8e06f0196e
2 changed files with 20 additions and 3 deletions

View File

@ -1294,6 +1294,10 @@ static inline void dm320_ep0setup(struct dm320_usbdev_s *priv)
(privep = dm320_epfindbyaddr(priv, index)) != NULL)
{
privep->halted = 0;
/* Restart the write queue */
(void)dm320_wrrequest(privep);
}
else
{
@ -1595,7 +1599,7 @@ static int dm320_ctlrinterrupt(int irq, FAR void *context)
if (!dm320_rqempty(privep))
{
dm320_wrrequest(privep);
(void)dm320_wrrequest(privep);
}
}
break;
@ -2038,7 +2042,7 @@ static int dm320_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *r
{
usbtrace(TRACE_DEVERROR(DM320_TRACEERR_NULLPACKET), 0);
dm320_putreg8(dm320_getreg8(DM320_USB_PERTXCSR1) | USB_TXCSR1_TXPKTRDY, DM320_USB_PERTXCSR1);
dm320_abortrequest(privep, req, OK);
dm320_abortrequest(privep, privreq, OK);
}
/* If we are stalled, then drop all requests on the floor */
@ -2056,7 +2060,7 @@ static int dm320_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s *r
/* Nothing to transfer -- exit success, with zero bytes transferred */
usbtrace(TRACE_COMPLETE(privep->epphy), privreq->req.xfrd);
dm320_abortrequest(privep, req, OK);
dm320_abortrequest(privep, privreq, OK);
}
/* Handle IN (device-to-host) requests */

View File

@ -2791,8 +2791,21 @@ static int lpc214x_epcancel(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s
static int lpc214x_epstall(FAR struct usbdev_ep_s *ep, boolean resume)
{
FAR struct lpc214x_ep_s *privep = (FAR struct lpc214x_ep_s *)ep;
irqstate_t flags;
/* STALL or RESUME the endpoint */
flags = irqsave();
usbtrace(resume ? TRACE_EPRESUME : TRACE_EPSTALL, privep->epphy);
lpc214x_usbcmd(CMD_USB_EP_SETSTATUS | privep->epphy, (resume ? 0 : USBDEV_EPSTALL));
/* If the endpoint of was resumed, then restart any queue write requests */
if (resume)
{
(void)lpc214x_wrrequest(privep);
}
irqrestore(flags);
return OK;
}