Bluetooth: Check for ISO support in controller
authorClaudia Draghicescu <claudia.rosu@nxp.com>
Wed, 10 May 2023 13:45:57 +0000 (16:45 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 11 Aug 2023 18:31:23 +0000 (11:31 -0700)
This patch checks for ISO_BROADCASTER and ISO_SYNC_RECEIVER in
controller.

Signed-off-by: Claudia Draghicescu <claudia.rosu@nxp.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
include/net/bluetooth/hci.h
include/net/bluetooth/hci_core.h
include/net/bluetooth/mgmt.h
net/bluetooth/mgmt.c

index 872dcb91a540e7d50c95db592947811364f5f16f..ab2f8f1817cf1b63af4f0d1630e51a14a437efff 100644 (file)
@@ -577,6 +577,7 @@ enum {
 #define HCI_LE_CIS_CENTRAL             0x10
 #define HCI_LE_CIS_PERIPHERAL          0x20
 #define HCI_LE_ISO_BROADCASTER         0x40
+#define HCI_LE_ISO_SYNC_RECEIVER       0x80
 
 /* Connection modes */
 #define HCI_CM_ACTIVE  0x0000
index e01d52cb668c0526ad44706c0d2ebaae72177331..da871581ef87be8ac183fbe96badb64319d6f9c6 100644 (file)
@@ -1765,6 +1765,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
 #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)
 
 #define mws_transport_config_capable(dev) (((dev)->commands[30] & 0x08) && \
        (!test_bit(HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG, &(dev)->quirks)))
index 5e68b3dd44222b82f2a2657fd5cce942ac1e55f0..d382679efd2b1c148a46e59d1f5e4cade063b5e6 100644 (file)
@@ -111,6 +111,8 @@ struct mgmt_rp_read_index_list {
 #define MGMT_SETTING_WIDEBAND_SPEECH   BIT(17)
 #define MGMT_SETTING_CIS_CENTRAL       BIT(18)
 #define MGMT_SETTING_CIS_PERIPHERAL    BIT(19)
+#define MGMT_SETTING_ISO_BROADCASTER   BIT(20)
+#define MGMT_SETTING_ISO_SYNC_RECEIVER BIT(21)
 
 #define MGMT_OP_READ_INFO              0x0004
 #define MGMT_READ_INFO_SIZE            0
index d4498037fadc658ae8d29b47d70ea881033e7fb9..4c352abe063b98a34b6655a4e60abee65cf4e1f2 100644 (file)
@@ -944,6 +944,12 @@ static u32 get_current_settings(struct hci_dev *hdev)
        if (cis_peripheral_capable(hdev))
                settings |= MGMT_SETTING_CIS_PERIPHERAL;
 
+       if (bis_capable(hdev))
+               settings |= MGMT_SETTING_ISO_BROADCASTER;
+
+       if (sync_recv_capable(hdev))
+               settings |= MGMT_SETTING_ISO_SYNC_RECEIVER;
+
        return settings;
 }