aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2012-03-06 21:39:50 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2012-03-06 22:04:23 -0500
commitc4762507342dabbe6896ef288df0851ac7dd63d6 (patch)
tree13e8c9805c3995a275a94f4796542df7bf88a2ac /include/net
parent0a4eaeeb993658a4d6cff054a863241f32d3d2fb (diff)
Bluetooth: Fix coding style in mgmt.h
Align struct definition in a proper way. Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/mgmt.h157
1 files changed, 78 insertions, 79 deletions
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 0ca3519e08bd..61953dc848a6 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -44,37 +44,37 @@
44#define MGMT_STATUS_INVALID_INDEX 0x11 44#define MGMT_STATUS_INVALID_INDEX 0x11
45 45
46struct mgmt_hdr { 46struct mgmt_hdr {
47 __le16 opcode; 47 __le16 opcode;
48 __le16 index; 48 __le16 index;
49 __le16 len; 49 __le16 len;
50} __packed; 50} __packed;
51 51
52struct mgmt_addr_info { 52struct mgmt_addr_info {
53 bdaddr_t bdaddr; 53 bdaddr_t bdaddr;
54 __u8 type; 54 __u8 type;
55} __packed; 55} __packed;
56#define MGMT_ADDR_INFO_SIZE 7 56#define MGMT_ADDR_INFO_SIZE 7
57 57
58#define MGMT_OP_READ_VERSION 0x0001 58#define MGMT_OP_READ_VERSION 0x0001
59#define MGMT_READ_VERSION_SIZE 0 59#define MGMT_READ_VERSION_SIZE 0
60struct mgmt_rp_read_version { 60struct mgmt_rp_read_version {
61 __u8 version; 61 __u8 version;
62 __le16 revision; 62 __le16 revision;
63} __packed; 63} __packed;
64 64
65#define MGMT_OP_READ_COMMANDS 0x0002 65#define MGMT_OP_READ_COMMANDS 0x0002
66#define MGMT_READ_COMMANDS_SIZE 0 66#define MGMT_READ_COMMANDS_SIZE 0
67struct mgmt_rp_read_commands { 67struct mgmt_rp_read_commands {
68 __le16 num_commands; 68 __le16 num_commands;
69 __le16 num_events; 69 __le16 num_events;
70 __le16 opcodes[0]; 70 __le16 opcodes[0];
71} __packed; 71} __packed;
72 72
73#define MGMT_OP_READ_INDEX_LIST 0x0003 73#define MGMT_OP_READ_INDEX_LIST 0x0003
74#define MGMT_READ_INDEX_LIST_SIZE 0 74#define MGMT_READ_INDEX_LIST_SIZE 0
75struct mgmt_rp_read_index_list { 75struct mgmt_rp_read_index_list {
76 __le16 num_controllers; 76 __le16 num_controllers;
77 __le16 index[0]; 77 __le16 index[0];
78} __packed; 78} __packed;
79 79
80/* Reserve one extra byte for names in management messages so that they 80/* Reserve one extra byte for names in management messages so that they
@@ -96,14 +96,14 @@ struct mgmt_rp_read_index_list {
96#define MGMT_OP_READ_INFO 0x0004 96#define MGMT_OP_READ_INFO 0x0004
97#define MGMT_READ_INFO_SIZE 0 97#define MGMT_READ_INFO_SIZE 0
98struct mgmt_rp_read_info { 98struct mgmt_rp_read_info {
99 bdaddr_t bdaddr; 99 bdaddr_t bdaddr;
100 __u8 version; 100 __u8 version;
101 __le16 manufacturer; 101 __le16 manufacturer;
102 __le32 supported_settings; 102 __le32 supported_settings;
103 __le32 current_settings; 103 __le32 current_settings;
104 __u8 dev_class[3]; 104 __u8 dev_class[3];
105 __u8 name[MGMT_MAX_NAME_LENGTH]; 105 __u8 name[MGMT_MAX_NAME_LENGTH];
106 __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH]; 106 __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH];
107} __packed; 107} __packed;
108 108
109struct mgmt_mode { 109struct mgmt_mode {
@@ -116,8 +116,8 @@ struct mgmt_mode {
116 116
117#define MGMT_OP_SET_DISCOVERABLE 0x0006 117#define MGMT_OP_SET_DISCOVERABLE 0x0006
118struct mgmt_cp_set_discoverable { 118struct mgmt_cp_set_discoverable {
119 __u8 val; 119 __u8 val;
120 __u16 timeout; 120 __u16 timeout;
121} __packed; 121} __packed;
122#define MGMT_SET_DISCOVERABLE_SIZE 3 122#define MGMT_SET_DISCOVERABLE_SIZE 3
123 123
@@ -134,63 +134,62 @@ struct mgmt_cp_set_discoverable {
134#define MGMT_OP_SET_HS 0x000C 134#define MGMT_OP_SET_HS 0x000C
135 135
136#define MGMT_OP_SET_LE 0x000D 136#define MGMT_OP_SET_LE 0x000D
137
138#define MGMT_OP_SET_DEV_CLASS 0x000E 137#define MGMT_OP_SET_DEV_CLASS 0x000E
139struct mgmt_cp_set_dev_class { 138struct mgmt_cp_set_dev_class {
140 __u8 major; 139 __u8 major;
141 __u8 minor; 140 __u8 minor;
142} __packed; 141} __packed;
143#define MGMT_SET_DEV_CLASS_SIZE 2 142#define MGMT_SET_DEV_CLASS_SIZE 2
144 143
145#define MGMT_OP_SET_LOCAL_NAME 0x000F 144#define MGMT_OP_SET_LOCAL_NAME 0x000F
146struct mgmt_cp_set_local_name { 145struct mgmt_cp_set_local_name {
147 __u8 name[MGMT_MAX_NAME_LENGTH]; 146 __u8 name[MGMT_MAX_NAME_LENGTH];
148 __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH]; 147 __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH];
149} __packed; 148} __packed;
150#define MGMT_SET_LOCAL_NAME_SIZE 260 149#define MGMT_SET_LOCAL_NAME_SIZE 260
151 150
152#define MGMT_OP_ADD_UUID 0x0010 151#define MGMT_OP_ADD_UUID 0x0010
153struct mgmt_cp_add_uuid { 152struct mgmt_cp_add_uuid {
154 __u8 uuid[16]; 153 __u8 uuid[16];
155 __u8 svc_hint; 154 __u8 svc_hint;
156} __packed; 155} __packed;
157#define MGMT_ADD_UUID_SIZE 17 156#define MGMT_ADD_UUID_SIZE 17
158 157
159#define MGMT_OP_REMOVE_UUID 0x0011 158#define MGMT_OP_REMOVE_UUID 0x0011
160struct mgmt_cp_remove_uuid { 159struct mgmt_cp_remove_uuid {
161 __u8 uuid[16]; 160 __u8 uuid[16];
162} __packed; 161} __packed;
163#define MGMT_REMOVE_UUID_SIZE 16 162#define MGMT_REMOVE_UUID_SIZE 16
164 163
165struct mgmt_link_key_info { 164struct mgmt_link_key_info {
166 struct mgmt_addr_info addr; 165 struct mgmt_addr_info addr;
167 u8 type; 166 u8 type;
168 u8 val[16]; 167 u8 val[16];
169 u8 pin_len; 168 u8 pin_len;
170} __packed; 169} __packed;
171 170
172#define MGMT_OP_LOAD_LINK_KEYS 0x0012 171#define MGMT_OP_LOAD_LINK_KEYS 0x0012
173struct mgmt_cp_load_link_keys { 172struct mgmt_cp_load_link_keys {
174 __u8 debug_keys; 173 __u8 debug_keys;
175 __le16 key_count; 174 __le16 key_count;
176 struct mgmt_link_key_info keys[0]; 175 struct mgmt_link_key_info keys[0];
177} __packed; 176} __packed;
178#define MGMT_LOAD_LINK_KEYS_SIZE 3 177#define MGMT_LOAD_LINK_KEYS_SIZE 3
179 178
180struct mgmt_ltk_info { 179struct mgmt_ltk_info {
181 struct mgmt_addr_info addr; 180 struct mgmt_addr_info addr;
182 __u8 authenticated; 181 __u8 authenticated;
183 __u8 master; 182 __u8 master;
184 __u8 enc_size; 183 __u8 enc_size;
185 __le16 ediv; 184 __le16 ediv;
186 __u8 rand[8]; 185 __u8 rand[8];
187 __u8 val[16]; 186 __u8 val[16];
188} __packed; 187} __packed;
189 188
190#define MGMT_OP_LOAD_LONG_TERM_KEYS 0x0013 189#define MGMT_OP_LOAD_LONG_TERM_KEYS 0x0013
191struct mgmt_cp_load_long_term_keys { 190struct mgmt_cp_load_long_term_keys {
192 __le16 key_count; 191 __le16 key_count;
193 struct mgmt_ltk_info keys[0]; 192 struct mgmt_ltk_info keys[0];
194} __packed; 193} __packed;
195#define MGMT_LOAD_LONG_TERM_KEYS_SIZE 2 194#define MGMT_LOAD_LONG_TERM_KEYS_SIZE 2
196 195
@@ -213,8 +212,8 @@ struct mgmt_rp_get_connections {
213#define MGMT_OP_PIN_CODE_REPLY 0x0016 212#define MGMT_OP_PIN_CODE_REPLY 0x0016
214struct mgmt_cp_pin_code_reply { 213struct mgmt_cp_pin_code_reply {
215 struct mgmt_addr_info addr; 214 struct mgmt_addr_info addr;
216 __u8 pin_len; 215 __u8 pin_len;
217 __u8 pin_code[16]; 216 __u8 pin_code[16];
218} __packed; 217} __packed;
219#define MGMT_PIN_CODE_REPLY_SIZE (MGMT_ADDR_INFO_SIZE + 17) 218#define MGMT_PIN_CODE_REPLY_SIZE (MGMT_ADDR_INFO_SIZE + 17)
220struct mgmt_rp_pin_code_reply { 219struct mgmt_rp_pin_code_reply {
@@ -229,14 +228,14 @@ struct mgmt_cp_pin_code_neg_reply {
229 228
230#define MGMT_OP_SET_IO_CAPABILITY 0x0018 229#define MGMT_OP_SET_IO_CAPABILITY 0x0018
231struct mgmt_cp_set_io_capability { 230struct mgmt_cp_set_io_capability {
232 __u8 io_capability; 231 __u8 io_capability;
233} __packed; 232} __packed;
234#define MGMT_SET_IO_CAPABILITY_SIZE 1 233#define MGMT_SET_IO_CAPABILITY_SIZE 1
235 234
236#define MGMT_OP_PAIR_DEVICE 0x0019 235#define MGMT_OP_PAIR_DEVICE 0x0019
237struct mgmt_cp_pair_device { 236struct mgmt_cp_pair_device {
238 struct mgmt_addr_info addr; 237 struct mgmt_addr_info addr;
239 __u8 io_cap; 238 __u8 io_cap;
240} __packed; 239} __packed;
241#define MGMT_PAIR_DEVICE_SIZE (MGMT_ADDR_INFO_SIZE + 1) 240#define MGMT_PAIR_DEVICE_SIZE (MGMT_ADDR_INFO_SIZE + 1)
242struct mgmt_rp_pair_device { 241struct mgmt_rp_pair_device {
@@ -274,7 +273,7 @@ struct mgmt_cp_user_confirm_neg_reply {
274#define MGMT_OP_USER_PASSKEY_REPLY 0x001E 273#define MGMT_OP_USER_PASSKEY_REPLY 0x001E
275struct mgmt_cp_user_passkey_reply { 274struct mgmt_cp_user_passkey_reply {
276 struct mgmt_addr_info addr; 275 struct mgmt_addr_info addr;
277 __le32 passkey; 276 __le32 passkey;
278} __packed; 277} __packed;
279#define MGMT_USER_PASSKEY_REPLY_SIZE (MGMT_ADDR_INFO_SIZE + 4) 278#define MGMT_USER_PASSKEY_REPLY_SIZE (MGMT_ADDR_INFO_SIZE + 4)
280struct mgmt_rp_user_passkey_reply { 279struct mgmt_rp_user_passkey_reply {
@@ -290,15 +289,15 @@ struct mgmt_cp_user_passkey_neg_reply {
290#define MGMT_OP_READ_LOCAL_OOB_DATA 0x0020 289#define MGMT_OP_READ_LOCAL_OOB_DATA 0x0020
291#define MGMT_READ_LOCAL_OOB_DATA_SIZE 0 290#define MGMT_READ_LOCAL_OOB_DATA_SIZE 0
292struct mgmt_rp_read_local_oob_data { 291struct mgmt_rp_read_local_oob_data {
293 __u8 hash[16]; 292 __u8 hash[16];
294 __u8 randomizer[16]; 293 __u8 randomizer[16];
295} __packed; 294} __packed;
296 295
297#define MGMT_OP_ADD_REMOTE_OOB_DATA 0x0021 296#define MGMT_OP_ADD_REMOTE_OOB_DATA 0x0021
298struct mgmt_cp_add_remote_oob_data { 297struct mgmt_cp_add_remote_oob_data {
299 struct mgmt_addr_info addr; 298 struct mgmt_addr_info addr;
300 __u8 hash[16]; 299 __u8 hash[16];
301 __u8 randomizer[16]; 300 __u8 randomizer[16];
302} __packed; 301} __packed;
303#define MGMT_ADD_REMOTE_OOB_DATA_SIZE (MGMT_ADDR_INFO_SIZE + 32) 302#define MGMT_ADD_REMOTE_OOB_DATA_SIZE (MGMT_ADDR_INFO_SIZE + 32)
304 303
@@ -323,7 +322,7 @@ struct mgmt_cp_stop_discovery {
323#define MGMT_OP_CONFIRM_NAME 0x0025 322#define MGMT_OP_CONFIRM_NAME 0x0025
324struct mgmt_cp_confirm_name { 323struct mgmt_cp_confirm_name {
325 struct mgmt_addr_info addr; 324 struct mgmt_addr_info addr;
326 __u8 name_known; 325 __u8 name_known;
327} __packed; 326} __packed;
328#define MGMT_CONFIRM_NAME_SIZE (MGMT_ADDR_INFO_SIZE + 1) 327#define MGMT_CONFIRM_NAME_SIZE (MGMT_ADDR_INFO_SIZE + 1)
329struct mgmt_rp_confirm_name { 328struct mgmt_rp_confirm_name {
@@ -344,20 +343,20 @@ struct mgmt_cp_unblock_device {
344 343
345#define MGMT_EV_CMD_COMPLETE 0x0001 344#define MGMT_EV_CMD_COMPLETE 0x0001
346struct mgmt_ev_cmd_complete { 345struct mgmt_ev_cmd_complete {
347 __le16 opcode; 346 __le16 opcode;
348 __u8 status; 347 __u8 status;
349 __u8 data[0]; 348 __u8 data[0];
350} __packed; 349} __packed;
351 350
352#define MGMT_EV_CMD_STATUS 0x0002 351#define MGMT_EV_CMD_STATUS 0x0002
353struct mgmt_ev_cmd_status { 352struct mgmt_ev_cmd_status {
354 __le16 opcode; 353 __le16 opcode;
355 __u8 status; 354 __u8 status;
356} __packed; 355} __packed;
357 356
358#define MGMT_EV_CONTROLLER_ERROR 0x0003 357#define MGMT_EV_CONTROLLER_ERROR 0x0003
359struct mgmt_ev_controller_error { 358struct mgmt_ev_controller_error {
360 __u8 error_code; 359 __u8 error_code;
361} __packed; 360} __packed;
362 361
363#define MGMT_EV_INDEX_ADDED 0x0004 362#define MGMT_EV_INDEX_ADDED 0x0004
@@ -368,33 +367,33 @@ struct mgmt_ev_controller_error {
368 367
369#define MGMT_EV_CLASS_OF_DEV_CHANGED 0x0007 368#define MGMT_EV_CLASS_OF_DEV_CHANGED 0x0007
370struct mgmt_ev_class_of_dev_changed { 369struct mgmt_ev_class_of_dev_changed {
371 __u8 dev_class[3]; 370 __u8 dev_class[3];
372}; 371};
373 372
374#define MGMT_EV_LOCAL_NAME_CHANGED 0x0008 373#define MGMT_EV_LOCAL_NAME_CHANGED 0x0008
375struct mgmt_ev_local_name_changed { 374struct mgmt_ev_local_name_changed {
376 __u8 name[MGMT_MAX_NAME_LENGTH]; 375 __u8 name[MGMT_MAX_NAME_LENGTH];
377 __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH]; 376 __u8 short_name[MGMT_MAX_SHORT_NAME_LENGTH];
378} __packed; 377} __packed;
379 378
380#define MGMT_EV_NEW_LINK_KEY 0x0009 379#define MGMT_EV_NEW_LINK_KEY 0x0009
381struct mgmt_ev_new_link_key { 380struct mgmt_ev_new_link_key {
382 __u8 store_hint; 381 __u8 store_hint;
383 struct mgmt_link_key_info key; 382 struct mgmt_link_key_info key;
384} __packed; 383} __packed;
385 384
386#define MGMT_EV_NEW_LONG_TERM_KEY 0x000A 385#define MGMT_EV_NEW_LONG_TERM_KEY 0x000A
387struct mgmt_ev_new_long_term_key { 386struct mgmt_ev_new_long_term_key {
388 __u8 store_hint; 387 __u8 store_hint;
389 struct mgmt_ltk_info key; 388 struct mgmt_ltk_info key;
390} __packed; 389} __packed;
391 390
392#define MGMT_EV_DEVICE_CONNECTED 0x000B 391#define MGMT_EV_DEVICE_CONNECTED 0x000B
393struct mgmt_ev_device_connected { 392struct mgmt_ev_device_connected {
394 struct mgmt_addr_info addr; 393 struct mgmt_addr_info addr;
395 __le32 flags; 394 __le32 flags;
396 __le16 eir_len; 395 __le16 eir_len;
397 __u8 eir[0]; 396 __u8 eir[0];
398} __packed; 397} __packed;
399 398
400#define MGMT_EV_DEVICE_DISCONNECTED 0x000C 399#define MGMT_EV_DEVICE_DISCONNECTED 0x000C
@@ -402,20 +401,20 @@ struct mgmt_ev_device_connected {
402#define MGMT_EV_CONNECT_FAILED 0x000D 401#define MGMT_EV_CONNECT_FAILED 0x000D
403struct mgmt_ev_connect_failed { 402struct mgmt_ev_connect_failed {
404 struct mgmt_addr_info addr; 403 struct mgmt_addr_info addr;
405 __u8 status; 404 __u8 status;
406} __packed; 405} __packed;
407 406
408#define MGMT_EV_PIN_CODE_REQUEST 0x000E 407#define MGMT_EV_PIN_CODE_REQUEST 0x000E
409struct mgmt_ev_pin_code_request { 408struct mgmt_ev_pin_code_request {
410 struct mgmt_addr_info addr; 409 struct mgmt_addr_info addr;
411 __u8 secure; 410 __u8 secure;
412} __packed; 411} __packed;
413 412
414#define MGMT_EV_USER_CONFIRM_REQUEST 0x000F 413#define MGMT_EV_USER_CONFIRM_REQUEST 0x000F
415struct mgmt_ev_user_confirm_request { 414struct mgmt_ev_user_confirm_request {
416 struct mgmt_addr_info addr; 415 struct mgmt_addr_info addr;
417 __u8 confirm_hint; 416 __u8 confirm_hint;
418 __le32 value; 417 __le32 value;
419} __packed; 418} __packed;
420 419
421#define MGMT_EV_USER_PASSKEY_REQUEST 0x0010 420#define MGMT_EV_USER_PASSKEY_REQUEST 0x0010
@@ -426,7 +425,7 @@ struct mgmt_ev_user_passkey_request {
426#define MGMT_EV_AUTH_FAILED 0x0011 425#define MGMT_EV_AUTH_FAILED 0x0011
427struct mgmt_ev_auth_failed { 426struct mgmt_ev_auth_failed {
428 struct mgmt_addr_info addr; 427 struct mgmt_addr_info addr;
429 __u8 status; 428 __u8 status;
430} __packed; 429} __packed;
431 430
432#define MGMT_DEV_FOUND_CONFIRM_NAME 0x01 431#define MGMT_DEV_FOUND_CONFIRM_NAME 0x01
@@ -435,16 +434,16 @@ struct mgmt_ev_auth_failed {
435#define MGMT_EV_DEVICE_FOUND 0x0012 434#define MGMT_EV_DEVICE_FOUND 0x0012
436struct mgmt_ev_device_found { 435struct mgmt_ev_device_found {
437 struct mgmt_addr_info addr; 436 struct mgmt_addr_info addr;
438 __s8 rssi; 437 __s8 rssi;
439 __u8 flags[4]; 438 __u8 flags[4];
440 __le16 eir_len; 439 __le16 eir_len;
441 __u8 eir[0]; 440 __u8 eir[0];
442} __packed; 441} __packed;
443 442
444#define MGMT_EV_DISCOVERING 0x0013 443#define MGMT_EV_DISCOVERING 0x0013
445struct mgmt_ev_discovering { 444struct mgmt_ev_discovering {
446 __u8 type; 445 __u8 type;
447 __u8 discovering; 446 __u8 discovering;
448} __packed; 447} __packed;
449 448
450#define MGMT_EV_DEVICE_BLOCKED 0x0014 449#define MGMT_EV_DEVICE_BLOCKED 0x0014