diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2015-03-13 05:11:01 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2015-03-13 06:09:26 -0400 |
commit | a1536da255f16f42b8f069b2769134b32558b265 (patch) | |
tree | d2ba54c3a9069c3133456b8eeb9d04e58d428a8c /net/bluetooth/hci_event.c | |
parent | d7a5a11d7fa80beb43d5f7cb421c86f9b4d21200 (diff) |
Bluetooth: Introduce hci_dev_set_flag helper macro
Instead of manually coding set_bit on hdev->dev_flags all the time,
use hci_dev_set_flag helper macro.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'net/bluetooth/hci_event.c')
-rw-r--r-- | net/bluetooth/hci_event.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index f1ed3fe9e0df..b01a93efada8 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -70,7 +70,7 @@ static void hci_cc_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb) | |||
70 | if (status) | 70 | if (status) |
71 | return; | 71 | return; |
72 | 72 | ||
73 | set_bit(HCI_PERIODIC_INQ, &hdev->dev_flags); | 73 | hci_dev_set_flag(hdev, HCI_PERIODIC_INQ); |
74 | } | 74 | } |
75 | 75 | ||
76 | static void hci_cc_exit_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb) | 76 | static void hci_cc_exit_periodic_inq(struct hci_dev *hdev, struct sk_buff *skb) |
@@ -501,7 +501,7 @@ static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb) | |||
501 | mgmt_ssp_enable_complete(hdev, sent->mode, status); | 501 | mgmt_ssp_enable_complete(hdev, sent->mode, status); |
502 | else if (!status) { | 502 | else if (!status) { |
503 | if (sent->mode) | 503 | if (sent->mode) |
504 | set_bit(HCI_SSP_ENABLED, &hdev->dev_flags); | 504 | hci_dev_set_flag(hdev, HCI_SSP_ENABLED); |
505 | else | 505 | else |
506 | clear_bit(HCI_SSP_ENABLED, &hdev->dev_flags); | 506 | clear_bit(HCI_SSP_ENABLED, &hdev->dev_flags); |
507 | } | 507 | } |
@@ -531,7 +531,7 @@ static void hci_cc_write_sc_support(struct hci_dev *hdev, struct sk_buff *skb) | |||
531 | 531 | ||
532 | if (!hci_dev_test_flag(hdev, HCI_MGMT) && !status) { | 532 | if (!hci_dev_test_flag(hdev, HCI_MGMT) && !status) { |
533 | if (sent->support) | 533 | if (sent->support) |
534 | set_bit(HCI_SC_ENABLED, &hdev->dev_flags); | 534 | hci_dev_set_flag(hdev, HCI_SC_ENABLED); |
535 | else | 535 | else |
536 | clear_bit(HCI_SC_ENABLED, &hdev->dev_flags); | 536 | clear_bit(HCI_SC_ENABLED, &hdev->dev_flags); |
537 | } | 537 | } |
@@ -1109,7 +1109,7 @@ static void hci_cc_le_set_adv_enable(struct hci_dev *hdev, struct sk_buff *skb) | |||
1109 | if (*sent) { | 1109 | if (*sent) { |
1110 | struct hci_conn *conn; | 1110 | struct hci_conn *conn; |
1111 | 1111 | ||
1112 | set_bit(HCI_LE_ADV, &hdev->dev_flags); | 1112 | hci_dev_set_flag(hdev, HCI_LE_ADV); |
1113 | 1113 | ||
1114 | conn = hci_conn_hash_lookup_state(hdev, LE_LINK, BT_CONNECT); | 1114 | conn = hci_conn_hash_lookup_state(hdev, LE_LINK, BT_CONNECT); |
1115 | if (conn) | 1115 | if (conn) |
@@ -1192,7 +1192,7 @@ static void hci_cc_le_set_scan_enable(struct hci_dev *hdev, | |||
1192 | 1192 | ||
1193 | switch (cp->enable) { | 1193 | switch (cp->enable) { |
1194 | case LE_SCAN_ENABLE: | 1194 | case LE_SCAN_ENABLE: |
1195 | set_bit(HCI_LE_SCAN, &hdev->dev_flags); | 1195 | hci_dev_set_flag(hdev, HCI_LE_SCAN); |
1196 | if (hdev->le_scan_type == LE_SCAN_ACTIVE) | 1196 | if (hdev->le_scan_type == LE_SCAN_ACTIVE) |
1197 | clear_pending_adv_report(hdev); | 1197 | clear_pending_adv_report(hdev); |
1198 | break; | 1198 | break; |
@@ -1388,7 +1388,7 @@ static void hci_cc_write_le_host_supported(struct hci_dev *hdev, | |||
1388 | 1388 | ||
1389 | if (sent->le) { | 1389 | if (sent->le) { |
1390 | hdev->features[1][0] |= LMP_HOST_LE; | 1390 | hdev->features[1][0] |= LMP_HOST_LE; |
1391 | set_bit(HCI_LE_ENABLED, &hdev->dev_flags); | 1391 | hci_dev_set_flag(hdev, HCI_LE_ENABLED); |
1392 | } else { | 1392 | } else { |
1393 | hdev->features[1][0] &= ~LMP_HOST_LE; | 1393 | hdev->features[1][0] &= ~LMP_HOST_LE; |
1394 | clear_bit(HCI_LE_ENABLED, &hdev->dev_flags); | 1394 | clear_bit(HCI_LE_ENABLED, &hdev->dev_flags); |
@@ -2608,7 +2608,7 @@ static void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *skb) | |||
2608 | * whenever the encryption procedure fails. | 2608 | * whenever the encryption procedure fails. |
2609 | */ | 2609 | */ |
2610 | if (ev->status && conn->type == LE_LINK) | 2610 | if (ev->status && conn->type == LE_LINK) |
2611 | set_bit(HCI_RPA_EXPIRED, &hdev->dev_flags); | 2611 | hci_dev_set_flag(hdev, HCI_RPA_EXPIRED); |
2612 | 2612 | ||
2613 | clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); | 2613 | clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); |
2614 | 2614 | ||