aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorSzymon Janc <szymon.janc@tieto.com>2011-02-25 13:05:48 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-27 14:56:41 -0500
commit4e51eae9cdda4bf096e73a4ebe23f8f96a17596a (patch)
treebcc268f23f386018b86ce7fe7094f59904e20b64 /include/net
parent779cb85016587d9ffaea681c38691d5301a3fedc (diff)
Bluetooth: Move index to common header in management interface
Most mgmt commands and event are related to hci adapter. Moving index to common header allow to easily use it in command status while reporting errors. For those not related to adapter use MGMT_INDEX_NONE (0xFFFF) as index. Signed-off-by: Szymon Janc <szymon.janc@tieto.com> Acked-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/mgmt.h43
1 files changed, 3 insertions, 40 deletions
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 1e63c3141a78..5fabfa886b3e 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -21,11 +21,13 @@
21 SOFTWARE IS DISCLAIMED. 21 SOFTWARE IS DISCLAIMED.
22*/ 22*/
23 23
24#define MGMT_INDEX_NONE 0xFFFF
25
24struct mgmt_hdr { 26struct mgmt_hdr {
25 __le16 opcode; 27 __le16 opcode;
28 __le16 index;
26 __le16 len; 29 __le16 len;
27} __packed; 30} __packed;
28#define MGMT_HDR_SIZE 4
29 31
30#define MGMT_OP_READ_VERSION 0x0001 32#define MGMT_OP_READ_VERSION 0x0001
31struct mgmt_rp_read_version { 33struct mgmt_rp_read_version {
@@ -40,11 +42,7 @@ struct mgmt_rp_read_index_list {
40} __packed; 42} __packed;
41 43
42#define MGMT_OP_READ_INFO 0x0004 44#define MGMT_OP_READ_INFO 0x0004
43struct mgmt_cp_read_info {
44 __le16 index;
45} __packed;
46struct mgmt_rp_read_info { 45struct mgmt_rp_read_info {
47 __le16 index;
48 __u8 type; 46 __u8 type;
49 __u8 powered; 47 __u8 powered;
50 __u8 connectable; 48 __u8 connectable;
@@ -60,7 +58,6 @@ struct mgmt_rp_read_info {
60} __packed; 58} __packed;
61 59
62struct mgmt_mode { 60struct mgmt_mode {
63 __le16 index;
64 __u8 val; 61 __u8 val;
65} __packed; 62} __packed;
66 63
@@ -74,27 +71,23 @@ struct mgmt_mode {
74 71
75#define MGMT_OP_ADD_UUID 0x0009 72#define MGMT_OP_ADD_UUID 0x0009
76struct mgmt_cp_add_uuid { 73struct mgmt_cp_add_uuid {
77 __le16 index;
78 __u8 uuid[16]; 74 __u8 uuid[16];
79 __u8 svc_hint; 75 __u8 svc_hint;
80} __packed; 76} __packed;
81 77
82#define MGMT_OP_REMOVE_UUID 0x000A 78#define MGMT_OP_REMOVE_UUID 0x000A
83struct mgmt_cp_remove_uuid { 79struct mgmt_cp_remove_uuid {
84 __le16 index;
85 __u8 uuid[16]; 80 __u8 uuid[16];
86} __packed; 81} __packed;
87 82
88#define MGMT_OP_SET_DEV_CLASS 0x000B 83#define MGMT_OP_SET_DEV_CLASS 0x000B
89struct mgmt_cp_set_dev_class { 84struct mgmt_cp_set_dev_class {
90 __le16 index;
91 __u8 major; 85 __u8 major;
92 __u8 minor; 86 __u8 minor;
93} __packed; 87} __packed;
94 88
95#define MGMT_OP_SET_SERVICE_CACHE 0x000C 89#define MGMT_OP_SET_SERVICE_CACHE 0x000C
96struct mgmt_cp_set_service_cache { 90struct mgmt_cp_set_service_cache {
97 __le16 index;
98 __u8 enable; 91 __u8 enable;
99} __packed; 92} __packed;
100 93
@@ -107,7 +100,6 @@ struct mgmt_key_info {
107 100
108#define MGMT_OP_LOAD_KEYS 0x000D 101#define MGMT_OP_LOAD_KEYS 0x000D
109struct mgmt_cp_load_keys { 102struct mgmt_cp_load_keys {
110 __le16 index;
111 __u8 debug_keys; 103 __u8 debug_keys;
112 __le16 key_count; 104 __le16 key_count;
113 struct mgmt_key_info keys[0]; 105 struct mgmt_key_info keys[0];
@@ -115,75 +107,60 @@ struct mgmt_cp_load_keys {
115 107
116#define MGMT_OP_REMOVE_KEY 0x000E 108#define MGMT_OP_REMOVE_KEY 0x000E
117struct mgmt_cp_remove_key { 109struct mgmt_cp_remove_key {
118 __le16 index;
119 bdaddr_t bdaddr; 110 bdaddr_t bdaddr;
120 __u8 disconnect; 111 __u8 disconnect;
121} __packed; 112} __packed;
122 113
123#define MGMT_OP_DISCONNECT 0x000F 114#define MGMT_OP_DISCONNECT 0x000F
124struct mgmt_cp_disconnect { 115struct mgmt_cp_disconnect {
125 __le16 index;
126 bdaddr_t bdaddr; 116 bdaddr_t bdaddr;
127} __packed; 117} __packed;
128struct mgmt_rp_disconnect { 118struct mgmt_rp_disconnect {
129 __le16 index;
130 bdaddr_t bdaddr; 119 bdaddr_t bdaddr;
131} __packed; 120} __packed;
132 121
133#define MGMT_OP_GET_CONNECTIONS 0x0010 122#define MGMT_OP_GET_CONNECTIONS 0x0010
134struct mgmt_cp_get_connections {
135 __le16 index;
136} __packed;
137struct mgmt_rp_get_connections { 123struct mgmt_rp_get_connections {
138 __le16 index;
139 __le16 conn_count; 124 __le16 conn_count;
140 bdaddr_t conn[0]; 125 bdaddr_t conn[0];
141} __packed; 126} __packed;
142 127
143#define MGMT_OP_PIN_CODE_REPLY 0x0011 128#define MGMT_OP_PIN_CODE_REPLY 0x0011
144struct mgmt_cp_pin_code_reply { 129struct mgmt_cp_pin_code_reply {
145 __le16 index;
146 bdaddr_t bdaddr; 130 bdaddr_t bdaddr;
147 __u8 pin_len; 131 __u8 pin_len;
148 __u8 pin_code[16]; 132 __u8 pin_code[16];
149} __packed; 133} __packed;
150struct mgmt_rp_pin_code_reply { 134struct mgmt_rp_pin_code_reply {
151 __le16 index;
152 bdaddr_t bdaddr; 135 bdaddr_t bdaddr;
153 uint8_t status; 136 uint8_t status;
154} __packed; 137} __packed;
155 138
156#define MGMT_OP_PIN_CODE_NEG_REPLY 0x0012 139#define MGMT_OP_PIN_CODE_NEG_REPLY 0x0012
157struct mgmt_cp_pin_code_neg_reply { 140struct mgmt_cp_pin_code_neg_reply {
158 __le16 index;
159 bdaddr_t bdaddr; 141 bdaddr_t bdaddr;
160} __packed; 142} __packed;
161 143
162#define MGMT_OP_SET_IO_CAPABILITY 0x0013 144#define MGMT_OP_SET_IO_CAPABILITY 0x0013
163struct mgmt_cp_set_io_capability { 145struct mgmt_cp_set_io_capability {
164 __le16 index;
165 __u8 io_capability; 146 __u8 io_capability;
166} __packed; 147} __packed;
167 148
168#define MGMT_OP_PAIR_DEVICE 0x0014 149#define MGMT_OP_PAIR_DEVICE 0x0014
169struct mgmt_cp_pair_device { 150struct mgmt_cp_pair_device {
170 __le16 index;
171 bdaddr_t bdaddr; 151 bdaddr_t bdaddr;
172 __u8 io_cap; 152 __u8 io_cap;
173} __packed; 153} __packed;
174struct mgmt_rp_pair_device { 154struct mgmt_rp_pair_device {
175 __le16 index;
176 bdaddr_t bdaddr; 155 bdaddr_t bdaddr;
177 __u8 status; 156 __u8 status;
178} __packed; 157} __packed;
179 158
180#define MGMT_OP_USER_CONFIRM_REPLY 0x0015 159#define MGMT_OP_USER_CONFIRM_REPLY 0x0015
181struct mgmt_cp_user_confirm_reply { 160struct mgmt_cp_user_confirm_reply {
182 __le16 index;
183 bdaddr_t bdaddr; 161 bdaddr_t bdaddr;
184} __packed; 162} __packed;
185struct mgmt_rp_user_confirm_reply { 163struct mgmt_rp_user_confirm_reply {
186 __le16 index;
187 bdaddr_t bdaddr; 164 bdaddr_t bdaddr;
188 __u8 status; 165 __u8 status;
189} __packed; 166} __packed;
@@ -204,19 +181,12 @@ struct mgmt_ev_cmd_status {
204 181
205#define MGMT_EV_CONTROLLER_ERROR 0x0003 182#define MGMT_EV_CONTROLLER_ERROR 0x0003
206struct mgmt_ev_controller_error { 183struct mgmt_ev_controller_error {
207 __le16 index;
208 __u8 error_code; 184 __u8 error_code;
209} __packed; 185} __packed;
210 186
211#define MGMT_EV_INDEX_ADDED 0x0004 187#define MGMT_EV_INDEX_ADDED 0x0004
212struct mgmt_ev_index_added {
213 __le16 index;
214} __packed;
215 188
216#define MGMT_EV_INDEX_REMOVED 0x0005 189#define MGMT_EV_INDEX_REMOVED 0x0005
217struct mgmt_ev_index_removed {
218 __le16 index;
219} __packed;
220 190
221#define MGMT_EV_POWERED 0x0006 191#define MGMT_EV_POWERED 0x0006
222 192
@@ -228,46 +198,39 @@ struct mgmt_ev_index_removed {
228 198
229#define MGMT_EV_NEW_KEY 0x000A 199#define MGMT_EV_NEW_KEY 0x000A
230struct mgmt_ev_new_key { 200struct mgmt_ev_new_key {
231 __le16 index;
232 struct mgmt_key_info key; 201 struct mgmt_key_info key;
233 __u8 old_key_type; 202 __u8 old_key_type;
234} __packed; 203} __packed;
235 204
236#define MGMT_EV_CONNECTED 0x000B 205#define MGMT_EV_CONNECTED 0x000B
237struct mgmt_ev_connected { 206struct mgmt_ev_connected {
238 __le16 index;
239 bdaddr_t bdaddr; 207 bdaddr_t bdaddr;
240} __packed; 208} __packed;
241 209
242#define MGMT_EV_DISCONNECTED 0x000C 210#define MGMT_EV_DISCONNECTED 0x000C
243struct mgmt_ev_disconnected { 211struct mgmt_ev_disconnected {
244 __le16 index;
245 bdaddr_t bdaddr; 212 bdaddr_t bdaddr;
246} __packed; 213} __packed;
247 214
248#define MGMT_EV_CONNECT_FAILED 0x000D 215#define MGMT_EV_CONNECT_FAILED 0x000D
249struct mgmt_ev_connect_failed { 216struct mgmt_ev_connect_failed {
250 __le16 index;
251 bdaddr_t bdaddr; 217 bdaddr_t bdaddr;
252 __u8 status; 218 __u8 status;
253} __packed; 219} __packed;
254 220
255#define MGMT_EV_PIN_CODE_REQUEST 0x000E 221#define MGMT_EV_PIN_CODE_REQUEST 0x000E
256struct mgmt_ev_pin_code_request { 222struct mgmt_ev_pin_code_request {
257 __le16 index;
258 bdaddr_t bdaddr; 223 bdaddr_t bdaddr;
259} __packed; 224} __packed;
260 225
261#define MGMT_EV_USER_CONFIRM_REQUEST 0x000F 226#define MGMT_EV_USER_CONFIRM_REQUEST 0x000F
262struct mgmt_ev_user_confirm_request { 227struct mgmt_ev_user_confirm_request {
263 __le16 index;
264 bdaddr_t bdaddr; 228 bdaddr_t bdaddr;
265 __le32 value; 229 __le32 value;
266} __packed; 230} __packed;
267 231
268#define MGMT_EV_AUTH_FAILED 0x0010 232#define MGMT_EV_AUTH_FAILED 0x0010
269struct mgmt_ev_auth_failed { 233struct mgmt_ev_auth_failed {
270 __le16 index;
271 bdaddr_t bdaddr; 234 bdaddr_t bdaddr;
272 __u8 status; 235 __u8 status;
273} __packed; 236} __packed;