From 14072a7991432d5861e51a4b85dc849ef2b1b25e Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 7 Oct 2008 23:06:57 +0000 Subject: [PATCH] Add another trace code for class driver calls git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@995 42af7a65-404d-4744-a932-0658087f49c3 --- drivers/usbdev/usbdev_trace.c | 4 ++ include/nuttx/usbdev_trace.h | 106 ++++++++++++++++++++++------------ 2 files changed, 72 insertions(+), 38 deletions(-) diff --git a/drivers/usbdev/usbdev_trace.c b/drivers/usbdev/usbdev_trace.c index 1982ccabce..c95a9eacfe 100644 --- a/drivers/usbdev/usbdev_trace.c +++ b/drivers/usbdev/usbdev_trace.c @@ -322,6 +322,10 @@ void usbtrace(uint16 event, uint16 value) default: switch (TRACE_ID(event)) { + case TRACE_CLASSAPI_ID: /* Other class driver system API calls */ + lldbg("Class API call %d: %04x\n", TRACE_DATA(event), value); + break; + case TRACE_INTENTRY_ID: /* Interrupt handler entry */ lldbg("Interrrupt %d entry: %04x\n", TRACE_DATA(event), value); break; diff --git a/include/nuttx/usbdev_trace.h b/include/nuttx/usbdev_trace.h index abb6bc720e..74e95078a7 100644 --- a/include/nuttx/usbdev_trace.h +++ b/include/nuttx/usbdev_trace.h @@ -47,28 +47,33 @@ * Preprocessor definitions ****************************************************************************/ +/* Event encoding/decoding macros *******************************************/ + #define TRACE_EVENT(id,data) ((uint16)(id)|(data)) #define TRACE_ID(event) ((event)&0xff00) #define TRACE_DATA(event) ((event)&0x00ff) +/* Events ******************************************************************/ + /* Event class IDs */ #define TRACE_INIT_ID (0x0000) /* Initialization events */ #define TRACE_EP_ID (0x0100) /* Endpoint API calls */ #define TRACE_DEV_ID (0x0200) /* USB device API calls */ #define TRACE_CLASS_ID (0x0300) /* USB class driver API calls */ -#define TRACE_INTENTRY_ID (0x0400) /* Interrupt handler entry */ -#define TRACE_INTDECODE_ID (0x0500) /* Decoded interrupt event */ -#define TRACE_INTEXIT_ID (0x0600) /* Interrupt handler exit */ -#define TRACE_OUTREQQUEUED_ID (0x0700) /* Request queued for OUT endpoint */ -#define TRACE_INREQQUEUED_ID (0x0800) /* Request queued for IN endpoint */ -#define TRACE_READ_ID (0x0900) /* Read (OUT) action */ -#define TRACE_WRITE_ID (0x0a00) /* Write (IN) action */ -#define TRACE_COMPLETE_ID (0x0b00) /* Request completed */ -#define TRACE_DEVERROR_ID (0x0c00) /* USB controller driver error event */ -#define TRACE_CLSERROR_ID (0x0d00) /* USB class driver error event */ +#define TRACE_CLASSAPI_ID (0x0400) /* Other class driver system API calls */ +#define TRACE_INTENTRY_ID (0x0500) /* Interrupt handler entry */ +#define TRACE_INTDECODE_ID (0x0600) /* Decoded interrupt event */ +#define TRACE_INTEXIT_ID (0x0700) /* Interrupt handler exit */ +#define TRACE_OUTREQQUEUED_ID (0x0800) /* Request queued for OUT endpoint */ +#define TRACE_INREQQUEUED_ID (0x0900) /* Request queued for IN endpoint */ +#define TRACE_READ_ID (0x0a00) /* Read (OUT) action */ +#define TRACE_WRITE_ID (0x0b00) /* Write (IN) action */ +#define TRACE_COMPLETE_ID (0x0c00) /* Request completed */ +#define TRACE_DEVERROR_ID (0x0d00) /* USB controller driver error event */ +#define TRACE_CLSERROR_ID (0x0e00) /* USB class driver error event */ -#define TRACE_NIDS 14 +#define TRACE_NIDS 15 /* Initialization events */ @@ -104,6 +109,8 @@ #define TRACE_CLASSSUSPEND TRACE_EVENT(TRACE_CLASS_ID, 0x0005) #define TRACE_CLASSRESUME TRACE_EVENT(TRACE_CLASS_ID, 0x0006) +#define TRACE_CLASSAPI(id) TRACE_EVENT(TRACE_CLASSAPI_ID, id) + /* USB device controller interrupt events. The 'id' is specific to the driver. * Particular values for 'id' are unique for a given implementation of a * controller driver @@ -134,35 +141,58 @@ #define TRACE_CLSERROR(id) TRACE_EVENT(TRACE_CLSERROR_ID, id) +/* USB Serial driver class events *******************************************/ + +/* UART interface API calls */ + +#define USBSER_TRACECLASSAPI_SETUP 0x0001 +#define USBSER_TRACECLASSAPI_SHUTDOWN 0x0002 +#define USBSER_TRACECLASSAPI_ATTACH 0x0003 +#define USBSER_TRACECLASSAPI_DETACH 0x0004 +#define USBSER_TRACECLASSAPI_IOCTL 0x0005 +#define USBSER_TRACECLASSAPI_RECEIVE 0x0006 +#define USBSER_TRACECLASSAPI_RXINT 0x0007 +#define USBSER_TRACECLASSAPI_RXAVAILABLE 0x0008 +#define USBSER_TRACECLASSAPI_SEND 0x0009 +#define USBSER_TRACECLASSAPI_TXINT 0x000a +#define USBSER_TRACECLASSAPI_TXREADY 0x000b +#define USBSER_TRACECLASSAPI_TXEMPTY 0x000c + /* Values of the class error ID used by the USB serial driver */ -#define USBSER_TRACEERR_ALLOCCTRLREQ 0x0001 -#define USBSER_TRACEERR_ALREADYCLOSED 0x0002 -#define USBSER_TRACEERR_CONSOLEREGISTER 0x0003 -#define USBSER_TRACEERR_DEVREGISTER 0x0004 -#define USBSER_TRACEERR_EPRESPQ 0x0005 -#define USBSER_TRACEERR_GETUNKNOWNDESC 0x0006 -#define USBSER_TRACEERR_INALLOCEPFAIL 0x0007 -#define USBSER_TRACEERR_INCONFIGEPFAIL 0x0008 -#define USBSER_TRACEERR_INVALIDARG 0x0009 -#define USBSER_TRACEERR_EP0NOTBOUND 0x000a -#define USBSER_TRACEERR_OUTALLOCEPFAIL 0x000b -#define USBSER_TRACEERR_OUTCONFIGEPFAIL 0x000c -#define USBSER_TRACEERR_RDALLOCREQ 0x000d -#define USBSER_TRACEERR_RDSHUTDOWN 0x000e -#define USBSER_TRACEERR_RDSUBMIT 0x000f -#define USBSER_TRACEERR_RDUNEXPECTED 0x0010 -#define USBSER_TRACEERR_REQRESULT 0x0011 -#define USBSER_TRACEERR_SETUPNOTCONNECTED 0x0012 -#define USBSER_TRACEERR_SUBMITFAIL 0x0013 -#define USBSER_TRACEERR_UARTREGISTER 0x0014 -#define USBSER_TRACEERR_UNSUPPORTEDCTRLREQ 0x0015 -#define USBSER_TRACEERR_UNSUPPORTEDRWREQ 0x0016 -#define USBSER_TRACEERR_UNSUPPORTEDSTDREQ 0x0017 -#define USBSER_TRACEERR_UNSUPPORTEDTYPE 0x0018 -#define USBSER_TRACEERR_WRALLOCREQ 0x0019 -#define USBSER_TRACEERR_WRSHUTDOWN 0x001a -#define USBSER_TRACEERR_WRUNEXPECTED 0x001b +#define USBSER_TRACEERR_ALLOCCTRLREQ 0x0001 +#define USBSER_TRACEERR_ALLOCDEVSTRUCT 0x0002 +#define USBSER_TRACEERR_ALREADYCLOSED 0x0003 +#define USBSER_TRACEERR_ALREADYCONFIGURED 0x0004 +#define USBSER_TRACEERR_CONFIGIDBAD 0x0005 +#define USBSER_TRACEERR_CONFIGNONE 0x0006 +#define USBSER_TRACEERR_CONSOLEREGISTER 0x0007 +#define USBSER_TRACEERR_DEVREGISTER 0x0008 +#define USBSER_TRACEERR_EPRESPQ 0x0009 +#define USBSER_TRACEERR_GETUNKNOWNDESC 0x000a +#define USBSER_TRACEERR_INVALIDARG 0x000b +#define USBSER_TRACEERR_EP0NOTBOUND 0x000c +#define USBSER_TRACEERR_EPBULKINALLOCFAIL 0x000d +#define USBSER_TRACEERR_EPBULKINCONFIGFAIL 0x000e +#define USBSER_TRACEERR_EPBULKOUTALLOCFAIL 0x000f +#define USBSER_TRACEERR_EPINTINALLOCFAIL 0x0010 +#define USBSER_TRACEERR_EPINTINCONFIGFAIL 0x0011 +#define USBSER_TRACEERR_EPBULKOUTCONFIGFAIL 0x0012 +#define USBSER_TRACEERR_RDALLOCREQ 0x0013 +#define USBSER_TRACEERR_RDSHUTDOWN 0x0014 +#define USBSER_TRACEERR_RDSUBMIT 0x0015 +#define USBSER_TRACEERR_RDUNEXPECTED 0x0016 +#define USBSER_TRACEERR_REQRESULT 0x0017 +#define USBSER_TRACEERR_SETUPNOTCONNECTED 0x0018 +#define USBSER_TRACEERR_SUBMITFAIL 0x0019 +#define USBSER_TRACEERR_UARTREGISTER 0x001a +#define USBSER_TRACEERR_UNSUPPORTEDCTRLREQ 0x001b +#define USBSER_TRACEERR_UNSUPPORTEDRWREQ 0x001c +#define USBSER_TRACEERR_UNSUPPORTEDSTDREQ 0x001d +#define USBSER_TRACEERR_UNSUPPORTEDTYPE 0x001e +#define USBSER_TRACEERR_WRALLOCREQ 0x001f +#define USBSER_TRACEERR_WRSHUTDOWN 0x0020 +#define USBSER_TRACEERR_WRUNEXPECTED 0x0021 /**************************************************************************** * Public Types