Bluetooth: Add support for connect failed management event
[deliverable/linux.git] / include / net / bluetooth / mgmt.h
CommitLineData
c02178d2
JH
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
24struct mgmt_hdr {
25 __le16 opcode;
26 __le16 len;
27} __packed;
28#define MGMT_HDR_SIZE 4
29
02d98129
JH
30#define MGMT_OP_READ_VERSION 0x0001
31struct mgmt_rp_read_version {
32 __u8 version;
33 __le16 revision;
34} __packed;
35
faba42eb
JH
36#define MGMT_OP_READ_INDEX_LIST 0x0003
37struct mgmt_rp_read_index_list {
38 __le16 num_controllers;
39 __le16 index[0];
40} __packed;
41
f7b64e69
JH
42#define MGMT_OP_READ_INFO 0x0004
43struct mgmt_cp_read_info {
44 __le16 index;
45} __packed;
46struct mgmt_rp_read_info {
47 __le16 index;
48 __u8 type;
49 __u8 powered;
9fbcbb45 50 __u8 connectable;
f7b64e69
JH
51 __u8 discoverable;
52 __u8 pairable;
53 __u8 sec_mode;
54 bdaddr_t bdaddr;
55 __u8 dev_class[3];
56 __u8 features[8];
57 __u16 manufacturer;
58 __u8 hci_ver;
59 __u16 hci_rev;
60} __packed;
61
72a734ec 62struct mgmt_mode {
eec8d2bc 63 __le16 index;
72a734ec 64 __u8 val;
eec8d2bc
JH
65} __packed;
66
72a734ec
JH
67#define MGMT_OP_SET_POWERED 0x0005
68
73f22f62 69#define MGMT_OP_SET_DISCOVERABLE 0x0006
73f22f62 70
9fbcbb45 71#define MGMT_OP_SET_CONNECTABLE 0x0007
9fbcbb45 72
c542a06c
JH
73#define MGMT_OP_SET_PAIRABLE 0x0008
74
2aeb9a1a
JH
75#define MGMT_OP_ADD_UUID 0x0009
76struct mgmt_cp_add_uuid {
77 __le16 index;
78 __u8 uuid[16];
1aff6f09 79 __u8 svc_hint;
2aeb9a1a
JH
80} __packed;
81
82#define MGMT_OP_REMOVE_UUID 0x000A
83struct mgmt_cp_remove_uuid {
84 __le16 index;
85 __u8 uuid[16];
86} __packed;
87
1aff6f09
JH
88#define MGMT_OP_SET_DEV_CLASS 0x000B
89struct mgmt_cp_set_dev_class {
90 __le16 index;
91 __u8 major;
92 __u8 minor;
93} __packed;
94
95#define MGMT_OP_SET_SERVICE_CACHE 0x000C
96struct mgmt_cp_set_service_cache {
97 __le16 index;
98 __u8 enable;
99} __packed;
100
55ed8ca1
JH
101struct mgmt_key_info {
102 bdaddr_t bdaddr;
103 u8 type;
104 u8 val[16];
105 u8 pin_len;
106} __packed;
107
108#define MGMT_OP_LOAD_KEYS 0x000D
109struct mgmt_cp_load_keys {
110 __le16 index;
111 __u8 debug_keys;
112 __le16 key_count;
113 struct mgmt_key_info keys[0];
114} __packed;
115
116#define MGMT_OP_REMOVE_KEY 0x000E
117struct mgmt_cp_remove_key {
118 __le16 index;
119 bdaddr_t bdaddr;
120 __u8 disconnect;
121} __packed;
8962ee74
JH
122
123#define MGMT_OP_DISCONNECT 0x000F
124struct mgmt_cp_disconnect {
125 __le16 index;
126 bdaddr_t bdaddr;
127} __packed;
128struct mgmt_rp_disconnect {
129 __le16 index;
130 bdaddr_t bdaddr;
131} __packed;
55ed8ca1 132
c02178d2
JH
133#define MGMT_EV_CMD_COMPLETE 0x0001
134struct mgmt_ev_cmd_complete {
135 __le16 opcode;
136 __u8 data[0];
137} __packed;
138
139#define MGMT_EV_CMD_STATUS 0x0002
140struct mgmt_ev_cmd_status {
141 __u8 status;
142 __le16 opcode;
143} __packed;
144
145#define MGMT_EV_CONTROLLER_ERROR 0x0003
146struct mgmt_ev_controller_error {
147 __le16 index;
148 __u8 error_code;
149} __packed;
c71e97bf
JH
150
151#define MGMT_EV_INDEX_ADDED 0x0004
152struct mgmt_ev_index_added {
153 __le16 index;
154} __packed;
155
156#define MGMT_EV_INDEX_REMOVED 0x0005
157struct mgmt_ev_index_removed {
158 __le16 index;
159} __packed;
5add6af8
JH
160
161#define MGMT_EV_POWERED 0x0006
73f22f62
JH
162
163#define MGMT_EV_DISCOVERABLE 0x0007
9fbcbb45
JH
164
165#define MGMT_EV_CONNECTABLE 0x0008
c542a06c
JH
166
167#define MGMT_EV_PAIRABLE 0x0009
55ed8ca1
JH
168
169#define MGMT_EV_NEW_KEY 0x000A
170struct mgmt_ev_new_key {
171 __le16 index;
172 struct mgmt_key_info key;
173 __u8 old_key_type;
174} __packed;
f7520543
JH
175
176#define MGMT_EV_CONNECTED 0x000B
177struct mgmt_ev_connected {
178 __le16 index;
179 bdaddr_t bdaddr;
180} __packed;
181
182#define MGMT_EV_DISCONNECTED 0x000C
183struct mgmt_ev_disconnected {
184 __le16 index;
185 bdaddr_t bdaddr;
186} __packed;
17d5c04c
JH
187
188#define MGMT_EV_CONNECT_FAILED 0x000D
189struct mgmt_ev_connect_failed {
190 __le16 index;
191 bdaddr_t bdaddr;
192 __u8 status;
193} __packed;
This page took 0.045262 seconds and 5 git commands to generate.