Skip to contentSkip to conversation

fixup! Bluetooth: hci_sync: Add LE Channel Sounding HCI Command/event structures

PATCH In review Luiz Augusto von Dentz 3 participants 5 messages Dec 19, 2025 – Dec 22, 2025

Subsystems (2)
lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 fixup! Bluetooth: hci_sync: Add LE Channel Sounding HCI Command/event structures

From: Luiz Augusto von Dentz <[email protected]>

---
 net/bluetooth/hci_sync.c | 38 +++++++++++++++++++++++++++-----------
 1 file changed, 27 insertions(+), 11 deletions(-)
net/bluetooth/hci_sync.c +27 -11
index 5de98be752bc..ab0b68faa61c 100644
@@ -4570,27 +4570,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;
-
-	/* Channel Sounding (Host Support) */
-	cp.bit_number = 47;
-	cp.bit_value = le_cs_capable(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 */
@@ -4618,7 +4634,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),
 	{}
 };
 
Signature · 1 line
2.52.0
author maintainer
#1 lore raw

Hi Naga,

Quoted 66 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 net/bluetooth/hci_sync.c | 38 +++++++++++++++++++++++++++-----------
 1 file changed, 27 insertions(+), 11 deletions(-)
net/bluetooth/hci_sync.c +26 -10
index 5de98be752bc..ab0b68faa61c 100644
@@ -4570,27 +4570,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;
-
-       /* Channel Sounding (Host Support) */
-       cp.bit_number = 47;
-       cp.bit_value = le_cs_capable(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 */

net/bluetooth/hci_sync.c static const struct hci_init_stage le_init3[] = { · line 4637

Quoted 5 lines
net/bluetooth/hci_sync.c +1 -1
@@ -4618,7 +4634,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),

Let me know if you have any comments regarding this change, I'm planning to amend the original change since it hasn't been pushed to next-next yet, this has been found by:

https://netdev-ai.bots.linux.dev/ai-review.html?id=999e331e-1161-4eec-ad26-fafc3fea6cfd

Quoted 6 lines
net/bluetooth/hci_sync.c +0 -1
        {}
 };
 
--

2.52.0

Signature · 1 line
Luiz Augusto von Dentz
author maintainer
#2 lore raw

Hi Naga,

Quoted 81 lines · Luiz Augusto von Dentz

Hi Naga,

Quoted 66 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 net/bluetooth/hci_sync.c | 38 +++++++++++++++++++++++++++-----------
 1 file changed, 27 insertions(+), 11 deletions(-)
net/bluetooth/hci_sync.c +26 -10
index 5de98be752bc..ab0b68faa61c 100644
@@ -4570,27 +4570,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;
-
-       /* Channel Sounding (Host Support) */
-       cp.bit_number = 47;
-       cp.bit_value = le_cs_capable(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 */

net/bluetooth/hci_sync.c static const struct hci_init_stage le_init3[] = { · line 4637

Quoted 5 lines
net/bluetooth/hci_sync.c +1 -1
@@ -4618,7 +4634,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),

Let me know if you have any comments regarding this change, I'm planning to amend the original change since it hasn't been pushed to next-next yet, this has been found by:

Quoted 1 line

https://netdev-ai.bots.linux.dev/ai-review.html?id=999e331e-1161-4eec-ad26-fafc3fea6cfd

Any feedback?

Quoted 11 lines
Quoted 7 lines
net/bluetooth/hci_sync.c +0 -1
        {}
 };
 
--

2.52.0

--
Luiz Augusto von Dentz

Signature · 1 line
Luiz Augusto von Dentz
#3 lore raw

Hi Luiz,

The patch looks good, we have checked internally on the setup as well.

Thanks and Regards,
Bhavani

Quoted 103 lines · Luiz Augusto von Dentz

Hi Naga,

Quoted 81 lines · Luiz Augusto von Dentz

Hi Naga,

Quoted 66 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

---
 net/bluetooth/hci_sync.c | 38 +++++++++++++++++++++++++++-----------
 1 file changed, 27 insertions(+), 11 deletions(-)
net/bluetooth/hci_sync.c +26 -10
index 5de98be752bc..ab0b68faa61c 100644
@@ -4570,27 +4570,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;
-
-       /* Channel Sounding (Host Support) */
-       cp.bit_number = 47;
-       cp.bit_value = le_cs_capable(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 */

net/bluetooth/hci_sync.c static const struct hci_init_stage le_init3[] = { · line 4637

Quoted 5 lines
net/bluetooth/hci_sync.c +1 -1
@@ -4618,7 +4634,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),

Let me know if you have any comments regarding this change, I'm planning to amend the original change since it hasn't been pushed to next-next yet, this has been found by:

Quoted 1 line

https://netdev-ai.bots.linux.dev/ai-review.html?id=999e331e-1161-4eec-ad26-fafc3fea6cfd

Any feedback?

Quoted 11 lines
Quoted 7 lines
net/bluetooth/hci_sync.c +0 -1
        {}
 };
 
--

2.52.0

--
Luiz Augusto von Dentz

#4 lore raw
In reply to Luiz Augusto von Dentz

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1035126

---Test result---

Test Summary:

CheckPatch                    PENDING   0.56 seconds
GitLint                       PENDING   0.33 seconds
SubjectPrefix                 PASS      0.06 seconds
BuildKernel                   PASS      25.38 seconds
CheckAllWarning               PASS      28.06 seconds
CheckSparse                   PASS      31.86 seconds
BuildKernel32                 PASS      25.04 seconds
TestRunnerSetup               PASS      555.28 seconds
TestRunner_l2cap-tester       PASS      28.19 seconds
TestRunner_iso-tester         PASS      73.38 seconds
TestRunner_bnep-tester        PASS      6.35 seconds
TestRunner_mgmt-tester        FAIL      116.62 seconds
TestRunner_rfcomm-tester      PASS      9.54 seconds
TestRunner_sco-tester         FAIL      14.83 seconds
TestRunner_ioctl-tester       PASS      10.42 seconds
TestRunner_mesh-tester        FAIL      12.68 seconds
TestRunner_smp-tester         PASS      8.77 seconds
TestRunner_userchan-tester    PASS      6.79 seconds
IncrementalBuild              PENDING   0.92 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner Output:
Total: 494, Passed: 489 (99.0%), Failed: 1, Not Run: 4

Failed Test Cases
Read Exp Feature - Success Failed 0.105 seconds
##############################
Test: TestRunner_sco-tester - FAIL
Desc: Run sco-tester with test-runner
Output:
WARNING: possible circular locking dependency detected

BUG: sleeping function called from invalid context at net/core/sock.c:3782

Total: 30, Passed: 30 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner Output:
Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0

Failed Test Cases

Mesh - Send cancel - 1                               Timed out    2.764 seconds
Mesh - Send cancel - 2                               Timed out    1.998 seconds

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:

---
Regards,
Linux Bluetooth