summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorNaga Bhavani Akella <naga.akella@oss.qualcomm.com>2025-12-17 16:55:23 +0530
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2026-01-29 13:24:48 -0500
commitfe05e3c0593fda2c476b359b012065a42dccdd71 (patch)
treea8b8d8e153d8e6defb7e08359c780adc644efa1a /net
parent48fea7d4b363cfc051d50639a135f8be5d0be7c2 (diff)
Bluetooth: hci_sync: Add LE Channel Sounding HCI Command/event structures
1. Implement LE Event Mask to include events required for LE Channel Sounding 2. Enable Channel Sounding feature bit in the LE Host Supported Features command 3. Define HCI command and event structures necessary for LE Channel Sounding functionality Signed-off-by: Naga Bhavani Akella <naga.akella@oss.qualcomm.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/bluetooth/hci_sync.c45
1 files changed, 38 insertions, 7 deletions
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 334eb4376a26..4163d9b16e1a 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4428,6 +4428,17 @@ static int hci_le_set_event_mask_sync(struct hci_dev *hdev)
events[4] |= 0x02; /* LE BIG Info Advertising Report */
}
+ if (le_cs_capable(hdev)) {
+ /* Channel Sounding events */
+ events[5] |= 0x08; /* LE CS Read Remote Supported Cap Complete event */
+ events[5] |= 0x10; /* LE CS Read Remote FAE Table Complete event */
+ events[5] |= 0x20; /* LE CS Security Enable Complete event */
+ events[5] |= 0x40; /* LE CS Config Complete event */
+ events[5] |= 0x80; /* LE CS Procedure Enable Complete event */
+ events[6] |= 0x01; /* LE CS Subevent Result event */
+ events[6] |= 0x02; /* LE CS Subevent Result Continue event */
+ events[6] |= 0x04; /* LE CS Test End Complete event */
+ }
return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_EVENT_MASK,
sizeof(events), events, HCI_CMD_TIMEOUT);
}
@@ -4560,23 +4571,43 @@ static int hci_set_le_support_sync(struct hci_dev *hdev)
}
/* LE Set Host Feature */
-static int hci_le_set_host_feature_sync(struct hci_dev *hdev)
+static int hci_le_set_host_feature_sync(struct hci_dev *hdev, u8 bit, u8 value)
{
struct hci_cp_le_set_host_feature cp;
- if (!iso_capable(hdev))
- return 0;
-
memset(&cp, 0, sizeof(cp));
/* Connected Isochronous Channels (Host Support) */
- cp.bit_number = 32;
- cp.bit_value = iso_enabled(hdev) ? 0x01 : 0x00;
+ cp.bit_number = bit;
+ cp.bit_value = value;
return __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_HOST_FEATURE,
sizeof(cp), &cp, HCI_CMD_TIMEOUT);
}
+/* Set Host Features, each feature needs to be sent separately since
+ * HCI_OP_LE_SET_HOST_FEATURE doesn't support setting all of them at once.
+ */
+static int hci_le_set_host_features_sync(struct hci_dev *hdev)
+{
+ int err;
+
+ if (iso_capable(hdev)) {
+ /* Connected Isochronous Channels (Host Support) */
+ err = hci_le_set_host_feature_sync(hdev, 32,
+ (iso_enabled(hdev) ? 0x01 :
+ 0x00));
+ if (err)
+ return err;
+ }
+
+ if (le_cs_capable(hdev))
+ /* Channel Sounding (Host Support) */
+ err = hci_le_set_host_feature_sync(hdev, 47, 0x01);
+
+ return err;
+}
+
/* LE Controller init stage 3 command sequence */
static const struct hci_init_stage le_init3[] = {
/* HCI_OP_LE_SET_EVENT_MASK */
@@ -4604,7 +4635,7 @@ static const struct hci_init_stage le_init3[] = {
/* HCI_OP_WRITE_LE_HOST_SUPPORTED */
HCI_INIT(hci_set_le_support_sync),
/* HCI_OP_LE_SET_HOST_FEATURE */
- HCI_INIT(hci_le_set_host_feature_sync),
+ HCI_INIT(hci_le_set_host_features_sync),
{}
};