diff options
| author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2012-11-29 10:46:05 -0500 |
|---|---|---|
| committer | Gustavo Padovan <gustavo.padovan@collabora.co.uk> | 2012-12-03 13:00:00 -0500 |
| commit | 5d05416e0907b0dd30b62b002bed3b85e6efbd61 (patch) | |
| tree | 8ee7c46ae2533c168a63e9e1ea10980168c06a2c /include/net/bluetooth | |
| parent | ced5c338d7b696021058c23fb6a286def2171df5 (diff) | |
Bluetooth: AMP: Check that AMP is present and active
Before starting quering remote AMP controllers make sure
that there is local active AMP controller.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'include/net/bluetooth')
| -rw-r--r-- | include/net/bluetooth/hci_core.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 2f2b743f5b1..014a2eaa538 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
| @@ -779,6 +779,22 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
| 779 | #define lmp_host_le_capable(dev) !!((dev)->host_features[0] & LMP_HOST_LE) | 779 | #define lmp_host_le_capable(dev) !!((dev)->host_features[0] & LMP_HOST_LE) |
| 780 | #define lmp_host_le_br_capable(dev) !!((dev)->host_features[0] & LMP_HOST_LE_BREDR) | 780 | #define lmp_host_le_br_capable(dev) !!((dev)->host_features[0] & LMP_HOST_LE_BREDR) |
| 781 | 781 | ||
| 782 | /* returns true if at least one AMP active */ | ||
| 783 | static inline bool hci_amp_capable(void) | ||
| 784 | { | ||
| 785 | struct hci_dev *hdev; | ||
| 786 | bool ret = false; | ||
| 787 | |||
| 788 | read_lock(&hci_dev_list_lock); | ||
| 789 | list_for_each_entry(hdev, &hci_dev_list, list) | ||
| 790 | if (hdev->amp_type == HCI_AMP && | ||
| 791 | test_bit(HCI_UP, &hdev->flags)) | ||
| 792 | ret = true; | ||
| 793 | read_unlock(&hci_dev_list_lock); | ||
| 794 | |||
| 795 | return ret; | ||
| 796 | } | ||
| 797 | |||
| 782 | /* ----- HCI protocols ----- */ | 798 | /* ----- HCI protocols ----- */ |
| 783 | #define HCI_PROTO_DEFER 0x01 | 799 | #define HCI_PROTO_DEFER 0x01 |
| 784 | 800 | ||
