aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/mgmt.h
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2011-01-17 07:41:05 -0500
committerGustavo F. Padovan <padovan@profusion.mobi>2011-02-07 22:40:07 -0500
commit55ed8ca10f3530de8edbbf138acb50992bf5005b (patch)
tree3145b2b995758b2cb64493fc8ec29e63d0e9f0b4 /include/net/bluetooth/mgmt.h
parent1aff6f09491f454d4cd9f405c783fa5e9d3168a0 (diff)
Bluetooth: Implement link key handling for the management interface
This patch adds a management commands to feed the kernel with all stored link keys as well as remove specific ones or all of them. Once the load_keys command has been called the kernel takes over link key replies. A new_key event is also added to inform userspace of newly created link keys that should be stored permanently. Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include/net/bluetooth/mgmt.h')
-rw-r--r--include/net/bluetooth/mgmt.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index b092c4c014eb..56b500a2f68c 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -98,6 +98,28 @@ struct mgmt_cp_set_service_cache {
98 __u8 enable; 98 __u8 enable;
99} __packed; 99} __packed;
100 100
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;
122
101#define MGMT_EV_CMD_COMPLETE 0x0001 123#define MGMT_EV_CMD_COMPLETE 0x0001
102struct mgmt_ev_cmd_complete { 124struct mgmt_ev_cmd_complete {
103 __le16 opcode; 125 __le16 opcode;
@@ -133,3 +155,10 @@ struct mgmt_ev_index_removed {
133#define MGMT_EV_CONNECTABLE 0x0008 155#define MGMT_EV_CONNECTABLE 0x0008
134 156
135#define MGMT_EV_PAIRABLE 0x0009 157#define MGMT_EV_PAIRABLE 0x0009
158
159#define MGMT_EV_NEW_KEY 0x000A
160struct mgmt_ev_new_key {
161 __le16 index;
162 struct mgmt_key_info key;
163 __u8 old_key_type;
164} __packed;