usb: Add instance parameter to descriptors definitions
This allows to place instances of the class one after another in the linker section. Fixes #12908 Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
parent
a49125ca90
commit
bf9c6d72e8
11 changed files with 14 additions and 13 deletions
|
@ -50,8 +50,8 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
#define USBD_DEVICE_DESCR_DEFINE(p) \
|
#define USBD_DEVICE_DESCR_DEFINE(p) \
|
||||||
static __in_section(usb, descriptor_##p, 0) __used
|
static __in_section(usb, descriptor_##p, 0) __used
|
||||||
#define USBD_CLASS_DESCR_DEFINE(p) \
|
#define USBD_CLASS_DESCR_DEFINE(p, instance) \
|
||||||
static __in_section(usb, descriptor_##p, 1) __used
|
static __in_section(usb, descriptor_##p.1, instance) __used
|
||||||
#define USBD_MISC_DESCR_DEFINE(p) \
|
#define USBD_MISC_DESCR_DEFINE(p) \
|
||||||
static __in_section(usb, descriptor_##p, 2) __used
|
static __in_section(usb, descriptor_##p, 2) __used
|
||||||
#define USBD_USER_DESCR_DEFINE(p) \
|
#define USBD_USER_DESCR_DEFINE(p) \
|
||||||
|
|
|
@ -57,7 +57,8 @@ struct usb_bluetooth_config {
|
||||||
struct usb_ep_descriptor if0_in_ep;
|
struct usb_ep_descriptor if0_in_ep;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
USBD_CLASS_DESCR_DEFINE(primary) struct usb_bluetooth_config bluetooth_cfg = {
|
USBD_CLASS_DESCR_DEFINE(primary, 0)
|
||||||
|
struct usb_bluetooth_config bluetooth_cfg = {
|
||||||
/* Interface descriptor 0 */
|
/* Interface descriptor 0 */
|
||||||
.if0 = {
|
.if0 = {
|
||||||
.bLength = sizeof(struct usb_if_descriptor),
|
.bLength = sizeof(struct usb_if_descriptor),
|
||||||
|
|
|
@ -99,7 +99,7 @@ struct usb_cdc_acm_config {
|
||||||
struct usb_ep_descriptor if1_out_ep;
|
struct usb_ep_descriptor if1_out_ep;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
USBD_CLASS_DESCR_DEFINE(primary) struct usb_cdc_acm_config cdc_acm_cfg = {
|
USBD_CLASS_DESCR_DEFINE(primary, 0) struct usb_cdc_acm_config cdc_acm_cfg = {
|
||||||
#ifdef CONFIG_USB_COMPOSITE_DEVICE
|
#ifdef CONFIG_USB_COMPOSITE_DEVICE
|
||||||
.iad_cdc = {
|
.iad_cdc = {
|
||||||
.bLength = sizeof(struct usb_association_descriptor),
|
.bLength = sizeof(struct usb_association_descriptor),
|
||||||
|
|
|
@ -35,7 +35,7 @@ struct usb_hid_config {
|
||||||
#endif
|
#endif
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
USBD_CLASS_DESCR_DEFINE(primary) struct usb_hid_config hid_cfg = {
|
USBD_CLASS_DESCR_DEFINE(primary, 0) struct usb_hid_config hid_cfg = {
|
||||||
/* Interface descriptor */
|
/* Interface descriptor */
|
||||||
.if0 = {
|
.if0 = {
|
||||||
.bLength = sizeof(struct usb_if_descriptor),
|
.bLength = sizeof(struct usb_if_descriptor),
|
||||||
|
|
|
@ -36,7 +36,7 @@ struct usb_loopback_config {
|
||||||
struct usb_ep_descriptor if0_in_ep;
|
struct usb_ep_descriptor if0_in_ep;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
USBD_CLASS_DESCR_DEFINE(primary) struct usb_loopback_config loopback_cfg = {
|
USBD_CLASS_DESCR_DEFINE(primary, 0) struct usb_loopback_config loopback_cfg = {
|
||||||
/* Interface descriptor 0 */
|
/* Interface descriptor 0 */
|
||||||
.if0 = {
|
.if0 = {
|
||||||
.bLength = sizeof(struct usb_if_descriptor),
|
.bLength = sizeof(struct usb_if_descriptor),
|
||||||
|
|
|
@ -68,7 +68,7 @@ struct usb_mass_config {
|
||||||
struct usb_ep_descriptor if0_out_ep;
|
struct usb_ep_descriptor if0_out_ep;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
USBD_CLASS_DESCR_DEFINE(primary) struct usb_mass_config mass_cfg = {
|
USBD_CLASS_DESCR_DEFINE(primary, 0) struct usb_mass_config mass_cfg = {
|
||||||
/* Interface descriptor */
|
/* Interface descriptor */
|
||||||
.if0 = {
|
.if0 = {
|
||||||
.bLength = sizeof(struct usb_if_descriptor),
|
.bLength = sizeof(struct usb_if_descriptor),
|
||||||
|
|
|
@ -53,7 +53,7 @@ struct usb_cdc_ecm_config {
|
||||||
struct usb_ep_descriptor if1_1_out_ep;
|
struct usb_ep_descriptor if1_1_out_ep;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
USBD_CLASS_DESCR_DEFINE(primary) struct usb_cdc_ecm_config cdc_ecm_cfg = {
|
USBD_CLASS_DESCR_DEFINE(primary, 0) struct usb_cdc_ecm_config cdc_ecm_cfg = {
|
||||||
#ifdef CONFIG_USB_COMPOSITE_DEVICE
|
#ifdef CONFIG_USB_COMPOSITE_DEVICE
|
||||||
.iad = {
|
.iad = {
|
||||||
.bLength = sizeof(struct usb_association_descriptor),
|
.bLength = sizeof(struct usb_association_descriptor),
|
||||||
|
|
|
@ -27,7 +27,7 @@ struct usb_cdc_eem_config {
|
||||||
struct usb_ep_descriptor if0_out_ep;
|
struct usb_ep_descriptor if0_out_ep;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
USBD_CLASS_DESCR_DEFINE(primary) struct usb_cdc_eem_config cdc_eem_cfg = {
|
USBD_CLASS_DESCR_DEFINE(primary, 0) struct usb_cdc_eem_config cdc_eem_cfg = {
|
||||||
/* Interface descriptor 0 */
|
/* Interface descriptor 0 */
|
||||||
/* CDC Communication interface */
|
/* CDC Communication interface */
|
||||||
.if0 = {
|
.if0 = {
|
||||||
|
|
|
@ -69,7 +69,7 @@ struct usb_rndis_config {
|
||||||
struct usb_ep_descriptor if1_out_ep;
|
struct usb_ep_descriptor if1_out_ep;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
USBD_CLASS_DESCR_DEFINE(primary) struct usb_rndis_config rndis_cfg = {
|
USBD_CLASS_DESCR_DEFINE(primary, 0) struct usb_rndis_config rndis_cfg = {
|
||||||
#ifdef CONFIG_USB_COMPOSITE_DEVICE
|
#ifdef CONFIG_USB_COMPOSITE_DEVICE
|
||||||
.iad = {
|
.iad = {
|
||||||
.bLength = sizeof(struct usb_association_descriptor),
|
.bLength = sizeof(struct usb_association_descriptor),
|
||||||
|
|
|
@ -78,7 +78,7 @@ struct usb_dfu_config {
|
||||||
struct dfu_runtime_descriptor dfu_descr;
|
struct dfu_runtime_descriptor dfu_descr;
|
||||||
} __packed;
|
} __packed;
|
||||||
|
|
||||||
USBD_CLASS_DESCR_DEFINE(primary) struct usb_dfu_config dfu_cfg = {
|
USBD_CLASS_DESCR_DEFINE(primary, 0) struct usb_dfu_config dfu_cfg = {
|
||||||
/* Interface descriptor */
|
/* Interface descriptor */
|
||||||
.if0 = {
|
.if0 = {
|
||||||
.bLength = sizeof(struct usb_if_descriptor),
|
.bLength = sizeof(struct usb_if_descriptor),
|
||||||
|
|
|
@ -64,7 +64,7 @@ struct usb_loopback_config {
|
||||||
|
|
||||||
|
|
||||||
#define DEFINE_LOOPBACK_DESC(x) \
|
#define DEFINE_LOOPBACK_DESC(x) \
|
||||||
USBD_CLASS_DESCR_DEFINE(primary) \
|
USBD_CLASS_DESCR_DEFINE(primary, x) \
|
||||||
struct usb_loopback_config loopback_cfg_##x = { \
|
struct usb_loopback_config loopback_cfg_##x = { \
|
||||||
.if0 = INITIALIZER_IF, \
|
.if0 = INITIALIZER_IF, \
|
||||||
.if0_out_ep = INITIALIZER_IF_EP(LOOPBACK_OUT_EP_ADDR, \
|
.if0_out_ep = INITIALIZER_IF_EP(LOOPBACK_OUT_EP_ADDR, \
|
||||||
|
@ -88,7 +88,7 @@ struct usb_loopback_config {
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DEFINE_LOOPBACK_CFG_DATA(x) \
|
#define DEFINE_LOOPBACK_CFG_DATA(x) \
|
||||||
USBD_CFG_DATA_DEFINE(loopback) \
|
USBD_CFG_DATA_DEFINE(loopback_##x) \
|
||||||
struct usb_cfg_data loopback_config_##x = { \
|
struct usb_cfg_data loopback_config_##x = { \
|
||||||
.usb_device_description = NULL, \
|
.usb_device_description = NULL, \
|
||||||
.interface_config = NULL, \
|
.interface_config = NULL, \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue