Skip to content
Permalink
Browse files

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>
  • Loading branch information...
masz-nordic authored and nashif committed Mar 6, 2019
1 parent a30950c commit b1f3825ea3fb07f89eb4daebb547dd2b6356a89b
Showing with 12 additions and 4 deletions.
  1. +8 −0 subsys/usb/class/Kconfig
  2. +4 −4 subsys/usb/class/cdc_acm.c
@@ -46,6 +46,14 @@ config CDC_ACM_BULK_EP_MPS
help
CDC ACM class bulk endpoints size

config CDC_ACM_IAD
bool "Force using Interface Association Descriptor"
default n
help
IAD should not be required for non-composite CDC ACM device,
but Windows 7 fails to properly enumerate without it.
Enable if you want CDC ACM to work with Windows 7.

module = USB_CDC_ACM
module-str = usb cdc acm
source "subsys/logging/Kconfig.template.log_config"
@@ -78,7 +78,7 @@ LOG_MODULE_REGISTER(usb_cdc_acm);
#define ACM_IN_EP_IDX 2

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

#if CONFIG_USB_COMPOSITE_DEVICE
#if (CONFIG_USB_COMPOSITE_DEVICE || CONFIG_CDC_ACM_IAD)
#define DEFINE_CDC_ACM_DESCR(x, int_ep_addr, out_ep_addr, in_ep_addr) \
USBD_CLASS_DESCR_DEFINE(primary, x) \
struct usb_cdc_acm_config cdc_acm_cfg_##x = { \
@@ -1014,7 +1014,7 @@ static const struct uart_driver_api cdc_acm_driver_api = {
CONFIG_CDC_ACM_BULK_EP_MPS, \
0x00), \
}
#else /* CONFIG_USB_COMPOSITE_DEVICE */
#else /* (CONFIG_USB_COMPOSITE_DEVICE || CONFIG_CDC_ACM_IAD) */
#define DEFINE_CDC_ACM_DESCR(x, int_ep_addr, out_ep_addr, in_ep_addr) \
USBD_CLASS_DESCR_DEFINE(primary, x) \
struct usb_cdc_acm_config cdc_acm_cfg_##x = { \
@@ -1038,7 +1038,7 @@ static const struct uart_driver_api cdc_acm_driver_api = {
CONFIG_CDC_ACM_BULK_EP_MPS, \
0x00), \
}
#endif /* CONFIG_USB_COMPOSITE_DEVICE */
#endif /* (CONFIG_USB_COMPOSITE_DEVICE || CONFIG_CDC_ACM_IAD) */

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

0 comments on commit b1f3825

Please sign in to comment.
You can’t perform that action at this time.