BT_DBG("conn %p", conn);
if (test_bit(HCI_CONN_SSP_ENABLED, &conn->flags) &&
- conn->hdev->ssp_mode > 0 &&
- !(conn->link_mode & HCI_LM_ENCRYPT))
+ test_bit(HCI_SSP_ENABLED, &conn->hdev->dev_flags) &&
+ !(conn->link_mode & HCI_LM_ENCRYPT))
return 0;
return 1;
key. */
if (sec_level == BT_SECURITY_LOW &&
(!test_bit(HCI_CONN_SSP_ENABLED, &conn->flags) ||
- !conn->hdev->ssp_mode))
+ !test_bit(HCI_SSP_ENABLED, &conn->hdev->dev_flags)))
return 1;
/* For other security levels we need the link key. */
if (rp->status)
return;
- hdev->ssp_mode = rp->mode;
+ if (rp->mode)
+ set_bit(HCI_SSP_ENABLED, &hdev->dev_flags);
+ else
+ clear_bit(HCI_SSP_ENABLED, &hdev->dev_flags);
}
static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb)
if (!sent)
return;
- hdev->ssp_mode = *((__u8 *) sent);
+ if (*((u8 *) sent))
+ set_bit(HCI_SSP_ENABLED, &hdev->dev_flags);
+ else
+ clear_bit(HCI_SSP_ENABLED, &hdev->dev_flags);
}
static u8 hci_get_inquiry_mode(struct hci_dev *hdev)
/* Only request authentication for SSP connections or non-SSP
* devices with sec_level HIGH or if MITM protection is requested */
- if (!(hdev->ssp_mode > 0 &&
+ if (!(test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) &&
test_bit(HCI_CONN_SSP_ENABLED, &conn->flags)) &&
conn->pending_sec_level != BT_SECURITY_HIGH &&
!(conn->auth_type & 0x01))
if (!ev->status) {
if (!(test_bit(HCI_CONN_SSP_ENABLED, &conn->flags) &&
- hdev->ssp_mode > 0) &&
+ test_bit(HCI_SSP_ENABLED, &hdev->dev_flags)) &&
test_bit(HCI_CONN_REAUTH_PEND, &conn->flags)) {
BT_INFO("re-auth of legacy device is not possible.");
} else {
clear_bit(HCI_CONN_REAUTH_PEND, &conn->flags);
if (conn->state == BT_CONFIG) {
- if (!ev->status && hdev->ssp_mode > 0 &&
+ if (!ev->status &&
+ test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) &&
test_bit(HCI_CONN_SSP_ENABLED, &conn->flags)) {
struct hci_cp_set_conn_encrypt cp;
cp.handle = ev->handle;
if (test_bit(HCI_AUTH, &hdev->flags))
settings |= MGMT_SETTING_LINK_SECURITY;
- if (hdev->ssp_mode > 0)
+ if (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags))
settings |= MGMT_SETTING_SSP;
return settings;
if (!(hdev->features[6] & LMP_EXT_INQ))
return 0;
- if (hdev->ssp_mode == 0)
+ if (!test_bit(HCI_SSP_ENABLED, &hdev->dev_flags))
return 0;
if (test_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))