diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2008-10-27 16:39:15 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2008-10-27 16:39:15 +0000 |
commit | 2274da04826fe60da2984a8748a348ce531e0e0d (patch) | |
tree | 3db31cde3d7c77557812c498dbb0ee87e5222599 /nuttx/arch/arm/src/lpc214x | |
parent | 43ec5df3b099beb6f146bd53e93baab55a91d7bb (diff) |
Correct error in end-of-request handling
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@1082 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/arch/arm/src/lpc214x')
-rw-r--r-- | nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c index cb220cc1bb..71c30596d2 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c +++ b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c @@ -958,7 +958,7 @@ static void lpc214x_reqcomplete(struct lpc214x_ep_s *privep, sint16 result) int stalled = privep->stalled; irqstate_t flags; - /* Remove the complete request at the head of the endpoint request list */ + /* Remove the completed request at the head of the endpoint request list */ flags = irqsave(); privreq = lpc214x_rqdequeue(privep); @@ -1014,8 +1014,8 @@ static int lpc214x_wrrequest(struct lpc214x_ep_s *privep) return OK; } - uvdbg("len=%d xfrd=%d nullpkt=%d\n", - privreq->req.len, privreq->req.xfrd, privep->txnullpkt); + ullvdbg("epphy=%d req=%p: len=%d xfrd=%d nullpkt=%d\n", + privep->epphy, privreq, privreq->req.len, privreq->req.xfrd, privep->txnullpkt); /* Ignore any attempt to send a zero length packet on anything but EP0IN */ @@ -1090,7 +1090,7 @@ static int lpc214x_wrrequest(struct lpc214x_ep_s *privep) * then we are finished with the transfer */ - if (bytesleft <= 0 && !privep->txnullpkt) + if (privreq->req.xfrd >= privreq->req.len && !privep->txnullpkt) { usbtrace(TRACE_COMPLETE(privep->epphy), privreq->req.xfrd); privep->txnullpkt = 0; @@ -1123,8 +1123,8 @@ static int lpc214x_rdrequest(struct lpc214x_ep_s *privep) return OK; } - uvdbg("len=%d xfrd=%d nullpkt=%d\n", - privreq->req.len, privreq->req.xfrd, privep->txnullpkt); + ullvdbg("len=%d xfrd=%d nullpkt=%d\n", + privreq->req.len, privreq->req.xfrd, privep->txnullpkt); /* Ignore any attempt to receive a zero length packet */ @@ -1526,8 +1526,8 @@ static inline void lpc214x_ep0setup(struct lpc214x_usbdev_s *priv) index = GETUINT16(ctrl.index); len = GETUINT16(ctrl.len); - uvdbg("type=%02x req=%02x value=%04x index=%04x len=%04x\n", - ctrl.type, ctrl.req, value, index, len); + ullvdbg("type=%02x req=%02x value=%04x index=%04x len=%04x\n", + ctrl.type, ctrl.req, value, index, len); /* Dispatch any non-standard requests */ @@ -1671,7 +1671,7 @@ static inline void lpc214x_ep0setup(struct lpc214x_usbdev_s *priv) if (((ctrl.type & USB_REQ_RECIPIENT_MASK) == USB_REQ_RECIPIENT_DEVICE) && value == USB_FEATURE_TESTMODE) { - uvdbg("test mode: %d\n", index); + ullvdbg("test mode: %d\n", index); } else if ((ctrl.type & USB_REQ_RECIPIENT_MASK) != USB_REQ_RECIPIENT_ENDPOINT) { @@ -2240,7 +2240,7 @@ static int lpc214x_usbinterrupt(int irq, FAR void *context) } else { - uvdbg("Pending data on OUT endpoint\n"); + ullvdbg("Pending data on OUT endpoint\n"); priv->rxpending = 1; } } @@ -2687,7 +2687,7 @@ static int lpc214x_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s if (!req || !req->callback || !req->buf || !ep) { usbtrace(TRACE_DEVERROR(LPC214X_TRACEERR_INVALIDPARMS), 0); - uvdbg("req=%p callback=%p buf=%p ep=%p\n", req, req->callback, req->buf, ep); + ullvdbg("req=%p callback=%p buf=%p ep=%p\n", req, req->callback, req->buf, ep); return -EINVAL; } #endif |