USB device: Rename usbdev_description_s to usbdev_devinfo_s to avoid any more confusion of naming with device descriptions in the future. Instances of usbdev_devinfo_s are now called devinfo vs devdesc when is a bad naming collision.

This commit is contained in:
Gregory Nutt 2017-07-20 09:34:48 -06:00
parent 4fde6fc654
commit ee0c035a6d
16 changed files with 213 additions and 213 deletions

View File

@ -103,7 +103,7 @@ static FAR void *g_mschandle;
#ifdef CONFIG_USBMSC_COMPOSITE
static int board_mscclassobject(int minor,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
FAR struct usbdevclass_driver_s **classdev)
{
int ret;
@ -137,7 +137,7 @@ static int board_mscclassobject(int minor,
/* Get the mass storage device's class object */
ret = usbmsc_classobject(g_mschandle, devdesc, classdev);
ret = usbmsc_classobject(g_mschandle, devinfo, classdev);
if (ret < 0)
{
uerr("ERROR: usbmsc_classobject failed: %d\n", -ret);
@ -219,23 +219,23 @@ static FAR void *board_composite0_connect(int port)
/* Interfaces */
dev[0].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[0].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[0].minor = 0; /* The minor interface number */
/* Strings */
dev[0].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[0].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[0].devdesc.epno[CDCACM_EP_INTIN_IDX] = 1;
dev[0].devdesc.epno[CDCACM_EP_BULKIN_IDX] = 2;
dev[0].devdesc.epno[CDCACM_EP_BULKOUT_IDX] = 3;
dev[0].devinfo.epno[CDCACM_EP_INTIN_IDX] = 1;
dev[0].devinfo.epno[CDCACM_EP_BULKIN_IDX] = 2;
dev[0].devinfo.epno[CDCACM_EP_BULKOUT_IDX] = 3;
/* Count up the base numbers */
ifnobase += dev[0].devdesc.ninterfaces;
strbase += dev[0].devdesc.nstrings;
ifnobase += dev[0].devinfo.ninterfaces;
strbase += dev[0].devinfo.nstrings;
/* Configure the mass storage device device */
/* Ask the usbmsc driver to fill in the constants we didn't
@ -252,22 +252,22 @@ static FAR void *board_composite0_connect(int port)
/* Interfaces */
dev[1].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[1].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[1].minor = 0; /* The minor interface number */
/* Strings */
dev[1].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[1].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[1].devdesc.epno[USBMSC_EP_BULKIN_IDX] = 5;
dev[1].devdesc.epno[USBMSC_EP_BULKOUT_IDX] = 4;
dev[1].devinfo.epno[USBMSC_EP_BULKIN_IDX] = 5;
dev[1].devinfo.epno[USBMSC_EP_BULKOUT_IDX] = 4;
/* Count up the base numbers */
ifnobase += dev[1].devdesc.ninterfaces;
strbase += dev[1].devdesc.nstrings;
ifnobase += dev[1].devinfo.ninterfaces;
strbase += dev[1].devinfo.nstrings;
return composite_initialize(2, dev);
}
@ -313,20 +313,20 @@ static FAR void *board_composite1_connect(int port)
/* Interfaces */
dev[i].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[i].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
/* Strings */
dev[i].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[i].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[i].devdesc.epno[CDCACM_EP_INTIN_IDX] = epno++;
dev[i].devdesc.epno[CDCACM_EP_BULKIN_IDX] = epno++;
dev[i].devdesc.epno[CDCACM_EP_BULKOUT_IDX] = epno++;
dev[i].devinfo.epno[CDCACM_EP_INTIN_IDX] = epno++;
dev[i].devinfo.epno[CDCACM_EP_BULKIN_IDX] = epno++;
dev[i].devinfo.epno[CDCACM_EP_BULKOUT_IDX] = epno++;
ifnobase += dev[i].devdesc.ninterfaces;
strbase += dev[i].devdesc.nstrings;
ifnobase += dev[i].devinfo.ninterfaces;
strbase += dev[i].devinfo.nstrings;
}
return composite_initialize(2, dev);

View File

@ -118,7 +118,7 @@ static FAR void *g_mschandle;
#ifdef CONFIG_USBMSC_COMPOSITE
static int board_mscclassobject(int minor,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
FAR struct usbdevclass_driver_s **classdev)
{
int ret;
@ -152,7 +152,7 @@ static int board_mscclassobject(int minor,
/* Get the mass storage device's class object */
ret = usbmsc_classobject(g_mschandle, devdesc, classdev);
ret = usbmsc_classobject(g_mschandle, devinfo, classdev);
if (ret < 0)
{
uerr("ERROR: usbmsc_classobject failed: %d\n", -ret);
@ -234,23 +234,23 @@ static FAR void *board_composite0_connect(int port)
/* Interfaces */
dev[0].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[0].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[0].minor = 0; /* The minor interface number */
/* Strings */
dev[0].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[0].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[0].devdesc.epno[CDCACM_EP_INTIN_IDX] = 1;
dev[0].devdesc.epno[CDCACM_EP_BULKIN_IDX] = 2;
dev[0].devdesc.epno[CDCACM_EP_BULKOUT_IDX] = 3;
dev[0].devinfo.epno[CDCACM_EP_INTIN_IDX] = 1;
dev[0].devinfo.epno[CDCACM_EP_BULKIN_IDX] = 2;
dev[0].devinfo.epno[CDCACM_EP_BULKOUT_IDX] = 3;
/* Count up the base numbers */
ifnobase += dev[0].devdesc.ninterfaces;
strbase += dev[0].devdesc.nstrings;
ifnobase += dev[0].devinfo.ninterfaces;
strbase += dev[0].devinfo.nstrings;
/* Configure the mass storage device device */
/* Ask the usbmsc driver to fill in the constants we didn't
@ -267,22 +267,22 @@ static FAR void *board_composite0_connect(int port)
/* Interfaces */
dev[1].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[1].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[1].minor = 0; /* The minor interface number */
/* Strings */
dev[1].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[1].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[1].devdesc.epno[USBMSC_EP_BULKIN_IDX] = 5;
dev[1].devdesc.epno[USBMSC_EP_BULKOUT_IDX] = 4;
dev[1].devinfo.epno[USBMSC_EP_BULKIN_IDX] = 5;
dev[1].devinfo.epno[USBMSC_EP_BULKOUT_IDX] = 4;
/* Count up the base numbers */
ifnobase += dev[1].devdesc.ninterfaces;
strbase += dev[1].devdesc.nstrings;
ifnobase += dev[1].devinfo.ninterfaces;
strbase += dev[1].devinfo.nstrings;
return composite_initialize(2, dev);
}
@ -335,20 +335,20 @@ static FAR void *board_composite1_connect(int port)
/* Interfaces */
dev[i].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[i].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
/* Strings */
dev[i].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[i].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[i].devdesc.epno[CDCACM_EP_INTIN_IDX] = epno++;
dev[i].devdesc.epno[CDCACM_EP_BULKIN_IDX] = epno++;
dev[i].devdesc.epno[CDCACM_EP_BULKOUT_IDX] = epno++;
dev[i].devinfo.epno[CDCACM_EP_INTIN_IDX] = epno++;
dev[i].devinfo.epno[CDCACM_EP_BULKIN_IDX] = epno++;
dev[i].devinfo.epno[CDCACM_EP_BULKOUT_IDX] = epno++;
ifnobase += dev[i].devdesc.ninterfaces;
strbase += dev[i].devdesc.nstrings;
ifnobase += dev[i].devinfo.ninterfaces;
strbase += dev[i].devinfo.nstrings;
}
return composite_initialize(2, dev);

View File

@ -86,7 +86,7 @@ static FAR void *g_mschandle;
#ifdef CONFIG_USBMSC_COMPOSITE
static int board_mscclassobject(int minor,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
FAR struct usbdevclass_driver_s **classdev)
{
int ret;
@ -120,7 +120,7 @@ static int board_mscclassobject(int minor,
/* Get the mass storage device's class object */
ret = usbmsc_classobject(g_mschandle, devdesc, classdev);
ret = usbmsc_classobject(g_mschandle, devinfo, classdev);
if (ret < 0)
{
uerr("ERROR: usbmsc_classobject failed: %d\n", -ret);
@ -223,23 +223,23 @@ FAR void *board_composite_connect(int port, int configid)
/* Interfaces */
dev[0].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[0].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[0].minor = 0; /* The minor interface number */
/* Strings */
dev[0].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[0].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[0].devdesc.epno[CDCACM_EP_INTIN_IDX] = 3;
dev[0].devdesc.epno[CDCACM_EP_BULKIN_IDX] = 4;
dev[0].devdesc.epno[CDCACM_EP_BULKOUT_IDX] = 5;
dev[0].devinfo.epno[CDCACM_EP_INTIN_IDX] = 3;
dev[0].devinfo.epno[CDCACM_EP_BULKIN_IDX] = 4;
dev[0].devinfo.epno[CDCACM_EP_BULKOUT_IDX] = 5;
/* Count up the base numbers */
ifnobase += dev[0].devdesc.ninterfaces;
strbase += dev[0].devdesc.nstrings;
ifnobase += dev[0].devinfo.ninterfaces;
strbase += dev[0].devinfo.nstrings;
/* Configure the mass storage device device */
/* Ask the usbmsc driver to fill in the constants we didn't
@ -256,22 +256,22 @@ FAR void *board_composite_connect(int port, int configid)
/* Interfaces */
dev[1].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[1].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[1].minor = 0; /* The minor interface number */
/* Strings */
dev[1].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[1].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[1].devdesc.epno[USBMSC_EP_BULKIN_IDX] = 1;
dev[1].devdesc.epno[USBMSC_EP_BULKOUT_IDX] = 2;
dev[1].devinfo.epno[USBMSC_EP_BULKIN_IDX] = 1;
dev[1].devinfo.epno[USBMSC_EP_BULKOUT_IDX] = 2;
/* Count up the base numbers */
ifnobase += dev[1].devdesc.ninterfaces;
strbase += dev[1].devdesc.nstrings;
ifnobase += dev[1].devinfo.ninterfaces;
strbase += dev[1].devinfo.nstrings;
return composite_initialize(2, dev);
#else
@ -323,20 +323,20 @@ FAR void *board_composite_connect(int port, int configid)
/* Interfaces */
dev[ia].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[ia].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
/* Strings */
dev[ia].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[ia].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[ia].devdesc.epno[CDCACM_EP_INTIN_IDX] = 7 + ia;
dev[ia].devdesc.epno[CDCACM_EP_BULKIN_IDX] = 1 + ia * 2;
dev[ia].devdesc.epno[CDCACM_EP_BULKOUT_IDX] = 2 + ia * 2;
dev[ia].devinfo.epno[CDCACM_EP_INTIN_IDX] = 7 + ia;
dev[ia].devinfo.epno[CDCACM_EP_BULKIN_IDX] = 1 + ia * 2;
dev[ia].devinfo.epno[CDCACM_EP_BULKOUT_IDX] = 2 + ia * 2;
ifnobase += dev[ia].devdesc.ninterfaces;
strbase += dev[ia].devdesc.nstrings;
ifnobase += dev[ia].devinfo.ninterfaces;
strbase += dev[ia].devinfo.nstrings;
}
return composite_initialize(3, dev);

View File

@ -320,7 +320,7 @@ static int stm32_composite_initialize(void)
#ifdef CONFIG_USBMSC_COMPOSITE
static int board_mscclassobject(int minor,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
FAR struct usbdevclass_driver_s **classdev)
{
int ret;
@ -354,7 +354,7 @@ static int board_mscclassobject(int minor,
/* Get the mass storage device's class object */
ret = usbmsc_classobject(g_mschandle, devdesc, classdev);
ret = usbmsc_classobject(g_mschandle, devinfo, classdev);
if (ret < 0)
{
uerr("ERROR: usbmsc_classobject failed: %d\n", -ret);
@ -436,23 +436,23 @@ static FAR void *board_composite0_connect(int port)
/* Interfaces */
dev[0].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[0].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[0].minor = 0; /* The minor interface number */
/* Strings */
dev[0].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[0].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[0].devdesc.epno[CDCACM_EP_INTIN_IDX] = 1;
dev[0].devdesc.epno[CDCACM_EP_BULKIN_IDX] = 2;
dev[0].devdesc.epno[CDCACM_EP_BULKOUT_IDX] = 3;
dev[0].devinfo.epno[CDCACM_EP_INTIN_IDX] = 1;
dev[0].devinfo.epno[CDCACM_EP_BULKIN_IDX] = 2;
dev[0].devinfo.epno[CDCACM_EP_BULKOUT_IDX] = 3;
/* Count up the base numbers */
ifnobase += dev[0].devdesc.ninterfaces;
strbase += dev[0].devdesc.nstrings;
ifnobase += dev[0].devinfo.ninterfaces;
strbase += dev[0].devinfo.nstrings;
/* Configure the mass storage device device */
/* Ask the usbmsc driver to fill in the constants we didn't
@ -469,22 +469,22 @@ static FAR void *board_composite0_connect(int port)
/* Interfaces */
dev[1].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[1].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[1].minor = 0; /* The minor interface number */
/* Strings */
dev[1].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[1].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[1].devdesc.epno[USBMSC_EP_BULKIN_IDX] = 5;
dev[1].devdesc.epno[USBMSC_EP_BULKOUT_IDX] = 4;
dev[1].devinfo.epno[USBMSC_EP_BULKIN_IDX] = 5;
dev[1].devinfo.epno[USBMSC_EP_BULKOUT_IDX] = 4;
/* Count up the base numbers */
ifnobase += dev[1].devdesc.ninterfaces;
strbase += dev[1].devdesc.nstrings;
ifnobase += dev[1].devinfo.ninterfaces;
strbase += dev[1].devinfo.nstrings;
return composite_initialize(2, dev);
}
@ -537,20 +537,20 @@ static FAR void *board_composite1_connect(int port)
/* Interfaces */
dev[i].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[i].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
/* Strings */
dev[i].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[i].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[i].devdesc.epno[CDCACM_EP_INTIN_IDX] = epno++;
dev[i].devdesc.epno[CDCACM_EP_BULKIN_IDX] = epno++;
dev[i].devdesc.epno[CDCACM_EP_BULKOUT_IDX] = epno++;
dev[i].devinfo.epno[CDCACM_EP_INTIN_IDX] = epno++;
dev[i].devinfo.epno[CDCACM_EP_BULKIN_IDX] = epno++;
dev[i].devinfo.epno[CDCACM_EP_BULKOUT_IDX] = epno++;
ifnobase += dev[i].devdesc.ninterfaces;
strbase += dev[i].devdesc.nstrings;
ifnobase += dev[i].devinfo.ninterfaces;
strbase += dev[i].devinfo.nstrings;
}
return composite_initialize(2, dev);

View File

@ -114,7 +114,7 @@ static FAR void *g_mschandle;
#ifdef CONFIG_USBMSC_COMPOSITE
static int board_mscclassobject(int minor,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
FAR struct usbdevclass_driver_s **classdev)
{
int ret;
@ -148,7 +148,7 @@ static int board_mscclassobject(int minor,
/* Get the mass storage device's class object */
ret = usbmsc_classobject(g_mschandle, devdesc, classdev);
ret = usbmsc_classobject(g_mschandle, devinfo, classdev);
if (ret < 0)
{
uerr("ERROR: usbmsc_classobject failed: %d\n", -ret);
@ -230,23 +230,23 @@ static FAR void *board_composite0_connect(int port)
/* Interfaces */
dev[0].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[0].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[0].minor = 0; /* The minor interface number */
/* Strings */
dev[0].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[0].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[0].devdesc.epno[CDCACM_EP_INTIN_IDX] = 1;
dev[0].devdesc.epno[CDCACM_EP_BULKIN_IDX] = 2;
dev[0].devdesc.epno[CDCACM_EP_BULKOUT_IDX] = 3;
dev[0].devinfo.epno[CDCACM_EP_INTIN_IDX] = 1;
dev[0].devinfo.epno[CDCACM_EP_BULKIN_IDX] = 2;
dev[0].devinfo.epno[CDCACM_EP_BULKOUT_IDX] = 3;
/* Count up the base numbers */
ifnobase += dev[0].devdesc.ninterfaces;
strbase += dev[0].devdesc.nstrings;
ifnobase += dev[0].devinfo.ninterfaces;
strbase += dev[0].devinfo.nstrings;
/* Configure the mass storage device device */
/* Ask the usbmsc driver to fill in the constants we didn't
@ -263,22 +263,22 @@ static FAR void *board_composite0_connect(int port)
/* Interfaces */
dev[1].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[1].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[1].minor = 0; /* The minor interface number */
/* Strings */
dev[1].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[1].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[1].devdesc.epno[USBMSC_EP_BULKIN_IDX] = 5;
dev[1].devdesc.epno[USBMSC_EP_BULKOUT_IDX] = 4;
dev[1].devinfo.epno[USBMSC_EP_BULKIN_IDX] = 5;
dev[1].devinfo.epno[USBMSC_EP_BULKOUT_IDX] = 4;
/* Count up the base numbers */
ifnobase += dev[1].devdesc.ninterfaces;
strbase += dev[1].devdesc.nstrings;
ifnobase += dev[1].devinfo.ninterfaces;
strbase += dev[1].devinfo.nstrings;
return composite_initialize(2, dev);
}
@ -331,20 +331,20 @@ static FAR void *board_composite1_connect(int port)
/* Interfaces */
dev[i].devdesc.ifnobase = ifnobase; /* Offset to Interface-IDs */
dev[i].devinfo.ifnobase = ifnobase; /* Offset to Interface-IDs */
/* Strings */
dev[i].devdesc.strbase = strbase; /* Offset to String Numbers */
dev[i].devinfo.strbase = strbase; /* Offset to String Numbers */
/* Endpoints */
dev[i].devdesc.epno[CDCACM_EP_INTIN_IDX] = epno++;
dev[i].devdesc.epno[CDCACM_EP_BULKIN_IDX] = epno++;
dev[i].devdesc.epno[CDCACM_EP_BULKOUT_IDX] = epno++;
dev[i].devinfo.epno[CDCACM_EP_INTIN_IDX] = epno++;
dev[i].devinfo.epno[CDCACM_EP_BULKIN_IDX] = epno++;
dev[i].devinfo.epno[CDCACM_EP_BULKOUT_IDX] = epno++;
ifnobase += dev[i].devdesc.ninterfaces;
strbase += dev[i].devdesc.nstrings;
ifnobase += dev[i].devinfo.ninterfaces;
strbase += dev[i].devinfo.nstrings;
}
return composite_initialize(2, dev);

View File

@ -105,7 +105,7 @@ struct cdcacm_dev_s
FAR struct usbdev_req_s *ctrlreq; /* Allocated control request */
struct sq_queue_s reqlist; /* List of write request containers */
struct usbdev_description_s devdesc;
struct usbdev_devinfo_s devinfo;
/* Pre-allocated write request containers. The write requests will
* be linked in a free list (reqlist), and used to send requests to
@ -161,7 +161,7 @@ static void cdcacm_freereq(FAR struct usbdev_ep_s *ep,
static void cdcacm_resetconfig(FAR struct cdcacm_dev_s *priv);
static int cdcacm_epconfigure(FAR struct usbdev_ep_s *ep,
enum cdcacm_epdesc_e epid, bool last,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
bool hispeed);
static int cdcacm_setconfig(FAR struct cdcacm_dev_s *priv,
uint8_t config);
@ -634,11 +634,11 @@ static void cdcacm_resetconfig(FAR struct cdcacm_dev_s *priv)
static int cdcacm_epconfigure(FAR struct usbdev_ep_s *ep,
enum cdcacm_epdesc_e epid, bool last,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
bool hispeed)
{
struct usb_epdesc_s epdesc;
cdcacm_copy_epdesc(epid, &epdesc, devdesc, hispeed);
cdcacm_copy_epdesc(epid, &epdesc, devinfo, hispeed);
return EP_CONFIGURE(ep, &epdesc, last);
}
@ -699,13 +699,13 @@ static int cdcacm_setconfig(FAR struct cdcacm_dev_s *priv, uint8_t config)
if (priv->usbdev->speed == USB_SPEED_HIGH)
{
ret = cdcacm_epconfigure(priv->epintin, CDCACM_EPINTIN, false,
&priv->devdesc, true);
&priv->devinfo, true);
}
else
#endif
{
ret = cdcacm_epconfigure(priv->epintin, CDCACM_EPINTIN, false,
&priv->devdesc, false);
&priv->devinfo, false);
}
if (ret < 0)
@ -722,13 +722,13 @@ static int cdcacm_setconfig(FAR struct cdcacm_dev_s *priv, uint8_t config)
if (priv->usbdev->speed == USB_SPEED_HIGH)
{
ret = cdcacm_epconfigure(priv->epbulkin, CDCACM_EPBULKIN, false,
&priv->devdesc, true);
&priv->devinfo, true);
}
else
#endif
{
ret = cdcacm_epconfigure(priv->epbulkin, CDCACM_EPBULKIN, false,
&priv->devdesc, false);
&priv->devinfo, false);
}
if (ret < 0)
@ -745,13 +745,13 @@ static int cdcacm_setconfig(FAR struct cdcacm_dev_s *priv, uint8_t config)
if (priv->usbdev->speed == USB_SPEED_HIGH)
{
ret = cdcacm_epconfigure(priv->epbulkout, CDCACM_EPBULKOUT, true,
&priv->devdesc, true);
&priv->devinfo, true);
}
else
#endif
{
ret = cdcacm_epconfigure(priv->epbulkout, CDCACM_EPBULKOUT, true,
&priv->devdesc, false);
&priv->devinfo, false);
}
if (ret < 0)
@ -1004,7 +1004,7 @@ static int cdcacm_bind(FAR struct usbdevclass_driver_s *driver,
/* Pre-allocate the IN interrupt endpoint */
priv->epintin = DEV_ALLOCEP(dev, CDCACM_MKEPINTIN(&priv->devdesc),
priv->epintin = DEV_ALLOCEP(dev, CDCACM_MKEPINTIN(&priv->devinfo),
true, USB_EP_ATTR_XFER_INT);
if (!priv->epintin)
{
@ -1017,7 +1017,7 @@ static int cdcacm_bind(FAR struct usbdevclass_driver_s *driver,
/* Pre-allocate the IN bulk endpoint */
priv->epbulkin = DEV_ALLOCEP(dev, CDCACM_MKEPBULKIN(&priv->devdesc),
priv->epbulkin = DEV_ALLOCEP(dev, CDCACM_MKEPBULKIN(&priv->devinfo),
true, USB_EP_ATTR_XFER_BULK);
if (!priv->epbulkin)
{
@ -1030,7 +1030,7 @@ static int cdcacm_bind(FAR struct usbdevclass_driver_s *driver,
/* Pre-allocate the OUT bulk endpoint */
priv->epbulkout = DEV_ALLOCEP(dev, CDCACM_MKEPBULKOUT(&priv->devdesc),
priv->epbulkout = DEV_ALLOCEP(dev, CDCACM_MKEPBULKOUT(&priv->devinfo),
false, USB_EP_ATTR_XFER_BULK);
if (!priv->epbulkout)
{
@ -1358,10 +1358,10 @@ static int cdcacm_setup(FAR struct usbdevclass_driver_s *driver,
case USB_DESC_TYPE_CONFIG:
{
#ifdef CONFIG_USBDEV_DUALSPEED
ret = cdcacm_mkcfgdesc(ctrlreq->buf, &priv->devdesc,
ret = cdcacm_mkcfgdesc(ctrlreq->buf, &priv->devinfo,
dev->speed, ctrl->req);
#else
ret = cdcacm_mkcfgdesc(ctrlreq->buf, &priv->devdesc);
ret = cdcacm_mkcfgdesc(ctrlreq->buf, &priv->devinfo);
#endif
}
break;
@ -1425,9 +1425,9 @@ static int cdcacm_setup(FAR struct usbdevclass_driver_s *driver,
if (ctrl->type == USB_REQ_RECIPIENT_INTERFACE &&
priv->config == CDCACM_CONFIGID)
{
if ((index == priv->devdesc.ifnobase &&
if ((index == priv->devinfo.ifnobase &&
value == CDCACM_NOTALTIFID) ||
(index == (priv->devdesc.ifnobase + 1) &&
(index == (priv->devinfo.ifnobase + 1) &&
value == CDCACM_DATAALTIFID))
{
cdcacm_resetconfig(priv);
@ -1443,9 +1443,9 @@ static int cdcacm_setup(FAR struct usbdevclass_driver_s *driver,
if (ctrl->type == (USB_DIR_IN | USB_REQ_RECIPIENT_INTERFACE) &&
priv->config == CDCACM_CONFIGIDNONE)
{
if ((index == priv->devdesc.ifnobase &&
if ((index == priv->devinfo.ifnobase &&
value == CDCACM_NOTALTIFID) ||
(index == (priv->devdesc.ifnobase + 1) &&
(index == (priv->devinfo.ifnobase + 1) &&
value == CDCACM_DATAALTIFID))
{
*(FAR uint8_t *) ctrlreq->buf = value;
@ -1480,7 +1480,7 @@ static int cdcacm_setup(FAR struct usbdevclass_driver_s *driver,
case ACM_GET_LINE_CODING:
{
if (ctrl->type == (USB_DIR_IN | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE) &&
index == priv->devdesc.ifnobase)
index == priv->devinfo.ifnobase)
{
/* Return the current line status from the private data
* structure.
@ -1506,7 +1506,7 @@ static int cdcacm_setup(FAR struct usbdevclass_driver_s *driver,
{
if (ctrl->type == (USB_DIR_OUT | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE) &&
len == SIZEOF_CDC_LINECODING && /* dataout && len == outlen && */
index == priv->devdesc.ifnobase)
index == priv->devinfo.ifnobase)
{
/* Save the new line coding in the private data structure.
* NOTE: that this is conditional now because not all device
@ -1546,7 +1546,7 @@ static int cdcacm_setup(FAR struct usbdevclass_driver_s *driver,
case ACM_SET_CTRL_LINE_STATE:
{
if (ctrl->type == (USB_DIR_OUT | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE) &&
index == priv->devdesc.ifnobase)
index == priv->devinfo.ifnobase)
{
/* Save the control line state in the private data
* structure. Only bits 0 and 1 have meaning. Respond with
@ -1577,7 +1577,7 @@ static int cdcacm_setup(FAR struct usbdevclass_driver_s *driver,
case ACM_SEND_BREAK:
{
if (ctrl->type == (USB_DIR_OUT | USB_REQ_TYPE_CLASS | USB_REQ_RECIPIENT_INTERFACE) &&
index == priv->devdesc.ifnobase)
index == priv->devinfo.ifnobase)
{
/* If there is a registered callback to handle the SendBreak
* request, then callout now. Respond with a zero length
@ -2346,7 +2346,7 @@ static bool cdcuart_txempty(FAR struct uart_dev_s *dev)
#ifndef CONFIG_CDCACM_COMPOSITE
static
#endif
int cdcacm_classobject(int minor, FAR struct usbdev_description_s *devdesc,
int cdcacm_classobject(int minor, FAR struct usbdev_devinfo_s *devinfo,
FAR struct usbdevclass_driver_s **classdev)
{
FAR struct cdcacm_alloc_s *alloc;
@ -2380,8 +2380,8 @@ int cdcacm_classobject(int minor, FAR struct usbdev_description_s *devdesc,
/* Save the caller provided device description (composite only) */
memcpy(&priv->devdesc, devdesc,
sizeof(struct usbdev_description_s));
memcpy(&priv->devinfo, devinfo,
sizeof(struct usbdev_devinfo_s));
/* Fake line status */
@ -2469,24 +2469,24 @@ errout_with_class:
int cdcacm_initialize(int minor, FAR void **handle)
{
FAR struct usbdevclass_driver_s *drvr = NULL;
struct usbdev_description_s devdesc;
struct usbdev_devinfo_s devinfo;
int ret;
memset(&devdesc, 0, sizeof(struct usbdev_description_s));
memset(&devinfo, 0, sizeof(struct usbdev_devinfo_s));
/* Interfaces.
*
* ifnobase must be provided by board-specific logic
*/
devdesc.ninterfaces = CDCACM_NINTERFACES; /* Number of interfaces in the configuration */
devinfo.ninterfaces = CDCACM_NINTERFACES; /* Number of interfaces in the configuration */
/* Strings.
*
* strbase must be provided by board-specific logic
*/
devdesc.nstrings = CDCACM_NSTRIDS; /* Number of Strings */
devinfo.nstrings = CDCACM_NSTRIDS; /* Number of Strings */
/* Endpoints.
*
@ -2494,16 +2494,16 @@ int cdcacm_initialize(int minor, FAR void **handle)
* CDC/ACM is used in a composite device.
*/
devdesc.nendpoints = CDCACM_NUM_EPS;
devinfo.nendpoints = CDCACM_NUM_EPS;
#ifndef CONFIG_CDCACM_COMPOSITE
devdesc.epno[CDCACM_EP_INTIN_IDX] = CONFIG_CDCACM_EPINTIN;
devdesc.epno[CDCACM_EP_BULKIN_IDX] = CONFIG_CDCACM_EPBULKIN;
devdesc.epno[CDCACM_EP_BULKOUT_IDX] = CONFIG_CDCACM_EPBULKOUT;
devinfo.epno[CDCACM_EP_INTIN_IDX] = CONFIG_CDCACM_EPINTIN;
devinfo.epno[CDCACM_EP_BULKIN_IDX] = CONFIG_CDCACM_EPBULKIN;
devinfo.epno[CDCACM_EP_BULKOUT_IDX] = CONFIG_CDCACM_EPBULKOUT;
#endif
/* Get an instance of the serial driver class object */
ret = cdcacm_classobject(minor, &devdesc, &drvr);
ret = cdcacm_classobject(minor, &devinfo, &drvr);
if (ret == OK)
{
/* Register the USB serial class driver */
@ -2669,20 +2669,20 @@ void cdcacm_get_composite_devdesc(struct composite_devdesc_s *dev)
* ifnobase must be provided by board-specific logic
*/
dev->devdesc.ninterfaces = CDCACM_NINTERFACES; /* Number of interfaces in the configuration */
dev->devinfo.ninterfaces = CDCACM_NINTERFACES; /* Number of interfaces in the configuration */
/* Strings.
*
* strbase must be provided by board-specific logic
*/
dev->devdesc.nstrings = CDCACM_NSTRIDS; /* Number of Strings */
dev->devinfo.nstrings = CDCACM_NSTRIDS; /* Number of Strings */
/* Endpoints.
*
* Endpoint numbers must be provided by board-specific logic.
*/
dev->devdesc.nendpoints = CDCACM_NUM_EPS;
dev->devinfo.nendpoints = CDCACM_NUM_EPS;
}
#endif

View File

@ -255,7 +255,7 @@ FAR const struct usb_devdesc_s *cdcacm_getdevdesc(void);
int cdcacm_copy_epdesc(enum cdcacm_epdesc_e epid,
FAR struct usb_epdesc_s *epdesc,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
bool hispeed);
/****************************************************************************
@ -268,11 +268,11 @@ int cdcacm_copy_epdesc(enum cdcacm_epdesc_e epid,
#ifdef CONFIG_USBDEV_DUALSPEED
int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
uint8_t speed, uint8_t type);
#else
int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf,
FAR struct usbdev_description_s *devdesc);
FAR struct usbdev_devinfo_s *devinfo);
#endif
/****************************************************************************

View File

@ -232,7 +232,7 @@ FAR const struct usb_devdesc_s *cdcacm_getdevdesc(void)
int cdcacm_copy_epdesc(enum cdcacm_epdesc_e epid,
FAR struct usb_epdesc_s *epdesc,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
bool hispeed)
{
#ifndef CONFIG_USBDEV_DUALSPEED
@ -246,7 +246,7 @@ int cdcacm_copy_epdesc(enum cdcacm_epdesc_e epid,
{
epdesc->len = USB_SIZEOF_EPDESC; /* Descriptor length */
epdesc->type = USB_DESC_TYPE_ENDPOINT; /* Descriptor type */
epdesc->addr = CDCACM_MKEPINTIN(devdesc); /* Endpoint address */
epdesc->addr = CDCACM_MKEPINTIN(devinfo); /* Endpoint address */
epdesc->attr = CDCACM_EPINTIN_ATTR; /* Endpoint attributes */
#ifdef CONFIG_USBDEV_DUALSPEED
@ -274,7 +274,7 @@ int cdcacm_copy_epdesc(enum cdcacm_epdesc_e epid,
{
epdesc->len = USB_SIZEOF_EPDESC; /* Descriptor length */
epdesc->type = USB_DESC_TYPE_ENDPOINT; /* Descriptor type */
epdesc->addr = CDCACM_MKEPBULKOUT(devdesc); /* Endpoint address */
epdesc->addr = CDCACM_MKEPBULKOUT(devinfo); /* Endpoint address */
epdesc->attr = CDCACM_EPOUTBULK_ATTR; /* Endpoint attributes */
#ifdef CONFIG_USBDEV_DUALSPEED
if (hispeed)
@ -301,7 +301,7 @@ int cdcacm_copy_epdesc(enum cdcacm_epdesc_e epid,
{
epdesc->len = USB_SIZEOF_EPDESC; /* Descriptor length */
epdesc->type = USB_DESC_TYPE_ENDPOINT; /* Descriptor type */
epdesc->addr = CDCACM_MKEPBULKIN(devdesc); /* Endpoint address */
epdesc->addr = CDCACM_MKEPBULKIN(devinfo); /* Endpoint address */
epdesc->attr = CDCACM_EPINBULK_ATTR; /* Endpoint attributes */
#ifdef CONFIG_USBDEV_DUALSPEED
@ -342,11 +342,11 @@ int cdcacm_copy_epdesc(enum cdcacm_epdesc_e epid,
#ifdef CONFIG_USBDEV_DUALSPEED
int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
uint8_t speed, uint8_t type)
#else
int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf,
FAR struct usbdev_description_s *devdesc)
FAR struct usbdev_devinfo_s *devinfo)
#endif
{
int length = 0;
@ -420,8 +420,8 @@ int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf,
dest->len = USB_SIZEOF_IADDESC; /* Descriptor length */
dest->type = USB_DESC_TYPE_INTERFACEASSOCIATION; /* Descriptor type */
dest->firstif = devdesc->ifnobase; /* Number of first interface of the function */
dest->nifs = devdesc->ninterfaces; /* Number of interfaces associated with the function */
dest->firstif = devinfo->ifnobase; /* Number of first interface of the function */
dest->nifs = devinfo->ninterfaces; /* Number of interfaces associated with the function */
dest->classid = USB_CLASS_CDC; /* Class code */
dest->subclass = CDC_SUBCLASS_ACM; /* Sub-class code */
dest->protocol = CDC_PROTO_NONE; /* Protocol code */
@ -440,14 +440,14 @@ int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf,
dest->len = USB_SIZEOF_IFDESC; /* Descriptor length */
dest->type = USB_DESC_TYPE_INTERFACE; /* Descriptor type */
dest->ifno = devdesc->ifnobase; /* Interface number */
dest->ifno = devinfo->ifnobase; /* Interface number */
dest->alt = CDCACM_NOTALTIFID; /* Alternate setting */
dest->neps = 1; /* Number of endpoints */
dest->classid = USB_CLASS_CDC; /* Interface class */
dest->subclass = CDC_SUBCLASS_ACM; /* Interface sub-class */
dest->protocol = CDC_PROTO_ATM; /* Interface protocol */
#ifdef CONFIG_CDCACM_NOTIFSTR
dest->iif = devdesc->strbase + CDCACM_NOTIFSTRID; /* iInterface */
dest->iif = devinfo->strbase + CDCACM_NOTIFSTRID; /* iInterface */
#else
dest->iif = 0; /* iInterface */
#endif
@ -501,8 +501,8 @@ int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf,
dest->size = SIZEOF_UNION_FUNCDESC(1); /* Descriptor length */
dest->type = USB_DESC_TYPE_CSINTERFACE; /* Descriptor type */
dest->subtype = CDC_DSUBTYPE_UNION; /* Descriptor sub-type */
dest->master = devdesc->ifnobase; /* Master interface number */
dest->slave[0] = devdesc->ifnobase + 1; /* Slave[0] interface number */
dest->master = devinfo->ifnobase; /* Master interface number */
dest->slave[0] = devinfo->ifnobase + 1; /* Slave[0] interface number */
buf += sizeof(struct cdc_union_funcdesc_s);
}
@ -520,7 +520,7 @@ int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf,
dest->type = USB_DESC_TYPE_CSINTERFACE; /* Descriptor type */
dest->subtype = CDC_DSUBTYPE_CALLMGMT; /* Descriptor sub-type */
dest->caps = 3; /* Bit encoded capabilities */
dest->ifno = devdesc->ifnobase + 1; /* Interface number of Data Class interface */
dest->ifno = devinfo->ifnobase + 1; /* Interface number of Data Class interface */
buf += sizeof(struct cdc_callmgmt_funcdesc_s);
}
@ -531,7 +531,7 @@ int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf,
if (buf != NULL)
{
cdcacm_copy_epdesc(CDCACM_EPINTIN, (struct usb_epdesc_s *)buf, devdesc, hispeed);
cdcacm_copy_epdesc(CDCACM_EPINTIN, (struct usb_epdesc_s *)buf, devinfo, hispeed);
buf += USB_SIZEOF_EPDESC;
}
@ -545,14 +545,14 @@ int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf,
dest->len = USB_SIZEOF_IFDESC; /* Descriptor length */
dest->type = USB_DESC_TYPE_INTERFACE; /* Descriptor type */
dest->ifno = devdesc->ifnobase + 1; /* Interface number */
dest->ifno = devinfo->ifnobase + 1; /* Interface number */
dest->alt = CDCACM_DATAALTIFID; /* Alternate setting */
dest->neps = 2; /* Number of endpoints */
dest->classid = USB_CLASS_CDC_DATA; /* Interface class */
dest->subclass = CDC_DATA_SUBCLASS_NONE; /* Interface sub-class */
dest->protocol = CDC_DATA_PROTO_NONE; /* Interface protocol */
#ifdef CONFIG_CDCACM_DATAIFSTR
dest->iif = devdesc->strbase + CDCACM_DATAIFSTRID; /* iInterface */
dest->iif = devinfo->strbase + CDCACM_DATAIFSTRID; /* iInterface */
#else
dest->iif = 0; /* iInterface */
#endif
@ -566,7 +566,7 @@ int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf,
if (buf != NULL)
{
cdcacm_copy_epdesc(CDCACM_EPBULKOUT, (struct usb_epdesc_s *)buf, devdesc, hispeed);
cdcacm_copy_epdesc(CDCACM_EPBULKOUT, (struct usb_epdesc_s *)buf, devinfo, hispeed);
buf += USB_SIZEOF_EPDESC;
}
@ -576,7 +576,7 @@ int16_t cdcacm_mkcfgdesc(FAR uint8_t *buf,
if (buf != NULL)
{
cdcacm_copy_epdesc(CDCACM_EPBULKIN, (struct usb_epdesc_s *)buf, devdesc, hispeed);
cdcacm_copy_epdesc(CDCACM_EPBULKIN, (struct usb_epdesc_s *)buf, devinfo, hispeed);
buf += USB_SIZEOF_EPDESC;
}

View File

@ -180,9 +180,9 @@ static int composite_classsetup(FAR struct composite_dev_s *priv,
for (i = 0; i < priv->ndevices; i++)
{
if (interface >= priv->device[i].compdesc.devdesc.ifnobase &&
interface < (priv->device[i].compdesc.devdesc.ifnobase +
priv->device[i].compdesc.devdesc.ninterfaces))
if (interface >= priv->device[i].compdesc.devinfo.ifnobase &&
interface < (priv->device[i].compdesc.devinfo.ifnobase +
priv->device[i].compdesc.devinfo.ninterfaces))
{
ret = CLASS_SETUP(priv->device[i].dev, dev, ctrl, dataout, outlen);
break;
@ -496,11 +496,11 @@ static int composite_setup(FAR struct usbdevclass_driver_s *driver,
for (i = 0; i < priv->ndevices; i++)
{
if (strid >= priv->device[i].compdesc.devdesc.strbase &&
strid < priv->device[i].compdesc.devdesc.strbase +
priv->device[i].compdesc.devdesc.nstrings)
if (strid >= priv->device[i].compdesc.devinfo.strbase &&
strid < priv->device[i].compdesc.devinfo.strbase +
priv->device[i].compdesc.devinfo.nstrings)
{
ret = priv->device[i].compdesc.mkstrdesc(strid - priv->device[i].compdesc.devdesc.strbase, buf);
ret = priv->device[i].compdesc.mkstrdesc(strid - priv->device[i].compdesc.devinfo.strbase, buf);
break;
}
}
@ -842,7 +842,7 @@ FAR void *composite_initialize(uint8_t ndevices,
ret =
priv->device[i].compdesc.classobject(priv->device[i].compdesc.minor,
&priv->device[i].compdesc.devdesc,
&priv->device[i].compdesc.devinfo,
&priv->device[i].dev);
if (ret < 0)
{
@ -852,7 +852,7 @@ FAR void *composite_initialize(uint8_t ndevices,
}
priv->cfgdescsize += priv->device[i].compdesc.cfgdescsize;
priv->ninterfaces += priv->device[i].compdesc.devdesc.ninterfaces;
priv->ninterfaces += priv->device[i].compdesc.devinfo.ninterfaces;
}
priv->ndevices = ndevices;

View File

@ -244,13 +244,13 @@ int16_t composite_mkcfgdesc(FAR struct composite_dev_s *priv, FAR uint8_t *buf)
{
#ifdef CONFIG_USBDEV_DUALSPEED
len = priv->device[i].compdesc.mkconfdesc(buf,
&priv->device[i].compdesc.devdesc,
&priv->device[i].compdesc.devinfo,
speed, type);
total += len;
buf += len;
#else
len = priv->device[i].compdesc.mkconfdesc(buf,
&priv->device[i].compdesc.devdesc);
&priv->device[i].compdesc.devinfo);
total += len;
buf += len;
#endif

View File

@ -308,7 +308,7 @@ static int usbmsc_bind(FAR struct usbdevclass_driver_s *driver,
/* Pre-allocate the IN bulk endpoint */
priv->epbulkin = DEV_ALLOCEP(dev, USBMSC_MKEPBULKIN(&priv->devdesc),
priv->epbulkin = DEV_ALLOCEP(dev, USBMSC_MKEPBULKIN(&priv->devinfo),
true, USB_EP_ATTR_XFER_BULK);
if (!priv->epbulkin)
{
@ -321,7 +321,7 @@ static int usbmsc_bind(FAR struct usbdevclass_driver_s *driver,
/* Pre-allocate the OUT bulk endpoint */
priv->epbulkout = DEV_ALLOCEP(dev, USBMSC_MKEPBULKOUT(&priv->devdesc),
priv->epbulkout = DEV_ALLOCEP(dev, USBMSC_MKEPBULKOUT(&priv->devinfo),
false, USB_EP_ATTR_XFER_BULK);
if (!priv->epbulkout)
{
@ -993,7 +993,7 @@ int usbmsc_setconfig(FAR struct usbmsc_dev_s *priv, uint8_t config)
/* Configure the IN bulk endpoint */
usbmsc_copy_epdesc(USBMSC_EPBULKIN, &epdesc, &priv->devdesc,
usbmsc_copy_epdesc(USBMSC_EPBULKIN, &epdesc, &priv->devinfo,
hispeed);
ret = EP_CONFIGURE(priv->epbulkin, &epdesc, false);
if (ret < 0)
@ -1006,7 +1006,7 @@ int usbmsc_setconfig(FAR struct usbmsc_dev_s *priv, uint8_t config)
/* Configure the OUT bulk endpoint */
usbmsc_copy_epdesc(USBMSC_EPBULKOUT, &epdesc, &priv->devdesc,
usbmsc_copy_epdesc(USBMSC_EPBULKOUT, &epdesc, &priv->devinfo,
hispeed);
ret = EP_CONFIGURE(priv->epbulkout, &epdesc, true);
if (ret < 0)
@ -1738,7 +1738,7 @@ errout_with_lock:
#ifdef CONFIG_USBMSC_COMPOSITE
int usbmsc_classobject(FAR void *handle,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
FAR struct usbdevclass_driver_s **classdev)
{
FAR struct usbmsc_alloc_s *alloc = (FAR struct usbmsc_alloc_s *)handle;
@ -1748,7 +1748,7 @@ int usbmsc_classobject(FAR void *handle,
/* Save the device description */
memcpy(&alloc->dev.devdesc, devdesc, sizeof(struct usbdev_description_s));
memcpy(&alloc->dev.devinfo, devinfo, sizeof(struct usbdev_devinfo_s));
/* Export the LUNs as with the "standalone" USB mass storage driver, but
* don't register the class instance with the USB device infrastructure.
@ -1921,20 +1921,20 @@ void usbmsc_get_composite_devdesc(FAR struct composite_devdesc_s *dev)
* ifnobase must be provided by board-specific logic
*/
dev->devdesc.ninterfaces = USBMSC_NINTERFACES; /* Number of interfaces in the configuration */
dev->devinfo.ninterfaces = USBMSC_NINTERFACES; /* Number of interfaces in the configuration */
/* Strings.
*
* strbase must be provided by board-specific logic
*/
dev->devdesc.nstrings = USBMSC_NSTRIDS; /* Number of Strings */
dev->devinfo.nstrings = USBMSC_NSTRIDS; /* Number of Strings */
/* Endpoints.
*
* Endpoint numbers must be provided by board-specific logic.
*/
dev->devdesc.nendpoints = USBMSC_NENDPOINTS;
dev->devinfo.nendpoints = USBMSC_NENDPOINTS;
}
#endif

View File

@ -448,7 +448,7 @@ struct usbmsc_dev_s
struct sq_queue_s wrreqlist; /* List of empty write request containers */
struct sq_queue_s rdreqlist; /* List of filled read request containers */
struct usbdev_description_s devdesc;
struct usbdev_devinfo_s devinfo;
/* Pre-allocated write request containers. The write requests will
* be linked in a free list (wrreqlist), and used to send requests to
@ -577,7 +577,7 @@ FAR const struct usb_devdesc_s *usbmsc_getdevdesc(void);
int usbmsc_copy_epdesc(enum usbmsc_epdesc_e epid,
FAR struct usb_epdesc_s *epdesc,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
bool hispeed);
/****************************************************************************
@ -589,10 +589,10 @@ int usbmsc_copy_epdesc(enum usbmsc_epdesc_e epid,
****************************************************************************/
#ifdef CONFIG_USBDEV_DUALSPEED
int16_t usbmsc_mkcfgdesc(FAR uint8_t *buf, FAR struct usbdev_description_s *devdesc,
int16_t usbmsc_mkcfgdesc(FAR uint8_t *buf, FAR struct usbdev_devinfo_s *devinfo,
uint8_t speed, uint8_t type);
#else
int16_t usbmsc_mkcfgdesc(FAR uint8_t *buf, FAR struct usbdev_description_s *devdesc);
int16_t usbmsc_mkcfgdesc(FAR uint8_t *buf, FAR struct usbdev_devinfo_s *devinfo);
#endif
/****************************************************************************

View File

@ -226,7 +226,7 @@ FAR const struct usb_devdesc_s *usbmsc_getdevdesc(void)
int usbmsc_copy_epdesc(enum usbmsc_epdesc_e epid,
FAR struct usb_epdesc_s *epdesc,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
bool hispeed)
{
#ifndef CONFIG_USBDEV_DUALSPEED
@ -241,7 +241,7 @@ int usbmsc_copy_epdesc(enum usbmsc_epdesc_e epid,
{
epdesc->len = USB_SIZEOF_EPDESC; /* Descriptor length */
epdesc->type = USB_DESC_TYPE_ENDPOINT; /* Descriptor type */
epdesc->addr = USBMSC_MKEPBULKOUT(devdesc); /* Endpoint address */
epdesc->addr = USBMSC_MKEPBULKOUT(devinfo); /* Endpoint address */
epdesc->attr = USBMSC_EPOUTBULK_ATTR; /* Endpoint attributes */
#ifdef CONFIG_USBDEV_DUALSPEED
@ -269,7 +269,7 @@ int usbmsc_copy_epdesc(enum usbmsc_epdesc_e epid,
{
epdesc->len = USB_SIZEOF_EPDESC; /* Descriptor length */
epdesc->type = USB_DESC_TYPE_ENDPOINT; /* Descriptor type */
epdesc->addr = USBMSC_MKEPBULKIN(devdesc); /* Endpoint address */
epdesc->addr = USBMSC_MKEPBULKIN(devinfo); /* Endpoint address */
epdesc->attr = USBMSC_EPINBULK_ATTR; /* Endpoint attributes */
#ifdef CONFIG_USBDEV_DUALSPEED
@ -310,11 +310,11 @@ int usbmsc_copy_epdesc(enum usbmsc_epdesc_e epid,
#ifdef CONFIG_USBDEV_DUALSPEED
int16_t usbmsc_mkcfgdesc(uint8_t *buf,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devinfo,
uint8_t speed, uint8_t type)
#else
int16_t usbmsc_mkcfgdesc(uint8_t *buf,
FAR struct usbdev_description_s *devdesc)
FAR struct usbdev_devinfo_s *devinfo)
#endif
{
int length = 0;
@ -373,13 +373,13 @@ int16_t usbmsc_mkcfgdesc(uint8_t *buf,
dest->len = USB_SIZEOF_IFDESC; /* Descriptor length */
dest->type = USB_DESC_TYPE_INTERFACE; /* Descriptor type */
dest->ifno = devdesc->ifnobase; /* Interface number */
dest->ifno = devinfo->ifnobase; /* Interface number */
dest->alt = USBMSC_ALTINTERFACEID; /* Alternate setting */
dest->neps = USBMSC_NENDPOINTS; /* Number of endpoints */
dest->classid = USB_CLASS_MASS_STORAGE; /* Interface class */
dest->subclass = USBMSC_SUBCLASS_SCSI; /* Interface sub-class */
dest->protocol = USBMSC_PROTO_BULKONLY; /* Interface protocol */
dest->iif = devdesc->strbase + USBMSC_INTERFACESTRID; /* iInterface */
dest->iif = devinfo->strbase + USBMSC_INTERFACESTRID; /* iInterface */
buf += sizeof(struct usb_ifdesc_s);
length += sizeof(struct usb_ifdesc_s);
@ -391,7 +391,7 @@ int16_t usbmsc_mkcfgdesc(uint8_t *buf,
{
int len = usbmsc_copy_epdesc(USBMSC_EPBULKIN, (FAR struct usb_epdesc_s *)buf,
devdesc, hispeed);
devinfo, hispeed);
buf += len;
length += len;
@ -401,7 +401,7 @@ int16_t usbmsc_mkcfgdesc(uint8_t *buf,
{
int len = usbmsc_copy_epdesc(USBMSC_EPBULKOUT,
(FAR struct usb_epdesc_s *)buf, devdesc,
(FAR struct usb_epdesc_s *)buf, devinfo,
hispeed);
buf += len;

View File

@ -97,7 +97,7 @@
* Size of the serial receive/transmit buffers. Default 256.
*/
/* Informations needed in usbdev_description_s */
/* Informations needed in usbdev_devinfo_s */
#define CDCACM_NUM_EPS (3)
@ -348,9 +348,9 @@ typedef FAR void (*cdcacm_callback_t)(enum cdcacm_event_e event);
****************************************************************************/
#if defined(CONFIG_USBDEV_COMPOSITE) && defined(CONFIG_CDCACM_COMPOSITE)
struct usbdev_description_s;
struct usbdev_devinfo_s;
struct usbdevclass_driver_s;
int cdcacm_classobject(int minor, FAR struct usbdev_description_s *devdesc,
int cdcacm_classobject(int minor, FAR struct usbdev_devinfo_s *devdesc,
FAR struct usbdevclass_driver_s **classdev);
#endif

View File

@ -196,9 +196,9 @@
/* USB Controller Structures ********************************************************/
/* usbdev_description_s - describes the low level bindings of an usb device */
/* usbdev_devinfo_s - describes the low level bindings of an usb device */
struct usbdev_description_s
struct usbdev_devinfo_s
{
int ninterfaces; /* Number of interfaces in the configuration */
int ifnobase; /* Offset to Interface-IDs */
@ -215,16 +215,16 @@ struct composite_devdesc_s
{
#ifdef CONFIG_USBDEV_DUALSPEED
CODE int16_t (*mkconfdesc)(FAR uint8_t *buf,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devdesc,
uint8_t speed, uint8_t type);
#else
CODE int16_t (*mkconfdesc)(FAR uint8_t *buf,
FAR struct usbdev_description_s *devdesc);
FAR struct usbdev_devinfo_s *devdesc);
#endif
CODE int (*mkstrdesc)(uint8_t id, FAR struct usb_strdesc_s *strdesc);
CODE int (*classobject)(int minor,
FAR struct usbdev_description_s *devdesc,
FAR struct usbdev_devinfo_s *devdesc,
FAR struct usbdevclass_driver_s **classdev);
CODE void (*uninitialize)(FAR struct usbdevclass_driver_s *classdev);
@ -234,7 +234,7 @@ struct composite_devdesc_s
int cfgdescsize; /* The size of the config descriptor */
int minor;
struct usbdev_description_s devdesc;
struct usbdev_devinfo_s devdesc;
};
#endif

View File

@ -56,7 +56,7 @@
* Pre-processor Definitions
****************************************************************************/
/* Informations about the device needed in usbdev_description_s */
/* Informations about the device needed in usbdev_devinfo_s */
#define USBMSC_CONFIGID (1) /* The only supported configuration ID */
#define USBMSC_NENDPOINTS (2) /* Number of endpoints in the interface */
@ -189,7 +189,7 @@ int usbmsc_exportluns(FAR void *handle);
#if defined(CONFIG_USBDEV_COMPOSITE) && defined(CONFIG_USBMSC_COMPOSITE)
struct usbdevclass_driver_s;
int usbmsc_classobject(FAR void *handle, FAR struct usbdev_description_s *devdesc,
int usbmsc_classobject(FAR void *handle, FAR struct usbdev_devinfo_s *devdesc,
FAR struct usbdevclass_driver_s **classdev);
#endif