diff mbox series

[BlueZ,5/6] bap: Remove interface

Message ID 20250307154457.85751-6-iulia.tanasescu@nxp.com (mailing list archive)
State Accepted
Commit 8850bad1e027e27eaf4a2e2940173a6cc236d2e9
Headers show
Series bap: Remove interface | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success

Commit Message

Iulia Tanasescu March 7, 2025, 3:44 p.m. UTC
This removes the BAP plugin interface and updates the BAP and
BASS plugins to use shared/bap APIs.
---
 Makefile.plugins      |  2 +-
 profiles/audio/bap.c  | 57 ++-----------------------------------------
 profiles/audio/bap.h  | 13 ----------
 profiles/audio/bass.c |  6 ++---
 4 files changed, 5 insertions(+), 73 deletions(-)
 delete mode 100644 profiles/audio/bap.h
diff mbox series

Patch

diff --git a/Makefile.plugins b/Makefile.plugins
index 43e665432..bae4363d0 100644
--- a/Makefile.plugins
+++ b/Makefile.plugins
@@ -113,7 +113,7 @@  endif
 
 if BAP
 builtin_modules += bap
-builtin_sources += profiles/audio/bap.h profiles/audio/bap.c
+builtin_sources += profiles/audio/bap.c
 endif
 
 if BASS
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 1889e1a1e..a37e62f76 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -56,8 +56,6 @@ 
 #include "src/log.h"
 #include "src/error.h"
 
-#include "bap.h"
-
 #define ISO_SOCKET_UUID "6fbaf188-05e0-496a-9885-d6ddfdb4e03e"
 #define PACS_UUID_STR "00001850-0000-1000-8000-00805f9b34fb"
 #define BCAAS_UUID_STR "00001852-0000-1000-8000-00805f9b34fb"
@@ -1053,57 +1051,6 @@  static void iso_bcast_confirm_cb(GIOChannel *io, GError *err, void *user_data)
 	}
 }
 
-void bap_qos_to_iso_qos(struct bt_bap_qos *bap_qos,
-				struct bt_iso_qos *iso_qos)
-{
-	memset(iso_qos, 0, sizeof(*iso_qos));
-
-	iso_qos->bcast.big = bap_qos->bcast.big;
-	iso_qos->bcast.bis = bap_qos->bcast.bis;
-	iso_qos->bcast.sync_factor = bap_qos->bcast.sync_factor;
-	iso_qos->bcast.packing = bap_qos->bcast.packing;
-	iso_qos->bcast.framing = bap_qos->bcast.framing;
-	iso_qos->bcast.encryption = bap_qos->bcast.encryption;
-	if (bap_qos->bcast.bcode && bap_qos->bcast.bcode->iov_base)
-		memcpy(iso_qos->bcast.bcode, bap_qos->bcast.bcode->iov_base,
-				bap_qos->bcast.bcode->iov_len);
-	iso_qos->bcast.options = bap_qos->bcast.options;
-	iso_qos->bcast.skip = bap_qos->bcast.skip;
-	iso_qos->bcast.sync_timeout = bap_qos->bcast.sync_timeout;
-	iso_qos->bcast.sync_cte_type = bap_qos->bcast.sync_cte_type;
-	iso_qos->bcast.mse = bap_qos->bcast.mse;
-	iso_qos->bcast.timeout = bap_qos->bcast.timeout;
-	memcpy(&iso_qos->bcast.out, &bap_qos->bcast.io_qos,
-			sizeof(struct bt_iso_io_qos));
-}
-
-void bap_iso_qos_to_bap_qos(struct bt_iso_qos *iso_qos,
-				struct bt_bap_qos *bap_qos)
-{
-	bap_qos->bcast.big = iso_qos->bcast.big;
-	bap_qos->bcast.bis = iso_qos->bcast.bis;
-	bap_qos->bcast.sync_factor = iso_qos->bcast.sync_factor;
-	bap_qos->bcast.packing = iso_qos->bcast.packing;
-	bap_qos->bcast.framing = iso_qos->bcast.framing;
-	bap_qos->bcast.encryption = iso_qos->bcast.encryption;
-	if (bap_qos->bcast.encryption)
-		bap_qos->bcast.bcode = util_iov_new(iso_qos->bcast.bcode,
-						sizeof(iso_qos->bcast.bcode));
-	bap_qos->bcast.options = iso_qos->bcast.options;
-	bap_qos->bcast.skip = iso_qos->bcast.skip;
-	bap_qos->bcast.sync_timeout = iso_qos->bcast.sync_timeout;
-	bap_qos->bcast.sync_cte_type =
-			iso_qos->bcast.sync_cte_type;
-	bap_qos->bcast.mse = iso_qos->bcast.mse;
-	bap_qos->bcast.timeout = iso_qos->bcast.timeout;
-	bap_qos->bcast.io_qos.interval =
-			iso_qos->bcast.in.interval;
-	bap_qos->bcast.io_qos.latency = iso_qos->bcast.in.latency;
-	bap_qos->bcast.io_qos.phy = iso_qos->bcast.in.phy;
-	bap_qos->bcast.io_qos.rtn = iso_qos->bcast.in.rtn;
-	bap_qos->bcast.io_qos.sdu = iso_qos->bcast.in.sdu;
-}
-
 static void create_stream_for_bis(struct bap_data *bap_data,
 		struct bt_bap_pac *lpac, struct bt_bap_qos *qos,
 		struct iovec *caps, struct iovec *meta, char *path)
