#define hci_dev_set_flag(hdev, nr) set_bit((nr), &(hdev)->dev_flags)
#define hci_dev_clear_flag(hdev, nr) clear_bit((nr), &(hdev)->dev_flags)
+#define hci_dev_change_flag(hdev, nr) change_bit((nr), &(hdev)->dev_flags)
#define hci_dev_test_flag(hdev, nr) test_bit((nr), &(hdev)->dev_flags)
/* ----- HCI interface to upper protocols ----- */
* and so no need to check HCI_LIMITED_DISCOVERABLE.
*/
if (!!cp->val != hci_dev_test_flag(hdev, HCI_DISCOVERABLE)) {
- change_bit(HCI_DISCOVERABLE, &hdev->dev_flags);
+ hci_dev_change_flag(hdev, HCI_DISCOVERABLE);
changed = true;
}
bool changed = false;
if (!!cp->val != hci_dev_test_flag(hdev, HCI_LINK_SECURITY)) {
- change_bit(HCI_LINK_SECURITY, &hdev->dev_flags);
+ hci_dev_change_flag(hdev, HCI_LINK_SECURITY);
changed = true;
}
bool changed = false;
if (val != hci_dev_test_flag(hdev, HCI_LE_ENABLED)) {
- change_bit(HCI_LE_ENABLED, &hdev->dev_flags);
+ hci_dev_change_flag(hdev, HCI_LE_ENABLED);
changed = true;
}
}
if (!hdev_is_powered(hdev)) {
- change_bit(HCI_FAST_CONNECTABLE, &hdev->dev_flags);
+ hci_dev_change_flag(hdev, HCI_FAST_CONNECTABLE);
err = send_settings_rsp(sk, MGMT_OP_SET_FAST_CONNECTABLE,
hdev);
new_settings(hdev, sk);
hci_dev_clear_flag(hdev, HCI_HS_ENABLED);
}
- change_bit(HCI_BREDR_ENABLED, &hdev->dev_flags);
+ hci_dev_change_flag(hdev, HCI_BREDR_ENABLED);
err = send_settings_rsp(sk, MGMT_OP_SET_BREDR, hdev);
if (err < 0)