diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-10-28 17:19:13 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-10-28 17:19:13 +0000 |
commit | ebc1ad6b38a9f4427790c9ded5a4a81248c1d35d (patch) | |
tree | eb4d4c02ffef8b620dc5bf126f63fec5f5274c7a | |
parent | f8c80edc454ccbce3679b0e16b1ead6f2312e9cb (diff) | |
download | px4-nuttx-ebc1ad6b38a9f4427790c9ded5a4a81248c1d35d.tar.gz px4-nuttx-ebc1ad6b38a9f4427790c9ded5a4a81248c1d35d.tar.bz2 px4-nuttx-ebc1ad6b38a9f4427790c9ded5a4a81248c1d35d.zip |
Need to restart write queue after stalled endpoint resumed
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1092 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/arch/arm/src/dm320/dm320_usbdev.c | 10 | ||||
-rw-r--r-- | nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c | 13 |
2 files changed, 20 insertions, 3 deletions
diff --git a/nuttx/arch/arm/src/dm320/dm320_usbdev.c b/nuttx/arch/arm/src/dm320/dm320_usbdev.c index 0076f0067..b77cf2317 100644 --- a/nuttx/arch/arm/src/dm320/dm320_usbdev.c +++ b/nuttx/arch/arm/src/dm320/dm320_usbdev.c @@ -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 */ diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c index e23da86cc..f4bd1bd13 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c +++ b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c @@ -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; } |