aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2011-01-21 23:10:07 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-07 22:40:07 -0500
commit980e1a537fed7dfa53e9a4b6e586b43341f8c2d5 (patch)
tree36d7716d48a71e16f37afb5d8afdb527463826cd /include
parenta38528f1117590169c0bf61cbf874e9fd2d5c5c9 (diff)
Bluetooth: Add support for PIN code handling in the management interface
This patch adds the necessary commands and events needed to communicate PIN code related actions between the kernel and userspace. This includes a pin_code_request event as well as pin_code_reply and pin_code_negative_reply commands. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include')
-rw-r--r--include/net/bluetooth/hci.h8
-rw-r--r--include/net/bluetooth/hci_core.h4
-rw-r--r--include/net/bluetooth/mgmt.h20
3 files changed, 32 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 08fbf1253b83..e8e52da2b26b 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -309,11 +309,19 @@ struct hci_cp_pin_code_reply {
309 __u8 pin_len; 309 __u8 pin_len;
310 __u8 pin_code[16]; 310 __u8 pin_code[16];
311} __packed; 311} __packed;
312struct hci_rp_pin_code_reply {
313 __u8 status;
314 bdaddr_t bdaddr;
315} __packed;
312 316
313#define HCI_OP_PIN_CODE_NEG_REPLY 0x040e 317#define HCI_OP_PIN_CODE_NEG_REPLY 0x040e
314struct hci_cp_pin_code_neg_reply { 318struct hci_cp_pin_code_neg_reply {
315 bdaddr_t bdaddr; 319 bdaddr_t bdaddr;
316} __packed; 320} __packed;
321struct hci_rp_pin_code_neg_reply {
322 __u8 status;
323 bdaddr_t bdaddr;
324} __packed;
317 325
318#define HCI_OP_CHANGE_CONN_PTYPE 0x040f 326#define HCI_OP_CHANGE_CONN_PTYPE 0x040f
319struct hci_cp_change_conn_ptype { 327struct hci_cp_change_conn_ptype {
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 45caae62cb8e..9ac3da6e4a9a 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -213,6 +213,7 @@ struct hci_conn {
213 __u8 auth_type; 213 __u8 auth_type;
214 __u8 sec_level; 214 __u8 sec_level;
215 __u8 pending_sec_level; 215 __u8 pending_sec_level;
216 __u8 pin_length;
216 __u8 power_save; 217 __u8 power_save;
217 __u16 disc_timeout; 218 __u16 disc_timeout;
218 unsigned long pend; 219 unsigned long pend;
@@ -718,6 +719,9 @@ int mgmt_connected(u16 index, bdaddr_t *bdaddr);
718int mgmt_disconnected(u16 index, bdaddr_t *bdaddr); 719int mgmt_disconnected(u16 index, bdaddr_t *bdaddr);
719int mgmt_disconnect_failed(u16 index); 720int mgmt_disconnect_failed(u16 index);
720int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status); 721int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status);
722int mgmt_pin_code_request(u16 index, bdaddr_t *bdaddr);
723int mgmt_pin_code_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status);
724int mgmt_pin_code_neg_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status);
721 725
722/* HCI info for socket */ 726/* HCI info for socket */
723#define hci_pi(sk) ((struct hci_pinfo *) sk) 727#define hci_pi(sk) ((struct hci_pinfo *) sk)
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 3d8d589fa559..46fb56d21b59 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -140,6 +140,20 @@ struct mgmt_rp_get_connections {
140 bdaddr_t conn[0]; 140 bdaddr_t conn[0];
141} __packed; 141} __packed;
142 142
143#define MGMT_OP_PIN_CODE_REPLY 0x0011
144struct mgmt_cp_pin_code_reply {
145 __le16 index;
146 bdaddr_t bdaddr;
147 __u8 pin_len;
148 __u8 pin_code[16];
149} __packed;
150
151#define MGMT_OP_PIN_CODE_NEG_REPLY 0x0012
152struct mgmt_cp_pin_code_neg_reply {
153 __le16 index;
154 bdaddr_t bdaddr;
155} __packed;
156
143#define MGMT_EV_CMD_COMPLETE 0x0001 157#define MGMT_EV_CMD_COMPLETE 0x0001
144struct mgmt_ev_cmd_complete { 158struct mgmt_ev_cmd_complete {
145 __le16 opcode; 159 __le16 opcode;
@@ -201,3 +215,9 @@ struct mgmt_ev_connect_failed {
201 bdaddr_t bdaddr; 215 bdaddr_t bdaddr;
202 __u8 status; 216 __u8 status;
203} __packed; 217} __packed;
218
219#define MGMT_EV_PIN_CODE_REQUEST 0x000E
220struct mgmt_ev_pin_code_request {
221 __le16 index;
222 bdaddr_t bdaddr;
223} __packed;