diff mbox series

hci_event: handling CIS QoS

Message ID 20221116143334.4990-1-abhay.maheshbhai.maheta@intel.com
State New
Headers show
Series hci_event: handling CIS QoS | expand

Commit Message

Abhay Maheta Nov. 16, 2022, 2:33 p.m. UTC
This sets QoS on CIS connction establishement.

Signed-off-by: Abhay Maheta <abhay.maheshbhai.maheta@intel.com>
---
 net/bluetooth/hci_event.c | 32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

Comments

bluez.test.bot@gmail.com Nov. 18, 2022, 4:15 a.m. UTC | #1
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=696036

---Test result---

Test Summary:
CheckPatch                    PASS      0.59 seconds
GitLint                       PASS      0.28 seconds
SubjectPrefix                 FAIL      0.35 seconds
BuildKernel                   PASS      33.62 seconds
BuildKernel32                 PASS      29.94 seconds
TestRunnerSetup               PASS      418.08 seconds
TestRunner_l2cap-tester       PASS      15.64 seconds
TestRunner_iso-tester         FAIL      14.97 seconds
TestRunner_bnep-tester        PASS      5.41 seconds
TestRunner_mgmt-tester        PASS      103.52 seconds
TestRunner_rfcomm-tester      PASS      9.04 seconds
TestRunner_sco-tester         PASS      8.46 seconds
TestRunner_ioctl-tester       PASS      9.68 seconds
TestRunner_mesh-tester        PASS      6.62 seconds
TestRunner_smp-tester         PASS      8.39 seconds
TestRunner_userchan-tester    PASS      5.51 seconds
IncrementalBuild              PASS      30.91 seconds

Details
##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix
Output:
"Bluetooth: " prefix is not specified in the subject
##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:
Total: 55, Passed: 11 (20.0%), Failed: 44, Not Run: 0

Failed Test Cases
ISO QoS 8_1_1 - Success                              Failed       2.009 seconds
ISO QoS 8_2_1 - Success                              Failed       0.142 seconds
ISO QoS 16_1_1 - Success                             Failed       0.143 seconds
ISO QoS 16_2_1 - Success                             Failed       0.142 seconds
ISO QoS 16_2_1 CIG 0x01 - Success                    Failed       0.141 seconds
ISO QoS 16_2_1 CIG 0x01 CIS 0x01 - Success           Failed       0.140 seconds
ISO QoS 24_1_1 - Success                             Failed       0.139 seconds
ISO QoS 24_2_1 - Success                             Failed       0.141 seconds
ISO QoS 32_1_1 - Success                             Failed       0.139 seconds
ISO QoS 32_2_1 - Success                             Failed       0.139 seconds
ISO QoS 44_1_1 - Success                             Failed       0.142 seconds
ISO QoS 44_2_1 - Success                             Failed       0.141 seconds
ISO QoS 48_1_1 - Success                             Failed       0.140 seconds
ISO QoS 48_2_1 - Success                             Failed       0.140 seconds
ISO QoS 48_3_1 - Success                             Failed       0.142 seconds
ISO QoS 48_4_1 - Success                             Failed       0.141 seconds
ISO QoS 48_5_1 - Success                             Failed       0.139 seconds
ISO QoS 48_6_1 - Success                             Failed       0.139 seconds
ISO QoS 8_1_2 - Success                              Failed       0.143 seconds
ISO QoS 8_2_2 - Success                              Failed       0.143 seconds
ISO QoS 16_1_2 - Success                             Failed       0.141 seconds
ISO QoS 16_2_2 - Success                             Failed       0.145 seconds
ISO QoS 24_1_2 - Success                             Failed       0.142 seconds
ISO QoS 24_2_2 - Success                             Failed       0.143 seconds
ISO QoS 32_1_2 - Success                             Failed       0.141 seconds
ISO QoS 32_2_2 - Success                             Failed       0.141 seconds
ISO QoS 44_1_2 - Success                             Failed       0.140 seconds
ISO QoS 44_2_2 - Success                             Failed       0.137 seconds
ISO QoS 48_1_2 - Success                             Failed       0.140 seconds
ISO QoS 48_2_2 - Success                             Failed       0.137 seconds
ISO QoS 48_3_2 - Success                             Failed       0.141 seconds
ISO QoS 48_4_2 - Success                             Failed       0.139 seconds
ISO QoS 48_5_2 - Success                             Failed       0.137 seconds
ISO QoS 48_6_2 - Success                             Failed       0.139 seconds
ISO Connect2 CIG 0x01 - Success                      Failed       0.176 seconds
ISO Send - Success                                   Failed       0.140 seconds
ISO Receive - Success                                Failed       0.145 seconds
ISO Defer Send - Success                             Failed       0.141 seconds
ISO 48_2_1 Defer Send - Success                      Failed       0.139 seconds
ISO Defer Receive - Success                          Failed       0.139 seconds
ISO 48_2_1 Defer Receive - Success                   Failed       0.135 seconds
ISO Send and Receive - Success                       Failed       0.141 seconds
ISO Disconnect - Success                             Failed       0.140 seconds
ISO Reconnect - Success                              Failed       0.141 seconds


