diff mbox series

[1/1] Bluetooth: ISO: Match QoS adv handle with BIG handle

Message ID 20230929153727.3728-2-iulia.tanasescu@nxp.com
State Accepted
Commit cffdc28aa2e2b0071bb614a982b0bddc7a0eeb59
Headers show
Series Bluetooth: ISO: Match QoS adv handle with BIG handle | expand

Commit Message

Iulia Tanasescu Sept. 29, 2023, 3:37 p.m. UTC
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.

Signed-off-by: Iulia Tanasescu <iulia.tanasescu@nxp.com>
---
 net/bluetooth/hci_conn.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

bluez.test.bot@gmail.com Sept. 29, 2023, 4:39 p.m. UTC | #1
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
diff mbox series

Patch

diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index e62a5f368a51..7890ec449a7b 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -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.
 		 */