* [PATCH v5] Bluetooth: hci_event: Fix parsing of CIS Established Event
@ 2023-06-23 21:24 Luiz Augusto von Dentz
2023-06-26 20:42 ` patchwork-bot+bluetooth
0 siblings, 1 reply; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2023-06-23 21:24 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The ISO Interval on CIS Established Event uses 1.25 ms slots:
BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E
page 2304:
Time = N * 1.25 ms
In addition to that this always update the QoS settings based on CIS
Established Event.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
net/bluetooth/hci_event.c | 45 ++++++++++++++++++++++++++++-----------
1 file changed, 32 insertions(+), 13 deletions(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index b1aefe4bb751..77cbf13037b3 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -6822,6 +6822,7 @@ static void hci_le_cis_estabilished_evt(struct hci_dev *hdev, void *data,
{
struct hci_evt_le_cis_established *ev = data;
struct hci_conn *conn;
+ struct bt_iso_qos *qos;
bool pending = false;
u16 handle = __le16_to_cpu(ev->handle);
@@ -6846,21 +6847,39 @@ static void hci_le_cis_estabilished_evt(struct hci_dev *hdev, void *data,
pending = test_and_clear_bit(HCI_CONN_CREATE_CIS, &conn->flags);
- if (conn->role == HCI_ROLE_SLAVE) {
- __le32 interval;
+ qos = &conn->iso_qos;
- memset(&interval, 0, sizeof(interval));
+ /* Convert ISO Interval (1.25 ms slots) to SDU Interval (us) */
+ qos->ucast.in.interval = le16_to_cpu(ev->interval) * 1250;
+ qos->ucast.out.interval = qos->ucast.in.interval;
- memcpy(&interval, ev->c_latency, sizeof(ev->c_latency));
- conn->iso_qos.ucast.in.interval = le32_to_cpu(interval);
- memcpy(&interval, ev->p_latency, sizeof(ev->p_latency));
- conn->iso_qos.ucast.out.interval = le32_to_cpu(interval);
- conn->iso_qos.ucast.in.latency = le16_to_cpu(ev->interval);
- conn->iso_qos.ucast.out.latency = le16_to_cpu(ev->interval);
- conn->iso_qos.ucast.in.sdu = le16_to_cpu(ev->c_mtu);
- conn->iso_qos.ucast.out.sdu = le16_to_cpu(ev->p_mtu);
- conn->iso_qos.ucast.in.phy = ev->c_phy;
- conn->iso_qos.ucast.out.phy = ev->p_phy;
+ switch (conn->role) {
+ case HCI_ROLE_SLAVE:
+ /* Convert Transport Latency (us) to Latency (msec) */
+ qos->ucast.in.latency =
+ DIV_ROUND_CLOSEST(get_unaligned_le24(ev->c_latency),
+ 1000);
+ qos->ucast.out.latency =
+ DIV_ROUND_CLOSEST(get_unaligned_le24(ev->p_latency),
+ 1000);
+ qos->ucast.in.sdu = le16_to_cpu(ev->c_mtu);
+ qos->ucast.out.sdu = le16_to_cpu(ev->p_mtu);
+ qos->ucast.in.phy = ev->c_phy;
+ qos->ucast.out.phy = ev->p_phy;
+ break;
+ case HCI_ROLE_MASTER:
+ /* Convert Transport Latency (us) to Latency (msec) */
+ qos->ucast.out.latency =
+ DIV_ROUND_CLOSEST(get_unaligned_le24(ev->c_latency),
+ 1000);
+ qos->ucast.in.latency =
+ DIV_ROUND_CLOSEST(get_unaligned_le24(ev->p_latency),
+ 1000);
+ qos->ucast.out.sdu = le16_to_cpu(ev->c_mtu);
+ qos->ucast.in.sdu = le16_to_cpu(ev->p_mtu);
+ qos->ucast.out.phy = ev->c_phy;
+ qos->ucast.in.phy = ev->p_phy;
+ break;
}
if (!ev->status) {
--
2.40.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v5] Bluetooth: hci_event: Fix parsing of CIS Established Event
2023-06-23 21:24 Luiz Augusto von Dentz
@ 2023-06-26 20:42 ` patchwork-bot+bluetooth
0 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+bluetooth @ 2023-06-26 20:42 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Fri, 23 Jun 2023 14:24:39 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> The ISO Interval on CIS Established Event uses 1.25 ms slots:
>
> BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E
> page 2304:
>
> [...]
Here is the summary with links:
- [v5] Bluetooth: hci_event: Fix parsing of CIS Established Event
https://git.kernel.org/bluetooth/bluetooth-next/c/5f68122ac282
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v5] Bluetooth: hci_event: Fix parsing of CIS Established Event
@ 2023-06-27 0:31 Luiz Augusto von Dentz
2023-06-27 1:04 ` [v5] " bluez.test.bot
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2023-06-27 0:31 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The ISO Interval on CIS Established Event uses 1.25 ms slots:
BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E
page 2304:
Time = N * 1.25 ms
In addition to that this always update the QoS settings based on CIS
Established Event.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
net/bluetooth/hci_event.c | 45 ++++++++++++++++++++++++++++-----------
1 file changed, 32 insertions(+), 13 deletions(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index b1aefe4bb751..77cbf13037b3 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -6822,6 +6822,7 @@ static void hci_le_cis_estabilished_evt(struct hci_dev *hdev, void *data,
{
struct hci_evt_le_cis_established *ev = data;
struct hci_conn *conn;
+ struct bt_iso_qos *qos;
bool pending = false;
u16 handle = __le16_to_cpu(ev->handle);
@@ -6846,21 +6847,39 @@ static void hci_le_cis_estabilished_evt(struct hci_dev *hdev, void *data,
pending = test_and_clear_bit(HCI_CONN_CREATE_CIS, &conn->flags);
- if (conn->role == HCI_ROLE_SLAVE) {
- __le32 interval;
+ qos = &conn->iso_qos;
- memset(&interval, 0, sizeof(interval));
+ /* Convert ISO Interval (1.25 ms slots) to SDU Interval (us) */
+ qos->ucast.in.interval = le16_to_cpu(ev->interval) * 1250;
+ qos->ucast.out.interval = qos->ucast.in.interval;
- memcpy(&interval, ev->c_latency, sizeof(ev->c_latency));
- conn->iso_qos.ucast.in.interval = le32_to_cpu(interval);
- memcpy(&interval, ev->p_latency, sizeof(ev->p_latency));
- conn->iso_qos.ucast.out.interval = le32_to_cpu(interval);
- conn->iso_qos.ucast.in.latency = le16_to_cpu(ev->interval);
- conn->iso_qos.ucast.out.latency = le16_to_cpu(ev->interval);
- conn->iso_qos.ucast.in.sdu = le16_to_cpu(ev->c_mtu);
- conn->iso_qos.ucast.out.sdu = le16_to_cpu(ev->p_mtu);
- conn->iso_qos.ucast.in.phy = ev->c_phy;
- conn->iso_qos.ucast.out.phy = ev->p_phy;
+ switch (conn->role) {
+ case HCI_ROLE_SLAVE:
+ /* Convert Transport Latency (us) to Latency (msec) */
+ qos->ucast.in.latency =
+ DIV_ROUND_CLOSEST(get_unaligned_le24(ev->c_latency),
+ 1000);
+ qos->ucast.out.latency =
+ DIV_ROUND_CLOSEST(get_unaligned_le24(ev->p_latency),
+ 1000);
+ qos->ucast.in.sdu = le16_to_cpu(ev->c_mtu);
+ qos->ucast.out.sdu = le16_to_cpu(ev->p_mtu);
+ qos->ucast.in.phy = ev->c_phy;
+ qos->ucast.out.phy = ev->p_phy;
+ break;
+ case HCI_ROLE_MASTER:
+ /* Convert Transport Latency (us) to Latency (msec) */
+ qos->ucast.out.latency =
+ DIV_ROUND_CLOSEST(get_unaligned_le24(ev->c_latency),
+ 1000);
+ qos->ucast.in.latency =
+ DIV_ROUND_CLOSEST(get_unaligned_le24(ev->p_latency),
+ 1000);
+ qos->ucast.out.sdu = le16_to_cpu(ev->c_mtu);
+ qos->ucast.in.sdu = le16_to_cpu(ev->p_mtu);
+ qos->ucast.out.phy = ev->c_phy;
+ qos->ucast.in.phy = ev->p_phy;
+ break;
}
if (!ev->status) {
--
2.40.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [v5] Bluetooth: hci_event: Fix parsing of CIS Established Event
2023-06-27 0:31 [PATCH v5] Bluetooth: hci_event: Fix parsing of CIS Established Event Luiz Augusto von Dentz
@ 2023-06-27 1:04 ` bluez.test.bot
2023-06-27 3:47 ` [PATCH v5] " Paul Menzel
2023-06-27 19:01 ` patchwork-bot+bluetooth
2 siblings, 0 replies; 6+ messages in thread
From: bluez.test.bot @ 2023-06-27 1:04 UTC (permalink / raw)
To: linux-bluetooth, luiz.dentz
[-- Attachment #1: Type: text/plain, Size: 553 bytes --]
This is an automated email and please do not reply to this email.
Dear Submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.
----- Output -----
error: patch failed: net/bluetooth/hci_event.c:6822
error: net/bluetooth/hci_event.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch
Please resolve the issue and submit the patches again.
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v5] Bluetooth: hci_event: Fix parsing of CIS Established Event
2023-06-27 0:31 [PATCH v5] Bluetooth: hci_event: Fix parsing of CIS Established Event Luiz Augusto von Dentz
2023-06-27 1:04 ` [v5] " bluez.test.bot
@ 2023-06-27 3:47 ` Paul Menzel
2023-06-27 19:01 ` patchwork-bot+bluetooth
2 siblings, 0 replies; 6+ messages in thread
From: Paul Menzel @ 2023-06-27 3:47 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Dear Luiz,
Thank you for your patch.
Am 27.06.23 um 02:31 schrieb Luiz Augusto von Dentz:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> The ISO Interval on CIS Established Event uses 1.25 ms slots:
>
> BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E
> page 2304:
>
> Time = N * 1.25 ms
>
> In addition to that this always update the QoS settings based on CIS
> Established Event.
update*s*
Does “always” mean, it wasn’t set for the master role before, and that
is done now?
Kind regards,
Paul
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
> net/bluetooth/hci_event.c | 45 ++++++++++++++++++++++++++++-----------
> 1 file changed, 32 insertions(+), 13 deletions(-)
>
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index b1aefe4bb751..77cbf13037b3 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -6822,6 +6822,7 @@ static void hci_le_cis_estabilished_evt(struct hci_dev *hdev, void *data,
> {
> struct hci_evt_le_cis_established *ev = data;
> struct hci_conn *conn;
> + struct bt_iso_qos *qos;
> bool pending = false;
> u16 handle = __le16_to_cpu(ev->handle);
>
> @@ -6846,21 +6847,39 @@ static void hci_le_cis_estabilished_evt(struct hci_dev *hdev, void *data,
>
> pending = test_and_clear_bit(HCI_CONN_CREATE_CIS, &conn->flags);
>
> - if (conn->role == HCI_ROLE_SLAVE) {
> - __le32 interval;
> + qos = &conn->iso_qos;
>
> - memset(&interval, 0, sizeof(interval));
> + /* Convert ISO Interval (1.25 ms slots) to SDU Interval (us) */
> + qos->ucast.in.interval = le16_to_cpu(ev->interval) * 1250;
> + qos->ucast.out.interval = qos->ucast.in.interval;
>
> - memcpy(&interval, ev->c_latency, sizeof(ev->c_latency));
> - conn->iso_qos.ucast.in.interval = le32_to_cpu(interval);
> - memcpy(&interval, ev->p_latency, sizeof(ev->p_latency));
> - conn->iso_qos.ucast.out.interval = le32_to_cpu(interval);
> - conn->iso_qos.ucast.in.latency = le16_to_cpu(ev->interval);
> - conn->iso_qos.ucast.out.latency = le16_to_cpu(ev->interval);
> - conn->iso_qos.ucast.in.sdu = le16_to_cpu(ev->c_mtu);
> - conn->iso_qos.ucast.out.sdu = le16_to_cpu(ev->p_mtu);
> - conn->iso_qos.ucast.in.phy = ev->c_phy;
> - conn->iso_qos.ucast.out.phy = ev->p_phy;
> + switch (conn->role) {
> + case HCI_ROLE_SLAVE:
> + /* Convert Transport Latency (us) to Latency (msec) */
> + qos->ucast.in.latency =
> + DIV_ROUND_CLOSEST(get_unaligned_le24(ev->c_latency),
> + 1000);
> + qos->ucast.out.latency =
> + DIV_ROUND_CLOSEST(get_unaligned_le24(ev->p_latency),
> + 1000);
> + qos->ucast.in.sdu = le16_to_cpu(ev->c_mtu);
> + qos->ucast.out.sdu = le16_to_cpu(ev->p_mtu);
> + qos->ucast.in.phy = ev->c_phy;
> + qos->ucast.out.phy = ev->p_phy;
> + break;
> + case HCI_ROLE_MASTER:
> + /* Convert Transport Latency (us) to Latency (msec) */
> + qos->ucast.out.latency =
> + DIV_ROUND_CLOSEST(get_unaligned_le24(ev->c_latency),
> + 1000);
> + qos->ucast.in.latency =
> + DIV_ROUND_CLOSEST(get_unaligned_le24(ev->p_latency),
> + 1000);
> + qos->ucast.out.sdu = le16_to_cpu(ev->c_mtu);
> + qos->ucast.in.sdu = le16_to_cpu(ev->p_mtu);
> + qos->ucast.out.phy = ev->c_phy;
> + qos->ucast.in.phy = ev->p_phy;
> + break;
> }
>
> if (!ev->status) {
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v5] Bluetooth: hci_event: Fix parsing of CIS Established Event
2023-06-27 0:31 [PATCH v5] Bluetooth: hci_event: Fix parsing of CIS Established Event Luiz Augusto von Dentz
2023-06-27 1:04 ` [v5] " bluez.test.bot
2023-06-27 3:47 ` [PATCH v5] " Paul Menzel
@ 2023-06-27 19:01 ` patchwork-bot+bluetooth
2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+bluetooth @ 2023-06-27 19:01 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: linux-bluetooth
Hello:
This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Mon, 26 Jun 2023 17:31:42 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> The ISO Interval on CIS Established Event uses 1.25 ms slots:
>
> BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E
> page 2304:
>
> [...]
Here is the summary with links:
- [v5] Bluetooth: hci_event: Fix parsing of CIS Established Event
https://git.kernel.org/bluetooth/bluetooth-next/c/8649851b1945
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-06-27 19:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-27 0:31 [PATCH v5] Bluetooth: hci_event: Fix parsing of CIS Established Event Luiz Augusto von Dentz
2023-06-27 1:04 ` [v5] " bluez.test.bot
2023-06-27 3:47 ` [PATCH v5] " Paul Menzel
2023-06-27 19:01 ` patchwork-bot+bluetooth
-- strict thread matches above, loose matches on Subject: below --
2023-06-23 21:24 Luiz Augusto von Dentz
2023-06-26 20:42 ` patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).