All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1 1/2] btdev: Fix not setting sid on BT_HCI_EVT_LE_PA_SYNC_ESTABLISHED
@ 2025-06-10 15:11 Luiz Augusto von Dentz
  2025-06-10 15:11 ` [PATCH BlueZ v1 2/2] iso-tester: Add more tests for getpeername Luiz Augusto von Dentz
  2025-06-10 16:38 ` [BlueZ,v1,1/2] btdev: Fix not setting sid on BT_HCI_EVT_LE_PA_SYNC_ESTABLISHED bluez.test.bot
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2025-06-10 15:11 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

The event BT_HCI_EVT_LE_PA_SYNC_ESTABLISHED shall set the SID accourding
to the value set in the periodic advertisement it is synchronized since
the kernel will use that to complete the connection and notify the
socket.
---
 emulator/btdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 2c62dc711d98..555f55e52772 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -5479,6 +5479,7 @@ static void le_pa_sync_estabilished(struct btdev *dev, struct btdev *remote,
 	per_adv->sync_handle = sync_handle;
 
 	ev.handle = cpu_to_le16(per_adv->sync_handle);
+	ev.sid = per_adv->sid;
 	ev.addr_type = per_adv->addr_type;
 	memcpy(ev.addr, per_adv->addr, sizeof(ev.addr));
 	ev.phy = 0x01;
-- 
2.49.0


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

* [PATCH BlueZ v1 2/2] iso-tester: Add more tests for getpeername
  2025-06-10 15:11 [PATCH BlueZ v1 1/2] btdev: Fix not setting sid on BT_HCI_EVT_LE_PA_SYNC_ESTABLISHED Luiz Augusto von Dentz
@ 2025-06-10 15:11 ` Luiz Augusto von Dentz
  2025-06-10 16:38 ` [BlueZ,v1,1/2] btdev: Fix not setting sid on BT_HCI_EVT_LE_PA_SYNC_ESTABLISHED bluez.test.bot
  1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2025-06-10 15:11 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This tests setting SID for broadcast source in adition to existing test
that was testing broadcast sink only, so this adds/updates the following
test:

ISO Broadcaster SID auto - Success
ISO Broadcaster SID 0x01 - Success
ISO Broadcaster Receiver SID auto - Success
ISO Broadcaster Receiver SID 0x01 - Success
---
 emulator/bthost.c   |  3 ++-
 emulator/bthost.h   |  2 +-
 tools/iso-tester.c  | 47 +++++++++++++++++++++++++++++++++++++++++++--
 tools/mesh-tester.c |  2 +-
 tools/mgmt-tester.c |  4 ++--
 5 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/emulator/bthost.c b/emulator/bthost.c
index f53b4382d6f9..7ab4533d12b4 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -3467,7 +3467,7 @@ void bthost_set_scan_enable(struct bthost *bthost, uint8_t enable)
 							&cp, sizeof(cp));
 }
 
-void bthost_set_ext_adv_params(struct bthost *bthost)
+void bthost_set_ext_adv_params(struct bthost *bthost, uint8_t sid)
 {
 	const uint8_t interval_20ms[] = { 0x20, 0x00, 0x00 };
 	struct bt_hci_cmd_le_set_ext_adv_params cp;
@@ -3477,6 +3477,7 @@ void bthost_set_ext_adv_params(struct bthost *bthost)
 	cp.evt_properties = cpu_to_le16(0x0013);
 	memcpy(cp.min_interval, interval_20ms, sizeof(cp.min_interval));
 	memcpy(cp.max_interval, interval_20ms, sizeof(cp.max_interval));
+	cp.sid = sid;
 	send_command(bthost, BT_HCI_CMD_LE_SET_EXT_ADV_PARAMS,
 							&cp, sizeof(cp));
 }
diff --git a/emulator/bthost.h b/emulator/bthost.h
index db640daff38a..456f631d51a0 100644
--- a/emulator/bthost.h
+++ b/emulator/bthost.h
@@ -113,7 +113,7 @@ void bthost_set_adv_enable(struct bthost *bthost, uint8_t enable);
 
 void bthost_set_ext_adv_data(struct bthost *bthost, const uint8_t *data,
 								uint8_t len);
