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