From 85a08da966e3a2c4e9d3012bcfd4e54c24b6003f Mon Sep 17 00:00:00 2001 From: Emil Obalski Date: Fri, 29 Nov 2019 09:08:46 +0100 Subject: [PATCH] usb: Rename defines to match present naming convention This commit renames two defines: CS_INTERFACE -> USB_CS_INTERFACE_DESC CS_ENDPOINT -> USB_CS_ENDPOINT_DESC in order to match current naming convention when it comes to descriptors fields. All relevant files are updated to match renamed macros. Signed-off-by: Emil Obalski --- include/usb/usb_common.h | 4 ++-- subsys/usb/class/cdc_acm.c | 8 ++++---- subsys/usb/class/netusb/function_ecm.c | 6 +++--- subsys/usb/class/netusb/function_rndis.c | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/usb/usb_common.h b/include/usb/usb_common.h index 22383ab7768..418b09cfa62 100644 --- a/include/usb/usb_common.h +++ b/include/usb/usb_common.h @@ -71,8 +71,8 @@ #define USB_DEVICE_CAPABILITY_DESC 0x10 #define USB_HID_DESC 0x21 #define USB_HID_REPORT_DESC 0x22 -#define CS_INTERFACE 0x24 -#define CS_ENDPOINT 0x25 +#define USB_CS_INTERFACE_DESC 0x24 +#define USB_CS_ENDPOINT_DESC 0x25 #define USB_DFU_FUNCTIONAL_DESC 0x21 #define USB_ASSOCIATION_DESC 0x0B #define USB_BINARY_OBJECT_STORE_DESC 0x0F diff --git a/subsys/usb/class/cdc_acm.c b/subsys/usb/class/cdc_acm.c index 3f7082374db..a81461530a4 100644 --- a/subsys/usb/class/cdc_acm.c +++ b/subsys/usb/class/cdc_acm.c @@ -118,7 +118,7 @@ struct usb_cdc_acm_config { #define INITIALIZER_IF_HDR \ { \ .bFunctionLength = sizeof(struct cdc_header_descriptor),\ - .bDescriptorType = CS_INTERFACE, \ + .bDescriptorType = USB_CS_INTERFACE_DESC, \ .bDescriptorSubtype = HEADER_FUNC_DESC, \ .bcdCDC = sys_cpu_to_le16(USB_1_1), \ } @@ -126,7 +126,7 @@ struct usb_cdc_acm_config { #define INITIALIZER_IF_CM \ { \ .bFunctionLength = sizeof(struct cdc_cm_descriptor), \ - .bDescriptorType = CS_INTERFACE, \ + .bDescriptorType = USB_CS_INTERFACE_DESC, \ .bDescriptorSubtype = CALL_MANAGEMENT_FUNC_DESC, \ .bmCapabilities = 0x02, \ .bDataInterface = 1, \ @@ -141,7 +141,7 @@ struct usb_cdc_acm_config { #define INITIALIZER_IF_ACM \ { \ .bFunctionLength = sizeof(struct cdc_acm_descriptor), \ - .bDescriptorType = CS_INTERFACE, \ + .bDescriptorType = USB_CS_INTERFACE_DESC, \ .bDescriptorSubtype = ACM_FUNC_DESC, \ .bmCapabilities = 0x02, \ } @@ -149,7 +149,7 @@ struct usb_cdc_acm_config { #define INITIALIZER_IF_UNION \ { \ .bFunctionLength = sizeof(struct cdc_union_descriptor), \ - .bDescriptorType = CS_INTERFACE, \ + .bDescriptorType = USB_CS_INTERFACE_DESC, \ .bDescriptorSubtype = UNION_FUNC_DESC, \ .bControlInterface = 0, \ .bSubordinateInterface0 = 1, \ diff --git a/subsys/usb/class/netusb/function_ecm.c b/subsys/usb/class/netusb/function_ecm.c index 5e3b6cfc6b2..c01586d36e1 100644 --- a/subsys/usb/class/netusb/function_ecm.c +++ b/subsys/usb/class/netusb/function_ecm.c @@ -78,14 +78,14 @@ USBD_CLASS_DESCR_DEFINE(primary, 0) struct usb_cdc_ecm_config cdc_ecm_cfg = { /* Header Functional Descriptor */ .if0_header = { .bFunctionLength = sizeof(struct cdc_header_descriptor), - .bDescriptorType = CS_INTERFACE, + .bDescriptorType = USB_CS_INTERFACE_DESC, .bDescriptorSubtype = HEADER_FUNC_DESC, .bcdCDC = sys_cpu_to_le16(USB_1_1), }, /* Union Functional Descriptor */ .if0_union = { .bFunctionLength = sizeof(struct cdc_union_descriptor), - .bDescriptorType = CS_INTERFACE, + .bDescriptorType = USB_CS_INTERFACE_DESC, .bDescriptorSubtype = UNION_FUNC_DESC, .bControlInterface = 0, .bSubordinateInterface0 = 1, @@ -93,7 +93,7 @@ USBD_CLASS_DESCR_DEFINE(primary, 0) struct usb_cdc_ecm_config cdc_ecm_cfg = { /* Ethernet Networking Functional descriptor */ .if0_netfun_ecm = { .bFunctionLength = sizeof(struct cdc_ecm_descriptor), - .bDescriptorType = CS_INTERFACE, + .bDescriptorType = USB_CS_INTERFACE_DESC, .bDescriptorSubtype = ETHERNET_FUNC_DESC, .iMACAddress = 4, .bmEthernetStatistics = sys_cpu_to_le32(0), /* None */ diff --git a/subsys/usb/class/netusb/function_rndis.c b/subsys/usb/class/netusb/function_rndis.c index f5e91ef27a7..3e8867a7f42 100644 --- a/subsys/usb/class/netusb/function_rndis.c +++ b/subsys/usb/class/netusb/function_rndis.c @@ -89,14 +89,14 @@ USBD_CLASS_DESCR_DEFINE(primary, 0) struct usb_rndis_config rndis_cfg = { /* Header Functional Descriptor */ .if0_header = { .bFunctionLength = sizeof(struct cdc_header_descriptor), - .bDescriptorType = CS_INTERFACE, + .bDescriptorType = USB_CS_INTERFACE_DESC, .bDescriptorSubtype = HEADER_FUNC_DESC, .bcdCDC = sys_cpu_to_le16(USB_1_1), }, /* Call Management Functional Descriptor */ .if0_cm = { .bFunctionLength = sizeof(struct cdc_cm_descriptor), - .bDescriptorType = CS_INTERFACE, + .bDescriptorType = USB_CS_INTERFACE_DESC, .bDescriptorSubtype = CALL_MANAGEMENT_FUNC_DESC, .bmCapabilities = 0x00, .bDataInterface = 1, @@ -104,7 +104,7 @@ USBD_CLASS_DESCR_DEFINE(primary, 0) struct usb_rndis_config rndis_cfg = { /* ACM Functional Descriptor */ .if0_acm = { .bFunctionLength = sizeof(struct cdc_acm_descriptor), - .bDescriptorType = CS_INTERFACE, + .bDescriptorType = USB_CS_INTERFACE_DESC, .bDescriptorSubtype = ACM_FUNC_DESC, /* Device supports the request combination of: * Set_Line_Coding, @@ -117,7 +117,7 @@ USBD_CLASS_DESCR_DEFINE(primary, 0) struct usb_rndis_config rndis_cfg = { /* Union Functional Descriptor */ .if0_union = { .bFunctionLength = sizeof(struct cdc_union_descriptor), - .bDescriptorType = CS_INTERFACE, + .bDescriptorType = USB_CS_INTERFACE_DESC, .bDescriptorSubtype = UNION_FUNC_DESC, .bControlInterface = 0, .bSubordinateInterface0 = 1,