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.h191
1 files changed, 108 insertions, 83 deletions
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 3b6880690a78..be65d3417883 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -61,22 +61,29 @@ struct mgmt_rp_read_index_list {
61/* Reserve one extra byte for names in management messages so that they 61/* Reserve one extra byte for names in management messages so that they
62 * are always guaranteed to be nul-terminated */ 62 * are always guaranteed to be nul-terminated */
63#define MGMT_MAX_NAME_LENGTH (HCI_MAX_NAME_LENGTH + 1) 63#define MGMT_MAX_NAME_LENGTH (HCI_MAX_NAME_LENGTH + 1)
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
64 76
65#define MGMT_OP_READ_INFO 0x0004 77#define MGMT_OP_READ_INFO 0x0004
66struct mgmt_rp_read_info { 78struct mgmt_rp_read_info {
67 __u8 type;
68 __u8 powered;
69 __u8 connectable;
70 __u8 discoverable;
71 __u8 pairable;
72 __u8 sec_mode;
73 bdaddr_t bdaddr; 79 bdaddr_t bdaddr;
80 __u8 version;
81 __le16 manufacturer;
82 __le32 supported_settings;
83 __le32 current_settings;
74 __u8 dev_class[3]; 84 __u8 dev_class[3];
75 __u8 features[8];
76 __u16 manufacturer;
77 __u8 hci_ver;
78 __u16 hci_rev;
79 __u8 name[MGMT_MAX_NAME_LENGTH]; 85 __u8 name[MGMT_MAX_NAME_LENGTH];
86 __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH];
80} __packed; 87} __packed;
81 88
82struct mgmt_mode { 89struct mgmt_mode {
@@ -93,28 +100,38 @@ struct mgmt_cp_set_discoverable {
93 100
94#define MGMT_OP_SET_CONNECTABLE 0x0007 101#define MGMT_OP_SET_CONNECTABLE 0x0007
95 102
96#define MGMT_OP_SET_PAIRABLE 0x0008 103#define MGMT_OP_SET_FAST_CONNECTABLE 0x0008
97 104
98#define MGMT_OP_ADD_UUID 0x0009 105#define MGMT_OP_SET_PAIRABLE 0x0009
99struct mgmt_cp_add_uuid {
100 __u8 uuid[16];
101 __u8 svc_hint;
102} __packed;
103 106
104#define MGMT_OP_REMOVE_UUID 0x000A 107#define MGMT_OP_SET_LINK_SECURITY 0x000A
105struct mgmt_cp_remove_uuid {
106 __u8 uuid[16];
107} __packed;
108 108
109#define MGMT_OP_SET_DEV_CLASS 0x000B 109#define MGMT_OP_SET_SSP 0x000B
110
111#define MGMT_OP_SET_HS 0x000C
112
113#define MGMT_OP_SET_LE 0x000D
114
115#define MGMT_OP_SET_DEV_CLASS 0x000E
110struct mgmt_cp_set_dev_class { 116struct mgmt_cp_set_dev_class {
111 __u8 major; 117 __u8 major;
112 __u8 minor; 118 __u8 minor;
113} __packed; 119} __packed;
114 120
115#define MGMT_OP_SET_SERVICE_CACHE 0x000C 121#define MGMT_OP_SET_LOCAL_NAME 0x000F
116struct mgmt_cp_set_service_cache { 122struct mgmt_cp_set_local_name {
117 __u8 enable; 123 __u8 name[MGMT_MAX_NAME_LENGTH];
124} __packed;
125
126#define MGMT_OP_ADD_UUID 0x0010
127struct mgmt_cp_add_uuid {
128 __u8 uuid[16];
129 __u8 svc_hint;
130} __packed;
131
132#define MGMT_OP_REMOVE_UUID 0x0011
133struct mgmt_cp_remove_uuid {
134 __u8 uuid[16];
118} __packed; 135} __packed;
119 136
120struct mgmt_link_key_info { 137struct mgmt_link_key_info {
@@ -124,14 +141,14 @@ struct mgmt_link_key_info {
124 u8 pin_len; 141 u8 pin_len;
125} __packed; 142} __packed;
126 143
127#define MGMT_OP_LOAD_LINK_KEYS 0x000D 144#define MGMT_OP_LOAD_LINK_KEYS 0x0012
128struct mgmt_cp_load_link_keys { 145struct mgmt_cp_load_link_keys {
129 __u8 debug_keys; 146 __u8 debug_keys;
130 __le16 key_count; 147 __le16 key_count;
131 struct mgmt_link_key_info keys[0]; 148 struct mgmt_link_key_info keys[0];
132} __packed; 149} __packed;
133 150
134#define MGMT_OP_REMOVE_KEYS 0x000E 151#define MGMT_OP_REMOVE_KEYS 0x0013
135struct mgmt_cp_remove_keys { 152struct mgmt_cp_remove_keys {
136 bdaddr_t bdaddr; 153 bdaddr_t bdaddr;
137 __u8 disconnect; 154 __u8 disconnect;
@@ -141,7 +158,7 @@ struct mgmt_rp_remove_keys {
141 __u8 status; 158 __u8 status;
142}; 159};
143 160
144#define MGMT_OP_DISCONNECT 0x000F 161#define MGMT_OP_DISCONNECT 0x0014
145struct mgmt_cp_disconnect { 162struct mgmt_cp_disconnect {
146 bdaddr_t bdaddr; 163 bdaddr_t bdaddr;
147} __packed; 164} __packed;
@@ -160,13 +177,13 @@ struct mgmt_addr_info {
160 __u8 type; 177 __u8 type;
161} __packed; 178} __packed;
162 179
163#define MGMT_OP_GET_CONNECTIONS 0x0010 180#define MGMT_OP_GET_CONNECTIONS 0x0015
164struct mgmt_rp_get_connections { 181struct mgmt_rp_get_connections {
165 __le16 conn_count; 182 __le16 conn_count;
166 struct mgmt_addr_info addr[0]; 183 struct mgmt_addr_info addr[0];
167} __packed; 184} __packed;
168 185
169#define MGMT_OP_PIN_CODE_REPLY 0x0011 186#define MGMT_OP_PIN_CODE_REPLY 0x0016
170struct mgmt_cp_pin_code_reply { 187struct mgmt_cp_pin_code_reply {
171 bdaddr_t bdaddr; 188 bdaddr_t bdaddr;
172 __u8 pin_len; 189 __u8 pin_len;
@@ -177,17 +194,17 @@ struct mgmt_rp_pin_code_reply {
177 uint8_t status; 194 uint8_t status;
178} __packed; 195} __packed;
179 196
180#define MGMT_OP_PIN_CODE_NEG_REPLY 0x0012 197#define MGMT_OP_PIN_CODE_NEG_REPLY 0x0017
181struct mgmt_cp_pin_code_neg_reply { 198struct mgmt_cp_pin_code_neg_reply {
182 bdaddr_t bdaddr; 199 bdaddr_t bdaddr;
183} __packed; 200} __packed;
184 201
185#define MGMT_OP_SET_IO_CAPABILITY 0x0013 202#define MGMT_OP_SET_IO_CAPABILITY 0x0018
186struct mgmt_cp_set_io_capability { 203struct mgmt_cp_set_io_capability {
187 __u8 io_capability; 204 __u8 io_capability;
188} __packed; 205} __packed;
189 206
190#define MGMT_OP_PAIR_DEVICE 0x0014 207#define MGMT_OP_PAIR_DEVICE 0x0019
191struct mgmt_cp_pair_device { 208struct mgmt_cp_pair_device {
192 struct mgmt_addr_info addr; 209 struct mgmt_addr_info addr;
193 __u8 io_cap; 210 __u8 io_cap;
@@ -197,7 +214,7 @@ struct mgmt_rp_pair_device {
197 __u8 status; 214 __u8 status;
198} __packed; 215} __packed;
199 216
200#define MGMT_OP_USER_CONFIRM_REPLY 0x0015 217#define MGMT_OP_USER_CONFIRM_REPLY 0x001A
201struct mgmt_cp_user_confirm_reply { 218struct mgmt_cp_user_confirm_reply {
202 bdaddr_t bdaddr; 219 bdaddr_t bdaddr;
203} __packed; 220} __packed;
@@ -206,61 +223,68 @@ struct mgmt_rp_user_confirm_reply {
206 __u8 status; 223 __u8 status;
207} __packed; 224} __packed;
208 225
209#define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x0016 226#define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x001B
227struct mgmt_cp_user_confirm_neg_reply {
228 bdaddr_t bdaddr;
229} __packed;
210 230
211#define MGMT_OP_SET_LOCAL_NAME 0x0017 231#define MGMT_OP_USER_PASSKEY_REPLY 0x001C
212struct mgmt_cp_set_local_name { 232struct mgmt_cp_user_passkey_reply {
213 __u8 name[MGMT_MAX_NAME_LENGTH]; 233 bdaddr_t bdaddr;
234 __le32 passkey;
235} __packed;
236struct mgmt_rp_user_passkey_reply {
237 bdaddr_t bdaddr;
238 __u8 status;
214} __packed; 239} __packed;
215 240
216#define MGMT_OP_READ_LOCAL_OOB_DATA 0x0018 241#define MGMT_OP_USER_PASSKEY_NEG_REPLY 0x001D
242struct mgmt_cp_user_passkey_neg_reply {
243 bdaddr_t bdaddr;
244} __packed;
245
246#define MGMT_OP_READ_LOCAL_OOB_DATA 0x001E
217struct mgmt_rp_read_local_oob_data { 247struct mgmt_rp_read_local_oob_data {
218 __u8 hash[16]; 248 __u8 hash[16];
219 __u8 randomizer[16]; 249 __u8 randomizer[16];
220} __packed; 250} __packed;
221 251
222#define MGMT_OP_ADD_REMOTE_OOB_DATA 0x0019 252#define MGMT_OP_ADD_REMOTE_OOB_DATA 0x001F
223struct mgmt_cp_add_remote_oob_data { 253struct mgmt_cp_add_remote_oob_data {
224 bdaddr_t bdaddr; 254 bdaddr_t bdaddr;
225 __u8 hash[16]; 255 __u8 hash[16];
226 __u8 randomizer[16]; 256 __u8 randomizer[16];
227} __packed; 257} __packed;
228 258
229#define MGMT_OP_REMOVE_REMOTE_OOB_DATA 0x001A 259#define MGMT_OP_REMOVE_REMOTE_OOB_DATA 0x0020
230struct mgmt_cp_remove_remote_oob_data { 260struct mgmt_cp_remove_remote_oob_data {
231 bdaddr_t bdaddr; 261 bdaddr_t bdaddr;
232} __packed; 262} __packed;
233 263
234#define MGMT_OP_START_DISCOVERY 0x001B 264#define MGMT_OP_START_DISCOVERY 0x0021
235struct mgmt_cp_start_discovery { 265struct mgmt_cp_start_discovery {
236 __u8 type; 266 __u8 type;
237} __packed; 267} __packed;
238 268
239#define MGMT_OP_STOP_DISCOVERY 0x001C 269#define MGMT_OP_STOP_DISCOVERY 0x0022
240 270
241#define MGMT_OP_BLOCK_DEVICE 0x001D 271#define MGMT_OP_CONFIRM_NAME 0x0023
242struct mgmt_cp_block_device { 272struct mgmt_cp_confirm_name {
243 bdaddr_t bdaddr; 273 bdaddr_t bdaddr;
274 __u8 name_known;
244} __packed; 275} __packed;
245 276struct mgmt_rp_confirm_name {
246#define MGMT_OP_UNBLOCK_DEVICE 0x001E
247struct mgmt_cp_unblock_device {
248 bdaddr_t bdaddr; 277 bdaddr_t bdaddr;
278 __u8 status;
249} __packed; 279} __packed;
250 280
251#define MGMT_OP_SET_FAST_CONNECTABLE 0x001F 281#define MGMT_OP_BLOCK_DEVICE 0x0024
252struct mgmt_cp_set_fast_connectable { 282struct mgmt_cp_block_device {
253 __u8 enable;
254} __packed;
255
256#define MGMT_OP_USER_PASSKEY_REPLY 0x0020
257struct mgmt_cp_user_passkey_reply {
258 bdaddr_t bdaddr; 283 bdaddr_t bdaddr;
259 __le32 passkey;
260} __packed; 284} __packed;
261 285
262#define MGMT_OP_USER_PASSKEY_NEG_REPLY 0x0021 286#define MGMT_OP_UNBLOCK_DEVICE 0x0025
263struct mgmt_cp_user_passkey_neg_reply { 287struct mgmt_cp_unblock_device {
264 bdaddr_t bdaddr; 288 bdaddr_t bdaddr;
265} __packed; 289} __packed;
266 290
@@ -285,81 +309,82 @@ struct mgmt_ev_controller_error {
285 309
286#define MGMT_EV_INDEX_REMOVED 0x0005 310#define MGMT_EV_INDEX_REMOVED 0x0005
287 311
288#define MGMT_EV_POWERED 0x0006 312#define MGMT_EV_NEW_SETTINGS 0x0006
289 313
290#define MGMT_EV_DISCOVERABLE 0x0007 314#define MGMT_EV_CLASS_OF_DEV_CHANGED 0x0007
291 315struct mgmt_ev_class_of_dev_changed {
292#define MGMT_EV_CONNECTABLE 0x0008 316 __u8 dev_class[3];
317};
293 318
294#define MGMT_EV_PAIRABLE 0x0009 319#define MGMT_EV_LOCAL_NAME_CHANGED 0x0008
320struct mgmt_ev_local_name_changed {
321 __u8 name[MGMT_MAX_NAME_LENGTH];
322 __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH];
323} __packed;
295 324
296#define MGMT_EV_NEW_LINK_KEY 0x000A 325#define MGMT_EV_NEW_LINK_KEY 0x0009
297struct mgmt_ev_new_link_key { 326struct mgmt_ev_new_link_key {
298 __u8 store_hint; 327 __u8 store_hint;
299 struct mgmt_link_key_info key; 328 struct mgmt_link_key_info key;
300} __packed; 329} __packed;
301 330
302#define MGMT_EV_CONNECTED 0x000B 331#define MGMT_EV_CONNECTED 0x000A
303 332
304#define MGMT_EV_DISCONNECTED 0x000C 333#define MGMT_EV_DISCONNECTED 0x000B
305 334
306#define MGMT_EV_CONNECT_FAILED 0x000D 335#define MGMT_EV_CONNECT_FAILED 0x000C
307struct mgmt_ev_connect_failed { 336struct mgmt_ev_connect_failed {
308 struct mgmt_addr_info addr; 337 struct mgmt_addr_info addr;
309 __u8 status; 338 __u8 status;
310} __packed; 339} __packed;
311 340
312#define MGMT_EV_PIN_CODE_REQUEST 0x000E 341#define MGMT_EV_PIN_CODE_REQUEST 0x000D
313struct mgmt_ev_pin_code_request { 342struct mgmt_ev_pin_code_request {
314 bdaddr_t bdaddr; 343 bdaddr_t bdaddr;
315 __u8 secure; 344 __u8 secure;
316} __packed; 345} __packed;
317 346
318#define MGMT_EV_USER_CONFIRM_REQUEST 0x000F 347#define MGMT_EV_USER_CONFIRM_REQUEST 0x000E
319struct mgmt_ev_user_confirm_request { 348struct mgmt_ev_user_confirm_request {
320 bdaddr_t bdaddr; 349 bdaddr_t bdaddr;
321 __u8 confirm_hint; 350 __u8 confirm_hint;
322 __le32 value; 351 __le32 value;
323} __packed; 352} __packed;
324 353
354#define MGMT_EV_USER_PASSKEY_REQUEST 0x000F
355struct mgmt_ev_user_passkey_request {
356 bdaddr_t bdaddr;
357} __packed;
358
325#define MGMT_EV_AUTH_FAILED 0x0010 359#define MGMT_EV_AUTH_FAILED 0x0010
326struct mgmt_ev_auth_failed { 360struct mgmt_ev_auth_failed {
327 bdaddr_t bdaddr; 361 bdaddr_t bdaddr;
328 __u8 status; 362 __u8 status;
329} __packed; 363} __packed;
330 364
331#define MGMT_EV_LOCAL_NAME_CHANGED 0x0011 365#define MGMT_EV_DEVICE_FOUND 0x0011
332struct mgmt_ev_local_name_changed {
333 __u8 name[MGMT_MAX_NAME_LENGTH];
334} __packed;
335
336#define MGMT_EV_DEVICE_FOUND 0x0012
337struct mgmt_ev_device_found { 366struct mgmt_ev_device_found {
338 struct mgmt_addr_info addr; 367 struct mgmt_addr_info addr;
339 __u8 dev_class[3]; 368 __u8 dev_class[3];
340 __s8 rssi; 369 __s8 rssi;
370 __u8 confirm_name;
341 __u8 eir[HCI_MAX_EIR_LENGTH]; 371 __u8 eir[HCI_MAX_EIR_LENGTH];
342} __packed; 372} __packed;
343 373
344#define MGMT_EV_REMOTE_NAME 0x0013 374#define MGMT_EV_REMOTE_NAME 0x0012
345struct mgmt_ev_remote_name { 375struct mgmt_ev_remote_name {
346 bdaddr_t bdaddr; 376 bdaddr_t bdaddr;
347 __u8 name[MGMT_MAX_NAME_LENGTH]; 377 __u8 name[MGMT_MAX_NAME_LENGTH];
348} __packed; 378} __packed;
349 379
350#define MGMT_EV_DISCOVERING 0x0014 380#define MGMT_EV_DISCOVERING 0x0013
351 381
352#define MGMT_EV_DEVICE_BLOCKED 0x0015 382#define MGMT_EV_DEVICE_BLOCKED 0x0014
353struct mgmt_ev_device_blocked { 383struct mgmt_ev_device_blocked {
354 bdaddr_t bdaddr; 384 bdaddr_t bdaddr;
355} __packed; 385} __packed;
356 386
357#define MGMT_EV_DEVICE_UNBLOCKED 0x0016 387#define MGMT_EV_DEVICE_UNBLOCKED 0x0015
358struct mgmt_ev_device_unblocked { 388struct mgmt_ev_device_unblocked {
359 bdaddr_t bdaddr; 389 bdaddr_t bdaddr;
360} __packed; 390} __packed;
361
362#define MGMT_EV_USER_PASSKEY_REQUEST 0x0017
363struct mgmt_ev_user_passkey_request {
364 bdaddr_t bdaddr;
365} __packed;