aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/mgmt.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/bluetooth/mgmt.h')
-rw-r--r--include/net/bluetooth/mgmt.h126
1 files changed, 64 insertions, 62 deletions
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 0a694480c27e..42eb48bb2c3b 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -46,6 +46,16 @@ struct mgmt_hdr {
46 __le16 len; 46 __le16 len;
47} __packed; 47} __packed;
48 48
49#define MGMT_ADDR_BREDR 0x00
50#define MGMT_ADDR_LE_PUBLIC 0x01
51#define MGMT_ADDR_LE_RANDOM 0x02
52#define MGMT_ADDR_INVALID 0xff
53
54struct mgmt_addr_info {
55 bdaddr_t bdaddr;
56 __u8 type;
57} __packed;
58
49#define MGMT_OP_READ_VERSION 0x0001 59#define MGMT_OP_READ_VERSION 0x0001
50struct mgmt_rp_read_version { 60struct mgmt_rp_read_version {
51 __u8 version; 61 __u8 version;
@@ -148,7 +158,23 @@ struct mgmt_cp_load_link_keys {
148 struct mgmt_link_key_info keys[0]; 158 struct mgmt_link_key_info keys[0];
149} __packed; 159} __packed;
150 160
151#define MGMT_OP_REMOVE_KEYS 0x0013 161struct mgmt_ltk_info {
162 struct mgmt_addr_info addr;
163 __u8 authenticated;
164 __u8 master;
165 __u8 enc_size;
166 __le16 ediv;
167 __u8 rand[8];
168 __u8 val[16];
169} __packed;
170
171#define MGMT_OP_LOAD_LONG_TERM_KEYS 0x0013
172struct mgmt_cp_load_long_term_keys {
173 __le16 key_count;
174 struct mgmt_ltk_info keys[0];
175} __packed;
176
177#define MGMT_OP_REMOVE_KEYS 0x0014
152struct mgmt_cp_remove_keys { 178struct mgmt_cp_remove_keys {
153 bdaddr_t bdaddr; 179 bdaddr_t bdaddr;
154 __u8 disconnect; 180 __u8 disconnect;
@@ -158,7 +184,7 @@ struct mgmt_rp_remove_keys {
158 __u8 status; 184 __u8 status;
159}; 185};
160 186
161#define MGMT_OP_DISCONNECT 0x0014 187#define MGMT_OP_DISCONNECT 0x0015
162struct mgmt_cp_disconnect { 188struct mgmt_cp_disconnect {
163 bdaddr_t bdaddr; 189 bdaddr_t bdaddr;
164} __packed; 190} __packed;
@@ -167,23 +193,13 @@ struct mgmt_rp_disconnect {
167 __u8 status; 193 __u8 status;
168} __packed; 194} __packed;
169 195
170#define MGMT_ADDR_BREDR 0x00 196#define MGMT_OP_GET_CONNECTIONS 0x0016
171#define MGMT_ADDR_LE_PUBLIC 0x01
172#define MGMT_ADDR_LE_RANDOM 0x02
173#define MGMT_ADDR_INVALID 0xff
174
175struct mgmt_addr_info {
176 bdaddr_t bdaddr;
177 __u8 type;
178} __packed;
179
180#define MGMT_OP_GET_CONNECTIONS 0x0015
181struct mgmt_rp_get_connections { 197struct mgmt_rp_get_connections {
182 __le16 conn_count; 198 __le16 conn_count;
183 struct mgmt_addr_info addr[0]; 199 struct mgmt_addr_info addr[0];
184} __packed; 200} __packed;
185 201
186#define MGMT_OP_PIN_CODE_REPLY 0x0016 202#define MGMT_OP_PIN_CODE_REPLY 0x0017
187struct mgmt_cp_pin_code_reply { 203struct mgmt_cp_pin_code_reply {
188 bdaddr_t bdaddr; 204 bdaddr_t bdaddr;
189 __u8 pin_len; 205 __u8 pin_len;
@@ -194,17 +210,17 @@ struct mgmt_rp_pin_code_reply {
194 uint8_t status; 210 uint8_t status;
195} __packed; 211} __packed;
196 212
197#define MGMT_OP_PIN_CODE_NEG_REPLY 0x0017 213#define MGMT_OP_PIN_CODE_NEG_REPLY 0x0018
198struct mgmt_cp_pin_code_neg_reply { 214struct mgmt_cp_pin_code_neg_reply {
199 bdaddr_t bdaddr; 215 bdaddr_t bdaddr;
200} __packed; 216} __packed;
201 217
202#define MGMT_OP_SET_IO_CAPABILITY 0x0018 218#define MGMT_OP_SET_IO_CAPABILITY 0x0019
203struct mgmt_cp_set_io_capability { 219struct mgmt_cp_set_io_capability {
204 __u8 io_capability; 220 __u8 io_capability;
205} __packed; 221} __packed;
206 222
207#define MGMT_OP_PAIR_DEVICE 0x0019 223#define MGMT_OP_PAIR_DEVICE 0x001A
208struct mgmt_cp_pair_device { 224struct mgmt_cp_pair_device {
209 struct mgmt_addr_info addr; 225 struct mgmt_addr_info addr;
210 __u8 io_cap; 226 __u8 io_cap;
@@ -214,7 +230,9 @@ struct mgmt_rp_pair_device {
214 __u8 status; 230 __u8 status;
215} __packed; 231} __packed;
216 232
217#define MGMT_OP_USER_CONFIRM_REPLY 0x001A 233#define MGMT_OP_CANCEL_PAIR_DEVICE 0x001B
234
235#define MGMT_OP_USER_CONFIRM_REPLY 0x001C
218struct mgmt_cp_user_confirm_reply { 236struct mgmt_cp_user_confirm_reply {
219 bdaddr_t bdaddr; 237 bdaddr_t bdaddr;
220} __packed; 238} __packed;
@@ -223,12 +241,12 @@ struct mgmt_rp_user_confirm_reply {
223 __u8 status; 241 __u8 status;
224} __packed; 242} __packed;
225 243
226#define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x001B 244#define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x001D
227struct mgmt_cp_user_confirm_neg_reply { 245struct mgmt_cp_user_confirm_neg_reply {
228 bdaddr_t bdaddr; 246 bdaddr_t bdaddr;
229} __packed; 247} __packed;
230 248
231#define MGMT_OP_USER_PASSKEY_REPLY 0x001C 249#define MGMT_OP_USER_PASSKEY_REPLY 0x001E
232struct mgmt_cp_user_passkey_reply { 250struct mgmt_cp_user_passkey_reply {
233 bdaddr_t bdaddr; 251 bdaddr_t bdaddr;
234 __le32 passkey; 252 __le32 passkey;
@@ -238,37 +256,37 @@ struct mgmt_rp_user_passkey_reply {
238 __u8 status; 256 __u8 status;
239} __packed; 257} __packed;
240 258
241#define MGMT_OP_USER_PASSKEY_NEG_REPLY 0x001D 259#define MGMT_OP_USER_PASSKEY_NEG_REPLY 0x001F
242struct mgmt_cp_user_passkey_neg_reply { 260struct mgmt_cp_user_passkey_neg_reply {
243 bdaddr_t bdaddr; 261 bdaddr_t bdaddr;
244} __packed; 262} __packed;
245 263
246#define MGMT_OP_READ_LOCAL_OOB_DATA 0x001E 264#define MGMT_OP_READ_LOCAL_OOB_DATA 0x0020
247struct mgmt_rp_read_local_oob_data { 265struct mgmt_rp_read_local_oob_data {
248 __u8 hash[16]; 266 __u8 hash[16];
249 __u8 randomizer[16]; 267 __u8 randomizer[16];
250} __packed; 268} __packed;
251 269
252#define MGMT_OP_ADD_REMOTE_OOB_DATA 0x001F 270#define MGMT_OP_ADD_REMOTE_OOB_DATA 0x0021
253struct mgmt_cp_add_remote_oob_data { 271struct mgmt_cp_add_remote_oob_data {
254 bdaddr_t bdaddr; 272 bdaddr_t bdaddr;
255 __u8 hash[16]; 273 __u8 hash[16];
256 __u8 randomizer[16]; 274 __u8 randomizer[16];
257} __packed; 275} __packed;
258 276
259#define MGMT_OP_REMOVE_REMOTE_OOB_DATA 0x0020 277#define MGMT_OP_REMOVE_REMOTE_OOB_DATA 0x0022
260struct mgmt_cp_remove_remote_oob_data { 278struct mgmt_cp_remove_remote_oob_data {
261 bdaddr_t bdaddr; 279 bdaddr_t bdaddr;
262} __packed; 280} __packed;
263 281
264#define MGMT_OP_START_DISCOVERY 0x0021 282#define MGMT_OP_START_DISCOVERY 0x0023
265struct mgmt_cp_start_discovery { 283struct mgmt_cp_start_discovery {
266 __u8 type; 284 __u8 type;
267} __packed; 285} __packed;
268 286
269#define MGMT_OP_STOP_DISCOVERY 0x0022 287#define MGMT_OP_STOP_DISCOVERY 0x0024
270 288
271#define MGMT_OP_CONFIRM_NAME 0x0023 289#define MGMT_OP_CONFIRM_NAME 0x0025
272struct mgmt_cp_confirm_name { 290struct mgmt_cp_confirm_name {
273 bdaddr_t bdaddr; 291 bdaddr_t bdaddr;
274 __u8 name_known; 292 __u8 name_known;
@@ -278,32 +296,16 @@ struct mgmt_rp_confirm_name {
278 __u8 status; 296 __u8 status;
279} __packed; 297} __packed;
280 298
281#define MGMT_OP_BLOCK_DEVICE 0x0024 299#define MGMT_OP_BLOCK_DEVICE 0x0026
282struct mgmt_cp_block_device { 300struct mgmt_cp_block_device {
283 bdaddr_t bdaddr; 301 bdaddr_t bdaddr;
284} __packed; 302} __packed;
285 303
286#define MGMT_OP_UNBLOCK_DEVICE 0x0025 304#define MGMT_OP_UNBLOCK_DEVICE 0x0027
287struct mgmt_cp_unblock_device { 305struct mgmt_cp_unblock_device {
288 bdaddr_t bdaddr; 306 bdaddr_t bdaddr;
289} __packed; 307} __packed;
290 308
291struct mgmt_ltk_info {
292 struct mgmt_addr_info addr;
293 __u8 authenticated;
294 __u8 master;
295 __u8 enc_size;
296 __le16 ediv;
297 __u8 rand[8];
298 __u8 val[16];
299} __packed;
300
301#define MGMT_OP_LOAD_LONG_TERM_KEYS 0x0026
302struct mgmt_cp_load_long_term_keys {
303 __le16 key_count;
304 struct mgmt_ltk_info keys[0];
305} __packed;
306
307#define MGMT_EV_CMD_COMPLETE 0x0001 309#define MGMT_EV_CMD_COMPLETE 0x0001
308struct mgmt_ev_cmd_complete { 310struct mgmt_ev_cmd_complete {
309 __le16 opcode; 311 __le16 opcode;
@@ -344,46 +346,52 @@ struct mgmt_ev_new_link_key {
344 struct mgmt_link_key_info key; 346 struct mgmt_link_key_info key;
345} __packed; 347} __packed;
346 348
347#define MGMT_EV_DEVICE_CONNECTED 0x000A 349#define MGMT_EV_NEW_LONG_TERM_KEY 0x000A
350struct mgmt_ev_new_long_term_key {
351 __u8 store_hint;
352 struct mgmt_ltk_info key;
353} __packed;
354
355#define MGMT_EV_DEVICE_CONNECTED 0x000B
348struct mgmt_ev_device_connected { 356struct mgmt_ev_device_connected {
349 struct mgmt_addr_info addr; 357 struct mgmt_addr_info addr;
350 __le16 eir_len; 358 __le16 eir_len;
351 __u8 eir[0]; 359 __u8 eir[0];
352} __packed; 360} __packed;
353 361
354#define MGMT_EV_DEVICE_DISCONNECTED 0x000B 362#define MGMT_EV_DEVICE_DISCONNECTED 0x000C
355 363
356#define MGMT_EV_CONNECT_FAILED 0x000C 364#define MGMT_EV_CONNECT_FAILED 0x000D
357struct mgmt_ev_connect_failed { 365struct mgmt_ev_connect_failed {
358 struct mgmt_addr_info addr; 366 struct mgmt_addr_info addr;
359 __u8 status; 367 __u8 status;
360} __packed; 368} __packed;
361 369
362#define MGMT_EV_PIN_CODE_REQUEST 0x000D 370#define MGMT_EV_PIN_CODE_REQUEST 0x000E
363struct mgmt_ev_pin_code_request { 371struct mgmt_ev_pin_code_request {
364 bdaddr_t bdaddr; 372 bdaddr_t bdaddr;
365 __u8 secure; 373 __u8 secure;
366} __packed; 374} __packed;
367 375
368#define MGMT_EV_USER_CONFIRM_REQUEST 0x000E 376#define MGMT_EV_USER_CONFIRM_REQUEST 0x000F
369struct mgmt_ev_user_confirm_request { 377struct mgmt_ev_user_confirm_request {
370 bdaddr_t bdaddr; 378 bdaddr_t bdaddr;
371 __u8 confirm_hint; 379 __u8 confirm_hint;
372 __le32 value; 380 __le32 value;
373} __packed; 381} __packed;
374 382
375#define MGMT_EV_USER_PASSKEY_REQUEST 0x000F 383#define MGMT_EV_USER_PASSKEY_REQUEST 0x0010
376struct mgmt_ev_user_passkey_request { 384struct mgmt_ev_user_passkey_request {
377 bdaddr_t bdaddr; 385 bdaddr_t bdaddr;
378} __packed; 386} __packed;
379 387
380#define MGMT_EV_AUTH_FAILED 0x0010 388#define MGMT_EV_AUTH_FAILED 0x0011
381struct mgmt_ev_auth_failed { 389struct mgmt_ev_auth_failed {
382 bdaddr_t bdaddr; 390 bdaddr_t bdaddr;
383 __u8 status; 391 __u8 status;
384} __packed; 392} __packed;
385 393
386#define MGMT_EV_DEVICE_FOUND 0x0011 394#define MGMT_EV_DEVICE_FOUND 0x0012
387struct mgmt_ev_device_found { 395struct mgmt_ev_device_found {
388 struct mgmt_addr_info addr; 396 struct mgmt_addr_info addr;
389 __s8 rssi; 397 __s8 rssi;
@@ -392,20 +400,14 @@ struct mgmt_ev_device_found {
392 __u8 eir[0]; 400 __u8 eir[0];
393} __packed; 401} __packed;
394 402
395#define MGMT_EV_DISCOVERING 0x0012 403#define MGMT_EV_DISCOVERING 0x0013
396 404
397#define MGMT_EV_DEVICE_BLOCKED 0x0013 405#define MGMT_EV_DEVICE_BLOCKED 0x0014
398struct mgmt_ev_device_blocked { 406struct mgmt_ev_device_blocked {
399 bdaddr_t bdaddr; 407 bdaddr_t bdaddr;
400} __packed; 408} __packed;
401 409
402#define MGMT_EV_DEVICE_UNBLOCKED 0x0014 410#define MGMT_EV_DEVICE_UNBLOCKED 0x0015
403struct mgmt_ev_device_unblocked { 411struct mgmt_ev_device_unblocked {
404 bdaddr_t bdaddr; 412 bdaddr_t bdaddr;
405} __packed; 413} __packed;
406
407#define MGMT_EV_NEW_LONG_TERM_KEY 0x0015
408struct mgmt_ev_new_long_term_key {
409 __u8 store_hint;
410 struct mgmt_ltk_info key;
411} __packed;