summaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/mgmt.h
diff options
context:
space:
mode:
authorJohan Hedberg2011-01-17 13:41:05 +0100
committerGustavo F. Padovan2011-02-08 04:40:07 +0100
commit55ed8ca10f3530de8edbbf138acb50992bf5005b (patch)
tree3145b2b995758b2cb64493fc8ec29e63d0e9f0b4 /include/net/bluetooth/mgmt.h
parentBluetooth: Add class of device control to the management interface (diff)
downloadkernel-qcow2-linux-55ed8ca10f3530de8edbbf138acb50992bf5005b.tar.gz
kernel-qcow2-linux-55ed8ca10f3530de8edbbf138acb50992bf5005b.tar.xz
kernel-qcow2-linux-55ed8ca10f3530de8edbbf138acb50992bf5005b.zip
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 {
__u8 enable;
} __packed;
+struct mgmt_key_info {
+ bdaddr_t bdaddr;
+ u8 type;
+ u8 val[16];
+ u8 pin_len;
+} __packed;
+
+#define MGMT_OP_LOAD_KEYS 0x000D
+struct mgmt_cp_load_keys {
+ __le16 index;
+ __u8 debug_keys;
+ __le16 key_count;
+ struct mgmt_key_info keys[0];
+} __packed;
+
+#define MGMT_OP_REMOVE_KEY 0x000E
+struct mgmt_cp_remove_key {
+ __le16 index;
+ bdaddr_t bdaddr;
+ __u8 disconnect;
+} __packed;
+
#define MGMT_EV_CMD_COMPLETE 0x0001
struct mgmt_ev_cmd_complete {
__le16 opcode;
@@ -133,3 +155,10 @@ struct mgmt_ev_index_removed {
#define MGMT_EV_CONNECTABLE 0x0008
#define MGMT_EV_PAIRABLE 0x0009
+
+#define MGMT_EV_NEW_KEY 0x000A
+struct mgmt_ev_new_key {
+ __le16 index;
+ struct mgmt_key_info key;
+ __u8 old_key_type;
+} __packed;