usb_host: Rename symbols that conflict with TinyUSB

This commit is contained in:
Tomas Rezucha 2022-02-11 20:45:24 +01:00
parent fe4b75d4ce
commit d9b8717058
2 changed files with 129 additions and 129 deletions

View File

@ -648,7 +648,7 @@ static esp_err_t cdc_acm_find_intf_and_ep_desc(cdc_dev_t *cdc_dev, uint8_t intf_
// IAD with correct interface number was found: Check Class/Subclass codes, save Interface indexes // IAD with correct interface number was found: Check Class/Subclass codes, save Interface indexes
assert(iad_desc->bInterfaceCount == 2); assert(iad_desc->bInterfaceCount == 2);
assert(iad_desc->bFunctionClass == USB_CLASS_COMM); assert(iad_desc->bFunctionClass == USB_CLASS_COMM);
assert(iad_desc->bFunctionSubClass == CDC_SUBCLASS_ACM); assert(iad_desc->bFunctionSubClass == USB_CDC_SUBCLASS_ACM);
notif_intf_idx = iad_desc->bFirstInterface; notif_intf_idx = iad_desc->bFirstInterface;
data_intf_idx = iad_desc->bFirstInterface + 1; data_intf_idx = iad_desc->bFirstInterface + 1;
interface_found = true; interface_found = true;
@ -727,7 +727,7 @@ esp_err_t cdc_acm_host_open(uint16_t vid, uint16_t pid, uint8_t interface_idx, c
// Check whether found Interfaces are really CDC-ACM // Check whether found Interfaces are really CDC-ACM
assert(cdc_dev->notif.intf_desc->bInterfaceClass == USB_CLASS_COMM); assert(cdc_dev->notif.intf_desc->bInterfaceClass == USB_CLASS_COMM);
assert(cdc_dev->notif.intf_desc->bInterfaceSubClass == CDC_SUBCLASS_ACM); assert(cdc_dev->notif.intf_desc->bInterfaceSubClass == USB_CDC_SUBCLASS_ACM);
assert(cdc_dev->notif.intf_desc->bNumEndpoints == 1); assert(cdc_dev->notif.intf_desc->bNumEndpoints == 1);
assert(cdc_dev->data.intf_desc->bInterfaceClass == USB_CLASS_CDC_DATA); assert(cdc_dev->data.intf_desc->bInterfaceClass == USB_CLASS_CDC_DATA);
assert(cdc_dev->data.intf_desc->bNumEndpoints == 2); assert(cdc_dev->data.intf_desc->bNumEndpoints == 2);
@ -861,26 +861,26 @@ static void cdc_acm_print_desc(const usb_standard_desc_t *_desc)
} }
switch (((cdc_header_desc_t *)_desc)->bDescriptorSubtype) { switch (((cdc_header_desc_t *)_desc)->bDescriptorSubtype) {
case CDC_DESC_SUBTYPE_HEADER: { case USB_CDC_DESC_SUBTYPE_HEADER: {
cdc_header_desc_t *desc = (cdc_header_desc_t *)_desc; cdc_header_desc_t *desc = (cdc_header_desc_t *)_desc;
printf("\t*** CDC Header Descriptor ***\n"); printf("\t*** CDC Header Descriptor ***\n");
printf("\tbcdCDC: %d.%d0\n", ((desc->bcdCDC >> 8) & 0xF), ((desc->bcdCDC >> 4) & 0xF)); printf("\tbcdCDC: %d.%d0\n", ((desc->bcdCDC >> 8) & 0xF), ((desc->bcdCDC >> 4) & 0xF));
break; break;
} }
case CDC_DESC_SUBTYPE_CALL: { case USB_CDC_DESC_SUBTYPE_CALL: {
cdc_acm_call_desc_t *desc = (cdc_acm_call_desc_t *)_desc; cdc_acm_call_desc_t *desc = (cdc_acm_call_desc_t *)_desc;
printf("\t*** CDC Call Descriptor ***\n"); printf("\t*** CDC Call Descriptor ***\n");
printf("\tbmCapabilities: 0x%02X\n", desc->bmCapabilities.val); printf("\tbmCapabilities: 0x%02X\n", desc->bmCapabilities.val);
printf("\tbDataInterface: %d\n", desc->bDataInterface); printf("\tbDataInterface: %d\n", desc->bDataInterface);
break; break;
} }
case CDC_DESC_SUBTYPE_ACM: { case USB_CDC_DESC_SUBTYPE_ACM: {
cdc_acm_acm_desc_t *desc = (cdc_acm_acm_desc_t *)_desc; cdc_acm_acm_desc_t *desc = (cdc_acm_acm_desc_t *)_desc;
printf("\t*** CDC ACM Descriptor ***\n"); printf("\t*** CDC ACM Descriptor ***\n");
printf("\tbmCapabilities: 0x%02X\n", desc->bmCapabilities.val); printf("\tbmCapabilities: 0x%02X\n", desc->bmCapabilities.val);
break; break;
} }
case CDC_DESC_SUBTYPE_UNION: { case USB_CDC_DESC_SUBTYPE_UNION: {
cdc_union_desc_t *desc = (cdc_union_desc_t *)_desc; cdc_union_desc_t *desc = (cdc_union_desc_t *)_desc;
printf("\t*** CDC Union Descriptor ***\n"); printf("\t*** CDC Union Descriptor ***\n");
printf("\tbControlInterface: %d\n", desc->bControlInterface); printf("\tbControlInterface: %d\n", desc->bControlInterface);
@ -969,7 +969,7 @@ static void notif_xfer_cb(usb_transfer_t *transfer)
if (cdc_acm_is_transfer_completed(transfer)) { if (cdc_acm_is_transfer_completed(transfer)) {
cdc_notification_t *notif = (cdc_notification_t *)transfer->data_buffer; cdc_notification_t *notif = (cdc_notification_t *)transfer->data_buffer;
switch (notif->bNotificationCode) { switch (notif->bNotificationCode) {
case CDC_NOTIF_NETWORK_CONNECTION: { case USB_CDC_NOTIF_NETWORK_CONNECTION: {
if (cdc_dev->notif.cb) { if (cdc_dev->notif.cb) {
const cdc_acm_host_dev_event_data_t net_conn_event = { const cdc_acm_host_dev_event_data_t net_conn_event = {
.type = CDC_ACM_HOST_NETWORK_CONNECTION, .type = CDC_ACM_HOST_NETWORK_CONNECTION,
@ -979,7 +979,7 @@ static void notif_xfer_cb(usb_transfer_t *transfer)
} }
break; break;
} }
case CDC_NOTIF_SERIAL_STATE: { case USB_CDC_NOTIF_SERIAL_STATE: {
cdc_dev->serial_state.val = *((uint16_t *)notif->Data); cdc_dev->serial_state.val = *((uint16_t *)notif->Data);
if (cdc_dev->notif.cb) { if (cdc_dev->notif.cb) {
const cdc_acm_host_dev_event_data_t serial_state_event = { const cdc_acm_host_dev_event_data_t serial_state_event = {
@ -990,7 +990,7 @@ static void notif_xfer_cb(usb_transfer_t *transfer)
} }
break; break;
} }
case CDC_NOTIF_RESPONSE_AVAILABLE: // Encapsulated commands not implemented - fallthrough case USB_CDC_NOTIF_RESPONSE_AVAILABLE: // Encapsulated commands not implemented - fallthrough
default: default:
ESP_LOGW("CDC_ACM", "Unsupported notification type 0x%02X", notif->bNotificationCode); ESP_LOGW("CDC_ACM", "Unsupported notification type 0x%02X", notif->bNotificationCode);
ESP_LOG_BUFFER_HEX("CDC_ACM", transfer->data_buffer, transfer->actual_num_bytes); ESP_LOG_BUFFER_HEX("CDC_ACM", transfer->data_buffer, transfer->actual_num_bytes);
@ -1083,7 +1083,7 @@ esp_err_t cdc_acm_host_line_coding_get(cdc_acm_dev_hdl_t cdc_hdl, cdc_acm_line_c
CDC_ACM_CHECK(cdc_hdl && line_coding, ESP_ERR_INVALID_ARG); CDC_ACM_CHECK(cdc_hdl && line_coding, ESP_ERR_INVALID_ARG);
ESP_RETURN_ON_ERROR( ESP_RETURN_ON_ERROR(
send_cdc_request((cdc_dev_t *)cdc_hdl, true, CDC_REQ_GET_LINE_CODING, (uint8_t *)line_coding, sizeof(cdc_acm_line_coding_t), 0), send_cdc_request((cdc_dev_t *)cdc_hdl, true, USB_CDC_REQ_GET_LINE_CODING, (uint8_t *)line_coding, sizeof(cdc_acm_line_coding_t), 0),
TAG,); TAG,);
ESP_LOGD(TAG, "Line Get: Rate: %d, Stop bits: %d, Parity: %d, Databits: %d", line_coding->dwDTERate, ESP_LOGD(TAG, "Line Get: Rate: %d, Stop bits: %d, Parity: %d, Databits: %d", line_coding->dwDTERate,
line_coding->bCharFormat, line_coding->bParityType, line_coding->bDataBits); line_coding->bCharFormat, line_coding->bParityType, line_coding->bDataBits);
@ -1095,7 +1095,7 @@ esp_err_t cdc_acm_host_line_coding_set(cdc_acm_dev_hdl_t cdc_hdl, const cdc_acm_
CDC_ACM_CHECK(cdc_hdl && line_coding, ESP_ERR_INVALID_ARG); CDC_ACM_CHECK(cdc_hdl && line_coding, ESP_ERR_INVALID_ARG);
ESP_RETURN_ON_ERROR( ESP_RETURN_ON_ERROR(
send_cdc_request((cdc_dev_t *)cdc_hdl, false, CDC_REQ_SET_LINE_CODING, (uint8_t *)line_coding, sizeof(cdc_acm_line_coding_t), 0), send_cdc_request((cdc_dev_t *)cdc_hdl, false, USB_CDC_REQ_SET_LINE_CODING, (uint8_t *)line_coding, sizeof(cdc_acm_line_coding_t), 0),
TAG,); TAG,);
ESP_LOGD(TAG, "Line Set: Rate: %d, Stop bits: %d, Parity: %d, Databits: %d", line_coding->dwDTERate, ESP_LOGD(TAG, "Line Set: Rate: %d, Stop bits: %d, Parity: %d, Databits: %d", line_coding->dwDTERate,
line_coding->bCharFormat, line_coding->bParityType, line_coding->bDataBits); line_coding->bCharFormat, line_coding->bParityType, line_coding->bDataBits);
@ -1109,7 +1109,7 @@ esp_err_t cdc_acm_host_set_control_line_state(cdc_acm_dev_hdl_t cdc_hdl, bool dt
const uint16_t ctrl_bitmap = (uint16_t)dtr | ((uint16_t)rts << 1); const uint16_t ctrl_bitmap = (uint16_t)dtr | ((uint16_t)rts << 1);
ESP_RETURN_ON_ERROR( ESP_RETURN_ON_ERROR(
send_cdc_request((cdc_dev_t *)cdc_hdl, false, CDC_REQ_SET_CONTROL_LINE_STATE, NULL, 0, ctrl_bitmap), send_cdc_request((cdc_dev_t *)cdc_hdl, false, USB_CDC_REQ_SET_CONTROL_LINE_STATE, NULL, 0, ctrl_bitmap),
TAG,); TAG,);
ESP_LOGD(TAG, "Control Line Set: DTR: %d, RTS: %d", dtr, rts); ESP_LOGD(TAG, "Control Line Set: DTR: %d, RTS: %d", dtr, rts);
return ESP_OK; return ESP_OK;
@ -1120,7 +1120,7 @@ esp_err_t cdc_acm_host_send_break(cdc_acm_dev_hdl_t cdc_hdl, uint16_t duration_m
CDC_ACM_CHECK(cdc_hdl, ESP_ERR_INVALID_ARG); CDC_ACM_CHECK(cdc_hdl, ESP_ERR_INVALID_ARG);
ESP_RETURN_ON_ERROR( ESP_RETURN_ON_ERROR(
send_cdc_request((cdc_dev_t *)cdc_hdl, false, CDC_REQ_SEND_BREAK, NULL, 0, duration_ms), send_cdc_request((cdc_dev_t *)cdc_hdl, false, USB_CDC_REQ_SEND_BREAK, NULL, 0, duration_ms),
TAG,); TAG,);
// Block until break is deasserted // Block until break is deasserted

View File

@ -13,33 +13,33 @@
* @see Table 13, USB CDC specification rev. 1.2 * @see Table 13, USB CDC specification rev. 1.2
*/ */
typedef enum { typedef enum {
CDC_DESC_SUBTYPE_HEADER = 0x00, // Header Functional Descriptor USB_CDC_DESC_SUBTYPE_HEADER = 0x00, // Header Functional Descriptor
CDC_DESC_SUBTYPE_CALL = 0x01, // Call Management Functional Descriptor USB_CDC_DESC_SUBTYPE_CALL = 0x01, // Call Management Functional Descriptor
CDC_DESC_SUBTYPE_ACM = 0x02, // Abstract Control Management Functional Descriptor USB_CDC_DESC_SUBTYPE_ACM = 0x02, // Abstract Control Management Functional Descriptor
CDC_DESC_SUBTYPE_DLM = 0x03, // Direct Line Management Functional Descriptor USB_CDC_DESC_SUBTYPE_DLM = 0x03, // Direct Line Management Functional Descriptor
CDC_DESC_SUBTYPE_TEL_RINGER = 0x04, // Telephone Ringer Functional Descriptor USB_CDC_DESC_SUBTYPE_TEL_RINGER = 0x04, // Telephone Ringer Functional Descriptor
CDC_DESC_SUBTYPE_TEL_CLSR = 0x05, // Telephone Call and Line State Reporting Capabilities Functional Descriptor USB_CDC_DESC_SUBTYPE_TEL_CLSR = 0x05, // Telephone Call and Line State Reporting Capabilities Functional Descriptor
CDC_DESC_SUBTYPE_UNION = 0x06, // Union Functional Descriptor USB_CDC_DESC_SUBTYPE_UNION = 0x06, // Union Functional Descriptor
CDC_DESC_SUBTYPE_COUNTRY = 0x07, // Country Selection Functional Descriptor USB_CDC_DESC_SUBTYPE_COUNTRY = 0x07, // Country Selection Functional Descriptor
CDC_DESC_SUBTYPE_TEL_MODE = 0x08, // Telephone Operational Modes Functional Descriptor USB_CDC_DESC_SUBTYPE_TEL_MODE = 0x08, // Telephone Operational Modes Functional Descriptor
CDC_DESC_SUBTYPE_TERMINAL = 0x09, // USB Terminal USB_CDC_DESC_SUBTYPE_TERMINAL = 0x09, // USB Terminal
CDC_DESC_SUBTYPE_NCHT = 0x0A, // Network Channel Terminal USB_CDC_DESC_SUBTYPE_NCHT = 0x0A, // Network Channel Terminal
CDC_DESC_SUBTYPE_PROTOCOL = 0x08, // Protocol Unit USB_CDC_DESC_SUBTYPE_PROTOCOL = 0x08, // Protocol Unit
CDC_DESC_SUBTYPE_EXTENSION = 0x0C, // Extension Unit USB_CDC_DESC_SUBTYPE_EXTENSION = 0x0C, // Extension Unit
CDC_DESC_SUBTYPE_MULTI_CHAN = 0x0D, // Multi-Channel Management Functional Descriptor USB_CDC_DESC_SUBTYPE_MULTI_CHAN = 0x0D, // Multi-Channel Management Functional Descriptor
CDC_DESC_SUBTYPE_CAPI = 0x0E, // CAPI Control USB_CDC_DESC_SUBTYPE_CAPI = 0x0E, // CAPI Control
CDC_DESC_SUBTYPE_ETH = 0x0F, // Ethernet Networking USB_CDC_DESC_SUBTYPE_ETH = 0x0F, // Ethernet Networking
CDC_DESC_SUBTYPE_ATM = 0x10, // ATM Networking USB_CDC_DESC_SUBTYPE_ATM = 0x10, // ATM Networking
CDC_DESC_SUBTYPE_WHANDSET = 0x11, // Wireless Handset Control Model Functional Descriptor USB_CDC_DESC_SUBTYPE_WHANDSET = 0x11, // Wireless Handset Control Model Functional Descriptor
CDC_DESC_SUBTYPE_MDLM = 0x12, // Mobile Direct Line Model USB_CDC_DESC_SUBTYPE_MDLM = 0x12, // Mobile Direct Line Model
CDC_DESC_SUBTYPE_MDLM_DETAIL = 0x13, // MDLM Detail USB_CDC_DESC_SUBTYPE_MDLM_DETAIL = 0x13, // MDLM Detail
CDC_DESC_SUBTYPE_DMM = 0x14, // Device Management Model USB_CDC_DESC_SUBTYPE_DMM = 0x14, // Device Management Model
CDC_DESC_SUBTYPE_OBEX = 0x15, // OBEX Functional USB_CDC_DESC_SUBTYPE_OBEX = 0x15, // OBEX Functional
CDC_DESC_SUBTYPE_COMMAND_SET = 0x16, // Command Set USB_CDC_DESC_SUBTYPE_COMMAND_SET = 0x16, // Command Set
CDC_DESC_SUBTYPE_COMMAND_SET_DETAIL = 0x17, // Command Set Detail Functional Descriptor USB_CDC_DESC_SUBTYPE_COMMAND_SET_DETAIL = 0x17, // Command Set Detail Functional Descriptor
CDC_DESC_SUBTYPE_TEL_CM = 0x18, // Telephone Control Model Functional Descriptor USB_CDC_DESC_SUBTYPE_TEL_CM = 0x18, // Telephone Control Model Functional Descriptor
CDC_DESC_SUBTYPE_OBEX_SERVICE = 0x19, // OBEX Service Identifier Functional Descriptor USB_CDC_DESC_SUBTYPE_OBEX_SERVICE = 0x19, // OBEX Service Identifier Functional Descriptor
CDC_DESC_SUBTYPE_NCM = 0x1A // NCM Functional Descriptor USB_CDC_DESC_SUBTYPE_NCM = 0x1A // NCM Functional Descriptor
} __attribute__((packed)) cdc_desc_subtype_t; } __attribute__((packed)) cdc_desc_subtype_t;
/** /**
@ -48,19 +48,19 @@ typedef enum {
* @see Table 4, USB CDC specification rev. 1.2 * @see Table 4, USB CDC specification rev. 1.2
*/ */
typedef enum { typedef enum {
CDC_SUBCLASS_DLCM = 0x01, // Direct Line Control Model USB_CDC_SUBCLASS_DLCM = 0x01, // Direct Line Control Model
CDC_SUBCLASS_ACM = 0x02, // Abstract Control Model USB_CDC_SUBCLASS_ACM = 0x02, // Abstract Control Model
CDC_SUBCLASS_TCM = 0x03, // Telephone Control Model USB_CDC_SUBCLASS_TCM = 0x03, // Telephone Control Model
CDC_SUBCLASS_MCHCM = 0x04, // Multi-Channel Control Model USB_CDC_SUBCLASS_MCHCM = 0x04, // Multi-Channel Control Model
CDC_SUBCLASS_CAPI = 0x05, // CAPI Control Model USB_CDC_SUBCLASS_CAPI = 0x05, // CAPI Control Model
CDC_SUBCLASS_ECM = 0x06, // Ethernet Networking Control Model USB_CDC_SUBCLASS_ECM = 0x06, // Ethernet Networking Control Model
CDC_SUBCLASS_ATM = 0x07, // ATM Networking Model USB_CDC_SUBCLASS_ATM = 0x07, // ATM Networking Model
CDC_SUBCLASS_HANDSET = 0x08, // Wireless Handset Control Model USB_CDC_SUBCLASS_HANDSET = 0x08, // Wireless Handset Control Model
CDC_SUBCLASS_DEV_MAN = 0x09, // Device Management USB_CDC_SUBCLASS_DEV_MAN = 0x09, // Device Management
CDC_SUBCLASS_MOBILE = 0x0A, // Mobile Direct Line Model USB_CDC_SUBCLASS_MOBILE = 0x0A, // Mobile Direct Line Model
CDC_SUBCLASS_OBEX = 0x0B, // OBEX USB_CDC_SUBCLASS_OBEX = 0x0B, // OBEX
CDC_SUBCLASS_EEM = 0x0C, // Ethernet Emulation Model USB_CDC_SUBCLASS_EEM = 0x0C, // Ethernet Emulation Model
CDC_SUBCLASS_NCM = 0x0D // Network Control Model USB_CDC_SUBCLASS_NCM = 0x0D // Network Control Model
} __attribute__((packed)) cdc_subclass_t; } __attribute__((packed)) cdc_subclass_t;
/** /**
@ -69,16 +69,16 @@ typedef enum {
* @see Table 5, USB CDC specification rev. 1.2 * @see Table 5, USB CDC specification rev. 1.2
*/ */
typedef enum { typedef enum {
CDC_COMM_PROTOCOL_NONE = 0x00, // No class specific protocol required USB_CDC_COMM_PROTOCOL_NONE = 0x00, // No class specific protocol required
CDC_COMM_PROTOCOL_V250 = 0x01, // AT Commands: V.250 etc USB_CDC_COMM_PROTOCOL_V250 = 0x01, // AT Commands: V.250 etc
CDC_COMM_PROTOCOL_PCAA = 0x02, // AT Commands defined by PCCA-101 USB_CDC_COMM_PROTOCOL_PCAA = 0x02, // AT Commands defined by PCCA-101
CDC_COMM_PROTOCOL_PCAA_A = 0x03, // AT Commands defined by PCAA-101 & Annex O USB_CDC_COMM_PROTOCOL_PCAA_A = 0x03, // AT Commands defined by PCAA-101 & Annex O
CDC_COMM_PROTOCOL_GSM = 0x04, // AT Commands defined by GSM 07.07 USB_CDC_COMM_PROTOCOL_GSM = 0x04, // AT Commands defined by GSM 07.07
CDC_COMM_PROTOCOL_3GPP = 0x05, // AT Commands defined by 3GPP 27.007 USB_CDC_COMM_PROTOCOL_3GPP = 0x05, // AT Commands defined by 3GPP 27.007
CDC_COMM_PROTOCOL_TIA = 0x06, // AT Commands defined by TIA for CDMA USB_CDC_COMM_PROTOCOL_TIA = 0x06, // AT Commands defined by TIA for CDMA
CDC_COMM_PROTOCOL_EEM = 0x07, // Ethernet Emulation Model USB_CDC_COMM_PROTOCOL_EEM = 0x07, // Ethernet Emulation Model
CDC_COMM_PROTOCOL_EXT = 0xFE, // External Protocol: Commands defined by Command Set Functional Descriptor USB_CDC_COMM_PROTOCOL_EXT = 0xFE, // External Protocol: Commands defined by Command Set Functional Descriptor
CDC_COMM_PROTOCOL_VENDOR = 0xFF // Vendor-specific USB_CDC_COMM_PROTOCOL_VENDOR = 0xFF // Vendor-specific
} __attribute__((packed)) cdc_comm_protocol_t; } __attribute__((packed)) cdc_comm_protocol_t;
/** /**
@ -87,18 +87,18 @@ typedef enum {
* @see Table 7, USB CDC specification rev. 1.2 * @see Table 7, USB CDC specification rev. 1.2
*/ */
typedef enum { typedef enum {
CDC_DATA_PROTOCOL_NONE = 0x00, // No class specific protocol required USB_CDC_DATA_PROTOCOL_NONE = 0x00, // No class specific protocol required
CDC_DATA_PROTOCOL_NCM = 0x01, // Network Transfer Block USB_CDC_DATA_PROTOCOL_NCM = 0x01, // Network Transfer Block
CDC_DATA_PROTOCOL_I430 = 0x30, // Physical interface protocol for ISDN BRI USB_CDC_DATA_PROTOCOL_I430 = 0x30, // Physical interface protocol for ISDN BRI
CDC_DATA_PROTOCOL_HDLC = 0x31, // HDLC USB_CDC_DATA_PROTOCOL_HDLC = 0x31, // HDLC
CDC_DATA_PROTOCOL_Q921M = 0x50, // Management protocol for Q.921 data link protocol USB_CDC_DATA_PROTOCOL_Q921M = 0x50, // Management protocol for Q.921 data link protocol
CDC_DATA_PROTOCOL_Q921 = 0x51, // Data link protocol for Q.931 USB_CDC_DATA_PROTOCOL_Q921 = 0x51, // Data link protocol for Q.931
CDC_DATA_PROTOCOL_Q921TM = 0x52, // TEI-multiplexor for Q.921 data link protocol USB_CDC_DATA_PROTOCOL_Q921TM = 0x52, // TEI-multiplexor for Q.921 data link protocol
CDC_DATA_PROTOCOL_V42BIS = 0x90, // Data compression procedures USB_CDC_DATA_PROTOCOL_V42BIS = 0x90, // Data compression procedures
CDC_DATA_PROTOCOL_Q931 = 0x91, // Euro-ISDN protocol control USB_CDC_DATA_PROTOCOL_Q931 = 0x91, // Euro-ISDN protocol control
CDC_DATA_PROTOCOL_V120 = 0x92, // V.24 rate adaptation to ISDN USB_CDC_DATA_PROTOCOL_V120 = 0x92, // V.24 rate adaptation to ISDN
CDC_DATA_PROTOCOL_CAPI = 0x93, // CAPI Commands USB_CDC_DATA_PROTOCOL_CAPI = 0x93, // CAPI Commands
CDC_DATA_PROTOCOL_VENDOR = 0xFF // Vendor-specific USB_CDC_DATA_PROTOCOL_VENDOR = 0xFF // Vendor-specific
} __attribute__((packed)) cdc_data_protocol_t; } __attribute__((packed)) cdc_data_protocol_t;
/** /**
@ -107,52 +107,52 @@ typedef enum {
* @see Table 19, USB CDC specification rev. 1.2 * @see Table 19, USB CDC specification rev. 1.2
*/ */
typedef enum { typedef enum {
CDC_REQ_SEND_ENCAPSULATED_COMMAND = 0x00, USB_CDC_REQ_SEND_ENCAPSULATED_COMMAND = 0x00,
CDC_REQ_GET_ENCAPSULATED_RESPONSE = 0x01, USB_CDC_REQ_GET_ENCAPSULATED_RESPONSE = 0x01,
CDC_REQ_SET_COMM_FEATURE = 0x02, USB_CDC_REQ_SET_COMM_FEATURE = 0x02,
CDC_REQ_GET_COMM_FEATURE = 0x03, USB_CDC_REQ_GET_COMM_FEATURE = 0x03,
CDC_REQ_CLEAR_COMM_FEATURE = 0x04, USB_CDC_REQ_CLEAR_COMM_FEATURE = 0x04,
CDC_REQ_SET_AUX_LINE_STATE = 0x10, USB_CDC_REQ_SET_AUX_LINE_STATE = 0x10,
CDC_REQ_SET_HOOK_STATE = 0x11, USB_CDC_REQ_SET_HOOK_STATE = 0x11,
CDC_REQ_PULSE_SETUP = 0x12, USB_CDC_REQ_PULSE_SETUP = 0x12,
CDC_REQ_SEND_PULSE = 0x13, USB_CDC_REQ_SEND_PULSE = 0x13,
CDC_REQ_SET_PULSE_TIME = 0x14, USB_CDC_REQ_SET_PULSE_TIME = 0x14,
CDC_REQ_RING_AUX_JACK = 0x15, USB_CDC_REQ_RING_AUX_JACK = 0x15,
CDC_REQ_SET_LINE_CODING = 0x20, USB_CDC_REQ_SET_LINE_CODING = 0x20,
CDC_REQ_GET_LINE_CODING = 0x21, USB_CDC_REQ_GET_LINE_CODING = 0x21,
CDC_REQ_SET_CONTROL_LINE_STATE = 0x22, USB_CDC_REQ_SET_CONTROL_LINE_STATE = 0x22,
CDC_REQ_SEND_BREAK = 0x23, USB_CDC_REQ_SEND_BREAK = 0x23,
CDC_REQ_SET_RINGER_PARMS = 0x30, USB_CDC_REQ_SET_RINGER_PARMS = 0x30,
CDC_REQ_GET_RINGER_PARMS = 0x31, USB_CDC_REQ_GET_RINGER_PARMS = 0x31,
CDC_REQ_SET_OPERATION_PARMS = 0x32, USB_CDC_REQ_SET_OPERATION_PARMS = 0x32,
CDC_REQ_GET_OPERATION_PARMS = 0x33, USB_CDC_REQ_GET_OPERATION_PARMS = 0x33,
CDC_REQ_SET_LINE_PARMS = 0x34, USB_CDC_REQ_SET_LINE_PARMS = 0x34,
CDC_REQ_GET_LINE_PARMS = 0x35, USB_CDC_REQ_GET_LINE_PARMS = 0x35,
CDC_REQ_DIAL_DIGITS = 0x36, USB_CDC_REQ_DIAL_DIGITS = 0x36,
CDC_REQ_SET_UNIT_PARAMETER = 0x37, USB_CDC_REQ_SET_UNIT_PARAMETER = 0x37,
CDC_REQ_GET_UNIT_PARAMETER = 0x38, USB_CDC_REQ_GET_UNIT_PARAMETER = 0x38,
CDC_REQ_CLEAR_UNIT_PARAMETER = 0x39, USB_CDC_REQ_CLEAR_UNIT_PARAMETER = 0x39,
CDC_REQ_GET_PROFILE = 0x3A, USB_CDC_REQ_GET_PROFILE = 0x3A,
CDC_REQ_SET_ETHERNET_MULTICAST_FILTERS = 0x40, USB_CDC_REQ_SET_ETHERNET_MULTICAST_FILTERS = 0x40,
CDC_REQ_SET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER = 0x41, USB_CDC_REQ_SET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER = 0x41,
CDC_REQ_GET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER = 0x42, USB_CDC_REQ_GET_ETHERNET_POWER_MANAGEMENT_PATTERN_FILTER = 0x42,
CDC_REQ_SET_ETHERNET_PACKET_FILTER = 0x43, USB_CDC_REQ_SET_ETHERNET_PACKET_FILTER = 0x43,
CDC_REQ_GET_ETHERNET_STATISTIC = 0x44, USB_CDC_REQ_GET_ETHERNET_STATISTIC = 0x44,
CDC_REQ_SET_ATM_DATA_FORMAT = 0x50, USB_CDC_REQ_SET_ATM_DATA_FORMAT = 0x50,
CDC_REQ_GET_ATM_DEVICE_STATISTICS = 0x51, USB_CDC_REQ_GET_ATM_DEVICE_STATISTICS = 0x51,
CDC_REQ_SET_ATM_DEFAULT_VC = 0x52, USB_CDC_REQ_SET_ATM_DEFAULT_VC = 0x52,
CDC_REQ_GET_ATM_VC_STATISTICS = 0x53, USB_CDC_REQ_GET_ATM_VC_STATISTICS = 0x53,
CDC_REQ_GET_NTB_PARAMETERS = 0x80, USB_CDC_REQ_GET_NTB_PARAMETERS = 0x80,
CDC_REQ_GET_NET_ADDRESS = 0x81, USB_CDC_REQ_GET_NET_ADDRESS = 0x81,
CDC_REQ_SET_NET_ADDRESS = 0x82, USB_CDC_REQ_SET_NET_ADDRESS = 0x82,
CDC_REQ_GET_NTB_FORMAT = 0x83, USB_CDC_REQ_GET_NTB_FORMAT = 0x83,
CDC_REQ_SET_NTB_FORMAT = 0x84, USB_CDC_REQ_SET_NTB_FORMAT = 0x84,
CDC_REQ_GET_NTB_INPUT_SIZE = 0x85, USB_CDC_REQ_GET_NTB_INPUT_SIZE = 0x85,
CDC_REQ_SET_NTB_INPUT_SIZE = 0x86, USB_CDC_REQ_SET_NTB_INPUT_SIZE = 0x86,
CDC_REQ_GET_MAX_DATAGRAM_SIZE = 0x87, USB_CDC_REQ_GET_MAX_DATAGRAM_SIZE = 0x87,
CDC_REQ_SET_MAX_DATAGRAM_SIZE = 0x88, USB_CDC_REQ_SET_MAX_DATAGRAM_SIZE = 0x88,
CDC_REQ_GET_CRC_MODE = 0x89, USB_CDC_REQ_GET_CRC_MODE = 0x89,
CDC_REQ_SET_CRC_MODE = 0x8A USB_CDC_REQ_SET_CRC_MODE = 0x8A
} __attribute__((packed)) cdc_request_code_t; } __attribute__((packed)) cdc_request_code_t;
/** /**
@ -161,14 +161,14 @@ typedef enum {
* @see Table 20, USB CDC specification rev. 1.2 * @see Table 20, USB CDC specification rev. 1.2
*/ */
typedef enum { typedef enum {
CDC_NOTIF_NETWORK_CONNECTION = 0x00, USB_CDC_NOTIF_NETWORK_CONNECTION = 0x00,
CDC_NOTIF_RESPONSE_AVAILABLE = 0x01, USB_CDC_NOTIF_RESPONSE_AVAILABLE = 0x01,
CDC_NOTIF_AUX_JACK_HOOK_STATE = 0x08, USB_CDC_NOTIF_AUX_JACK_HOOK_STATE = 0x08,
CDC_NOTIF_RING_DETECT = 0x09, USB_CDC_NOTIF_RING_DETECT = 0x09,
CDC_NOTIF_SERIAL_STATE = 0x20, USB_CDC_NOTIF_SERIAL_STATE = 0x20,
CDC_NOTIF_CALL_STATE_CHANGE = 0x28, USB_CDC_NOTIF_CALL_STATE_CHANGE = 0x28,
CDC_NOTIF_LINE_STATE_CHANGE = 0x29, USB_CDC_NOTIF_LINE_STATE_CHANGE = 0x29,
CDC_NOTIF_CONNECTION_SPEED_CHANGE = 0x2A USB_CDC_NOTIF_CONNECTION_SPEED_CHANGE = 0x2A
} __attribute__((packed)) cdc_notification_code_t; } __attribute__((packed)) cdc_notification_code_t;
typedef struct { typedef struct {