---
Regards,
Linux Bluetooth
bluez.test.bot@gmail.com Nov. 18, 2022, 5:56 a.m. UTC | #2
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=696036

---Test result---

Test Summary:
CheckPatch                    PASS      0.70 seconds
GitLint                       PASS      0.35 seconds
SubjectPrefix                 FAIL      0.36 seconds
BuildKernel                   PASS      34.87 seconds
BuildKernel32                 PASS      31.40 seconds
TestRunnerSetup               PASS      433.85 seconds
TestRunner_l2cap-tester       PASS      16.40 seconds
TestRunner_iso-tester         FAIL      16.15 seconds
TestRunner_bnep-tester        PASS      5.61 seconds
TestRunner_mgmt-tester        PASS      108.01 seconds
TestRunner_rfcomm-tester      PASS      9.55 seconds
TestRunner_sco-tester         PASS      8.99 seconds
TestRunner_ioctl-tester       PASS      10.26 seconds
TestRunner_mesh-tester        PASS      7.12 seconds
TestRunner_smp-tester         PASS      8.77 seconds
TestRunner_userchan-tester    PASS      5.89 seconds
IncrementalBuild              PASS      32.55 seconds

Details
##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix
Output:
"Bluetooth: " prefix is not specified in the subject
##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:
Total: 55, Passed: 11 (20.0%), Failed: 44, Not Run: 0

Failed Test Cases
ISO QoS 8_1_1 - Success                              Failed       2.029 seconds
ISO QoS 8_2_1 - Success                              Failed       0.153 seconds
ISO QoS 16_1_1 - Success                             Failed       0.153 seconds
ISO QoS 16_2_1 - Success                             Failed       0.157 seconds
ISO QoS 16_2_1 CIG 0x01 - Success                    Failed       0.156 seconds
ISO QoS 16_2_1 CIG 0x01 CIS 0x01 - Success           Failed       0.153 seconds
ISO QoS 24_1_1 - Success                             Failed       0.153 seconds
ISO QoS 24_2_1 - Success                             Failed       0.152 seconds
ISO QoS 32_1_1 - Success                             Failed       0.156 seconds
ISO QoS 32_2_1 - Success                             Failed       0.155 seconds
ISO QoS 44_1_1 - Success                             Failed       0.154 seconds
ISO QoS 44_2_1 - Success                             Failed       0.150 seconds
ISO QoS 48_1_1 - Success                             Failed       0.152 seconds
ISO QoS 48_2_1 - Success                             Failed       0.153 seconds
ISO QoS 48_3_1 - Success                             Failed       0.150 seconds
ISO QoS 48_4_1 - Success                             Failed       0.152 seconds
ISO QoS 48_5_1 - Success                             Failed       0.152 seconds
ISO QoS 48_6_1 - Success                             Failed       0.154 seconds
ISO QoS 8_1_2 - Success                              Failed       0.156 seconds
ISO QoS 8_2_2 - Success                              Failed       0.152 seconds
ISO QoS 16_1_2 - Success                             Failed       0.152 seconds
ISO QoS 16_2_2 - Success                             Failed       0.155 seconds
ISO QoS 24_1_2 - Success                             Failed       0.156 seconds
ISO QoS 24_2_2 - Success                             Failed       0.154 seconds
ISO QoS 32_1_2 - Success                             Failed       0.156 seconds
ISO QoS 32_2_2 - Success                             Failed       0.152 seconds
ISO QoS 44_1_2 - Success                             Failed       0.154 seconds
ISO QoS 44_2_2 - Success                             Failed       0.152 seconds
ISO QoS 48_1_2 - Success                             Failed       0.157 seconds
ISO QoS 48_2_2 - Success                             Failed       0.153 seconds
ISO QoS 48_3_2 - Success                             Failed       0.155 seconds
ISO QoS 48_4_2 - Success                             Failed       0.155 seconds
ISO QoS 48_5_2 - Success                             Failed       0.154 seconds
ISO QoS 48_6_2 - Success                             Failed       0.155 seconds
ISO Connect2 CIG 0x01 - Success                      Failed       0.194 seconds
ISO Send - Success                                   Failed       0.154 seconds
ISO Receive - Success                                Failed       0.159 seconds
ISO Defer Send - Success                             Failed       0.155 seconds
ISO 48_2_1 Defer Send - Success                      Failed       0.152 seconds
ISO Defer Receive - Success                          Failed       0.151 seconds
ISO 48_2_1 Defer Receive - Success                   Failed       0.149 seconds
ISO Send and Receive - Success                       Failed       0.157 seconds
ISO Disconnect - Success                             Failed       0.159 seconds
ISO Reconnect - Success                              Failed       0.158 seconds


