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:
parent
ba245530fb
commit
8e06f0196e
|
@ -1294,6 +1294,10 @@ static inline void dm320_ep0setup(struct dm320_usbdev_s *priv)
|
||||||
(privep = dm320_epfindbyaddr(priv, index)) != NULL)
|
(privep = dm320_epfindbyaddr(priv, index)) != NULL)
|
||||||
{
|
{
|
||||||
privep->halted = 0;
|
privep->halted = 0;
|
||||||
|
|
||||||
|
/* Restart the write queue */
|
||||||
|
|
||||||
|
(void)dm320_wrrequest(privep);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1595,7 +1599,7 @@ static int dm320_ctlrinterrupt(int irq, FAR void *context)
|
||||||
|
|
||||||
if (!dm320_rqempty(privep))
|
if (!dm320_rqempty(privep))
|
||||||
{
|
{
|
||||||
dm320_wrrequest(privep);
|
(void)dm320_wrrequest(privep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
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);
|
usbtrace(TRACE_DEVERROR(DM320_TRACEERR_NULLPACKET), 0);
|
||||||
dm320_putreg8(dm320_getreg8(DM320_USB_PERTXCSR1) | USB_TXCSR1_TXPKTRDY, DM320_USB_PERTXCSR1);
|
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 */
|
/* 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 */
|
/* Nothing to transfer -- exit success, with zero bytes transferred */
|
||||||
|
|
||||||
usbtrace(TRACE_COMPLETE(privep->epphy), privreq->req.xfrd);
|
usbtrace(TRACE_COMPLETE(privep->epphy), privreq->req.xfrd);
|
||||||
dm320_abortrequest(privep, req, OK);
|
dm320_abortrequest(privep, privreq, OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle IN (device-to-host) requests */
|
/* Handle IN (device-to-host) requests */
|
||||||
|
|
|
@ -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)
|
static int lpc214x_epstall(FAR struct usbdev_ep_s *ep, boolean resume)
|
||||||
{
|
{
|
||||||
FAR struct lpc214x_ep_s *privep = (FAR struct lpc214x_ep_s *)ep;
|
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);
|
usbtrace(resume ? TRACE_EPRESUME : TRACE_EPSTALL, privep->epphy);
|
||||||
lpc214x_usbcmd(CMD_USB_EP_SETSTATUS | privep->epphy, (resume ? 0 : USBDEV_EPSTALL));
|
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;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue