aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2014-02-27 19:00:28 -0500
committerJohan Hedberg <johan.hedberg@intel.com>2014-02-28 05:36:04 -0500
commitfe39c7b2dacf7fd4dcddc26704d01315ab92b7cb (patch)
tree9eb0ab5c8daa3432201c6e0219468cd851669b06 /include/net/bluetooth
parenta3172b7eb4a2719711187cfca12097d2326e85a7 (diff)
Bluetooth: Use __le64 type for LE random numbers
The random numbers in Bluetooth Low Energy are 64-bit numbers and should also be little endian since the HCI specification is little endian. Change the whole Low Energy pairing to use __le64 instead of a byte array. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'include/net/bluetooth')
-rw-r--r--include/net/bluetooth/hci.h4
-rw-r--r--include/net/bluetooth/hci_core.h8
-rw-r--r--include/net/bluetooth/mgmt.h2
3 files changed, 7 insertions, 7 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 35ef60febd57..0740fee39c73 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -1234,7 +1234,7 @@ struct hci_cp_le_conn_update {
1234#define HCI_OP_LE_START_ENC 0x2019 1234#define HCI_OP_LE_START_ENC 0x2019
1235struct hci_cp_le_start_enc { 1235struct hci_cp_le_start_enc {
1236 __le16 handle; 1236 __le16 handle;
1237 __u8 rand[8]; 1237 __le64 rand;
1238 __le16 ediv; 1238 __le16 ediv;
1239 __u8 ltk[16]; 1239 __u8 ltk[16];
1240} __packed; 1240} __packed;
@@ -1646,7 +1646,7 @@ struct hci_ev_le_conn_complete {
1646#define HCI_EV_LE_LTK_REQ 0x05 1646#define HCI_EV_LE_LTK_REQ 0x05
1647struct hci_ev_le_ltk_req { 1647struct hci_ev_le_ltk_req {
1648 __le16 handle; 1648 __le16 handle;
1649 __u8 random[8]; 1649 __le64 rand;
1650 __le16 ediv; 1650 __le16 ediv;
1651} __packed; 1651} __packed;
1652 1652
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 571168811ecd..0c63a7e12d90 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -99,7 +99,7 @@ struct smp_ltk {
99 u8 type; 99 u8 type;
100 u8 enc_size; 100 u8 enc_size;
101 __le16 ediv; 101 __le16 ediv;
102 u8 rand[8]; 102 __le64 rand;
103 u8 val[16]; 103 u8 val[16];
104}; 104};
105 105
@@ -828,11 +828,11 @@ void hci_link_keys_clear(struct hci_dev *hdev);
828struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 828struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
829int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, 829int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
830 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len); 830 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len);
831struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8], 831struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, __le64 rand,
832 bool master); 832 bool master);
833struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, 833struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
834 u8 addr_type, u8 type, u8 authenticated, 834 u8 addr_type, u8 type, u8 authenticated,
835 u8 tk[16], u8 enc_size, __le16 ediv, u8 rand[8]); 835 u8 tk[16], u8 enc_size, __le16 ediv, __le64 rand);
836struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr, 836struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr,
837 u8 addr_type, bool master); 837 u8 addr_type, bool master);
838int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type); 838int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type);
@@ -1293,7 +1293,7 @@ struct hci_sec_filter {
1293 1293
1294void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, 1294void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
1295 u16 latency, u16 to_multiplier); 1295 u16 latency, u16 to_multiplier);
1296void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8], 1296void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand,
1297 __u8 ltk[16]); 1297 __u8 ltk[16]);
1298 1298
1299int hci_update_random_address(struct hci_request *req, bool require_privacy, 1299int hci_update_random_address(struct hci_request *req, bool require_privacy,
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 62d560624e3d..0326648fd799 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -187,7 +187,7 @@ struct mgmt_ltk_info {
187 __u8 master; 187 __u8 master;
188 __u8 enc_size; 188 __u8 enc_size;
189 __le16 ediv; 189 __le16 ediv;
190 __u8 rand[8]; 190 __le64 rand;
191 __u8 val[16]; 191 __u8 val[16];
192} __packed; 192} __packed;
193 193