More name changes: USBSER->PL2303 CDCSER->CDCACM

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4337 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo
2012-01-25 23:04:17 +00:00
parent f9739ec32a
commit 758d4cd6e6
121 changed files with 2928 additions and 2928 deletions
+2 -2
View File
@@ -37,11 +37,11 @@ ifeq ($(CONFIG_USBDEV),y)
# Include USB device drivers
ifeq ($(CONFIG_USBSER),y)
ifeq ($(CONFIG_PL2303),y)
CSRCS += pl2303.c
endif
ifeq ($(CONFIG_CDCSER),y)
ifeq ($(CONFIG_CDCACM),y)
CSRCS += cdcacm.c cdcacm_descriptors.c
endif
File diff suppressed because it is too large Load Diff
+84 -84
View File
@@ -53,22 +53,22 @@
****************************************************************************/
/* Configuration ************************************************************/
/* If the serial device is configured as part of a composite device than both
* CONFIG_USBDEV_COMPOSITE and CONFIG_CDCSER_COMPOSITE must be defined.
* CONFIG_USBDEV_COMPOSITE and CONFIG_CDCACM_COMPOSITE must be defined.
*/
#ifndef CONFIG_USBDEV_COMPOSITE
# undef CONFIG_CDCSER_COMPOSITE
# undef CONFIG_CDCACM_COMPOSITE
#endif
#if defined(CONFIG_CDCSER_COMPOSITE) && !defined(CONFIG_CDCSER_STRBASE)
# define CONFIG_CDCSER_STRBASE (4)
#if defined(CONFIG_CDCACM_COMPOSITE) && !defined(CONFIG_CDCACM_STRBASE)
# define CONFIG_CDCACM_STRBASE (4)
#endif
/* Packet and request buffer sizes */
#ifndef CONFIG_CDCSER_COMPOSITE
# ifndef CONFIG_CDCSER_EP0MAXPACKET
# define CONFIG_CDCSER_EP0MAXPACKET 64
#ifndef CONFIG_CDCACM_COMPOSITE
# ifndef CONFIG_CDCACM_EP0MAXPACKET
# define CONFIG_CDCACM_EP0MAXPACKET 64
# endif
#endif
@@ -76,100 +76,100 @@
* device, then the interface IDs may need to be offset.
*/
#ifndef CONFIG_CDCSER_COMPOSITE
# undef CONFIG_CDCSER_IFNOBASE
# define CONFIG_CDCSER_IFNOBASE 0
#ifndef CONFIG_CDCACM_COMPOSITE
# undef CONFIG_CDCACM_IFNOBASE
# define CONFIG_CDCACM_IFNOBASE 0
#endif
#ifndef CONFIG_CDCSER_IFNOBASE
# define CONFIG_CDCSER_IFNOBASE 0
#ifndef CONFIG_CDCACM_IFNOBASE
# define CONFIG_CDCACM_IFNOBASE 0
#endif
/* Descriptors **************************************************************/
/* These settings are not modifiable via the NuttX configuration */
#define CDC_VERSIONNO 0x0110 /* CDC version number 1.10 (BCD) */
#define CDCSER_CONFIGIDNONE (0) /* Config ID means to return to address mode */
#define CDCACM_CONFIGIDNONE (0) /* Config ID means to return to address mode */
/* Interface IDs:
*
* CDCSER_NINTERFACES Two interfaces
* CDCSER_NOTIFID ID of the notifier interface
* CDCSER_NOTALTIFID No alternate for the notifier interface
* CDCSER_DATAIFID ID of the data interface
* CDCSER_DATAALTIFID No alternate for the data interface
* CDCACM_NINTERFACES Two interfaces
* CDCACM_NOTIFID ID of the notifier interface
* CDCACM_NOTALTIFID No alternate for the notifier interface
* CDCACM_DATAIFID ID of the data interface
* CDCACM_DATAALTIFID No alternate for the data interface
*/
#define CDCSER_NINTERFACES (2) /* Number of interfaces in the configuration */
#define CDCSER_NOTIFID (CONFIG_CDCSER_IFNOBASE+0)
#define CDCSER_NOTALTIFID CDCSER_NOTIFID
#define CDCSER_DATAIFID (CONFIG_CDCSER_IFNOBASE+1)
#define CDCSER_DATAALTIFID CDCSER_DATAIFID
#define CDCACM_NINTERFACES (2) /* Number of interfaces in the configuration */
#define CDCACM_NOTIFID (CONFIG_CDCACM_IFNOBASE+0)
#define CDCACM_NOTALTIFID CDCACM_NOTIFID
#define CDCACM_DATAIFID (CONFIG_CDCACM_IFNOBASE+1)
#define CDCACM_DATAALTIFID CDCACM_DATAIFID
/* Configuration descriptor values */
#define CDCSER_CONFIGID (1) /* The only supported configuration ID */
#define CDCACM_CONFIGID (1) /* The only supported configuration ID */
/* Buffer big enough for any of our descriptors (the config descriptor is the
* biggest).
*/
#define CDCSER_MXDESCLEN (64)
#define CDCACM_MXDESCLEN (64)
/* Device descriptor values */
#define CDCSER_VERSIONNO (0x0101) /* Device version number 1.1 (BCD) */
#define CDCSER_NCONFIGS (1) /* Number of configurations supported */
#define CDCACM_VERSIONNO (0x0101) /* Device version number 1.1 (BCD) */
#define CDCACM_NCONFIGS (1) /* Number of configurations supported */
/* String language */
#define CDCSER_STR_LANGUAGE (0x0409) /* en-us */
#define CDCACM_STR_LANGUAGE (0x0409) /* en-us */
/* Descriptor strings. If there serial device is part of a composite device
* then the manufacturer, product, and serial number strings will be provided
* by the composite logic.
*/
#ifndef CONFIG_CDCSER_COMPOSITE
# define CDCSER_MANUFACTURERSTRID (1)
# define CDCSER_PRODUCTSTRID (2)
# define CDCSER_SERIALSTRID (3)
# define CDCSER_CONFIGSTRID (4)
#ifndef CONFIG_CDCACM_COMPOSITE
# define CDCACM_MANUFACTURERSTRID (1)
# define CDCACM_PRODUCTSTRID (2)
# define CDCACM_SERIALSTRID (3)
# define CDCACM_CONFIGSTRID (4)
# undef CONFIG_CDCSER_STRBASE
# define CONFIG_CDCSER_STRBASE (4)
# undef CONFIG_CDCACM_STRBASE
# define CONFIG_CDCACM_STRBASE (4)
#endif
/* These string IDs only exist if a user-defined string is provided */
#ifdef CONFIG_CDCSER_NOTIFSTR
# define CDCSER_NOTIFSTRID (CONFIG_CDCSER_STRBASE+1)
#ifdef CONFIG_CDCACM_NOTIFSTR
# define CDCACM_NOTIFSTRID (CONFIG_CDCACM_STRBASE+1)
#else
# define CDCSER_NOTIFSTRID CONFIG_CDCSER_STRBASE
# define CDCACM_NOTIFSTRID CONFIG_CDCACM_STRBASE
#endif
#ifdef CONFIG_CDCSER_DATAIFSTR
# define CDCSER_DATAIFSTRID (CDCSER_NOTIFSTRID+1)
#ifdef CONFIG_CDCACM_DATAIFSTR
# define CDCACM_DATAIFSTRID (CDCACM_NOTIFSTRID+1)
#else
# define CDCSER_DATAIFSTRID CDCSER_NOTIFSTRID
# define CDCACM_DATAIFSTRID CDCACM_NOTIFSTRID
#endif
#define CDCSER_LASTSTRID CDCSER_DATAIFSTRID
#define CDCACM_LASTSTRID CDCACM_DATAIFSTRID
/* Configuration descriptor size */
#ifndef CONFIG_CDCSER_COMPOSITE
#ifndef CONFIG_CDCACM_COMPOSITE
/* Number of individual descriptors in the configuration descriptor:
* Configuration descriptor + (2) interface descriptors + (3) endpoint
* descriptors + (3) ACM descriptors.
*/
# define CDCSER_CFGGROUP_SIZE (9)
# define CDCACM_CFGGROUP_SIZE (9)
/* The size of the config descriptor: (9 + 2*9 + 3*7 + 4 + 5 + 5) = 62 */
# define SIZEOF_CDCSER_CFGDESC \
# define SIZEOF_CDCACM_CFGDESC \
(USB_SIZEOF_CFGDESC + 2*USB_SIZEOF_IFDESC + 3*USB_SIZEOF_EPDESC + \
SIZEOF_ACM_FUNCDESC + SIZEOF_HDR_FUNCDESC + SIZEOF_UNION_FUNCDESC(1))
#else
@@ -178,25 +178,25 @@
* (2) interface descriptors + (3) endpoint descriptors + (3) ACM descriptors.
*/
# define CDCSER_CFGGROUP_SIZE (8)
# define CDCACM_CFGGROUP_SIZE (8)
/* The size of the config descriptor: (2*9 + 3*7 + 4 + 5 + 5) = 53 */
# define SIZEOF_CDCSER_CFGDESC \
# define SIZEOF_CDCACM_CFGDESC \
(2*USB_SIZEOF_IFDESC + 3*USB_SIZEOF_EPDESC + SIZEOF_ACM_FUNCDESC + \
SIZEOF_HDR_FUNCDESC + SIZEOF_UNION_FUNCDESC(1))
#endif
/* Endpoint configuration ****************************************************/
#define CDCSER_EPINTIN_ADDR (USB_DIR_IN|CONFIG_CDCSER_EPINTIN)
#define CDCSER_EPINTIN_ATTR (USB_EP_ATTR_XFER_INT)
#define CDCACM_EPINTIN_ADDR (USB_DIR_IN|CONFIG_CDCACM_EPINTIN)
#define CDCACM_EPINTIN_ATTR (USB_EP_ATTR_XFER_INT)
#define CDCSER_EPOUTBULK_ADDR (CONFIG_CDCSER_EPBULKOUT)
#define CDCSER_EPOUTBULK_ATTR (USB_EP_ATTR_XFER_BULK)
#define CDCACM_EPOUTBULK_ADDR (CONFIG_CDCACM_EPBULKOUT)
#define CDCACM_EPOUTBULK_ATTR (USB_EP_ATTR_XFER_BULK)
#define CDCSER_EPINBULK_ADDR (USB_DIR_IN|CONFIG_CDCSER_EPBULKIN)
#define CDCSER_EPINBULK_ATTR (USB_EP_ATTR_XFER_BULK)
#define CDCACM_EPINBULK_ADDR (USB_DIR_IN|CONFIG_CDCACM_EPBULKIN)
#define CDCACM_EPINBULK_ATTR (USB_EP_ATTR_XFER_BULK)
/* Misc Macros **************************************************************/
/* MIN/MAX macros */
@@ -211,28 +211,28 @@
/* Trace values *************************************************************/
#define CDCSER_CLASSAPI_SETUP TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_SETUP)
#define CDCSER_CLASSAPI_SHUTDOWN TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_SHUTDOWN)
#define CDCSER_CLASSAPI_ATTACH TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_ATTACH)
#define CDCSER_CLASSAPI_DETACH TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_DETACH)
#define CDCSER_CLASSAPI_IOCTL TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_IOCTL)
#define CDCSER_CLASSAPI_RECEIVE TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_RECEIVE)
#define CDCSER_CLASSAPI_RXINT TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_RXINT)
#define CDCSER_CLASSAPI_RXAVAILABLE TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_RXAVAILABLE)
#define CDCSER_CLASSAPI_SEND TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_SEND)
#define CDCSER_CLASSAPI_TXINT TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_TXINT)
#define CDCSER_CLASSAPI_TXREADY TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_TXREADY)
#define CDCSER_CLASSAPI_TXEMPTY TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_TXEMPTY)
#define CDCACM_CLASSAPI_SETUP TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_SETUP)
#define CDCACM_CLASSAPI_SHUTDOWN TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_SHUTDOWN)
#define CDCACM_CLASSAPI_ATTACH TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_ATTACH)
#define CDCACM_CLASSAPI_DETACH TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_DETACH)
#define CDCACM_CLASSAPI_IOCTL TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_IOCTL)
#define CDCACM_CLASSAPI_RECEIVE TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_RECEIVE)
#define CDCACM_CLASSAPI_RXINT TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_RXINT)
#define CDCACM_CLASSAPI_RXAVAILABLE TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_RXAVAILABLE)
#define CDCACM_CLASSAPI_SEND TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_SEND)
#define CDCACM_CLASSAPI_TXINT TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_TXINT)
#define CDCACM_CLASSAPI_TXREADY TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_TXREADY)
#define CDCACM_CLASSAPI_TXEMPTY TRACE_EVENT(TRACE_CLASSAPI_ID, USBSER_TRACECLASSAPI_TXEMPTY)
/****************************************************************************
* Public Types
****************************************************************************/
enum cdcser_epdesc_e
enum cdcacm_epdesc_e
{
CDCSER_EPINTIN = 0, /* Interrupt IN endpoint descriptor */
CDCSER_EPBULKOUT, /* Bulk OUT endpoint descriptor */
CDCSER_EPBULKIN /* Bulk IN endpoint descriptor */
CDCACM_EPINTIN = 0, /* Interrupt IN endpoint descriptor */
CDCACM_EPBULKOUT, /* Bulk OUT endpoint descriptor */
CDCACM_EPBULKIN /* Bulk IN endpoint descriptor */
};
/****************************************************************************
@@ -244,29 +244,29 @@ enum cdcser_epdesc_e
****************************************************************************/
/****************************************************************************
* Name: cdcser_mkstrdesc
* Name: cdcacm_mkstrdesc
*
* Description:
* Construct a string descriptor
*
****************************************************************************/
int cdcser_mkstrdesc(uint8_t id, struct usb_strdesc_s *strdesc);
int cdcacm_mkstrdesc(uint8_t id, struct usb_strdesc_s *strdesc);
/****************************************************************************
* Name: cdcser_getepdesc
* Name: cdcacm_getepdesc
*
* Description:
* Return a pointer to the raw device descriptor
*
****************************************************************************/
#ifndef CONFIG_CDCSER_COMPOSITE
FAR const struct usb_devdesc_s *cdcser_getdevdesc(void);
#ifndef CONFIG_CDCACM_COMPOSITE
FAR const struct usb_devdesc_s *cdcacm_getdevdesc(void);
#endif
/****************************************************************************
* Name: cdcser_getepdesc
* Name: cdcacm_getepdesc
*
* Description:
* Return a pointer to the raw endpoint descriptor (used for configuring
@@ -274,10 +274,10 @@ FAR const struct usb_devdesc_s *cdcser_getdevdesc(void);
*
****************************************************************************/
FAR const struct usb_epdesc_s *cdcser_getepdesc(enum cdcser_epdesc_e epid);
FAR const struct usb_epdesc_s *cdcacm_getepdesc(enum cdcacm_epdesc_e epid);
/****************************************************************************
* Name: cdcser_mkepdesc
* Name: cdcacm_mkepdesc
*
* Description:
* Construct the endpoint descriptor using the correct max packet size.
@@ -285,12 +285,12 @@ FAR const struct usb_epdesc_s *cdcser_getepdesc(enum cdcser_epdesc_e epid);
****************************************************************************/
#ifdef CONFIG_USBDEV_DUALSPEED
void cdcser_mkepdesc(enum cdcser_epdesc_e epid,
void cdcacm_mkepdesc(enum cdcacm_epdesc_e epid,
uint16_t mxpacket, FAR struct usb_epdesc_s *outdesc);
#endif
/****************************************************************************
* Name: cdcser_mkcfgdesc
* Name: cdcacm_mkcfgdesc
*
* Description:
* Construct the configuration descriptor
@@ -298,21 +298,21 @@ void cdcser_mkepdesc(enum cdcser_epdesc_e epid,
****************************************************************************/
#ifdef CONFIG_USBDEV_DUALSPEED
int16_t cdcser_mkcfgdesc(FAR uint8_t *buf, uint8_t speed, uint8_t type);
int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf, uint8_t speed, uint8_t type);
#else
int16_t cdcser_mkcfgdesc(FAR uint8_t *buf);
int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf);
#endif
/****************************************************************************
* Name: cdcser_getqualdesc
* Name: cdcacm_getqualdesc
*
* Description:
* Return a pointer to the raw qual descriptor
*
****************************************************************************/
#if !defined(CONFIG_CDCSER_COMPOSITE) && defined(CONFIG_USBDEV_DUALSPEED)
FAR const struct usb_qualdesc_s *cdcser_getqualdesc(void);
#if !defined(CONFIG_CDCACM_COMPOSITE) && defined(CONFIG_USBDEV_DUALSPEED)
FAR const struct usb_qualdesc_s *cdcacm_getqualdesc(void);
#endif
#endif /* __DRIVERS_USBDEV_CDCACM_H */
+88 -88
View File
@@ -47,7 +47,7 @@
#include <nuttx/usb/usb.h>
#include <nuttx/usb/cdc.h>
#include <nuttx/usb/cdc_serial.h>
#include <nuttx/usb/cdcacm.h>
#include <nuttx/usb/usbdev_trace.h>
#include "cdcacm.h"
@@ -85,7 +85,7 @@ struct cfgdecsc_group_s
* composite device logic.
*/
#ifndef CONFIG_CDCSER_COMPOSITE
#ifndef CONFIG_CDCACM_COMPOSITE
static const struct usb_devdesc_s g_devdesc =
{
USB_SIZEOF_DEVDESC, /* len */
@@ -97,23 +97,23 @@ static const struct usb_devdesc_s g_devdesc =
USB_CLASS_CDC, /* class */
CDC_SUBCLASS_NONE, /* subclass */
CDC_PROTO_NONE, /* protocol */
CONFIG_CDCSER_EP0MAXPACKET, /* maxpacketsize */
CONFIG_CDCACM_EP0MAXPACKET, /* maxpacketsize */
{
LSBYTE(CONFIG_CDCSER_VENDORID), /* vendor */
MSBYTE(CONFIG_CDCSER_VENDORID)
LSBYTE(CONFIG_CDCACM_VENDORID), /* vendor */
MSBYTE(CONFIG_CDCACM_VENDORID)
},
{
LSBYTE(CONFIG_CDCSER_PRODUCTID), /* product */
MSBYTE(CONFIG_CDCSER_PRODUCTID)
LSBYTE(CONFIG_CDCACM_PRODUCTID), /* product */
MSBYTE(CONFIG_CDCACM_PRODUCTID)
},
{
LSBYTE(CDCSER_VERSIONNO), /* device */
MSBYTE(CDCSER_VERSIONNO)
LSBYTE(CDCACM_VERSIONNO), /* device */
MSBYTE(CDCACM_VERSIONNO)
},
CDCSER_MANUFACTURERSTRID, /* imfgr */
CDCSER_PRODUCTSTRID, /* iproduct */
CDCSER_SERIALSTRID, /* serno */
CDCSER_NCONFIGS /* nconfigs */
CDCACM_MANUFACTURERSTRID, /* imfgr */
CDCACM_PRODUCTSTRID, /* iproduct */
CDCACM_SERIALSTRID, /* serno */
CDCACM_NCONFIGS /* nconfigs */
};
#endif
@@ -122,18 +122,18 @@ static const struct usb_devdesc_s g_devdesc =
* composite device logic.
*/
#ifndef CONFIG_CDCSER_COMPOSITE
#ifndef CONFIG_CDCACM_COMPOSITE
static const struct usb_cfgdesc_s g_cfgdesc =
{
USB_SIZEOF_CFGDESC, /* len */
USB_DESC_TYPE_CONFIG, /* type */
{
LSBYTE(SIZEOF_CDCSER_CFGDESC), /* LS totallen */
MSBYTE(SIZEOF_CDCSER_CFGDESC) /* MS totallen */
LSBYTE(SIZEOF_CDCACM_CFGDESC), /* LS totallen */
MSBYTE(SIZEOF_CDCACM_CFGDESC) /* MS totallen */
},
CDCSER_NINTERFACES, /* ninterfaces */
CDCSER_CONFIGID, /* cfgvalue */
CDCSER_CONFIGSTRID, /* icfg */
CDCACM_NINTERFACES, /* ninterfaces */
CDCACM_CONFIGID, /* cfgvalue */
CDCACM_CONFIGSTRID, /* icfg */
USB_CONFIG_ATTR_ONE|SELFPOWERED|REMOTEWAKEUP, /* attr */
(CONFIG_USBDEV_MAXPOWER + 1) / 2 /* mxpower */
};
@@ -145,14 +145,14 @@ static const struct usb_ifdesc_s g_notifdesc =
{
USB_SIZEOF_IFDESC, /* len */
USB_DESC_TYPE_INTERFACE, /* type */
CDCSER_NOTIFID, /* ifno */
CDCSER_NOTALTIFID, /* alt */
CDCACM_NOTIFID, /* ifno */
CDCACM_NOTALTIFID, /* alt */
1, /* neps */
USB_CLASS_CDC, /* class */
CDC_SUBCLASS_ACM, /* subclass */
CDC_PROTO_ATM, /* proto */
#ifdef CONFIG_CDCSER_NOTIFSTR
CDCSER_NOTIFSTRID /* iif */
#ifdef CONFIG_CDCACM_NOTIFSTR
CDCACM_NOTIFSTRID /* iif */
#else
0 /* iif */
#endif
@@ -198,11 +198,11 @@ static const struct usb_epdesc_s g_epintindesc =
{
USB_SIZEOF_EPDESC, /* len */
USB_DESC_TYPE_ENDPOINT, /* type */
CDCSER_EPINTIN_ADDR, /* addr */
CDCSER_EPINTIN_ATTR, /* attr */
CDCACM_EPINTIN_ADDR, /* addr */
CDCACM_EPINTIN_ATTR, /* attr */
{
LSBYTE(CONFIG_CDCSER_EPINTIN_FSSIZE), /* maxpacket (full speed) */
MSBYTE(CONFIG_CDCSER_EPINTIN_FSSIZE)
LSBYTE(CONFIG_CDCACM_EPINTIN_FSSIZE), /* maxpacket (full speed) */
MSBYTE(CONFIG_CDCACM_EPINTIN_FSSIZE)
},
0xff /* interval */
};
@@ -213,14 +213,14 @@ static const struct usb_ifdesc_s g_dataifdesc =
{
USB_SIZEOF_IFDESC, /* len */
USB_DESC_TYPE_INTERFACE, /* type */
CDCSER_DATAIFID, /* ifno */
CDCSER_DATAALTIFID, /* alt */
CDCACM_DATAIFID, /* ifno */
CDCACM_DATAALTIFID, /* alt */
2, /* neps */
USB_CLASS_CDC_DATA, /* class */
CDC_DATA_SUBCLASS_NONE, /* subclass */
CDC_DATA_PROTO_NONE, /* proto */
#ifdef CONFIG_CDCSER_DATAIFSTR
CDCSER_DATAIFSTRID /* iif */
#ifdef CONFIG_CDCACM_DATAIFSTR
CDCACM_DATAIFSTRID /* iif */
#else
0 /* iif */
#endif
@@ -232,11 +232,11 @@ static const struct usb_epdesc_s g_epbulkoutdesc =
{
USB_SIZEOF_EPDESC, /* len */
USB_DESC_TYPE_ENDPOINT, /* type */
CDCSER_EPOUTBULK_ADDR, /* addr */
CDCSER_EPOUTBULK_ATTR, /* attr */
CDCACM_EPOUTBULK_ADDR, /* addr */
CDCACM_EPOUTBULK_ATTR, /* attr */
{
LSBYTE(CONFIG_CDCSER_EPBULKOUT_FSSIZE), /* maxpacket (full speed) */
MSBYTE(CONFIG_CDCSER_EPBULKOUT_FSSIZE)
LSBYTE(CONFIG_CDCACM_EPBULKOUT_FSSIZE), /* maxpacket (full speed) */
MSBYTE(CONFIG_CDCACM_EPBULKOUT_FSSIZE)
},
1 /* interval */
};
@@ -247,11 +247,11 @@ static const struct usb_epdesc_s g_epbulkindesc =
{
USB_SIZEOF_EPDESC, /* len */
USB_DESC_TYPE_ENDPOINT, /* type */
CDCSER_EPINBULK_ADDR, /* addr */
CDCSER_EPINBULK_ATTR, /* attr */
CDCACM_EPINBULK_ADDR, /* addr */
CDCACM_EPINBULK_ATTR, /* attr */
{
LSBYTE(CONFIG_CDCSER_EPBULKIN_FSSIZE), /* maxpacket (full speed) */
MSBYTE(CONFIG_CDCSER_EPBULKIN_FSSIZE)
LSBYTE(CONFIG_CDCACM_EPBULKIN_FSSIZE), /* maxpacket (full speed) */
MSBYTE(CONFIG_CDCACM_EPBULKIN_FSSIZE)
},
1 /* interval */
};
@@ -266,14 +266,14 @@ static const struct usb_epdesc_s g_epbulkindesc =
* instead of compile time, there should no issues there either.
*/
static const struct cfgdecsc_group_s g_cfggroup[CDCSER_CFGGROUP_SIZE] =
static const struct cfgdecsc_group_s g_cfggroup[CDCACM_CFGGROUP_SIZE] =
{
/* Configuration Descriptor. If the serial device is used in as part
* or a composite device, then the configuration descriptor is
* provided by the composite device logic.
*/
#ifndef CONFIG_CDCSER_COMPOSITE
#ifndef CONFIG_CDCACM_COMPOSITE
{
USB_SIZEOF_CFGDESC, /* 1. Configuration descriptor */
0,
@@ -302,7 +302,7 @@ static const struct cfgdecsc_group_s g_cfggroup[CDCSER_CFGGROUP_SIZE] =
},
{
USB_SIZEOF_EPDESC, /* 6. Interrupt IN endpoint descriptor */
CONFIG_CDCSER_EPINTIN_HSSIZE,
CONFIG_CDCACM_EPINTIN_HSSIZE,
(FAR void *)&g_epintindesc
},
{
@@ -312,17 +312,17 @@ static const struct cfgdecsc_group_s g_cfggroup[CDCSER_CFGGROUP_SIZE] =
},
{
USB_SIZEOF_EPDESC, /* 8. Bulk OUT endpoint descriptor */
CONFIG_CDCSER_EPBULKOUT_HSSIZE,
CONFIG_CDCACM_EPBULKOUT_HSSIZE,
(FAR void *)&g_epbulkoutdesc
},
{
USB_SIZEOF_EPDESC, /* 9. Bulk OUT endpoint descriptor */
CONFIG_CDCSER_EPBULKIN_HSSIZE,
CONFIG_CDCACM_EPBULKIN_HSSIZE,
(FAR void *)&g_epbulkindesc
}
};
#if !defined(CONFIG_CDCSER_COMPOSITE) && defined(CONFIG_USBDEV_DUALSPEED)
#if !defined(CONFIG_CDCACM_COMPOSITE) && defined(CONFIG_USBDEV_DUALSPEED)
static const struct usb_qualdesc_s g_qualdesc =
{
USB_SIZEOF_QUALDESC, /* len */
@@ -334,8 +334,8 @@ static const struct usb_qualdesc_s g_qualdesc =
USB_CLASS_VENDOR_SPEC, /* class */
0, /* subclass */
0, /* protocol */
CONFIG_CDCSER_EP0MAXPACKET, /* mxpacketsize */
CDCSER_NCONFIGS, /* nconfigs */
CONFIG_CDCACM_EP0MAXPACKET, /* mxpacketsize */
CDCACM_NCONFIGS, /* nconfigs */
0, /* reserved */
};
#endif
@@ -349,17 +349,17 @@ static const struct usb_qualdesc_s g_qualdesc =
****************************************************************************/
/****************************************************************************
* Name: cdcser_mkstrdesc
* Name: cdcacm_mkstrdesc
*
* Description:
* Construct a string descriptor
*
****************************************************************************/
int cdcser_mkstrdesc(uint8_t id, struct usb_strdesc_s *strdesc)
int cdcacm_mkstrdesc(uint8_t id, struct usb_strdesc_s *strdesc)
{
#if !defined(CONFIG_CDCSER_COMPOSITE) || defined(CONFIG_CDCSER_NOTIFSTR) || \
defined(CONFIG_CDCSER_DATAIFSTR)
#if !defined(CONFIG_CDCACM_COMPOSITE) || defined(CONFIG_CDCACM_NOTIFSTR) || \
defined(CONFIG_CDCACM_DATAIFSTR)
const char *str;
int len;
@@ -368,44 +368,44 @@ int cdcser_mkstrdesc(uint8_t id, struct usb_strdesc_s *strdesc)
switch (id)
{
#ifndef CONFIG_CDCSER_COMPOSITE
#ifndef CONFIG_CDCACM_COMPOSITE
case 0:
{
/* Descriptor 0 is the language id */
strdesc->len = 4;
strdesc->type = USB_DESC_TYPE_STRING;
strdesc->data[0] = LSBYTE(CDCSER_STR_LANGUAGE);
strdesc->data[1] = MSBYTE(CDCSER_STR_LANGUAGE);
strdesc->data[0] = LSBYTE(CDCACM_STR_LANGUAGE);
strdesc->data[1] = MSBYTE(CDCACM_STR_LANGUAGE);
return 4;
}
case CDCSER_MANUFACTURERSTRID:
str = CONFIG_CDCSER_VENDORSTR;
case CDCACM_MANUFACTURERSTRID:
str = CONFIG_CDCACM_VENDORSTR;
break;
case CDCSER_PRODUCTSTRID:
str = CONFIG_CDCSER_PRODUCTSTR;
case CDCACM_PRODUCTSTRID:
str = CONFIG_CDCACM_PRODUCTSTR;
break;
case CDCSER_SERIALSTRID:
str = CONFIG_CDCSER_SERIALSTR;
case CDCACM_SERIALSTRID:
str = CONFIG_CDCACM_SERIALSTR;
break;
case CDCSER_CONFIGSTRID:
str = CONFIG_CDCSER_CONFIGSTR;
case CDCACM_CONFIGSTRID:
str = CONFIG_CDCACM_CONFIGSTR;
break;
#endif
#ifdef CONFIG_CDCSER_NOTIFSTR
case CDCSER_NOTIFSTRID:
str = CONFIG_CDCSER_NOTIFSTR;
#ifdef CONFIG_CDCACM_NOTIFSTR
case CDCACM_NOTIFSTRID:
str = CONFIG_CDCACM_NOTIFSTR;
break;
#endif
#ifdef CONFIG_CDCSER_DATAIFSTR
case CDCSER_DATAIFSTRID:
str = CONFIG_CDCSER_DATAIFSTR;
#ifdef CONFIG_CDCACM_DATAIFSTR
case CDCACM_DATAIFSTRID:
str = CONFIG_CDCACM_DATAIFSTR;
break;
#endif
@@ -433,22 +433,22 @@ int cdcser_mkstrdesc(uint8_t id, struct usb_strdesc_s *strdesc)
}
/****************************************************************************
* Name: cdcser_getepdesc
* Name: cdcacm_getepdesc
*
* Description:
* Return a pointer to the raw device descriptor
*
****************************************************************************/
#ifndef CONFIG_CDCSER_COMPOSITE
FAR const struct usb_devdesc_s *cdcser_getdevdesc(void)
#ifndef CONFIG_CDCACM_COMPOSITE
FAR const struct usb_devdesc_s *cdcacm_getdevdesc(void)
{
return &g_devdesc;
}
#endif
/****************************************************************************
* Name: cdcser_getepdesc
* Name: cdcacm_getepdesc
*
* Description:
* Return a pointer to the raw endpoint struct (used for configuring
@@ -456,17 +456,17 @@ FAR const struct usb_devdesc_s *cdcser_getdevdesc(void)
*
****************************************************************************/
FAR const struct usb_epdesc_s *cdcser_getepdesc(enum cdcser_epdesc_e epid)
FAR const struct usb_epdesc_s *cdcacm_getepdesc(enum cdcacm_epdesc_e epid)
{
switch (epid)
{
case CDCSER_EPINTIN: /* Interrupt IN endpoint */
case CDCACM_EPINTIN: /* Interrupt IN endpoint */
return &g_epintindesc;
case CDCSER_EPBULKOUT: /* Bulk OUT endpoint */
case CDCACM_EPBULKOUT: /* Bulk OUT endpoint */
return &g_epbulkoutdesc;
case CDCSER_EPBULKIN: /* Bulk IN endpoint */
case CDCACM_EPBULKIN: /* Bulk IN endpoint */
return &g_epbulkindesc;
default:
@@ -475,7 +475,7 @@ FAR const struct usb_epdesc_s *cdcser_getepdesc(enum cdcser_epdesc_e epid)
}
/****************************************************************************
* Name: cdcser_mkepdesc
* Name: cdcacm_mkepdesc
*
* Description:
* Construct the endpoint descriptor using the correct max packet size.
@@ -483,14 +483,14 @@ FAR const struct usb_epdesc_s *cdcser_getepdesc(enum cdcser_epdesc_e epid)
****************************************************************************/
#ifdef CONFIG_USBDEV_DUALSPEED
void cdcser_mkepdesc(num cdcser_epdesc_e epid, uint16_t mxpacket,
void cdcacm_mkepdesc(num cdcacm_epdesc_e epid, uint16_t mxpacket,
FAR struct usb_epdesc_s *outdesc)
{
FAR const struct usb_epdesc_s *indesc;
/* Copy the "canned" descriptor */
indesc = cdcser_getepdesc(epid)
indesc = cdcacm_getepdesc(epid)
memcpy(outdesc, indesc, USB_SIZEOF_EPDESC);
/* Then add the correct max packet size */
@@ -501,7 +501,7 @@ void cdcser_mkepdesc(num cdcser_epdesc_e epid, uint16_t mxpacket,
#endif
/****************************************************************************
* Name: cdcser_mkcfgdesc
* Name: cdcacm_mkcfgdesc
*
* Description:
* Construct the configuration descriptor
@@ -509,9 +509,9 @@ void cdcser_mkepdesc(num cdcser_epdesc_e epid, uint16_t mxpacket,
****************************************************************************/
#ifdef CONFIG_USBDEV_DUALSPEED
int16_t cdcser_mkcfgdesc(FAR uint8_t *buf, uint8_t speed, uint8_t type)
int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf, uint8_t speed, uint8_t type)
#else
int16_t cdcser_mkcfgdesc(FAR uint8_t *buf)
int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf)
#endif
{
FAR const struct cfgdecsc_group_s *group;
@@ -531,7 +531,7 @@ int16_t cdcser_mkcfgdesc(FAR uint8_t *buf)
/* Copy all of the descriptors in the group */
for (i = 0, dest = buf; i < CDCSER_CFGGROUP_SIZE; i++)
for (i = 0, dest = buf; i < CDCACM_CFGGROUP_SIZE; i++)
{
group = &g_cfggroup[i];
@@ -547,7 +547,7 @@ int16_t cdcser_mkcfgdesc(FAR uint8_t *buf)
#ifdef CONFIG_USBDEV_DUALSPEED
if (highspeed && group->hsepsize != 0)
{
cdcser_mkepdesc(group->desc, group->hsepsize,
cdcacm_mkepdesc(group->desc, group->hsepsize,
(FAR struct usb_epdesc_s*)dest);
}
else
@@ -565,19 +565,19 @@ int16_t cdcser_mkcfgdesc(FAR uint8_t *buf)
dest += group->descsize;
}
return SIZEOF_CDCSER_CFGDESC;
return SIZEOF_CDCACM_CFGDESC;
}
/****************************************************************************
* Name: cdcser_getqualdesc
* Name: cdcacm_getqualdesc
*
* Description:
* Return a pointer to the raw qual descriptor
*
****************************************************************************/
#if !defined(CONFIG_CDCSER_COMPOSITE) && defined(CONFIG_USBDEV_DUALSPEED)
FAR const struct usb_qualdesc_s *cdcser_getqualdesc(void)
#if !defined(CONFIG_CDCACM_COMPOSITE) && defined(CONFIG_USBDEV_DUALSPEED)
FAR const struct usb_qualdesc_s *cdcacm_getqualdesc(void)
{
return &g_qualdesc;
}
+23 -23
View File
@@ -50,8 +50,8 @@
#ifdef CONFIG_USBDEV_COMPOSITE
#ifdef CONFIG_CDCSER_COMPOSITE
# include <nuttx/usb/cdc_serial.h>
#ifdef CONFIG_CDCACM_COMPOSITE
# include <nuttx/usb/cdcacm.h>
# include "cdcacm.h"
#endif
@@ -124,18 +124,18 @@
* the CDC serial device or the mass storage device.
*/
#if defined(CONFIG_CDCSER_COMPOSITE)
#if defined(CONFIG_CDCACM_COMPOSITE)
# define DEV1_IS_CDCACM 1
# define DEV1_MKCFGDESC cdcser_mkcfgdesc
# define DEV1_MKCFGDESC cdcacm_mkcfgdesc
# define DEV1_CLASSOBJECT board_cdcclassobject
# define DEV1_NCONFIGS CDCSER_NCONFIGS
# define DEV1_CONFIGID CDCSER_CONFIGID
# define DEV1_FIRSTINTERFACE CONFIG_CDCSER_IFNOBASE
# define DEV1_NINTERFACES CDCSER_NINTERFACES
# define DEV1_FIRSTSTRID CONFIG_CDCSER_STRBASE
# define DEV1_NSTRIDS (CDCSER_LASTSTRID-CONFIG_CDCSER_STRBASE)
# define DEV1_CFGDESCSIZE SIZEOF_CDCSER_CFGDESC
#elif defined(CONFIG_CDCSER_COMPOSITE)
# define DEV1_NCONFIGS CDCACM_NCONFIGS
# define DEV1_CONFIGID CDCACM_CONFIGID
# define DEV1_FIRSTINTERFACE CONFIG_CDCACM_IFNOBASE
# define DEV1_NINTERFACES CDCACM_NINTERFACES
# define DEV1_FIRSTSTRID CONFIG_CDCACM_STRBASE
# define DEV1_NSTRIDS (CDCACM_LASTSTRID-CONFIG_CDCACM_STRBASE)
# define DEV1_CFGDESCSIZE SIZEOF_CDCACM_CFGDESC
#elif defined(CONFIG_CDCACM_COMPOSITE)
# define DEV1_IS_USBMSC 1
# define DEV1_MKCFGDESC usbmsc_mkcfgdesc
# define DEV1_CLASSOBJECT board_mscclassobject
@@ -154,18 +154,18 @@
* the CDC serial device or the mass storage device.
*/
#if defined(CONFIG_CDCSER_COMPOSITE) && !defined(DEV1_IS_CDCACM)
#if defined(CONFIG_CDCACM_COMPOSITE) && !defined(DEV1_IS_CDCACM)
# define DEV2_IS_CDCACM 1
# define DEV2_MKCFGDESC cdcser_mkcfgdesc
# define DEV2_MKCFGDESC cdcacm_mkcfgdesc
# define DEV2_CLASSOBJECT board_cdcclassobject
# define DEV2_NCONFIGS CDCSER_NCONFIGS
# define DEV2_CONFIGID CDCSER_CONFIGID
# define DEV2_FIRSTINTERFACE CONFIG_CDCSER_IFNOBASE
# define DEV2_NINTERFACES CDCSER_NINTERFACES
# define DEV2_FIRSTSTRID CONFIG_CDCSER_STRBASE
# define DEV2_NSTRIDS (CDCSER_LASTSTRID-CONFIG_CDCSER_STRBASE)
# define DEV2_CFGDESCSIZE SIZEOF_CDCSER_CFGDESC
#elif defined(CONFIG_CDCSER_COMPOSITE) && !defined(DEV1_IS_USBMSC)
# define DEV2_NCONFIGS CDCACM_NCONFIGS
# define DEV2_CONFIGID CDCACM_CONFIGID
# define DEV2_FIRSTINTERFACE CONFIG_CDCACM_IFNOBASE
# define DEV2_NINTERFACES CDCACM_NINTERFACES
# define DEV2_FIRSTSTRID CONFIG_CDCACM_STRBASE
# define DEV2_NSTRIDS (CDCACM_LASTSTRID-CONFIG_CDCACM_STRBASE)
# define DEV2_CFGDESCSIZE SIZEOF_CDCACM_CFGDESC
#elif defined(CONFIG_CDCACM_COMPOSITE) && !defined(DEV1_IS_USBMSC)
# define DEV2_IS_USBMSC 1
# define DEV2_MKCFGDESC usbmsc_mkcfgdesc
# define DEV2_CLASSOBJECT board_mscclassobject
@@ -173,7 +173,7 @@
# define DEV2_CONFIGID USBMSC_CONFIGID
# define DEV2_FIRSTINTERFACE CONFIG_USBMSC_IFNOBASE
# define DEV2_NINTERFACES USBMSC_NINTERFACES
# define DEV2_FIRSTSTRID CONFIG_CDCSER_STRBASE
# define DEV2_FIRSTSTRID CONFIG_CDCACM_STRBASE
# define DEV2_NSTRIDS (USBMSC_LASTSTRID-CONFIG_USBMSC_STRBASE)
# define DEV2_CFGDESCSIZE SIZEOF_USBMSC_CFGDESC
#else
+2 -2
View File
@@ -1580,7 +1580,7 @@ int usbmsc_exportluns(FAR void *handle)
/* Register the USB storage class driver (unless we are part of a composite device) */
#ifndef CONFIG_CDCSER_COMPOSITE
#ifndef CONFIG_USBMSC_COMPOSITE
ret = usbdev_register(&drvr->drvr);
if (ret != OK)
{
@@ -1666,7 +1666,7 @@ void usbmsc_uninitialize(FAR void *handle)
/* Unregister the driver (unless we are a part of a composite device */
#ifndef CONFIG_CDCSER_COMPOSITE
#ifndef CONFIG_USBMSC_COMPOSITE
usbdev_unregister(&alloc->drvr.drvr);
#endif
+1 -1
View File
@@ -110,7 +110,7 @@
/* Packet and request buffer sizes */
#ifndef CONFIG_CDCSER_COMPOSITE
#ifndef CONFIG_USBMSC_COMPOSITE
# ifndef CONFIG_USBMSC_EP0MAXPACKET
# define CONFIG_USBMSC_EP0MAXPACKET 64
# endif
File diff suppressed because it is too large Load Diff