1 /****************************************************************************** 2 * 3 * Copyright 1999-2014 Broadcom Corporation 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at: 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 ******************************************************************************/ 18 19 #ifndef HCIDEFS_H 20 #define HCIDEFS_H 21 22 #include "stack/include/hci_error_code.h" 23 24 #define HCI_PROTO_VERSION 0x01 /* Version for BT spec 1.1 */ 25 #define HCI_PROTO_VERSION_1_2 0x02 /* Version for BT spec 1.2 */ 26 #define HCI_PROTO_VERSION_2_0 0x03 /* Version for BT spec 2.0 */ 27 #define HCI_PROTO_VERSION_2_1 0x04 /* Version for BT spec 2.1 [Lisbon] */ 28 #define HCI_PROTO_VERSION_3_0 0x05 /* Version for BT spec 3.0 */ 29 #define HCI_PROTO_VERSION_4_0 0x06 /* Version for BT spec 4.0 [LE] */ 30 #define HCI_PROTO_VERSION_4_1 0x07 /* Version for BT spec 4.1 */ 31 #define HCI_PROTO_VERSION_4_2 0x08 /* Version for BT spec 4.2 */ 32 #define HCI_PROTO_VERSION_5_0 0x09 /* Version for BT spec 5.0 */ 33 34 /* 35 * Definitions for HCI groups 36 */ 37 #define HCI_GRP_LINK_CONTROL_CMDS (0x01 << 10) /* 0x0400 */ 38 #define HCI_GRP_LINK_POLICY_CMDS (0x02 << 10) /* 0x0800 */ 39 #define HCI_GRP_HOST_CONT_BASEBAND_CMDS (0x03 << 10) /* 0x0C00 */ 40 #define HCI_GRP_INFORMATIONAL_PARAMS (0x04 << 10) /* 0x1000 */ 41 #define HCI_GRP_STATUS_PARAMS (0x05 << 10) /* 0x1400 */ 42 #define HCI_GRP_TESTING_CMDS (0x06 << 10) /* 0x1800 */ 43 #define HCI_GRP_BLE_CMDS (0x08 << 10) /* 0x2000 (LE Commands) */ 44 45 #define HCI_GRP_VENDOR_SPECIFIC (0x3F << 10) /* 0xFC00 */ 46 47 /* 48 * Definitions for Link Control Commands 49 */ 50 /* Following opcode is used only in command complete event for flow control */ 51 #define HCI_COMMAND_NONE 0x0000 52 53 /* Commands of HCI_GRP_LINK_CONTROL_CMDS group */ 54 #define HCI_INQUIRY (0x0001 | HCI_GRP_LINK_CONTROL_CMDS) 55 #define HCI_INQUIRY_CANCEL (0x0002 | HCI_GRP_LINK_CONTROL_CMDS) 56 #define HCI_PERIODIC_INQUIRY_MODE (0x0003 | HCI_GRP_LINK_CONTROL_CMDS) 57 #define HCI_EXIT_PERIODIC_INQUIRY_MODE (0x0004 | HCI_GRP_LINK_CONTROL_CMDS) 58 #define HCI_CREATE_CONNECTION (0x0005 | HCI_GRP_LINK_CONTROL_CMDS) 59 #define HCI_DISCONNECT (0x0006 | HCI_GRP_LINK_CONTROL_CMDS) 60 #define HCI_ADD_SCO_CONNECTION (0x0007 | HCI_GRP_LINK_CONTROL_CMDS) 61 #define HCI_CREATE_CONNECTION_CANCEL (0x0008 | HCI_GRP_LINK_CONTROL_CMDS) 62 #define HCI_ACCEPT_CONNECTION_REQUEST (0x0009 | HCI_GRP_LINK_CONTROL_CMDS) 63 #define HCI_REJECT_CONNECTION_REQUEST (0x000A | HCI_GRP_LINK_CONTROL_CMDS) 64 #define HCI_LINK_KEY_REQUEST_REPLY (0x000B | HCI_GRP_LINK_CONTROL_CMDS) 65 #define HCI_LINK_KEY_REQUEST_NEG_REPLY (0x000C | HCI_GRP_LINK_CONTROL_CMDS) 66 #define HCI_PIN_CODE_REQUEST_REPLY (0x000D | HCI_GRP_LINK_CONTROL_CMDS) 67 #define HCI_PIN_CODE_REQUEST_NEG_REPLY (0x000E | HCI_GRP_LINK_CONTROL_CMDS) 68 #define HCI_CHANGE_CONN_PACKET_TYPE (0x000F | HCI_GRP_LINK_CONTROL_CMDS) 69 #define HCI_AUTHENTICATION_REQUESTED (0x0011 | HCI_GRP_LINK_CONTROL_CMDS) 70 #define HCI_SET_CONN_ENCRYPTION (0x0013 | HCI_GRP_LINK_CONTROL_CMDS) 71 #define HCI_CHANGE_CONN_LINK_KEY (0x0015 | HCI_GRP_LINK_CONTROL_CMDS) 72 #define HCI_CENTRAL_LINK_KEY (0x0017 | HCI_GRP_LINK_CONTROL_CMDS) 73 #define HCI_RMT_NAME_REQUEST (0x0019 | HCI_GRP_LINK_CONTROL_CMDS) 74 #define HCI_RMT_NAME_REQUEST_CANCEL (0x001A | HCI_GRP_LINK_CONTROL_CMDS) 75 #define HCI_READ_RMT_FEATURES (0x001B | HCI_GRP_LINK_CONTROL_CMDS) 76 #define HCI_READ_RMT_EXT_FEATURES (0x001C | HCI_GRP_LINK_CONTROL_CMDS) 77 #define HCI_READ_RMT_VERSION_INFO (0x001D | HCI_GRP_LINK_CONTROL_CMDS) 78 #define HCI_READ_RMT_CLOCK_OFFSET (0x001F | HCI_GRP_LINK_CONTROL_CMDS) 79 #define HCI_READ_LMP_HANDLE (0x0020 | HCI_GRP_LINK_CONTROL_CMDS) 80 #define HCI_SETUP_ESCO_CONNECTION (0x0028 | HCI_GRP_LINK_CONTROL_CMDS) 81 #define HCI_ACCEPT_ESCO_CONNECTION (0x0029 | HCI_GRP_LINK_CONTROL_CMDS) 82 #define HCI_REJECT_ESCO_CONNECTION (0x002A | HCI_GRP_LINK_CONTROL_CMDS) 83 #define HCI_IO_CAPABILITY_REQUEST_REPLY (0x002B | HCI_GRP_LINK_CONTROL_CMDS) 84 #define HCI_USER_CONF_REQUEST_REPLY (0x002C | HCI_GRP_LINK_CONTROL_CMDS) 85 #define HCI_USER_CONF_VALUE_NEG_REPLY (0x002D | HCI_GRP_LINK_CONTROL_CMDS) 86 #define HCI_USER_PASSKEY_REQ_REPLY (0x002E | HCI_GRP_LINK_CONTROL_CMDS) 87 #define HCI_USER_PASSKEY_REQ_NEG_REPLY (0x002F | HCI_GRP_LINK_CONTROL_CMDS) 88 #define HCI_REM_OOB_DATA_REQ_REPLY (0x0030 | HCI_GRP_LINK_CONTROL_CMDS) 89 #define HCI_REM_OOB_DATA_REQ_NEG_REPLY (0x0033 | HCI_GRP_LINK_CONTROL_CMDS) 90 #define HCI_IO_CAP_REQ_NEG_REPLY (0x0034 | HCI_GRP_LINK_CONTROL_CMDS) 91 92 /* AMP HCI */ 93 #define HCI_CREATE_PHYSICAL_LINK (0x0035 | HCI_GRP_LINK_CONTROL_CMDS) 94 #define HCI_ACCEPT_PHYSICAL_LINK (0x0036 | HCI_GRP_LINK_CONTROL_CMDS) 95 #define HCI_DISCONNECT_PHYSICAL_LINK (0x0037 | HCI_GRP_LINK_CONTROL_CMDS) 96 #define HCI_CREATE_LOGICAL_LINK (0x0038 | HCI_GRP_LINK_CONTROL_CMDS) 97 #define HCI_ACCEPT_LOGICAL_LINK (0x0039 | HCI_GRP_LINK_CONTROL_CMDS) 98 #define HCI_DISCONNECT_LOGICAL_LINK (0x003A | HCI_GRP_LINK_CONTROL_CMDS) 99 #define HCI_LOGICAL_LINK_CANCEL (0x003B | HCI_GRP_LINK_CONTROL_CMDS) 100 #define HCI_FLOW_SPEC_MODIFY (0x003C | HCI_GRP_LINK_CONTROL_CMDS) 101 102 #define HCI_ENH_SETUP_ESCO_CONNECTION (0x003D | HCI_GRP_LINK_CONTROL_CMDS) 103 #define HCI_ENH_ACCEPT_ESCO_CONNECTION (0x003E | HCI_GRP_LINK_CONTROL_CMDS) 104 105 /* ConnectionLess Broadcast */ 106 #define HCI_TRUNCATED_PAGE (0x003F | HCI_GRP_LINK_CONTROL_CMDS) 107 #define HCI_TRUNCATED_PAGE_CANCEL (0x0040 | HCI_GRP_LINK_CONTROL_CMDS) 108 #define HCI_SET_CLB (0x0041 | HCI_GRP_LINK_CONTROL_CMDS) 109 #define HCI_RECEIVE_CLB (0x0042 | HCI_GRP_LINK_CONTROL_CMDS) 110 #define HCI_START_SYNC_TRAIN (0x0043 | HCI_GRP_LINK_CONTROL_CMDS) 111 #define HCI_RECEIVE_SYNC_TRAIN (0x0044 | HCI_GRP_LINK_CONTROL_CMDS) 112 113 #define HCI_LINK_CTRL_CMDS_FIRST HCI_INQUIRY 114 #define HCI_LINK_CTRL_CMDS_LAST HCI_RECEIVE_SYNC_TRAIN 115 116 /* Commands of HCI_GRP_LINK_POLICY_CMDS */ 117 #define HCI_HOLD_MODE (0x0001 | HCI_GRP_LINK_POLICY_CMDS) 118 #define HCI_SNIFF_MODE (0x0003 | HCI_GRP_LINK_POLICY_CMDS) 119 #define HCI_EXIT_SNIFF_MODE (0x0004 | HCI_GRP_LINK_POLICY_CMDS) 120 #define HCI_PARK_MODE (0x0005 | HCI_GRP_LINK_POLICY_CMDS) 121 #define HCI_EXIT_PARK_MODE (0x0006 | HCI_GRP_LINK_POLICY_CMDS) 122 #define HCI_QOS_SETUP (0x0007 | HCI_GRP_LINK_POLICY_CMDS) 123 #define HCI_ROLE_DISCOVERY (0x0009 | HCI_GRP_LINK_POLICY_CMDS) 124 #define HCI_SWITCH_ROLE (0x000B | HCI_GRP_LINK_POLICY_CMDS) 125 #define HCI_READ_POLICY_SETTINGS (0x000C | HCI_GRP_LINK_POLICY_CMDS) 126 #define HCI_WRITE_POLICY_SETTINGS (0x000D | HCI_GRP_LINK_POLICY_CMDS) 127 #define HCI_READ_DEF_POLICY_SETTINGS (0x000E | HCI_GRP_LINK_POLICY_CMDS) 128 #define HCI_WRITE_DEF_POLICY_SETTINGS (0x000F | HCI_GRP_LINK_POLICY_CMDS) 129 #define HCI_FLOW_SPECIFICATION (0x0010 | HCI_GRP_LINK_POLICY_CMDS) 130 #define HCI_SNIFF_SUB_RATE (0x0011 | HCI_GRP_LINK_POLICY_CMDS) 131 132 #define HCI_LINK_POLICY_CMDS_FIRST HCI_HOLD_MODE 133 #define HCI_LINK_POLICY_CMDS_LAST HCI_SNIFF_SUB_RATE 134 135 /* Commands of HCI_GRP_HOST_CONT_BASEBAND_CMDS */ 136 #define HCI_SET_EVENT_MASK (0x0001 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 137 #define HCI_RESET (0x0003 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 138 #define HCI_SET_EVENT_FILTER (0x0005 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 139 #define HCI_FLUSH (0x0008 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 140 #define HCI_READ_PIN_TYPE (0x0009 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 141 #define HCI_WRITE_PIN_TYPE (0x000A | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 142 #define HCI_GET_MWS_TRANS_LAYER_CFG (0x000C | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 143 #define HCI_READ_STORED_LINK_KEY (0x000D | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 144 #define HCI_WRITE_STORED_LINK_KEY (0x0011 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 145 #define HCI_DELETE_STORED_LINK_KEY (0x0012 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 146 #define HCI_CHANGE_LOCAL_NAME (0x0013 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 147 #define HCI_READ_LOCAL_NAME (0x0014 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 148 #define HCI_READ_CONN_ACCEPT_TOUT (0x0015 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 149 #define HCI_WRITE_CONN_ACCEPT_TOUT (0x0016 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 150 #define HCI_READ_PAGE_TOUT (0x0017 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 151 #define HCI_WRITE_PAGE_TOUT (0x0018 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 152 #define HCI_READ_SCAN_ENABLE (0x0019 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 153 #define HCI_WRITE_SCAN_ENABLE (0x001A | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 154 #define HCI_READ_PAGESCAN_CFG (0x001B | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 155 #define HCI_WRITE_PAGESCAN_CFG (0x001C | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 156 #define HCI_READ_INQUIRYSCAN_CFG (0x001D | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 157 #define HCI_WRITE_INQUIRYSCAN_CFG (0x001E | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 158 #define HCI_READ_AUTHENTICATION_ENABLE \ 159 (0x001F | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 160 #define HCI_WRITE_AUTHENTICATION_ENABLE \ 161 (0x0020 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 162 #define HCI_READ_ENCRYPTION_MODE (0x0021 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 163 #define HCI_WRITE_ENCRYPTION_MODE (0x0022 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 164 #define HCI_READ_CLASS_OF_DEVICE (0x0023 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 165 #define HCI_WRITE_CLASS_OF_DEVICE (0x0024 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 166 #define HCI_READ_VOICE_SETTINGS (0x0025 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 167 #define HCI_WRITE_VOICE_SETTINGS (0x0026 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 168 #define HCI_READ_AUTOMATIC_FLUSH_TIMEOUT \ 169 (0x0027 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 170 #define HCI_WRITE_AUTOMATIC_FLUSH_TIMEOUT \ 171 (0x0028 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 172 #define HCI_READ_NUM_BCAST_REXMITS (0x0029 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 173 #define HCI_WRITE_NUM_BCAST_REXMITS (0x002A | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 174 #define HCI_READ_HOLD_MODE_ACTIVITY (0x002B | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 175 #define HCI_WRITE_HOLD_MODE_ACTIVITY (0x002C | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 176 #define HCI_READ_TRANSMIT_POWER_LEVEL (0x002D | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 177 #define HCI_READ_SCO_FLOW_CTRL_ENABLE (0x002E | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 178 #define HCI_WRITE_SCO_FLOW_CTRL_ENABLE \ 179 (0x002F | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 180 #define HCI_SET_HC_TO_HOST_FLOW_CTRL (0x0031 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 181 #define HCI_HOST_BUFFER_SIZE (0x0033 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 182 #define HCI_HOST_NUM_PACKETS_DONE (0x0035 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 183 #define HCI_READ_LINK_SUPER_TOUT (0x0036 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 184 #define HCI_WRITE_LINK_SUPER_TOUT (0x0037 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 185 #define HCI_READ_NUM_SUPPORTED_IAC (0x0038 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 186 #define HCI_READ_CURRENT_IAC_LAP (0x0039 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 187 #define HCI_WRITE_CURRENT_IAC_LAP (0x003A | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 188 #define HCI_READ_PAGESCAN_PERIOD_MODE (0x003B | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 189 #define HCI_WRITE_PAGESCAN_PERIOD_MODE \ 190 (0x003C | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 191 #define HCI_READ_PAGESCAN_MODE (0x003D | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 192 #define HCI_WRITE_PAGESCAN_MODE (0x003E | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 193 #define HCI_SET_AFH_CHANNELS (0x003F | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 194 195 #define HCI_READ_INQSCAN_TYPE (0x0042 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 196 #define HCI_WRITE_INQSCAN_TYPE (0x0043 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 197 #define HCI_READ_INQUIRY_MODE (0x0044 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 198 #define HCI_WRITE_INQUIRY_MODE (0x0045 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 199 #define HCI_READ_PAGESCAN_TYPE (0x0046 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 200 #define HCI_WRITE_PAGESCAN_TYPE (0x0047 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 201 #define HCI_READ_AFH_ASSESSMENT_MODE (0x0048 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 202 #define HCI_WRITE_AFH_ASSESSMENT_MODE (0x0049 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 203 #define HCI_READ_EXT_INQ_RESPONSE (0x0051 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 204 #define HCI_WRITE_EXT_INQ_RESPONSE (0x0052 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 205 #define HCI_REFRESH_ENCRYPTION_KEY (0x0053 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 206 #define HCI_READ_SIMPLE_PAIRING_MODE (0x0055 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 207 #define HCI_WRITE_SIMPLE_PAIRING_MODE (0x0056 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 208 #define HCI_READ_LOCAL_OOB_DATA (0x0057 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 209 #define HCI_READ_INQ_TX_POWER_LEVEL (0x0058 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 210 #define HCI_WRITE_INQ_TX_POWER_LEVEL (0x0059 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 211 #define HCI_READ_ERRONEOUS_DATA_RPT (0x005A | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 212 #define HCI_WRITE_ERRONEOUS_DATA_RPT (0x005B | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 213 #define HCI_ENHANCED_FLUSH (0x005F | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 214 #define HCI_SEND_KEYPRESS_NOTIF (0x0060 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 215 216 /* AMP HCI */ 217 #define HCI_READ_LOGICAL_LINK_ACCEPT_TIMEOUT \ 218 (0x0061 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 219 #define HCI_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT \ 220 (0x0062 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 221 #define HCI_SET_EVENT_MASK_PAGE_2 (0x0063 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 222 #define HCI_READ_LOCATION_DATA (0x0064 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 223 #define HCI_WRITE_LOCATION_DATA (0x0065 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 224 #define HCI_READ_FLOW_CONTROL_MODE (0x0066 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 225 #define HCI_WRITE_FLOW_CONTROL_MODE (0x0067 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 226 #define HCI_READ_BE_FLUSH_TOUT (0x0069 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 227 #define HCI_WRITE_BE_FLUSH_TOUT (0x006A | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 228 /* 802.11 only */ 229 #define HCI_SHORT_RANGE_MODE (0x006B | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 230 #define HCI_READ_LE_HOST_SUPPORT (0x006C | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 231 #define HCI_WRITE_LE_HOST_SUPPORT (0x006D | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 232 233 /* MWS coexistence */ 234 #define HCI_SET_MWS_CHANNEL_PARAMETERS \ 235 (0x006E | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 236 #define HCI_SET_EXTERNAL_FRAME_CONFIGURATION \ 237 (0x006F | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 238 #define HCI_SET_MWS_SIGNALING (0x0070 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 239 #define HCI_SET_MWS_TRANSPORT_LAYER (0x0071 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 240 #define HCI_SET_MWS_SCAN_FREQUENCY_TABLE \ 241 (0x0072 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 242 #define HCI_SET_MWS_PATTERN_CONFIGURATION \ 243 (0x0073 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 244 245 /* Connectionless Broadcast */ 246 #define HCI_SET_RESERVED_LT_ADDR (0x0074 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 247 #define HCI_DELETE_RESERVED_LT_ADDR (0x0075 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 248 #define HCI_WRITE_CLB_DATA (0x0076 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 249 #define HCI_READ_SYNC_TRAIN_PARAM (0x0077 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 250 #define HCI_WRITE_SYNC_TRAIN_PARAM (0x0078 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 251 252 #define HCI_READ_SECURE_CONNS_SUPPORT (0x0079 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 253 #define HCI_WRITE_SECURE_CONNS_SUPPORT \ 254 (0x007A | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 255 #define HCI_CONFIGURE_DATA_PATH (0x0083 | HCI_GRP_HOST_CONT_BASEBAND_CMDS) 256 #define HCI_CONT_BASEBAND_CMDS_FIRST HCI_SET_EVENT_MASK 257 #define HCI_CONT_BASEBAND_CMDS_LAST HCI_READ_SYNC_TRAIN_PARAM 258 259 /* Commands of HCI_GRP_INFORMATIONAL_PARAMS group */ 260 #define HCI_READ_LOCAL_VERSION_INFO (0x0001 | HCI_GRP_INFORMATIONAL_PARAMS) 261 #define HCI_READ_LOCAL_SUPPORTED_CMDS (0x0002 | HCI_GRP_INFORMATIONAL_PARAMS) 262 #define HCI_READ_LOCAL_FEATURES (0x0003 | HCI_GRP_INFORMATIONAL_PARAMS) 263 #define HCI_READ_LOCAL_EXT_FEATURES (0x0004 | HCI_GRP_INFORMATIONAL_PARAMS) 264 #define HCI_READ_BUFFER_SIZE (0x0005 | HCI_GRP_INFORMATIONAL_PARAMS) 265 #define HCI_READ_COUNTRY_CODE (0x0007 | HCI_GRP_INFORMATIONAL_PARAMS) 266 #define HCI_READ_BD_ADDR (0x0009 | HCI_GRP_INFORMATIONAL_PARAMS) 267 #define HCI_READ_DATA_BLOCK_SIZE (0x000A | HCI_GRP_INFORMATIONAL_PARAMS) 268 #define HCI_READ_LOCAL_SUPPORTED_CODECS (0x000B | HCI_GRP_INFORMATIONAL_PARAMS) 269 270 #define HCI_INFORMATIONAL_CMDS_FIRST HCI_READ_LOCAL_VERSION_INFO 271 #define HCI_INFORMATIONAL_CMDS_LAST HCI_READ_LOCAL_SUPPORTED_CODECS 272 273 /* Commands of HCI_GRP_STATUS_PARAMS group */ 274 #define HCI_READ_FAILED_CONTACT_COUNTER (0x0001 | HCI_GRP_STATUS_PARAMS) 275 #define HCI_RESET_FAILED_CONTACT_COUNTER (0x0002 | HCI_GRP_STATUS_PARAMS) 276 #define HCI_GET_LINK_QUALITY (0x0003 | HCI_GRP_STATUS_PARAMS) 277 #define HCI_READ_RSSI (0x0005 | HCI_GRP_STATUS_PARAMS) 278 #define HCI_READ_AFH_CH_MAP (0x0006 | HCI_GRP_STATUS_PARAMS) 279 #define HCI_READ_CLOCK (0x0007 | HCI_GRP_STATUS_PARAMS) 280 #define HCI_READ_ENCR_KEY_SIZE (0x0008 | HCI_GRP_STATUS_PARAMS) 281 282 /* AMP HCI */ 283 #define HCI_READ_LOCAL_AMP_INFO (0x0009 | HCI_GRP_STATUS_PARAMS) 284 #define HCI_READ_LOCAL_AMP_ASSOC (0x000A | HCI_GRP_STATUS_PARAMS) 285 #define HCI_WRITE_REMOTE_AMP_ASSOC (0x000B | HCI_GRP_STATUS_PARAMS) 286 287 #define HCI_STATUS_PARAMS_CMDS_FIRST HCI_READ_FAILED_CONTACT_COUNTER 288 #define HCI_STATUS_PARAMS_CMDS_LAST HCI_WRITE_REMOTE_AMP_ASSOC 289 290 /* Commands of HCI_GRP_TESTING_CMDS group */ 291 #define HCI_READ_LOOPBACK_MODE (0x0001 | HCI_GRP_TESTING_CMDS) 292 #define HCI_WRITE_LOOPBACK_MODE (0x0002 | HCI_GRP_TESTING_CMDS) 293 #define HCI_ENABLE_DEV_UNDER_TEST_MODE (0x0003 | HCI_GRP_TESTING_CMDS) 294 #define HCI_WRITE_SIMP_PAIR_DEBUG_MODE (0x0004 | HCI_GRP_TESTING_CMDS) 295 296 /* AMP HCI */ 297 #define HCI_ENABLE_AMP_RCVR_REPORTS (0x0007 | HCI_GRP_TESTING_CMDS) 298 #define HCI_AMP_TEST_END (0x0008 | HCI_GRP_TESTING_CMDS) 299 #define HCI_AMP_TEST (0x0009 | HCI_GRP_TESTING_CMDS) 300 301 #define HCI_TESTING_CMDS_FIRST HCI_READ_LOOPBACK_MODE 302 #define HCI_TESTING_CMDS_LAST HCI_AMP_TEST 303 304 #define HCI_VENDOR_CMDS_FIRST 0x0001 305 #define HCI_VENDOR_CMDS_LAST 0xFFFF 306 #define HCI_VSC_MULTI_AV_HANDLE 0x0AAA 307 #define HCI_VSC_BURST_MODE_HANDLE 0x0BBB 308 309 /* BLE HCI Group Commands */ 310 /* Commands of BLE Controller setup and configuration */ 311 #define HCI_BLE_SET_EVENT_MASK (0x0001 | HCI_GRP_BLE_CMDS) 312 #define HCI_BLE_READ_BUFFER_SIZE (0x0002 | HCI_GRP_BLE_CMDS) 313 #define HCI_BLE_READ_LOCAL_SPT_FEAT (0x0003 | HCI_GRP_BLE_CMDS) 314 #define HCI_BLE_WRITE_LOCAL_SPT_FEAT (0x0004 | HCI_GRP_BLE_CMDS) 315 #define HCI_BLE_WRITE_RANDOM_ADDR (0x0005 | HCI_GRP_BLE_CMDS) 316 #define HCI_BLE_WRITE_ADV_PARAMS (0x0006 | HCI_GRP_BLE_CMDS) 317 #define HCI_BLE_READ_ADV_CHNL_TX_POWER (0x0007 | HCI_GRP_BLE_CMDS) 318 #define HCI_BLE_WRITE_ADV_DATA (0x0008 | HCI_GRP_BLE_CMDS) 319 #define HCI_BLE_WRITE_SCAN_RSP_DATA (0x0009 | HCI_GRP_BLE_CMDS) 320 #define HCI_BLE_WRITE_ADV_ENABLE (0x000A | HCI_GRP_BLE_CMDS) 321 #define HCI_BLE_WRITE_SCAN_PARAMS (0x000B | HCI_GRP_BLE_CMDS) 322 #define HCI_BLE_WRITE_SCAN_ENABLE (0x000C | HCI_GRP_BLE_CMDS) 323 #define HCI_BLE_CREATE_LL_CONN (0x000D | HCI_GRP_BLE_CMDS) 324 #define HCI_BLE_CREATE_CONN_CANCEL (0x000E | HCI_GRP_BLE_CMDS) 325 #define HCI_BLE_READ_ACCEPTLIST_SIZE (0x000F | HCI_GRP_BLE_CMDS) 326 #define HCI_BLE_CLEAR_ACCEPTLIST (0x0010 | HCI_GRP_BLE_CMDS) 327 #define HCI_BLE_ADD_ACCEPTLIST (0x0011 | HCI_GRP_BLE_CMDS) 328 #define HCI_BLE_REMOVE_ACCEPTLIST (0x0012 | HCI_GRP_BLE_CMDS) 329 #define HCI_BLE_UPD_LL_CONN_PARAMS (0x0013 | HCI_GRP_BLE_CMDS) 330 #define HCI_BLE_SET_HOST_CHNL_CLASS (0x0014 | HCI_GRP_BLE_CMDS) 331 #define HCI_BLE_READ_CHNL_MAP (0x0015 | HCI_GRP_BLE_CMDS) 332 #define HCI_BLE_READ_REMOTE_FEAT (0x0016 | HCI_GRP_BLE_CMDS) 333 #define HCI_BLE_ENCRYPT (0x0017 | HCI_GRP_BLE_CMDS) 334 #define HCI_BLE_RAND (0x0018 | HCI_GRP_BLE_CMDS) 335 #define HCI_BLE_START_ENC (0x0019 | HCI_GRP_BLE_CMDS) 336 #define HCI_BLE_LTK_REQ_REPLY (0x001A | HCI_GRP_BLE_CMDS) 337 #define HCI_BLE_LTK_REQ_NEG_REPLY (0x001B | HCI_GRP_BLE_CMDS) 338 #define HCI_BLE_READ_SUPPORTED_STATES (0x001C | HCI_GRP_BLE_CMDS) 339 /* 0x001D, 0x001E and 0x001F are reserved */ 340 #define HCI_BLE_RECEIVER_TEST (0x001D | HCI_GRP_BLE_CMDS) 341 #define HCI_BLE_TRANSMITTER_TEST (0x001E | HCI_GRP_BLE_CMDS) 342 /* BLE TEST COMMANDS */ 343 #define HCI_BLE_TEST_END (0x001F | HCI_GRP_BLE_CMDS) 344 #define HCI_BLE_RC_PARAM_REQ_REPLY (0x0020 | HCI_GRP_BLE_CMDS) 345 #define HCI_BLE_RC_PARAM_REQ_NEG_REPLY (0x0021 | HCI_GRP_BLE_CMDS) 346 347 #define HCI_BLE_SET_DATA_LENGTH (0x0022 | HCI_GRP_BLE_CMDS) 348 #define HCI_BLE_READ_DEFAULT_DATA_LENGTH (0x0023 | HCI_GRP_BLE_CMDS) 349 #define HCI_BLE_WRITE_DEFAULT_DATA_LENGTH (0x0024 | HCI_GRP_BLE_CMDS) 350 351 #define HCI_BLE_ADD_DEV_RESOLVING_LIST (0x0027 | HCI_GRP_BLE_CMDS) 352 #define HCI_BLE_RM_DEV_RESOLVING_LIST (0x0028 | HCI_GRP_BLE_CMDS) 353 #define HCI_BLE_CLEAR_RESOLVING_LIST (0x0029 | HCI_GRP_BLE_CMDS) 354 #define HCI_BLE_READ_RESOLVING_LIST_SIZE (0x002A | HCI_GRP_BLE_CMDS) 355 #define HCI_BLE_READ_RESOLVABLE_ADDR_PEER (0x002B | HCI_GRP_BLE_CMDS) 356 #define HCI_BLE_READ_RESOLVABLE_ADDR_LOCAL (0x002C | HCI_GRP_BLE_CMDS) 357 #define HCI_BLE_SET_ADDR_RESOLUTION_ENABLE (0x002D | HCI_GRP_BLE_CMDS) 358 #define HCI_BLE_SET_RAND_PRIV_ADDR_TIMOUT (0x002E | HCI_GRP_BLE_CMDS) 359 #define HCI_BLE_READ_MAXIMUM_DATA_LENGTH (0x002F | HCI_GRP_BLE_CMDS) 360 #define HCI_BLE_READ_PHY (0x0030 | HCI_GRP_BLE_CMDS) 361 #define HCI_BLE_SET_DEFAULT_PHY (0x0031 | HCI_GRP_BLE_CMDS) 362 #define HCI_BLE_SET_PHY (0x0032 | HCI_GRP_BLE_CMDS) 363 #define HCI_BLE_ENH_RECEIVER_TEST (0x0033 | HCI_GRP_BLE_CMDS) 364 #define HCI_BLE_ENH_TRANSMITTER_TEST (0x0034 | HCI_GRP_BLE_CMDS) 365 #define HCI_LE_SET_EXT_ADVERTISING_RANDOM_ADDRESS (0x35 | HCI_GRP_BLE_CMDS) 366 #define HCI_LE_SET_EXT_ADVERTISING_PARAM (0x36 | HCI_GRP_BLE_CMDS) 367 #define HCI_LE_SET_EXT_ADVERTISING_DATA (0x37 | HCI_GRP_BLE_CMDS) 368 #define HCI_LE_SET_EXT_ADVERTISING_SCAN_RESP (0x38 | HCI_GRP_BLE_CMDS) 369 #define HCI_LE_SET_EXT_ADVERTISING_ENABLE (0x39 | HCI_GRP_BLE_CMDS) 370 #define HCI_LE_READ_MAXIMUM_ADVERTISING_DATA_LENGTH (0x003A | HCI_GRP_BLE_CMDS) 371 #define HCI_LE_READ_NUMBER_OF_SUPPORTED_ADVERTISING_SETS \ 372 (0x003B | HCI_GRP_BLE_CMDS) 373 #define HCI_LE_REMOVE_ADVERTISING_SET (0x003C | HCI_GRP_BLE_CMDS) 374 #define HCI_LE_CLEAR_ADVERTISING_SETS (0x003D | HCI_GRP_BLE_CMDS) 375 #define HCI_LE_SET_PERIODIC_ADVERTISING_PARAM (0x003E | HCI_GRP_BLE_CMDS) 376 #define HCI_LE_SET_PERIODIC_ADVERTISING_DATA (0x003F | HCI_GRP_BLE_CMDS) 377 #define HCI_LE_SET_PERIODIC_ADVERTISING_ENABLE (0x0040 | HCI_GRP_BLE_CMDS) 378 #define HCI_LE_SET_EXTENDED_SCAN_PARAMETERS (0x0041 | HCI_GRP_BLE_CMDS) 379 #define HCI_LE_SET_EXTENDED_SCAN_ENABLE (0x0042 | HCI_GRP_BLE_CMDS) 380 #define HCI_LE_EXTENDED_CREATE_CONNECTION (0x0043 | HCI_GRP_BLE_CMDS) 381 #define HCI_BLE_PERIODIC_ADVERTISING_CREATE_SYNC (0x0044 | HCI_GRP_BLE_CMDS) 382 #define HCI_BLE_PERIODIC_ADVERTISING_CREATE_SYNC_CANCEL \ 383 (0x0045 | HCI_GRP_BLE_CMDS) 384 #define HCI_BLE_PERIODIC_ADVERTISING_TERMINATE_SYNC \ 385 (0x0046 | HCI_GRP_BLE_CMDS) 386 #define HCI_BLE_ADD_DEVICE_TO_PERIODIC_ADVERTISER_LIST \ 387 (0x0047 | HCI_GRP_BLE_CMDS) 388 #define HCI_BLE_REMOVE_DEVICE_FROM_PERIODIC_ADVERTISER_LIST \ 389 (0x0048 | HCI_GRP_BLE_CMDS) 390 #define HCI_BLE_CLEAR_PERIODIC_ADVERTISER_LIST (0x0049 | HCI_GRP_BLE_CMDS) 391 #define HCI_BLE_READ_PERIODIC_ADVERTISER_LIST_SIZE (0x004A | HCI_GRP_BLE_CMDS) 392 #define HCI_BLE_READ_TRANSMIT_POWER (0x004B | HCI_GRP_BLE_CMDS) 393 #define HCI_BLE_READ_RF_COMPENS_POWER (0x004C | HCI_GRP_BLE_CMDS) 394 #define HCI_BLE_WRITE_RF_COMPENS_POWER (0x004D | HCI_GRP_BLE_CMDS) 395 #define HCI_BLE_SET_PRIVACY_MODE (0x004E | HCI_GRP_BLE_CMDS) 396 #define HCI_LE_SET_PERIODIC_ADVERTISING_RECEIVE_ENABLE \ 397 (0x0059 | HCI_GRP_BLE_CMDS) 398 #define HCI_LE_PERIODIC_ADVERTISING_SYNC_TRANSFER (0x005A | HCI_GRP_BLE_CMDS) 399 #define HCI_LE_PERIODIC_ADVERTISING_SET_INFO_TRANSFER \ 400 (0x005B | HCI_GRP_BLE_CMDS) 401 #define HCI_LE_SET_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAM \ 402 (0x005C | HCI_GRP_BLE_CMDS) 403 #define HCI_LE_SET_DEFAULT_PERIODIC_ADVERTISING_SYNC_TRANSFER_PARAM \ 404 (0x005D | HCI_GRP_BLE_CMDS) 405 #define HCI_BLE_READ_BUFFER_SIZE_V2 (0x0060 | HCI_GRP_BLE_CMDS) 406 #define HCI_LE_SET_HOST_FEATURE (0x0074 | HCI_GRP_BLE_CMDS) 407 408 /* LE Get Vendor Capabilities Command opcode */ 409 #define HCI_BLE_VENDOR_CAP (0x0153 | HCI_GRP_VENDOR_SPECIFIC) 410 #define HCI_LE_READ_ISO_TX_SYNC (0x0061 | HCI_GRP_BLE_CMDS) 411 #define HCI_LE_SET_CIG_PARAMS (0x0062 | HCI_GRP_BLE_CMDS) 412 #define HCI_LE_SET_CIG_PARAMS_TEST (0x0063 | HCI_GRP_BLE_CMDS) 413 #define HCI_LE_CREATE_CIS (0x0064 | HCI_GRP_BLE_CMDS) 414 #define HCI_LE_REMOVE_CIG (0x0065 | HCI_GRP_BLE_CMDS) 415 #define HCI_LE_ACCEPT_CIS_REQ (0x0066 | HCI_GRP_BLE_CMDS) 416 #define HCI_LE_REJ_CIS_REQ (0x0067 | HCI_GRP_BLE_CMDS) 417 #define HCI_LE_CREATE_BIG (0x0068 | HCI_GRP_BLE_CMDS) 418 #define HCI_LE_CREATE_BIG_TEST (0x0069 | HCI_GRP_BLE_CMDS) 419 #define HCI_LE_TERM_BIG (0x006A | HCI_GRP_BLE_CMDS) 420 #define HCI_LE_BIG_CREATE_SYNC (0x006B | HCI_GRP_BLE_CMDS) 421 #define HCI_LE_BIG_TERM_SYNC (0x006C | HCI_GRP_BLE_CMDS) 422 #define HCI_LE_REQ_PEER_SCA (0x006D | HCI_GRP_BLE_CMDS) 423 #define HCI_LE_SETUP_ISO_DATA_PATH (0x006E | HCI_GRP_BLE_CMDS) 424 #define HCI_LE_REMOVE_ISO_DATA_PATH (0x006F | HCI_GRP_BLE_CMDS) 425 #define HCI_LE_ISO_TRANSMIT_TEST (0x0070 | HCI_GRP_BLE_CMDS) 426 #define HCI_LE_ISO_RECEIVE_TEST (0x0071 | HCI_GRP_BLE_CMDS) 427 #define HCI_LE_ISO_READ_TEST_CNTRS (0x0072 | HCI_GRP_BLE_CMDS) 428 #define HCI_LE_ISO_TEST_END (0x0073 | HCI_GRP_BLE_CMDS) 429 #define HCI_LE_SET_HOST_FEATURE (0x0074 | HCI_GRP_BLE_CMDS) 430 #define HCI_LE_READ_ISO_LINK_QUALITY (0x0075 | HCI_GRP_BLE_CMDS) 431 432 /* Multi adv opcode */ 433 #define HCI_BLE_MULTI_ADV (0x0154 | HCI_GRP_VENDOR_SPECIFIC) 434 435 /* Batch scan opcode */ 436 #define HCI_BLE_BATCH_SCAN (0x0156 | HCI_GRP_VENDOR_SPECIFIC) 437 438 /* ADV filter opcode */ 439 #define HCI_BLE_ADV_FILTER (0x0157 | HCI_GRP_VENDOR_SPECIFIC) 440 441 /* Energy info opcode */ 442 #define HCI_BLE_ENERGY_INFO (0x0159 | HCI_GRP_VENDOR_SPECIFIC) 443 444 /* Controller debug info opcode */ 445 #define HCI_CONTROLLER_DEBUG_INFO (0x015B | HCI_GRP_VENDOR_SPECIFIC) 446 447 /* A2DP offload opcode */ 448 #define HCI_CONTROLLER_A2DP (0x015D | HCI_GRP_VENDOR_SPECIFIC) 449 450 /* Bluetooth Quality Report opcode */ 451 #define HCI_CONTROLLER_BQR (0x015E | HCI_GRP_VENDOR_SPECIFIC) 452 453 /* Bluetooth Dynamic Audio Buffer opcode */ 454 #define HCI_CONTROLLER_DAB (0x015F | HCI_GRP_VENDOR_SPECIFIC) 455 #define HCI_CONTROLLER_DAB_GET_BUFFER_TIME 0x01 456 #define HCI_CONTROLLER_DAB_SET_BUFFER_TIME 0x02 457 458 /* subcode for multi adv feature */ 459 #define BTM_BLE_MULTI_ADV_SET_PARAM 0x01 460 #define BTM_BLE_MULTI_ADV_WRITE_ADV_DATA 0x02 461 #define BTM_BLE_MULTI_ADV_WRITE_SCAN_RSP_DATA 0x03 462 #define BTM_BLE_MULTI_ADV_SET_RANDOM_ADDR 0x04 463 #define BTM_BLE_MULTI_ADV_ENB 0x05 464 465 /* multi adv VSE subcode */ 466 /* multi adv instance state change */ 467 #define HCI_VSE_SUBCODE_BLE_MULTI_ADV_ST_CHG 0x55 468 469 /* subcode for batch scan feature */ 470 #define BTM_BLE_BATCH_SCAN_ENB_DISAB_CUST_FEATURE 0x01 471 #define BTM_BLE_BATCH_SCAN_SET_STORAGE_PARAM 0x02 472 #define BTM_BLE_BATCH_SCAN_SET_PARAMS 0x03 473 #define BTM_BLE_BATCH_SCAN_READ_RESULTS 0x04 474 475 /* batch scan VSE subcode */ 476 #define HCI_VSE_SUBCODE_BLE_THRESHOLD_SUB_EVT 0x54 /* Threshold event */ 477 478 /* tracking sub event */ 479 #define HCI_VSE_SUBCODE_BLE_TRACKING_SUB_EVT 0x56 /* Tracking event */ 480 481 /* debug info sub event */ 482 #define HCI_VSE_SUBCODE_DEBUG_INFO_SUB_EVT 0x57 483 484 /* Bluetooth Quality Report sub event */ 485 #define HCI_VSE_SUBCODE_BQR_SUB_EVT 0x58 486 487 /* LE Supported States */ 488 constexpr uint8_t HCI_LE_STATES_NON_CONN_ADV_BIT = 0; 489 constexpr uint8_t HCI_LE_STATES_SCAN_ADV_BIT = 1; 490 constexpr uint8_t HCI_LE_STATES_CONN_ADV_BIT = 2; 491 constexpr uint8_t HCI_LE_STATES_HI_DUTY_DIR_ADV_BIT = 3; 492 constexpr uint8_t HCI_LE_STATES_PASS_SCAN_BIT = 4; 493 constexpr uint8_t HCI_LE_STATES_ACTIVE_SCAN_BIT = 5; 494 constexpr uint8_t HCI_LE_STATES_INIT_BIT = 6; 495 constexpr uint8_t HCI_LE_STATES_PERIPHERAL_BIT = 7; 496 constexpr uint8_t HCI_LE_STATES_NON_CONN_ADV_PASS_SCAN_BIT = 8; 497 constexpr uint8_t HCI_LE_STATES_SCAN_ADV_PASS_SCAN_BIT = 9; 498 constexpr uint8_t HCI_LE_STATES_CONN_ADV_PASS_SCAN_BIT = 10; 499 constexpr uint8_t HCI_LE_STATES_HI_DUTY_DIR_ADV_PASS_SCAN_BIT = 11; 500 constexpr uint8_t HCI_LE_STATES_NON_CONN_ADV_ACTIVE_SCAN_BIT = 12; 501 constexpr uint8_t HCI_LE_STATES_SCAN_ADV_ACTIVE_SCAN_BIT = 13; 502 constexpr uint8_t HCI_LE_STATES_CONN_ADV_ACTIVE_SCAN_BIT = 14; 503 constexpr uint8_t HCI_LE_STATES_HI_DUTY_DIR_ADV_ACTIVE_SCAN_BIT = 15; 504 constexpr uint8_t HCI_LE_STATES_NON_CONN_INIT_BIT = 16; 505 constexpr uint8_t HCI_LE_STATES_SCAN_ADV_INIT_BIT = 17; 506 constexpr uint8_t HCI_LE_STATES_NON_CONN_ADV_CENTRAL_BIT = 18; 507 constexpr uint8_t HCI_LE_STATES_SCAN_ADV_CENTRAL_BIT = 19; 508 constexpr uint8_t HCI_LE_STATES_NON_CONN_ADV_PERIPHERAL_BIT = 20; 509 constexpr uint8_t HCI_LE_STATES_SCAN_ADV_PERIPHERAL_BIT = 21; 510 constexpr uint8_t HCI_LE_STATES_PASS_SCAN_INIT_BIT = 22; 511 constexpr uint8_t HCI_LE_STATES_ACTIVE_SCAN_INIT_BIT = 23; 512 constexpr uint8_t HCI_LE_STATES_PASS_SCAN_CENTRAL_BIT = 24; 513 constexpr uint8_t HCI_LE_STATES_ACTIVE_SCAN_CENTRAL_BIT = 25; 514 constexpr uint8_t HCI_LE_STATES_PASS_SCAN_PERIPHERAL_BIT = 26; 515 constexpr uint8_t HCI_LE_STATES_ACTIVE_SCAN_PERIPHERAL_BIT = 27; 516 constexpr uint8_t HCI_LE_STATES_INIT_CENTRAL_BIT = 28; 517 constexpr uint8_t HCI_LE_STATES_LOW_DUTY_DIR_ADV_BIT = 29; 518 constexpr uint8_t HCI_LE_STATES_LO_DUTY_DIR_ADV_PASS_SCAN_BIT = 30; 519 constexpr uint8_t HCI_LE_STATES_LO_DUTY_DIR_ADV_ACTIVE_SCAN_BIT = 31; 520 constexpr uint8_t HCI_LE_STATES_CONN_ADV_INIT_BIT = 32; 521 constexpr uint8_t HCI_LE_STATES_HI_DUTY_DIR_ADV_INIT_BIT = 33; 522 constexpr uint8_t HCI_LE_STATES_LO_DUTY_DIR_ADV_INIT_BIT = 34; 523 constexpr uint8_t HCI_LE_STATES_CONN_ADV_CENTRAL_BIT = 35; 524 constexpr uint8_t HCI_LE_STATES_HI_DUTY_DIR_ADV_CENTRAL_BIT = 36; 525 constexpr uint8_t HCI_LE_STATES_LO_DUTY_DIR_ADV_CENTRAL_BIT = 37; 526 constexpr uint8_t HCI_LE_STATES_CONN_ADV_PERIPHERAL_BIT = 38; 527 constexpr uint8_t HCI_LE_STATES_HI_DUTY_DIR_ADV_PERIPHERAL_BIT = 39; 528 constexpr uint8_t HCI_LE_STATES_LO_DUTY_DIR_ADV_PERIPHERAL_BIT = 40; 529 constexpr uint8_t HCI_LE_STATES_INIT_CENTRAL_PERIPHERAL_BIT = 41; 530 531 /* 532 * Definitions for HCI Events 533 */ 534 #define HCI_INQUIRY_COMP_EVT 0x01 535 #define HCI_INQUIRY_RESULT_EVT 0x02 536 #define HCI_CONNECTION_COMP_EVT 0x03 537 #define HCI_CONNECTION_REQUEST_EVT 0x04 538 #define HCI_DISCONNECTION_COMP_EVT 0x05 539 #define HCI_AUTHENTICATION_COMP_EVT 0x06 540 #define HCI_RMT_NAME_REQUEST_COMP_EVT 0x07 541 #define HCI_ENCRYPTION_CHANGE_EVT 0x08 542 #define HCI_CHANGE_CONN_LINK_KEY_EVT 0x09 543 #define HCI_CENTRAL_LINK_KEY_COMP_EVT 0x0A 544 #define HCI_READ_RMT_FEATURES_COMP_EVT 0x0B 545 #define HCI_READ_RMT_VERSION_COMP_EVT 0x0C 546 #define HCI_QOS_SETUP_COMP_EVT 0x0D 547 #define HCI_COMMAND_COMPLETE_EVT 0x0E 548 #define HCI_COMMAND_STATUS_EVT 0x0F 549 #define HCI_HARDWARE_ERROR_EVT 0x10 550 #define HCI_FLUSH_OCCURED_EVT 0x11 551 #define HCI_ROLE_CHANGE_EVT 0x12 552 #define HCI_NUM_COMPL_DATA_PKTS_EVT 0x13 553 #define HCI_MODE_CHANGE_EVT 0x14 554 #define HCI_RETURN_LINK_KEYS_EVT 0x15 555 #define HCI_PIN_CODE_REQUEST_EVT 0x16 556 #define HCI_LINK_KEY_REQUEST_EVT 0x17 557 #define HCI_LINK_KEY_NOTIFICATION_EVT 0x18 558 #define HCI_LOOPBACK_COMMAND_EVT 0x19 559 #define HCI_DATA_BUF_OVERFLOW_EVT 0x1A 560 #define HCI_MAX_SLOTS_CHANGED_EVT 0x1B 561 #define HCI_READ_CLOCK_OFF_COMP_EVT 0x1C 562 #define HCI_CONN_PKT_TYPE_CHANGE_EVT 0x1D 563 #define HCI_QOS_VIOLATION_EVT 0x1E 564 #define HCI_PAGE_SCAN_MODE_CHANGE_EVT 0x1F 565 #define HCI_PAGE_SCAN_REP_MODE_CHNG_EVT 0x20 566 #define HCI_FLOW_SPECIFICATION_COMP_EVT 0x21 567 #define HCI_INQUIRY_RSSI_RESULT_EVT 0x22 568 #define HCI_READ_RMT_EXT_FEATURES_COMP_EVT 0x23 569 #define HCI_ESCO_CONNECTION_COMP_EVT 0x2C 570 #define HCI_ESCO_CONNECTION_CHANGED_EVT 0x2D 571 #define HCI_SNIFF_SUB_RATE_EVT 0x2E 572 #define HCI_EXTENDED_INQUIRY_RESULT_EVT 0x2F 573 #define HCI_ENCRYPTION_KEY_REFRESH_COMP_EVT 0x30 574 #define HCI_IO_CAPABILITY_REQUEST_EVT 0x31 575 #define HCI_IO_CAPABILITY_RESPONSE_EVT 0x32 576 #define HCI_USER_CONFIRMATION_REQUEST_EVT 0x33 577 #define HCI_USER_PASSKEY_REQUEST_EVT 0x34 578 #define HCI_REMOTE_OOB_DATA_REQUEST_EVT 0x35 579 #define HCI_SIMPLE_PAIRING_COMPLETE_EVT 0x36 580 #define HCI_LINK_SUPER_TOUT_CHANGED_EVT 0x38 581 #define HCI_ENHANCED_FLUSH_COMPLETE_EVT 0x39 582 #define HCI_USER_PASSKEY_NOTIFY_EVT 0x3B 583 #define HCI_KEYPRESS_NOTIFY_EVT 0x3C 584 #define HCI_RMT_HOST_SUP_FEAT_NOTIFY_EVT 0x3D 585 586 /* ULP HCI Event */ 587 #define HCI_BLE_EVENT 0x3e 588 /* ULP Event sub code */ 589 #define HCI_BLE_CONN_COMPLETE_EVT 0x01 590 #define HCI_BLE_ADV_PKT_RPT_EVT 0x02 591 #define HCI_BLE_LL_CONN_PARAM_UPD_EVT 0x03 592 #define HCI_BLE_READ_REMOTE_FEAT_CMPL_EVT 0x04 593 #define HCI_BLE_LTK_REQ_EVT 0x05 594 #define HCI_BLE_RC_PARAM_REQ_EVT 0x06 595 #define HCI_BLE_DATA_LENGTH_CHANGE_EVT 0x07 596 #define HCI_BLE_ENHANCED_CONN_COMPLETE_EVT 0x0a 597 #define HCI_BLE_DIRECT_ADV_EVT 0x0b 598 #define HCI_BLE_PHY_UPDATE_COMPLETE_EVT 0x0c 599 #define HCI_LE_EXTENDED_ADVERTISING_REPORT_EVT 0x0D 600 #define HCI_BLE_PERIODIC_ADV_SYNC_EST_EVT 0x0E 601 #define HCI_BLE_PERIODIC_ADV_REPORT_EVT 0x0F 602 #define HCI_BLE_PERIODIC_ADV_SYNC_LOST_EVT 0x10 603 #define HCI_BLE_SCAN_TIMEOUT_EVT 0x11 604 #define HCI_LE_ADVERTISING_SET_TERMINATED_EVT 0x12 605 #define HCI_BLE_SCAN_REQ_RX_EVT 0x13 606 #define HCI_BLE_CIS_EST_EVT 0x19 607 #define HCI_BLE_CIS_REQ_EVT 0x1a 608 #define HCI_BLE_CREATE_BIG_CPL_EVT 0x1b 609 #define HCI_BLE_TERM_BIG_CPL_EVT 0x1c 610 #define HCI_BLE_BIG_SYNC_EST_EVT 0x1d 611 #define HCI_BLE_BIG_SYNC_LOST_EVT 0x1e 612 #define HCI_BLE_REQ_PEER_SCA_CPL_EVT 0x1f 613 614 #define HCI_LE_PERIODIC_ADV_SYNC_TRANSFERE_RECEIVED_EVT 0x18 615 #define HCI_LE_BIGINFO_ADVERTISING_REPORT_EVT 0x22 616 617 #define HCI_VENDOR_SPECIFIC_EVT 0xFF /* Vendor specific events */ 618 619 /* 620 * Definitions for HCI enable event 621 */ 622 #define HCI_INQUIRY_RESULT_EV(p) (*((uint32_t*)(p)) & 0x00000002) 623 #define HCI_CONNECTION_COMPLETE_EV(p) (*((uint32_t*)(p)) & 0x00000004) 624 #define HCI_CONNECTION_REQUEST_EV(p) (*((uint32_t*)(p)) & 0x00000008) 625 #define HCI_DISCONNECTION_COMPLETE_EV(p) (*((uint32_t*)(p)) & 0x00000010) 626 #define HCI_AUTHENTICATION_COMPLETE_EV(p) (*((uint32_t*)(p)) & 0x00000020) 627 #define HCI_RMT_NAME_REQUEST_COMPL_EV(p) (*((uint32_t*)(p)) & 0x00000040) 628 #define HCI_CHANGE_CONN_ENCRPT_ENABLE_EV(p) (*((uint32_t*)(p)) & 0x00000080) 629 #define HCI_CHANGE_CONN_LINK_KEY_EV(p) (*((uint32_t*)(p)) & 0x00000100) 630 #define HCI_CENTRAL_LINK_KEY_COMPLETE_EV(p) (*((uint32_t*)(p)) & 0x00000200) 631 #define HCI_READ_RMT_FEATURES_COMPL_EV(p) (*((uint32_t*)(p)) & 0x00000400) 632 #define HCI_READ_RMT_VERSION_COMPL_EV(p) (*((uint32_t*)(p)) & 0x00000800) 633 #define HCI_QOS_SETUP_COMPLETE_EV(p) (*((uint32_t*)(p)) & 0x00001000) 634 #define HCI_COMMAND_COMPLETE_EV(p) (*((uint32_t*)(p)) & 0x00002000) 635 #define HCI_COMMAND_STATUS_EV(p) (*((uint32_t*)(p)) & 0x00004000) 636 #define HCI_HARDWARE_ERROR_EV(p) (*((uint32_t*)(p)) & 0x00008000) 637 #define HCI_FLASH_OCCURED_EV(p) (*((uint32_t*)(p)) & 0x00010000) 638 #define HCI_ROLE_CHANGE_EV(p) (*((uint32_t*)(p)) & 0x00020000) 639 #define HCI_NUM_COMPLETED_PKTS_EV(p) (*((uint32_t*)(p)) & 0x00040000) 640 #define HCI_MODE_CHANGE_EV(p) (*((uint32_t*)(p)) & 0x00080000) 641 #define HCI_RETURN_LINK_KEYS_EV(p) (*((uint32_t*)(p)) & 0x00100000) 642 #define HCI_PIN_CODE_REQUEST_EV(p) (*((uint32_t*)(p)) & 0x00200000) 643 #define HCI_LINK_KEY_REQUEST_EV(p) (*((uint32_t*)(p)) & 0x00400000) 644 #define HCI_LINK_KEY_NOTIFICATION_EV(p) (*((uint32_t*)(p)) & 0x00800000) 645 #define HCI_LOOPBACK_COMMAND_EV(p) (*((uint32_t*)(p)) & 0x01000000) 646 #define HCI_DATA_BUF_OVERFLOW_EV(p) (*((uint32_t*)(p)) & 0x02000000) 647 #define HCI_MAX_SLOTS_CHANGE_EV(p) (*((uint32_t*)(p)) & 0x04000000) 648 #define HCI_READ_CLOCK_OFFSET_COMP_EV(p) (*((uint32_t*)(p)) & 0x08000000) 649 #define HCI_CONN_PKT_TYPE_CHANGED_EV(p) (*((uint32_t*)(p)) & 0x10000000) 650 #define HCI_QOS_VIOLATION_EV(p) (*((uint32_t*)(p)) & 0x20000000) 651 #define HCI_PAGE_SCAN_MODE_CHANGED_EV(p) (*((uint32_t*)(p)) & 0x40000000) 652 #define HCI_PAGE_SCAN_REP_MODE_CHNG_EV(p) (*((uint32_t*)(p)) & 0x80000000) 653 654 /* the event mask for 2.0 + EDR and later (includes Lisbon events) */ 655 #define HCI_DUMO_EVENT_MASK_EXT \ 656 { 0x3D, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } 657 /* 0x00001FFF FFFFFFFF Default - no Lisbon events 658 0x00000800 00000000 Synchronous Connection Complete Event 659 0x00001000 00000000 Synchronous Connection Changed Event 660 0x00002000 00000000 Sniff Subrate Event 661 0x00004000 00000000 Extended Inquiry Result Event 662 0x00008000 00000000 Encryption Key Refresh Complete Event 663 0x00010000 00000000 IO Capability Request Event 664 0x00020000 00000000 IO Capability Response Event 665 0x00040000 00000000 User Confirmation Request Event 666 0x00080000 00000000 User Passkey Request Event 667 0x00100000 00000000 Remote OOB Data Request Event 668 0x00200000 00000000 Simple Pairing Complete Event 669 0x00400000 00000000 Generic AMP Link Key Notification Event 670 0x00800000 00000000 Link Supervision Timeout Changed Event 671 0x01000000 00000000 Enhanced Flush Complete Event 672 0x04000000 00000000 User Passkey Notification Event 673 0x08000000 00000000 Keypress Notification Event 674 0x10000000 00000000 Remote Host Supported Features Notification Event 675 0x20000000 00000000 LE Meta Event 676 */ 677 678 /* 679 * Definitions for packet type masks (BT1.2 and BT2.0 definitions) 680 */ 681 typedef enum : uint16_t { 682 HCI_PKT_TYPES_MASK_NO_2_DH1 = 0x0002, 683 HCI_PKT_TYPES_MASK_NO_3_DH1 = 0x0004, 684 HCI_PKT_TYPES_MASK_DM1 = 0x0008, 685 HCI_PKT_TYPES_MASK_DH1 = 0x0010, 686 HCI_PKT_TYPES_MASK_HV1 = 0x0020, 687 HCI_PKT_TYPES_MASK_HV2 = 0x0040, 688 HCI_PKT_TYPES_MASK_HV3 = 0x0080, 689 HCI_PKT_TYPES_MASK_NO_2_DH3 = 0x0100, 690 HCI_PKT_TYPES_MASK_NO_3_DH3 = 0x0200, 691 HCI_PKT_TYPES_MASK_DM3 = 0x0400, 692 HCI_PKT_TYPES_MASK_DH3 = 0x0800, 693 HCI_PKT_TYPES_MASK_NO_2_DH5 = 0x1000, 694 HCI_PKT_TYPES_MASK_NO_3_DH5 = 0x2000, 695 HCI_PKT_TYPES_MASK_DM5 = 0x4000, 696 HCI_PKT_TYPES_MASK_DH5 = 0x8000, 697 } tHCI_PKT_TYPE_BITMASK; 698 699 /* 700 * Define parameters to allow role switch during create connection 701 */ 702 #define HCI_CR_CONN_NOT_ALLOW_SWITCH 0x00 703 #define HCI_CR_CONN_ALLOW_SWITCH 0x01 704 705 /* Page scan period modes */ 706 #define HCI_PAGE_SCAN_REP_MODE_R1 0x01 707 708 /* Page scan modes */ 709 #define HCI_MANDATARY_PAGE_SCAN_MODE 0x00 710 711 /* Page and inquiry scan types */ 712 #define HCI_SCAN_TYPE_STANDARD 0x00 713 #define HCI_DEF_SCAN_TYPE HCI_SCAN_TYPE_STANDARD 714 715 /* Definitions for Extended Inquiry Response */ 716 #define HCI_EXT_INQ_RESPONSE_LEN 240 717 #define HCI_EIR_FLAGS_TYPE 0x01 718 #define HCI_EIR_MORE_16BITS_UUID_TYPE 0x02 719 #define HCI_EIR_COMPLETE_16BITS_UUID_TYPE 0x03 720 #define HCI_EIR_MORE_32BITS_UUID_TYPE 0x04 721 #define HCI_EIR_COMPLETE_32BITS_UUID_TYPE 0x05 722 #define HCI_EIR_MORE_128BITS_UUID_TYPE 0x06 723 #define HCI_EIR_COMPLETE_128BITS_UUID_TYPE 0x07 724 #define HCI_EIR_SHORTENED_LOCAL_NAME_TYPE 0x08 725 #define HCI_EIR_COMPLETE_LOCAL_NAME_TYPE 0x09 726 #define HCI_EIR_TX_POWER_LEVEL_TYPE 0x0A 727 #define HCI_EIR_MANUFACTURER_SPECIFIC_TYPE 0xFF 728 #define HCI_EIR_SERVICE_DATA_TYPE 0x16 729 #define HCI_EIR_SERVICE_DATA_16BITS_UUID_TYPE 0x16 730 #define HCI_EIR_SERVICE_DATA_32BITS_UUID_TYPE 0x20 731 #define HCI_EIR_SERVICE_DATA_128BITS_UUID_TYPE 0x21 732 #define HCI_EIR_OOB_BD_ADDR_TYPE 0x0C 733 #define HCI_EIR_OOB_COD_TYPE 0x0D 734 #define HCI_EIR_OOB_SSP_HASH_C_TYPE 0x0E 735 #define HCI_EIR_OOB_SSP_RAND_R_TYPE 0x0F 736 #define HCI_EIR_RSI_TYPE 0x2E 737 738 /* Definitions for Write Simple Pairing Mode */ 739 #define HCI_SP_MODE_ENABLED 0x01 740 741 /* Definitions for Write Secure Connections Host Support */ 742 #define HCI_SC_MODE_ENABLED 0x01 743 744 /* Filters that are sent in set filter command */ 745 #define HCI_FILTER_CONNECTION_SETUP 0x02 746 747 #define HCI_FILTER_COND_NEW_DEVICE 0x00 748 #define HCI_FILTER_COND_DEVICE_CLASS 0x01 749 #define HCI_FILTER_COND_BD_ADDR 0x02 750 751 /* role switch disabled */ 752 #define HCI_DO_AUTO_ACCEPT_CONNECT 2 753 754 /* PIN type */ 755 #define HCI_PIN_TYPE_FIXED 1 756 757 /* Scan enable flags */ 758 #define HCI_INQUIRY_SCAN_ENABLED 0x01 759 #define HCI_PAGE_SCAN_ENABLED 0x02 760 761 /* Pagescan timer definitions in 0.625 ms */ 762 #define HCI_DEF_PAGESCAN_INTERVAL 0x0800 /* 1.28 sec */ 763 764 /* Parameter for pagescan window is passed to LC and is kept in slots */ 765 #define HCI_DEF_PAGESCAN_WINDOW 0x12 /* 11.25 ms */ 766 767 /* Inquiryscan timer definitions in 0.625 ms */ 768 #define HCI_DEF_INQUIRYSCAN_INTERVAL 0x1000 /* 2.56 sec */ 769 770 /* Parameter for inquiryscan window is passed to LC and is kept in slots */ 771 #define HCI_DEF_INQUIRYSCAN_WINDOW 0x12 /* 11.25 ms */ 772 773 /* Encryption modes */ 774 typedef enum : uint8_t { 775 HCI_ENCRYPT_MODE_DISABLED = 0x00, 776 HCI_ENCRYPT_MODE_ON = 0x01, 777 HCI_ENCRYPT_MODE_ON_BR_EDR_AES_CCM = 0x02, 778 } tHCI_ENCRYPT_MODE; 779 780 /* Voice settings */ 781 #define HCI_INP_CODING_LINEAR 0x0000 /* 0000000000 */ 782 #define HCI_INP_CODING_U_LAW 0x0100 /* 0100000000 */ 783 #define HCI_INP_CODING_A_LAW 0x0200 /* 1000000000 */ 784 785 #define HCI_INP_DATA_FMT_2S_COMPLEMENT 0x0040 /* 0001000000 */ 786 #define HCI_INP_DATA_FMT_SIGN_MAGNITUDE 0x0080 /* 0010000000 */ 787 #define HCI_INP_DATA_FMT_UNSIGNED 0x00c0 /* 0011000000 */ 788 789 #define HCI_INP_SAMPLE_SIZE_8BIT 0x0000 /* 0000000000 */ 790 #define HCI_INP_SAMPLE_SIZE_16BIT 0x0020 /* 0000100000 */ 791 792 #define HCI_INP_LINEAR_PCM_BIT_POS_OFFS 2 793 794 #define HCI_AIR_CODING_FORMAT_CVSD 0x0000 /* 0000000000 */ 795 #define HCI_AIR_CODING_FORMAT_U_LAW 0x0001 /* 0000000001 */ 796 #define HCI_AIR_CODING_FORMAT_A_LAW 0x0002 /* 0000000010 */ 797 #define HCI_AIR_CODING_FORMAT_TRANSPNT 0x0003 /* 0000000011 */ 798 #define HCI_AIR_CODING_FORMAT_MASK 0x0003 /* 0000000011 */ 799 800 /* default 0001100000 */ 801 #define HCI_DEFAULT_VOICE_SETTINGS \ 802 (HCI_INP_CODING_LINEAR | HCI_INP_DATA_FMT_2S_COMPLEMENT | \ 803 HCI_INP_SAMPLE_SIZE_16BIT | HCI_AIR_CODING_FORMAT_CVSD) 804 805 /* Retransmit timer definitions in 0.625 */ 806 #define HCI_MAX_AUTOMATIC_FLUSH_TIMEOUT 0x07FF 807 808 /* Default Link Supervision timeoout */ 809 #define HCI_DEFAULT_INACT_TOUT 0x7D00 /* BR/EDR (20 seconds) */ 810 811 /* Read transmit power level parameter */ 812 #define HCI_READ_CURRENT 0x00 813 814 /* Link types for connection complete event */ 815 #define HCI_LINK_TYPE_SCO 0x00 816 #define HCI_LINK_TYPE_ACL 0x01 817 #define HCI_LINK_TYPE_ESCO 0x02 818 819 /* Link Key Notification Event (Key Type) definitions */ 820 #define HCI_LKEY_TYPE_COMBINATION 0x00 821 #define HCI_LKEY_TYPE_REMOTE_UNIT 0x02 822 #define HCI_LKEY_TYPE_DEBUG_COMB 0x03 823 #define HCI_LKEY_TYPE_UNAUTH_COMB 0x04 824 #define HCI_LKEY_TYPE_AUTH_COMB 0x05 825 #define HCI_LKEY_TYPE_CHANGED_COMB 0x06 826 #define HCI_LKEY_TYPE_UNAUTH_COMB_P_256 0x07 827 #define HCI_LKEY_TYPE_AUTH_COMB_P_256 0x08 828 829 /* Define an invalid value for a handle */ 830 #define HCI_INVALID_HANDLE 0xFFFF 831 832 /* Define the preamble length for all HCI Commands. 833 * This is 2-bytes for opcode and 1 byte for length 834 */ 835 #define HCIC_PREAMBLE_SIZE 3 836 837 /* Define the preamble length for all HCI Events 838 * This is 1-byte for opcode and 1 byte for length 839 */ 840 #define HCIE_PREAMBLE_SIZE 2 841 842 // Packet boundary flags 843 constexpr uint8_t kFIRST_NON_AUTOMATICALLY_FLUSHABLE = 0x0; 844 constexpr uint8_t kCONTINUING_FRAGMENT = 0x1; 845 constexpr uint8_t kHCI_FIRST_AUTOMATICALLY_FLUSHABLE = 0x2; 846 847 struct HciDataPreambleBits { 848 uint16_t handle : 12; 849 uint16_t boundary : 2; 850 uint16_t broadcast : 1; 851 uint16_t unused15 : 1; 852 uint16_t length; 853 }; 854 struct HciDataPreambleRaw { 855 uint16_t word0; 856 uint16_t word1; 857 }; 858 union HciDataPreamble { 859 HciDataPreambleBits bits; 860 HciDataPreambleRaw raw; Serialize(uint8_t * data)861 void Serialize(uint8_t* data) { 862 *data++ = ((raw.word0) & 0xff); 863 *data++ = (((raw.word0) >> 8) & 0xff); 864 *data++ = ((raw.word1) & 0xff); 865 *data++ = (((raw.word1 >> 8)) & 0xff); 866 } IsFlushable()867 bool IsFlushable() const { 868 return bits.boundary == kHCI_FIRST_AUTOMATICALLY_FLUSHABLE; 869 } SetFlushable()870 void SetFlushable() { bits.boundary = kHCI_FIRST_AUTOMATICALLY_FLUSHABLE; } 871 }; 872 #define HCI_DATA_PREAMBLE_SIZE sizeof(HciDataPreamble) 873 static_assert(HCI_DATA_PREAMBLE_SIZE == 4); 874 static_assert(sizeof(HciDataPreambleRaw) == sizeof(HciDataPreambleBits)); 875 876 /* local Bluetooth controller id for AMP HCI */ 877 #define LOCAL_BR_EDR_CONTROLLER_ID 0 878 879 /* Define the extended flow specification fields used by AMP */ 880 typedef struct { 881 uint8_t id; 882 uint8_t stype; 883 uint16_t max_sdu_size; 884 uint32_t sdu_inter_time; 885 uint32_t access_latency; 886 uint32_t flush_timeout; 887 } tHCI_EXT_FLOW_SPEC; 888 889 /* Parameter information for HCI_BRCM_SET_ACL_PRIORITY */ 890 #define HCI_BRCM_ACL_PRIORITY_PARAM_SIZE 3 891 #define HCI_BRCM_SET_ACL_PRIORITY (0x0057 | HCI_GRP_VENDOR_SPECIFIC) 892 #define HCI_BRCM_ACL_NORMAL_PRIORITY 0x00 893 #define HCI_BRCM_ACL_HIGH_PRIORITY 0xFF 894 #define HCI_BRCM_ACL_HIGH_PRIORITY_LOW_LATENCY 0xF3 895 896 #define LMP_COMPID_GOOGLE 0xE0 897 898 // TODO(zachoverflow): remove this once broadcom specific hacks are removed 899 #define LMP_COMPID_BROADCOM 15 900 901 // TODO: Remove this once Synaptics specific code is removed 902 #define LMP_COMPID_SYNAPTICS 0x0A76 903 904 /* Parameter information for HCI_SYNA_SET_ACL_PRIORITY */ 905 #define HCI_SYNA_ACL_PRIORITY_PARAM_SIZE 3 906 #define HCI_SYNA_ACL_PRIORITY_LOW 0x00 907 #define HCI_SYNA_ACL_PRIORITY_HIGH 0xFF 908 #define HCI_SYNA_SET_ACL_PRIORITY (0x0057 | HCI_GRP_VENDOR_SPECIFIC) 909 910 /* 911 * Define packet size 912 */ 913 #define HCI_DM1_PACKET_SIZE 17 914 #define HCI_DH1_PACKET_SIZE 27 915 #define HCI_DM3_PACKET_SIZE 121 916 #define HCI_DH3_PACKET_SIZE 183 917 #define HCI_DM5_PACKET_SIZE 224 918 #define HCI_DH5_PACKET_SIZE 339 919 #define HCI_AUX1_PACKET_SIZE 29 920 #define HCI_HV1_PACKET_SIZE 10 921 #define HCI_HV2_PACKET_SIZE 20 922 #define HCI_HV3_PACKET_SIZE 30 923 #define HCI_DV_PACKET_SIZE 9 924 #define HCI_EDR2_DH1_PACKET_SIZE 54 925 #define HCI_EDR2_DH3_PACKET_SIZE 367 926 #define HCI_EDR2_DH5_PACKET_SIZE 679 927 #define HCI_EDR3_DH1_PACKET_SIZE 83 928 #define HCI_EDR3_DH3_PACKET_SIZE 552 929 #define HCI_EDR3_DH5_PACKET_SIZE 1021 930 931 /* Feature Pages */ 932 #define HCI_EXT_FEATURES_PAGE_MAX 3 // Parse feature pages 0-3 933 934 #define HCI_FEATURE_BYTES_PER_PAGE 8 935 936 #define HCI_EXT_FEATURES_SUCCESS_EVT_LEN 13 937 938 /* LMP features encoding - page 0 */ 939 #define HCI_3_SLOT_PACKETS_SUPPORTED(x) ((x)[0] & 0x01) 940 #define HCI_5_SLOT_PACKETS_SUPPORTED(x) ((x)[0] & 0x02) 941 #define HCI_ENCRYPTION_SUPPORTED(x) ((x)[0] & 0x04) 942 #define HCI_SLOT_OFFSET_SUPPORTED(x) ((x)[0] & 0x08) 943 #define HCI_TIMING_ACC_SUPPORTED(x) ((x)[0] & 0x10) 944 #define HCI_SWITCH_SUPPORTED(x) ((x)[0] & 0x20) 945 #define HCI_HOLD_MODE_SUPPORTED(x) ((x)[0] & 0x40) 946 #define HCI_SNIFF_MODE_SUPPORTED(x) ((x)[0] & 0x80) 947 948 #define HCI_PARK_MODE_SUPPORTED(x) ((x)[1] & 0x01) 949 #define HCI_RSSI_SUPPORTED(x) ((x)[1] & 0x02) 950 #define HCI_CQM_DATA_RATE_SUPPORTED(x) ((x)[1] & 0x04) 951 #define HCI_SCO_LINK_SUPPORTED(x) ((x)[1] & 0x08) 952 #define HCI_HV2_PACKETS_SUPPORTED(x) ((x)[1] & 0x10) 953 #define HCI_HV3_PACKETS_SUPPORTED(x) ((x)[1] & 0x20) 954 #define HCI_LMP_U_LAW_SUPPORTED(x) ((x)[1] & 0x40) 955 #define HCI_LMP_A_LAW_SUPPORTED(x) ((x)[1] & 0x80) 956 957 #define HCI_LMP_CVSD_SUPPORTED(x) ((x)[2] & 0x01) 958 #define HCI_PAGING_SCHEME_SUPPORTED(x) ((x)[2] & 0x02) 959 #define HCI_POWER_CTRL_SUPPORTED(x) ((x)[2] & 0x04) 960 #define HCI_LMP_TRANSPNT_SUPPORTED(x) ((x)[2] & 0x08) 961 #define HCI_FLOW_CTRL_LAG_VALUE(x) (((x)[2] & 0x70) >> 4) 962 #define HCI_LMP_BCAST_ENC_SUPPORTED(x) ((x)[2] & 0x80) 963 964 #define HCI_LMP_SCATTER_MODE_SUPPORTED(x) ((x)[3] & 0x01) 965 #define HCI_EDR_ACL_2MPS_SUPPORTED(x) ((x)[3] & 0x02) 966 #define HCI_EDR_ACL_3MPS_SUPPORTED(x) ((x)[3] & 0x04) 967 #define HCI_ENHANCED_INQ_SUPPORTED(x) ((x)[3] & 0x08) 968 #define HCI_LMP_INTERLACED_INQ_SCAN_SUPPORTED(x) ((x)[3] & 0x10) 969 #define HCI_LMP_INTERLACED_PAGE_SCAN_SUPPORTED(x) ((x)[3] & 0x20) 970 #define HCI_LMP_INQ_RSSI_SUPPORTED(x) ((x)[3] & 0x40) 971 #define HCI_ESCO_EV3_SUPPORTED(x) ((x)[3] & 0x80) 972 973 #define HCI_ESCO_EV4_SUPPORTED(x) ((x)[4] & 0x01) 974 #define HCI_ESCO_EV5_SUPPORTED(x) ((x)[4] & 0x02) 975 #define HCI_LMP_ABSENCE_MASKS_SUPPORTED(x) ((x)[4] & 0x04) 976 #define HCI_LMP_AFH_CAP_PERIPHERAL_SUPPORTED(x) ((x)[4] & 0x08) 977 #define HCI_LMP_AFH_CLASS_PERIPHERAL_SUPPORTED(x) ((x)[4] & 0x10) 978 #define HCI_BREDR_NOT_SPT_SUPPORTED(x) ((x)[4] & 0x20) 979 #define HCI_LE_SPT_SUPPORTED(x) ((x)[4] & 0x40) 980 #define HCI_3_SLOT_EDR_ACL_SUPPORTED(x) ((x)[4] & 0x80) 981 982 #define HCI_5_SLOT_EDR_ACL_SUPPORTED(x) ((x)[5] & 0x01) 983 #define HCI_SNIFF_SUB_RATE_SUPPORTED(x) (static_cast<bool>((x)[5] & 0x02)) 984 #define HCI_ATOMIC_ENCRYPT_SUPPORTED(x) ((x)[5] & 0x04) 985 #define HCI_LMP_AFH_CAP_MASTR_SUPPORTED(x) ((x)[5] & 0x08) 986 #define HCI_LMP_AFH_CLASS_MASTR_SUPPORTED(x) ((x)[5] & 0x10) 987 #define HCI_EDR_ESCO_2MPS_SUPPORTED(x) ((x)[5] & 0x20) 988 #define HCI_EDR_ESCO_3MPS_SUPPORTED(x) ((x)[5] & 0x40) 989 #define HCI_3_SLOT_EDR_ESCO_SUPPORTED(x) ((x)[5] & 0x80) 990 991 #define HCI_EXT_INQ_RSP_SUPPORTED(x) ((x)[6] & 0x01) 992 #define HCI_SIMUL_LE_BREDR_SUPPORTED(x) ((x)[6] & 0x02) 993 #define HCI_ANUM_PIN_CAP_SUPPORTED(x) ((x)[6] & 0x04) 994 #define HCI_SIMPLE_PAIRING_SUPPORTED(x) ((x)[6] & 0x08) 995 #define HCI_ENCAP_PDU_SUPPORTED(x) ((x)[6] & 0x10) 996 #define HCI_ERROR_DATA_SUPPORTED(x) ((x)[6] & 0x20) 997 /* This feature is causing frequent link drops when doing call switch with 998 * certain av/hfp headsets */ 999 // TODO: move the disabling somewhere else 1000 #define HCI_NON_FLUSHABLE_PB_SUPPORTED(x) (0) //((x)[6] & 0x40) 1001 #define HCI_LINK_SUP_TO_EVT_SUPPORTED(x) ((x)[7] & 0x01) 1002 #define HCI_INQ_RESP_TX_SUPPORTED(x) ((x)[7] & 0x02) 1003 #define HCI_LMP_EXTENDED_SUPPORTED(x) ((x)[7] & 0x80) 1004 1005 /* LMP features encoding - page 1 */ 1006 #define HCI_SSP_HOST_SUPPORTED(x) ((x)[0] & 0x01) 1007 #define HCI_LE_HOST_SUPPORTED(x) ((x)[0] & 0x02) 1008 #define HCI_SIMUL_DUMO_HOST_SUPPORTED(x) ((x)[0] & 0x04) 1009 #define HCI_SC_HOST_SUPPORTED(x) ((x)[0] & 0x08) 1010 1011 /* LMP features encoding - page 2 */ 1012 #define HCI_CSB_CENTRAL_SUPPORTED(x) ((x)[0] & 0x01) 1013 #define HCI_CSB_PERIPHERAL_SUPPORTED(x) ((x)[0] & 0x02) 1014 #define HCI_SYNC_TRAIN_CENTRAL_SUPPORTED(x) ((x)[0] & 0x04) 1015 #define HCI_SYNC_SCAN_PERIPHERAL_SUPPORTED(x) ((x)[0] & 0x08) 1016 #define HCI_INQ_RESP_NOTIF_SUPPORTED(x) ((x)[0] & 0x10) 1017 1018 #define HCI_SC_CTRLR_SUPPORTED(x) ((x)[1] & 0x01) 1019 #define HCI_PING_SUPPORTED(x) ((x)[1] & 0x02) 1020 1021 /* LE features encoding - page 0 (the only page for now) */ 1022 #define HCI_LE_ENCRYPTION_SUPPORTED(x) ((x)[0] & 0x01) 1023 #define HCI_LE_CONN_PARAM_REQ_SUPPORTED(x) ((x)[0] & 0x02) 1024 #define HCI_LE_EXT_REJ_IND_SUPPORTED(x) ((x)[0] & 0x04) 1025 #define HCI_LE_PERIPHERAL_INIT_FEAT_EXC_SUPPORTED(x) ((x)[0] & 0x08) 1026 #define HCI_LE_DATA_LEN_EXT_SUPPORTED(x) ((x)[0] & 0x20) 1027 #define HCI_LE_ENHANCED_PRIVACY_SUPPORTED(x) ((x)[0] & 0x40) 1028 #define HCI_LE_EXT_SCAN_FILTER_POLICY_SUPPORTED(x) ((x)[0] & 0x80) 1029 1030 #define HCI_LE_2M_PHY_SUPPORTED(x) ((x)[1] & 0x01) 1031 #define HCI_LE_CODED_PHY_SUPPORTED(x) ((x)[1] & 0x08) 1032 #define HCI_LE_EXTENDED_ADVERTISING_SUPPORTED(x) ((x)[1] & 0x10) 1033 #define HCI_LE_PERIODIC_ADVERTISING_SUPPORTED(x) ((x)[1] & 0x20) 1034 #define HCI_LE_PERIODIC_ADVERTISING_SYNC_TRANSFER_SENDER(x) ((x)[3] & 0x01) 1035 #define HCI_LE_PERIODIC_ADVERTISING_SYNC_TRANSFER_RECIPIENT(x) ((x)[3] & 0x02) 1036 #define HCI_LE_CIS_CENTRAL(x) ((x)[3] & 0x10) 1037 #define HCI_LE_CIS_PERIPHERAL(x) ((x)[3] & 0x20) 1038 #define HCI_LE_ISO_BROADCASTER(x) ((x)[3] & 0x40) 1039 #define HCI_LE_SYNCHRONIZED_RECEIVER(x) ((x)[3] & 0x80) 1040 1041 /* Supported Commands*/ 1042 #define HCI_NUM_SUPP_COMMANDS_BYTES 64 1043 1044 #define HCI_INQUIRY_SUPPORTED(x) ((x)[0] & 0x01) 1045 #define HCI_INQUIRY_CANCEL_SUPPORTED(x) ((x)[0] & 0x02) 1046 #define HCI_PERIODIC_INQUIRY_SUPPORTED(x) ((x)[0] & 0x04) 1047 #define HCI_EXIT_PERIODIC_INQUIRY_SUPPORTED(x) ((x)[0] & 0x08) 1048 #define HCI_CREATE_CONN_SUPPORTED(x) ((x)[0] & 0x10) 1049 #define HCI_DISCONNECT_SUPPORTED(x) ((x)[0] & 0x20) 1050 #define HCI_ADD_SCO_CONN_SUPPORTED(x) ((x)[0] & 0x40) 1051 #define HCI_CANCEL_CREATE_CONN_SUPPORTED(x) ((x)[0] & 0x80) 1052 1053 #define HCI_ACCEPT_CONN_REQUEST_SUPPORTED(x) ((x)[1] & 0x01) 1054 #define HCI_REJECT_CONN_REQUEST_SUPPORTED(x) ((x)[1] & 0x02) 1055 #define HCI_LINK_KEY_REQUEST_REPLY_SUPPORTED(x) ((x)[1] & 0x04) 1056 #define HCI_LINK_KEY_REQUEST_NEG_REPLY_SUPPORTED(x) ((x)[1] & 0x08) 1057 #define HCI_PIN_CODE_REQUEST_REPLY_SUPPORTED(x) ((x)[1] & 0x10) 1058 #define HCI_PIN_CODE_REQUEST_NEG_REPLY_SUPPORTED(x) ((x)[1] & 0x20) 1059 #define HCI_CHANGE_CONN_PKT_TYPE_SUPPORTED(x) ((x)[1] & 0x40) 1060 #define HCI_AUTH_REQUEST_SUPPORTED(x) ((x)[1] & 0x80) 1061 1062 #define HCI_SET_CONN_ENCRYPTION_SUPPORTED(x) ((x)[2] & 0x01) 1063 #define HCI_CHANGE_CONN_LINK_KEY_SUPPORTED(x) ((x)[2] & 0x02) 1064 #define HCI_CENTRAL_LINK_KEY_SUPPORTED(x) ((x)[2] & 0x04) 1065 #define HCI_REMOTE_NAME_REQUEST_SUPPORTED(x) ((x)[2] & 0x08) 1066 #define HCI_CANCEL_REMOTE_NAME_REQUEST_SUPPORTED(x) ((x)[2] & 0x10) 1067 #define HCI_READ_REMOTE_SUPP_FEATURES_SUPPORTED(x) ((x)[2] & 0x20) 1068 #define HCI_READ_REMOTE_EXT_FEATURES_SUPPORTED(x) ((x)[2] & 0x40) 1069 #define HCI_READ_REMOTE_VER_INFO_SUPPORTED(x) ((x)[2] & 0x80) 1070 1071 #define HCI_READ_CLOCK_OFFSET_SUPPORTED(x) ((x)[3] & 0x01) 1072 #define HCI_READ_LMP_HANDLE_SUPPORTED(x) ((x)[3] & 0x02) 1073 /* rest of bits in 3-rd byte are reserved */ 1074 1075 #define HCI_HOLD_MODE_CMD_SUPPORTED(x) ((x)[4] & 0x02) 1076 #define HCI_SNIFF_MODE_CMD_SUPPORTED(x) ((x)[4] & 0x04) 1077 #define HCI_EXIT_SNIFF_MODE_SUPPORTED(x) ((x)[4] & 0x08) 1078 #define HCI_PARK_STATE_SUPPORTED(x) ((x)[4] & 0x10) 1079 #define HCI_EXIT_PARK_STATE_SUPPORTED(x) ((x)[4] & 0x20) 1080 #define HCI_QOS_SETUP_SUPPORTED(x) ((x)[4] & 0x40) 1081 #define HCI_ROLE_DISCOVERY_SUPPORTED(x) ((x)[4] & 0x80) 1082 1083 #define HCI_SWITCH_ROLE_SUPPORTED(x) ((x)[5] & 0x01) 1084 #define HCI_READ_LINK_POLICY_SET_SUPPORTED(x) ((x)[5] & 0x02) 1085 #define HCI_WRITE_LINK_POLICY_SET_SUPPORTED(x) ((x)[5] & 0x04) 1086 #define HCI_READ_DEF_LINK_POLICY_SET_SUPPORTED(x) ((x)[5] & 0x08) 1087 #define HCI_WRITE_DEF_LINK_POLICY_SET_SUPPORTED(x) ((x)[5] & 0x10) 1088 #define HCI_FLOW_SPECIFICATION_SUPPORTED(x) ((x)[5] & 0x20) 1089 #define HCI_SET_EVENT_MASK_SUPPORTED(x) ((x)[5] & 0x40) 1090 #define HCI_RESET_SUPPORTED(x) ((x)[5] & 0x80) 1091 1092 #define HCI_SET_EVENT_FILTER_SUPPORTED(x) ((x)[6] & 0x01) 1093 #define HCI_FLUSH_SUPPORTED(x) ((x)[6] & 0x02) 1094 #define HCI_READ_PIN_TYPE_SUPPORTED(x) ((x)[6] & 0x04) 1095 #define HCI_WRITE_PIN_TYPE_SUPPORTED(x) ((x)[6] & 0x08) 1096 #define HCI_READ_STORED_LINK_KEY_SUPPORTED(x) ((x)[6] & 0x20) 1097 #define HCI_WRITE_STORED_LINK_KEY_SUPPORTED(x) ((x)[6] & 0x40) 1098 #define HCI_DELETE_STORED_LINK_KEY_SUPPORTED(x) ((x)[6] & 0x80) 1099 1100 #define HCI_WRITE_LOCAL_NAME_SUPPORTED(x) ((x)[7] & 0x01) 1101 #define HCI_READ_LOCAL_NAME_SUPPORTED(x) ((x)[7] & 0x02) 1102 #define HCI_READ_CONN_ACCEPT_TOUT_SUPPORTED(x) ((x)[7] & 0x04) 1103 #define HCI_WRITE_CONN_ACCEPT_TOUT_SUPPORTED(x) ((x)[7] & 0x08) 1104 #define HCI_READ_PAGE_TOUT_SUPPORTED(x) ((x)[7] & 0x10) 1105 #define HCI_WRITE_PAGE_TOUT_SUPPORTED(x) ((x)[7] & 0x20) 1106 #define HCI_READ_SCAN_ENABLE_SUPPORTED(x) ((x)[7] & 0x40) 1107 #define HCI_WRITE_SCAN_ENABLE_SUPPORTED(x) ((x)[7] & 0x80) 1108 1109 #define HCI_READ_PAGE_SCAN_ACTIVITY_SUPPORTED(x) ((x)[8] & 0x01) 1110 #define HCI_WRITE_PAGE_SCAN_ACTIVITY_SUPPORTED(x) ((x)[8] & 0x02) 1111 #define HCI_READ_INQURIY_SCAN_ACTIVITY_SUPPORTED(x) ((x)[8] & 0x04) 1112 #define HCI_WRITE_INQURIY_SCAN_ACTIVITY_SUPPORTED(x) ((x)[8] & 0x08) 1113 #define HCI_READ_AUTH_ENABLE_SUPPORTED(x) ((x)[8] & 0x10) 1114 #define HCI_WRITE_AUTH_ENABLE_SUPPORTED(x) ((x)[8] & 0x20) 1115 #define HCI_READ_ENCRYPT_ENABLE_SUPPORTED(x) ((x)[8] & 0x40) 1116 #define HCI_WRITE_ENCRYPT_ENABLE_SUPPORTED(x) ((x)[8] & 0x80) 1117 1118 #define HCI_READ_CLASS_DEVICE_SUPPORTED(x) ((x)[9] & 0x01) 1119 #define HCI_WRITE_CLASS_DEVICE_SUPPORTED(x) ((x)[9] & 0x02) 1120 #define HCI_READ_VOICE_SETTING_SUPPORTED(x) ((x)[9] & 0x04) 1121 #define HCI_WRITE_VOICE_SETTING_SUPPORTED(x) ((x)[9] & 0x08) 1122 #define HCI_READ_AUTOMATIC_FLUSH_TIMEOUT_SUPPORTED(x) ((x)[9] & 0x10) 1123 #define HCI_WRITE_AUTOMATIC_FLUSH_TIMEOUT_SUPPORTED(x) ((x)[9] & 0x20) 1124 #define HCI_READ_NUM_BROAD_RETRANS_SUPPORTED(x) ((x)[9] & 0x40) 1125 #define HCI_WRITE_NUM_BROAD_RETRANS_SUPPORTED(x) ((x)[9] & 0x80) 1126 1127 #define HCI_READ_HOLD_MODE_ACTIVITY_SUPPORTED(x) ((x)[10] & 0x01) 1128 #define HCI_WRITE_HOLD_MODE_ACTIVITY_SUPPORTED(x) ((x)[10] & 0x02) 1129 #define HCI_READ_TRANS_PWR_LEVEL_SUPPORTED(x) ((x)[10] & 0x04) 1130 #define HCI_READ_SYNCH_FLOW_CTRL_ENABLE_SUPPORTED(x) ((x)[10] & 0x08) 1131 #define HCI_WRITE_SYNCH_FLOW_CTRL_ENABLE_SUPPORTED(x) ((x)[10] & 0x10) 1132 #define HCI_SET_HOST_CTRLR_TO_HOST_FC_SUPPORTED(x) ((x)[10] & 0x20) 1133 #define HCI_HOST_BUFFER_SIZE_SUPPORTED(x) ((x)[10] & 0x40) 1134 #define HCI_HOST_NUM_COMPLETED_PKTS_SUPPORTED(x) ((x)[10] & 0x80) 1135 1136 #define HCI_READ_LINK_SUP_TOUT_SUPPORTED(x) ((x)[11] & 0x01) 1137 #define HCI_WRITE_LINK_SUP_TOUT_SUPPORTED(x) ((x)[11] & 0x02) 1138 #define HCI_READ_NUM_SUPP_IAC_SUPPORTED(x) ((x)[11] & 0x04) 1139 #define HCI_READ_CURRENT_IAC_LAP_SUPPORTED(x) ((x)[11] & 0x08) 1140 #define HCI_WRITE_CURRENT_IAC_LAP_SUPPORTED(x) ((x)[11] & 0x10) 1141 #define HCI_READ_PAGE_SCAN_PER_MODE_SUPPORTED(x) ((x)[11] & 0x20) 1142 #define HCI_WRITE_PAGE_SCAN_PER_MODE_SUPPORTED(x) ((x)[11] & 0x40) 1143 #define HCI_READ_PAGE_SCAN_MODE_SUPPORTED(x) ((x)[11] & 0x80) 1144 1145 #define HCI_WRITE_PAGE_SCAN_MODE_SUPPORTED(x) ((x)[12] & 0x01) 1146 #define HCI_SET_AFH_CHNL_CLASS_SUPPORTED(x) ((x)[12] & 0x02) 1147 #define HCI_READ_INQUIRY_SCAN_TYPE_SUPPORTED(x) ((x)[12] & 0x10) 1148 #define HCI_WRITE_INQUIRY_SCAN_TYPE_SUPPORTED(x) ((x)[12] & 0x20) 1149 #define HCI_READ_INQUIRY_MODE_SUPPORTED(x) ((x)[12] & 0x40) 1150 #define HCI_WRITE_INQUIRY_MODE_SUPPORTED(x) ((x)[12] & 0x80) 1151 1152 #define HCI_READ_PAGE_SCAN_TYPE_SUPPORTED(x) ((x)[13] & 0x01) 1153 #define HCI_WRITE_PAGE_SCAN_TYPE_SUPPORTED(x) ((x)[13] & 0x02) 1154 #define HCI_READ_AFH_CHNL_ASSESS_MODE_SUPPORTED(x) ((x)[13] & 0x04) 1155 #define HCI_WRITE_AFH_CHNL_ASSESS_MODE_SUPPORTED(x) ((x)[13] & 0x08) 1156 1157 #define HCI_READ_LOCAL_VER_INFO_SUPPORTED(x) ((x)[14] & 0x08) 1158 #define HCI_READ_LOCAL_SUP_CMDS_SUPPORTED(x) ((x)[14] & 0x10) 1159 #define HCI_READ_LOCAL_SUPP_FEATURES_SUPPORTED(x) ((x)[14] & 0x20) 1160 #define HCI_READ_LOCAL_EXT_FEATURES_SUPPORTED(x) ((x)[14] & 0x40) 1161 #define HCI_READ_BUFFER_SIZE_SUPPORTED(x) ((x)[14] & 0x80) 1162 1163 #define HCI_READ_COUNTRY_CODE_SUPPORTED(x) ((x)[15] & 0x01) 1164 #define HCI_READ_BD_ADDR_SUPPORTED(x) ((x)[15] & 0x02) 1165 #define HCI_READ_FAIL_CONTACT_CNTR_SUPPORTED(x) ((x)[15] & 0x04) 1166 #define HCI_RESET_FAIL_CONTACT_CNTR_SUPPORTED(x) ((x)[15] & 0x08) 1167 #define HCI_GET_LINK_QUALITY_SUPPORTED(x) ((x)[15] & 0x10) 1168 #define HCI_READ_RSSI_SUPPORTED(x) ((x)[15] & 0x20) 1169 #define HCI_READ_AFH_CH_MAP_SUPPORTED(x) ((x)[15] & 0x40) 1170 #define HCI_READ_BD_CLOCK_SUPPORTED(x) ((x)[15] & 0x80) 1171 1172 #define HCI_READ_LOOPBACK_MODE_SUPPORTED(x) ((x)[16] & 0x01) 1173 #define HCI_WRITE_LOOPBACK_MODE_SUPPORTED(x) ((x)[16] & 0x02) 1174 #define HCI_ENABLE_DEV_UNDER_TEST_SUPPORTED(x) ((x)[16] & 0x04) 1175 #define HCI_SETUP_SYNCH_CONN_SUPPORTED(x) ((x)[16] & 0x08) 1176 #define HCI_ACCEPT_SYNCH_CONN_SUPPORTED(x) ((x)[16] & 0x10) 1177 #define HCI_REJECT_SYNCH_CONN_SUPPORTED(x) ((x)[16] & 0x20) 1178 1179 #define HCI_READ_EXT_INQUIRY_RESP_SUPPORTED(x) ((x)[17] & 0x01) 1180 #define HCI_WRITE_EXT_INQUIRY_RESP_SUPPORTED(x) ((x)[17] & 0x02) 1181 #define HCI_REFRESH_ENCRYPTION_KEY_SUPPORTED(x) ((x)[17] & 0x04) 1182 #define HCI_SNIFF_SUB_RATE_CMD_SUPPORTED(x) ((x)[17] & 0x10) 1183 #define HCI_READ_SIMPLE_PAIRING_MODE_SUPPORTED(x) ((x)[17] & 0x20) 1184 #define HCI_WRITE_SIMPLE_PAIRING_MODE_SUPPORTED(x) ((x)[17] & 0x40) 1185 #define HCI_READ_LOCAL_OOB_DATA_SUPPORTED(x) ((x)[17] & 0x80) 1186 1187 #define HCI_READ_INQUIRY_RESPONSE_TX_POWER_SUPPORTED(x) ((x)[18] & 0x01) 1188 #define HCI_WRITE_INQUIRY_RESPONSE_TX_POWER_SUPPORTED(x) ((x)[18] & 0x02) 1189 #define HCI_READ_DEFAULT_ERRONEOUS_DATA_REPORTING_SUPPORTED(x) ((x)[18] & 0x04) 1190 #define HCI_WRITE_DEFAULT_ERRONEOUS_DATA_REPORTING_SUPPORTED(x) ((x)[18] & 0x08) 1191 #define HCI_IO_CAPABILITY_REQUEST_REPLY_SUPPORTED(x) ((x)[18] & 0x80) 1192 1193 #define HCI_USER_CONFIRMATION_REQUEST_REPLY_SUPPORTED(x) ((x)[19] & 0x01) 1194 #define HCI_USER_CONFIRMATION_REQUEST_NEG_REPLY_SUPPORTED(x) ((x)[19] & 0x02) 1195 #define HCI_USER_PASSKEY_REQUEST_REPLY_SUPPORTED(x) ((x)[19] & 0x04) 1196 #define HCI_USER_PASSKEY_REQUEST_NEG_REPLY_SUPPORTED(x) ((x)[19] & 0x08) 1197 #define HCI_REMOTE_OOB_DATA_REQUEST_REPLY_SUPPORTED(x) ((x)[19] & 0x10) 1198 #define HCI_WRITE_SIMPLE_PAIRING_DBG_MODE_SUPPORTED(x) ((x)[19] & 0x20) 1199 #define HCI_ENHANCED_FLUSH_SUPPORTED(x) ((x)[19] & 0x40) 1200 #define HCI_REMOTE_OOB_DATA_REQUEST_NEG_REPLY_SUPPORTED(x) ((x)[19] & 0x80) 1201 1202 #define HCI_SEND_NOTIF_SUPPORTED(x) ((x)[20] & 0x04) 1203 #define HCI_IO_CAP_REQ_NEG_REPLY_SUPPORTED(x) ((x)[20] & 0x08) 1204 #define HCI_READ_ENCR_KEY_SIZE_SUPPORTED(x) ((x)[20] & 0x10) 1205 1206 #define HCI_CREATE_PHYSICAL_LINK_SUPPORTED(x) ((x)[21] & 0x01) 1207 #define HCI_ACCEPT_PHYSICAL_LINK_SUPPORTED(x) ((x)[21] & 0x02) 1208 #define HCI_DISCONNECT_PHYSICAL_LINK_SUPPORTED(x) ((x)[21] & 0x04) 1209 #define HCI_CREATE_LOGICAL_LINK_SUPPORTED(x) ((x)[21] & 0x08) 1210 #define HCI_ACCEPT_LOGICAL_LINK_SUPPORTED(x) ((x)[21] & 0x10) 1211 #define HCI_DISCONNECT_LOGICAL_LINK_SUPPORTED(x) ((x)[21] & 0x20) 1212 #define HCI_LOGICAL_LINK_CANCEL_SUPPORTED(x) ((x)[21] & 0x40) 1213 #define HCI_FLOW_SPEC_MODIFY_SUPPORTED(x) ((x)[21] & 0x80) 1214 1215 #define HCI_READ_LOGICAL_LINK_ACCEPT_TIMEOUT_SUPPORTED(x) ((x)[22] & 0x01) 1216 #define HCI_WRITE_LOGICAL_LINK_ACCEPT_TIMEOUT_SUPPORTED(x) ((x)[22] & 0x02) 1217 #define HCI_SET_EVENT_MASK_PAGE_2_SUPPORTED(x) ((x)[22] & 0x04) 1218 #define HCI_READ_LOCATION_DATA_SUPPORTED(x) ((x)[22] & 0x08) 1219 #define HCI_WRITE_LOCATION_DATA_SUPPORTED(x) ((x)[22] & 0x10) 1220 #define HCI_READ_LOCAL_AMP_INFO_SUPPORTED(x) ((x)[22] & 0x20) 1221 #define HCI_READ_LOCAL_AMP_ASSOC_SUPPORTED(x) ((x)[22] & 0x40) 1222 #define HCI_WRITE_REMOTE_AMP_ASSOC_SUPPORTED(x) ((x)[22] & 0x80) 1223 1224 #define HCI_READ_FLOW_CONTROL_MODE_SUPPORTED(x) ((x)[23] & 0x01) 1225 #define HCI_WRITE_FLOW_CONTROL_MODE_SUPPORTED(x) ((x)[23] & 0x02) 1226 #define HCI_READ_DATA_BLOCK_SIZE_SUPPORTED(x) ((x)[23] & 0x04) 1227 #define HCI_ENABLE_AMP_RCVR_REPORTS_SUPPORTED(x) ((x)[23] & 0x20) 1228 #define HCI_AMP_TEST_END_SUPPORTED(x) ((x)[23] & 0x40) 1229 #define HCI_AMP_TEST_SUPPORTED(x) ((x)[23] & 0x80) 1230 1231 #define HCI_READ_TRANSMIT_POWER_LEVEL_SUPPORTED(x) ((x)[24] & 0x01) 1232 #define HCI_READ_BE_FLUSH_TOUT_SUPPORTED(x) ((x)[24] & 0x04) 1233 #define HCI_WRITE_BE_FLUSH_TOUT_SUPPORTED(x) ((x)[24] & 0x08) 1234 #define HCI_SHORT_RANGE_MODE_SUPPORTED(x) ((x)[24] & 0x10) 1235 1236 #define HCI_ENH_SETUP_SYNCH_CONN_SUPPORTED(x) ((x)[29] & 0x08) 1237 #define HCI_ENH_ACCEPT_SYNCH_CONN_SUPPORTED(x) ((x)[29] & 0x10) 1238 #define HCI_READ_LOCAL_CODECS_SUPPORTED(x) ((x)[29] & 0x20) 1239 #define HCI_SET_MWS_CHANNEL_PARAMETERS_SUPPORTED(x) ((x)[29] & 0x40) 1240 #define HCI_SET_EXTERNAL_FRAME_CONFIGURATION_SUPPORTED(x) ((x)[29] & 0x80) 1241 1242 #define HCI_SET_MWS_SIGNALING_SUPPORTED(x) ((x)[30] & 0x01) 1243 #define HCI_SET_MWS_TRANSPORT_LAYER_SUPPORTED(x) ((x)[30] & 0x02) 1244 #define HCI_SET_MWS_SCAN_FREQUENCY_TABLE_SUPPORTED(x) ((x)[30] & 0x04) 1245 #define HCI_GET_MWS_TRANS_LAYER_CFG_SUPPORTED(x) ((x)[30] & 0x08) 1246 #define HCI_SET_MWS_PATTERN_CONFIGURATION_SUPPORTED(x) ((x)[30] & 0x10) 1247 #define HCI_SET_TRIG_CLK_CAP_SUPPORTED(x) ((x)[30] & 0x20) 1248 #define HCI_TRUNCATED_PAGE_SUPPORTED(x) ((x)[30] & 0x40) 1249 #define HCI_TRUNCATED_PAGE_CANCEL_SUPPORTED(x) ((x)[30] & 0x80) 1250 1251 #define HCI_SET_CONLESS_PERIPHERAL_BRCST_SUPPORTED(x) ((x)[31] & 0x01) 1252 #define HCI_SET_CONLESS_PERIPHERAL_BRCST_RECEIVE_SUPPORTED(x) ((x)[31] & 0x02) 1253 #define HCI_START_SYNC_TRAIN_SUPPORTED(x) ((x)[31] & 0x04) 1254 #define HCI_RECEIVE_SYNC_TRAIN_SUPPORTED(x) ((x)[31] & 0x08) 1255 #define HCI_SET_RESERVED_LT_ADDR_SUPPORTED(x) ((x)[31] & 0x10) 1256 #define HCI_DELETE_RESERVED_LT_ADDR_SUPPORTED(x) ((x)[31] & 0x20) 1257 #define HCI_SET_CONLESS_PERIPHERAL_BRCST_DATA_SUPPORTED(x) ((x)[31] & 0x40) 1258 #define HCI_READ_SYNC_TRAIN_PARAM_SUPPORTED(x) ((x)[31] & 0x80) 1259 1260 #define HCI_WRITE_SYNC_TRAIN_PARAM_SUPPORTED(x) ((x)[32] & 0x01) 1261 #define HCI_REMOTE_OOB_EXTENDED_DATA_REQUEST_REPLY_SUPPORTED(x) ((x)[32] & 0x02) 1262 #define HCI_READ_SECURE_CONNS_SUPPORT_SUPPORTED(x) ((x)[32] & 0x04) 1263 #define HCI_WRITE_SECURE_CONNS_SUPPORT_SUPPORTED(x) ((x)[32] & 0x08) 1264 #define HCI_READ_AUTHENT_PAYLOAD_TOUT_SUPPORTED(x) ((x)[32] & 0x10) 1265 #define HCI_WRITE_AUTHENT_PAYLOAD_TOUT_SUPPORTED(x) ((x)[32] & 0x20) 1266 #define HCI_READ_LOCAL_OOB_EXTENDED_DATA_SUPPORTED(x) ((x)[32] & 0x40) 1267 #define HCI_WRITE_SECURE_CONNECTIONS_TEST_MODE_SUPPORTED(x) ((x)[32] & 0x80) 1268 1269 #define HCI_LE_RC_CONN_PARAM_UPD_RPY_SUPPORTED(x) ((x)[33] & 0x10) 1270 #define HCI_LE_RC_CONN_PARAM_UPD_NEG_RPY_SUPPORTED(x) ((x)[33] & 0x20) 1271 1272 #define HCI_LE_READ_PHY_SUPPORTED(x) ((x)[35] & 0x10) 1273 #define HCI_LE_SET_DEFAULT_PHY_SUPPORTED(x) ((x)[35] & 0x20) 1274 #define HCI_LE_SET_PHY_SUPPORTED(x) ((x)[35] & 0x40) 1275 #define HCI_LE_ENH_RX_TEST_SUPPORTED(x) ((x)[35] & 0x80) 1276 1277 #define HCI_LE_ENH_TX_TEST_SUPPORTED(x) ((x)[36] & 0x01) 1278 1279 #define HCI_LE_SET_PRIVACY_MODE_SUPPORTED(x) ((x)[39] & 0x04) 1280 1281 #define HCI_LE_SET_HOST_FEATURE_SUPPORTED(x) ((x)[44] & 0x02) 1282 1283 #define HCI_CONFIGURE_DATA_PATH_SUPPORTED(x) ((x)[45] & 0x20) 1284 1285 #endif 1286