From 58e817db76e2fce0fcf104b93351949c02736085 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Fri, 24 Mar 2023 13:13:04 +0100 Subject: [PATCH] rndis: do not configure endpoints from Kconfig when composite enabled This should be done from a board specific logic, as for other composite devices --- drivers/usbdev/Kconfig | 4 ++-- drivers/usbdev/rndis.c | 14 +++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/drivers/usbdev/Kconfig b/drivers/usbdev/Kconfig index c41de08f0d..19cada83f0 100644 --- a/drivers/usbdev/Kconfig +++ b/drivers/usbdev/Kconfig @@ -1022,8 +1022,6 @@ config RNDIS_VERSIONNO hex "RNDIS Version Number" default 0x0001 -endif # !RNDIS_COMPOSITE - config RNDIS_EPBULKIN int "RNDIS bulk in endpoint number" default 1 @@ -1036,6 +1034,8 @@ config RNDIS_EPINTIN int "RNDIS interrupt in endpoint number" default 3 +endif # !RNDIS_COMPOSITE + endif # RNDIS menuconfig DFU diff --git a/drivers/usbdev/rndis.c b/drivers/usbdev/rndis.c index 6e38074ae4..30a4caefa7 100644 --- a/drivers/usbdev/rndis.c +++ b/drivers/usbdev/rndis.c @@ -89,9 +89,11 @@ static_assert((CONFIG_NET_LL_GUARDSIZE % 4) == 2, #define RNDIS_NINTERFACES (2) #define RNDIS_NSTRIDS (0) -#define RNDIS_EPINTIN_ADDR USB_EPIN(CONFIG_RNDIS_EPINTIN) -#define RNDIS_EPBULKIN_ADDR USB_EPIN(CONFIG_RNDIS_EPBULKIN) -#define RNDIS_EPBULKOUT_ADDR USB_EPOUT(CONFIG_RNDIS_EPBULKOUT) +#ifndef CONFIG_RNDIS_COMPOSITE +# define RNDIS_EPINTIN_ADDR USB_EPIN(CONFIG_RNDIS_EPINTIN) +# define RNDIS_EPBULKIN_ADDR USB_EPIN(CONFIG_RNDIS_EPBULKIN) +# define RNDIS_EPBULKOUT_ADDR USB_EPOUT(CONFIG_RNDIS_EPBULKOUT) +#endif #define RNDIS_NUM_EPS (3) #define RNDIS_MANUFACTURERSTRID (1) @@ -326,7 +328,9 @@ const static struct rndis_cfgdesc_s g_rndis_cfgdesc = { .len = USB_SIZEOF_EPDESC, .type = USB_DESC_TYPE_ENDPOINT, +#ifndef CONFIG_RNDIS_COMPOSITE .addr = RNDIS_EPINTIN_ADDR, +#endif .attr = USB_EP_ATTR_XFER_INT, .mxpacketsize = { @@ -348,7 +352,9 @@ const static struct rndis_cfgdesc_s g_rndis_cfgdesc = { .len = USB_SIZEOF_EPDESC, .type = USB_DESC_TYPE_ENDPOINT, +#ifndef CONFIG_RNDIS_COMPOSITE .addr = RNDIS_EPBULKIN_ADDR, +#endif .attr = USB_EP_ATTR_XFER_BULK, #ifdef CONFIG_USBDEV_DUALSPEED .mxpacketsize = @@ -367,7 +373,9 @@ const static struct rndis_cfgdesc_s g_rndis_cfgdesc = { .len = USB_SIZEOF_EPDESC, .type = USB_DESC_TYPE_ENDPOINT, +#ifndef CONFIG_RNDIS_COMPOSITE .addr = RNDIS_EPBULKOUT_ADDR, +#endif .attr = USB_EP_ATTR_XFER_BULK, #ifdef CONFIG_USBDEV_DUALSPEED .mxpacketsize =