Commit eb9a8f3f authored by Marcel Holtmann's avatar Marcel Holtmann Committed by Johan Hedberg

Bluetooth: Track Secure Connections support of remote devices

It is important to know if Secure Connections support has been enabled
for a given remote device. The information is provided in the remote
host features page. So track this information and provide a simple
helper function to extract the status.
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent eadd663a
...@@ -448,6 +448,7 @@ enum { ...@@ -448,6 +448,7 @@ enum {
HCI_CONN_LE_SMP_PEND, HCI_CONN_LE_SMP_PEND,
HCI_CONN_MGMT_CONNECTED, HCI_CONN_MGMT_CONNECTED,
HCI_CONN_SSP_ENABLED, HCI_CONN_SSP_ENABLED,
HCI_CONN_SC_ENABLED,
HCI_CONN_POWER_SAVE, HCI_CONN_POWER_SAVE,
HCI_CONN_REMOTE_OOB, HCI_CONN_REMOTE_OOB,
HCI_CONN_6LOWPAN, HCI_CONN_6LOWPAN,
...@@ -460,6 +461,13 @@ static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) ...@@ -460,6 +461,13 @@ static inline bool hci_conn_ssp_enabled(struct hci_conn *conn)
test_bit(HCI_CONN_SSP_ENABLED, &conn->flags); test_bit(HCI_CONN_SSP_ENABLED, &conn->flags);
} }
static inline bool hci_conn_sc_enabled(struct hci_conn *conn)
{
struct hci_dev *hdev = conn->hdev;
return test_bit(HCI_SC_ENABLED, &hdev->dev_flags) &&
test_bit(HCI_CONN_SC_ENABLED, &conn->flags);
}
static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c) static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c)
{ {
struct hci_conn_hash *h = &hdev->conn_hash; struct hci_conn_hash *h = &hdev->conn_hash;
......
...@@ -2898,6 +2898,9 @@ static void hci_remote_ext_features_evt(struct hci_dev *hdev, ...@@ -2898,6 +2898,9 @@ static void hci_remote_ext_features_evt(struct hci_dev *hdev,
* features do not indicate SSP support */ * features do not indicate SSP support */
clear_bit(HCI_CONN_SSP_ENABLED, &conn->flags); clear_bit(HCI_CONN_SSP_ENABLED, &conn->flags);
} }
if (ev->features[0] & LMP_HOST_SC)
set_bit(HCI_CONN_SC_ENABLED, &conn->flags);
} }
if (conn->state != BT_CONFIG) if (conn->state != BT_CONFIG)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment