Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 19 | #ifndef __UAPI_LINUX_USB_CDC_H |
| 20 | #define __UAPI_LINUX_USB_CDC_H |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 21 | #include <linux/types.h> |
| 22 | #define USB_CDC_SUBCLASS_ACM 0x02 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #define USB_CDC_SUBCLASS_ETHERNET 0x06 |
| 24 | #define USB_CDC_SUBCLASS_WHCM 0x08 |
| 25 | #define USB_CDC_SUBCLASS_DMM 0x09 |
| 26 | #define USB_CDC_SUBCLASS_MDLM 0x0a |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #define USB_CDC_SUBCLASS_OBEX 0x0b |
| 28 | #define USB_CDC_SUBCLASS_EEM 0x0c |
| 29 | #define USB_CDC_SUBCLASS_NCM 0x0d |
| 30 | #define USB_CDC_SUBCLASS_MBIM 0x0e |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | #define USB_CDC_PROTO_NONE 0 |
| 32 | #define USB_CDC_ACM_PROTO_AT_V25TER 1 |
| 33 | #define USB_CDC_ACM_PROTO_AT_PCCA101 2 |
| 34 | #define USB_CDC_ACM_PROTO_AT_PCCA101_WAKE 3 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 35 | #define USB_CDC_ACM_PROTO_AT_GSM 4 |
| 36 | #define USB_CDC_ACM_PROTO_AT_3G 5 |
| 37 | #define USB_CDC_ACM_PROTO_AT_CDMA 6 |
| 38 | #define USB_CDC_ACM_PROTO_VENDOR 0xff |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 39 | #define USB_CDC_PROTO_EEM 7 |
| 40 | #define USB_CDC_NCM_PROTO_NTB 1 |
| 41 | #define USB_CDC_MBIM_PROTO_NTB 2 |
| 42 | #define USB_CDC_HEADER_TYPE 0x00 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 43 | #define USB_CDC_CALL_MANAGEMENT_TYPE 0x01 |
| 44 | #define USB_CDC_ACM_TYPE 0x02 |
| 45 | #define USB_CDC_UNION_TYPE 0x06 |
| 46 | #define USB_CDC_COUNTRY_TYPE 0x07 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 47 | #define USB_CDC_NETWORK_TERMINAL_TYPE 0x0a |
| 48 | #define USB_CDC_ETHERNET_TYPE 0x0f |
| 49 | #define USB_CDC_WHCM_TYPE 0x11 |
| 50 | #define USB_CDC_MDLM_TYPE 0x12 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 51 | #define USB_CDC_MDLM_DETAIL_TYPE 0x13 |
| 52 | #define USB_CDC_DMM_TYPE 0x14 |
| 53 | #define USB_CDC_OBEX_TYPE 0x15 |
| 54 | #define USB_CDC_NCM_TYPE 0x1a |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 55 | #define USB_CDC_MBIM_TYPE 0x1b |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 56 | #define USB_CDC_MBIM_EXTENDED_TYPE 0x1c |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 57 | struct usb_cdc_header_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 58 | __u8 bLength; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 59 | __u8 bDescriptorType; |
| 60 | __u8 bDescriptorSubType; |
| 61 | __le16 bcdCDC; |
| 62 | } __attribute__((packed)); |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 63 | struct usb_cdc_call_mgmt_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 64 | __u8 bLength; |
| 65 | __u8 bDescriptorType; |
| 66 | __u8 bDescriptorSubType; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 67 | __u8 bmCapabilities; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 68 | #define USB_CDC_CALL_MGMT_CAP_CALL_MGMT 0x01 |
| 69 | #define USB_CDC_CALL_MGMT_CAP_DATA_INTF 0x02 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 70 | __u8 bDataInterface; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 71 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 72 | struct usb_cdc_acm_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 73 | __u8 bLength; |
| 74 | __u8 bDescriptorType; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 75 | __u8 bDescriptorSubType; |
| 76 | __u8 bmCapabilities; |
| 77 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 78 | #define USB_CDC_COMM_FEATURE 0x01 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 79 | #define USB_CDC_CAP_LINE 0x02 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 80 | #define USB_CDC_CAP_BRK 0x04 |
| 81 | #define USB_CDC_CAP_NOTIFY 0x08 |
| 82 | struct usb_cdc_union_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 83 | __u8 bLength; |
| 84 | __u8 bDescriptorType; |
| 85 | __u8 bDescriptorSubType; |
| 86 | __u8 bMasterInterface0; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 87 | __u8 bSlaveInterface0; |
| 88 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 89 | struct usb_cdc_country_functional_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 90 | __u8 bLength; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 91 | __u8 bDescriptorType; |
| 92 | __u8 bDescriptorSubType; |
| 93 | __u8 iCountryCodeRelDate; |
| 94 | __le16 wCountyCode0; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 95 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 96 | struct usb_cdc_network_terminal_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 97 | __u8 bLength; |
| 98 | __u8 bDescriptorType; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 99 | __u8 bDescriptorSubType; |
| 100 | __u8 bEntityId; |
| 101 | __u8 iName; |
| 102 | __u8 bChannelIndex; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 103 | __u8 bPhysicalInterface; |
| 104 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 105 | struct usb_cdc_ether_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 106 | __u8 bLength; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 107 | __u8 bDescriptorType; |
| 108 | __u8 bDescriptorSubType; |
| 109 | __u8 iMACAddress; |
| 110 | __le32 bmEthernetStatistics; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 111 | __le16 wMaxSegmentSize; |
| 112 | __le16 wNumberMCFilters; |
| 113 | __u8 bNumberPowerFilters; |
| 114 | } __attribute__((packed)); |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 115 | struct usb_cdc_dmm_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 116 | __u8 bFunctionLength; |
| 117 | __u8 bDescriptorType; |
| 118 | __u8 bDescriptorSubtype; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 119 | __u16 bcdVersion; |
| 120 | __le16 wMaxCommand; |
| 121 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 122 | struct usb_cdc_mdlm_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 123 | __u8 bLength; |
| 124 | __u8 bDescriptorType; |
| 125 | __u8 bDescriptorSubType; |
| 126 | __le16 bcdVersion; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 127 | __u8 bGUID[16]; |
| 128 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 129 | struct usb_cdc_mdlm_detail_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 130 | __u8 bLength; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 131 | __u8 bDescriptorType; |
| 132 | __u8 bDescriptorSubType; |
| 133 | __u8 bGuidDescriptorType; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame^] | 134 | __u8 bDetailData[]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 135 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 136 | struct usb_cdc_obex_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 137 | __u8 bLength; |
| 138 | __u8 bDescriptorType; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 139 | __u8 bDescriptorSubType; |
| 140 | __le16 bcdVersion; |
| 141 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 142 | struct usb_cdc_ncm_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 143 | __u8 bLength; |
| 144 | __u8 bDescriptorType; |
| 145 | __u8 bDescriptorSubType; |
| 146 | __le16 bcdNcmVersion; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 147 | __u8 bmNetworkCapabilities; |
| 148 | } __attribute__((packed)); |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 149 | struct usb_cdc_mbim_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 150 | __u8 bLength; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 151 | __u8 bDescriptorType; |
| 152 | __u8 bDescriptorSubType; |
| 153 | __le16 bcdMBIMVersion; |
| 154 | __le16 wMaxControlMessage; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 155 | __u8 bNumberFilters; |
| 156 | __u8 bMaxFilterSize; |
| 157 | __le16 wMaxSegmentSize; |
| 158 | __u8 bmNetworkCapabilities; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 159 | } __attribute__((packed)); |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 160 | struct usb_cdc_mbim_extended_desc { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 161 | __u8 bLength; |
| 162 | __u8 bDescriptorType; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 163 | __u8 bDescriptorSubType; |
| 164 | __le16 bcdMBIMExtendedVersion; |
| 165 | __u8 bMaxOutstandingCommandMessages; |
| 166 | __le16 wMTU; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 167 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 168 | #define USB_CDC_SEND_ENCAPSULATED_COMMAND 0x00 |
| 169 | #define USB_CDC_GET_ENCAPSULATED_RESPONSE 0x01 |
| 170 | #define USB_CDC_REQ_SET_LINE_CODING 0x20 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 171 | #define USB_CDC_REQ_GET_LINE_CODING 0x21 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 172 | #define USB_CDC_REQ_SET_CONTROL_LINE_STATE 0x22 |
| 173 | #define USB_CDC_REQ_SEND_BREAK 0x23 |
| 174 | #define USB_CDC_SET_ETHERNET_MULTICAST_FILTERS 0x40 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 175 | #define USB_CDC_SET_ETHERNET_PM_PATTERN_FILTER 0x41 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 176 | #define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42 |
| 177 | #define USB_CDC_SET_ETHERNET_PACKET_FILTER 0x43 |
| 178 | #define USB_CDC_GET_ETHERNET_STATISTIC 0x44 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 179 | #define USB_CDC_GET_NTB_PARAMETERS 0x80 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 180 | #define USB_CDC_GET_NET_ADDRESS 0x81 |
| 181 | #define USB_CDC_SET_NET_ADDRESS 0x82 |
| 182 | #define USB_CDC_GET_NTB_FORMAT 0x83 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 183 | #define USB_CDC_SET_NTB_FORMAT 0x84 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 184 | #define USB_CDC_GET_NTB_INPUT_SIZE 0x85 |
| 185 | #define USB_CDC_SET_NTB_INPUT_SIZE 0x86 |
| 186 | #define USB_CDC_GET_MAX_DATAGRAM_SIZE 0x87 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 187 | #define USB_CDC_SET_MAX_DATAGRAM_SIZE 0x88 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 188 | #define USB_CDC_GET_CRC_MODE 0x89 |
| 189 | #define USB_CDC_SET_CRC_MODE 0x8a |
| 190 | struct usb_cdc_line_coding { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 191 | __le32 dwDTERate; |
| 192 | __u8 bCharFormat; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 193 | #define USB_CDC_1_STOP_BITS 0 |
| 194 | #define USB_CDC_1_5_STOP_BITS 1 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 195 | #define USB_CDC_2_STOP_BITS 2 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 196 | __u8 bParityType; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 197 | #define USB_CDC_NO_PARITY 0 |
| 198 | #define USB_CDC_ODD_PARITY 1 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 199 | #define USB_CDC_EVEN_PARITY 2 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 200 | #define USB_CDC_MARK_PARITY 3 |
| 201 | #define USB_CDC_SPACE_PARITY 4 |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 202 | __u8 bDataBits; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 203 | } __attribute__((packed)); |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame^] | 204 | #define USB_CDC_CTRL_DTR (1 << 0) |
| 205 | #define USB_CDC_CTRL_RTS (1 << 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 206 | #define USB_CDC_PACKET_TYPE_PROMISCUOUS (1 << 0) |
| 207 | #define USB_CDC_PACKET_TYPE_ALL_MULTICAST (1 << 1) |
| 208 | #define USB_CDC_PACKET_TYPE_DIRECTED (1 << 2) |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 209 | #define USB_CDC_PACKET_TYPE_BROADCAST (1 << 3) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 210 | #define USB_CDC_PACKET_TYPE_MULTICAST (1 << 4) |
| 211 | #define USB_CDC_NOTIFY_NETWORK_CONNECTION 0x00 |
| 212 | #define USB_CDC_NOTIFY_RESPONSE_AVAILABLE 0x01 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 213 | #define USB_CDC_NOTIFY_SERIAL_STATE 0x20 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 214 | #define USB_CDC_NOTIFY_SPEED_CHANGE 0x2a |
| 215 | struct usb_cdc_notification { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 216 | __u8 bmRequestType; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 217 | __u8 bNotificationType; |
| 218 | __le16 wValue; |
| 219 | __le16 wIndex; |
| 220 | __le16 wLength; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 221 | } __attribute__((packed)); |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame^] | 222 | #define USB_CDC_SERIAL_STATE_DCD (1 << 0) |
| 223 | #define USB_CDC_SERIAL_STATE_DSR (1 << 1) |
| 224 | #define USB_CDC_SERIAL_STATE_BREAK (1 << 2) |
| 225 | #define USB_CDC_SERIAL_STATE_RING_SIGNAL (1 << 3) |
| 226 | #define USB_CDC_SERIAL_STATE_FRAMING (1 << 4) |
| 227 | #define USB_CDC_SERIAL_STATE_PARITY (1 << 5) |
| 228 | #define USB_CDC_SERIAL_STATE_OVERRUN (1 << 6) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 229 | struct usb_cdc_speed_change { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 230 | __le32 DLBitRRate; |
| 231 | __le32 ULBitRate; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 232 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 233 | struct usb_cdc_ncm_ntb_parameters { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 234 | __le16 wLength; |
| 235 | __le16 bmNtbFormatsSupported; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 236 | __le32 dwNtbInMaxSize; |
| 237 | __le16 wNdpInDivisor; |
| 238 | __le16 wNdpInPayloadRemainder; |
| 239 | __le16 wNdpInAlignment; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 240 | __le16 wPadding1; |
| 241 | __le32 dwNtbOutMaxSize; |
| 242 | __le16 wNdpOutDivisor; |
| 243 | __le16 wNdpOutPayloadRemainder; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 244 | __le16 wNdpOutAlignment; |
| 245 | __le16 wNtbOutMaxDatagrams; |
| 246 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 247 | #define USB_CDC_NCM_NTH16_SIGN 0x484D434E |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 248 | #define USB_CDC_NCM_NTH32_SIGN 0x686D636E |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 249 | struct usb_cdc_ncm_nth16 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 250 | __le32 dwSignature; |
| 251 | __le16 wHeaderLength; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 252 | __le16 wSequence; |
| 253 | __le16 wBlockLength; |
| 254 | __le16 wNdpIndex; |
| 255 | } __attribute__((packed)); |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 256 | struct usb_cdc_ncm_nth32 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 257 | __le32 dwSignature; |
| 258 | __le16 wHeaderLength; |
| 259 | __le16 wSequence; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 260 | __le32 dwBlockLength; |
| 261 | __le32 dwNdpIndex; |
| 262 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 263 | #define USB_CDC_NCM_NDP16_CRC_SIGN 0x314D434E |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 264 | #define USB_CDC_NCM_NDP16_NOCRC_SIGN 0x304D434E |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 265 | #define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E |
| 266 | #define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E |
| 267 | #define USB_CDC_MBIM_NDP16_IPS_SIGN 0x00535049 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 268 | #define USB_CDC_MBIM_NDP32_IPS_SIGN 0x00737069 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 269 | #define USB_CDC_MBIM_NDP16_DSS_SIGN 0x00535344 |
| 270 | #define USB_CDC_MBIM_NDP32_DSS_SIGN 0x00737364 |
| 271 | struct usb_cdc_ncm_dpe16 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 272 | __le16 wDatagramIndex; |
| 273 | __le16 wDatagramLength; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 274 | } __attribute__((__packed__)); |
| 275 | struct usb_cdc_ncm_ndp16 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 276 | __le32 dwSignature; |
| 277 | __le16 wLength; |
| 278 | __le16 wNextNdpIndex; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame^] | 279 | struct usb_cdc_ncm_dpe16 dpe16[]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 280 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 281 | struct usb_cdc_ncm_dpe32 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 282 | __le32 dwDatagramIndex; |
| 283 | __le32 dwDatagramLength; |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 284 | } __attribute__((__packed__)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 285 | struct usb_cdc_ncm_ndp32 { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 286 | __le32 dwSignature; |
| 287 | __le16 wLength; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 288 | __le16 wReserved6; |
| 289 | __le32 dwNextNdpIndex; |
| 290 | __le32 dwReserved12; |
Christopher Ferris | 7447a1c | 2022-10-04 18:24:44 -0700 | [diff] [blame^] | 291 | struct usb_cdc_ncm_dpe32 dpe32[]; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 292 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 293 | #define USB_CDC_NCM_NDP16_INDEX_MIN 0x000C |
| 294 | #define USB_CDC_NCM_NDP32_INDEX_MIN 0x0010 |
| 295 | #define USB_CDC_NCM_DATAGRAM_FORMAT_CRC 0x30 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 296 | #define USB_CDC_NCM_DATAGRAM_FORMAT_NOCRC 0X31 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 297 | #define USB_CDC_NCM_PROTO_CODE_NO_ENCAP_COMMANDS 0x00 |
| 298 | #define USB_CDC_NCM_PROTO_CODE_EXTERN_PROTO 0xFE |
| 299 | #define USB_CDC_NCM_NCAP_ETH_FILTER (1 << 0) |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 300 | #define USB_CDC_NCM_NCAP_NET_ADDRESS (1 << 1) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 301 | #define USB_CDC_NCM_NCAP_ENCAP_COMMAND (1 << 2) |
| 302 | #define USB_CDC_NCM_NCAP_MAX_DATAGRAM_SIZE (1 << 3) |
| 303 | #define USB_CDC_NCM_NCAP_CRC_MODE (1 << 4) |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 304 | #define USB_CDC_NCM_NCAP_NTB_INPUT_SIZE (1 << 5) |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 305 | #define USB_CDC_NCM_NTB16_SUPPORTED (1 << 0) |
| 306 | #define USB_CDC_NCM_NTB32_SUPPORTED (1 << 1) |
| 307 | #define USB_CDC_NCM_NDP_ALIGN_MIN_SIZE 0x04 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 308 | #define USB_CDC_NCM_NTB_MAX_LENGTH 0x1C |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 309 | #define USB_CDC_NCM_NTB16_FORMAT 0x00 |
| 310 | #define USB_CDC_NCM_NTB32_FORMAT 0x01 |
| 311 | #define USB_CDC_NCM_NTB_MIN_IN_SIZE 2048 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 312 | #define USB_CDC_NCM_NTB_MIN_OUT_SIZE 2048 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 313 | struct usb_cdc_ncm_ndp_input_size { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 314 | __le32 dwNtbInMaxSize; |
| 315 | __le16 wNtbInMaxDatagrams; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 316 | __le16 wReserved; |
| 317 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 318 | #define USB_CDC_NCM_CRC_NOT_APPENDED 0x00 |
| 319 | #define USB_CDC_NCM_CRC_APPENDED 0x01 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 320 | #endif |