All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Add support for handling encrypted BIGs based on BIGInfo reports
@ 2023-08-24 10:16 Iulia Tanasescu
  2023-08-24 10:16 ` [PATCH 1/2] Bluetooth: ISO: Add MGMT event for BIGInfo adv report Iulia Tanasescu
  2023-08-24 10:16 ` [PATCH 2/2] Bluetooth: ISO: Pass sync_handle through iso qos Iulia Tanasescu
  0 siblings, 2 replies; 5+ messages in thread
From: Iulia Tanasescu @ 2023-08-24 10:16 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: claudia.rosu, mihai-octavian.urzica, silviu.barbulescu,
	vlad.pruteanu, andrei.istodorescu, Iulia Tanasescu

This patch introduces MGMT events for BIGInfo advertising reports, so
that the event can be passed from kernel to userspace.

This patch also adds the sync_handle field to the bt_iso_bcast_qos
structure.

These changes are needed in order to implement the BASS Set Broadcast
Code operation - a BASS Server is required to inspect BIGInfo
advertising reports received from a Broadcast Source, to determine if
the BIG is encrypted or not. The Server is only able to associate a
Broadcast Source with a received BIGInfo report by looking at the
sync_handle field. This is why the sync_handle needs to be available
in the QoS structure, so that it can e retrieved via getsockopt, once
PA sync is established.

Iulia Tanasescu (2):
  Bluetooth: ISO: Add MGMT event for BIGInfo adv report
  Bluetooth: ISO: Pass sync_handle through iso qos

 include/net/bluetooth/bluetooth.h |  1 +
 include/net/bluetooth/hci_core.h  |  4 +++-
 include/net/bluetooth/mgmt.h      | 18 ++++++++++++++++++
 net/bluetooth/hci_conn.c          |  5 ++---
 net/bluetooth/hci_event.c         |  7 ++++++-
 net/bluetooth/iso.c               | 18 +++++++-----------
 net/bluetooth/mgmt.c              |  8 ++++++++
 7 files changed, 45 insertions(+), 16 deletions(-)


base-commit: feed554a67ab7a602cd26cf6a4c44093dd54d4b9
-- 
2.34.1


^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH 1/2] Bluetooth: ISO: Add MGMT event for BIGInfo adv report
@ 2023-08-21 12:00 Iulia Tanasescu
  2023-08-21 12:49 ` Add support for handling encrypted BIGs based on BIGInfo reports bluez.test.bot
  0 siblings, 1 reply; 5+ messages in thread
From: Iulia Tanasescu @ 2023-08-21 12:00 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: claudia.rosu, mihai-octavian.urzica, silviu.barbulescu,
	vlad.pruteanu, andrei.istodorescu, Iulia Tanasescu

This introduces the MGMT_EV_LE_BIG_INFO_ADV_REPORT event.

Signed-off-by: Iulia Tanasescu <iulia.tanasescu@nxp.com>
---
 include/net/bluetooth/hci_core.h |  2 ++
 include/net/bluetooth/mgmt.h     | 18 ++++++++++++++++++
 net/bluetooth/hci_event.c        |  7 ++++++-
 net/bluetooth/mgmt.c             |  8 ++++++++
 4 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 6fb055e3c595..ba2e1082b86f 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -2228,6 +2228,8 @@ void mgmt_discovering(struct hci_dev *hdev, u8 discovering);
 void mgmt_suspending(struct hci_dev *hdev, u8 state);
 void mgmt_resuming(struct hci_dev *hdev, u8 reason, bdaddr_t *bdaddr,
 		   u8 addr_type);
+int mgmt_le_big_info_adv_report(struct hci_dev *hdev,
+				struct hci_evt_le_big_info_adv_report *ev);
 bool mgmt_powering_down(struct hci_dev *hdev);
 void mgmt_new_ltk(struct hci_dev *hdev, struct smp_ltk *key, bool persistent);
 void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk, bool persistent);
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index d382679efd2b..5f7ad5bc5f73 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -3,6 +3,7 @@
 
    Copyright (C) 2010  Nokia Corporation
    Copyright (C) 2011-2012  Intel Corporation
+   Copyright 2023  NXP
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License version 2 as
@@ -1177,3 +1178,20 @@ struct mgmt_ev_mesh_device_found {
 struct mgmt_ev_mesh_pkt_cmplt {
 	__u8	handle;
 } __packed;
+
+#define MGMT_EV_LE_BIG_INFO_ADV_REPORT	0x0033
+struct mgmt_ev_le_big_info_adv_report {
+	__le16  sync_handle;
+	__u8    num_bis;
+	__u8    nse;
+	__le16  iso_interval;
+	__u8    bn;
+	__u8    pto;
+	__u8    irc;
+	__le16  max_pdu;
+	__u8    sdu_interval[3];
+	__le16  max_sdu;
+	__u8    phy;
+	__u8    framing;
+	__u8    encryption;
+} __packed;
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index b4b72070f5f6..b794c8fb2238 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -7143,9 +7143,14 @@ static void hci_le_big_info_adv_report_evt(struct hci_dev *hdev, void *data,
 	hci_dev_lock(hdev);
 
 	mask |= hci_proto_connect_ind(hdev, BDADDR_ANY, ISO_LINK, &flags);
-	if (!(mask & HCI_LM_ACCEPT))
+	if (!(mask & HCI_LM_ACCEPT)) {
 		hci_le_pa_term_sync(hdev, ev->sync_handle);
+		goto unlock;
+	}
 
+	mgmt_le_big_info_adv_report(hdev, ev);
+
+unlock:
 	hci_dev_unlock(hdev);
 }
 
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index d6c9b7bc8592..db6d74c40ac3 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -3,6 +3,7 @@
 
    Copyright (C) 2010  Nokia Corporation
    Copyright (C) 2011-2012 Intel Corporation
+   Copyright 2023 NXP
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License version 2 as
@@ -10523,6 +10524,13 @@ void mgmt_resuming(struct hci_dev *hdev, u8 reason, bdaddr_t *bdaddr,
 	mgmt_event(MGMT_EV_CONTROLLER_RESUME, hdev, &ev, sizeof(ev), NULL);
 }
 
+int mgmt_le_big_info_adv_report(struct hci_dev *hdev,
+				struct hci_evt_le_big_info_adv_report *ev)
+{
+	return mgmt_event(MGMT_EV_LE_BIG_INFO_ADV_REPORT, hdev,
+			(struct mgmt_ev_le_big_info_adv_report *)ev, sizeof(*ev), NULL);
+}
+
 static struct hci_mgmt_chan chan = {
 	.channel	= HCI_CHANNEL_CONTROL,
 	.handler_count	= ARRAY_SIZE(mgmt_handlers),
-- 
2.34.1


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

end of thread, other threads:[~2023-08-24 11:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-24 10:16 [PATCH 0/2] Add support for handling encrypted BIGs based on BIGInfo reports Iulia Tanasescu
2023-08-24 10:16 ` [PATCH 1/2] Bluetooth: ISO: Add MGMT event for BIGInfo adv report Iulia Tanasescu
2023-08-24 11:02   ` Add support for handling encrypted BIGs based on BIGInfo reports bluez.test.bot
2023-08-24 10:16 ` [PATCH 2/2] Bluetooth: ISO: Pass sync_handle through iso qos Iulia Tanasescu
  -- strict thread matches above, loose matches on Subject: below --
2023-08-21 12:00 [PATCH 1/2] Bluetooth: ISO: Add MGMT event for BIGInfo adv report Iulia Tanasescu
2023-08-21 12:49 ` Add support for handling encrypted BIGs based on BIGInfo reports 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.