-void bthost_set_ext_adv_params(struct bthost *bthost);
+void bthost_set_ext_adv_params(struct bthost *bthost, uint8_t sid);
 void bthost_set_ext_adv_enable(struct bthost *bthost, uint8_t enable);
 void bthost_set_pa_params(struct bthost *bthost);
 void bthost_set_pa_data(struct bthost *bthost, const uint8_t *data,
diff --git a/tools/iso-tester.c b/tools/iso-tester.c
index 7bc0eb12c1c5..323ba6920ba3 100644
--- a/tools/iso-tester.c
+++ b/tools/iso-tester.c
@@ -1412,6 +1412,26 @@ static const struct iso_client_data bcast_1_1_16_2_1_send = {
 	.base_len = sizeof(base_lc3_16_2_1),
 };
 
+static const struct iso_client_data bcast_16_2_1_send_sid = {
+	.qos = QOS_OUT_16_2_1,
+	.expect_err = 0,
+	.send = &send_16_2_1,
+	.bcast = true,
+	.base = base_lc3_16_2_1,
+	.base_len = sizeof(base_lc3_16_2_1),
+	.sid = 0xff,
+};
+
+static const struct iso_client_data bcast_16_2_1_send_sid1 = {
+	.qos = QOS_OUT_16_2_1,
+	.expect_err = 0,
+	.send = &send_16_2_1,
+	.bcast = true,
+	.base = base_lc3_16_2_1,
+	.base_len = sizeof(base_lc3_16_2_1),
+	.sid = 0x01,
+};
+
 static const struct iso_client_data bcast_16_2_1_recv = {
 	.qos = QOS_IN_16_2_1,
 	.expect_err = 0,
@@ -1439,6 +1459,16 @@ static const struct iso_client_data bcast_16_2_1_recv_sid = {
 	.sid = 0xff,
 };
 
+static const struct iso_client_data bcast_16_2_1_recv_sid1 = {
+	.qos = QOS_IN_16_2_1,
+	.expect_err = 0,
+	.recv = &send_16_2_1,
+	.bcast = true,
+	.server = true,
+	.big = true,
+	.sid = 0x01,
+};
+
 static const struct iso_client_data bcast_enc_16_2_1_recv = {
 	.qos = QOS_IN_ENC_16_2_1,
 	.expect_err = 0,
@@ -1658,7 +1688,8 @@ static void setup_powered_callback(uint8_t status, uint16_t length,
 		host = hciemu_client_host(client);
 		bthost_set_cmd_complete_cb(host, client_connectable_complete,
 									data);
-		bthost_set_ext_adv_params(host);
+		bthost_set_ext_adv_params(host, isodata->sid != 0xff ?
+						isodata->sid : 0x00);
 		bthost_set_ext_adv_enable(host, 0x01);
 
 		if (!isodata)
@@ -2623,6 +2654,8 @@ static gboolean iso_connect(GIOChannel *io, GIOCondition cond,
 			tester_test_failed();
 			return FALSE;
 		}
+
+		tester_print("SID: 0x%02x", addr.bc.bc_sid);
 	}
 
 	len = sizeof(sk_err);
@@ -3886,14 +3919,24 @@ int main(int argc, char *argv[])
 							&bcast_1_1_16_2_1_send,
 							setup_powered,
 							test_bcast);
+	test_iso("ISO Broadcaster SID auto - Success", &bcast_16_2_1_send_sid,
+							setup_powered,
+							test_bcast);
+	test_iso("ISO Broadcaster SID 0x01 - Success", &bcast_16_2_1_send_sid1,
+							setup_powered,
+							test_bcast);
 
 	test_iso("ISO Broadcaster Receiver - Success", &bcast_16_2_1_recv,
 							setup_powered,
 							test_bcast_recv);
-	test_iso("ISO Broadcaster Receiver SID 0xff - Success",
+	test_iso("ISO Broadcaster Receiver SID auto - Success",
 							&bcast_16_2_1_recv_sid,
 							setup_powered,
 							test_bcast_recv);
+	test_iso("ISO Broadcaster Receiver SID 0x01 - Success",
+							&bcast_16_2_1_recv_sid1,
+							setup_powered,
+							test_bcast_recv);
 	test_iso2("ISO Broadcaster Receiver2 - Success", &bcast_16_2_1_recv2,
 							setup_powered,
 							test_bcast_recv2);
diff --git a/tools/mesh-tester.c b/tools/mesh-tester.c
index d7b3b6f9b1db..848ccbe51a87 100644
--- a/tools/mesh-tester.c
+++ b/tools/mesh-tester.c
@@ -968,7 +968,7 @@ static void setup_bthost(void)
 	if (data->hciemu_type == HCIEMU_TYPE_LE ||
 			test->client_enable_adv) {
 		if (data->hciemu_type >= HCIEMU_TYPE_BREDRLE50) {
-			bthost_set_ext_adv_params(bthost);
+			bthost_set_ext_adv_params(bthost, 0x00);
 			bthost_set_ext_adv_enable(bthost, 0x01);
 		} else
 			bthost_set_adv_enable(bthost, 0x01);
diff --git a/tools/mgmt-tester.c b/tools/mgmt-tester.c
index 030827cd51d1..a1d48152f23b 100644
--- a/tools/mgmt-tester.c
+++ b/tools/mgmt-tester.c
@@ -6169,7 +6169,7 @@ static void setup_bthost(void)
 	if (data->hciemu_type == HCIEMU_TYPE_LE ||
 		test->client_enable_adv) {
 		if (data->hciemu_type >= HCIEMU_TYPE_BREDRLE50) {
-			bthost_set_ext_adv_params(bthost);
+			bthost_set_ext_adv_params(bthost, 0x00);
 			bthost_set_ext_adv_enable(bthost, 0x01);
 		} else
 			bthost_set_adv_enable(bthost, 0x01);
@@ -11724,7 +11724,7 @@ static void trigger_device_found(void *user_data)
 
 		bthost_set_adv_enable(bthost, 0x01);
 	} else if (data->hciemu_type >= HCIEMU_TYPE_BREDRLE50) {
-		bthost_set_ext_adv_params(bthost);
+		bthost_set_ext_adv_params(bthost, 0x00);
 		if (test->set_adv)
 			bthost_set_ext_adv_data(bthost, test->adv_data,
 							test->adv_data_len);
-- 
2.49.0


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

* RE: [BlueZ,v1,1/2] btdev: Fix not setting sid on BT_HCI_EVT_LE_PA_SYNC_ESTABLISHED
  2025-06-10 15:11 [PATCH BlueZ v1 1/2] btdev: Fix not setting sid on BT_HCI_EVT_LE_PA_SYNC_ESTABLISHED Luiz Augusto von Dentz
  2025-06-10 15:11 ` [PATCH BlueZ v1 2/2] iso-tester: Add more tests for getpeername Luiz Augusto von Dentz
@ 2025-06-10 16:38 ` bluez.test.bot
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2025-06-10 16:38 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 1687 bytes --]

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

---Test result---

Test Summary:
CheckPatch                    PENDING   0.35 seconds
GitLint                       PENDING   0.39 seconds
BuildEll                      PASS      20.37 seconds
BluezMake                     PASS      2803.72 seconds
MakeCheck                     PASS      19.86 seconds
MakeDistcheck                 PASS      201.50 seconds
CheckValgrind                 PASS      278.59 seconds
CheckSmatch                   WARNING   307.31 seconds
bluezmakeextell               PASS      129.15 seconds
IncrementalBuild              PENDING   0.23 seconds
ScanBuild                     PASS      922.86 seconds

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

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

##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
emulator/btdev.c:456:29: warning: Variable length array is used.emulator/bthost.c:668:28: warning: Variable length array is used.emulator/bthost.c:669:32: warning: Variable length array is used.emulator/bthost.c:886:28: warning: Variable length array is used.emulator/bthost.c:920:28: warning: Variable length array is used.
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


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

end of thread, other threads:[~2025-06-10 16:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10 15:11 [PATCH BlueZ v1 1/2] btdev: Fix not setting sid on BT_HCI_EVT_LE_PA_SYNC_ESTABLISHED Luiz Augusto von Dentz
2025-06-10 15:11 ` [PATCH BlueZ v1 2/2] iso-tester: Add more tests for getpeername Luiz Augusto von Dentz
2025-06-10 16:38 ` [BlueZ,v1,1/2] btdev: Fix not setting sid on BT_HCI_EVT_LE_PA_SYNC_ESTABLISHED bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.