Skip to contentSkip to conversation

Bluetooth: ISO: Match QoS adv handle with BIG handle

PATCH In review Iulia Tanasescu 2 participants 3 messages Sep 29, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Bluetooth: ISO: Match QoS adv handle with BIG handle

Currently, if the user wants to bind multiple broadcast sockets to the same BIG handle, the BIG and BIS fields of the QoS structs must be identical for all sockets.

It means that the user must remember both the desired BIG handle and the associated advertising handle that the BIG will be opened for. This information is redundant, since one BIG handle may only be associated with an unique adv handle.

This patch makes it possible for the user to only provide a desired BIG handle and leave the advertising handle as unset - in this case, the kernel should allocate an unused adv handle for the first opened socket and then be able to match it for all other sockets that will be later bound for the same BIG.

Iulia Tanasescu (1):
Bluetooth: ISO: Match QoS adv handle with BIG handle

 net/bluetooth/hci_conn.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

base-commit: 091e25d6b54992d1d702ae91cbac139d4c243251

Signature · 1 line
2.39.2
#1 lore raw

PATCH 1/1 Bluetooth: ISO: Match QoS adv handle with BIG handle

In case the user binds multiple sockets for the same BIG, the BIG handle should be matched with the associated adv handle, if it has already been allocated previously.

---
 net/bluetooth/hci_conn.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
net/bluetooth/hci_conn.c +12 -0
index e62a5f368a51..7890ec449a7b 100644
@@ -1494,6 +1494,18 @@ static int qos_set_bis(struct hci_dev *hdev, struct bt_iso_qos *qos)
 
 	/* Allocate BIS if not set */
 	if (qos->bcast.bis == BT_ISO_QOS_BIS_UNSET) {
+		if (qos->bcast.big != BT_ISO_QOS_BIG_UNSET) {
+			conn = hci_conn_hash_lookup_big(hdev, qos->bcast.big);
+
+			if (conn) {
+				/* If the BIG handle is already matched to an advertising
+				 * handle, do not allocate a new one.
+				 */
+				qos->bcast.bis = conn->iso_qos.bcast.bis;
+				return 0;
+			}
+		}
+
 		/* Find an unused adv set to advertise BIS, skip instance 0x00
 		 * since it is reserved as general purpose set.
 		 */
Signature · 1 line
2.39.2
#2 lore raw

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=788854

---Test result---

Test Summary:

CheckPatch                    PASS      0.58 seconds
GitLint                       PASS      0.26 seconds
SubjectPrefix                 PASS      0.08 seconds
BuildKernel                   PASS      33.90 seconds
CheckAllWarning               PASS      36.67 seconds
CheckSparse                   PASS      42.09 seconds
CheckSmatch                   PASS      117.46 seconds
BuildKernel32                 PASS      32.87 seconds
TestRunnerSetup               PASS      496.38 seconds
TestRunner_l2cap-tester       PASS      30.09 seconds
TestRunner_iso-tester         PASS      49.60 seconds
TestRunner_bnep-tester        PASS      10.53 seconds
TestRunner_mgmt-tester        PASS      218.45 seconds
TestRunner_rfcomm-tester      PASS      15.14 seconds
TestRunner_sco-tester         PASS      18.75 seconds
TestRunner_ioctl-tester       PASS      17.13 seconds
TestRunner_mesh-tester        PASS      12.56 seconds
TestRunner_smp-tester         PASS      13.61 seconds
TestRunner_userchan-tester    PASS      10.40 seconds
IncrementalBuild              PASS      30.93 seconds

---
Regards,
Linux Bluetooth