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