Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: hci_sync: Don't make a periodic advertising set connectable
@ 2026-11-22 20:14 Simon Mikuda
  2026-11-22 22:56 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Mikuda @ 2026-11-22 20:14 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: Michal Dzik, Marcel Holtmann, Luiz Augusto von Dentz,
	Simon Mikuda

From: Michal Dzik <michal.dzik@streamunlimited.com>

An advertising instance without MGMT_ADV_FLAG_CONNECTABLE follows the
global connectable setting, and so does the instance of a broadcast
source, which create_big_sync() starts with no flag but
MGMT_ADV_FLAG_SEC_2M. Whenever the adapter is connectable, e.g. while it
is discoverable, the set is configured as connectable extended
advertising, and the controller rejects enabling periodic advertising on
it with Command Disallowed ([Vol 4] Part E, Section 7.8.63), so the
broadcast source fails to start:

  Bluetooth: hci0: Opcode 0x2040 failed: -16
  Bluetooth: hci0: Unable to create BIG: -16

Don't let the global connectable setting make an instance with periodic
advertising connectable.

Fixes: eca0ae4aea66 ("Bluetooth: Add initial implementation of BIS connections")
Signed-off-by: Michal Dzik <michal.dzik@streamunlimited.com>
Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
---
 net/bluetooth/hci_sync.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 638589f77081..11aeaa9feef5 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -1519,10 +1519,12 @@ int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance)
 	flags = hci_adv_instance_flags(hdev, instance);
 
 	/* If the "connectable" instance flag was not set, then choose between
-	 * ADV_IND and ADV_NONCONN_IND based on the global connectable setting.
+	 * ADV_IND and ADV_NONCONN_IND based on the global connectable setting,
+	 * unless the instance carries periodic advertising, which can only be
+	 * enabled on a non-connectable advertising set.
 	 */
 	connectable = (flags & MGMT_ADV_FLAG_CONNECTABLE) ||
-		      mgmt_get_connectable(hdev);
+		      (mgmt_get_connectable(hdev) && !(adv && adv->periodic));
 
 	if (!is_advertising_allowed(hdev, connectable)) {
 		if (instance)

base-commit: 4fe38719e6738feaa90486e36b0790dd5d960a96
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-22 22:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 20:14 [PATCH] Bluetooth: hci_sync: Don't make a periodic advertising set connectable Simon Mikuda
2026-11-22 22:56 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox