aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2011-06-09 17:50:47 -0400
committerGustavo F. Padovan <padovan@profusion.mobi>2011-06-13 14:48:25 -0400
commita7a595f675f1b33dc73167147321dba5c4395acc (patch)
treeee17d1ba777fd18ec7b666a356b00c131cb5f0f2 /include
parent7d24ddcc1140d2f796436e476c8d69469610588b (diff)
Bluetooth: Add support for LE Start Encryption
This adds support for starting SMP Phase 2 Encryption, when the initial SMP negotiation is successful. This adds the LE Start Encryption and LE Long Term Key Request commands and related events. Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'include')
-rw-r--r--include/net/bluetooth/hci.h34
-rw-r--r--include/net/bluetooth/hci_core.h6
2 files changed, 40 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index bd285c6a5509..65345cd215be 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -745,6 +745,33 @@ struct hci_cp_le_conn_update {
745 __le16 max_ce_len; 745 __le16 max_ce_len;
746} __packed; 746} __packed;
747 747
748#define HCI_OP_LE_START_ENC 0x2019
749struct hci_cp_le_start_enc {
750 __le16 handle;
751 __u8 rand[8];
752 __le16 ediv;
753 __u8 ltk[16];
754} __packed;
755
756#define HCI_OP_LE_LTK_REPLY 0x201a
757struct hci_cp_le_ltk_reply {
758 __le16 handle;
759 __u8 ltk[16];
760} __packed;
761struct hci_rp_le_ltk_reply {
762 __u8 status;
763 __le16 handle;
764} __packed;
765
766#define HCI_OP_LE_LTK_NEG_REPLY 0x201b
767struct hci_cp_le_ltk_neg_reply {
768 __le16 handle;
769} __packed;
770struct hci_rp_le_ltk_neg_reply {
771 __u8 status;
772 __le16 handle;
773} __packed;
774
748/* ---- HCI Events ---- */ 775/* ---- HCI Events ---- */
749#define HCI_EV_INQUIRY_COMPLETE 0x01 776#define HCI_EV_INQUIRY_COMPLETE 0x01
750 777
@@ -1035,6 +1062,13 @@ struct hci_ev_le_conn_complete {
1035 __u8 clk_accurancy; 1062 __u8 clk_accurancy;
1036} __packed; 1063} __packed;
1037 1064
1065#define HCI_EV_LE_LTK_REQ 0x05
1066struct hci_ev_le_ltk_req {
1067 __le16 handle;
1068 __u8 random[8];
1069 __le16 ediv;
1070} __packed;
1071
1038/* Advertising report event types */ 1072/* Advertising report event types */
1039#define ADV_IND 0x00 1073#define ADV_IND 0x00
1040#define ADV_DIRECT_IND 0x01 1074#define ADV_DIRECT_IND 0x01
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 7837f3260863..ab6842c6e49a 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -249,6 +249,7 @@ struct hci_conn {
249 __u8 power_save; 249 __u8 power_save;
250 __u16 disc_timeout; 250 __u16 disc_timeout;
251 unsigned long pend; 251 unsigned long pend;
252 __u8 ltk[16];
252 253
253 __u8 remote_cap; 254 __u8 remote_cap;
254 __u8 remote_oob; 255 __u8 remote_oob;
@@ -861,4 +862,9 @@ void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result);
861 862
862void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, 863void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
863 u16 latency, u16 to_multiplier); 864 u16 latency, u16 to_multiplier);
865void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8],
866 __u8 ltk[16]);
867void hci_le_ltk_reply(struct hci_conn *conn, u8 ltk[16]);
868void hci_le_ltk_neg_reply(struct hci_conn *conn);
869
864#endif /* __HCI_CORE_H */ 870#endif /* __HCI_CORE_H */