From 83200f4f501cff6378fc9655f5abeafc45cb3f93 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 29 Sep 2008 23:04:33 +0000 Subject: Add more trace events git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@961 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c') diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c index aed47a03a..8fc94c2c0 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c +++ b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c @@ -823,6 +823,8 @@ static void lpc214x_cancelrequests(struct lpc214x_ep_s *privep) { while (!sq_empty(&privep->reqlist)) { + usbtrace(TRACE_COMPLETE(privep->epphy), + ((struct lpc214x_req_s *)sq_peek(&privep->reqlist))->req.xfrd); lpc214x_reqcomplete(privep, -ESHUTDOWN); } } @@ -1103,6 +1105,7 @@ static inline void lpc214x_ep0setup(struct lpc214x_usbdev_s *priv) result = -EPROTO; } + usbtrace(TRACE_COMPLETE(ep0->epphy), privreq->req.xfrd); lpc214x_reqcomplete(ep0, result); } @@ -2011,7 +2014,6 @@ static int lpc214x_epdisable(FAR struct usbdev_ep_s *ep) reg &= ~mask; putreg32(reg, LPC214X_USBDEV_EPINTEN); - uvdbg("Disabled ep\n"); irqrestore(flags); return OK; } @@ -2179,6 +2181,7 @@ static int lpc214x_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s { /* Nothing to transfer -- exit success, zero-bytes transferred */ + usbtrace(TRACE_COMPLETE(privep->epphy), privreq->req.xfrd); lpc214x_reqcomplete(privep, OK); goto success_notransfer; } @@ -2209,6 +2212,7 @@ static int lpc214x_epsubmit(FAR struct usbdev_ep_s *ep, FAR struct usbdev_req_s if (ret >= 0) { + usbtrace(TRACE_REQQUEUED(privep->epphy), privreq->req.len); sq_addlast(&privreq->sqe, &privep->reqlist); } @@ -2528,7 +2532,7 @@ void up_usbinitialize(void) usbtrace(TRACE_DEVINIT, 0); - /* Initialize the device state structure softwate EP priority */ + /* Initialize the device state structure */ memset(priv, 0, sizeof(struct lpc214x_usbdev_s)); priv->usbdev.ops = &g_devops; @@ -2632,12 +2636,13 @@ int usbdev_register(struct usbdevclass_driver_s *driver) int ret; usbtrace(TRACE_DEVREGISTER, 0); + #ifdef CONFIG_DEBUG if (!driver || !driver->ops.bind || !driver->ops.unbind || !driver->ops.disconnect || !driver->ops.setup) { - usbtrace(TRACE_ERROR(LPC214X_TRACEERR_INVALIDPARMS), 0); - return -EINVAL; + usbtrace(TRACE_ERROR(LPC214X_TRACEERR_INVALIDPARMS), 0); + return -EINVAL; } if (g_usbdev.driver) -- cgit v1.2.3