| 1 |
|
| 2 | |
| 3 | BlueZ - Bluetooth protocol stack for Linux
|
| 4 |
|
| 5 | Copyright (C) 2010 Nokia Corporation
|
| 6 | Copyright (C) 2011-2012 Intel Corporation
|
| 7 |
|
| 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
| 9 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 10 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
|
| 11 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
|
| 12 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
|
| 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
| 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
| 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
| 16 |
|
| 17 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
|
| 18 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
|
| 19 | SOFTWARE IS DISCLAIMED.
|
| 20 |
|
| 21 |
|
| 22 | #define MGMT_INDEX_NONE 0xFFFF
|
| 23 |
|
| 24 | #define MGMT_STATUS_SUCCESS 0x00
|
| 25 | #define MGMT_STATUS_UNKNOWN_COMMAND 0x01
|
| 26 | #define MGMT_STATUS_NOT_CONNECTED 0x02
|
| 27 | #define MGMT_STATUS_FAILED 0x03
|
| 28 | #define MGMT_STATUS_CONNECT_FAILED 0x04
|
| 29 | #define MGMT_STATUS_AUTH_FAILED 0x05
|
| 30 | #define MGMT_STATUS_NOT_PAIRED 0x06
|
| 31 | #define MGMT_STATUS_NO_RESOURCES 0x07
|
| 32 | #define MGMT_STATUS_TIMEOUT 0x08
|
| 33 | #define MGMT_STATUS_ALREADY_CONNECTED 0x09
|
| 34 | #define MGMT_STATUS_BUSY 0x0a
|
| 35 | #define MGMT_STATUS_REJECTED 0x0b
|
| 36 | #define MGMT_STATUS_NOT_SUPPORTED 0x0c
|
| 37 | #define MGMT_STATUS_INVALID_PARAMS 0x0d
|
| 38 | #define MGMT_STATUS_DISCONNECTED 0x0e
|
| 39 | #define MGMT_STATUS_NOT_POWERED 0x0f
|
| 40 | #define MGMT_STATUS_CANCELLED 0x10
|
| 41 | #define MGMT_STATUS_INVALID_INDEX 0x11
|
| 42 | #define MGMT_STATUS_RFKILLED 0x12
|
| 43 | #define MGMT_STATUS_ALREADY_PAIRED 0x13
|
| 44 | #define MGMT_STATUS_PERMISSION_DENIED 0x14
|
| 45 |
|
| 46 | struct mgmt_hdr {
|
| 47 | __le16 opcode;
|
| 48 | __le16 index;
|
| 49 | __le16 len;
|
| 50 | } __packed;
|
| 51 |
|
| 52 | struct mgmt_tlv {
|
| 53 |
|
| 54 | __struct_group(mgmt_tlv_hdr, __hdr, __packed,
|
| 55 | __le16 type;
|
| 56 | __u8 length;
|
| 57 | );
|
| 58 | __u8 value[];
|
| 59 | } __packed;
|
| 60 | static_assert(offsetof(struct mgmt_tlv, value) == sizeof(struct mgmt_tlv_hdr),
|
| 61 | "struct member likely outside of __struct_group()");
|
| 62 |
|
| 63 | struct mgmt_addr_info {
|
| 64 | bdaddr_t bdaddr;
|
| 65 | __u8 type;
|
| 66 | } __packed;
|
| 67 | #define MGMT_ADDR_INFO_SIZE 7
|
| 68 |
|
| 69 | #define MGMT_OP_READ_VERSION 0x0001
|
| 70 | #define MGMT_READ_VERSION_SIZE 0
|
| 71 | struct mgmt_rp_read_version {
|
| 72 | __u8 version;
|
| 73 | __le16 revision;
|
| 74 | } __packed;
|
| 75 |
|
| 76 | #define MGMT_OP_READ_COMMANDS 0x0002
|
| 77 | #define MGMT_READ_COMMANDS_SIZE 0
|
| 78 | struct mgmt_rp_read_commands {
|
| 79 | __le16 num_commands;
|
| 80 | __le16 num_events;
|
| 81 | __le16 opcodes[];
|
| 82 | } __packed;
|
| 83 |
|
| 84 | #define MGMT_OP_READ_INDEX_LIST 0x0003
|
| 85 | #define MGMT_READ_INDEX_LIST_SIZE 0
|
| 86 | struct mgmt_rp_read_index_list {
|
| 87 | __le16 num_controllers;
|
| 88 | __le16 index[];
|
| 89 | } __packed;
|
| 90 |
|
| 91 | |
| 92 | * are always guaranteed to be nul-terminated
|
| 93 | #define MGMT_MAX_NAME_LENGTH (HCI_MAX_NAME_LENGTH + 1)
|
| 94 | #define MGMT_MAX_SHORT_NAME_LENGTH (HCI_MAX_SHORT_NAME_LENGTH + 1)
|
| 95 |
|
| 96 | #define MGMT_SETTING_POWERED BIT(0)
|
| 97 | #define MGMT_SETTING_CONNECTABLE BIT(1)
|
| 98 | #define MGMT_SETTING_FAST_CONNECTABLE BIT(2)
|
| 99 | #define MGMT_SETTING_DISCOVERABLE BIT(3)
|
| 100 | #define MGMT_SETTING_BONDABLE BIT(4)
|
| 101 | #define MGMT_SETTING_LINK_SECURITY BIT(5)
|
| 102 | #define MGMT_SETTING_SSP BIT(6)
|
| 103 | #define MGMT_SETTING_BREDR BIT(7)
|
| 104 | #define MGMT_SETTING_HS BIT(8)
|
| 105 | #define MGMT_SETTING_LE BIT(9)
|
| 106 | #define MGMT_SETTING_ADVERTISING BIT(10)
|
| 107 | #define MGMT_SETTING_SECURE_CONN BIT(11)
|
| 108 | #define MGMT_SETTING_DEBUG_KEYS BIT(12)
|
| 109 | #define MGMT_SETTING_PRIVACY BIT(13)
|
| 110 | #define MGMT_SETTING_CONFIGURATION BIT(14)
|
| 111 | #define MGMT_SETTING_STATIC_ADDRESS BIT(15)
|
| 112 | #define MGMT_SETTING_PHY_CONFIGURATION BIT(16)
|
| 113 | #define MGMT_SETTING_WIDEBAND_SPEECH BIT(17)
|
| 114 | #define MGMT_SETTING_CIS_CENTRAL BIT(18)
|
| 115 | #define MGMT_SETTING_CIS_PERIPHERAL BIT(19)
|
| 116 | #define MGMT_SETTING_ISO_BROADCASTER BIT(20)
|
| 117 | #define MGMT_SETTING_ISO_SYNC_RECEIVER BIT(21)
|
| 118 | #define MGMT_SETTING_LL_PRIVACY BIT(22)
|
| 119 | #define MGMT_SETTING_PAST_SENDER BIT(23)
|
| 120 | #define MGMT_SETTING_PAST_RECEIVER BIT(24)
|
| 121 | #define MGMT_SETTING_SCI BIT(25)
|
| 122 |
|
| 123 | #define MGMT_OP_READ_INFO 0x0004
|
| 124 | #define MGMT_READ_INFO_SIZE 0
|
| 125 | struct mgmt_rp_read_info {
|
| 126 | bdaddr_t bdaddr;
|
| 127 | __u8 version;
|
| 128 | __le16 manufacturer;
|
| 129 | __le32 supported_settings;
|
| 130 | __le32 current_settings;
|
| 131 | __u8 dev_class[3];
|
| 132 | __u8 name[MGMT_MAX_NAME_LENGTH];
|
| 133 | __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH];
|
| 134 | } __packed;
|
| 135 |
|
| 136 | struct mgmt_mode {
|
| 137 | __u8 val;
|
| 138 | } __packed;
|
| 139 |
|
| 140 | #define MGMT_SETTING_SIZE 1
|
| 141 |
|
| 142 | #define MGMT_OP_SET_POWERED 0x0005
|
| 143 |
|
| 144 | #define MGMT_OP_SET_DISCOVERABLE 0x0006
|
| 145 | struct mgmt_cp_set_discoverable {
|
| 146 | __u8 val;
|
| 147 | __le16 timeout;
|
| 148 | } __packed;
|
| 149 | #define MGMT_SET_DISCOVERABLE_SIZE 3
|
| 150 |
|
| 151 | #define MGMT_OP_SET_CONNECTABLE 0x0007
|
| 152 |
|
| 153 | #define MGMT_OP_SET_FAST_CONNECTABLE 0x0008
|
| 154 |
|
| 155 | #define MGMT_OP_SET_BONDABLE 0x0009
|
| 156 |
|
| 157 | #define MGMT_OP_SET_LINK_SECURITY 0x000A
|
| 158 |
|
| 159 | #define MGMT_OP_SET_SSP 0x000B
|
| 160 |
|
| 161 | #define MGMT_OP_SET_HS 0x000C
|
| 162 |
|
| 163 | #define MGMT_OP_SET_LE 0x000D
|
| 164 | #define MGMT_OP_SET_DEV_CLASS 0x000E
|
| 165 | struct mgmt_cp_set_dev_class {
|
| 166 | __u8 major;
|
| 167 | __u8 minor;
|
| 168 | } __packed;
|
| 169 | #define MGMT_SET_DEV_CLASS_SIZE 2
|
| 170 |
|
| 171 | #define MGMT_OP_SET_LOCAL_NAME 0x000F
|
| 172 | struct mgmt_cp_set_local_name {
|
| 173 | __u8 name[MGMT_MAX_NAME_LENGTH];
|
| 174 | __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH];
|
| 175 | } __packed;
|
| 176 | #define MGMT_SET_LOCAL_NAME_SIZE 260
|
| 177 |
|
| 178 | #define MGMT_OP_ADD_UUID 0x0010
|
| 179 | struct mgmt_cp_add_uuid {
|
| 180 | __u8 uuid[16];
|
| 181 | __u8 svc_hint;
|
| 182 | } __packed;
|
| 183 | #define MGMT_ADD_UUID_SIZE 17
|
| 184 |
|
| 185 | #define MGMT_OP_REMOVE_UUID 0x0011
|
| 186 | struct mgmt_cp_remove_uuid {
|
| 187 | __u8 uuid[16];
|
| 188 | } __packed;
|
| 189 | #define MGMT_REMOVE_UUID_SIZE 16
|
| 190 |
|
| 191 | struct mgmt_link_key_info {
|
| 192 | struct mgmt_addr_info addr;
|
| 193 | __u8 type;
|
| 194 | __u8 val[16];
|
| 195 | __u8 pin_len;
|
| 196 | } __packed;
|
| 197 |
|
| 198 | #define MGMT_OP_LOAD_LINK_KEYS 0x0012
|
| 199 | struct mgmt_cp_load_link_keys {
|
| 200 | __u8 debug_keys;
|
| 201 | __le16 key_count;
|
| 202 | struct mgmt_link_key_info keys[];
|
| 203 | } __packed;
|
| 204 | #define MGMT_LOAD_LINK_KEYS_SIZE 3
|
| 205 |
|
| 206 | #define MGMT_LTK_UNAUTHENTICATED 0x00
|
| 207 | #define MGMT_LTK_AUTHENTICATED 0x01
|
| 208 | #define MGMT_LTK_P256_UNAUTH 0x02
|
| 209 | #define MGMT_LTK_P256_AUTH 0x03
|
| 210 | #define MGMT_LTK_P256_DEBUG 0x04
|
| 211 |
|
| 212 | struct mgmt_ltk_info {
|
| 213 | struct mgmt_addr_info addr;
|
| 214 | __u8 type;
|
| 215 | __u8 initiator;
|
| 216 | __u8 enc_size;
|
| 217 | __le16 ediv;
|
| 218 | __le64 rand;
|
| 219 | __u8 val[16];
|
| 220 | } __packed;
|
| 221 |
|
| 222 | #define MGMT_OP_LOAD_LONG_TERM_KEYS 0x0013
|
| 223 | struct mgmt_cp_load_long_term_keys {
|
| 224 | __le16 key_count;
|
| 225 | struct mgmt_ltk_info keys[];
|
| 226 | } __packed;
|
| 227 | #define MGMT_LOAD_LONG_TERM_KEYS_SIZE 2
|
| 228 |
|
| 229 | #define MGMT_OP_DISCONNECT 0x0014
|
| 230 | struct mgmt_cp_disconnect {
|
| 231 | struct mgmt_addr_info addr;
|
| 232 | } __packed;
|
| 233 | #define MGMT_DISCONNECT_SIZE MGMT_ADDR_INFO_SIZE
|
| 234 | struct mgmt_rp_disconnect {
|
| 235 | struct mgmt_addr_info addr;
|
| 236 | } __packed;
|
| 237 |
|
| 238 | #define MGMT_OP_GET_CONNECTIONS 0x0015
|
| 239 | #define MGMT_GET_CONNECTIONS_SIZE 0
|
| 240 | struct mgmt_rp_get_connections {
|
| 241 | __le16 conn_count;
|
| 242 | struct mgmt_addr_info addr[];
|
| 243 | } __packed;
|
| 244 |
|
| 245 | #define MGMT_OP_PIN_CODE_REPLY 0x0016
|
| 246 | struct mgmt_cp_pin_code_reply {
|
| 247 | struct mgmt_addr_info addr;
|
| 248 | __u8 pin_len;
|
| 249 | __u8 pin_code[16];
|
| 250 | } __packed;
|
| 251 | #define MGMT_PIN_CODE_REPLY_SIZE (MGMT_ADDR_INFO_SIZE + 17)
|
| 252 | struct mgmt_rp_pin_code_reply {
|
| 253 | struct mgmt_addr_info addr;
|
| 254 | } __packed;
|
| 255 |
|
| 256 | #define MGMT_OP_PIN_CODE_NEG_REPLY 0x0017
|
| 257 | struct mgmt_cp_pin_code_neg_reply {
|
| 258 | struct mgmt_addr_info addr;
|
| 259 | } __packed;
|
| 260 | #define MGMT_PIN_CODE_NEG_REPLY_SIZE MGMT_ADDR_INFO_SIZE
|
| 261 |
|
| 262 | #define MGMT_OP_SET_IO_CAPABILITY 0x0018
|
| 263 | struct mgmt_cp_set_io_capability {
|
| 264 | __u8 io_capability;
|
| 265 | } __packed;
|
| 266 | #define MGMT_SET_IO_CAPABILITY_SIZE 1
|
| 267 |
|
| 268 | #define MGMT_OP_PAIR_DEVICE 0x0019
|
| 269 | struct mgmt_cp_pair_device {
|
| 270 | struct mgmt_addr_info addr;
|
| 271 | __u8 io_cap;
|
| 272 | } __packed;
|
| 273 | #define MGMT_PAIR_DEVICE_SIZE (MGMT_ADDR_INFO_SIZE + 1)
|
| 274 | struct mgmt_rp_pair_device {
|
| 275 | struct mgmt_addr_info addr;
|
| 276 | } __packed;
|
| 277 |
|
| 278 | #define MGMT_OP_CANCEL_PAIR_DEVICE 0x001A
|
| 279 | #define MGMT_CANCEL_PAIR_DEVICE_SIZE MGMT_ADDR_INFO_SIZE
|
| 280 |
|
| 281 | #define MGMT_OP_UNPAIR_DEVICE 0x001B
|
| 282 | struct mgmt_cp_unpair_device {
|
| 283 | struct mgmt_addr_info addr;
|
| 284 | __u8 disconnect;
|
| 285 | } __packed;
|
| 286 | #define MGMT_UNPAIR_DEVICE_SIZE (MGMT_ADDR_INFO_SIZE + 1)
|
| 287 | struct mgmt_rp_unpair_device {
|
| 288 | struct mgmt_addr_info addr;
|
| 289 | };
|
| 290 |
|
| 291 | #define MGMT_OP_USER_CONFIRM_REPLY 0x001C
|
| 292 | struct mgmt_cp_user_confirm_reply {
|
| 293 | struct mgmt_addr_info addr;
|
| 294 | } __packed;
|
| 295 | #define MGMT_USER_CONFIRM_REPLY_SIZE MGMT_ADDR_INFO_SIZE
|
| 296 | struct mgmt_rp_user_confirm_reply {
|
| 297 | struct mgmt_addr_info addr;
|
| 298 | } __packed;
|
| 299 |
|
| 300 | #define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x001D
|
| 301 | struct mgmt_cp_user_confirm_neg_reply {
|
| 302 | struct mgmt_addr_info addr;
|
| 303 | } __packed;
|
| 304 | #define MGMT_USER_CONFIRM_NEG_REPLY_SIZE MGMT_ADDR_INFO_SIZE
|
| 305 |
|
| 306 | #define MGMT_OP_USER_PASSKEY_REPLY 0x001E
|
| 307 | struct mgmt_cp_user_passkey_reply {
|
| 308 | struct mgmt_addr_info addr;
|
| 309 | __le32 passkey;
|
| 310 | } __packed;
|
| 311 | #define MGMT_USER_PASSKEY_REPLY_SIZE (MGMT_ADDR_INFO_SIZE + 4)
|
| 312 | struct mgmt_rp_user_passkey_reply {
|
| 313 | struct mgmt_addr_info addr;
|
| 314 | } __packed;
|
| 315 |
|
| 316 | #define MGMT_OP_USER_PASSKEY_NEG_REPLY 0x001F
|
| 317 | struct mgmt_cp_user_passkey_neg_reply {
|
| 318 | struct mgmt_addr_info addr;
|
| 319 | } __packed;
|
| 320 | #define MGMT_USER_PASSKEY_NEG_REPLY_SIZE MGMT_ADDR_INFO_SIZE
|
| 321 |
|
| 322 | #define MGMT_OP_READ_LOCAL_OOB_DATA 0x0020
|
| 323 | #define MGMT_READ_LOCAL_OOB_DATA_SIZE 0
|
| 324 | struct mgmt_rp_read_local_oob_data {
|
| 325 | __u8 hash192[16];
|
| 326 | __u8 rand192[16];
|
| 327 | __u8 hash256[16];
|
| 328 | __u8 rand256[16];
|
| 329 | } __packed;
|
| 330 |
|
| 331 | #define MGMT_OP_ADD_REMOTE_OOB_DATA 0x0021
|
| 332 | struct mgmt_cp_add_remote_oob_data {
|
| 333 | struct mgmt_addr_info addr;
|
| 334 | __u8 hash[16];
|
| 335 | __u8 rand[16];
|
| 336 | } __packed;
|
| 337 | #define MGMT_ADD_REMOTE_OOB_DATA_SIZE (MGMT_ADDR_INFO_SIZE + 32)
|
| 338 | struct mgmt_cp_add_remote_oob_ext_data {
|
| 339 | struct mgmt_addr_info addr;
|
| 340 | __u8 hash192[16];
|
| 341 | __u8 rand192[16];
|
| 342 | __u8 hash256[16];
|
| 343 | __u8 rand256[16];
|
| 344 | } __packed;
|
| 345 | #define MGMT_ADD_REMOTE_OOB_EXT_DATA_SIZE (MGMT_ADDR_INFO_SIZE + 64)
|
| 346 |
|
| 347 | #define MGMT_OP_REMOVE_REMOTE_OOB_DATA 0x0022
|
| 348 | struct mgmt_cp_remove_remote_oob_data {
|
| 349 | struct mgmt_addr_info addr;
|
| 350 | } __packed;
|
| 351 | #define MGMT_REMOVE_REMOTE_OOB_DATA_SIZE MGMT_ADDR_INFO_SIZE
|
| 352 |
|
| 353 | #define MGMT_OP_START_DISCOVERY 0x0023
|
| 354 | struct mgmt_cp_start_discovery {
|
| 355 | __u8 type;
|
| 356 | } __packed;
|
| 357 | #define MGMT_START_DISCOVERY_SIZE 1
|
| 358 |
|
| 359 | #define MGMT_OP_STOP_DISCOVERY 0x0024
|
| 360 | struct mgmt_cp_stop_discovery {
|
| 361 | __u8 type;
|
| 362 | } __packed;
|
| 363 | #define MGMT_STOP_DISCOVERY_SIZE 1
|
| 364 |
|
| 365 | #define MGMT_OP_CONFIRM_NAME 0x0025
|
| 366 | struct mgmt_cp_confirm_name {
|
| 367 | struct mgmt_addr_info addr;
|
| 368 | __u8 name_known;
|
| 369 | } __packed;
|
| 370 | #define MGMT_CONFIRM_NAME_SIZE (MGMT_ADDR_INFO_SIZE + 1)
|
| 371 | struct mgmt_rp_confirm_name {
|
| 372 | struct mgmt_addr_info addr;
|
| 373 | } __packed;
|
| 374 |
|
| 375 | #define MGMT_OP_BLOCK_DEVICE 0x0026
|
| 376 | struct mgmt_cp_block_device {
|
| 377 | struct mgmt_addr_info addr;
|
| 378 | } __packed;
|
| 379 | #define MGMT_BLOCK_DEVICE_SIZE MGMT_ADDR_INFO_SIZE
|
| 380 |
|
| 381 | #define MGMT_OP_UNBLOCK_DEVICE 0x0027
|
| 382 | struct mgmt_cp_unblock_device {
|
| 383 | struct mgmt_addr_info addr;
|
| 384 | } __packed;
|
| 385 | #define MGMT_UNBLOCK_DEVICE_SIZE MGMT_ADDR_INFO_SIZE
|
| 386 |
|
| 387 | #define MGMT_OP_SET_DEVICE_ID 0x0028
|
| 388 | struct mgmt_cp_set_device_id {
|
| 389 | __le16 source;
|
| 390 | __le16 vendor;
|
| 391 | __le16 product;
|
| 392 | __le16 version;
|
| 393 | } __packed;
|
| 394 | #define MGMT_SET_DEVICE_ID_SIZE 8
|
| 395 |
|
| 396 | #define MGMT_OP_SET_ADVERTISING 0x0029
|
| 397 |
|
| 398 | #define MGMT_OP_SET_BREDR 0x002A
|
| 399 |
|
| 400 | #define MGMT_OP_SET_STATIC_ADDRESS 0x002B
|
| 401 | struct mgmt_cp_set_static_address {
|
| 402 | bdaddr_t bdaddr;
|
| 403 | } __packed;
|
| 404 | #define MGMT_SET_STATIC_ADDRESS_SIZE 6
|
| 405 |
|
| 406 | #define MGMT_OP_SET_SCAN_PARAMS 0x002C
|
| 407 | struct mgmt_cp_set_scan_params {
|
| 408 | __le16 interval;
|
| 409 | __le16 window;
|
| 410 | } __packed;
|
| 411 | #define MGMT_SET_SCAN_PARAMS_SIZE 4
|
| 412 |
|
| 413 | #define MGMT_OP_SET_SECURE_CONN 0x002D
|
| 414 |
|
| 415 | #define MGMT_OP_SET_DEBUG_KEYS 0x002E
|
| 416 |
|
| 417 | #define MGMT_OP_SET_PRIVACY 0x002F
|
| 418 | struct mgmt_cp_set_privacy {
|
| 419 | __u8 privacy;
|
| 420 | __u8 irk[16];
|
| 421 | } __packed;
|
| 422 | #define MGMT_SET_PRIVACY_SIZE 17
|
| 423 |
|
| 424 | struct mgmt_irk_info {
|
| 425 | struct mgmt_addr_info addr;
|
| 426 | __u8 val[16];
|
| 427 | } __packed;
|
| 428 |
|
| 429 | #define MGMT_OP_LOAD_IRKS 0x0030
|
| 430 | struct mgmt_cp_load_irks {
|
| 431 | __le16 irk_count;
|
| 432 | struct mgmt_irk_info irks[];
|
| 433 | } __packed;
|
| 434 | #define MGMT_LOAD_IRKS_SIZE 2
|
| 435 |
|
| 436 | #define MGMT_OP_GET_CONN_INFO 0x0031
|
| 437 | struct mgmt_cp_get_conn_info {
|
| 438 | struct mgmt_addr_info addr;
|
| 439 | } __packed;
|
| 440 | #define MGMT_GET_CONN_INFO_SIZE MGMT_ADDR_INFO_SIZE
|
| 441 | struct mgmt_rp_get_conn_info {
|
| 442 | struct mgmt_addr_info addr;
|
| 443 | __s8 rssi;
|
| 444 | __s8 tx_power;
|
| 445 | __s8 max_tx_power;
|
| 446 | } __packed;
|
| 447 |
|
| 448 | #define MGMT_OP_GET_CLOCK_INFO 0x0032
|
| 449 | struct mgmt_cp_get_clock_info {
|
| 450 | struct mgmt_addr_info addr;
|
| 451 | } __packed;
|
| 452 | #define MGMT_GET_CLOCK_INFO_SIZE MGMT_ADDR_INFO_SIZE
|
| 453 | struct mgmt_rp_get_clock_info {
|
| 454 | struct mgmt_addr_info addr;
|
| 455 | __le32 local_clock;
|
| 456 | __le32 piconet_clock;
|
| 457 | __le16 accuracy;
|
| 458 | } __packed;
|
| 459 |
|
| 460 | #define MGMT_OP_ADD_DEVICE 0x0033
|
| 461 | struct mgmt_cp_add_device {
|
| 462 | struct mgmt_addr_info addr;
|
| 463 | __u8 action;
|
| 464 | } __packed;
|
| 465 | #define MGMT_ADD_DEVICE_SIZE (MGMT_ADDR_INFO_SIZE + 1)
|
| 466 |
|
| 467 | #define MGMT_OP_REMOVE_DEVICE 0x0034
|
| 468 | struct mgmt_cp_remove_device {
|
| 469 | struct mgmt_addr_info addr;
|
| 470 | } __packed;
|
| 471 | #define MGMT_REMOVE_DEVICE_SIZE MGMT_ADDR_INFO_SIZE
|
| 472 |
|
| 473 | struct mgmt_conn_param {
|
| 474 | struct mgmt_addr_info addr;
|
| 475 | __le16 min_interval;
|
| 476 | __le16 max_interval;
|
| 477 | __le16 latency;
|
| 478 | __le16 timeout;
|
| 479 | } __packed;
|
| 480 |
|
| 481 | #define MGMT_OP_LOAD_CONN_PARAM 0x0035
|
| 482 | struct mgmt_cp_load_conn_param {
|
| 483 | __le16 param_count;
|
| 484 | struct mgmt_conn_param params[];
|
| 485 | } __packed;
|
| 486 | #define MGMT_LOAD_CONN_PARAM_SIZE 2
|
| 487 |
|
| 488 | #define MGMT_OP_READ_UNCONF_INDEX_LIST 0x0036
|
| 489 | #define MGMT_READ_UNCONF_INDEX_LIST_SIZE 0
|
| 490 | struct mgmt_rp_read_unconf_index_list {
|
| 491 | __le16 num_controllers;
|
| 492 | __le16 index[];
|
| 493 | } __packed;
|
| 494 |
|
| 495 | #define MGMT_OPTION_EXTERNAL_CONFIG 0x00000001
|
| 496 | #define MGMT_OPTION_PUBLIC_ADDRESS 0x00000002
|
| 497 |
|
| 498 | #define MGMT_OP_READ_CONFIG_INFO 0x0037
|
| 499 | #define MGMT_READ_CONFIG_INFO_SIZE 0
|
| 500 | struct mgmt_rp_read_config_info {
|
| 501 | __le16 manufacturer;
|
| 502 | __le32 supported_options;
|
| 503 | __le32 missing_options;
|
| 504 | } __packed;
|
| 505 |
|
| 506 | #define MGMT_OP_SET_EXTERNAL_CONFIG 0x0038
|
| 507 | struct mgmt_cp_set_external_config {
|
| 508 | __u8 config;
|
| 509 | } __packed;
|
| 510 | #define MGMT_SET_EXTERNAL_CONFIG_SIZE 1
|
| 511 |
|
| 512 | #define MGMT_OP_SET_PUBLIC_ADDRESS 0x0039
|
| 513 | struct mgmt_cp_set_public_address {
|
| 514 | bdaddr_t bdaddr;
|
| 515 | } __packed;
|
| 516 | #define MGMT_SET_PUBLIC_ADDRESS_SIZE 6
|
| 517 |
|
| 518 | #define MGMT_OP_START_SERVICE_DISCOVERY 0x003A
|
| 519 | struct mgmt_cp_start_service_discovery {
|
| 520 | __u8 type;
|
| 521 | __s8 rssi;
|
| 522 | __le16 uuid_count;
|
| 523 | __u8 uuids[][16];
|
| 524 | } __packed;
|
| 525 | #define MGMT_START_SERVICE_DISCOVERY_SIZE 4
|
| 526 |
|
| 527 | #define MGMT_OP_READ_LOCAL_OOB_EXT_DATA 0x003B
|
| 528 | struct mgmt_cp_read_local_oob_ext_data {
|
| 529 | __u8 type;
|
| 530 | } __packed;
|
| 531 | #define MGMT_READ_LOCAL_OOB_EXT_DATA_SIZE 1
|
| 532 | struct mgmt_rp_read_local_oob_ext_data {
|
| 533 | __u8 type;
|
| 534 | __le16 eir_len;
|
| 535 | __u8 eir[];
|
| 536 | } __packed;
|
| 537 |
|
| 538 | #define MGMT_OP_READ_EXT_INDEX_LIST 0x003C
|
| 539 | #define MGMT_READ_EXT_INDEX_LIST_SIZE 0
|
| 540 | struct mgmt_rp_read_ext_index_list {
|
| 541 | __le16 num_controllers;
|
| 542 | struct {
|
| 543 | __le16 index;
|
| 544 | __u8 type;
|
| 545 | __u8 bus;
|
| 546 | } entry[];
|
| 547 | } __packed;
|
| 548 |
|
| 549 | #define MGMT_OP_READ_ADV_FEATURES 0x0003D
|
| 550 | #define MGMT_READ_ADV_FEATURES_SIZE 0
|
| 551 | struct mgmt_rp_read_adv_features {
|
| 552 | __le32 supported_flags;
|
| 553 | __u8 max_adv_data_len;
|
| 554 | __u8 max_scan_rsp_len;
|
| 555 | __u8 max_instances;
|
| 556 | __u8 num_instances;
|
| 557 | __u8 instance[];
|
| 558 | } __packed;
|
| 559 |
|
| 560 | #define MGMT_OP_ADD_ADVERTISING 0x003E
|
| 561 | struct mgmt_cp_add_advertising {
|
| 562 | __u8 instance;
|
| 563 | __le32 flags;
|
| 564 | __le16 duration;
|
| 565 | __le16 timeout;
|
| 566 | __u8 adv_data_len;
|
| 567 | __u8 scan_rsp_len;
|
| 568 | __u8 data[];
|
| 569 | } __packed;
|
| 570 | #define MGMT_ADD_ADVERTISING_SIZE 11
|
| 571 | struct mgmt_rp_add_advertising {
|
| 572 | __u8 instance;
|
| 573 | } __packed;
|
| 574 |
|
| 575 | #define MGMT_ADV_FLAG_CONNECTABLE BIT(0)
|
| 576 | #define MGMT_ADV_FLAG_DISCOV BIT(1)
|
| 577 | #define MGMT_ADV_FLAG_LIMITED_DISCOV BIT(2)
|
| 578 | #define MGMT_ADV_FLAG_MANAGED_FLAGS BIT(3)
|
| 579 | #define MGMT_ADV_FLAG_TX_POWER BIT(4)
|
| 580 | #define MGMT_ADV_FLAG_APPEARANCE BIT(5)
|
| 581 | #define MGMT_ADV_FLAG_LOCAL_NAME BIT(6)
|
| 582 | #define MGMT_ADV_FLAG_SEC_1M BIT(7)
|
| 583 | #define MGMT_ADV_FLAG_SEC_2M BIT(8)
|
| 584 | #define MGMT_ADV_FLAG_SEC_CODED BIT(9)
|
| 585 | #define MGMT_ADV_FLAG_CAN_SET_TX_POWER BIT(10)
|
| 586 | #define MGMT_ADV_FLAG_HW_OFFLOAD BIT(11)
|
| 587 | #define MGMT_ADV_PARAM_DURATION BIT(12)
|
| 588 | #define MGMT_ADV_PARAM_TIMEOUT BIT(13)
|
| 589 | #define MGMT_ADV_PARAM_INTERVALS BIT(14)
|
| 590 | #define MGMT_ADV_PARAM_TX_POWER BIT(15)
|
| 591 | #define MGMT_ADV_PARAM_SCAN_RSP BIT(16)
|
| 592 |
|
| 593 | #define MGMT_ADV_FLAG_SEC_MASK (MGMT_ADV_FLAG_SEC_1M | MGMT_ADV_FLAG_SEC_2M | \
|
| 594 | MGMT_ADV_FLAG_SEC_CODED)
|
| 595 |
|
| 596 | #define MGMT_OP_REMOVE_ADVERTISING 0x003F
|
| 597 | struct mgmt_cp_remove_advertising {
|
| 598 | __u8 instance;
|
| 599 | } __packed;
|
| 600 | #define MGMT_REMOVE_ADVERTISING_SIZE 1
|
| 601 | struct mgmt_rp_remove_advertising {
|
| 602 | __u8 instance;
|
| 603 | } __packed;
|
| 604 |
|
| 605 | #define MGMT_OP_GET_ADV_SIZE_INFO 0x0040
|
| 606 | struct mgmt_cp_get_adv_size_info {
|
| 607 | __u8 instance;
|
| 608 | __le32 flags;
|
| 609 | } __packed;
|
| 610 | #define MGMT_GET_ADV_SIZE_INFO_SIZE 5
|
| 611 | struct mgmt_rp_get_adv_size_info {
|
| 612 | __u8 instance;
|
| 613 | __le32 flags;
|
| 614 | __u8 max_adv_data_len;
|
| 615 | __u8 max_scan_rsp_len;
|
| 616 | } __packed;
|
| 617 |
|
| 618 | #define MGMT_OP_START_LIMITED_DISCOVERY 0x0041
|
| 619 |
|
| 620 | #define MGMT_OP_READ_EXT_INFO 0x0042
|
| 621 | #define MGMT_READ_EXT_INFO_SIZE 0
|
| 622 | struct mgmt_rp_read_ext_info {
|
| 623 | bdaddr_t bdaddr;
|
| 624 | __u8 version;
|
| 625 | __le16 manufacturer;
|
| 626 | __le32 supported_settings;
|
| 627 | __le32 current_settings;
|
| 628 | __le16 eir_len;
|
| 629 | __u8 eir[];
|
| 630 | } __packed;
|
| 631 |
|
| 632 | #define MGMT_OP_SET_APPEARANCE 0x0043
|
| 633 | struct mgmt_cp_set_appearance {
|
| 634 | __le16 appearance;
|
| 635 | } __packed;
|
| 636 | #define MGMT_SET_APPEARANCE_SIZE 2
|
| 637 |
|
| 638 | #define MGMT_OP_GET_PHY_CONFIGURATION 0x0044
|
| 639 | struct mgmt_rp_get_phy_configuration {
|
| 640 | __le32 supported_phys;
|
| 641 | __le32 configurable_phys;
|
| 642 | __le32 selected_phys;
|
| 643 | } __packed;
|
| 644 | #define MGMT_GET_PHY_CONFIGURATION_SIZE 0
|
| 645 |
|
| 646 | #define MGMT_PHY_BR_1M_1SLOT BIT(0)
|
| 647 | #define MGMT_PHY_BR_1M_3SLOT BIT(1)
|
| 648 | #define MGMT_PHY_BR_1M_5SLOT BIT(2)
|
| 649 | #define MGMT_PHY_EDR_2M_1SLOT BIT(3)
|
| 650 | #define MGMT_PHY_EDR_2M_3SLOT BIT(4)
|
| 651 | #define MGMT_PHY_EDR_2M_5SLOT BIT(5)
|
| 652 | #define MGMT_PHY_EDR_3M_1SLOT BIT(6)
|
| 653 | #define MGMT_PHY_EDR_3M_3SLOT BIT(7)
|
| 654 | #define MGMT_PHY_EDR_3M_5SLOT BIT(8)
|
| 655 | #define MGMT_PHY_LE_1M_TX BIT(9)
|
| 656 | #define MGMT_PHY_LE_1M_RX BIT(10)
|
| 657 | #define MGMT_PHY_LE_2M_TX BIT(11)
|
| 658 | #define MGMT_PHY_LE_2M_RX BIT(12)
|
| 659 | #define MGMT_PHY_LE_CODED_TX BIT(13)
|
| 660 | #define MGMT_PHY_LE_CODED_RX BIT(14)
|
| 661 |
|
| 662 | #define MGMT_PHY_BREDR_MASK (MGMT_PHY_BR_1M_1SLOT | MGMT_PHY_BR_1M_3SLOT | \
|
| 663 | MGMT_PHY_BR_1M_5SLOT | MGMT_PHY_EDR_2M_1SLOT | \
|
| 664 | MGMT_PHY_EDR_2M_3SLOT | MGMT_PHY_EDR_2M_5SLOT | \
|
| 665 | MGMT_PHY_EDR_3M_1SLOT | MGMT_PHY_EDR_3M_3SLOT | \
|
| 666 | MGMT_PHY_EDR_3M_5SLOT)
|
| 667 | #define MGMT_PHY_LE_MASK (MGMT_PHY_LE_1M_TX | MGMT_PHY_LE_1M_RX | \
|
| 668 | MGMT_PHY_LE_2M_TX | MGMT_PHY_LE_2M_RX | \
|
| 669 | MGMT_PHY_LE_CODED_TX | MGMT_PHY_LE_CODED_RX)
|
| 670 | #define MGMT_PHY_LE_TX_MASK (MGMT_PHY_LE_1M_TX | MGMT_PHY_LE_2M_TX | \
|
| 671 | MGMT_PHY_LE_CODED_TX)
|
| 672 | #define MGMT_PHY_LE_RX_MASK (MGMT_PHY_LE_1M_RX | MGMT_PHY_LE_2M_RX | \
|
| 673 | MGMT_PHY_LE_CODED_RX)
|
| 674 |
|
| 675 | #define MGMT_OP_SET_PHY_CONFIGURATION 0x0045
|
| 676 | struct mgmt_cp_set_phy_configuration {
|
| 677 | __le32 selected_phys;
|
| 678 | } __packed;
|
| 679 | #define MGMT_SET_PHY_CONFIGURATION_SIZE 4
|
| 680 |
|
| 681 | #define MGMT_OP_SET_BLOCKED_KEYS 0x0046
|
| 682 |
|
| 683 | #define HCI_BLOCKED_KEY_TYPE_LINKKEY 0x00
|
| 684 | #define HCI_BLOCKED_KEY_TYPE_LTK 0x01
|
| 685 | #define HCI_BLOCKED_KEY_TYPE_IRK 0x02
|
| 686 |
|
| 687 | struct mgmt_blocked_key_info {
|
| 688 | __u8 type;
|
| 689 | __u8 val[16];
|
| 690 | } __packed;
|
| 691 |
|
| 692 | struct mgmt_cp_set_blocked_keys {
|
| 693 | __le16 key_count;
|
| 694 | struct mgmt_blocked_key_info keys[];
|
| 695 | } __packed;
|
| 696 | #define MGMT_OP_SET_BLOCKED_KEYS_SIZE 2
|
| 697 |
|
| 698 | #define MGMT_OP_SET_WIDEBAND_SPEECH 0x0047
|
| 699 |
|
| 700 | #define MGMT_CAP_SEC_FLAGS 0x01
|
| 701 | #define MGMT_CAP_MAX_ENC_KEY_SIZE 0x02
|
| 702 | #define MGMT_CAP_SMP_MAX_ENC_KEY_SIZE 0x03
|
| 703 | #define MGMT_CAP_LE_TX_PWR 0x04
|
| 704 |
|
| 705 | #define MGMT_OP_READ_CONTROLLER_CAP 0x0048
|
| 706 | #define MGMT_READ_CONTROLLER_CAP_SIZE 0
|
| 707 | struct mgmt_rp_read_controller_cap {
|
| 708 | __le16 cap_len;
|
| 709 | __u8 cap[];
|
| 710 | } __packed;
|
| 711 |
|
| 712 | #define MGMT_OP_READ_EXP_FEATURES_INFO 0x0049
|
| 713 | #define MGMT_READ_EXP_FEATURES_INFO_SIZE 0
|
| 714 | struct mgmt_rp_read_exp_features_info {
|
| 715 | __le16 feature_count;
|
| 716 | struct {
|
| 717 | __u8 uuid[16];
|
| 718 | __le32 flags;
|
| 719 | } features[];
|
| 720 | } __packed;
|
| 721 |
|
| 722 | #define MGMT_OP_SET_EXP_FEATURE 0x004a
|
| 723 | struct mgmt_cp_set_exp_feature {
|
| 724 | __u8 uuid[16];
|
| 725 | __u8 param[];
|
| 726 | } __packed;
|
| 727 | #define MGMT_SET_EXP_FEATURE_SIZE 16
|
| 728 | struct mgmt_rp_set_exp_feature {
|
| 729 | __u8 uuid[16];
|
| 730 | __le32 flags;
|
| 731 | } __packed;
|
| 732 |
|
| 733 | #define MGMT_OP_READ_DEF_SYSTEM_CONFIG 0x004b
|
| 734 | #define MGMT_READ_DEF_SYSTEM_CONFIG_SIZE 0
|
| 735 |
|
| 736 | #define MGMT_OP_SET_DEF_SYSTEM_CONFIG 0x004c
|
| 737 | #define MGMT_SET_DEF_SYSTEM_CONFIG_SIZE 0
|
| 738 |
|
| 739 | #define MGMT_OP_READ_DEF_RUNTIME_CONFIG 0x004d
|
| 740 | #define MGMT_READ_DEF_RUNTIME_CONFIG_SIZE 0
|
| 741 |
|
| 742 | #define MGMT_OP_SET_DEF_RUNTIME_CONFIG 0x004e
|
| 743 | #define MGMT_SET_DEF_RUNTIME_CONFIG_SIZE 0
|
| 744 |
|
| 745 | #define MGMT_OP_GET_DEVICE_FLAGS 0x004F
|
| 746 | #define MGMT_GET_DEVICE_FLAGS_SIZE 7
|
| 747 | struct mgmt_cp_get_device_flags {
|
| 748 | struct mgmt_addr_info addr;
|
| 749 | } __packed;
|
| 750 | struct mgmt_rp_get_device_flags {
|
| 751 | struct mgmt_addr_info addr;
|
| 752 | __le32 supported_flags;
|
| 753 | __le32 current_flags;
|
| 754 | } __packed;
|
| 755 |
|
| 756 | #define MGMT_OP_SET_DEVICE_FLAGS 0x0050
|
| 757 | #define MGMT_SET_DEVICE_FLAGS_SIZE 11
|
| 758 | struct mgmt_cp_set_device_flags {
|
| 759 | struct mgmt_addr_info addr;
|
| 760 | __le32 current_flags;
|
| 761 | } __packed;
|
| 762 | struct mgmt_rp_set_device_flags {
|
| 763 | struct mgmt_addr_info addr;
|
| 764 | } __packed;
|
| 765 |
|
| 766 | #define MGMT_ADV_MONITOR_FEATURE_MASK_OR_PATTERNS BIT(0)
|
| 767 |
|
| 768 | #define MGMT_OP_READ_ADV_MONITOR_FEATURES 0x0051
|
| 769 | #define MGMT_READ_ADV_MONITOR_FEATURES_SIZE 0
|
| 770 | struct mgmt_rp_read_adv_monitor_features {
|
| 771 | __le32 supported_features;
|
| 772 | __le32 enabled_features;
|
| 773 | __le16 max_num_handles;
|
| 774 | __u8 max_num_patterns;
|
| 775 | __le16 num_handles;
|
| 776 | __le16 handles[];
|
| 777 | } __packed;
|
| 778 |
|
| 779 | struct mgmt_adv_pattern {
|
| 780 | __u8 ad_type;
|
| 781 | __u8 offset;
|
| 782 | __u8 length;
|
| 783 | __u8 value[HCI_MAX_AD_LENGTH];
|
| 784 | } __packed;
|
| 785 |
|
| 786 | #define MGMT_OP_ADD_ADV_PATTERNS_MONITOR 0x0052
|
| 787 | struct mgmt_cp_add_adv_patterns_monitor {
|
| 788 | __u8 pattern_count;
|
| 789 | struct mgmt_adv_pattern patterns[];
|
| 790 | } __packed;
|
| 791 | #define MGMT_ADD_ADV_PATTERNS_MONITOR_SIZE 1
|
| 792 | struct mgmt_rp_add_adv_patterns_monitor {
|
| 793 | __le16 monitor_handle;
|
| 794 | } __packed;
|
| 795 |
|
| 796 | #define MGMT_OP_REMOVE_ADV_MONITOR 0x0053
|
| 797 | struct mgmt_cp_remove_adv_monitor {
|
| 798 | __le16 monitor_handle;
|
| 799 | } __packed;
|
| 800 | #define MGMT_REMOVE_ADV_MONITOR_SIZE 2
|
| 801 | struct mgmt_rp_remove_adv_monitor {
|
| 802 | __le16 monitor_handle;
|
| 803 | } __packed;
|
| 804 |
|
| 805 | #define MGMT_OP_ADD_EXT_ADV_PARAMS 0x0054
|
| 806 | struct mgmt_cp_add_ext_adv_params {
|
| 807 | __u8 instance;
|
| 808 | __le32 flags;
|
| 809 | __le16 duration;
|
| 810 | __le16 timeout;
|
| 811 | __le32 min_interval;
|
| 812 | __le32 max_interval;
|
| 813 | __s8 tx_power;
|
| 814 | } __packed;
|
| 815 | #define MGMT_ADD_EXT_ADV_PARAMS_MIN_SIZE 18
|
| 816 | struct mgmt_rp_add_ext_adv_params {
|
| 817 | __u8 instance;
|
| 818 | __s8 tx_power;
|
| 819 | __u8 max_adv_data_len;
|
| 820 | __u8 max_scan_rsp_len;
|
| 821 | } __packed;
|
| 822 |
|
| 823 | #define MGMT_OP_ADD_EXT_ADV_DATA 0x0055
|
| 824 | struct mgmt_cp_add_ext_adv_data {
|
| 825 | __u8 instance;
|
| 826 | __u8 adv_data_len;
|
| 827 | __u8 scan_rsp_len;
|
| 828 | __u8 data[];
|
| 829 | } __packed;
|
| 830 | #define MGMT_ADD_EXT_ADV_DATA_SIZE 3
|
| 831 | struct mgmt_rp_add_ext_adv_data {
|
| 832 | __u8 instance;
|
| 833 | } __packed;
|
| 834 |
|
| 835 | struct mgmt_adv_rssi_thresholds {
|
| 836 | __s8 high_threshold;
|
| 837 | __le16 high_threshold_timeout;
|
| 838 | __s8 low_threshold;
|
| 839 | __le16 low_threshold_timeout;
|
| 840 | __u8 sampling_period;
|
| 841 | } __packed;
|
| 842 |
|
| 843 | #define MGMT_OP_ADD_ADV_PATTERNS_MONITOR_RSSI 0x0056
|
| 844 | struct mgmt_cp_add_adv_patterns_monitor_rssi {
|
| 845 | struct mgmt_adv_rssi_thresholds rssi;
|
| 846 | __u8 pattern_count;
|
| 847 | struct mgmt_adv_pattern patterns[];
|
| 848 | } __packed;
|
| 849 | #define MGMT_ADD_ADV_PATTERNS_MONITOR_RSSI_SIZE 8
|
| 850 | #define MGMT_OP_SET_MESH_RECEIVER 0x0057
|
| 851 | struct mgmt_cp_set_mesh {
|
| 852 | __u8 enable;
|
| 853 | __le16 window;
|
| 854 | __le16 period;
|
| 855 | __u8 num_ad_types;
|
| 856 | __u8 ad_types[] __counted_by(num_ad_types);
|
| 857 | } __packed;
|
| 858 | #define MGMT_SET_MESH_RECEIVER_SIZE 6
|
| 859 |
|
| 860 | #define MGMT_OP_MESH_READ_FEATURES 0x0058
|
| 861 | #define MGMT_MESH_READ_FEATURES_SIZE 0
|
| 862 | #define MESH_HANDLES_MAX 3
|
| 863 | struct mgmt_rp_mesh_read_features {
|
| 864 | __le16 index;
|
| 865 | __u8 max_handles;
|
| 866 | __u8 used_handles;
|
| 867 | __u8 handles[MESH_HANDLES_MAX];
|
| 868 | } __packed;
|
| 869 |
|
| 870 | #define MGMT_OP_MESH_SEND 0x0059
|
| 871 | struct mgmt_cp_mesh_send {
|
| 872 | struct mgmt_addr_info addr;
|
| 873 | __le64 instant;
|
| 874 | __le16 delay;
|
| 875 | __u8 cnt;
|
| 876 | __u8 adv_data_len;
|
| 877 | __u8 adv_data[];
|
| 878 | } __packed;
|
| 879 | #define MGMT_MESH_SEND_SIZE 19
|
| 880 |
|
| 881 | #define MGMT_OP_MESH_SEND_CANCEL 0x005A
|
| 882 | struct mgmt_cp_mesh_send_cancel {
|
| 883 | __u8 handle;
|
| 884 | } __packed;
|
| 885 | #define MGMT_MESH_SEND_CANCEL_SIZE 1
|
| 886 |
|
| 887 | #define MGMT_OP_HCI_CMD_SYNC 0x005B
|
| 888 | struct mgmt_cp_hci_cmd_sync {
|
| 889 | __le16 opcode;
|
| 890 | __u8 event;
|
| 891 | __u8 timeout;
|
| 892 | __le16 params_len;
|
| 893 | __u8 params[];
|
| 894 | } __packed;
|
| 895 | #define MGMT_HCI_CMD_SYNC_SIZE 6
|
| 896 |
|
| 897 | #define MGMT_OP_LOAD_CONN_SUBRATE 0x005C
|
| 898 | struct mgmt_conn_subrate {
|
| 899 | struct mgmt_addr_info addr;
|
| 900 | __le16 min_interval;
|
| 901 | __le16 max_interval;
|
| 902 | __le16 subrate_min;
|
| 903 | __le16 subrate_max;
|
| 904 | __le16 max_latency;
|
| 905 | __le16 cont_num;
|
| 906 | __le16 supv_timeout;
|
| 907 | } __packed;
|
| 908 | struct mgmt_cp_load_conn_subrate {
|
| 909 | __le16 param_count;
|
| 910 | struct mgmt_conn_subrate params[] __counted_by_le(param_count);
|
| 911 | } __packed;
|
| 912 | #define MGMT_LOAD_CONN_SUBRATE_SIZE 2
|
| 913 |
|
| 914 | #define MGMT_EV_CMD_COMPLETE 0x0001
|
| 915 | struct mgmt_ev_cmd_complete {
|
| 916 | __le16 opcode;
|
| 917 | __u8 status;
|
| 918 | __u8 data[];
|
| 919 | } __packed;
|
| 920 |
|
| 921 | #define MGMT_EV_CMD_STATUS 0x0002
|
| 922 | struct mgmt_ev_cmd_status {
|
| 923 | __le16 opcode;
|
| 924 | __u8 status;
|
| 925 | } __packed;
|
| 926 |
|
| 927 | #define MGMT_EV_CONTROLLER_ERROR 0x0003
|
| 928 | struct mgmt_ev_controller_error {
|
| 929 | __u8 error_code;
|
| 930 | } __packed;
|
| 931 |
|
| 932 | #define MGMT_EV_INDEX_ADDED 0x0004
|
| 933 |
|
| 934 | #define MGMT_EV_INDEX_REMOVED 0x0005
|
| 935 |
|
| 936 | #define MGMT_EV_NEW_SETTINGS 0x0006
|
| 937 |
|
| 938 | #define MGMT_EV_CLASS_OF_DEV_CHANGED 0x0007
|
| 939 | struct mgmt_ev_class_of_dev_changed {
|
| 940 | __u8 dev_class[3];
|
| 941 | };
|
| 942 |
|
| 943 | #define MGMT_EV_LOCAL_NAME_CHANGED 0x0008
|
| 944 | struct mgmt_ev_local_name_changed {
|
| 945 | __u8 name[MGMT_MAX_NAME_LENGTH];
|
| 946 | __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH];
|
| 947 | } __packed;
|
| 948 |
|
| 949 | #define MGMT_EV_NEW_LINK_KEY 0x0009
|
| 950 | struct mgmt_ev_new_link_key {
|
| 951 | __u8 store_hint;
|
| 952 | struct mgmt_link_key_info key;
|
| 953 | } __packed;
|
| 954 |
|
| 955 | #define MGMT_EV_NEW_LONG_TERM_KEY 0x000A
|
| 956 | struct mgmt_ev_new_long_term_key {
|
| 957 | __u8 store_hint;
|
| 958 | struct mgmt_ltk_info key;
|
| 959 | } __packed;
|
| 960 |
|
| 961 | #define MGMT_EV_DEVICE_CONNECTED 0x000B
|
| 962 | struct mgmt_ev_device_connected {
|
| 963 | struct mgmt_addr_info addr;
|
| 964 | __le32 flags;
|
| 965 | __le16 eir_len;
|
| 966 | __u8 eir[];
|
| 967 | } __packed;
|
| 968 |
|
| 969 | #define MGMT_DEV_DISCONN_UNKNOWN 0x00
|
| 970 | #define MGMT_DEV_DISCONN_TIMEOUT 0x01
|
| 971 | #define MGMT_DEV_DISCONN_LOCAL_HOST 0x02
|
| 972 | #define MGMT_DEV_DISCONN_REMOTE 0x03
|
| 973 | #define MGMT_DEV_DISCONN_AUTH_FAILURE 0x04
|
| 974 | #define MGMT_DEV_DISCONN_LOCAL_HOST_SUSPEND 0x05
|
| 975 |
|
| 976 | #define MGMT_EV_DEVICE_DISCONNECTED 0x000C
|
| 977 | struct mgmt_ev_device_disconnected {
|
| 978 | struct mgmt_addr_info addr;
|
| 979 | __u8 reason;
|
| 980 | } __packed;
|
| 981 |
|
| 982 | #define MGMT_EV_CONNECT_FAILED 0x000D
|
| 983 | struct mgmt_ev_connect_failed {
|
| 984 | struct mgmt_addr_info addr;
|
| 985 | __u8 status;
|
| 986 | } __packed;
|
| 987 |
|
| 988 | #define MGMT_EV_PIN_CODE_REQUEST 0x000E
|
| 989 | struct mgmt_ev_pin_code_request {
|
| 990 | struct mgmt_addr_info addr;
|
| 991 | __u8 secure;
|
| 992 | } __packed;
|
| 993 |
|
| 994 | #define MGMT_EV_USER_CONFIRM_REQUEST 0x000F
|
| 995 | struct mgmt_ev_user_confirm_request {
|
| 996 | struct mgmt_addr_info addr;
|
| 997 | __u8 confirm_hint;
|
| 998 | __le32 value;
|
| 999 | } __packed;
|
| 1000 |
|
| 1001 | #define MGMT_EV_USER_PASSKEY_REQUEST 0x0010
|
| 1002 | struct mgmt_ev_user_passkey_request {
|
| 1003 | struct mgmt_addr_info addr;
|
| 1004 | } __packed;
|
| 1005 |
|
| 1006 | #define MGMT_EV_AUTH_FAILED 0x0011
|
| 1007 | struct mgmt_ev_auth_failed {
|
| 1008 | struct mgmt_addr_info addr;
|
| 1009 | __u8 status;
|
| 1010 | } __packed;
|
| 1011 |
|
| 1012 | #define MGMT_DEV_FOUND_CONFIRM_NAME BIT(0)
|
| 1013 | #define MGMT_DEV_FOUND_LEGACY_PAIRING BIT(1)
|
| 1014 | #define MGMT_DEV_FOUND_NOT_CONNECTABLE BIT(2)
|
| 1015 | #define MGMT_DEV_FOUND_INITIATED_CONN BIT(3)
|
| 1016 | #define MGMT_DEV_FOUND_NAME_REQUEST_FAILED BIT(4)
|
| 1017 | #define MGMT_DEV_FOUND_SCAN_RSP BIT(5)
|
| 1018 |
|
| 1019 | #define MGMT_EV_DEVICE_FOUND 0x0012
|
| 1020 | struct mgmt_ev_device_found {
|
| 1021 | struct mgmt_addr_info addr;
|
| 1022 | __s8 rssi;
|
| 1023 | __le32 flags;
|
| 1024 | __le16 eir_len;
|
| 1025 | __u8 eir[];
|
| 1026 | } __packed;
|
| 1027 |
|
| 1028 | #define MGMT_EV_DISCOVERING 0x0013
|
| 1029 | struct mgmt_ev_discovering {
|
| 1030 | __u8 type;
|
| 1031 | __u8 discovering;
|
| 1032 | } __packed;
|
| 1033 |
|
| 1034 | #define MGMT_EV_DEVICE_BLOCKED 0x0014
|
| 1035 | struct mgmt_ev_device_blocked {
|
| 1036 | struct mgmt_addr_info addr;
|
| 1037 | } __packed;
|
| 1038 |
|
| 1039 | #define MGMT_EV_DEVICE_UNBLOCKED 0x0015
|
| 1040 | struct mgmt_ev_device_unblocked {
|
| 1041 | struct mgmt_addr_info addr;
|
| 1042 | } __packed;
|
| 1043 |
|
| 1044 | #define MGMT_EV_DEVICE_UNPAIRED 0x0016
|
| 1045 | struct mgmt_ev_device_unpaired {
|
| 1046 | struct mgmt_addr_info addr;
|
| 1047 | } __packed;
|
| 1048 |
|
| 1049 | #define MGMT_EV_PASSKEY_NOTIFY 0x0017
|
| 1050 | struct mgmt_ev_passkey_notify {
|
| 1051 | struct mgmt_addr_info addr;
|
| 1052 | __le32 passkey;
|
| 1053 | __u8 entered;
|
| 1054 | } __packed;
|
| 1055 |
|
| 1056 | #define MGMT_EV_NEW_IRK 0x0018
|
| 1057 | struct mgmt_ev_new_irk {
|
| 1058 | __u8 store_hint;
|
| 1059 | bdaddr_t rpa;
|
| 1060 | struct mgmt_irk_info irk;
|
| 1061 | } __packed;
|
| 1062 |
|
| 1063 | #define MGMT_CSRK_LOCAL_UNAUTHENTICATED 0x00
|
| 1064 | #define MGMT_CSRK_REMOTE_UNAUTHENTICATED 0x01
|
| 1065 | #define MGMT_CSRK_LOCAL_AUTHENTICATED 0x02
|
| 1066 | #define MGMT_CSRK_REMOTE_AUTHENTICATED 0x03
|
| 1067 |
|
| 1068 | struct mgmt_csrk_info {
|
| 1069 | struct mgmt_addr_info addr;
|
| 1070 | __u8 type;
|
| 1071 | __u8 val[16];
|
| 1072 | } __packed;
|
| 1073 |
|
| 1074 | #define MGMT_EV_NEW_CSRK 0x0019
|
| 1075 | struct mgmt_ev_new_csrk {
|
| 1076 | __u8 store_hint;
|
| 1077 | struct mgmt_csrk_info key;
|
| 1078 | } __packed;
|
| 1079 |
|
| 1080 | #define MGMT_EV_DEVICE_ADDED 0x001a
|
| 1081 | struct mgmt_ev_device_added {
|
| 1082 | struct mgmt_addr_info addr;
|
| 1083 | __u8 action;
|
| 1084 | } __packed;
|
| 1085 |
|
| 1086 | #define MGMT_EV_DEVICE_REMOVED 0x001b
|
| 1087 | struct mgmt_ev_device_removed {
|
| 1088 | struct mgmt_addr_info addr;
|
| 1089 | } __packed;
|
| 1090 |
|
| 1091 | #define MGMT_EV_NEW_CONN_PARAM 0x001c
|
| 1092 | struct mgmt_ev_new_conn_param {
|
| 1093 | struct mgmt_addr_info addr;
|
| 1094 | __u8 store_hint;
|
| 1095 | __le16 min_interval;
|
| 1096 | __le16 max_interval;
|
| 1097 | __le16 latency;
|
| 1098 | __le16 timeout;
|
| 1099 | } __packed;
|
| 1100 |
|
| 1101 | #define MGMT_EV_UNCONF_INDEX_ADDED 0x001d
|
| 1102 |
|
| 1103 | #define MGMT_EV_UNCONF_INDEX_REMOVED 0x001e
|
| 1104 |
|
| 1105 | #define MGMT_EV_NEW_CONFIG_OPTIONS 0x001f
|
| 1106 |
|
| 1107 | struct mgmt_ev_ext_index {
|
| 1108 | __u8 type;
|
| 1109 | __u8 bus;
|
| 1110 | } __packed;
|
| 1111 |
|
| 1112 | #define MGMT_EV_EXT_INDEX_ADDED 0x0020
|
| 1113 |
|
| 1114 | #define MGMT_EV_EXT_INDEX_REMOVED 0x0021
|
| 1115 |
|
| 1116 | #define MGMT_EV_LOCAL_OOB_DATA_UPDATED 0x0022
|
| 1117 | struct mgmt_ev_local_oob_data_updated {
|
| 1118 | __u8 type;
|
| 1119 | __le16 eir_len;
|
| 1120 | __u8 eir[];
|
| 1121 | } __packed;
|
| 1122 |
|
| 1123 | #define MGMT_EV_ADVERTISING_ADDED 0x0023
|
| 1124 | struct mgmt_ev_advertising_added {
|
| 1125 | __u8 instance;
|
| 1126 | } __packed;
|
| 1127 |
|
| 1128 | #define MGMT_EV_ADVERTISING_REMOVED 0x0024
|
| 1129 | struct mgmt_ev_advertising_removed {
|
| 1130 | __u8 instance;
|
| 1131 | } __packed;
|
| 1132 |
|
| 1133 | #define MGMT_EV_EXT_INFO_CHANGED 0x0025
|
| 1134 | struct mgmt_ev_ext_info_changed {
|
| 1135 | __le16 eir_len;
|
| 1136 | __u8 eir[];
|
| 1137 | } __packed;
|
| 1138 |
|
| 1139 | #define MGMT_EV_PHY_CONFIGURATION_CHANGED 0x0026
|
| 1140 | struct mgmt_ev_phy_configuration_changed {
|
| 1141 | __le32 selected_phys;
|
| 1142 | } __packed;
|
| 1143 |
|
| 1144 | #define MGMT_EV_EXP_FEATURE_CHANGED 0x0027
|
| 1145 | struct mgmt_ev_exp_feature_changed {
|
| 1146 | __u8 uuid[16];
|
| 1147 | __le32 flags;
|
| 1148 | } __packed;
|
| 1149 |
|
| 1150 | #define MGMT_EV_DEVICE_FLAGS_CHANGED 0x002a
|
| 1151 | struct mgmt_ev_device_flags_changed {
|
| 1152 | struct mgmt_addr_info addr;
|
| 1153 | __le32 supported_flags;
|
| 1154 | __le32 current_flags;
|
| 1155 | } __packed;
|
| 1156 |
|
| 1157 | #define MGMT_EV_ADV_MONITOR_ADDED 0x002b
|
| 1158 | struct mgmt_ev_adv_monitor_added {
|
| 1159 | __le16 monitor_handle;
|
| 1160 | } __packed;
|
| 1161 |
|
| 1162 | #define MGMT_EV_ADV_MONITOR_REMOVED 0x002c
|
| 1163 | struct mgmt_ev_adv_monitor_removed {
|
| 1164 | __le16 monitor_handle;
|
| 1165 | } __packed;
|
| 1166 |
|
| 1167 | #define MGMT_EV_CONTROLLER_SUSPEND 0x002d
|
| 1168 | struct mgmt_ev_controller_suspend {
|
| 1169 | __u8 suspend_state;
|
| 1170 | } __packed;
|
| 1171 |
|
| 1172 | #define MGMT_EV_CONTROLLER_RESUME 0x002e
|
| 1173 | struct mgmt_ev_controller_resume {
|
| 1174 | __u8 wake_reason;
|
| 1175 | struct mgmt_addr_info addr;
|
| 1176 | } __packed;
|
| 1177 |
|
| 1178 | #define MGMT_WAKE_REASON_NON_BT_WAKE 0x0
|
| 1179 | #define MGMT_WAKE_REASON_UNEXPECTED 0x1
|
| 1180 | #define MGMT_WAKE_REASON_REMOTE_WAKE 0x2
|
| 1181 |
|
| 1182 | #define MGMT_EV_ADV_MONITOR_DEVICE_FOUND 0x002f
|
| 1183 | struct mgmt_ev_adv_monitor_device_found {
|
| 1184 | __le16 monitor_handle;
|
| 1185 | struct mgmt_addr_info addr;
|
| 1186 | __s8 rssi;
|
| 1187 | __le32 flags;
|
| 1188 | __le16 eir_len;
|
| 1189 | __u8 eir[];
|
| 1190 | } __packed;
|
| 1191 |
|
| 1192 | #define MGMT_EV_ADV_MONITOR_DEVICE_LOST 0x0030
|
| 1193 | struct mgmt_ev_adv_monitor_device_lost {
|
| 1194 | __le16 monitor_handle;
|
| 1195 | struct mgmt_addr_info addr;
|
| 1196 | } __packed;
|
| 1197 |
|
| 1198 | #define MGMT_EV_MESH_DEVICE_FOUND 0x0031
|
| 1199 | struct mgmt_ev_mesh_device_found {
|
| 1200 | struct mgmt_addr_info addr;
|
| 1201 | __s8 rssi;
|
| 1202 | __le64 instant;
|
| 1203 | __le32 flags;
|
| 1204 | __le16 eir_len;
|
| 1205 | __u8 eir[];
|
| 1206 | } __packed;
|
| 1207 |
|
| 1208 |
|
| 1209 | #define MGMT_EV_MESH_PACKET_CMPLT 0x0032
|
| 1210 | struct mgmt_ev_mesh_pkt_cmplt {
|
| 1211 | __u8 handle;
|
| 1212 | } __packed;
|
| 1213 |
|
| 1214 | #define MGMT_EV_CONN_SUBRATE 0x0033
|
| 1215 | struct mgmt_ev_conn_subrate {
|
| 1216 | struct mgmt_addr_info addr;
|
| 1217 | __u8 status;
|
| 1218 | __le16 interval;
|
| 1219 | __le16 subrate;
|
| 1220 | __le16 latency;
|
| 1221 | __le16 cont_num;
|
| 1222 | __le16 supv_timeout;
|
| 1223 | } __packed;
|