---
Regards,
Linux Bluetooth
bluez.test.bot@gmail.com Nov. 18, 2022, 7:54 a.m. UTC | #3
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=696036

---Test result---

Test Summary:
CheckPatch                    PASS      0.69 seconds
GitLint                       PASS      0.34 seconds
SubjectPrefix                 FAIL      0.35 seconds
BuildKernel                   PASS      34.21 seconds
BuildKernel32                 PASS      30.76 seconds
TestRunnerSetup               PASS      422.26 seconds
TestRunner_l2cap-tester       PASS      16.39 seconds
TestRunner_iso-tester         FAIL      16.21 seconds
TestRunner_bnep-tester        PASS      5.61 seconds
TestRunner_mgmt-tester        PASS      108.09 seconds
TestRunner_rfcomm-tester      PASS      9.52 seconds
TestRunner_sco-tester         PASS      8.94 seconds
TestRunner_ioctl-tester       PASS      10.29 seconds
TestRunner_mesh-tester        PASS      7.01 seconds
TestRunner_smp-tester         PASS      8.70 seconds
TestRunner_userchan-tester    PASS      5.86 seconds
IncrementalBuild              PASS      31.87 seconds

Details
##############################
Test: SubjectPrefix - FAIL
Desc: Check subject contains "Bluetooth" prefix
Output:
"Bluetooth: " prefix is not specified in the subject
##############################
Test: TestRunner_iso-tester - FAIL
Desc: Run iso-tester with test-runner
Output:
Total: 55, Passed: 11 (20.0%), Failed: 44, Not Run: 0

