drivers: usbdev: Fix USB descriptor
This commit fixes the regression from https://github.com/apache/nuttx/pull/13190 Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
This commit is contained in:
parent
baf79de7e5
commit
918ae4cc84
@ -1764,7 +1764,7 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
case USB_DESC_TYPE_CONFIG:
|
||||
{
|
||||
ret = usbclass_mkcfgdesc(ctrlreq->buf,
|
||||
dev->speed, ctrl->req);
|
||||
dev->speed, ctrl->value[1]);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -347,9 +347,11 @@ static const struct usbdev_epinfo_s g_rndis_epintindesc =
|
||||
.type = USB_DESC_TYPE_ENDPOINT,
|
||||
#ifndef CONFIG_RNDIS_COMPOSITE
|
||||
.addr = RNDIS_EPINTIN_ADDR,
|
||||
#else
|
||||
.addr = USB_DIR_IN,
|
||||
#endif
|
||||
.attr = USB_EP_ATTR_XFER_INT,
|
||||
.interval = 1
|
||||
.interval = 10
|
||||
},
|
||||
.reqnum = 1,
|
||||
.fssize = CONFIG_RNDIS_EPINTIN_FSSIZE,
|
||||
@ -397,6 +399,8 @@ static const struct usbdev_epinfo_s g_rndis_epbulkindesc =
|
||||
.type = USB_DESC_TYPE_ENDPOINT,
|
||||
#ifndef CONFIG_RNDIS_COMPOSITE
|
||||
.addr = RNDIS_EPBULKIN_ADDR,
|
||||
#else
|
||||
.addr = USB_DIR_IN,
|
||||
#endif
|
||||
.attr = USB_EP_ATTR_XFER_BULK,
|
||||
#ifdef CONFIG_USBDEV_DUALSPEED
|
||||
@ -434,6 +438,8 @@ static const struct usbdev_epinfo_s g_rndis_epbulkoutdesc =
|
||||
.type = USB_DESC_TYPE_ENDPOINT,
|
||||
#ifndef CONFIG_RNDIS_COMPOSITE
|
||||
.addr = RNDIS_EPBULKOUT_ADDR,
|
||||
#else
|
||||
.addr = USB_DIR_OUT,
|
||||
#endif
|
||||
.attr = USB_EP_ATTR_XFER_BULK,
|
||||
#ifdef CONFIG_USBDEV_DUALSPEED
|
||||
@ -1944,6 +1950,7 @@ static int16_t usbclass_mkcfgdesc(FAR uint8_t *buf,
|
||||
uint8_t speed, uint8_t type)
|
||||
{
|
||||
uint16_t totallen = 0;
|
||||
uint8_t epno;
|
||||
int ret;
|
||||
|
||||
/* Check for switches between high and full speed */
|
||||
@ -2007,8 +2014,9 @@ static int16_t usbclass_mkcfgdesc(FAR uint8_t *buf,
|
||||
|
||||
totallen += sizeof(struct usb_ifdesc_s);
|
||||
|
||||
epno = devinfo ? devinfo->epno[RNDIS_EP_INTIN_IDX] : 0;
|
||||
ret = usbdev_copy_epdesc((struct usb_epdesc_s *)buf,
|
||||
devinfo->epno[RNDIS_EP_INTIN_IDX],
|
||||
epno,
|
||||
speed,
|
||||
&g_rndis_epintindesc);
|
||||
|
||||
@ -2032,8 +2040,9 @@ static int16_t usbclass_mkcfgdesc(FAR uint8_t *buf,
|
||||
|
||||
totallen += sizeof(struct usb_ifdesc_s);
|
||||
|
||||
epno = devinfo ? devinfo->epno[RNDIS_EP_BULKIN_IDX] : 0;
|
||||
ret = usbdev_copy_epdesc((struct usb_epdesc_s *)buf,
|
||||
devinfo->epno[RNDIS_EP_BULKIN_IDX],
|
||||
epno,
|
||||
speed,
|
||||
&g_rndis_epbulkindesc);
|
||||
if (buf != NULL)
|
||||
@ -2043,8 +2052,9 @@ static int16_t usbclass_mkcfgdesc(FAR uint8_t *buf,
|
||||
|
||||
totallen += ret;
|
||||
|
||||
epno = devinfo ? devinfo->epno[RNDIS_EP_BULKOUT_IDX] : 0;
|
||||
ret = usbdev_copy_epdesc((struct usb_epdesc_s *)buf,
|
||||
devinfo->epno[RNDIS_EP_BULKOUT_IDX],
|
||||
epno,
|
||||
speed,
|
||||
&g_rndis_epbulkoutdesc);
|
||||
if (buf != NULL)
|
||||
@ -2508,7 +2518,7 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
|
||||
case USB_DESC_TYPE_CONFIG:
|
||||
{
|
||||
ret = usbclass_mkcfgdesc(ctrlreq->buf, &priv->devinfo,
|
||||
dev->speed, ctrl->req);
|
||||
dev->speed, ctrl->value[1]);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user