Skip to content

Commit b1f3825

Browse files
masz-nordicnashif
authored andcommitted
usb: cdc: add option to force IAD
Interface Association descriptor has to be used with Windows 7. Add CONFIG_CDC_ACM_IAD option to force its usage, disabled by default. Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
1 parent a30950c commit b1f3825

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

subsys/usb/class/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ config CDC_ACM_BULK_EP_MPS
4646
help
4747
CDC ACM class bulk endpoints size
4848

49+
config CDC_ACM_IAD
50+
bool "Force using Interface Association Descriptor"
51+
default n
52+
help
53+
IAD should not be required for non-composite CDC ACM device,
54+
but Windows 7 fails to properly enumerate without it.
55+
Enable if you want CDC ACM to work with Windows 7.
56+
4957
module = USB_CDC_ACM
5058
module-str = usb cdc acm
5159
source "subsys/logging/Kconfig.template.log_config"

subsys/usb/class/cdc_acm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ LOG_MODULE_REGISTER(usb_cdc_acm);
7878
#define ACM_IN_EP_IDX 2
7979

8080
struct usb_cdc_acm_config {
81-
#ifdef CONFIG_USB_COMPOSITE_DEVICE
81+
#if (CONFIG_USB_COMPOSITE_DEVICE || CONFIG_CDC_ACM_IAD)
8282
struct usb_association_descriptor iad_cdc;
8383
#endif
8484
struct usb_if_descriptor if0;
@@ -989,7 +989,7 @@ static const struct uart_driver_api cdc_acm_driver_api = {
989989
.endpoint = cdc_acm_ep_data_##x, \
990990
};
991991

992-
#if CONFIG_USB_COMPOSITE_DEVICE
992+
#if (CONFIG_USB_COMPOSITE_DEVICE || CONFIG_CDC_ACM_IAD)
993993
#define DEFINE_CDC_ACM_DESCR(x, int_ep_addr, out_ep_addr, in_ep_addr) \
994994
USBD_CLASS_DESCR_DEFINE(primary, x) \
995995
struct usb_cdc_acm_config cdc_acm_cfg_##x = { \
@@ -1014,7 +1014,7 @@ static const struct uart_driver_api cdc_acm_driver_api = {
10141014
CONFIG_CDC_ACM_BULK_EP_MPS, \
10151015
0x00), \
10161016
}
1017-
#else /* CONFIG_USB_COMPOSITE_DEVICE */
1017+
#else /* (CONFIG_USB_COMPOSITE_DEVICE || CONFIG_CDC_ACM_IAD) */
10181018
#define DEFINE_CDC_ACM_DESCR(x, int_ep_addr, out_ep_addr, in_ep_addr) \
10191019
USBD_CLASS_DESCR_DEFINE(primary, x) \
10201020
struct usb_cdc_acm_config cdc_acm_cfg_##x = { \
@@ -1038,7 +1038,7 @@ static const struct uart_driver_api cdc_acm_driver_api = {
10381038
CONFIG_CDC_ACM_BULK_EP_MPS, \
10391039
0x00), \
10401040
}
1041-
#endif /* CONFIG_USB_COMPOSITE_DEVICE */
1041+
#endif /* (CONFIG_USB_COMPOSITE_DEVICE || CONFIG_CDC_ACM_IAD) */
10421042

10431043
#define DEFINE_CDC_ACM_DEV_DATA(x, _) \
10441044
RING_BUF_DECLARE(rx_ringbuf_##x, \

0 commit comments

Comments
 (0)