Failed Test Cases
ISO QoS 8_1_1 - Success                              Failed       2.029 seconds
ISO QoS 8_2_1 - Success                              Failed       0.157 seconds
ISO QoS 16_1_1 - Success                             Failed       0.155 seconds
ISO QoS 16_2_1 - Success                             Failed       0.155 seconds
ISO QoS 16_2_1 CIG 0x01 - Success                    Failed       0.157 seconds
ISO QoS 16_2_1 CIG 0x01 CIS 0x01 - Success           Failed       0.157 seconds
ISO QoS 24_1_1 - Success                             Failed       0.154 seconds
ISO QoS 24_2_1 - Success                             Failed       0.154 seconds
ISO QoS 32_1_1 - Success                             Failed       0.156 seconds
ISO QoS 32_2_1 - Success                             Failed       0.154 seconds
ISO QoS 44_1_1 - Success                             Failed       0.154 seconds
ISO QoS 44_2_1 - Success                             Failed       0.154 seconds
ISO QoS 48_1_1 - Success                             Failed       0.155 seconds
ISO QoS 48_2_1 - Success                             Failed       0.157 seconds
ISO QoS 48_3_1 - Success                             Failed       0.155 seconds
ISO QoS 48_4_1 - Success                             Failed       0.155 seconds
ISO QoS 48_5_1 - Success                             Failed       0.154 seconds
ISO QoS 48_6_1 - Success                             Failed       0.154 seconds
ISO QoS 8_1_2 - Success                              Failed       0.158 seconds
ISO QoS 8_2_2 - Success                              Failed       0.155 seconds
ISO QoS 16_1_2 - Success                             Failed       0.155 seconds
ISO QoS 16_2_2 - Success                             Failed       0.157 seconds
ISO QoS 24_1_2 - Success                             Failed       0.156 seconds
ISO QoS 24_2_2 - Success                             Failed       0.155 seconds
ISO QoS 32_1_2 - Success                             Failed       0.156 seconds
ISO QoS 32_2_2 - Success                             Failed       0.154 seconds
ISO QoS 44_1_2 - Success                             Failed       0.154 seconds
ISO QoS 44_2_2 - Success                             Failed       0.154 seconds
ISO QoS 48_1_2 - Success                             Failed       0.155 seconds
ISO QoS 48_2_2 - Success                             Failed       0.158 seconds
ISO QoS 48_3_2 - Success                             Failed       0.157 seconds
ISO QoS 48_4_2 - Success                             Failed       0.155 seconds
ISO QoS 48_5_2 - Success                             Failed       0.153 seconds
ISO QoS 48_6_2 - Success                             Failed       0.155 seconds
ISO Connect2 CIG 0x01 - Success                      Failed       0.197 seconds
ISO Send - Success                                   Failed       0.158 seconds
ISO Receive - Success                                Failed       0.159 seconds
ISO Defer Send - Success                             Failed       0.159 seconds
ISO 48_2_1 Defer Send - Success                      Failed       0.155 seconds
ISO Defer Receive - Success                          Failed       0.151 seconds
ISO 48_2_1 Defer Receive - Success                   Failed       0.154 seconds
ISO Send and Receive - Success                       Failed       0.164 seconds
ISO Disconnect - Success                             Failed       0.160 seconds
ISO Reconnect - Success                              Failed       0.156 seconds


---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index faca701bce2a..d04af3ad6b73 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -6778,6 +6778,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;
 	u16 handle = __le16_to_cpu(ev->handle);
+	__le32 interval;
 
 	bt_dev_dbg(hdev, "status 0x%2.2x", ev->status);
 
@@ -6798,22 +6799,25 @@  static void hci_le_cis_estabilished_evt(struct hci_dev *hdev, void *data,
 		goto unlock;
 	}
 
-	if (conn->role == HCI_ROLE_SLAVE) {
-		__le32 interval;
+	memset(&interval, 0, sizeof(interval));
+	memcpy(&interval, ev->c_latency, sizeof(ev->c_latency));
+	/* Converting from microseconds to milliseconds */
+	conn->iso_qos.in.latency = (__u16)(le16_to_cpu(interval) / 1000);
 
-		memset(&interval, 0, sizeof(interval));
+	memcpy(&interval, ev->p_latency, sizeof(ev->p_latency));
+	/* Converting from microseconds to milliseconds */
+	conn->iso_qos.out.latency = (__u16)(le16_to_cpu(interval) / 1000);
 
-		memcpy(&interval, ev->c_latency, sizeof(ev->c_latency));
-		conn->iso_qos.in.interval = le32_to_cpu(interval);
-		memcpy(&interval, ev->p_latency, sizeof(ev->p_latency));
-		conn->iso_qos.out.interval = le32_to_cpu(interval);
-		conn->iso_qos.in.latency = le16_to_cpu(ev->interval);
-		conn->iso_qos.out.latency = le16_to_cpu(ev->interval);
-		conn->iso_qos.in.sdu = le16_to_cpu(ev->c_mtu);
-		conn->iso_qos.out.sdu = le16_to_cpu(ev->p_mtu);
-		conn->iso_qos.in.phy = ev->c_phy;
-		conn->iso_qos.out.phy = ev->p_phy;
-	}
+	/* Converting interval to microseconds */
+	conn->iso_qos.in.interval =
+		(__u32)((le32_to_cpu(ev->interval) * 125 / 100) * 1000);
+	conn->iso_qos.out.interval =
+		(__u32)((le32_to_cpu(ev->interval) * 125 / 100) * 1000);
+
+	conn->iso_qos.in.sdu = le16_to_cpu(ev->c_mtu);
+	conn->iso_qos.out.sdu = le16_to_cpu(ev->p_mtu);
+	conn->iso_qos.in.phy = ev->c_phy;
+	conn->iso_qos.out.phy = ev->p_phy;
 
 	if (!ev->status) {
 		conn->state = BT_CONNECTED;