aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/bluetooth/hci_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/bluetooth/hci_core.h')
-rw-r--r--include/net/bluetooth/hci_core.h39
1 files changed, 29 insertions, 10 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index a805b3d97c0b..3c7827005c25 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -75,6 +75,10 @@ struct discovery_state {
75 u32 last_adv_flags; 75 u32 last_adv_flags;
76 u8 last_adv_data[HCI_MAX_AD_LENGTH]; 76 u8 last_adv_data[HCI_MAX_AD_LENGTH];
77 u8 last_adv_data_len; 77 u8 last_adv_data_len;
78 bool report_invalid_rssi;
79 s8 rssi;
80 u16 uuid_count;
81 u8 (*uuids)[16];
78}; 82};
79 83
80struct hci_conn_hash { 84struct hci_conn_hash {
@@ -130,6 +134,7 @@ struct smp_irk {
130 134
131struct link_key { 135struct link_key {
132 struct list_head list; 136 struct list_head list;
137 struct rcu_head rcu;
133 bdaddr_t bdaddr; 138 bdaddr_t bdaddr;
134 u8 type; 139 u8 type;
135 u8 val[HCI_LINK_KEY_SIZE]; 140 u8 val[HCI_LINK_KEY_SIZE];
@@ -139,6 +144,7 @@ struct link_key {
139struct oob_data { 144struct oob_data {
140 struct list_head list; 145 struct list_head list;
141 bdaddr_t bdaddr; 146 bdaddr_t bdaddr;
147 u8 bdaddr_type;
142 u8 hash192[16]; 148 u8 hash192[16];
143 u8 rand192[16]; 149 u8 rand192[16];
144 u8 hash256[16]; 150 u8 hash256[16];
@@ -305,6 +311,7 @@ struct hci_dev {
305 __u32 req_result; 311 __u32 req_result;
306 312
307 void *smp_data; 313 void *smp_data;
314 void *smp_bredr_data;
308 315
309 struct discovery_state discovery; 316 struct discovery_state discovery;
310 struct hci_conn_hash conn_hash; 317 struct hci_conn_hash conn_hash;
@@ -500,6 +507,17 @@ static inline void discovery_init(struct hci_dev *hdev)
500 INIT_LIST_HEAD(&hdev->discovery.all); 507 INIT_LIST_HEAD(&hdev->discovery.all);
501 INIT_LIST_HEAD(&hdev->discovery.unknown); 508 INIT_LIST_HEAD(&hdev->discovery.unknown);
502 INIT_LIST_HEAD(&hdev->discovery.resolve); 509 INIT_LIST_HEAD(&hdev->discovery.resolve);
510 hdev->discovery.report_invalid_rssi = true;
511 hdev->discovery.rssi = HCI_RSSI_INVALID;
512}
513
514static inline void hci_discovery_filter_clear(struct hci_dev *hdev)
515{
516 hdev->discovery.report_invalid_rssi = true;
517 hdev->discovery.rssi = HCI_RSSI_INVALID;
518 hdev->discovery.uuid_count = 0;
519 kfree(hdev->discovery.uuids);
520 hdev->discovery.uuids = NULL;
503} 521}
504 522
505bool hci_discovery_active(struct hci_dev *hdev); 523bool hci_discovery_active(struct hci_dev *hdev);
@@ -558,6 +576,7 @@ enum {
558 HCI_CONN_AUTH_INITIATOR, 576 HCI_CONN_AUTH_INITIATOR,
559 HCI_CONN_DROP, 577 HCI_CONN_DROP,
560 HCI_CONN_PARAM_REMOVAL_PEND, 578 HCI_CONN_PARAM_REMOVAL_PEND,
579 HCI_CONN_NEW_LINK_KEY,
561}; 580};
562 581
563static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) 582static inline bool hci_conn_ssp_enabled(struct hci_conn *conn)
@@ -920,13 +939,11 @@ struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
920struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, 939struct link_key *hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn,
921 bdaddr_t *bdaddr, u8 *val, u8 type, 940 bdaddr_t *bdaddr, u8 *val, u8 type,
922 u8 pin_len, bool *persistent); 941 u8 pin_len, bool *persistent);
923struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, __le64 rand,
924 u8 role);
925struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, 942struct smp_ltk *hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
926 u8 addr_type, u8 type, u8 authenticated, 943 u8 addr_type, u8 type, u8 authenticated,
927 u8 tk[16], u8 enc_size, __le16 ediv, __le64 rand); 944 u8 tk[16], u8 enc_size, __le16 ediv, __le64 rand);
928struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr, 945struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr,
929 u8 addr_type, u8 role); 946 u8 addr_type, u8 role);
930int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type); 947int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 bdaddr_type);
931void hci_smp_ltks_clear(struct hci_dev *hdev); 948void hci_smp_ltks_clear(struct hci_dev *hdev);
932int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 949int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
@@ -941,13 +958,12 @@ void hci_smp_irks_clear(struct hci_dev *hdev);
941 958
942void hci_remote_oob_data_clear(struct hci_dev *hdev); 959void hci_remote_oob_data_clear(struct hci_dev *hdev);
943struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev, 960struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev,
944 bdaddr_t *bdaddr); 961 bdaddr_t *bdaddr, u8 bdaddr_type);
945int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, 962int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
946 u8 *hash, u8 *rand); 963 u8 bdaddr_type, u8 *hash192, u8 *rand192,
947int hci_add_remote_oob_ext_data(struct hci_dev *hdev, bdaddr_t *bdaddr, 964 u8 *hash256, u8 *rand256);
948 u8 *hash192, u8 *rand192, 965int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr,
949 u8 *hash256, u8 *rand256); 966 u8 bdaddr_type);
950int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr);
951 967
952void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); 968void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
953 969
@@ -998,6 +1014,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
998 1014
999#define hdev_is_powered(hdev) (test_bit(HCI_UP, &hdev->flags) && \ 1015#define hdev_is_powered(hdev) (test_bit(HCI_UP, &hdev->flags) && \
1000 !test_bit(HCI_AUTO_OFF, &hdev->dev_flags)) 1016 !test_bit(HCI_AUTO_OFF, &hdev->dev_flags))
1017#define bredr_sc_enabled(dev) ((lmp_sc_capable(dev) || \
1018 test_bit(HCI_FORCE_SC, &(dev)->dbg_flags)) && \
1019 test_bit(HCI_SC_ENABLED, &(dev)->dev_flags))
1001 1020
1002/* ----- HCI protocols ----- */ 1021/* ----- HCI protocols ----- */
1003#define HCI_PROTO_DEFER 0x01 1022#define HCI_PROTO_DEFER 0x01