|
@@ -302,8 +302,7 @@ struct cdc_ecm_descriptor {
|
|
|
/*Length of template descriptor: 66 bytes*/
|
|
/*Length of template descriptor: 66 bytes*/
|
|
|
#define CDC_ACM_DESCRIPTOR_LEN (8 + 9 + 5 + 5 + 4 + 5 + 7 + 9 + 7 + 7)
|
|
#define CDC_ACM_DESCRIPTOR_LEN (8 + 9 + 5 + 5 + 4 + 5 + 7 + 9 + 7 + 7)
|
|
|
// clang-format off
|
|
// clang-format off
|
|
|
-#ifndef CONFIG_USB_HS
|
|
|
|
|
-#define CDC_ACM_DESCRIPTOR_INIT(bFirstInterface, int_ep, out_ep, in_ep, str_idx) \
|
|
|
|
|
|
|
+#define CDC_ACM_DESCRIPTOR_INIT(bFirstInterface, int_ep, out_ep, in_ep, wMaxPacketSize, str_idx) \
|
|
|
/* Interface Associate */ \
|
|
/* Interface Associate */ \
|
|
|
0x08, /* bLength */ \
|
|
0x08, /* bLength */ \
|
|
|
USB_DESCRIPTOR_TYPE_INTERFACE_ASSOCIATION, /* bDescriptorType */ \
|
|
USB_DESCRIPTOR_TYPE_INTERFACE_ASSOCIATION, /* bDescriptorType */ \
|
|
@@ -359,152 +358,20 @@ struct cdc_ecm_descriptor {
|
|
|
USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
|
|
USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
|
|
|
out_ep, /* bEndpointAddress */ \
|
|
out_ep, /* bEndpointAddress */ \
|
|
|
0x02, /* bmAttributes */ \
|
|
0x02, /* bmAttributes */ \
|
|
|
- 0x40, 0x00, /* wMaxPacketSize */ \
|
|
|
|
|
|
|
+ WBVAL(wMaxPacketSize), /* wMaxPacketSize */ \
|
|
|
0x00, /* bInterval */ \
|
|
0x00, /* bInterval */ \
|
|
|
0x07, /* bLength */ \
|
|
0x07, /* bLength */ \
|
|
|
USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
|
|
USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
|
|
|
in_ep, /* bEndpointAddress */ \
|
|
in_ep, /* bEndpointAddress */ \
|
|
|
0x02, /* bmAttributes */ \
|
|
0x02, /* bmAttributes */ \
|
|
|
- 0x40, 0x00, /* wMaxPacketSize */ \
|
|
|
|
|
|
|
+ WBVAL(wMaxPacketSize), /* wMaxPacketSize */ \
|
|
|
0x00 /* bInterval */
|
|
0x00 /* bInterval */
|
|
|
-#else
|
|
|
|
|
-#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 */ \
|
|
|
|
|
- 0x02, /* bInterfaceCount */ \
|
|
|
|
|
- USB_DEVICE_CLASS_CDC, /* bFunctionClass */ \
|
|
|
|
|
- CDC_ABSTRACT_CONTROL_MODEL, /* bFunctionSubClass */ \
|
|
|
|
|
- CDC_COMMON_PROTOCOL_AT_COMMANDS, /* bFunctionProtocol */ \
|
|
|
|
|
- 0x00, /* iFunction */ \
|
|
|
|
|
- 0x09, /* bLength */ \
|
|
|
|
|
- USB_DESCRIPTOR_TYPE_INTERFACE, /* bDescriptorType */ \
|
|
|
|
|
- bFirstInterface, /* bInterfaceNumber */ \
|
|
|
|
|
- 0x00, /* bAlternateSetting */ \
|
|
|
|
|
- 0x01, /* bNumEndpoints */ \
|
|
|
|
|
- USB_DEVICE_CLASS_CDC, /* bInterfaceClass */ \
|
|
|
|
|
- CDC_ABSTRACT_CONTROL_MODEL, /* bInterfaceSubClass */ \
|
|
|
|
|
- CDC_COMMON_PROTOCOL_AT_COMMANDS, /* bInterfaceProtocol */ \
|
|
|
|
|
- str_idx, /* iInterface */ \
|
|
|
|
|
- 0x05, /* bLength */ \
|
|
|
|
|
- CDC_CS_INTERFACE, /* bDescriptorType */ \
|
|
|
|
|
- CDC_FUNC_DESC_HEADER, /* bDescriptorSubtype */ \
|
|
|
|
|
- WBVAL(CDC_V1_10), /* bcdCDC */ \
|
|
|
|
|
- 0x05, /* bLength */ \
|
|
|
|
|
- CDC_CS_INTERFACE, /* bDescriptorType */ \
|
|
|
|
|
- CDC_FUNC_DESC_CALL_MANAGEMENT, /* bDescriptorSubtype */ \
|
|
|
|
|
- 0x00, /* bmCapabilities */ \
|
|
|
|
|
- (uint8_t)(bFirstInterface + 1), /* bDataInterface */ \
|
|
|
|
|
- 0x04, /* bLength */ \
|
|
|
|
|
- CDC_CS_INTERFACE, /* bDescriptorType */ \
|
|
|
|
|
- CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT, /* bDescriptorSubtype */ \
|
|
|
|
|
- 0x02, /* bmCapabilities */ \
|
|
|
|
|
- 0x05, /* bLength */ \
|
|
|
|
|
- CDC_CS_INTERFACE, /* bDescriptorType */ \
|
|
|
|
|
- CDC_FUNC_DESC_UNION, /* bDescriptorSubtype */ \
|
|
|
|
|
- bFirstInterface, /* bMasterInterface */ \
|
|
|
|
|
- (uint8_t)(bFirstInterface + 1), /* bSlaveInterface0 */ \
|
|
|
|
|
- 0x07, /* bLength */ \
|
|
|
|
|
- USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
|
|
|
|
|
- int_ep, /* bEndpointAddress */ \
|
|
|
|
|
- 0x03, /* bmAttributes */ \
|
|
|
|
|
- 0x08, 0x00, /* wMaxPacketSize */ \
|
|
|
|
|
- 0x10, /* bInterval */ \
|
|
|
|
|
- 0x09, /* bLength */ \
|
|
|
|
|
- USB_DESCRIPTOR_TYPE_INTERFACE, /* bDescriptorType */ \
|
|
|
|
|
- (uint8_t)(bFirstInterface + 1), /* bInterfaceNumber */ \
|
|
|
|
|
- 0x00, /* bAlternateSetting */ \
|
|
|
|
|
- 0x02, /* bNumEndpoints */ \
|
|
|
|
|
- CDC_DATA_INTERFACE_CLASS, /* bInterfaceClass */ \
|
|
|
|
|
- 0x00, /* bInterfaceSubClass */ \
|
|
|
|
|
- 0x00, /* bInterfaceProtocol */ \
|
|
|
|
|
- 0x00, /* iInterface */ \
|
|
|
|
|
- 0x07, /* bLength */ \
|
|
|
|
|
- USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
|
|
|
|
|
- out_ep, /* bEndpointAddress */ \
|
|
|
|
|
- 0x02, /* bmAttributes */ \
|
|
|
|
|
- 0x00, 0x02, /* wMaxPacketSize */ \
|
|
|
|
|
- 0x00, /* bInterval */ \
|
|
|
|
|
- 0x07, /* bLength */ \
|
|
|
|
|
- USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
|
|
|
|
|
- in_ep, /* bEndpointAddress */ \
|
|
|
|
|
- 0x02, /* bmAttributes */ \
|
|
|
|
|
- 0x00, 0x02, /* wMaxPacketSize */ \
|
|
|
|
|
- 0x00 /* bInterval */
|
|
|
|
|
-#endif
|
|
|
|
|
// clang-format on
|
|
// clang-format on
|
|
|
|
|
|
|
|
/*Length of template descriptor: 66 bytes*/
|
|
/*Length of template descriptor: 66 bytes*/
|
|
|
#define CDC_RNDIS_DESCRIPTOR_LEN (8 + 9 + 5 + 5 + 4 + 5 + 7 + 9 + 7 + 7)
|
|
#define CDC_RNDIS_DESCRIPTOR_LEN (8 + 9 + 5 + 5 + 4 + 5 + 7 + 9 + 7 + 7)
|
|
|
// clang-format off
|
|
// clang-format off
|
|
|
-#ifndef CONFIG_USB_HS
|
|
|
|
|
-#define CDC_RNDIS_DESCRIPTOR_INIT(bFirstInterface, int_ep, out_ep, in_ep, str_idx) \
|
|
|
|
|
- /* Interface Associate */ \
|
|
|
|
|
- 0x08, /* bLength */ \
|
|
|
|
|
- USB_DESCRIPTOR_TYPE_INTERFACE_ASSOCIATION, /* bDescriptorType */ \
|
|
|
|
|
- bFirstInterface, /* bFirstInterface */ \
|
|
|
|
|
- 0x02, /* bInterfaceCount */ \
|
|
|
|
|
- USB_DEVICE_CLASS_WIRELESS, /* bFunctionClass */ \
|
|
|
|
|
- CDC_DIRECT_LINE_CONTROL_MODEL, /* bFunctionSubClass */ \
|
|
|
|
|
- CDC_COMMON_PROTOCOL_AT_COMMANDS_PCCA_101_AND_ANNEXO, /* bFunctionProtocol */ \
|
|
|
|
|
- 0x00, /* iFunction */ \
|
|
|
|
|
- 0x09, /* bLength */ \
|
|
|
|
|
- USB_DESCRIPTOR_TYPE_INTERFACE, /* bDescriptorType */ \
|
|
|
|
|
- bFirstInterface, /* bInterfaceNumber */ \
|
|
|
|
|
- 0x00, /* bAlternateSetting */ \
|
|
|
|
|
- 0x01, /* bNumEndpoints */ \
|
|
|
|
|
- USB_DEVICE_CLASS_WIRELESS, /* bInterfaceClass */ \
|
|
|
|
|
- CDC_DIRECT_LINE_CONTROL_MODEL, /* bInterfaceSubClass */ \
|
|
|
|
|
- CDC_COMMON_PROTOCOL_AT_COMMANDS_PCCA_101_AND_ANNEXO, /* bInterfaceProtocol */ \
|
|
|
|
|
- str_idx, /* iInterface */ \
|
|
|
|
|
- 0x05, /* bLength */ \
|
|
|
|
|
- CDC_CS_INTERFACE, /* bDescriptorType */ \
|
|
|
|
|
- CDC_FUNC_DESC_HEADER, /* bDescriptorSubtype */ \
|
|
|
|
|
- WBVAL(CDC_V1_10), /* bcdCDC */ \
|
|
|
|
|
- 0x05, /* bLength */ \
|
|
|
|
|
- CDC_CS_INTERFACE, /* bDescriptorType */ \
|
|
|
|
|
- CDC_FUNC_DESC_CALL_MANAGEMENT, /* bDescriptorSubtype */ \
|
|
|
|
|
- 0x00, /* bmCapabilities */ \
|
|
|
|
|
- (uint8_t)(bFirstInterface + 1), /* bDataInterface */ \
|
|
|
|
|
- 0x04, /* bLength */ \
|
|
|
|
|
- CDC_CS_INTERFACE, /* bDescriptorType */ \
|
|
|
|
|
- CDC_FUNC_DESC_ABSTRACT_CONTROL_MANAGEMENT, /* bDescriptorSubtype */ \
|
|
|
|
|
- 0x00, /* bmCapabilities */ \
|
|
|
|
|
- 0x05, /* bLength */ \
|
|
|
|
|
- CDC_CS_INTERFACE, /* bDescriptorType */ \
|
|
|
|
|
- CDC_FUNC_DESC_UNION, /* bDescriptorSubtype */ \
|
|
|
|
|
- bFirstInterface, /* bMasterInterface */ \
|
|
|
|
|
- (uint8_t)(bFirstInterface + 1), /* bSlaveInterface0 */ \
|
|
|
|
|
- 0x07, /* bLength */ \
|
|
|
|
|
- USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
|
|
|
|
|
- int_ep, /* bEndpointAddress */ \
|
|
|
|
|
- 0x03, /* bmAttributes */ \
|
|
|
|
|
- 0x08, 0x00, /* wMaxPacketSize */ \
|
|
|
|
|
- 0x10, /* bInterval */ \
|
|
|
|
|
- 0x09, /* bLength */ \
|
|
|
|
|
- USB_DESCRIPTOR_TYPE_INTERFACE, /* bDescriptorType */ \
|
|
|
|
|
- (uint8_t)(bFirstInterface + 1), /* bInterfaceNumber */ \
|
|
|
|
|
- 0x00, /* bAlternateSetting */ \
|
|
|
|
|
- 0x02, /* bNumEndpoints */ \
|
|
|
|
|
- CDC_DATA_INTERFACE_CLASS, /* bInterfaceClass */ \
|
|
|
|
|
- 0x00, /* bInterfaceSubClass */ \
|
|
|
|
|
- 0x00, /* bInterfaceProtocol */ \
|
|
|
|
|
- 0x00, /* iInterface */ \
|
|
|
|
|
- 0x07, /* bLength */ \
|
|
|
|
|
- USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
|
|
|
|
|
- out_ep, /* bEndpointAddress */ \
|
|
|
|
|
- 0x02, /* bmAttributes */ \
|
|
|
|
|
- 0x40, 0x00, /* wMaxPacketSize */ \
|
|
|
|
|
- 0x00, /* bInterval */ \
|
|
|
|
|
- 0x07, /* bLength */ \
|
|
|
|
|
- USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
|
|
|
|
|
- in_ep, /* bEndpointAddress */ \
|
|
|
|
|
- 0x02, /* bmAttributes */ \
|
|
|
|
|
- 0x40, 0x00, /* wMaxPacketSize */ \
|
|
|
|
|
- 0x00 /* bInterval */
|
|
|
|
|
-#else
|
|
|
|
|
-#define CDC_RNDIS_DESCRIPTOR_INIT(bFirstInterface, int_ep, out_ep, in_ep, str_idx) \
|
|
|
|
|
|
|
+#define CDC_RNDIS_DESCRIPTOR_INIT(bFirstInterface, int_ep, out_ep, in_ep, wMaxPacketSize, str_idx) \
|
|
|
/* Interface Associate */ \
|
|
/* Interface Associate */ \
|
|
|
0x08, /* bLength */ \
|
|
0x08, /* bLength */ \
|
|
|
USB_DESCRIPTOR_TYPE_INTERFACE_ASSOCIATION, /* bDescriptorType */ \
|
|
USB_DESCRIPTOR_TYPE_INTERFACE_ASSOCIATION, /* bDescriptorType */ \
|
|
@@ -560,15 +427,14 @@ struct cdc_ecm_descriptor {
|
|
|
USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
|
|
USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
|
|
|
out_ep, /* bEndpointAddress */ \
|
|
out_ep, /* bEndpointAddress */ \
|
|
|
0x02, /* bmAttributes */ \
|
|
0x02, /* bmAttributes */ \
|
|
|
- 0x00, 0x02, /* wMaxPacketSize */ \
|
|
|
|
|
|
|
+ WBVAL(wMaxPacketSize), /* wMaxPacketSize */ \
|
|
|
0x00, /* bInterval */ \
|
|
0x00, /* bInterval */ \
|
|
|
0x07, /* bLength */ \
|
|
0x07, /* bLength */ \
|
|
|
USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
|
|
USB_DESCRIPTOR_TYPE_ENDPOINT, /* bDescriptorType */ \
|
|
|
in_ep, /* bEndpointAddress */ \
|
|
in_ep, /* bEndpointAddress */ \
|
|
|
0x02, /* bmAttributes */ \
|
|
0x02, /* bmAttributes */ \
|
|
|
- 0x00, 0x02, /* wMaxPacketSize */ \
|
|
|
|
|
|
|
+ WBVAL(wMaxPacketSize), /* wMaxPacketSize */ \
|
|
|
0x00 /* bInterval */
|
|
0x00 /* bInterval */
|
|
|
-#endif
|
|
|
|
|
// clang-format on
|
|
// clang-format on
|
|
|
|
|
|
|
|
#endif /* USB_CDC_H */
|
|
#endif /* USB_CDC_H */
|