Skip to contentSkip to conversation

Bluetooth: ISO: Copy BASE if service data matches EIR_BAA_SERVICE_UUID

PATCH Superseded Claudia Draghicescu 2 participants 3 messages Sep 6, 2023

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover Bluetooth: ISO: Copy BASE if service data matches EIR_BAA_SERVICE_UUID

Copy the content of a Periodic Advertisement Report to BASE only if the service UUID is Basic Audio Announcement Service UUID.

Claudia Draghicescu (1):
Bluetooth: ISO: Copy BASE if service data matches EIR_BAA_SERVICE_UUID

 net/bluetooth/iso.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

base-commit: 52bf4fd43f759ac4698f041fff2cb27691698265

Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/1 Bluetooth: ISO: Copy BASE if service data matches EIR_BAA_SERVICE_UUID

Copy the content of a Periodic Advertisement Report to BASE only if the service UUID is Basic Audio Announcement Service UUID.

---
 net/bluetooth/iso.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)
net/bluetooth/iso.c +14 -6
index 16da946f5881..33ce9df7f65d 100644
@@ -14,6 +14,7 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 #include <net/bluetooth/iso.h>
+#include "eir.h"
 
 static const struct proto_ops iso_sock_ops;
 
@@ -47,6 +48,7 @@ static void iso_sock_kill(struct sock *sk);
 
 #define EIR_SERVICE_DATA_LENGTH 4
 #define BASE_MAX_LENGTH (HCI_MAX_PER_AD_LENGTH - EIR_SERVICE_DATA_LENGTH)
+#define EIR_BAA_SERVICE_UUID	0x1851
 
 /* iso_pinfo flags values */
 enum {
@@ -1458,7 +1460,7 @@ static int iso_sock_getsockopt(struct socket *sock, int level, int optname,
 		len = min_t(unsigned int, len, base_len);
 		if (copy_to_user(optval, base, len))
 			err = -EFAULT;
-
+		*optlen = len;
 		break;
 
 	default:
@@ -1648,7 +1650,6 @@ static void iso_conn_ready(struct iso_conn *conn)
 		}
 
 		if (ev2 && !ev2->status) {
-			iso_pi(sk)->sync_handle = iso_pi(parent)->sync_handle;
 			iso_pi(sk)->qos = iso_pi(parent)->qos;
 			iso_pi(sk)->bc_num_bis = iso_pi(parent)->bc_num_bis;
 			memcpy(iso_pi(sk)->bc_bis, iso_pi(parent)->bc_bis, ISO_MAX_NUM_BIS);
@@ -1771,13 +1772,20 @@ int iso_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags)
 
 	ev3 = hci_recv_event_data(hdev, HCI_EV_LE_PER_ADV_REPORT);
 	if (ev3) {
+		size_t base_len = ev3->length;
+		u8 *base;
+
 		sk = iso_get_sock_listen(&hdev->bdaddr, bdaddr,
 					 iso_match_sync_handle_pa_report, ev3);
-
-		if (sk) {
-			memcpy(iso_pi(sk)->base, ev3->data, ev3->length);
-			iso_pi(sk)->base_len = ev3->length;
+		base = eir_get_service_data(ev3->data, ev3->length,
+					    EIR_BAA_SERVICE_UUID, &base_len);
+		if (base) {
+			if (sk) {
+				memcpy(iso_pi(sk)->base, base, base_len);
+				iso_pi(sk)->base_len = base_len;
+			}
 		}
+
 	} else {
 		sk = iso_get_sock_listen(&hdev->bdaddr, BDADDR_ANY, NULL, NULL);
 	}
Signature · 1 line
2.34.1
#2 lore raw

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

---Test result---

Test Summary:

CheckPatch                    PASS      0.90 seconds
GitLint                       FAIL      0.62 seconds
SubjectPrefix                 PASS      0.13 seconds
BuildKernel                   PASS      40.41 seconds
CheckAllWarning               PASS      44.74 seconds
CheckSparse                   WARNING   49.64 seconds
CheckSmatch                   PASS      133.86 seconds
BuildKernel32                 PASS      38.81 seconds
TestRunnerSetup               PASS      567.33 seconds
TestRunner_l2cap-tester       PASS      29.57 seconds
TestRunner_iso-tester         PASS      53.80 seconds
TestRunner_bnep-tester        PASS      11.43 seconds
TestRunner_mgmt-tester        PASS      233.86 seconds
TestRunner_rfcomm-tester      PASS      17.39 seconds
TestRunner_sco-tester         PASS      21.31 seconds
TestRunner_ioctl-tester       PASS      19.66 seconds
TestRunner_mesh-tester        PASS      14.77 seconds
TestRunner_smp-tester         PASS      15.49 seconds
TestRunner_userchan-tester    PASS      12.22 seconds
IncrementalBuild              PASS      31.29 seconds

Details
##############################
Test: GitLint - FAIL
Desc: Run gitlint
Output:
[1/1] Bluetooth: ISO: Copy BASE if service data matches EIR_BAA_SERVICE_UUID

WARNING: I3 - ignore-body-lines: gitlint will be switching from using Python regex 'match' (match beginning) to 'search' (match anywhere) semantics. Please review your ignore-body-lines.regex option accordingly. To remove this warning, set general.regex-style-search=True. More details: https://jorisroovers.github.io/gitlint/configuration/#regex-style-search
5: B2 Line has trailing whitespace: " "
##############################
Test: CheckSparse - WARNING
Desc: Run sparse tool with linux kernel
Output:
net/bluetooth/iso.c:1466:18: warning: dereference of noderef expression

---
Regards,
Linux Bluetooth