diff options
| author | sakumisu <[email protected]> | 2021-11-09 10:28:10 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2021-11-09 10:28:10 +0800 |
| commit | bb5f7e434b2bbf75f92521748efe2ece54385209 (patch) | |
| tree | 30f2c7ad105eb081fb6c4282418e1dd942e88d73 /class/cdc | |
| parent | 936dda1df52914583e590a7e01d5b263cb35ab2c (diff) | |
modify class request print log
Diffstat (limited to 'class/cdc')
| -rw-r--r-- | class/cdc/usbd_cdc.c | 4 | ||||
| -rw-r--r-- | class/cdc/usbd_cdc.h | 50 |
2 files changed, 29 insertions, 25 deletions
diff --git a/class/cdc/usbd_cdc.c b/class/cdc/usbd_cdc.c index 69d8d307..1e1c3fe3 100644 --- a/class/cdc/usbd_cdc.c +++ b/class/cdc/usbd_cdc.c @@ -65,6 +65,10 @@ static void usbd_cdc_acm_reset(void) */
static int cdc_acm_class_request_handler(struct usb_setup_packet *pSetup, uint8_t **data, uint32_t *len)
{
+ USBD_LOG_DBG("CDC Class request: "
+ "bRequest 0x%02x\r\n",
+ setup->bRequest);
+
switch (pSetup->bRequest) {
case CDC_REQUEST_SET_LINE_CODING:
diff --git a/class/cdc/usbd_cdc.h b/class/cdc/usbd_cdc.h index 1441fd4c..33c2ac29 100644 --- a/class/cdc/usbd_cdc.h +++ b/class/cdc/usbd_cdc.h @@ -297,8 +297,8 @@ struct cdc_ecm_descriptor { #define CDC_ACM_DESCRIPTOR_LEN (8 + 9 + 5 + 5 + 4 + 5 + 7 + 9 + 7 + 7) // clang-format off #ifndef CONFIG_USB_HS -#define CDC_ACM_DESCRIPTOR_INIT(bFirstInterface, int_ep, out_ep, in_ep, str_idx) \ - /* Interface Associate */ \ +#define CDC_ACM_DESCRIPTOR_INIT(bFirstInterface, int_ep, out_ep, in_ep, str_idx) \ + /* Interface Associate */ \ 0x08, /* bLength */ \ USB_DESCRIPTOR_TYPE_INTERFACE_ASSOCIATION, /* bDescriptorType */ \ bFirstInterface, /* bFirstInterface */ \ @@ -306,7 +306,7 @@ struct cdc_ecm_descriptor { USB_DEVICE_CLASS_CDC, /* bFunctionClass */ \ CDC_ABSTRACT_CONTROL_MODEL, /* bFunctionSubClass */ \ CDC_COMMON_PROTOCOL_AT_COMMANDS, /* bFunctionProtocol */ \ - 0x00, /* iFunction */ /* CDC Control Interface */ \ + 0x00, /* iFunction */ \ 0x09, /* bLength */ \ USB_DESCRIPTOR_TYPE_INTERFACE, /* bDescriptorType */ \ bFirstInterface, /* bInterfaceNumber */ \ @@ -315,31 +315,31 @@ struct cdc_ecm_descriptor { USB_DEVICE_CLASS_CDC, /* bInterfaceClass */ \ CDC_ABSTRACT_CONTROL_MODEL, /* bInterfaceSubClass */ \ CDC_COMMON_PROTOCOL_AT_COMMANDS, /* bInterfaceProtocol */ \ - str_idx, /* iInterface */ /* CDC Header */ \ + str_idx, /* iInterface */ \ 0x05, /* bLength */ \ CDC_CS_INTERFACE, /* bDescriptorType */ \ CDC_FUNC_DESC_HEADER, /* bDescriptorSubtype */ \ - WBVAL(CDC_V1_10), /* bcdCDC */ /* CDC Call */ \ + WBVAL(CDC_V1_10), /* bcdCDC */ \ 0x05, /* bLength */ \ CDC_CS_INTERFACE, /* bDescriptorType */ \ CDC_FUNC_DESC_CALL_MANAGEMENT, /* bDescriptorSubtype */ \ bFirstInterface, /* bmCapabilities */ \ - (uint8_t)(bFirstInterface + 1), /* bDataInterface */ /* CDC ACM: support line request */ \ + (uint8_t)(bFirstInterface + 1), /* bDataInterface */ \ 0x04, /* bLength */ \ CDC_CS_INTERFACE, /* bDescriptorType */ \ CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT, /* bDescriptorSubtype */ \ - 0x02, /* bmCapabilities */ /* CDC Union */ \ + 0x02, /* bmCapabilities */ \ 0x05, /* bLength */ \ CDC_CS_INTERFACE, /* bDescriptorType */ \ CDC_FUNC_DESC_UNION, /* bDescriptorSubtype */ \ bFirstInterface, /* bMasterInterface */ \ - (uint8_t)(bFirstInterface + 1), /* bSlaveInterface0 */ /* Endpoint Notification */ \ + (uint8_t)(bFirstInterface + 1), /* bSlaveInterface0 */ \ 0x07, /* bLength */ \ USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \ int_ep, /* bEndpointAddress */ \ 0x03, /* bmAttributes */ \ 0x40, 0x00, /* wMaxPacketSize */ \ - 0x01, /* bInterval */ /* CDC Data Interface */ \ + 0x00, /* bInterval */ \ 0x09, /* bLength */ \ USB_DESCRIPTOR_TYPE_INTERFACE, /* bDescriptorType */ \ (uint8_t)(bFirstInterface + 1), /* bInterfaceNumber */ \ @@ -348,19 +348,19 @@ struct cdc_ecm_descriptor { CDC_DATA_INTERFACE_CLASS, /* bInterfaceClass */ \ 0x00, /* bInterfaceSubClass */ \ 0x00, /* bInterfaceProtocol */ \ - 0x00, /* iInterface */ /* Endpoint Out */ \ + 0x00, /* iInterface */ \ 0x07, /* bLength */ \ USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \ out_ep, /* bEndpointAddress */ \ 0x02, /* bmAttributes */ \ 0x40, 0x00, /* wMaxPacketSize */ \ - 0x01, /* bInterval */ /* Endpoint In */ \ + 0x00, /* bInterval */ \ 0x07, /* bLength */ \ USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \ in_ep, /* bEndpointAddress */ \ 0x02, /* bmAttributes */ \ 0x40, 0x00, /* wMaxPacketSize */ \ - 0x01 /* bInterval */ + 0x00 /* bInterval */ #else #define CDC_ACM_DESCRIPTOR_INIT(bFirstInterface, int_ep, out_ep, in_ep, str_idx) \ /* Interface Associate */ \ @@ -371,7 +371,7 @@ struct cdc_ecm_descriptor { USB_DEVICE_CLASS_CDC, /* bFunctionClass */ \ CDC_ABSTRACT_CONTROL_MODEL, /* bFunctionSubClass */ \ CDC_COMMON_PROTOCOL_AT_COMMANDS, /* bFunctionProtocol */ \ - 0x00, /* iFunction */ /* CDC Control Interface */ \ + 0x00, /* iFunction */ \ 0x09, /* bLength */ \ USB_DESCRIPTOR_TYPE_INTERFACE, /* bDescriptorType */ \ bFirstInterface, /* bInterfaceNumber */ \ @@ -380,31 +380,31 @@ struct cdc_ecm_descriptor { USB_DEVICE_CLASS_CDC, /* bInterfaceClass */ \ CDC_ABSTRACT_CONTROL_MODEL, /* bInterfaceSubClass */ \ CDC_COMMON_PROTOCOL_AT_COMMANDS, /* bInterfaceProtocol */ \ - str_idx, /* iInterface */ /* CDC Header */ \ + str_idx, /* iInterface */ \ 0x05, /* bLength */ \ CDC_CS_INTERFACE, /* bDescriptorType */ \ CDC_FUNC_DESC_HEADER, /* bDescriptorSubtype */ \ - WBVAL(CDC_V1_10), /* bcdCDC */ /* CDC Call */ \ + WBVAL(CDC_V1_10), /* bcdCDC */ \ 0x05, /* bLength */ \ CDC_CS_INTERFACE, /* bDescriptorType */ \ CDC_FUNC_DESC_CALL_MANAGEMENT, /* bDescriptorSubtype */ \ bFirstInterface, /* bmCapabilities */ \ - (uint8_t)(bFirstInterface + 1), /* bDataInterface */ /* CDC ACM: support line request */ \ + (uint8_t)(bFirstInterface + 1), /* bDataInterface */ \ 0x04, /* bLength */ \ CDC_CS_INTERFACE, /* bDescriptorType */ \ CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT, /* bDescriptorSubtype */ \ - 0x02, /* bmCapabilities */ /* CDC Union */ \ + 0x02, /* bmCapabilities */ \ 0x05, /* bLength */ \ CDC_CS_INTERFACE, /* bDescriptorType */ \ CDC_FUNC_DESC_UNION, /* bDescriptorSubtype */ \ bFirstInterface, /* bMasterInterface */ \ - (uint8_t)(bFirstInterface + 1), /* bSlaveInterface0 */ /* Endpoint Notification */ \ + (uint8_t)(bFirstInterface + 1), /* bSlaveInterface0 */ \ 0x07, /* bLength */ \ USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \ int_ep, /* bEndpointAddress */ \ 0x03, /* bmAttributes */ \ - 0x02, 0x00, /* wMaxPacketSize */ \ - 0x01, /* bInterval */ /* CDC Data Interface */ \ + 0x00, 0x02, /* wMaxPacketSize */ \ + 0x00, /* bInterval */ \ 0x09, /* bLength */ \ USB_DESCRIPTOR_TYPE_INTERFACE, /* bDescriptorType */ \ (uint8_t)(bFirstInterface + 1), /* bInterfaceNumber */ \ @@ -413,19 +413,19 @@ struct cdc_ecm_descriptor { CDC_DATA_INTERFACE_CLASS, /* bInterfaceClass */ \ 0x00, /* bInterfaceSubClass */ \ 0x00, /* bInterfaceProtocol */ \ - 0x00, /* iInterface */ /* Endpoint Out */ \ + 0x00, /* iInterface */ \ 0x07, /* bLength */ \ USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \ out_ep, /* bEndpointAddress */ \ 0x02, /* bmAttributes */ \ - 0x02, 0x00, /* wMaxPacketSize */ \ - 0x01, /* bInterval */ /* Endpoint In */ \ + 0x00, 0x02, /* wMaxPacketSize */ \ + 0x00, /* bInterval */ \ 0x07, /* bLength */ \ USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \ in_ep, /* bEndpointAddress */ \ 0x02, /* bmAttributes */ \ - 0x02, 0x00, /* wMaxPacketSize */ \ - 0x01 /* bInterval */ + 0x00, 0x02, /* wMaxPacketSize */ \ + 0x00 /* bInterval */ #endif // clang-format on |
