You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2023/03/28 22:44:05 UTC
[nuttx] 04/05: rndis: exclude the logic that belongs to composite
This is an automated email from the ASF dual-hosted git repository.
acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 8de219777365a88979fa65e826fd948d6ac14e8e
Author: raiden00pl <ra...@railab.me>
AuthorDate: Thu Mar 23 13:18:38 2023 +0100
rndis: exclude the logic that belongs to composite
---
drivers/usbdev/rndis.c | 30 ++++++++++++++++++++++++------
1 file changed, 24 insertions(+), 6 deletions(-)
diff --git a/drivers/usbdev/rndis.c b/drivers/usbdev/rndis.c
index b07ac08ddd..d260e9a7a7 100644
--- a/drivers/usbdev/rndis.c
+++ b/drivers/usbdev/rndis.c
@@ -2474,20 +2474,28 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
break;
#endif
-#ifdef CONFIG_USBDEV_DUALSPEED
+ /* If the serial device is used in as part of a composite
+ * device, then the configuration descriptor is provided by
+ * logic in the composite device implementation.
+ */
+
+#ifndef CONFIG_CDCACM_COMPOSITE
+# ifdef CONFIG_USBDEV_DUALSPEED
case USB_DESC_TYPE_OTHERSPEEDCONFIG:
-#endif /* CONFIG_USBDEV_DUALSPEED */
+# endif /* CONFIG_USBDEV_DUALSPEED */
case USB_DESC_TYPE_CONFIG:
{
-#ifdef CONFIG_USBDEV_DUALSPEED
+# ifdef CONFIG_USBDEV_DUALSPEED
ret = usbclass_mkcfgdesc(ctrlreq->buf, &priv->devinfo,
dev->speed, ctrl->req);
-#else
+# else
ret = usbclass_mkcfgdesc(ctrlreq->buf, &priv->devinfo);
-#endif
+# endif
}
break;
+#endif
+#ifndef CONFIG_CDCACM_COMPOSITE
case USB_DESC_TYPE_STRING:
{
/* index == language code. */
@@ -2496,6 +2504,7 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
(FAR struct usb_strdesc_s *)ctrlreq->buf);
}
break;
+#endif
default:
{
@@ -2516,6 +2525,12 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
}
break;
+ /* If the serial device is used in as part of a composite device,
+ * then the overall composite class configuration is managed by
+ * logic in the composite device implementation.
+ */
+
+#ifndef CONFIG_CDCACM_COMPOSITE
case USB_REQ_GETCONFIGURATION:
{
if (ctrl->type == USB_DIR_IN)
@@ -2525,6 +2540,7 @@ static int usbclass_setup(FAR struct usbdevclass_driver_s *driver,
}
}
break;
+#endif
default:
usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_UNSUPPORTEDSTDREQ),
@@ -2663,10 +2679,12 @@ static void usbclass_disconnect(FAR struct usbdevclass_driver_s *driver,
leave_critical_section(flags);
/* Perform the soft connect function so that we will we can be
- * re-enumerated.
+ * re-enumerated (unless we are part of a composite device)
*/
+#ifndef CONFIG_CDCACM_COMPOSITE
DEV_CONNECT(dev);
+#endif
}
/****************************************************************************