diff options
-rw-r--r-- | include/net/bluetooth/hci_core.h | 16 | ||||
-rw-r--r-- | net/bluetooth/l2cap_core.c | 16 |
2 files changed, 16 insertions, 16 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 4cb355b023a4..82c397451261 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -795,22 +795,6 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
795 | #define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE)) | 795 | #define lmp_host_le_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE)) |
796 | #define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR)) | 796 | #define lmp_host_le_br_capable(dev) (!!((dev)->features[1][0] & LMP_HOST_LE_BREDR)) |
797 | 797 | ||
798 | /* returns true if at least one AMP active */ | ||
799 | static inline bool hci_amp_capable(void) | ||
800 | { | ||
801 | struct hci_dev *hdev; | ||
802 | bool ret = false; | ||
803 | |||
804 | read_lock(&hci_dev_list_lock); | ||
805 | list_for_each_entry(hdev, &hci_dev_list, list) | ||
806 | if (hdev->amp_type != AMP_TYPE_BREDR && | ||
807 | test_bit(HCI_UP, &hdev->flags)) | ||
808 | ret = true; | ||
809 | read_unlock(&hci_dev_list_lock); | ||
810 | |||
811 | return ret; | ||
812 | } | ||
813 | |||
814 | /* ----- HCI protocols ----- */ | 798 | /* ----- HCI protocols ----- */ |
815 | #define HCI_PROTO_DEFER 0x01 | 799 | #define HCI_PROTO_DEFER 0x01 |
816 | 800 | ||
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index b0208e20390c..2efdb17d87a3 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
@@ -1012,6 +1012,22 @@ static inline int __l2cap_no_conn_pending(struct l2cap_chan *chan) | |||
1012 | return !test_bit(CONF_CONNECT_PEND, &chan->conf_state); | 1012 | return !test_bit(CONF_CONNECT_PEND, &chan->conf_state); |
1013 | } | 1013 | } |
1014 | 1014 | ||
1015 | /* returns true if at least one AMP active */ | ||
1016 | static inline bool hci_amp_capable(void) | ||
1017 | { | ||
1018 | struct hci_dev *hdev; | ||
1019 | bool ret = false; | ||
1020 | |||
1021 | read_lock(&hci_dev_list_lock); | ||
1022 | list_for_each_entry(hdev, &hci_dev_list, list) | ||
1023 | if (hdev->amp_type != AMP_TYPE_BREDR && | ||
1024 | test_bit(HCI_UP, &hdev->flags)) | ||
1025 | ret = true; | ||
1026 | read_unlock(&hci_dev_list_lock); | ||
1027 | |||
1028 | return ret; | ||
1029 | } | ||
1030 | |||
1015 | static bool __amp_capable(struct l2cap_chan *chan) | 1031 | static bool __amp_capable(struct l2cap_chan *chan) |
1016 | { | 1032 | { |
1017 | struct l2cap_conn *conn = chan->conn; | 1033 | struct l2cap_conn *conn = chan->conn; |