aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-03-11 14:11:11 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-03-11 14:11:11 -0500
commit409ec36c320d580a036045e603f96286c362c609 (patch)
tree3dd9b3569799f7962b523a068052445e2d2c51aa /include/net/bluetooth
parent1b7fe59322bef9e7a2c05b64a07a66b875299736 (diff)
parent8d5eab5aa676378b4c9daa62d10d08a0bca04677 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Diffstat (limited to 'include/net/bluetooth')
-rw-r--r--include/net/bluetooth/hci.h17
-rw-r--r--include/net/bluetooth/hci_core.h21
-rw-r--r--include/net/bluetooth/mgmt.h73
3 files changed, 78 insertions, 33 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index a5f8c4684a32..ec6acf2f1c0b 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -415,6 +415,17 @@ struct hci_cp_io_capability_reply {
415 __u8 authentication; 415 __u8 authentication;
416} __packed; 416} __packed;
417 417
418#define HCI_OP_USER_CONFIRM_REPLY 0x042c
419struct hci_cp_user_confirm_reply {
420 bdaddr_t bdaddr;
421} __packed;
422struct hci_rp_user_confirm_reply {
423 __u8 status;
424 bdaddr_t bdaddr;
425} __packed;
426
427#define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d
428
418#define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 429#define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434
419struct hci_cp_io_capability_neg_reply { 430struct hci_cp_io_capability_neg_reply {
420 bdaddr_t bdaddr; 431 bdaddr_t bdaddr;
@@ -936,6 +947,12 @@ struct hci_ev_io_capa_reply {
936 __u8 authentication; 947 __u8 authentication;
937} __packed; 948} __packed;
938 949
950#define HCI_EV_USER_CONFIRM_REQUEST 0x33
951struct hci_ev_user_confirm_req {
952 bdaddr_t bdaddr;
953 __le32 passkey;
954} __packed;
955
939#define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 956#define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36
940struct hci_ev_simple_pair_complete { 957struct hci_ev_simple_pair_complete {
941 __u8 status; 958 __u8 status;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index d5d8454236bf..441dadbf6a89 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -248,6 +248,10 @@ struct hci_conn {
248 void *priv; 248 void *priv;
249 249
250 struct hci_conn *link; 250 struct hci_conn *link;
251
252 void (*connect_cfm_cb) (struct hci_conn *conn, u8 status);
253 void (*security_cfm_cb) (struct hci_conn *conn, u8 status);
254 void (*disconn_cfm_cb) (struct hci_conn *conn, u8 reason);
251}; 255};
252 256
253extern struct hci_proto *hci_proto[]; 257extern struct hci_proto *hci_proto[];
@@ -571,6 +575,9 @@ static inline void hci_proto_connect_cfm(struct hci_conn *conn, __u8 status)
571 hp = hci_proto[HCI_PROTO_SCO]; 575 hp = hci_proto[HCI_PROTO_SCO];
572 if (hp && hp->connect_cfm) 576 if (hp && hp->connect_cfm)
573 hp->connect_cfm(conn, status); 577 hp->connect_cfm(conn, status);
578
579 if (conn->connect_cfm_cb)
580 conn->connect_cfm_cb(conn, status);
574} 581}
575 582
576static inline int hci_proto_disconn_ind(struct hci_conn *conn) 583static inline int hci_proto_disconn_ind(struct hci_conn *conn)
@@ -600,6 +607,9 @@ static inline void hci_proto_disconn_cfm(struct hci_conn *conn, __u8 reason)
600 hp = hci_proto[HCI_PROTO_SCO]; 607 hp = hci_proto[HCI_PROTO_SCO];
601 if (hp && hp->disconn_cfm) 608 if (hp && hp->disconn_cfm)
602 hp->disconn_cfm(conn, reason); 609 hp->disconn_cfm(conn, reason);
610
611 if (conn->disconn_cfm_cb)
612 conn->disconn_cfm_cb(conn, reason);
603} 613}
604 614
605static inline void hci_proto_auth_cfm(struct hci_conn *conn, __u8 status) 615static inline void hci_proto_auth_cfm(struct hci_conn *conn, __u8 status)
@@ -619,6 +629,9 @@ static inline void hci_proto_auth_cfm(struct hci_conn *conn, __u8 status)
619 hp = hci_proto[HCI_PROTO_SCO]; 629 hp = hci_proto[HCI_PROTO_SCO];
620 if (hp && hp->security_cfm) 630 if (hp && hp->security_cfm)
621 hp->security_cfm(conn, status, encrypt); 631 hp->security_cfm(conn, status, encrypt);
632
633 if (conn->security_cfm_cb)
634 conn->security_cfm_cb(conn, status);
622} 635}
623 636
624static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encrypt) 637static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encrypt)
@@ -632,6 +645,9 @@ static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status, __u
632 hp = hci_proto[HCI_PROTO_SCO]; 645 hp = hci_proto[HCI_PROTO_SCO];
633 if (hp && hp->security_cfm) 646 if (hp && hp->security_cfm)
634 hp->security_cfm(conn, status, encrypt); 647 hp->security_cfm(conn, status, encrypt);
648
649 if (conn->security_cfm_cb)
650 conn->security_cfm_cb(conn, status);
635} 651}
636 652
637int hci_register_proto(struct hci_proto *hproto); 653int hci_register_proto(struct hci_proto *hproto);
@@ -746,6 +762,11 @@ int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status);
746int mgmt_pin_code_request(u16 index, bdaddr_t *bdaddr); 762int mgmt_pin_code_request(u16 index, bdaddr_t *bdaddr);
747int mgmt_pin_code_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status); 763int mgmt_pin_code_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status);
748int mgmt_pin_code_neg_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status); 764int mgmt_pin_code_neg_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status);
765int mgmt_user_confirm_request(u16 index, bdaddr_t *bdaddr, __le32 value);
766int mgmt_user_confirm_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status);
767int mgmt_user_confirm_neg_reply_complete(u16 index, bdaddr_t *bdaddr,
768 u8 status);
769int mgmt_auth_failed(u16 index, bdaddr_t *bdaddr, u8 status);
749 770
750/* HCI info for socket */ 771/* HCI info for socket */
751#define hci_pi(sk) ((struct hci_pinfo *) sk) 772#define hci_pi(sk) ((struct hci_pinfo *) sk)
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 44ac55c85079..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,51 +107,66 @@ 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;
134struct mgmt_rp_pin_code_reply {
135 bdaddr_t bdaddr;
136 uint8_t status;
137} __packed;
150 138
151#define MGMT_OP_PIN_CODE_NEG_REPLY 0x0012 139#define MGMT_OP_PIN_CODE_NEG_REPLY 0x0012
152struct mgmt_cp_pin_code_neg_reply { 140struct mgmt_cp_pin_code_neg_reply {
153 __le16 index;
154 bdaddr_t bdaddr; 141 bdaddr_t bdaddr;
155} __packed; 142} __packed;
156 143
157#define MGMT_OP_SET_IO_CAPABILITY 0x0013 144#define MGMT_OP_SET_IO_CAPABILITY 0x0013
158struct mgmt_cp_set_io_capability { 145struct mgmt_cp_set_io_capability {
159 __le16 index;
160 __u8 io_capability; 146 __u8 io_capability;
161} __packed; 147} __packed;
162 148
149#define MGMT_OP_PAIR_DEVICE 0x0014
150struct mgmt_cp_pair_device {
151 bdaddr_t bdaddr;
152 __u8 io_cap;
153} __packed;
154struct mgmt_rp_pair_device {
155 bdaddr_t bdaddr;
156 __u8 status;
157} __packed;
158
159#define MGMT_OP_USER_CONFIRM_REPLY 0x0015
160struct mgmt_cp_user_confirm_reply {
161 bdaddr_t bdaddr;
162} __packed;
163struct mgmt_rp_user_confirm_reply {
164 bdaddr_t bdaddr;
165 __u8 status;
166} __packed;
167
168#define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x0016
169
163#define MGMT_EV_CMD_COMPLETE 0x0001 170#define MGMT_EV_CMD_COMPLETE 0x0001
164struct mgmt_ev_cmd_complete { 171struct mgmt_ev_cmd_complete {
165 __le16 opcode; 172 __le16 opcode;
@@ -174,19 +181,12 @@ struct mgmt_ev_cmd_status {
174 181
175#define MGMT_EV_CONTROLLER_ERROR 0x0003 182#define MGMT_EV_CONTROLLER_ERROR 0x0003
176struct mgmt_ev_controller_error { 183struct mgmt_ev_controller_error {
177 __le16 index;
178 __u8 error_code; 184 __u8 error_code;
179} __packed; 185} __packed;
180 186
181#define MGMT_EV_INDEX_ADDED 0x0004 187#define MGMT_EV_INDEX_ADDED 0x0004
182struct mgmt_ev_index_added {
183 __le16 index;
184} __packed;
185 188
186#define MGMT_EV_INDEX_REMOVED 0x0005 189#define MGMT_EV_INDEX_REMOVED 0x0005
187struct mgmt_ev_index_removed {
188 __le16 index;
189} __packed;
190 190
191#define MGMT_EV_POWERED 0x0006 191#define MGMT_EV_POWERED 0x0006
192 192
@@ -198,32 +198,39 @@ struct mgmt_ev_index_removed {
198 198
199#define MGMT_EV_NEW_KEY 0x000A 199#define MGMT_EV_NEW_KEY 0x000A
200struct mgmt_ev_new_key { 200struct mgmt_ev_new_key {
201 __le16 index;
202 struct mgmt_key_info key; 201 struct mgmt_key_info key;
203 __u8 old_key_type; 202 __u8 old_key_type;
204} __packed; 203} __packed;
205 204
206#define MGMT_EV_CONNECTED 0x000B 205#define MGMT_EV_CONNECTED 0x000B
207struct mgmt_ev_connected { 206struct mgmt_ev_connected {
208 __le16 index;
209 bdaddr_t bdaddr; 207 bdaddr_t bdaddr;
210} __packed; 208} __packed;
211 209
212#define MGMT_EV_DISCONNECTED 0x000C 210#define MGMT_EV_DISCONNECTED 0x000C
213struct mgmt_ev_disconnected { 211struct mgmt_ev_disconnected {
214 __le16 index;
215 bdaddr_t bdaddr; 212 bdaddr_t bdaddr;
216} __packed; 213} __packed;
217 214
218#define MGMT_EV_CONNECT_FAILED 0x000D 215#define MGMT_EV_CONNECT_FAILED 0x000D
219struct mgmt_ev_connect_failed { 216struct mgmt_ev_connect_failed {
220 __le16 index;
221 bdaddr_t bdaddr; 217 bdaddr_t bdaddr;
222 __u8 status; 218 __u8 status;
223} __packed; 219} __packed;
224 220
225#define MGMT_EV_PIN_CODE_REQUEST 0x000E 221#define MGMT_EV_PIN_CODE_REQUEST 0x000E
226struct mgmt_ev_pin_code_request { 222struct mgmt_ev_pin_code_request {
227 __le16 index;
228 bdaddr_t bdaddr; 223 bdaddr_t bdaddr;
229} __packed; 224} __packed;
225
226#define MGMT_EV_USER_CONFIRM_REQUEST 0x000F
227struct mgmt_ev_user_confirm_request {
228 bdaddr_t bdaddr;
229 __le32 value;
230} __packed;
231
232#define MGMT_EV_AUTH_FAILED 0x0010
233struct mgmt_ev_auth_failed {
234 bdaddr_t bdaddr;
235 __u8 status;
236} __packed;