Skip to content

Commit 14c28c4

Browse files
jfischer-nocarlescufi
authored andcommitted
usb: remove USB_SCD_ATTRIBUTES macro
USB_SCD_ATTRIBUTES is a configuration dependent macro that does not map any part of the spec and does not belong to usb_ch9 header. Signed-off-by: Johann Fischer <[email protected]>
1 parent e071555 commit 14c28c4

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

include/usb/usb_ch9.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,6 @@ struct usb_association_descriptor {
220220
#define USB_SCD_RESERVED BIT(7)
221221
#define USB_SCD_SELF_POWERED BIT(6)
222222
#define USB_SCD_REMOTE_WAKEUP BIT(5)
223-
#define USB_SCD_ATTRIBUTES (USB_SCD_RESERVED | \
224-
COND_CODE_1(CONFIG_USB_SELF_POWERED, \
225-
(USB_SCD_SELF_POWERED), (0)) | \
226-
COND_CODE_1(CONFIG_USB_DEVICE_REMOTE_WAKEUP, \
227-
(USB_SCD_REMOTE_WAKEUP), (0)))
228223

229224
/** USB Defined Base Class Codes from https://www.usb.org/defined-class-codes */
230225
#define USB_BCC_AUDIO 0x01

subsys/usb/class/dfu/usb_dfu.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ struct dev_dfu_mode_descriptor dfu_mode_desc = {
155155
.bNumInterfaces = 1,
156156
.bConfigurationValue = 1,
157157
.iConfiguration = 0,
158-
.bmAttributes = USB_SCD_ATTRIBUTES,
158+
.bmAttributes = USB_SCD_RESERVED |
159+
COND_CODE_1(CONFIG_USB_SELF_POWERED,
160+
(USB_SCD_SELF_POWERED), (0)) |
161+
COND_CODE_1(CONFIG_USB_DEVICE_REMOTE_WAKEUP,
162+
(USB_SCD_REMOTE_WAKEUP), (0)),
159163
.bMaxPower = CONFIG_USB_MAX_POWER,
160164
},
161165
.sec_dfu_cfg = {

subsys/usb/usb_descriptor.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ USBD_DEVICE_DESCR_DEFINE(primary) struct common_descriptor common_desc = {
9090
.bNumInterfaces = 0,
9191
.bConfigurationValue = 1,
9292
.iConfiguration = 0,
93-
.bmAttributes = USB_SCD_ATTRIBUTES,
93+
.bmAttributes = USB_SCD_RESERVED |
94+
COND_CODE_1(CONFIG_USB_SELF_POWERED,
95+
(USB_SCD_SELF_POWERED), (0)) |
96+
COND_CODE_1(CONFIG_USB_DEVICE_REMOTE_WAKEUP,
97+
(USB_SCD_REMOTE_WAKEUP), (0)),
9498
.bMaxPower = CONFIG_USB_MAX_POWER,
9599
},
96100
};

0 commit comments

Comments
 (0)