2023-04-13 21:13:39

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [BlueZ PATCH v2 1/2] btdev: Fix not setting CIS parameters properly

From: Luiz Augusto von Dentz <[email protected]>

The code was assuming only index 0 was to be used which doesn't work
when there are multiple CIS being programmed with different parameters.
---
emulator/btdev.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/emulator/btdev.c b/emulator/btdev.c
index 549f93645684..a04f34d4bdb3 100644
--- a/emulator/btdev.c
+++ b/emulator/btdev.c
@@ -5885,6 +5885,7 @@ static void le_cis_estabilished(struct btdev *dev, struct btdev_conn *conn,

if (!evt.status) {
struct btdev *remote = conn->link->dev;
+ int i = conn->handle - ISO_HANDLE;

/* TODO: Figure out if these values makes sense */
memcpy(evt.cig_sync_delay, remote->le_cig.params.c_interval,
@@ -5895,15 +5896,15 @@ static void le_cis_estabilished(struct btdev *dev, struct btdev_conn *conn,
sizeof(remote->le_cig.params.c_interval));
memcpy(evt.p_latency, &remote->le_cig.params.p_interval,
sizeof(remote->le_cig.params.p_interval));
- evt.c_phy = remote->le_cig.cis[0].c_phy;
- evt.p_phy = remote->le_cig.cis[0].p_phy;
+ evt.c_phy = remote->le_cig.cis[i].c_phy;
+ evt.p_phy = remote->le_cig.cis[i].p_phy;
evt.nse = 0x01;
evt.c_bn = 0x01;
evt.p_bn = 0x01;
evt.c_ft = 0x01;
evt.p_ft = 0x01;
- evt.c_mtu = remote->le_cig.cis[0].c_sdu;
- evt.p_mtu = remote->le_cig.cis[0].p_sdu;
+ evt.c_mtu = remote->le_cig.cis[i].c_sdu;
+ evt.p_mtu = remote->le_cig.cis[i].p_sdu;
evt.interval = remote->le_cig.params.c_latency;
}

@@ -5948,7 +5949,7 @@ static int cmd_create_cis_complete(struct btdev *dev, const void *data,
evt.acl_handle = cpu_to_le16(acl->handle);
evt.cis_handle = cpu_to_le16(iso->handle);
evt.cig_id = iso->dev->le_cig.params.cig_id;
- evt.cis_id = iso->dev->le_cig.cis[0].cis_id;
+ evt.cis_id = iso->dev->le_cig.cis[i].cis_id;

le_meta_event(iso->link->dev, BT_HCI_EVT_LE_CIS_REQ, &evt,
sizeof(evt));
--
2.39.2


2023-04-13 22:23:24

by bluez.test.bot

[permalink] [raw]
Subject: RE: [BlueZ,v2,1/2] btdev: Fix not setting CIS parameters properly

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

---Test result---

Test Summary:
CheckPatch PASS 1.02 seconds
GitLint PASS 0.56 seconds
BuildEll PASS 26.49 seconds
BluezMake PASS 780.21 seconds
MakeCheck PASS 10.85 seconds
MakeDistcheck PASS 152.34 seconds
CheckValgrind PASS 243.86 seconds
CheckSmatch WARNING 328.29 seconds
bluezmakeextell PASS 98.58 seconds
IncrementalBuild PASS 1256.93 seconds
ScanBuild PASS 1005.44 seconds

Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
emulator/btdev.c:412:29: warning: Variable length array is used.


---
Regards,
Linux Bluetooth

2023-04-14 23:14:40

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [BlueZ PATCH v2 1/2] btdev: Fix not setting CIS parameters properly

Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <[email protected]>:

On Thu, 13 Apr 2023 14:04:49 -0700 you wrote:
> From: Luiz Augusto von Dentz <[email protected]>
>
> The code was assuming only index 0 was to be used which doesn't work
> when there are multiple CIS being programmed with different parameters.
> ---
> emulator/btdev.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)

Here is the summary with links:
- [BlueZ,v2,1/2] btdev: Fix not setting CIS parameters properly
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=57b67987d4d8
- [BlueZ,v2,2/2] iso-tester: Add BAP Audio Configuration tests
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=4d197b859e57

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html