@@ -1197,7 +1144,7 @@  static gboolean big_info_report_cb(GIOChannel *io, GIOCondition cond,
 	iov.iov_len = base.base_len;
 
 	/* Create BAP QoS structure */
-	bap_iso_qos_to_bap_qos(&qos, &bap_qos);
+	bt_bap_iso_qos_to_bap_qos(&qos, &bap_qos);
 
 	bt_bap_parse_base(&iov, &bap_qos, bap_debug, bis_handler, data);
 
@@ -2962,7 +2909,7 @@  static void iso_do_big_sync(GIOChannel *io, void *user_data)
 	queue_foreach(links, setup_refresh_qos, data);
 
 	/* Set the user requested QOS */
-	bap_qos_to_iso_qos(&setup->qos, &qos);
+	bt_bap_qos_to_iso_qos(&setup->qos, &qos);
 
 	if (!bt_io_set(io, &err,
 			BT_IO_OPT_QOS, &qos,
diff --git a/profiles/audio/bap.h b/profiles/audio/bap.h
deleted file mode 100644
index 2bf93dd93..000000000
--- a/profiles/audio/bap.h
+++ /dev/null
@@ -1,13 +0,0 @@ 
-/* SPDX-License-Identifier: GPL-2.0-or-later */
-/*
- *
- *  BlueZ - Bluetooth protocol stack for Linux
- *
- *  Copyright 2024 NXP
- *
- */
-
-void bap_iso_qos_to_bap_qos(struct bt_iso_qos *iso_qos,
-				struct bt_bap_qos *bap_qos);
-void bap_qos_to_iso_qos(struct bt_bap_qos *bap_qos,
-				struct bt_iso_qos *iso_qos);
diff --git a/profiles/audio/bass.c b/profiles/audio/bass.c
index 6f68b80f3..d987987ff 100644
--- a/profiles/audio/bass.c
+++ b/profiles/audio/bass.c
@@ -52,8 +52,6 @@ 
 #include "src/log.h"
 #include "src/error.h"
 
-#include "bap.h"
-
 #define BASS_UUID_STR "0000184f-0000-1000-8000-00805f9b34fb"
 #define BCAAS_UUID_STR "00001852-0000-1000-8000-00805f9b34fb"
 
@@ -370,7 +368,7 @@  static void bap_state_changed(struct bt_bap_stream *stream, uint8_t old_state,
 
 		queue_foreach(links, append_stream, &iso_bc_addr);
 
-		bap_qos_to_iso_qos(bap_qos, &qos);
+		bt_bap_qos_to_iso_qos(bap_qos, &qos);
 
 		if (!bt_io_set(dg->io, &gerr,
 				BT_IO_OPT_QOS, &qos,
@@ -532,7 +530,7 @@  static gboolean big_info_cb(GIOChannel *io, GIOCondition cond,
 	iov.iov_len = base.base_len;
 
 	/* Create BAP QoS structure */
-	bap_iso_qos_to_bap_qos(&qos, &bap_qos);
+	bt_bap_iso_qos_to_bap_qos(&qos, &bap_qos);
 
 	bt_bap_parse_base(&iov, &bap_qos, bass_debug, bis_handler, dg);