From 11911ac2a3a14ee514525499f4c57c72c131d5ea Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 3 Oct 2008 21:53:31 +0000 Subject: [PATCH] Add an errorcode git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@975 42af7a65-404d-4744-a932-0658087f49c3 --- include/nuttx/usb.h | 20 ++++++++++++++++++++ include/nuttx/usbdev_trace.h | 27 ++++++++++++++------------- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/include/nuttx/usb.h b/include/nuttx/usb.h index a70cd3e0ce..66818c3e6f 100644 --- a/include/nuttx/usb.h +++ b/include/nuttx/usb.h @@ -201,6 +201,7 @@ struct usb_ctrlreq_s ubyte index[2]; ubyte len[2]; }; +#define USB_SIZEOF_CTRLREQ 8 /* Generic descriptor */ @@ -229,6 +230,7 @@ struct usb_devdesc_s ubyte serno; /* Serial number */ ubyte nconfigs; /* Number of configurations */ }; +#define USB_SIZEOF_DEVDESC 18 /* Configuration descriptor */ @@ -243,6 +245,20 @@ struct usb_cfgdesc_s ubyte attr; /* Attributes */ ubyte mxpower; /* Max power (mA/2) */ }; +#define USB_SIZEOF_CFGDESC 9 + +struct usb_otherspeedconfigdesc_s +{ + ubyte len; /* Descriptor length */ + ubyte type; /* Descriptor type */ + ubyte totallen[2]; /* Total length */ + ubyte ninterfaces; /* Number of interfaces */ + ubyte cfgvalue; /* Configuration value */ + ubyte icfg; /* Configuration */ + ubyte attr; /* Attributes */ + ubyte mxpower; /* Max power (mA/2) */ +}; +#define USB_SIZEOF_OTHERSPEEDCONFIGDESC 9 /* String descriptor */ @@ -267,6 +283,7 @@ struct usb_ifdesc_s ubyte protocol; /* Interface protocol */ ubyte iif; /* iInterface */ }; +#define USB_SIZEOF_IFDESC 9 /* Endpoint descriptor */ @@ -279,6 +296,7 @@ struct usb_epdesc_s ubyte mxpacketsize[2]; /* Maximum packet size */ ubyte interval; /* Interval */ }; +#define USB_SIZEOF_EPDESC 7 struct usb_audioepdesc_s { @@ -286,6 +304,7 @@ struct usb_audioepdesc_s ubyte refresh; ubyte synchaddr; }; +#define USB_SIZEOF_AUDIOEPDESC 9 /* Device qualifier descriptor */ @@ -301,6 +320,7 @@ struct usb_qualdesc_s ubyte nconfigs; /* Number of configurations */ ubyte reserved; }; +#define USB_SIZEOF_QUALDESC 10 /************************************************************************************ * Private Data diff --git a/include/nuttx/usbdev_trace.h b/include/nuttx/usbdev_trace.h index 02ce49f153..804ea20470 100644 --- a/include/nuttx/usbdev_trace.h +++ b/include/nuttx/usbdev_trace.h @@ -145,19 +145,20 @@ #define USBSER_TRACEERR_INALLOCEPFAIL 0x0007 #define USBSER_TRACEERR_INCONFIGEPFAIL 0x0008 #define USBSER_TRACEERR_INVALIDARG 0x0009 -#define USBSER_TRACEERR_OUTALLOCEPFAIL 0x000a -#define USBSER_TRACEERR_OUTCONFIGEPFAIL 0x000b -#define USBSER_TRACEERR_RDALLOCREQ 0x000c -#define USBSER_TRACEERR_RDSHUTDOWN 0x000d -#define USBSER_TRACEERR_RDSUBMIT 0x000e -#define USBSER_TRACEERR_RDUNEXPECTED 0x000f -#define USBSER_TRACEERR_REQRESULT 0x0010 -#define USBSER_TRACEERR_SETUPNOTCONNECTED 0x0011 -#define USBSER_TRACEERR_SUBMITFAIL 0x0012 -#define USBSER_TRACEERR_UARTREGISTER 0x0013 -#define USBSER_TRACEERR_WRALLOCREQ 0x0014 -#define USBSER_TRACEERR_WRSHUTDOWN 0x0015 -#define USBSER_TRACEERR_WRUNEXPECTED 0x0016 +#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_WRALLOCREQ 0x0015 +#define USBSER_TRACEERR_WRSHUTDOWN 0x0016 +#define USBSER_TRACEERR_WRUNEXPECTED 0x0017 /**************************************************************************** * Public Types