Johan Hedberg | c02178d | 2010-12-08 00:21:05 +0200 | [diff] [blame] | 1 | /* |
| 2 | BlueZ - Bluetooth protocol stack for Linux |
| 3 | |
| 4 | Copyright (C) 2010 Nokia Corporation |
| 5 | |
| 6 | This program is free software; you can redistribute it and/or modify |
| 7 | it under the terms of the GNU General Public License version 2 as |
| 8 | published by the Free Software Foundation; |
| 9 | |
| 10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 11 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 12 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
| 13 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
| 14 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
| 15 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
| 16 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 17 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 18 | |
| 19 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
| 20 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
| 21 | SOFTWARE IS DISCLAIMED. |
| 22 | */ |
| 23 | |
Szymon Janc | 4e51eae | 2011-02-25 19:05:48 +0100 | [diff] [blame] | 24 | #define MGMT_INDEX_NONE 0xFFFF |
| 25 | |
Johan Hedberg | ca69b79 | 2011-11-11 18:10:00 +0200 | [diff] [blame] | 26 | #define MGMT_STATUS_SUCCESS 0x00 |
| 27 | #define MGMT_STATUS_UNKNOWN_COMMAND 0x01 |
| 28 | #define MGMT_STATUS_NOT_CONNECTED 0x02 |
| 29 | #define MGMT_STATUS_FAILED 0x03 |
| 30 | #define MGMT_STATUS_CONNECT_FAILED 0x04 |
| 31 | #define MGMT_STATUS_AUTH_FAILED 0x05 |
| 32 | #define MGMT_STATUS_NOT_PAIRED 0x06 |
| 33 | #define MGMT_STATUS_NO_RESOURCES 0x07 |
| 34 | #define MGMT_STATUS_TIMEOUT 0x08 |
| 35 | #define MGMT_STATUS_ALREADY_CONNECTED 0x09 |
| 36 | #define MGMT_STATUS_BUSY 0x0a |
| 37 | #define MGMT_STATUS_REJECTED 0x0b |
| 38 | #define MGMT_STATUS_NOT_SUPPORTED 0x0c |
| 39 | #define MGMT_STATUS_INVALID_PARAMS 0x0d |
| 40 | #define MGMT_STATUS_DISCONNECTED 0x0e |
| 41 | #define MGMT_STATUS_NOT_POWERED 0x0f |
| 42 | |
Johan Hedberg | c02178d | 2010-12-08 00:21:05 +0200 | [diff] [blame] | 43 | struct mgmt_hdr { |
| 44 | __le16 opcode; |
Szymon Janc | 4e51eae | 2011-02-25 19:05:48 +0100 | [diff] [blame] | 45 | __le16 index; |
Johan Hedberg | c02178d | 2010-12-08 00:21:05 +0200 | [diff] [blame] | 46 | __le16 len; |
| 47 | } __packed; |
Johan Hedberg | c02178d | 2010-12-08 00:21:05 +0200 | [diff] [blame] | 48 | |
Johan Hedberg | 02d9812 | 2010-12-13 21:07:04 +0200 | [diff] [blame] | 49 | #define MGMT_OP_READ_VERSION 0x0001 |
| 50 | struct mgmt_rp_read_version { |
| 51 | __u8 version; |
| 52 | __le16 revision; |
| 53 | } __packed; |
| 54 | |
Johan Hedberg | faba42e | 2010-12-13 21:07:05 +0200 | [diff] [blame] | 55 | #define MGMT_OP_READ_INDEX_LIST 0x0003 |
| 56 | struct mgmt_rp_read_index_list { |
| 57 | __le16 num_controllers; |
| 58 | __le16 index[0]; |
| 59 | } __packed; |
| 60 | |
Johan Hedberg | dc4fe30 | 2011-03-16 14:29:36 +0200 | [diff] [blame] | 61 | /* Reserve one extra byte for names in management messages so that they |
| 62 | * are always guaranteed to be nul-terminated */ |
| 63 | #define MGMT_MAX_NAME_LENGTH (HCI_MAX_NAME_LENGTH + 1) |
Johan Hedberg | 69ab39e | 2011-12-15 00:47:35 +0200 | [diff] [blame] | 64 | #define MGMT_MAX_SHORT_NAME_LENGTH (10 + 1) |
| 65 | |
| 66 | #define MGMT_SETTING_POWERED 0x00000001 |
| 67 | #define MGMT_SETTING_CONNECTABLE 0x00000002 |
| 68 | #define MGMT_SETTING_FAST_CONNECTABLE 0x00000004 |
| 69 | #define MGMT_SETTING_DISCOVERABLE 0x00000008 |
| 70 | #define MGMT_SETTING_PAIRABLE 0x00000010 |
| 71 | #define MGMT_SETTING_LINK_SECURITY 0x00000020 |
| 72 | #define MGMT_SETTING_SSP 0x00000040 |
| 73 | #define MGMT_SETTING_BREDR 0x00000080 |
| 74 | #define MGMT_SETTING_HS 0x00000100 |
| 75 | #define MGMT_SETTING_LE 0x00000200 |
Johan Hedberg | dc4fe30 | 2011-03-16 14:29:36 +0200 | [diff] [blame] | 76 | |
Johan Hedberg | f7b64e69 | 2010-12-13 21:07:06 +0200 | [diff] [blame] | 77 | #define MGMT_OP_READ_INFO 0x0004 |
Johan Hedberg | f7b64e69 | 2010-12-13 21:07:06 +0200 | [diff] [blame] | 78 | struct mgmt_rp_read_info { |
Johan Hedberg | f7b64e69 | 2010-12-13 21:07:06 +0200 | [diff] [blame] | 79 | bdaddr_t bdaddr; |
Johan Hedberg | 69ab39e | 2011-12-15 00:47:35 +0200 | [diff] [blame] | 80 | __u8 version; |
| 81 | __le16 manufacturer; |
| 82 | __le32 supported_settings; |
| 83 | __le32 current_settings; |
Johan Hedberg | f7b64e69 | 2010-12-13 21:07:06 +0200 | [diff] [blame] | 84 | __u8 dev_class[3]; |
Johan Hedberg | dc4fe30 | 2011-03-16 14:29:36 +0200 | [diff] [blame] | 85 | __u8 name[MGMT_MAX_NAME_LENGTH]; |
Johan Hedberg | 69ab39e | 2011-12-15 00:47:35 +0200 | [diff] [blame] | 86 | __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH]; |
Johan Hedberg | f7b64e69 | 2010-12-13 21:07:06 +0200 | [diff] [blame] | 87 | } __packed; |
| 88 | |
Johan Hedberg | 72a734e | 2010-12-30 00:38:22 +0200 | [diff] [blame] | 89 | struct mgmt_mode { |
Johan Hedberg | 72a734e | 2010-12-30 00:38:22 +0200 | [diff] [blame] | 90 | __u8 val; |
| 91 | } __packed; |
| 92 | |
Johan Hedberg | eec8d2b | 2010-12-16 10:17:38 +0200 | [diff] [blame] | 93 | #define MGMT_OP_SET_POWERED 0x0005 |
Johan Hedberg | eec8d2b | 2010-12-16 10:17:38 +0200 | [diff] [blame] | 94 | |
Johan Hedberg | 73f22f6 | 2010-12-29 16:00:25 +0200 | [diff] [blame] | 95 | #define MGMT_OP_SET_DISCOVERABLE 0x0006 |
Johan Hedberg | 16ab91a | 2011-11-07 22:16:02 +0200 | [diff] [blame] | 96 | struct mgmt_cp_set_discoverable { |
| 97 | __u8 val; |
| 98 | __u16 timeout; |
| 99 | } __packed; |
Johan Hedberg | 73f22f6 | 2010-12-29 16:00:25 +0200 | [diff] [blame] | 100 | |
Johan Hedberg | 9fbcbb4 | 2010-12-30 00:18:33 +0200 | [diff] [blame] | 101 | #define MGMT_OP_SET_CONNECTABLE 0x0007 |
Johan Hedberg | 9fbcbb4 | 2010-12-30 00:18:33 +0200 | [diff] [blame] | 102 | |
Johan Hedberg | f7c6869ce | 2011-12-15 00:47:36 +0200 | [diff] [blame^] | 103 | #define MGMT_OP_SET_FAST_CONNECTABLE 0x001F |
| 104 | |
Johan Hedberg | c542a06 | 2011-01-26 13:11:03 +0200 | [diff] [blame] | 105 | #define MGMT_OP_SET_PAIRABLE 0x0008 |
| 106 | |
Johan Hedberg | 2aeb9a1 | 2011-01-04 12:08:51 +0200 | [diff] [blame] | 107 | #define MGMT_OP_ADD_UUID 0x0009 |
| 108 | struct mgmt_cp_add_uuid { |
Johan Hedberg | 2aeb9a1 | 2011-01-04 12:08:51 +0200 | [diff] [blame] | 109 | __u8 uuid[16]; |
Johan Hedberg | 1aff6f0 | 2011-01-13 21:56:52 +0200 | [diff] [blame] | 110 | __u8 svc_hint; |
Johan Hedberg | 2aeb9a1 | 2011-01-04 12:08:51 +0200 | [diff] [blame] | 111 | } __packed; |
| 112 | |
| 113 | #define MGMT_OP_REMOVE_UUID 0x000A |
| 114 | struct mgmt_cp_remove_uuid { |
Johan Hedberg | 2aeb9a1 | 2011-01-04 12:08:51 +0200 | [diff] [blame] | 115 | __u8 uuid[16]; |
| 116 | } __packed; |
| 117 | |
Johan Hedberg | 1aff6f0 | 2011-01-13 21:56:52 +0200 | [diff] [blame] | 118 | #define MGMT_OP_SET_DEV_CLASS 0x000B |
| 119 | struct mgmt_cp_set_dev_class { |
Johan Hedberg | 1aff6f0 | 2011-01-13 21:56:52 +0200 | [diff] [blame] | 120 | __u8 major; |
| 121 | __u8 minor; |
| 122 | } __packed; |
| 123 | |
| 124 | #define MGMT_OP_SET_SERVICE_CACHE 0x000C |
| 125 | struct mgmt_cp_set_service_cache { |
Johan Hedberg | 1aff6f0 | 2011-01-13 21:56:52 +0200 | [diff] [blame] | 126 | __u8 enable; |
| 127 | } __packed; |
| 128 | |
Johan Hedberg | 86742e1 | 2011-11-07 23:13:38 +0200 | [diff] [blame] | 129 | struct mgmt_link_key_info { |
Johan Hedberg | 55ed8ca1 | 2011-01-17 14:41:05 +0200 | [diff] [blame] | 130 | bdaddr_t bdaddr; |
| 131 | u8 type; |
| 132 | u8 val[16]; |
| 133 | u8 pin_len; |
| 134 | } __packed; |
| 135 | |
Johan Hedberg | 86742e1 | 2011-11-07 23:13:38 +0200 | [diff] [blame] | 136 | #define MGMT_OP_LOAD_LINK_KEYS 0x000D |
| 137 | struct mgmt_cp_load_link_keys { |
Johan Hedberg | 55ed8ca1 | 2011-01-17 14:41:05 +0200 | [diff] [blame] | 138 | __u8 debug_keys; |
| 139 | __le16 key_count; |
Johan Hedberg | 86742e1 | 2011-11-07 23:13:38 +0200 | [diff] [blame] | 140 | struct mgmt_link_key_info keys[0]; |
Johan Hedberg | 55ed8ca1 | 2011-01-17 14:41:05 +0200 | [diff] [blame] | 141 | } __packed; |
| 142 | |
Johan Hedberg | 86742e1 | 2011-11-07 23:13:38 +0200 | [diff] [blame] | 143 | #define MGMT_OP_REMOVE_KEYS 0x000E |
| 144 | struct mgmt_cp_remove_keys { |
Johan Hedberg | 55ed8ca1 | 2011-01-17 14:41:05 +0200 | [diff] [blame] | 145 | bdaddr_t bdaddr; |
| 146 | __u8 disconnect; |
| 147 | } __packed; |
Johan Hedberg | a8a1d19 | 2011-11-10 15:54:38 +0200 | [diff] [blame] | 148 | struct mgmt_rp_remove_keys { |
| 149 | bdaddr_t bdaddr; |
| 150 | __u8 status; |
| 151 | }; |
Johan Hedberg | 55ed8ca1 | 2011-01-17 14:41:05 +0200 | [diff] [blame] | 152 | |
Johan Hedberg | 8962ee7 | 2011-01-20 12:40:27 +0200 | [diff] [blame] | 153 | #define MGMT_OP_DISCONNECT 0x000F |
| 154 | struct mgmt_cp_disconnect { |
Johan Hedberg | 8962ee7 | 2011-01-20 12:40:27 +0200 | [diff] [blame] | 155 | bdaddr_t bdaddr; |
| 156 | } __packed; |
| 157 | struct mgmt_rp_disconnect { |
Johan Hedberg | 8962ee7 | 2011-01-20 12:40:27 +0200 | [diff] [blame] | 158 | bdaddr_t bdaddr; |
Johan Hedberg | 37d9ef7 | 2011-11-10 15:54:39 +0200 | [diff] [blame] | 159 | __u8 status; |
Johan Hedberg | 8962ee7 | 2011-01-20 12:40:27 +0200 | [diff] [blame] | 160 | } __packed; |
| 161 | |
Johan Hedberg | 4c659c3 | 2011-11-07 23:13:39 +0200 | [diff] [blame] | 162 | #define MGMT_ADDR_BREDR 0x00 |
Johan Hedberg | 48264f0 | 2011-11-09 13:58:58 +0200 | [diff] [blame] | 163 | #define MGMT_ADDR_LE_PUBLIC 0x01 |
| 164 | #define MGMT_ADDR_LE_RANDOM 0x02 |
Johan Hedberg | 4c659c3 | 2011-11-07 23:13:39 +0200 | [diff] [blame] | 165 | #define MGMT_ADDR_INVALID 0xff |
| 166 | |
| 167 | struct mgmt_addr_info { |
| 168 | bdaddr_t bdaddr; |
| 169 | __u8 type; |
| 170 | } __packed; |
| 171 | |
Johan Hedberg | 2784eb4 | 2011-01-21 13:56:35 +0200 | [diff] [blame] | 172 | #define MGMT_OP_GET_CONNECTIONS 0x0010 |
Johan Hedberg | 2784eb4 | 2011-01-21 13:56:35 +0200 | [diff] [blame] | 173 | struct mgmt_rp_get_connections { |
Johan Hedberg | 2784eb4 | 2011-01-21 13:56:35 +0200 | [diff] [blame] | 174 | __le16 conn_count; |
Johan Hedberg | 4c659c3 | 2011-11-07 23:13:39 +0200 | [diff] [blame] | 175 | struct mgmt_addr_info addr[0]; |
Johan Hedberg | 2784eb4 | 2011-01-21 13:56:35 +0200 | [diff] [blame] | 176 | } __packed; |
| 177 | |
Johan Hedberg | 980e1a5 | 2011-01-22 06:10:07 +0200 | [diff] [blame] | 178 | #define MGMT_OP_PIN_CODE_REPLY 0x0011 |
| 179 | struct mgmt_cp_pin_code_reply { |
Johan Hedberg | 980e1a5 | 2011-01-22 06:10:07 +0200 | [diff] [blame] | 180 | bdaddr_t bdaddr; |
| 181 | __u8 pin_len; |
| 182 | __u8 pin_code[16]; |
| 183 | } __packed; |
Johan Hedberg | ac56fb1 | 2011-02-19 12:05:59 -0300 | [diff] [blame] | 184 | struct mgmt_rp_pin_code_reply { |
Johan Hedberg | ac56fb1 | 2011-02-19 12:05:59 -0300 | [diff] [blame] | 185 | bdaddr_t bdaddr; |
| 186 | uint8_t status; |
| 187 | } __packed; |
Johan Hedberg | 980e1a5 | 2011-01-22 06:10:07 +0200 | [diff] [blame] | 188 | |
| 189 | #define MGMT_OP_PIN_CODE_NEG_REPLY 0x0012 |
| 190 | struct mgmt_cp_pin_code_neg_reply { |
Johan Hedberg | 980e1a5 | 2011-01-22 06:10:07 +0200 | [diff] [blame] | 191 | bdaddr_t bdaddr; |
| 192 | } __packed; |
| 193 | |
Johan Hedberg | 17fa4b9 | 2011-01-25 13:28:33 +0200 | [diff] [blame] | 194 | #define MGMT_OP_SET_IO_CAPABILITY 0x0013 |
| 195 | struct mgmt_cp_set_io_capability { |
Johan Hedberg | 17fa4b9 | 2011-01-25 13:28:33 +0200 | [diff] [blame] | 196 | __u8 io_capability; |
| 197 | } __packed; |
| 198 | |
Johan Hedberg | e9a416b | 2011-02-19 12:05:56 -0300 | [diff] [blame] | 199 | #define MGMT_OP_PAIR_DEVICE 0x0014 |
| 200 | struct mgmt_cp_pair_device { |
Johan Hedberg | ba4e564 | 2011-11-11 00:07:34 +0200 | [diff] [blame] | 201 | struct mgmt_addr_info addr; |
Johan Hedberg | e9a416b | 2011-02-19 12:05:56 -0300 | [diff] [blame] | 202 | __u8 io_cap; |
| 203 | } __packed; |
| 204 | struct mgmt_rp_pair_device { |
Johan Hedberg | ba4e564 | 2011-11-11 00:07:34 +0200 | [diff] [blame] | 205 | struct mgmt_addr_info addr; |
Johan Hedberg | e9a416b | 2011-02-19 12:05:56 -0300 | [diff] [blame] | 206 | __u8 status; |
| 207 | } __packed; |
| 208 | |
Johan Hedberg | a5c2968 | 2011-02-19 12:05:57 -0300 | [diff] [blame] | 209 | #define MGMT_OP_USER_CONFIRM_REPLY 0x0015 |
| 210 | struct mgmt_cp_user_confirm_reply { |
Johan Hedberg | a5c2968 | 2011-02-19 12:05:57 -0300 | [diff] [blame] | 211 | bdaddr_t bdaddr; |
| 212 | } __packed; |
| 213 | struct mgmt_rp_user_confirm_reply { |
Johan Hedberg | a5c2968 | 2011-02-19 12:05:57 -0300 | [diff] [blame] | 214 | bdaddr_t bdaddr; |
| 215 | __u8 status; |
| 216 | } __packed; |
| 217 | |
| 218 | #define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x0016 |
| 219 | |
Johan Hedberg | b312b161 | 2011-03-16 14:29:37 +0200 | [diff] [blame] | 220 | #define MGMT_OP_SET_LOCAL_NAME 0x0017 |
| 221 | struct mgmt_cp_set_local_name { |
| 222 | __u8 name[MGMT_MAX_NAME_LENGTH]; |
| 223 | } __packed; |
| 224 | |
Szymon Janc | c35938b | 2011-03-22 13:12:21 +0100 | [diff] [blame] | 225 | #define MGMT_OP_READ_LOCAL_OOB_DATA 0x0018 |
| 226 | struct mgmt_rp_read_local_oob_data { |
| 227 | __u8 hash[16]; |
| 228 | __u8 randomizer[16]; |
| 229 | } __packed; |
| 230 | |
Szymon Janc | 2763eda | 2011-03-22 13:12:22 +0100 | [diff] [blame] | 231 | #define MGMT_OP_ADD_REMOTE_OOB_DATA 0x0019 |
| 232 | struct mgmt_cp_add_remote_oob_data { |
| 233 | bdaddr_t bdaddr; |
| 234 | __u8 hash[16]; |
| 235 | __u8 randomizer[16]; |
| 236 | } __packed; |
| 237 | |
| 238 | #define MGMT_OP_REMOVE_REMOTE_OOB_DATA 0x001A |
| 239 | struct mgmt_cp_remove_remote_oob_data { |
| 240 | bdaddr_t bdaddr; |
| 241 | } __packed; |
| 242 | |
Johan Hedberg | 14a5366 | 2011-04-27 10:29:56 -0400 | [diff] [blame] | 243 | #define MGMT_OP_START_DISCOVERY 0x001B |
Johan Hedberg | 450dfda | 2011-11-12 11:58:22 +0200 | [diff] [blame] | 244 | struct mgmt_cp_start_discovery { |
| 245 | __u8 type; |
| 246 | } __packed; |
Johan Hedberg | 14a5366 | 2011-04-27 10:29:56 -0400 | [diff] [blame] | 247 | |
| 248 | #define MGMT_OP_STOP_DISCOVERY 0x001C |
| 249 | |
Antti Julku | 7fbec22 | 2011-06-15 12:01:15 +0300 | [diff] [blame] | 250 | #define MGMT_OP_BLOCK_DEVICE 0x001D |
| 251 | struct mgmt_cp_block_device { |
| 252 | bdaddr_t bdaddr; |
| 253 | } __packed; |
| 254 | |
| 255 | #define MGMT_OP_UNBLOCK_DEVICE 0x001E |
| 256 | struct mgmt_cp_unblock_device { |
| 257 | bdaddr_t bdaddr; |
| 258 | } __packed; |
| 259 | |
Brian Gix | 453a838 | 2011-11-12 22:01:12 -0800 | [diff] [blame] | 260 | #define MGMT_OP_USER_PASSKEY_REPLY 0x0020 |
| 261 | struct mgmt_cp_user_passkey_reply { |
| 262 | bdaddr_t bdaddr; |
| 263 | __le32 passkey; |
| 264 | } __packed; |
| 265 | |
| 266 | #define MGMT_OP_USER_PASSKEY_NEG_REPLY 0x0021 |
| 267 | struct mgmt_cp_user_passkey_neg_reply { |
| 268 | bdaddr_t bdaddr; |
| 269 | } __packed; |
| 270 | |
Johan Hedberg | c02178d | 2010-12-08 00:21:05 +0200 | [diff] [blame] | 271 | #define MGMT_EV_CMD_COMPLETE 0x0001 |
| 272 | struct mgmt_ev_cmd_complete { |
| 273 | __le16 opcode; |
| 274 | __u8 data[0]; |
| 275 | } __packed; |
| 276 | |
| 277 | #define MGMT_EV_CMD_STATUS 0x0002 |
| 278 | struct mgmt_ev_cmd_status { |
| 279 | __u8 status; |
| 280 | __le16 opcode; |
| 281 | } __packed; |
| 282 | |
| 283 | #define MGMT_EV_CONTROLLER_ERROR 0x0003 |
| 284 | struct mgmt_ev_controller_error { |
Johan Hedberg | c02178d | 2010-12-08 00:21:05 +0200 | [diff] [blame] | 285 | __u8 error_code; |
| 286 | } __packed; |
Johan Hedberg | c71e97b | 2010-12-13 21:07:07 +0200 | [diff] [blame] | 287 | |
| 288 | #define MGMT_EV_INDEX_ADDED 0x0004 |
Johan Hedberg | c71e97b | 2010-12-13 21:07:07 +0200 | [diff] [blame] | 289 | |
| 290 | #define MGMT_EV_INDEX_REMOVED 0x0005 |
Johan Hedberg | 5add6af | 2010-12-16 10:00:37 +0200 | [diff] [blame] | 291 | |
Johan Hedberg | 69ab39e | 2011-12-15 00:47:35 +0200 | [diff] [blame] | 292 | #define MGMT_EV_NEW_SETTINGS 0x0006 |
Johan Hedberg | 73f22f6 | 2010-12-29 16:00:25 +0200 | [diff] [blame] | 293 | |
| 294 | #define MGMT_EV_DISCOVERABLE 0x0007 |
Johan Hedberg | 9fbcbb4 | 2010-12-30 00:18:33 +0200 | [diff] [blame] | 295 | |
| 296 | #define MGMT_EV_CONNECTABLE 0x0008 |
Johan Hedberg | c542a06 | 2011-01-26 13:11:03 +0200 | [diff] [blame] | 297 | |
| 298 | #define MGMT_EV_PAIRABLE 0x0009 |
Johan Hedberg | 55ed8ca1 | 2011-01-17 14:41:05 +0200 | [diff] [blame] | 299 | |
Johan Hedberg | 86742e1 | 2011-11-07 23:13:38 +0200 | [diff] [blame] | 300 | #define MGMT_EV_NEW_LINK_KEY 0x000A |
| 301 | struct mgmt_ev_new_link_key { |
Johan Hedberg | 4df378a | 2011-04-28 11:29:03 -0700 | [diff] [blame] | 302 | __u8 store_hint; |
Johan Hedberg | 86742e1 | 2011-11-07 23:13:38 +0200 | [diff] [blame] | 303 | struct mgmt_link_key_info key; |
Johan Hedberg | 55ed8ca1 | 2011-01-17 14:41:05 +0200 | [diff] [blame] | 304 | } __packed; |
Johan Hedberg | f752054 | 2011-01-20 12:34:39 +0200 | [diff] [blame] | 305 | |
| 306 | #define MGMT_EV_CONNECTED 0x000B |
Johan Hedberg | f752054 | 2011-01-20 12:34:39 +0200 | [diff] [blame] | 307 | |
| 308 | #define MGMT_EV_DISCONNECTED 0x000C |
Johan Hedberg | 17d5c04 | 2011-01-22 06:09:08 +0200 | [diff] [blame] | 309 | |
| 310 | #define MGMT_EV_CONNECT_FAILED 0x000D |
| 311 | struct mgmt_ev_connect_failed { |
Johan Hedberg | 4c659c3 | 2011-11-07 23:13:39 +0200 | [diff] [blame] | 312 | struct mgmt_addr_info addr; |
Johan Hedberg | 17d5c04 | 2011-01-22 06:09:08 +0200 | [diff] [blame] | 313 | __u8 status; |
| 314 | } __packed; |
Johan Hedberg | 980e1a5 | 2011-01-22 06:10:07 +0200 | [diff] [blame] | 315 | |
| 316 | #define MGMT_EV_PIN_CODE_REQUEST 0x000E |
| 317 | struct mgmt_ev_pin_code_request { |
Johan Hedberg | 980e1a5 | 2011-01-22 06:10:07 +0200 | [diff] [blame] | 318 | bdaddr_t bdaddr; |
Waldemar Rymarkiewicz | a770bb5 | 2011-04-28 12:07:59 +0200 | [diff] [blame] | 319 | __u8 secure; |
Johan Hedberg | 980e1a5 | 2011-01-22 06:10:07 +0200 | [diff] [blame] | 320 | } __packed; |
Johan Hedberg | a5c2968 | 2011-02-19 12:05:57 -0300 | [diff] [blame] | 321 | |
| 322 | #define MGMT_EV_USER_CONFIRM_REQUEST 0x000F |
| 323 | struct mgmt_ev_user_confirm_request { |
Johan Hedberg | a5c2968 | 2011-02-19 12:05:57 -0300 | [diff] [blame] | 324 | bdaddr_t bdaddr; |
Johan Hedberg | 55bc1a3 | 2011-04-28 11:28:56 -0700 | [diff] [blame] | 325 | __u8 confirm_hint; |
Johan Hedberg | a5c2968 | 2011-02-19 12:05:57 -0300 | [diff] [blame] | 326 | __le32 value; |
| 327 | } __packed; |
Johan Hedberg | 2a61169 | 2011-02-19 12:06:00 -0300 | [diff] [blame] | 328 | |
| 329 | #define MGMT_EV_AUTH_FAILED 0x0010 |
| 330 | struct mgmt_ev_auth_failed { |
Johan Hedberg | 2a61169 | 2011-02-19 12:06:00 -0300 | [diff] [blame] | 331 | bdaddr_t bdaddr; |
| 332 | __u8 status; |
| 333 | } __packed; |
Johan Hedberg | b312b161 | 2011-03-16 14:29:37 +0200 | [diff] [blame] | 334 | |
| 335 | #define MGMT_EV_LOCAL_NAME_CHANGED 0x0011 |
| 336 | struct mgmt_ev_local_name_changed { |
| 337 | __u8 name[MGMT_MAX_NAME_LENGTH]; |
| 338 | } __packed; |
Johan Hedberg | e17acd4 | 2011-03-30 23:57:16 +0300 | [diff] [blame] | 339 | |
| 340 | #define MGMT_EV_DEVICE_FOUND 0x0012 |
| 341 | struct mgmt_ev_device_found { |
Johan Hedberg | 4c659c3 | 2011-11-07 23:13:39 +0200 | [diff] [blame] | 342 | struct mgmt_addr_info addr; |
Johan Hedberg | e17acd4 | 2011-03-30 23:57:16 +0300 | [diff] [blame] | 343 | __u8 dev_class[3]; |
| 344 | __s8 rssi; |
| 345 | __u8 eir[HCI_MAX_EIR_LENGTH]; |
| 346 | } __packed; |
Johan Hedberg | a88a965 | 2011-03-30 13:18:12 +0300 | [diff] [blame] | 347 | |
| 348 | #define MGMT_EV_REMOTE_NAME 0x0013 |
| 349 | struct mgmt_ev_remote_name { |
| 350 | bdaddr_t bdaddr; |
| 351 | __u8 name[MGMT_MAX_NAME_LENGTH]; |
| 352 | } __packed; |
Johan Hedberg | 314b238 | 2011-04-27 10:29:57 -0400 | [diff] [blame] | 353 | |
| 354 | #define MGMT_EV_DISCOVERING 0x0014 |
Antti Julku | 5e76244 | 2011-08-25 16:48:02 +0300 | [diff] [blame] | 355 | |
| 356 | #define MGMT_EV_DEVICE_BLOCKED 0x0015 |
| 357 | struct mgmt_ev_device_blocked { |
| 358 | bdaddr_t bdaddr; |
| 359 | } __packed; |
| 360 | |
| 361 | #define MGMT_EV_DEVICE_UNBLOCKED 0x0016 |
| 362 | struct mgmt_ev_device_unblocked { |
| 363 | bdaddr_t bdaddr; |
| 364 | } __packed; |
Brian Gix | c768708 | 2011-11-16 13:53:12 -0800 | [diff] [blame] | 365 | |
| 366 | #define MGMT_EV_USER_PASSKEY_REQUEST 0x0017 |
| 367 | struct mgmt_ev_user_passkey_request { |
| 368 | bdaddr_t bdaddr; |
| 369 | } __packed; |