]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: ISO: Update hci_conn_hash_lookup_big for Broadcast slave
authorIulia Tanasescu <iulia.tanasescu@nxp.com>
Fri, 1 Nov 2024 08:23:39 +0000 (10:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:33:58 +0000 (15:33 -0500)
[ Upstream commit 83d328a72eff3268ea4c19deb0a6cf4c7da15746 ]

Currently, hci_conn_hash_lookup_big only checks for BIS master connections,
by filtering out connections with the destination address set. This commit
updates this function to also consider BIS slave connections, since it is
also used for a Broadcast Receiver to set an available BIG handle before
issuing the LE BIG Create Sync command.

Signed-off-by: Iulia Tanasescu <iulia.tanasescu@nxp.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Stable-dep-of: f0c200a4a537 ("Bluetooth: ISO: Fix BIS connection dst_type handling")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/bluetooth/hci_core.h
net/bluetooth/hci_event.c
net/bluetooth/iso.c

index 69a1d8b12beff3d654440bb24e0f67c59ed1599e..ca75c71b58588f7f0c3e1d89164cd83a99269e5d 100644 (file)
@@ -1315,7 +1315,17 @@ static inline struct hci_conn *hci_conn_hash_lookup_big(struct hci_dev *hdev,
        rcu_read_lock();
 
        list_for_each_entry_rcu(c, &h->list, list) {
-               if (bacmp(&c->dst, BDADDR_ANY) || c->type != ISO_LINK)
+               if (c->type != ISO_LINK)
+                       continue;
+
+               /* An ISO_LINK hcon with BDADDR_ANY as destination
+                * address is a Broadcast connection. A Broadcast
+                * slave connection is associated with a PA train,
+                * so the sync_handle can be used to differentiate
+                * from unicast.
+                */
+               if (bacmp(&c->dst, BDADDR_ANY) &&
+                   c->sync_handle == HCI_SYNC_HANDLE_INVALID)
                        continue;
 
                if (handle == c->iso_qos.bcast.big) {
index 1e537ed83ba4b27cc9c0074a0a98cbb2dbcad128..debe9cc2f72d9f6c60d070f8f5094d292a24a43c 100644 (file)
@@ -6976,6 +6976,7 @@ static void hci_le_big_sync_established_evt(struct hci_dev *hdev, void *data,
                        /* Mark PA sync as established */
                        set_bit(HCI_CONN_PA_SYNC, &bis->flags);
 
+               bis->sync_handle = conn->sync_handle;
                bis->iso_qos.bcast.big = ev->handle;
                memset(&interval, 0, sizeof(interval));
                memcpy(&interval, ev->latency, sizeof(ev->latency));
index 2cd0b963c96bd0b05dd0ac2e4d9f13ee7416628f..f48a694b004abea8d979aad0043a4f3694b7373d 100644 (file)
@@ -1928,7 +1928,6 @@ static void iso_conn_ready(struct iso_conn *conn)
                if (!bacmp(&hcon->dst, BDADDR_ANY)) {
                        bacpy(&hcon->dst, &iso_pi(parent)->dst);
                        hcon->dst_type = iso_pi(parent)->dst_type;
-                       hcon->sync_handle = iso_pi(parent)->sync_handle;
                }
 
                if (ev3) {