diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2015-03-13 12:04:17 -0400 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2015-03-13 12:35:45 -0400 |
commit | eacb44dff98559d4682072c0061e1ecb63687e9c (patch) | |
tree | 5634cae7658ca3029b8d56426086d5fa6f7e7299 /include/net | |
parent | 6576fe4afc1203d27a5f4c8f5511f44203f4e333 (diff) |
Bluetooth: Use DECLARE_BITMAP for hdev->dev_flags field
The hdev->dev_flags field has outgrown itself on 32-bit systems. So
instead of hacking around it, switch to using DECLARE_BITMAP.
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/bluetooth/hci.h | 7 | ||||
-rw-r--r-- | include/net/bluetooth/hci_core.h | 24 |
2 files changed, 16 insertions, 15 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 0f3413b285a5..7a0272a6f0ba 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -226,14 +226,9 @@ enum { | |||
226 | HCI_FAST_CONNECTABLE, | 226 | HCI_FAST_CONNECTABLE, |
227 | HCI_BREDR_ENABLED, | 227 | HCI_BREDR_ENABLED, |
228 | HCI_LE_SCAN_INTERRUPTED, | 228 | HCI_LE_SCAN_INTERRUPTED, |
229 | __HCI_NUM_FLAGS, | ||
229 | }; | 230 | }; |
230 | 231 | ||
231 | /* A mask for the flags that are supposed to remain when a reset happens | ||
232 | * or the HCI device is closed. | ||
233 | */ | ||
234 | #define HCI_PERSISTENT_MASK (BIT(HCI_LE_SCAN) | BIT(HCI_PERIODIC_INQ) | \ | ||
235 | BIT(HCI_LE_ADV)) | ||
236 | |||
237 | /* HCI timeouts */ | 232 | /* HCI timeouts */ |
238 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 233 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
239 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ | 234 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 6db1333a114f..889a489d913f 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -354,7 +354,7 @@ struct hci_dev { | |||
354 | struct rfkill *rfkill; | 354 | struct rfkill *rfkill; |
355 | 355 | ||
356 | unsigned long dbg_flags; | 356 | unsigned long dbg_flags; |
357 | unsigned long dev_flags; | 357 | DECLARE_BITMAP(dev_flags, __HCI_NUM_FLAGS); |
358 | 358 | ||
359 | struct delayed_work le_scan_disable; | 359 | struct delayed_work le_scan_disable; |
360 | struct delayed_work le_scan_restart; | 360 | struct delayed_work le_scan_restart; |
@@ -502,14 +502,20 @@ extern struct list_head hci_cb_list; | |||
502 | extern rwlock_t hci_dev_list_lock; | 502 | extern rwlock_t hci_dev_list_lock; |
503 | extern struct mutex hci_cb_list_lock; | 503 | extern struct mutex hci_cb_list_lock; |
504 | 504 | ||
505 | #define hci_dev_set_flag(hdev, nr) set_bit((nr), &(hdev)->dev_flags) | 505 | #define hci_dev_set_flag(hdev, nr) set_bit((nr), (hdev)->dev_flags) |
506 | #define hci_dev_clear_flag(hdev, nr) clear_bit((nr), &(hdev)->dev_flags) | 506 | #define hci_dev_clear_flag(hdev, nr) clear_bit((nr), (hdev)->dev_flags) |
507 | #define hci_dev_change_flag(hdev, nr) change_bit((nr), &(hdev)->dev_flags) | 507 | #define hci_dev_change_flag(hdev, nr) change_bit((nr), (hdev)->dev_flags) |
508 | #define hci_dev_test_flag(hdev, nr) test_bit((nr), &(hdev)->dev_flags) | 508 | #define hci_dev_test_flag(hdev, nr) test_bit((nr), (hdev)->dev_flags) |
509 | 509 | #define hci_dev_test_and_set_flag(hdev, nr) test_and_set_bit((nr), (hdev)->dev_flags) | |
510 | #define hci_dev_test_and_set_flag(hdev, nr) test_and_set_bit((nr), &(hdev)->dev_flags) | 510 | #define hci_dev_test_and_clear_flag(hdev, nr) test_and_clear_bit((nr), (hdev)->dev_flags) |
511 | #define hci_dev_test_and_clear_flag(hdev, nr) test_and_clear_bit((nr), &(hdev)->dev_flags) | 511 | #define hci_dev_test_and_change_flag(hdev, nr) test_and_change_bit((nr), (hdev)->dev_flags) |
512 | #define hci_dev_test_and_change_flag(hdev, nr) test_and_change_bit((nr), &(hdev)->dev_flags) | 512 | |
513 | #define hci_dev_clear_volatile_flags(hdev) \ | ||
514 | do { \ | ||
515 | hci_dev_clear_flag(hdev, HCI_LE_SCAN); \ | ||
516 | hci_dev_clear_flag(hdev, HCI_LE_ADV); \ | ||
517 | hci_dev_clear_flag(hdev, HCI_PERIODIC_INQ); \ | ||
518 | } while (0) | ||
513 | 519 | ||
514 | /* ----- HCI interface to upper protocols ----- */ | 520 | /* ----- HCI interface to upper protocols ----- */ |
515 | int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); | 521 | int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); |