[PATCH v1] Bluetooth: hci_core: Fix {cis,bis}_capable not checking if LE is enabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

{cis,bis}_capable shall check that LE is enabled otherwise its MGMT
settings would still be marked as supported when they shouldn't.

Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections")
Fixes: eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections")
Fixes: ae7533613133 ("Bluetooth: Check for ISO support in controller")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
---
 include/net/bluetooth/hci_core.h | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 4dc11c66f7b8..d64f8dad978e 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -1984,11 +1984,17 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
 #define cis_capable(dev) \
 	(cis_central_capable(dev) || cis_peripheral_capable(dev))
 #define cis_central_capable(dev) \
-	((dev)->le_features[3] & HCI_LE_CIS_CENTRAL)
+	(hci_dev_test_flag(hdev, HCI_LE_ENABLED) && \
+	 (dev)->le_features[3] & HCI_LE_CIS_CENTRAL)
 #define cis_peripheral_capable(dev) \
-	((dev)->le_features[3] & HCI_LE_CIS_PERIPHERAL)
-#define bis_capable(dev) ((dev)->le_features[3] & HCI_LE_ISO_BROADCASTER)
-#define sync_recv_capable(dev) ((dev)->le_features[3] & HCI_LE_ISO_SYNC_RECEIVER)
+	(hci_dev_test_flag(hdev, HCI_LE_ENABLED) && \
+	 (dev)->le_features[3] & HCI_LE_CIS_PERIPHERAL)
+#define bis_capable(dev) \
+	(hci_dev_test_flag(hdev, HCI_LE_ENABLED) && \
+	 (dev)->le_features[3] & HCI_LE_ISO_BROADCASTER)
+#define sync_recv_capable(dev) \
+	(hci_dev_test_flag(hdev, HCI_LE_ENABLED) && \
+	 (dev)->le_features[3] & HCI_LE_ISO_SYNC_RECEIVER)
 
 #define mws_transport_config_capable(dev) (((dev)->commands[30] & 0x08) && \
 	(!hci_test_quirk((dev), HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG)))
-- 
2.50.1





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux