Commit 9a1a1996 authored by Andre Guedes's avatar Andre Guedes Committed by Gustavo Padovan

Bluetooth: Use lmp_ssp_capable where applicable

This patch replaces all LMP_SIMPLE_PAIR bit checking by the helper
macro lmp_ssp_capable.
Signed-off-by: default avatarAndre Guedes <andre.guedes@openbossa.org>
Signed-off-by: default avatarGustavo Padovan <gustavo.padovan@collabora.co.uk>
parent c383ddc4
...@@ -528,7 +528,7 @@ static void hci_setup_event_mask(struct hci_dev *hdev) ...@@ -528,7 +528,7 @@ static void hci_setup_event_mask(struct hci_dev *hdev)
if (hdev->features[7] & LMP_LSTO) if (hdev->features[7] & LMP_LSTO)
events[6] |= 0x80; /* Link Supervision Timeout Changed */ events[6] |= 0x80; /* Link Supervision Timeout Changed */
if (hdev->features[6] & LMP_SIMPLE_PAIR) { if (lmp_ssp_capable(hdev)) {
events[6] |= 0x01; /* IO Capability Request */ events[6] |= 0x01; /* IO Capability Request */
events[6] |= 0x02; /* IO Capability Response */ events[6] |= 0x02; /* IO Capability Response */
events[6] |= 0x04; /* User Confirmation Request */ events[6] |= 0x04; /* User Confirmation Request */
......
...@@ -380,7 +380,7 @@ static u32 get_supported_settings(struct hci_dev *hdev) ...@@ -380,7 +380,7 @@ static u32 get_supported_settings(struct hci_dev *hdev)
settings |= MGMT_SETTING_DISCOVERABLE; settings |= MGMT_SETTING_DISCOVERABLE;
settings |= MGMT_SETTING_PAIRABLE; settings |= MGMT_SETTING_PAIRABLE;
if (hdev->features[6] & LMP_SIMPLE_PAIR) if (lmp_ssp_capable(hdev))
settings |= MGMT_SETTING_SSP; settings |= MGMT_SETTING_SSP;
if (lmp_bredr_capable(hdev)) { if (lmp_bredr_capable(hdev)) {
...@@ -1121,7 +1121,7 @@ static int set_ssp(struct sock *sk, struct hci_dev *hdev, void *data, u16 len) ...@@ -1121,7 +1121,7 @@ static int set_ssp(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
hci_dev_lock(hdev); hci_dev_lock(hdev);
if (!(hdev->features[6] & LMP_SIMPLE_PAIR)) { if (!lmp_ssp_capable(hdev)) {
err = cmd_status(sk, hdev->id, MGMT_OP_SET_SSP, err = cmd_status(sk, hdev->id, MGMT_OP_SET_SSP,
MGMT_STATUS_NOT_SUPPORTED); MGMT_STATUS_NOT_SUPPORTED);
goto failed; goto failed;
...@@ -2201,7 +2201,7 @@ static int read_local_oob_data(struct sock *sk, struct hci_dev *hdev, ...@@ -2201,7 +2201,7 @@ static int read_local_oob_data(struct sock *sk, struct hci_dev *hdev,
goto unlock; goto unlock;
} }
if (!(hdev->features[6] & LMP_SIMPLE_PAIR)) { if (!lmp_ssp_capable(hdev)) {
err = cmd_status(sk, hdev->id, MGMT_OP_READ_LOCAL_OOB_DATA, err = cmd_status(sk, hdev->id, MGMT_OP_READ_LOCAL_OOB_DATA,
MGMT_STATUS_NOT_SUPPORTED); MGMT_STATUS_NOT_SUPPORTED);
goto unlock; goto unlock;
......
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