From patchwork Thu Oct 24 11:02:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 838218 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2060.outbound.protection.outlook.com [40.107.249.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 901A81CACCE for ; Thu, 24 Oct 2024 11:02:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729767779; cv=fail; b=OklHqMaBlGKDUI547F6h/TMp9/mSrj3a2JCWUF/idOzeqT59UoL9D34PpXxHJFYrgYg8xeX2CP8nZSH08Rza+7rszNAHO0dsabtvpWPk2NAeNEMZHyLQpNCQYAzrgmfnCcwygnU0vff8kwvoP3pXuDRP4tVi7Wb3zTrYgDW61to= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729767779; c=relaxed/simple; bh=vGoYHrV9It3hSCFhh0q5y6vymuna8Qe7Qal+Y+1Ry5I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=WAtAfEiOs2REe95aA97JP4/KQZogeY1ewymdHSZA4D0vA4CaEZRaHvpk963QWT4QcuWiOO4J01hJb17GjYP/lyAS4eNXq1WqJAR2V1l9i6NcTgrwNrYiSg1pdegl6HX8UQq3uX4vVEPoEwe7Siho9IlOkT7/Z2EDvnpSsiueoQU= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=B286stF/; arc=fail smtp.client-ip=40.107.249.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="B286stF/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=og2bSSwssZ1c94h//NB6fpJ3eJXtiaaojxyZsUQVqJZwICgiFR9LHEPZmCyMo1MNGA5WNuQ4bAw/u+IvYNttoLcZpmj4ePiMpxLYY9bSqznR2q9sZohuaGCOWvtajGeHaoFcBEX7RdKLl/g4cTlQOx0IzsjxyGBra++Igq5a8ZfByScuzgY5LNu84XvOlirlvmGvinLvDadgNJwmtpq20wYv3eV8l9d7j5tAxhRg6K9PrVtNwODc+VcYOno6pNOp1j0Me7sIsozHtO+5mTZVLpVcB/04jNg1E6PXIXnDia+hu3x7rNUJ6OqXc2RpXqlN0ViLzOGZ1sV0PX3jSW3MHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JwtOVH5eehtjp/++jGhxfvvjytHVqR+38TKX8bsnJdc=; b=ouitVyBwRVhPEmp6io4tqUjQ+deGbowLEGgk1SCD01WbBwbVOLXA6Qz1xjjkT4C5FgM6frejqjDGRhD36aH8nM6yd5IcKInhmSolcttuDGu3hqakZCnOhR0OZHxgGdx9QvdXZz5orm5glbxcYZ7JwI3lOgebHQR4zfk6OUMlxCBpSc3Zehv1tREND/KnXpZTICujly3zmKcUkbVcW2IAqx75n5/x3rSVhbbkSpsWwWjI30lCon47z5LNm8NVYJMpOhaRwFmyPEjo3b69WQg6DXCDSfAE95iUDjiq+BXbZk21c99lqr4q0TWIJOVYP0kFl639yF6TrzS6B+hT4IYdvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JwtOVH5eehtjp/++jGhxfvvjytHVqR+38TKX8bsnJdc=; b=B286stF/ws8cidl74L9EFJb13D4dXLvFrtPcGr0qHhxxJWUXoy6kEzsaC69EBiJ4XwEBo5sWhHrczsCWAcTnfUlzS/gS3Kh+Cucy+3R2M1gYt8UqN5RK2+0DLHVBJ8NKalGRacSYPviPxzMXAAg2kJPrCgD64OD0tm3yNRSj9ioyvX7aO0+C21zmrmjxdb/ZRYC6+BOa2l/+cytjzK6wZ3fCrVtTbwjwzu6H6Qc6iKzpTrFknsoX0SsWJZl52Bc++LIDLqXyJkW4IWvrrt2JMO5FXrNrW4PiO9Vym3/KwqZgwyfvMA8G0weJdJdoCTaCbK+vfcvID0B16uaUvGHprg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by AS4PR04MB9622.eurprd04.prod.outlook.com (2603:10a6:20b:4cc::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.26; Thu, 24 Oct 2024 11:02:52 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%4]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 11:02:52 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 01/14] shared/bap: Allow multiple links per stream Date: Thu, 24 Oct 2024 14:02:10 +0300 Message-ID: <20241024110223.77254-2-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241024110223.77254-1-iulia.tanasescu@nxp.com> References: <20241024110223.77254-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AS4PR09CA0018.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::6) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|AS4PR04MB9622:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ac12da1-13a4-497e-bd39-08dcf41b67c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: 4ZFhdFUbEhXPHurTj+YdszQN8PNCoYqNAS+gtQ7FFG1F7+/BIhIWMrcuX1suXOdK0n2ZJujni5q66nrolpcoPJLTSwn7FkU1QoY/Wl+rivyDJd27Q6BlMRuTucd00Xe275WS/30e9Pjd7FS4NbJ1I87WqwOKZ/F73dzCQ0F6NTw83fE1aSO3fP8YxPP8uUZA1cVB1IJvQWkSGJlSEL0INnEt+xMnECpjXaZ+Q4xVodEqQWFrxo0k+lQfejYwezgt0sXAlk2e21cBuuHfUy28PcZ8dn99ZnSS3+e3d1DfjhTmCJSD+NTF7IFF175A+jqZ+zFjwnQyLOiyujiEAtHt3Hk3qA2mJTO4AiQaW4sqjtbWlpZzj1A0DB8YS6PVJXApHEOXQYFrSOaxaLKMGX8W6FgxEw0qeLoXFNiqdltszlHy1uZZDjCIOGX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(13230040)(52116014)(376014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jQcFkoutC4NOAU4+858RFj+wZodOa8FrhnZtFYAE1w+c2GHNhbDxIhszA4LI/PfTcRVO9xHuM2H6Ql3CR3qc+YHHsQ1yw8D3QkTCNsqWF3MJGOhIFWwmzrg4dzvOxvHtrH5zVWXdATHtgj5o+hOEZqk0crQ+ERu0Tnj0UphYqQK9mJWv3AKD8pI61I160jovcyk57ymGlvc8knZHxrv5AnZ4LD9NJyMeuxOtbV2gpv7LnHFPvnff+Xsj4/SgISNvW9GD4rWnrEBAPbu0I/ta3llx+ge39Cg+zuj4XOacMdx4O6V2sMxImC4t1ifgcl+QBBdgiJ0oZQIZiGUcwWgERV9GqvjHRl7ODtMc0nGTQjfkpOpaTqKdbl1MuPywmITXsgOe63FxYh3sCPZCSAVOYLXuBg5ZAlheWnGEa+qrlCY6dTY3ySMNJK2XefdE/p7ytq0UicHyijNozJSRQPul6D+TkMyk6ve4gCmumgwVwByE5Q8XZlBv6HdudAgcXTsqneswEaC4lNevpZrE22qVjI6vsyvYRB0hgjL+U7mBwqvEMXZvvBTi9/2lih9rmy99Io3yI+OiVbXM6bsup72C3Iin9EhKU8kcleZi9g2QKgGUPepHPv4Vmt9Mi4SBOfS4hZdQG9HhGmGknSomXLD6dpG3DNLhBiWzWQxAKgQDzyhM6P21rD3U8N3ogGHS5tVBlrWlTWEfZbaacuMafe9CAyPwWzE1oOA2QHaZEuejzflIiWnJ/iE5siDLSjBRCG9rWYjHxmSbfRafXUIiyKvIIgVslG34+UdDveigtvqrXJy1+Z24P70QO2quzzjP0k3q73TKorryF6bs4HxTsiWWdFgou9UZBrT9TYZR/txIFDxk3OYg9bJOaxdaxW+KPJMe3Na+4fYpEo/OS7ZvBPEsmvhrBq7hf4DcFyRWa/MwCVvHmZKb/58vf849J0+GvDAADxZBlzptG0El2CTQwayCK3XZhpM+vQN6v+LX9FLJcRnRWrvJx+Ou59AdI7C3fU4Fnkko5w/mohPOqtjzH62pZg/03BE2speC/R0PS4aMpOSpqEYE5eCmpYXi1zDGaLkD/ZZsuEQ+Ya/Am4N03QS+PsHDJdvGzewMYFQppHlIdv856HSYzcmwX0Rur6joDfX8L6Xp1P09Nne6rDLvL8EDh6dk4KsyTAX+nFNfcUVnge2mYMwEmcjxXOIJyOLeM5E1rOAy+6VQ8b8+7IRgp43/Ec3CSxGKVWD5w3xcTUrtH9XGxUHeqQTCpWk4o9pdeCMalhoR2bgSCnIj0MowFlwSQro8rwrYsW26cTHhvH3ipVPhehzDzfI3zVtsxT850XTpODybp3qYbANMDh0kiQhzVJ9RRYFfRlwvRWZpdZuWtfH1GYGRPQ8SpwgAC/ODhB+i38S13YOrZoP8O8/nR5tZZSbcAgqRO1cLMw9Sj5wzSWJGXBykaVTGykKjuA2MiH5AvCeyFdXHZauoqfGod4C0ECbD94MmEBMwQUwZ8NjQbkqSBnxVv1oWMKdk/5ZcdSokVcs4CYDpZssGsLTJMwJMlJ6yySSyjAZrPn+ZsPNWVYbjF0J824Z6K38Y1BOT7RBKqTm705p0SfDXhJVJT2/Mxw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ac12da1-13a4-497e-bd39-08dcf41b67c9 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 11:02:52.3868 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3c+QPECeKMpQbmaMKNv5DbGDIWMLw1pDry1T3qIcByliMelLTGk4lrkdmF/1Cclaf83zTJ8EtipQpF9YRQ8m0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9622 This commit adds support to link multiple streams together, creating the foundation for implementing broadcast links: for Broadcast Sinks, the user could select multiple streams to receive audio from. All selected streams need to be linked together and considered when creating BIG sync. --- profiles/audio/transport.c | 38 ++++++-------- src/shared/bap.c | 104 +++++++++++++++++++++++++++++-------- src/shared/bap.h | 2 +- 3 files changed, 97 insertions(+), 47 deletions(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index 68192bae6..d71013077 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -330,12 +330,9 @@ static void transport_bap_remove_owner(struct media_transport *transport, { struct bap_transport *bap = transport->data; - if (bap && bap->linked) { - struct bt_bap_stream *link; - - link = bt_bap_stream_io_get_link(bap->stream); - linked_transport_remove_owner(link, owner); - } + if (bap && bap->linked) + queue_foreach(bt_bap_stream_io_get_links(bap->stream), + linked_transport_remove_owner, owner); } static void media_transport_remove_owner(struct media_transport *transport) @@ -581,12 +578,9 @@ static void transport_bap_set_owner(struct media_transport *transport, { struct bap_transport *bap = transport->data; - if (bap && bap->linked) { - struct bt_bap_stream *link; - - link = bt_bap_stream_io_get_link(bap->stream); - linked_transport_set_owner(link, owner); - } + if (bap && bap->linked) + queue_foreach(bt_bap_stream_io_get_links(bap->stream), + linked_transport_set_owner, owner); } static void media_transport_set_owner(struct media_transport *transport, @@ -1129,14 +1123,14 @@ static gboolean get_links(const GDBusPropertyTable *property, { struct media_transport *transport = data; struct bap_transport *bap = transport->data; - struct bt_bap_stream *link = bt_bap_stream_io_get_link(bap->stream); + struct queue *links = bt_bap_stream_io_get_links(bap->stream); DBusMessageIter array; dbus_message_iter_open_container(iter, DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH_AS_STRING, &array); - append_link(link, &array); + queue_foreach(links, append_link, &array); dbus_message_iter_close_container(iter, &array); @@ -1572,15 +1566,15 @@ static bool match_link_transport(const void *data, const void *user_data) static void bap_update_links(const struct media_transport *transport) { struct bap_transport *bap = transport->data; - struct bt_bap_stream *link = bt_bap_stream_io_get_link(bap->stream); + struct queue *links = bt_bap_stream_io_get_links(bap->stream); - if (bap->linked == (!!link)) + if (bap->linked == !queue_isempty(links)) return; - bap->linked = link ? true : false; + bap->linked = !queue_isempty(links); /* Check if the links transport has been create yet */ - if (bap->linked && !match_link_transport(link, NULL)) { + if (bap->linked && !queue_find(links, match_link_transport, NULL)) { bap->linked = false; return; } @@ -1757,15 +1751,13 @@ static void transport_bap_set_state(struct media_transport *transport, transport_state_t state) { struct bap_transport *bap = transport->data; - struct bt_bap_stream *link; if (!bap->linked) return; - link = bt_bap_stream_io_get_link(bap->stream); - - /* Update link */ - link_set_state(link, UINT_TO_PTR(state)); + /* Update links */ + queue_foreach(bt_bap_stream_io_get_links(bap->stream), link_set_state, + UINT_TO_PTR(state)); } static void bap_state_changed(struct bt_bap_stream *stream, uint8_t old_state, diff --git a/src/shared/bap.c b/src/shared/bap.c index 00c3b9ff6..1b70df4d5 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -262,7 +262,7 @@ struct bt_bap_stream { struct iovec *cc; struct iovec *meta; struct bt_bap_qos qos; - struct bt_bap_stream *link; + struct queue *links; struct bt_bap_stream_io *io; const struct bt_bap_stream_ops *ops; uint8_t old_state; @@ -1101,6 +1101,14 @@ static void stream_io_unref(struct bt_bap_stream_io *io) stream_io_free(io); } +static void bap_stream_unlink(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + struct bt_bap_stream *link = user_data; + + queue_remove(stream->links, link); +} + static void bap_stream_free(void *data) { struct bt_bap_stream *stream = data; @@ -1110,8 +1118,8 @@ static void bap_stream_free(void *data) if (stream->ep) stream->ep->stream = NULL; - if (stream->link) - stream->link->link = NULL; + queue_foreach(stream->links, bap_stream_unlink, stream); + queue_destroy(stream->links, NULL); stream_io_unref(stream->io); util_iov_free(stream->cc, 1); @@ -1246,6 +1254,17 @@ static void bap_stream_update_io_links(struct bt_bap_stream *stream) queue_find(bap->streams, bap_stream_io_link, stream); } +static bool match_stream_io(const void *data, const void *user_data) +{ + const struct bt_bap_stream *stream = data; + const struct bt_bap_stream_io *io = user_data; + + if (!stream->io) + return false; + + return stream->io == io; +} + static bool bap_stream_io_detach(struct bt_bap_stream *stream) { struct bt_bap_stream *link; @@ -1259,7 +1278,7 @@ static bool bap_stream_io_detach(struct bt_bap_stream *stream) io = stream->io; stream->io = NULL; - link = stream->link; + link = queue_find(stream->links, match_stream_io, io); if (link) { /* Detach link if in QoS state */ if (link->ep->state == BT_ASCS_ASE_STATE_QOS) @@ -1803,6 +1822,14 @@ static unsigned int bap_bcast_config(struct bt_bap_stream *stream, return 1; } +static void bap_stream_enable_link(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + struct iovec *metadata = user_data; + + bap_stream_metadata(stream, BT_ASCS_ENABLE, metadata, NULL, NULL); +} + static unsigned int bap_ucast_enable(struct bt_bap_stream *stream, bool enable_links, struct iovec *data, bt_bap_stream_func_t func, @@ -1821,9 +1848,7 @@ static unsigned int bap_ucast_enable(struct bt_bap_stream *stream, if (!ret || !enable_links) return ret; - if (stream->link) - bap_stream_metadata(stream->link, BT_ASCS_ENABLE, data, - NULL, NULL); + queue_foreach(stream->links, bap_stream_enable_link, data); return ret; } @@ -1872,6 +1897,13 @@ static unsigned int bap_ucast_start(struct bt_bap_stream *stream, return req->id; } +static void bap_stream_disable_link(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + + bt_bap_stream_disable(stream, false, NULL, NULL); +} + static unsigned int bap_ucast_disable(struct bt_bap_stream *stream, bool disable_links, bt_bap_stream_func_t func, @@ -1895,7 +1927,7 @@ static unsigned int bap_ucast_disable(struct bt_bap_stream *stream, } if (disable_links) - bt_bap_stream_disable(stream->link, false, NULL, NULL); + queue_foreach(stream->links, bap_stream_disable_link, NULL); return req->id; } @@ -2327,18 +2359,30 @@ static struct bt_bap_stream_io *stream_io_new(struct bt_bap *bap, int fd) return stream_io_ref(sio); } +static void stream_find_io(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + struct bt_bap_stream_io **io = user_data; + + if (*io) + return; + + *io = stream->io; +} + static struct bt_bap_stream_io *stream_get_io(struct bt_bap_stream *stream) { + struct bt_bap_stream_io *io = NULL; + if (!stream) return NULL; if (stream->io) return stream->io; - if (stream->link) - return stream->link->io; + queue_foreach(stream->links, stream_find_io, &io); - return NULL; + return io; } static bool stream_io_disconnected(struct io *io, void *user_data); @@ -5846,8 +5890,7 @@ bool bt_bap_stream_set_io(struct bt_bap_stream *stream, int fd) bap_stream_set_io(stream, INT_TO_PTR(fd)); - if (stream->link) - bap_stream_set_io(stream->link, INT_TO_PTR(fd)); + queue_foreach(stream->links, bap_stream_set_io, INT_TO_PTR(fd)); return true; } @@ -5902,7 +5945,8 @@ int bt_bap_stream_io_link(struct bt_bap_stream *stream, bap = stream->bap; - if (stream->link || link->link) + if (queue_find(stream->links, NULL, link) || + queue_find(link->links, NULL, stream)) return -EALREADY; if (stream->client != link->client || @@ -5911,8 +5955,14 @@ int bt_bap_stream_io_link(struct bt_bap_stream *stream, stream->ep->dir == link->ep->dir) return -EINVAL; - stream->link = link; - link->link = stream; + if (!stream->links) + stream->links = queue_new(); + + if (!link->links) + link->links = queue_new(); + + queue_push_tail(stream->links, link); + queue_push_tail(link->links, stream); /* Link IOs if already set on stream/link */ if (stream->io && !link->io) @@ -5925,12 +5975,12 @@ int bt_bap_stream_io_link(struct bt_bap_stream *stream, return 0; } -struct bt_bap_stream *bt_bap_stream_io_get_link(struct bt_bap_stream *stream) +struct queue *bt_bap_stream_io_get_links(struct bt_bap_stream *stream) { if (!stream) return NULL; - return stream->link; + return stream->links; } static void bap_stream_get_in_qos(void *data, void *user_data) @@ -5973,11 +6023,11 @@ bool bt_bap_stream_io_get_qos(struct bt_bap_stream *stream, switch (stream->ep->dir) { case BT_BAP_SOURCE: bap_stream_get_in_qos(stream, in); - bap_stream_get_out_qos(stream->link, out); + queue_foreach(stream->links, bap_stream_get_out_qos, out); break; case BT_BAP_SINK: bap_stream_get_out_qos(stream, out); - bap_stream_get_in_qos(stream->link, in); + queue_foreach(stream->links, bap_stream_get_in_qos, in); break; default: return false; @@ -5988,6 +6038,14 @@ bool bt_bap_stream_io_get_qos(struct bt_bap_stream *stream, return in && out; } +static void bap_stream_get_dir(void *data, void *user_data) +{ + struct bt_bap_stream *stream = data; + uint8_t *dir = user_data; + + *dir |= stream->ep->dir; +} + uint8_t bt_bap_stream_io_dir(struct bt_bap_stream *stream) { uint8_t dir; @@ -6007,8 +6065,7 @@ uint8_t bt_bap_stream_io_dir(struct bt_bap_stream *stream) } - if (stream->link) - dir |= stream->link->ep->dir; + queue_foreach(stream->links, bap_stream_get_dir, &dir); return dir; } @@ -6043,7 +6100,8 @@ int bt_bap_stream_io_connecting(struct bt_bap_stream *stream, int fd) return -EINVAL; bap_stream_io_connecting(stream, INT_TO_PTR(fd)); - bap_stream_io_connecting(stream->link, INT_TO_PTR(fd)); + + queue_foreach(stream->links, bap_stream_io_connecting, INT_TO_PTR(fd)); return 0; } diff --git a/src/shared/bap.h b/src/shared/bap.h index bf928bc2d..cd5ea2eba 100644 --- a/src/shared/bap.h +++ b/src/shared/bap.h @@ -231,7 +231,7 @@ int bt_bap_stream_cancel(struct bt_bap_stream *stream, unsigned int id); int bt_bap_stream_io_link(struct bt_bap_stream *stream, struct bt_bap_stream *link); -struct bt_bap_stream *bt_bap_stream_io_get_link(struct bt_bap_stream *stream); +struct queue *bt_bap_stream_io_get_links(struct bt_bap_stream *stream); bool bt_bap_stream_io_get_qos(struct bt_bap_stream *stream, struct bt_bap_qos **in, struct bt_bap_qos **out); From patchwork Thu Oct 24 11:02:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 838217 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2060.outbound.protection.outlook.com [40.107.249.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C04F1C9B68 for ; Thu, 24 Oct 2024 11:03:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729767786; cv=fail; b=X7AU/guhO2DuWiyoIvpXDw90asH3gp4NXrdz+MWjQFvw/FrMtkHTgVVC9RCbEVjGavhvUAdSL63nZVUBWcoGtOZ4o5BTjiPJWcvDwAGyU6+uZs6E+hkr/VHMk7TU/EKms2T0J0/x6YeiKiT6QsZ2/HcsbZBPVolkiEZJHy7wRGM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729767786; c=relaxed/simple; bh=+YJ4lQkKR64sWBWXE1mQtWFPDnweSL6VRli84jxYYls=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=tYDZoBXHzqPHfCuzVpc2WAoHVIe8no0Oihz4TSMkU2gaA0l6c+GOTRl5KqGI/d7SSWAjD8n+OMb9B8iRtvhMoxp3LHFT/NnBBNdzS7d/612Kk8d0jmPtitKTFe1Q/yMP7ZtuJKInvMccVsEXD/jAL1K4YQLHEskCoJ6mhAEz4Xc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=Ru7FmxWd; arc=fail smtp.client-ip=40.107.249.60 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="Ru7FmxWd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bT6bWQTWA9TY88oThZ1owW6sjBHFhN+IWJQBurm+voNFU2XNVc/EDhmvxFoA51DDcfiDLzSDxFOhb6H3FTvsk9cJDBlQAbiiAsmaEr+RjbS2W5p9/7SSk3BL7yLJGwF27EM/C5ODWM615BSlN7GPi+72C+XheImuDoULiUBRc3Yy4Adj2XqmKYG1xjz0kWmGHHKDfwKzYMbyQ5TC8eHEkxbUXp3upm5EH9Iq3698EYPdDLkdX3m9/jJN5LBXNMFvqAwvQl17qJN7XMHUwdDnMDjG4mq9/Jdx5vzua/tE8w+YlBhvKm+qCCc/d4uIijVV78onzahxQc4zbaadx478Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CeQS4U5MDyh0ZG/10HnEvqs8K/O7Tkj+eucr6oAqRIw=; b=y7BNI37FzXQyQc9rtMad8FVOqzBXStthzKxR4o/wehFYT10VCfwGZ0+c3QK2JxVfs/XE86g7WCXkcRzouJanAowFgMy5uobQTE+Awi4TEGEtqPqD3+F68GDjjkTyMJx7k+18+95w/M+TgPANQ1wXD05maAEcC12wkacIixdNkAlUDtfB7/tDjf0BmGzFQRKVC+EfufbqjBVPvKcPRb/F81cwiCixddwrsX3aNDSNvPf5PacHNYyE40ONhQfNF8Sy72qqUlZrf39tPUCRW0GFF4Q27pl1d96gGSo5au/pTeNEvZVs6MphYfivooXJwT6P8CNPEzqiiWbkbK2snsL7EQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CeQS4U5MDyh0ZG/10HnEvqs8K/O7Tkj+eucr6oAqRIw=; b=Ru7FmxWdBtoo3rNR5ObnAYjuhdleYGfxAplzA3WjmlyvaezHKSU0TrxcanT+8mZltWBudDNVziMaWeVlcDCcQ3wbL+U0SIBwOOWKC5F/4qF2MTzPW0ExUOMVncHLqEw1NMrosaXjM4Rb+OsQehqW92H1qF3hjYulo55NGGYW5/5v76vuMKb8ax2uZIupGgdA13won8cHeFDb7uDQ5PeFw+fPbCDePiEKLNZMyzL395kAwXF6Ki5+SYV3MOrVzyeDd4lmsD4DpA0H0P+4OD/gZIylytmJ3FTAlnP/SwIe+omWpneHKxGC944I0R2IRoeeVN89qaTLXqg1jSe6SyJ85A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by AS4PR04MB9622.eurprd04.prod.outlook.com (2603:10a6:20b:4cc::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.26; Thu, 24 Oct 2024 11:02:56 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%4]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 11:02:56 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 03/14] shared/bap: Fix broadcast set state Date: Thu, 24 Oct 2024 14:02:12 +0300 Message-ID: <20241024110223.77254-4-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241024110223.77254-1-iulia.tanasescu@nxp.com> References: <20241024110223.77254-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AS4PR09CA0018.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::6) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|AS4PR04MB9622:EE_ X-MS-Office365-Filtering-Correlation-Id: 01739cd7-f742-4d39-9a22-08dcf41b6a55 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: nakkLaUt3sjzVgnvDy1T5syhTJd89zhbP+3CtXdCLRoW0rTLNOPkYAg4LmcC6OKf04wi8gCzIIxvpSAK/+MLKsqBvpsHREDbXAeLwIJz2vk+u+5l6SrAl2hL5r42g0QFbJOk+Q4Fr0NqzvBDcaYsUBp9Kp3/6b0BmUzgegK4Yq3WF/q4JHSR6gybUngbHgneTVOA0rjLkecZzaXV1Pubje0EDxZaEks2FbiaftBQ88/gONHQjTweb52Mg8bt3CTcgDNMkqD9D9z2rDQiVbJFba911Pw6YOX+gh9ewjx3Tvpxwy8qM4S7sZ4NK0y7kabZI3sV02xOQw79csJjVUryYNzwLvhmPiogRfcJHtLJjYRGCT36W3yzGNxeeX+BK2PkB5T3Y+qqGDXTSSelM1MTme5ShaJPZEQpEtCcxF0EYc+njwkl1NgTSwU/vSpcJiRAZCNR8I3egAoGWfJ/es8mJ9iuqgfXTSGWeLeUBFpe8oARckJJfOyGwl+J/P4G5CXqxpD7K4G1nYKStaxJf38Sm8rcA/FOYXM3G1RBRzMp8PkpYbPkqOR75IViwanEO2LmHFjbA8Og9nTpHrLUE+ncypD6Lice8yXZ7fcNVthd4C8m8Mp8J58qa9tc6yyGKzCYfF2kIsMMUF4bZp3Kl8LZYHbv/rndv5veP+BMbt9jwvL/iUXmP6VFrddUclikB/NdRsgdDw7jPFPIhCt2RSmZauunJTrvPSHsbxNonSN/URSqSDNXxG4ZLpmq+UKowTL1ep1qH/9nJWHkkivHw8Vlyl6RurOPk6Hw3/Hed1zDo32DJSz+O4ki6YWTSJMTXPn/bkq3wCHBPCjZWmlDyCMy9OKiqUwn4B7M8WI4K98ozTIjZiXLF4B96w+S4xDUizTBPuCI4yofgjGndy6kR5Sih4mQ3riwkyD2Cx6l8PasETLhAPePxy0sFQizi2+sHpRlBySnW6+hXaESdjdaS+enLAous4v6A6W7ApPx793yPoU8mrWJZ+sW21KTsYkuVS9j0hxlcquWWlDScLHvUWzuPm+nI1ioPHEZMQ4nR1+2W56alPpYuRzIzdzcLTDvGjUK8lqG5iDVSZCgrugyADN+43z2ZdyITulxeidFfbFuUE9ZVbRVGE0Pcc1Xk6AoauGSwtkKoWvjTpGyTx4rUnUXELFULnXlrMFkMUpq5fd8RJwV14w7MS6s9jUlchnlK8CRdjDmrzNA5MJWyTM2Yh9qznscQWVPNuWpXahjwB9UFSy94rsFOwJXnJZrxbVZS6OSkH0lSxocOjne0hCL3n4pdpzMQQ0K7DmfhmlDAK2lvawEy37e2rVt7Oql5J1WH7yYkb6xu9iciK6U2WS2dHliTR/zrmr9UlKL+z2t3r11y+c= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8898.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(376014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: VdPiMVVMlAtFrnLG0Bxte3Vd8HajxSkh9tZrK9GhTct0kKTxHjVQDYZjeWKtITVmNQ1wYQZSHS7Z7kU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8kC3EMMqFxP/vYwlN9OaQXiEFZGnHCHT4dkLtGl0w+CF3BK1QPdItqgL10OpxtzvlOO1As1SY3CnBq+1M+t/ES0dd+OYsj1gp5C1UUZ7htlHh4oRBme9bpiLpriGWCfIndJrJOsuoOAJ0tdgOkPiaWD6dRiTBBNnYRBk8barhQEFLO6XayQ2Qvdv7Hddc8NCo2zYbT0oATYFgOnU184b5IsbSsq5U2XGd2AUPjmMORekpKbIN1zPUzqE2TW18Gg0K2VoY0ekhsldjwNHuUWyrSo7/+fdsm3PZoEVrRRNMCQY/PSi5LtYkiNIT+cEhl7x/nTKigAPePBq8X3V7qhY5Py1CXq285EeADuwcsvYORIVETpqjXDFrBvKry1ow+6ThL1eUaIkdRmjM0xehyAqwGo3DBxLHqIdwZ1SKWabzBhfQGSJ4JDHOLhe94iCO7H0q1LsdFDIPREv7UCG2JQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01739cd7-f742-4d39-9a22-08dcf41b6a55 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 11:02:56.6136 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ogp4ckKgsc0U4K9KHy0h5TbYuKJqHpb4VXylu5o1Ea0PJv0SBafJxNPKMIdICk/QQZ6fZh14SELQqwOcVolUDg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9622 When a stream changes state, the update is notified to other drivers that registered a state changed callback. These callbacks might further change the stream state, leading to the stream being freed. To avoid use after free errors post notifications, this commit adds support to ref/unref streams, to make sure that the stream is kept alive until all processing is completed. This also updates the switch condition post notifications, to handle the stream based on its current state. --- src/shared/bap.c | 45 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index ddf8ab84d..46ed490d1 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -262,6 +262,7 @@ struct bt_bap_stream_ops { }; struct bt_bap_stream { + int ref_count; struct bt_bap *bap; struct bt_bap_endpoint *ep; struct bt_bap_pac *lpac; @@ -1204,6 +1205,17 @@ static void bap_abort_stream_req(struct bt_bap *bap, queue_remove_all(bap->reqs, match_req_stream, stream, bap_req_abort); } +static void bt_bap_stream_unref(struct bt_bap_stream *stream) +{ + if (!stream) + return; + + if (__sync_sub_and_fetch(&stream->ref_count, 1)) + return; + + bap_stream_free(stream); +} + static void bap_ucast_detach(struct bt_bap_stream *stream) { struct bt_bap_endpoint *ep = stream->ep; @@ -1220,7 +1232,7 @@ static void bap_ucast_detach(struct bt_bap_stream *stream) stream->ep = NULL; ep->stream = NULL; - bap_stream_free(stream); + bt_bap_stream_unref(stream); } static void bap_bcast_src_detach(struct bt_bap_stream *stream) @@ -1238,7 +1250,7 @@ static void bap_bcast_src_detach(struct bt_bap_stream *stream) stream->ep = NULL; ep->stream = NULL; - bap_stream_free(stream); + bt_bap_stream_unref(stream); } static void bap_bcast_sink_detach(struct bt_bap_stream *stream) @@ -1248,7 +1260,7 @@ static void bap_bcast_sink_detach(struct bt_bap_stream *stream) queue_remove(stream->bap->streams, stream); bap_stream_clear_cfm(stream); - bap_stream_free(stream); + bt_bap_stream_unref(stream); } static bool bap_stream_io_link(const void *data, const void *user_data) @@ -2115,6 +2127,16 @@ static unsigned int bap_ucast_release(struct bt_bap_stream *stream, return req->id; } +static struct bt_bap_stream *bt_bap_stream_ref(struct bt_bap_stream *stream) +{ + if (!stream) + return NULL; + + __sync_fetch_and_add(&stream->ref_count, 1); + + return stream; +} + static void bap_bcast_set_state(struct bt_bap_stream *stream, uint8_t state) { struct bt_bap *bap = stream->bap; @@ -2123,6 +2145,8 @@ static void bap_bcast_set_state(struct bt_bap_stream *stream, uint8_t state) stream->old_state = stream->state; stream->state = state; + bt_bap_stream_ref(stream); + DBG(bap, "stream %p dir 0x%02x: %s -> %s", stream, bt_bap_stream_get_dir(stream), bt_bap_stream_statestr(stream->old_state), @@ -2138,7 +2162,7 @@ static void bap_bcast_set_state(struct bt_bap_stream *stream, uint8_t state) } /* Post notification updates */ - switch (state) { + switch (stream->state) { case BT_ASCS_ASE_STATE_IDLE: if (stream->ops && stream->ops->detach) stream->ops->detach(stream); @@ -2148,6 +2172,8 @@ static void bap_bcast_set_state(struct bt_bap_stream *stream, uint8_t state) stream_set_state(stream, BT_BAP_STREAM_STATE_IDLE); break; } + + bt_bap_stream_unref(stream); } static unsigned int bap_bcast_get_state(struct bt_bap_stream *stream) @@ -2544,7 +2570,7 @@ static struct bt_bap_stream *bap_stream_new(struct bt_bap *bap, queue_push_tail(bap->streams, stream); - return stream; + return bt_bap_stream_ref(stream); } static struct bt_bap_stream_io *stream_io_ref(struct bt_bap_stream_io *io) @@ -4145,6 +4171,13 @@ static void bap_detached(void *data, void *user_data) cb->detached(bap, cb->user_data); } +static void bap_stream_unref(void *data) +{ + struct bt_bap_stream *stream = data; + + bt_bap_stream_unref(stream); +} + static void bap_free(void *data) { struct bt_bap *bap = data; @@ -4163,7 +4196,7 @@ static void bap_free(void *data) queue_destroy(bap->reqs, bap_req_free); queue_destroy(bap->notify, NULL); - queue_destroy(bap->streams, bap_stream_free); + queue_destroy(bap->streams, bap_stream_unref); free(bap); } From patchwork Thu Oct 24 11:02:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 838216 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011044.outbound.protection.outlook.com [52.101.70.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 804141C174A for ; Thu, 24 Oct 2024 11:03:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729767790; cv=fail; b=BQfvljfFeH5NNfwHhyrowZ5rVJMMyb+Mr9OTm0MK/B4UiZQFKonhnQvWNN6dDdIk+UH3u4qlgauGZxXoLDQY3ejJQ+Sf8F0B8NSBEF0cuvzkTwPIDDZcWEtbnOyPfo/t/N/x2yO2As6o+7rf9fi6BDWJB0aaYaNVQ7AsUp30/6o= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729767790; c=relaxed/simple; bh=ZFFXxRCSf9Jx4GbQa2m//6EfaqXcj+5DDEi+eCi7Slo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=RtIbm76BN/clRMiOZDZOfS6RMFTBxS1YKfxyWPEQBYIx4bVk3DqNL62z9OtCRsuie4z8zf6b7bVjgaSIMLlVe6kjxBn25MT0lGwhyb5kYHS3OWEOCbNkNcDmoO5oDZb0kdXs2H+8TI2Fr2Ts6qeb6utm7YrM63XvDBntk+PLjlY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=HhCaDyIk; arc=fail smtp.client-ip=52.101.70.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="HhCaDyIk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CbB8nuNAbrdSXjSVhzMPPE/EcqzYhyVyTAugQe+LiLWLspgsfVTyYsUUdws0nwmH/rDUddyswsz7usp736pGIXRkI0mzh65cthYm2SEJBjR5FCGo1owtZ0jx3dnPmpXxahzEw37ga/n3TjMiWdziM9I72xN6QGeZDEDKGYkO4gjrqgytmAcoTdljOJeTyC29Zg82VMNoRD2SSOEtYIb9hx1dgDHMgMWYbpDATwWBTFiCVd+7Xr7ZR1MNwmHl0WZcyyzNq5Uz5FxixWK8PNxOCPQieQBKwRHBEGIDWmuoaMLBXIhzXKQIw257nE/F4ktzLq6nlr0bFbS1DljL9z0G8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E/70KQ7Y2mqGgTXupXPGpsWqexp8myFutK+mNYzAWdU=; b=fU3nbXmjNVE5sT/iuplNyde2Up/ZD6x/mPrMlPo9RvGazBIP2+Si0sOvKLtebG037mljGO4YHdFsyQSQnDLLk0h3G5qqEBgFfZNnYGQ3wL5lpxjXrX3JI0mzEgHfWjFBOwdytQD1O0hKS6OQuXxNkpe4xyuKYuGo0cmJgvj+KV215ysYDncYxjIg0ojyntEeFfLRqpZlAl+GKxPG5ctgqyzLCkh0iXqdvVvLNMAb7F8sATBt7+DN4CkMwGOXmsDM/wPXsZQnR2QLDmq8sYsB+H894Mu6J3EkIz1I3Kf7IzIrV0Kl76Yh06+Q6pPZ2lW7iLKC+XGcViPpXK/hqgLgyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E/70KQ7Y2mqGgTXupXPGpsWqexp8myFutK+mNYzAWdU=; b=HhCaDyIkQnrWkjrv33ZDR3RM7bR557mcI01B4WjAp8ddIHbJIWvNFh5cf5AdRVySHiinnW9SU85PlrD+tRbOku71PM/8xMqczh0S+z+oiML7tQpqoUPu/B63AkIW3Y6tYczcXRGfSJh5mPJMyGl9Cqe7MEA//rnc/jZtQJDRIlqEVeliSAZsZOS5JYKyLmvt00HyW0il1Pyz5oU78advTBDUI8vaor8Xvx+5e2XQXDBLKW3QwFxdey8Yih/Qs/IAYEz6gg4eDJ/Ef1TrdAaWn1dWeuOtq0ptVvwN2ATXgQff+UAZi6rErCDbnKHj8SlhBxFc5+stC9g/yzeENvPkzQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by DB9PR04MB9964.eurprd04.prod.outlook.com (2603:10a6:10:4c1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Thu, 24 Oct 2024 11:03:04 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%4]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 11:03:04 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 08/14] transport: Add Links property for broadcast transports Date: Thu, 24 Oct 2024 14:02:17 +0300 Message-ID: <20241024110223.77254-9-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241024110223.77254-1-iulia.tanasescu@nxp.com> References: <20241024110223.77254-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AS4PR09CA0018.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::6) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|DB9PR04MB9964:EE_ X-MS-Office365-Filtering-Correlation-Id: 462c239a-c986-487e-7938-08dcf41b6f34 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: HxYeRwCqRmZ/Ng3xYJAG6lSC4v7Bftkyw4wNYdF35hLiVbhnceS4M3iofGBduluXA4N++lVIbTHdrbgDL3ECQogA3Ug4/BD7K/s7nHyepVXKZIfRxQCzFuOInBYr3paOh7Kji/9cJaz/nYAYmMvSVNJsjc8dUiY/oNEf4XrMu+Nz3kL1xv9PRKXjG05uBsNRChFN2M5NbIGDVnI4659MWvSWWR8Bu2w9taCQR2H3TiyK4bvBkFKdI23IQdPzFEU27bnEHbI5LHvrb4C5gBHwDegYHGUzxetAVgzwoEAFQnv2OEsUAzU8kLHsSASJFGCqHFNBvMh4RVSxXXoMhyNCjK6WbJHgeTUnTgLl9OTPWAYfD8+DgUoQbPgf8kJXZJSzmM835yVrQCwsgLMe9MbDUvY12S8D/c1zRH6tI6i459hYkRxLuHThTq3tWAhxVldoo45IscTYizjyNOPyAdC5dmtanlwEhVtr1mKFDrk86SM0TqvpkYSghrm4ix0HRe/VP78qd5qSrQkM754YSYU70Fj/ZqPjHkf6IR3aifjkmsU3PWuixMbmoVMHL5LB8O21fu/c+IQHRhSY0OlkOB+7viYN+zmkrerrBzbG4DQq8G34/YehhiX3YWfLhhcGsBqJ9jSaqqhEhskOQLlPFnVtFwjzWKOS8sejjnZbw3fZ/Yio65VjOPJvqlwwDR6SZFlSHyHw1scMmGA2JwWjNpVvNyCCdZMYZt9DsGNPPu2I1LRDVHI8bjGoa/QtUvPUT/DqpmPaJqocYACoQLrjFb+q6Ez8szNGx9CCnmRx+eTC/mF73iyRHUvtOic7UpfQsoZQC2LhmQRZzc2HXcw62BtDhWevj8lF319RgoNNNZzL64YBWbtZfbEJYDyU+itegW1x+PYJejREt2+I3MylJKIGXQSTnCpAkhM3iG0rAgAYRqLMGAzV2OPabBnIOxptsEYocHZax0DrAOL+fHsSdUyQo7e79SS0MsSy5NnjuZRTJfrirQO0Ox0R8N258NAI7ycVKmTzMvd8yfK+rCV+HD7aScwS/J+c6i8rKs/MJ45xfwHcm+U3M0Py1C7qE28IKI6DUc6UxOgsSyhA1GH28Af87jUATQHsKqoDEaKZ/7XTvbBIgaAsFtfsFNCpAQrT90g0tgM8bWRvWGehqtxfHJfl1NZLqGOYKZDHsHnkc2wL0rwasTB0AP6TkwyjNozhvO9V4N+iPAIT+WK4Bf0LedqVkPzaIDNVhqfn60JjSuEjqlg6Y/L2x80UeziWxdQ/fNQ14zCJGqeUTeJ72HnXMqGv9YxBaA5zhRPs823MqxiUqnNnB4VecaPBLIbmW+T/DXiUHe9Xto/Iuzgltoesh7N8QHgG7ISEFgdnBIOeHvTMh5I= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8898.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(366016)(1800799024)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a1V117PotcbwDSyWUCyOSTKTgROTKJqzMeApJCTT4pcsoyNhOJ9Bd386IdmDpodfsndC7SFhAQmm56hYPqraldkd1fMn+4eRp6i+QknBykWNX02f19hJ3+NuDFgLhMMs/pEX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NG9bbpNiY4fow9544wx6KnOrqETodjTPW72mtgnQSrelgM1k+jkNEzM67U+6j4TpxmYc9X3eV3qKtYU2HPRVv6g+j2EB4DJ+GK4ZOqp7HCUrbAWCRGPWXI+PobAYABZQBDkvKeqQCJo92TYAypVdc6g5AaKr5LR66L4dyB7OjVXRqVPOYl5NdNyDbB4qFjSzVSFxlPxVwmbYcUn7sE5O9345A9AQT6RndBjw3cXGI84+Lu5wKOIUzi7zZFJIlO/9vYDm6jjCmkDAwNcttgNgSy1ErZZSicblD2QY0gBn3L60o27UdOWa53uOv3+skS6T/PyqPyM5rJadKKBen2NHGcsGL565b8vRYWirGn8JWbzV59IpKwggq+SZ2PApxSileU3ao7JdbbXKiofkCz0wePVoyQA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 462c239a-c986-487e-7938-08dcf41b6f34 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 11:03:04.7786 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: B3mikXwvDGFXhL/YM98vG2eXTJLnLXzdF2q5EMn0gLpwLZvm7aUEsdmqX4DrERB1P17OyNHTSnxRYK60vrBs+g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9964 This adds the "Links" property for broadcast transports, which allows upper layer applications to write and link transports together. --- profiles/audio/transport.c | 62 +++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index dafd1c471..b3bcbaa19 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -183,7 +183,8 @@ find_transport_by_bap_stream(const struct bt_bap_stream *stream) struct bap_transport *bap; if (strcasecmp(uuid, PAC_SINK_UUID) && - strcasecmp(uuid, PAC_SOURCE_UUID)) + strcasecmp(uuid, PAC_SOURCE_UUID) && + strcasecmp(uuid, BAA_SERVICE_UUID)) continue; bap = transport->data; @@ -1142,6 +1143,64 @@ static gboolean get_links(const GDBusPropertyTable *property, return TRUE; } +static struct media_transport *find_transport_by_path(const char *path) +{ + GSList *l; + + for (l = transports; l; l = g_slist_next(l)) { + struct media_transport *transport = l->data; + + if (g_str_equal(path, transport->path)) + return transport; + } + + return NULL; +} + +static void set_links(const GDBusPropertyTable *property, + DBusMessageIter *iter, + GDBusPendingPropertySet id, void *user_data) +{ + struct media_transport *transport = user_data; + struct bap_transport *bap = transport->data; + DBusMessageIter array; + + if (dbus_message_iter_get_arg_type(iter) != DBUS_TYPE_ARRAY) { + g_dbus_pending_property_error(id, + ERROR_INTERFACE ".InvalidArguments", + "Invalid arguments in method call"); + return; + } + + dbus_message_iter_recurse(iter, &array); + + while (dbus_message_iter_get_arg_type(&array) == + DBUS_TYPE_OBJECT_PATH) { + struct media_transport *link; + struct bap_transport *bap_link; + const char *path; + + dbus_message_iter_get_basic(&array, &path); + + link = find_transport_by_path(path); + if (!link) { + g_dbus_pending_property_error(id, + ERROR_INTERFACE ".InvalidArguments", + "Invalid arguments in method call"); + return; + } + + bap_link = link->data; + + /* Link stream */ + bt_bap_stream_io_link(bap->stream, bap_link->stream); + + dbus_message_iter_next(&array); + } + + g_dbus_pending_property_success(id); +} + static gboolean qos_ucast_exists(const GDBusPropertyTable *property, void *data) { struct media_transport *transport = data; @@ -1295,6 +1354,7 @@ static const GDBusPropertyTable transport_bap_bc_properties[] = { { "Endpoint", "o", get_endpoint, NULL, endpoint_exists }, { "Location", "u", get_location }, { "Metadata", "ay", get_metadata }, + { "Links", "ao", get_links, set_links, NULL }, { } }; From patchwork Thu Oct 24 11:02:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 838215 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011044.outbound.protection.outlook.com [52.101.70.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29B3B1CACE9 for ; Thu, 24 Oct 2024 11:03:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729767793; cv=fail; b=bEXjRuXs6vnq7s9sy/baQhqvBmyo1WeZbrE3PpxTZnYMAwLXqsfR28nwWtD1tqKDkK8EQSVn109A5rJ2rihfFCH+aea7hTpSKPtPGInrB/QKrlWC8bEN2ZBcVKefESN3kXRY/Ttv4fjsm/nU9kYD0S7+OoTBy2F1CnFf6rA9I6w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729767793; c=relaxed/simple; bh=riagUk8Xxr0Cktzk4sHScUpvK/r5x0fMe64DRNDzWgU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=ZpSn+Qukpi2/6YCtGqolbFe5tGU6l2G81FjcsZNQOnqArMA3Y8L9IvsXQaanslMxFtNNmTsE//i4XY54wqKpTEZXcGQSHeo0VrwOpyu8ypHySFycqzZj0+rZk0MgS6W7mJZ1kO236VEuX+WObPWB7gKSKwNkFiCNgpPyk2WRrN4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=bJEGPmbL; arc=fail smtp.client-ip=52.101.70.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="bJEGPmbL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Xq7zjcnEW+VQJjdQXtmaMbXX+t1Y32QhcJQhtXcQxXY7eJPab+6UAKNnKzBEDguiZda/c7AU34M+MnjivS07enIfyJQCqkqWwFKbTOH2pHQnFrhBsannGGrHBgFmnne4Xg5C6MCf6MTEEYyNZCLZ2z3+MPeQGV/wRteQXSlR2qNHlLddPlYEExnQPArMM6L95mW+H6+wEcYLiDwfYDdEIeEk+pgD3k8WyaPvfkKlU6hbOvvPyuW1AwPGoZ8A+qVKqME9IgM8HHfaqToxk8KFcYjZjYW8PhpT3hejrcMjlnhfIDjbE09MoLLyY89t2lTZ/A/qeM8obLoLoAYIJt9eiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0NhqylQQdv+u6MmA4OBs5PD9do0FH9Ogit451oRFxG8=; b=ipNEs8MFOrBj41NJrs+Ft3XykHYD64e9H3CVe9sx+rlHY3/oKkkrYeO7iPgXdoAyB+fgaeaifpBkmc5j5PFlyG73+iZDPSX92S8UvfUxw5wzx1Z3OP0xNhJO/fMEsmA5ilBtFdkBRe/AgNuLuuFnfD14EkR53mNkxGKTOYxSfLEUFzhZjeTDqRXi+iNm0tVWCLoxxk6HVnX2qAdsoIotThawWuMo7/noTe0iDrffVuMqgGre6oLy1DUV7qWkQBvBp6vjtT5U8YZFn3eA6PnnWGg73hZIprbb5yioMNYngOaIuEdAqMIRxZIO/ojHIQqKNGTXMZZtwI0sjzySJgeNxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0NhqylQQdv+u6MmA4OBs5PD9do0FH9Ogit451oRFxG8=; b=bJEGPmbLoUhlbSHrK/vPDyBy/g3QwsCCIZhNlAutp7plnoiszyCRmJTuQx8/VcjTnYS8HLq7ebVUMsX9D4EL2RmrFIEDhqQ8NtouBw4Thj/1TSk6w580S4CJPYWS6vQa0OFk1SYSeey1fhgWEZA5uFifzWqZUOiiRL6P2Yfozfm3rA92J7YduCL/EJ37uqeOi9eGjof5TSjNse/FYmwXfumH0sAkOLQFxUrofmfb68fV4kS1Co6rWoY/XZ/ZKk3EBmqBAG2wBUx2XQSSQ8Z2onQKDkJXCSdXGomZnC24tOVvvkm46Hq4iscmSYjuoDTx19MXeLPtDzwLtZLIk8+E1A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by DB9PR04MB9964.eurprd04.prod.outlook.com (2603:10a6:10:4c1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Thu, 24 Oct 2024 11:03:06 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%4]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 11:03:06 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 09/14] doc/media: Update Links property for broadcast Date: Thu, 24 Oct 2024 14:02:18 +0300 Message-ID: <20241024110223.77254-10-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241024110223.77254-1-iulia.tanasescu@nxp.com> References: <20241024110223.77254-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AS4PR09CA0018.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::6) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|DB9PR04MB9964:EE_ X-MS-Office365-Filtering-Correlation-Id: 52fbcb76-b0e3-40da-daf3-08dcf41b7011 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: sWuOjT0ZKuK3NpMm3mzA0DS3qdtKd5GXHw83Z8IIGxdvNo+jFsGQ1WSlbhqQO8sMAE3PDbXTM9LMeMz2iGwqvCzouR3r2unLlgbc9Hrgakm5F76DuC7/ebYjOYhoLLZ1Ywpt0UuRy9qB4z9dkuP+h6FnHUVq8b1JKQP2U1B60TP7JQgk+0UZoDEEn93g87+C480dJrDgO8lmWd2ugDlnEsy/RR84Pgv7jjBm6Zfugenj/dZz0heKgwTo7DQVHNmOadgRYzM9rN525qD+/A7JNJy5GiTDh15Kxnu7TImevr1feNMlBVGbGTGH9U5lHxv0DTvAoAnby0XPLcsHizUwEHUWia8y8XsoYafDPbjLGQpV1B++96JS+5r+ZJHmaKih50et39jEGaYVpEUf4+WYFiba+HcBvcltUXgTo4movZLMjIYh32EO38+Wfy7oM5WdrMVbGqOubvr93EClHlcvC2KRtgRRSiJRXlEOX1+oBFruH4oUEdXtPbJpzs9BSvj4Q7ZRNqLfEbGWgG2lrR5CJ179tnyIuGUVyUMJR3RTGrMcIe4TVHqLUBbqgprOPpwCo8O6obs4aEL5mvcPkEwgWV0GhacIO/BvC6YApE7buIxciJcBreptESavIxGmdwQwdQANz/HdVnm78rXQkzb+zlkU7dVV0NGYQG4qBwMAbeWkcqLx/o+dVSgU05Kkmcpx/oW7RKDBQHuKzmseoNscYYlh6lO6CQVLRJif5gVXXKoD3Mylo9CvMBgY4zAPPobDi7p3fcusBnYG2EXeoGQxreGcxEACImMtg77MqXJEr67PiCZvv6Ao7LLNO+KXrrLqn04qM0UI9rqNvRONi3r8EyZEMzhaHTY7yJoTg2PKwrdtkAPa0q9NK/c6U0wvSX0xdbsne3QK1Sr+lB5TsPgIHfMrijS6I1jY09Of8MRNjXDuzwiBJwXg3pyR1VmSSFJR7Lgp4yOcc3XlZ292GfyApwwV7pyp5HOJQFK4f8nql3Yt0aH4lL8m2xFLGkIn4shOfAeaNH8B1MLwM8Yq2yN+68Nhuzq/csNb0US2Hr3yOYHCppQ098Q3LhWW4dd7whFAlTm1fZmx0jL7eRh4vPRq+69cEFa06UwNpn/B83XKNWf9g9FjygPV45KC3FHdTtvCpFWy6lUbFj9f46Mu/L/SecUYJ25P/y/wABonEkTuprJL7Ng9L5i+iA8cT5zcKCZrYdR39viVPCN7IxamSrljEKN7dSVnXAJA088RKPnHhe/BwkTVRtjlXxUnvVjcP+dP58Bvx5TIpD8MMpJ3Men+SCY/mpDWNgQhQRbrXvUIDBVaP6rht5DyjTD7/SNPcuMSe2oXyUmdlgiUtMG88W9S110NQAab+fc3xWA3Gq+aOIE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8898.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(366016)(1800799024)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Ex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w2cZ1yZZnaVoIUXshte7YBjnugNZ8cWbuN7b+ftXpOqpaH5dHk31U4MJRFEmFKNFIMEifIR68VauBBoeaCQLBmPvdCVhTkJwWneE559Icv/CNVg5T8TmFknqBy7jLkbftVHgWSC7aSU2Z8NlzCwqY2tTspEvUl02Zk/cqzquvSYsiDee+jbng+k9CuszS+4HbhP7UKeowd9OHjF9h8nGFSUhaZrNYvYeUMU6JE5n2H8PT1ZVBOKHTCznJdVKsgmRPEMYIoib1yLzBk2HhI9peokYXZNPgrqu4MfJL9ulgCzfzyp83Qtuyc8HbOlmS0T682Nb3iphZtcAX5Zczaz8i0KYtd6JwEBCOsfARl3Q/UEltMEcQOe1S0K31I1WjScV/bKh4NwuxIwU8ocm4neYoTYtetpHxNzGtZro70DkEpbi0LeQzS4c33YSIQ7/V1ouxwgv1/SxolSohzAQYDxZVGi6NsFeRO3QMfpOAkPAGNBQnYGwaG9sWhrRZeACKBpkr9eQ5pcEMBEQlyePK98NtMs3WpIGodxcinK8IBCy07TYxhM6z/VpdEH+0CGLwSKKqq43SYsk7Z9JGb2lM79kj6uoz9+qVA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52fbcb76-b0e3-40da-daf3-08dcf41b7011 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 11:03:06.2422 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UAcQ9o3aLjU9cfLf7JbgCTio9XYBOks7AZG0V/xlRpS7Os0er7BdZMc15VoSVKA5oz1yq0hQk9n7qP9zr6r/bw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9964 This adds details about the "Links" property for broadcast. --- doc/org.bluez.MediaTransport.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/org.bluez.MediaTransport.rst b/doc/org.bluez.MediaTransport.rst index 4d998b2a8..2173e0177 100644 --- a/doc/org.bluez.MediaTransport.rst +++ b/doc/org.bluez.MediaTransport.rst @@ -149,6 +149,9 @@ array{object} Links [readonly, optional, ISO only, experimental] Linked transport objects which the transport is associated with. + For Broadcast transports, the property is writable and it is + not optional. + dict QoS [readwrite, optional, ISO only, experimental] `````````````````````````````````````````````````````` From patchwork Thu Oct 24 11:02:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 838214 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011044.outbound.protection.outlook.com [52.101.70.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AFBAC1CACC9 for ; Thu, 24 Oct 2024 11:03:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729767796; cv=fail; b=GW1q7OQjOat7HlwHe1Mk5vndiIYqqHbG7a5GWN5G5xJFuQvxB13gXaSJoasax+9mL2ugOSlNIsbjRCArbPJ/ySAVdrTm/ws0xQzcrYcuXse/RHiGdGxkSy6cJ+jpoYuU/X5IgQ/QfPGgALMV+fqfGVNaWBHAHolVdZt9zCOM6sU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729767796; c=relaxed/simple; bh=DBjw1HuhG9Hc1TTXpFthYCiqbR6nNuTPlts6WlPno80=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=t76jw4AwSO2rYXOhrie46iFi2u/Lp0QyZdcale5uk2LcLu1IgOuLNO6i3Aj5kbpTFCEnjwS6so4G/5PytB1euKbw0CuH7I5zfoYriPftbYeiMghB1Q+478mPFFYsrDMc4CjSCqJX7Cd2efx/bJ4Jb0Fm4twfRWn7UnHa3NxCG+w= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=NasWlrkY; arc=fail smtp.client-ip=52.101.70.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="NasWlrkY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=F3/OrAAMG3bGE9TD61bs2Xr7/iFHiqqGehuUIN2IpJf0gGfGibAuzQO9eGb9qEuN3OxhsA3pK8TstfG3gqGnlwE6hbo9RXFMANkQSmjCFStJm3dLGlRayhl2VOFtosaK8N/DjJvOvgfsqecxsE5+MnpQaFcUQZ2YQD2uHcOg6JtHYbHitu3j2M3wRrSHoY1I0a6x3SwvhcW5fAwM2RuTt6yXVhntQ3kkICbHsDjsL6ZeTvNsDPZMU2WpAVEZePB8Re8tse8lINdiof1wUhYEBwlYMcSZl5HueG88y1wOykFS1yZbrt8DhYh5CBiJpIKt9X3R0h4d6Y9qKGqKaIDPOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kwWf7rVpAhkvNGcoWH8mWav+kcSOW7QebguyLx4xXQE=; b=wS3FcxWA7Nzn0G2DsIgIXRgnyIlPWBlIDk8Iz09Ndsw/BAVQ+zd8zXEWORps749GqJ67YD8K0hIBRR9vYll6/kq4UcHWLvTIo/KOLqXufbZmjgad7GmO2bna1lBjM3MxIEpK+ku1KT3M4BncHO82p3+tpQpkRqhkNKxQd3/nlfc8TTn+udGCXfnp/40zhbopaDAykhzd6gM0QzL2vfdnyl7ig7hZFw0T5+dFY8F7Fbz9Ou9qr10L3zvupSG3Hg/Mkh6gDdG5HFshr2z8sAaL15NkpvX6Q1IakLPGDwF+Bs4iftjV63V4Qw3U0PnCMdcmxzyC0HrkdkSvW51qAZczrA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kwWf7rVpAhkvNGcoWH8mWav+kcSOW7QebguyLx4xXQE=; b=NasWlrkYiEDMKToQ8Ruj7DT25iEyZCnww6d2AfC1NMxGDOcPYweA+0JQclngWMfMwqP0a+1/8zwlWI1Ya7mpUp2niBpxHNQN3vyO2WmHacZoV2uLk7i4H2XfN+tLzuV3JqWbLjZ47eBKgg4gxuq4Kv8g0cZ15qnpg22RmKX5NPI4I9h8G5ZDskvDmGan/bdSLOZ5hYwgNonGAOtF5qEgU6QeCeTtpvV0tcOdxJ9go+HB398XpgTtNr8kWIF/NPlDGNegyWCFjFK7u8PwGdI0vrWkYcLnS+25kDXaAEgChkXfFvm/4VyjjLh3pOy4cUIp1U/o2v3EfFPecM176/0WsQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by DB9PR04MB9964.eurprd04.prod.outlook.com (2603:10a6:10:4c1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Thu, 24 Oct 2024 11:03:07 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%4]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 11:03:07 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 10/14] transport: Set bap_update_links as transport op Date: Thu, 24 Oct 2024 14:02:19 +0300 Message-ID: <20241024110223.77254-11-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241024110223.77254-1-iulia.tanasescu@nxp.com> References: <20241024110223.77254-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AS4PR09CA0018.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::6) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|DB9PR04MB9964:EE_ X-MS-Office365-Filtering-Correlation-Id: 87f3a239-3597-4807-ce87-08dcf41b70e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: 5xiMTA7POO70Ht2wgJWS0VQsp7s7DRuRK/GUjHi9K9wL/qZ/orjn4s5aHHTl03TJfDgVMwDNatMjgrgN01KqLDAhLIw2N34gkCanIap7RUVuic652TJliP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SHjr0/i6pFFUGSpEPCkPbyiXMkkEL+7X/2UZcRduXAIImAc9uEM2FXGM35SFRPURb2Zh2/2noe5L8QGEVjY76ACCVEduAxtVN7CYrTyRzTsMJJyvmBxTVgf+Z1vwORk2uEIVh9S1aWtrqEjb3ojswq6iHPGo8nyIrxRPvXrQvdPjav5gixNB0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8898.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(366016)(1800799024)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eXRj7Ql6Z4joKw3/aN1VlaeW4LzIX+HaWDEH1vaxauvEy4Nqri0PtcrI1AbTU7gQRS15KkAvfWDp5/bM12QdHnrMrjjm5hoJG27bzB/EH8SjD9ZE3RznMmDrp+Icc/MSL2BYQYZMEE2bfI0QJOfxQdI5GZvbFEGYZiSdluhsdpw6VJk4V6mj9+xOfmtfjIJzP1wiBeOwU6jpKSBcZRMTSDw+9q47Rya3chchZKglf8U6IalA0V3lxoDC9n1KzK2n4vLfWPNlLJwfiiTKK5i1/LEVwP5V4VpJ2iZ3BHtJxYYg0MfmEi7Nb9YQN3c17rq+2IeE6vGYt8/AI5Mp/SAelE7DgWPvEETYzEw4RbMGRTc35noTLxJitlmGZFq7ohbA1bfnMTbqXffUjyzCbY8dbd7OmaRE7TXTSKPELw6rS/lloul4b7QsiPnzupQW5OWjo9QfdZDtumrFBbHdY2ErbijMFTuEgTsdjO+IkG4OMysTOAFcyAlUqn8eXL+vLYvtt7Dwk07McoqxcMIxhTQBQrs+5+yJscouKEzm43HbpPYUXOb32LTwed0MZinrarHFzbGtIuxOqGlSa1SSuZFga3jSYB3JP33bEEWx6Rerl62vNwl3BJvOVAZHi7XaA8jEzl2KNGhZmqoGfx4U0CdryKqdkeo2ZK3TTEjdd+6lBEtw/m7oCpI0nFYXgaePkS0v4RCIDSdUJ65nguFIc8GcMXPFoRs5OsKD3SNMPNIVRqSkI3jlviSJso42IbDwOVHM4LAUk3C0FEht3TXXW0/CufQB9psLxtGRhuzOHgCw3hpMDyC4E5k3hH9JtRk4NKHEeXX+km0NpYGyW7cSqqmPJy5gV5r/U5bQjbN1jYk7AX4oSfvCjs0/umDw2iCHxSKWBzCxyZER/YAEOYcDmAfvIzS1j38zZXKc74uBuYEz6venURzC9M5DaAkBd6PIeME/XQRS4ECmBothOqZTv+MZbF06/FLnjZRCpZcQ1o6KiWml8bmKddag8HnrNARJnoN46FXtyZ6HktNafKwMojZdMHfJOHQnx6dX0uyUx3zcRnXPVLHOadq7dblu0jeFIjyRv7bJT9vuCPorQr/OCWPgWbQSZoB8Ruua0sKM7cbYAlRyIY+BhWOoqhxZipqCg6fD/YYfTdxYUERyigmxYSkrcRbdZvC8+ebzpGUyCYmCN1rpMPTXunRB86xEhHhL19iShxT0X+zFiqkTplQY3E0x1nE/Ce1FbE/GNXDg7ofv8ov0HDd4kwSaefGmFRkRe8kd7xs+/XSqD6DdeSmnU0DJTIY3YFP3+pbXLmhb7XjdvfuLpThY4V6xN9BQcrk7rVYL+m6pKDCsYjEZx4C2/5cpGs/Lf0lv4sI41gM8HkBhnJvZY+7sV+fO79xEXkvCtR1hQkELadvWjFJ8Imi1hbRy3C4H4WdwjyW5Q7IIeo6hTlew9iaelvnBv6jTMm167PbCMSXtCJRVnS9/nhLMWmq1AFhqqDwkb09nVulxmeInhZAxfF6fbifwT4oriRwhwJgk+C94BeN6F1AZJ3pCu81rnyYAyN1z2j3UXHLYk7SN2sHF0ZXQ/vicvYUaD4UUBmN4668YPdYOHIu9HynzGvt0Zw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87f3a239-3597-4807-ce87-08dcf41b70e7 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 11:03:07.6801 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2vNAmALi7b5dWPyIQgL84P9FTV3og9w33kqbQ2D1Zb3tN/MEs4p1wqahQsPbYrwepLbv27FTpMXZKUGmVXC4Lg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9964 This implements bap_update_links as transport op, since broadcast links need to be handled differently for unicast, which only allows one link. For broadcast, the property changed signal should be emitted everytime a new link is added or removed. --- profiles/audio/transport.c | 45 +++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index b3bcbaa19..2f5ff6de0 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -116,6 +116,7 @@ struct media_transport_ops { void *(*get_stream)(struct media_transport *transport); int8_t (*get_volume)(struct media_transport *transport); int (*set_volume)(struct media_transport *transport, int8_t level); + void (*update_links)(const struct media_transport *transport); GDestroyNotify destroy; }; @@ -1628,7 +1629,8 @@ static bool match_link_transport(const void *data, const void *user_data) return true; } -static void bap_update_links(const struct media_transport *transport) +static void transport_bap_update_links_uc( + const struct media_transport *transport) { struct bap_transport *bap = transport->data; struct queue *links = bt_bap_stream_io_get_links(bap->stream); @@ -1651,6 +1653,30 @@ static void bap_update_links(const struct media_transport *transport) DBG("stream %p linked %s", bap->stream, bap->linked ? "true" : "false"); } +static void transport_bap_update_links_bc( + const struct media_transport *transport) +{ + struct bap_transport *bap = transport->data; + struct queue *links = bt_bap_stream_io_get_links(bap->stream); + + if (!queue_isempty(links)) + bap->linked = true; + else + bap->linked = false; + + g_dbus_emit_property_changed(btd_get_dbus_connection(), transport->path, + MEDIA_TRANSPORT_INTERFACE, + "Links"); + + DBG("stream %p linked %s", bap->stream, bap->linked ? "true" : "false"); +} + +static void bap_update_links(const struct media_transport *transport) +{ + if (transport->ops && transport->ops->update_links) + transport->ops->update_links(transport); +} + static void bap_update_qos(const struct media_transport *transport) { struct bap_transport *bap = transport->data; @@ -2105,7 +2131,7 @@ static void *transport_asha_init(struct media_transport *transport, void *data) #define TRANSPORT_OPS(_uuid, _props, _set_owner, _remove_owner, _init, \ _resume, _suspend, _cancel, _set_state, _get_stream, \ - _get_volume, _set_volume, _destroy) \ + _get_volume, _set_volume, _update_links, _destroy) \ { \ .uuid = _uuid, \ .properties = _props, \ @@ -2119,6 +2145,7 @@ static void *transport_asha_init(struct media_transport *transport, void *data) .get_stream = _get_stream, \ .get_volume = _get_volume, \ .set_volume = _set_volume, \ + .update_links = _update_links, \ .destroy = _destroy \ } @@ -2127,22 +2154,24 @@ static void *transport_asha_init(struct media_transport *transport, void *data) transport_a2dp_resume, transport_a2dp_suspend, \ transport_a2dp_cancel, NULL, \ transport_a2dp_get_stream, transport_a2dp_get_volume, \ - _set_volume, _destroy) + _set_volume, NULL, _destroy) -#define BAP_OPS(_uuid, _props, _set_owner, _remove_owner) \ +#define BAP_OPS(_uuid, _props, _set_owner, _remove_owner, _update_links) \ TRANSPORT_OPS(_uuid, _props, _set_owner, _remove_owner,\ transport_bap_init, \ transport_bap_resume, transport_bap_suspend, \ transport_bap_cancel, transport_bap_set_state, \ - transport_bap_get_stream, NULL, NULL, \ + transport_bap_get_stream, NULL, NULL, _update_links, \ transport_bap_destroy) #define BAP_UC_OPS(_uuid) \ BAP_OPS(_uuid, transport_bap_uc_properties, \ - transport_bap_set_owner, transport_bap_remove_owner) + transport_bap_set_owner, transport_bap_remove_owner, \ + transport_bap_update_links_uc) #define BAP_BC_OPS(_uuid) \ - BAP_OPS(_uuid, transport_bap_bc_properties, NULL, NULL) + BAP_OPS(_uuid, transport_bap_bc_properties, NULL, NULL, \ + transport_bap_update_links_bc) #define ASHA_OPS(_uuid) \ TRANSPORT_OPS(_uuid, transport_asha_properties, NULL, NULL, \ @@ -2150,7 +2179,7 @@ static void *transport_asha_init(struct media_transport *transport, void *data) transport_asha_resume, transport_asha_suspend, \ transport_asha_cancel, NULL, NULL, \ transport_asha_get_volume, transport_asha_set_volume, \ - NULL) + NULL, NULL) static const struct media_transport_ops transport_ops[] = { A2DP_OPS(A2DP_SOURCE_UUID, transport_a2dp_src_init, From patchwork Thu Oct 24 11:02:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 838213 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011044.outbound.protection.outlook.com [52.101.70.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A63AD1CACDD for ; Thu, 24 Oct 2024 11:03:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729767798; cv=fail; b=pvT+gtxY/OQ+ahKA438/QCuideaX8t+Twx7oSYFuSrDq3mRu6IUNm5lCiA19xmHdsXDmUihbxUf81ms1bhhrv25E+o/t0vwsM1A/bI0cC+lybmXuZMq+G8XlKar9ggfEx8fL8uNMrnQYID6uyj/pUTO2m/oV1/V9AtGCpBpGwik= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729767798; c=relaxed/simple; bh=DgyPv53iHdnTPOrLt2LwIbzrvEY19ZYNPyeIZR3Sbas=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=qa3fixYBj0MhJJhPPRtF48AtEgcHwyR/uv8Dm+kgzeijBvK50EOeiQ/QGE2L9Kj50CQ+nssdyNC1tX5D9M9MUs9kHrKjAhpfsM/LDcUWdaQCMXjB74NO2oWEaUUIsXrhimCUBQY9pxLz63TVIlyu+kpvPIeDEsRCGh839G1DBxc= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=NWxRIVfM; arc=fail smtp.client-ip=52.101.70.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="NWxRIVfM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LzVAHerqfJmtjMetaksexsRoOuvOHiTG1N4ZZUeMpwIv1N0NzfAOnJQK7KTR6RPlA3CQ9EnZGWURjxTY/Y8pRtO2bJvwsR3m1x0buuVTKZ+0qTBpu51mVAE2fEn75gtaA9p5h8wIOAU1QjgrMiFFi/YWwGEXcrPQ/D9UHeX0gYo3vdYQY+f8wRUbEgm5HCcDCljdv5YH7jcFKwUUVHkMT0dwHVmXv5DR4W+MFzO3XcW/3cHW7wxuJrFwCtlsAWsXfvHmOPXcGmNQhsC4k4aMMtDoSGVsmlQg25DHMpk7U8vMYy5J+SWDYLhc559mC2TbSTuC+MDTPF3joUINxTs29g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=StK26AHiMKpFaYLOHxcQCIgxucrxIA3twyNPzY8kVIM=; b=wQaMDigr/Yznr2gA8RqYJ52PzzAbD2prTSkVLxNg+v2LkVS2SAGgaf8kj//VhJFIb6Y9YmRIKJTqqJ0dakUyfF2wviooJVnexccTEnqJWKU6rD99ycu43qMQe/bzxLNthzAvDv8rKbkSUBrCexqNXyxWoDhwYbERJX5qNsmZhC24kqlqKv+wa2qmGTWqkLS9pCoSkiQj8p7JEYTc2Ee1Hsg/k6CSsXfvaVcMwsf1dnuuAdRbrekj/UMfFXdCXVcZoxo4qou3n5qGacgOkXj0DExOpUtnwbsv4KVEHC4zgl7my0lv/5EHZvPZkkCab0ieQeTXaqRzDkVps9mmByo9JA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=StK26AHiMKpFaYLOHxcQCIgxucrxIA3twyNPzY8kVIM=; b=NWxRIVfMnbNG71ZZecQ0cMPAS81we9pTSMEfoKAWHvM5z96dzDizNkYbLhzCvaoRq75u74A3iotTw+upZ+G9sUdQmo/d909RFjAcnkX7RtDpx1A8No/kfNlwC0jPFweAcpxMb80DEIep4uvYiL/az5T9TES4wM6DFvllyoM7ZXc11KWuvrDENUjq6TDltb/bbNw8HA2nDMmbw7/bQysoC9c01KES3hxA97dtZdp+tSx7hCdvZQZRoq8ALRRk004fZE+XSxunVMMyUBu0sB26O/cvqIRUh2Crgb2VWEKhj9And/KNzf7OFJO8cSi/AmcV1u6AJmTVwurqUXNBX9cV8g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by DB9PR04MB9964.eurprd04.prod.outlook.com (2603:10a6:10:4c1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Thu, 24 Oct 2024 11:03:09 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%4]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 11:03:09 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 11/14] transport: Make transport_bap_set_state part of BAP_OPS Date: Thu, 24 Oct 2024 14:02:20 +0300 Message-ID: <20241024110223.77254-12-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241024110223.77254-1-iulia.tanasescu@nxp.com> References: <20241024110223.77254-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AS4PR09CA0018.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::6) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|DB9PR04MB9964:EE_ X-MS-Office365-Filtering-Correlation-Id: fc14cf3f-f16a-4607-18aa-08dcf41b71c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: ZkQd8p7DIou4YyYNjpV/VBGh1BDLuVXEmsK4p1xjSWG2xMrbEwzdRYmptP0nxULSH8YAVcG4thfnUwsZt79LcQsURY593c9Amu6DG8y9Qzcvb4zgyz2kqFYnVXV/N3Dzc3pcxuzot1SrCzmZjlUL2sgl5Dk1yuGlk8uM9xY0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WXZ52im/hAkAptcEAcqXONE2B03Ah5+IRhL/CebDmE/8nOTS0tVfeKJ9xclTeZDUzsTpet1Ca0W2VHkFoRkovHRSMN41W09QMcEJwmsKMI2nVfcE2UDFKcfsY95Ynd04+K8P2o+gyFP/K0= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR04MB8898.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(366016)(1800799024)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: rV5Xkmo5yV0VpBjdhqISUr8CXJ8UahcS02FqJD6/lbPC5+VvlfVn98AUrZu0jwx5cOgveEhezTL/5u5uQAS+Kbx4/6wc3ACYdeJLG0vE5B2zUjBSE/Yrq0q53zzIxrv9ZiRE2V6ri7u7Vk0T04wvNMygqLNohXK3Wzp1UZcnBlS+cDnLBbk6bW49Eg9k7zgxJnFB3ZARVT9l7xR4nfKasZdEFrtGa7IUhrFQVnwKRJ3wAIr8DHO6BH1O1u/yBCZOOE3NBYVw20QesAdzumMgXjjG2sWeFWsaniz0WAduzFqrsbAUFdPPPs1P/G7lLpuBeQGypz9pEykdbN1WBU4/JtwzMHKHzEszv70yQaA64QthGVYCMpqNVQ9mLsliQ6Nyt50EvQy1CVCsbRyHaN+6UZgX8XJG3Oq9QvdbDxrh4RIK93smUN8R3h3weUXkt7kromamAKqrmj5nyQBmSh68TY5EDlEyYDWLwr7Yjxk+aCWIOMJ5n87uiL+hB5JOQ1HQya63Q1s/6xpBDyiX7dFXQg4SzV+GkS0JaITtTvcX2pNgWJjf+N3MwLMJTR9UTm3ftb9gB/wa3jUrhr9P2Eg4uTYAbINf1ArswQCXDaICKK9lwH3573B5b4ez1e59KjL+vf1pojAxIbT2YEzFSo/39S2zPz/iq/9kr2Fh72mY4jZFFxWUC2PYBQO4rLgen+dUZ5WfuLcJ0o7ZOenETKWRSbf+RETN4QXIku/tLh8WdXXZ3raxf0fc1Dfdo3epC2Pi0wyqVPHPAtQSOAEpse8isfldis9vWykrM8qkygiKZa+aULZNGstcD8lTSsutscCUyfUpKgJ9LHHI/CQlNK39OJu5HEnWJY1Cshc/xJKZgi0rc0KZD3vY+YmSRmhPzaY7eDmAnSuTljb4nZcTbVlGoIP8nz4iADYI+xf88qQDKbDn8DXQfe1FNn8ff8mR6esn+1VizL00+09qbtYkFA0HvGtZPai0T0BUUuT6qxXPatMJ6+BPxtyBbh3mkxltQY1AHYjBIhWfW9useQqLOOuP4bOtXzayqFhcZiwRhwwUp9URDKDckIJnpcVW0zllPwZC/FnRMzwKFFw1kG7ZO55lC/J6uM0mNKWRPeSSDngcUgEgGsm9LZ9BfLc3WCZJ/9SEh+uVmZzOcqJ9UdX35pe+I3JTTz6Xy3d/QlBe+Kb5Z/66K8Nf1kB5smG9++OY0WBgj1/Xn8J9kPnkrumwhRZqpWOsjuAatoN7VlSsGTE6BR14duMqAOPmkOOhbHwa9u+N77F+3V/IaZWd4o86OjN5Iz6YQR9YXCUT/G7tVg/lM3dAIhUi7ZMZIIe/KG4750FOnYNp2sGn3ytf8Jc19d3Nezcx9BpyeLQ1Nvte0afqGPh4CTTZM1BMwJOge9o6JkJIQihuuWbxkTuZ8cs35weAc88VsVWzEu1LZIq1o6WacWS4Nfg5RSPwyIUtLfUIzhEjAb5p9/NMsbit3tmNI73y4U35EiYd6SLqrTXo4SpZKkwwJ6RyMxVER2WPUec/FIJ2BTe5HArKc9JCSycXz/GAlIkyEHXxU9B02cuqzLlwtDT2xU47GBFftn2f1FaF/CetusEOrNR0hrDDfXr1YLL55Q== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc14cf3f-f16a-4607-18aa-08dcf41b71c5 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 11:03:09.1108 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fLVJtUquOwPGWO2qQBcxwCsk3Y5FY0cQI8ez5qxDYpX9KITQ2tPR9eEkFmWDb7IIDlPLymia3nW1BJGOLdVMpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9964 This splits the transport set_state operation for unicast and broadcast, by implementing it as a transport op. Unlike unicast, broadcast transports need to be acquired/released separately, so changes in a transport state should not affect its links. --- profiles/audio/transport.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c index 2f5ff6de0..bb2ce8a4a 100644 --- a/profiles/audio/transport.c +++ b/profiles/audio/transport.c @@ -2156,22 +2156,23 @@ static void *transport_asha_init(struct media_transport *transport, void *data) transport_a2dp_get_stream, transport_a2dp_get_volume, \ _set_volume, NULL, _destroy) -#define BAP_OPS(_uuid, _props, _set_owner, _remove_owner, _update_links) \ +#define BAP_OPS(_uuid, _props, _set_owner, _remove_owner, _update_links, \ + _set_state) \ TRANSPORT_OPS(_uuid, _props, _set_owner, _remove_owner,\ transport_bap_init, \ transport_bap_resume, transport_bap_suspend, \ - transport_bap_cancel, transport_bap_set_state, \ + transport_bap_cancel, _set_state, \ transport_bap_get_stream, NULL, NULL, _update_links, \ transport_bap_destroy) #define BAP_UC_OPS(_uuid) \ BAP_OPS(_uuid, transport_bap_uc_properties, \ transport_bap_set_owner, transport_bap_remove_owner, \ - transport_bap_update_links_uc) + transport_bap_update_links_uc, transport_bap_set_state) #define BAP_BC_OPS(_uuid) \ BAP_OPS(_uuid, transport_bap_bc_properties, NULL, NULL, \ - transport_bap_update_links_bc) + transport_bap_update_links_bc, NULL) #define ASHA_OPS(_uuid) \ TRANSPORT_OPS(_uuid, transport_asha_properties, NULL, NULL, \ From patchwork Thu Oct 24 11:02:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 838212 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011044.outbound.protection.outlook.com [52.101.70.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95CC41CACCC for ; Thu, 24 Oct 2024 11:03:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729767804; cv=fail; b=H7MFbGdQNH+m7ufVfalwC5yV4vLxgicLshyPRNd3VvSIUUag3FPRHb77PiusTE6SdvWI1Gj0g9+TQBquw4qqc38Ztf/Ch0zxIJnMlVPoW5WAj7WMkWfzTY2y2RBqj+keYWKsDtmioWIR6OSLljM9dxhpeFp1EFBWUMkWpkeGLdU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729767804; c=relaxed/simple; bh=A0KlTM+60pSi/BKDq4BjaLDPFP2MgJPBvuFCET9441Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=e0Nu/f9023+h2YxexHTwTODo7oFAAObKox3ayJdB1Ac6GooRM0D7zpq0jZch33/NuXSHjRerS6pduYgb8rPqowjS0Wxil3flCsvOr61NtygU6aV7HwgRaDXByssA0Ex0m8LfKMYl8bGxVx4jlnpyzte5ZwNABDN1kcUZrcTw20Q= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=CG7cP3J4; arc=fail smtp.client-ip=52.101.70.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="CG7cP3J4" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xAtPMl6aLZ+fyyQrY5lFVuYIfZKzGnhiUB01+AhBBr2mSlrVgMC7PI+SZaMK4FifLuuhZswegL+0QcZAbYsEsO0AwyQ56vjD+V24myl1vAHECUubQAHFKpu3BaXNfk3dhEJyAfdah70eDN7RM0yCC+K7IDxa7kIolnQjO7BTESqaOpM3tWqt9NJZD/NCJvFZT0CmFI3wxHBnX0Zc9C7wnpDFM/KYgYU9dj2NQPJu+MGcEnECoqIsRZnA9SHwjyFshAxGR84x79s/ymAf+8COGRa8dZTV5Hq0pBSAJJp16KHX5Nu8DGNi55n8gLG/PTvmnh++OMb0ER+QmQIyC5i12g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=XjqyURUXzN1ULLwz0SXvnnDaimcQuKYmFBvTLDq0ePM=; b=KjFKIR+WLTbo8NNwbeFsSBOzm4Gycph8mgYXJP7Guc6dYXO9lBWZaRpMttubJLVTEZx+MdeDgkqBvscTgCq4FT5NjTxS2hEt/9QlEt7VV26UWiCZIRBns9l8qjlHUgM6yZjYIoZh6Y2fTj60YXGqWkN1Dlip4dtg6x6c+SjOFxKjyoMJ+7bbMQGXhhB0he/nfz4+LRTot4NPLTwikesHt9FHOP4n59ahytihCyaYWhSGkPt0M6QTiNU+4hD4/A07QtygD+fTAqgrC3tkKbPlDjY/5LnmDCqYLe9F+p6so66fzDlvnkn7qEYJ2rEwsFA/ToBIz1LernSKfWql0XOgJA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XjqyURUXzN1ULLwz0SXvnnDaimcQuKYmFBvTLDq0ePM=; b=CG7cP3J4qqN/0mLIjGGMV9V1GYufS4nM5BqIfYEK7MqHMPiramScflW4wTvFkVaWwYGFkq3RLOhXeRnT3fc69jWFNQJNDPk8oKkMwzgmG6tWXaxLCAiOoSCsZunDHiKBlfiJqmImnRXStnlhSsOAhccWrIgZjMuFlMRmLC/tuq6FODNErbRA40DQpE4O3xzJ/6jP+oV1sKsEzkRRJ7fucugF6N/hdp3N7fLqph/3y7Id4gy4WItREhZ1br/WhkYw2R2Ric0o60iIEIRHMFxIhDJBEwlAvkDNYmSVHGP/YNLiJh/dhZG+6kpp0G0GuiBZLRui3vtb36DXG+y627TL9g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) by DB9PR04MB9964.eurprd04.prod.outlook.com (2603:10a6:10:4c1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Thu, 24 Oct 2024 11:03:14 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::5e22:869c:33c:9654%4]) with mapi id 15.20.8093.014; Thu, 24 Oct 2024 11:03:13 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 13/14] client/player: Add support to select multiple transports Date: Thu, 24 Oct 2024 14:02:22 +0300 Message-ID: <20241024110223.77254-14-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241024110223.77254-1-iulia.tanasescu@nxp.com> References: <20241024110223.77254-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AS4PR09CA0018.eurprd09.prod.outlook.com (2603:10a6:20b:5d4::6) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|DB9PR04MB9964:EE_ X-MS-Office365-Filtering-Correlation-Id: 319ec9b6-de89-46e8-4af2-08dcf41b749f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|366016|1800799024|376014|38350700014; X-Microsoft-Antispam-Message-Info: UPwXyYa3dmKGj07hFbXKWmhTIGZKRKg5eteMovvnzqsOcVUCg57BmET9HNISB0Xvq6IlWw6ItmsSxhCVLkfcu5ENCcQWTXBoQkMeL6/8TTsfs58LKOW1wXC6/MeFjrI43Ft9G6s7MLR5vFg0Gf9dXYuN4m4LmRiVRQgXof7Z+XMkrVb6Z32XaIhS/mDRY4ccHhLviX2XT7zxJwOZasY6aAWN0WTgNXlkNLRomW4mpMegikNGavS2vyZl41kdktrRn0Yq4Y4/hrRAnHizOpeyGnyp7O4VZ9KcGn8gqxcE19A/E8cKqruPNw7uC2FWPdJ0V1Q2/l6iwm87RufK0gZv0iRGFXhR4C8evQJZFiPbxipyRZ84abfMKfoNu3Ju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:AS8PR04MB8898.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(366016)(1800799024)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KYXTYReVcPbw7+ZPTH+YCBLrohqrH1F4tRy4x7gq5dShCJ6HdEZpB1MPGCaSR/9IRELTl8qsqmnFU0WY7SG4oQZIEOnY5PWp1C22pwph1rZU2bgFVtS5IlYLS8MvHj+i/Fw2IC9EG4QqmZSdOGCDHwI+X629ZnkvScUSgUYsybKjBM23qzFJkhtaC8VWwl8wAgSf2gSmFgVl0h9gfrydIeNocgtZcW/Fq6SBAqcoXjwKgRNJEnpPPGm0Zzb5XY/1JlvZBvPoYFtH2EecmadiMTwnGHyWr7ZHDv8pRtat7lnyQouO3E0x8hwPb0lcomaEt0IMZjbABYFMOt5098PwpR2Zeo31TrP/pbl/4tfvn+ydsEGKADi3xOcQU0u94Uy7rW1vHLxAk/a0QQ9ylPNyjMU24KyumtMpR/ssR3tJbW8fDVEBBFUouGnKL02sSKhfGlkGQpWNeRhzFEUJKwNjdRsxPafqdaNKDZkxOtd1/fqqpVSPprWJZh+oKTdY2O4IdvcnNTjlqPdVsFl9SOOIYBnWwPUpufAd49ShYrTpf/Bn/duJ7jR2nEa1QlGFTunK/emHDNhU8bTrT+tF2M+bJmC4buptoMWOmVAO5I5wELB3Q5ssvDoSZMAtJ8r/U5A5Dg5NFX+7ylBP0jevyk7GmfPRjSxcQjic6cBrYqxMeE0/rEfE1pD3xPTo3bAD2ITDNCCWThHPUnCb5BFmE2VOwos+vf+Kf9KRQL6Q7gaxhX9lXQcUDSdnQw4Y662Ckdhjsp1MUBxYCQBa3Swr7yZD96LRFv/qur7HjGGR/SXJKyaJQe6F4VJ7JQ73T/+xE6k99nJT56V/6lrqH2/aAnwsbOqlyeQ2Wmgi7DIWx2zFWvtXckw1Xjw/NN6fM7yUzC4TbwzXFQkzK4yTERA5WBqPpyfCU1CJuJf2E9u9wMK4p1pK5VaHDHIkKHdk0ARdMIszL1EqmdwbFjk4OkOeJ/zn8emmaQ4pACQxwWPBLieAZHaddORQ0j6vZvXdFPFdnVQGfBwt4FtAVIXf/hT3X8BE+sFmv8OcxWTa1qgaSlSLpmHI4WXP5B0t9r8yIyGDuV48hPfTzsORi4fiSriRref2tqfFC0+13ipj0rF7K4E7kUA0HeNWTo8xHvqKFvmnWaLjYRAmj8PXyBE9fc3yNuWwyc+jlzSNO0YyzG5HMJGkAKkKvGjYP6oFAIHx5vjIwAWhCWV9xJQM6mxWcelPzTvI+HLEuGwlei7m9maKnYigrqb/43wVB2HGp12wBlTy1JG35nsWhRASJ+jcKYOzimh9X0+zJ/6Z7JzzxfVu9fRs200dDiNw76ahL/qzDkFiILJf8f80IXd4GQf1m9BqPQvY6QfQQTeYLvCTZDqnXrXHp/XproYG3GYWs2ohTAQYettEi8Q3e0246AresvCLHGHAET7mu6pA0kp+tbp3s0ENqUirbsuSCPad4zV9aXbuEB5Xs7QJabnUrn9t5TyvgzICmx/J6AIW7NCXiYavg1EvZ5aI9qOK7f2ENfzSIwnk1VacGV4Yde7d+y7Wi+RNhLZgfp0z+M21SeWhRqvpi5ooqpBhzikp8ZdV0Ga2ezTdY3Ze7el2Fvt+g30YeSXFByw9KA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 319ec9b6-de89-46e8-4af2-08dcf41b749f X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2024 11:03:13.9307 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: YF4zr7sXX+dNz0LIyOPe72mdfGgZeX9Pz7T+wRLZL51cpYdqL/BIG1O6tm9zLs8ueSQGknDrV3WlAqyHZOio4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9964 This updates transport select to link transports together before calling the "Select" method for each of them. The bluetoothctl log below shows a Broadcast Sink detecting 2 streams from a source and selecting both of them. After the first transport is acquired, the link is created and the first transport goes active. client/bluetoothctl [bluetooth]# endpoint.register 00001851-0000-1000-8000-00805f9b34fb 0x06 [/local/endpoint/ep0] Auto Accept (yes/no): y [/local/endpoint/ep0] Max Transports (auto/value): a [/local/endpoint/ep0] Locations: 1 [/local/endpoint/ep0] Supported Context (value): 1 Capabilities: 03 01 ff 00 02 02 03 05 04 1a 00 f0 00 02 03 01 Metadata: [bluetooth]# Endpoint /local/endpoint/ep0 registered [bluetooth]# scan on [bluetooth]# [NEW] Device 17:7A:80:64:A7:93 17-7A-80-64-A7-93 [17-7A-80-64-A7-93]# [NEW] Transport /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0 [17-7A-80-64-A7-93]# [NEW] Transport /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1 [17-7A-80-64-A7-93]# transport.select /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0 /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1 [17-7A-80-64-A7-93]# [CHG] Transport /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0 State: broadcasting [17-7A-80-64-A7-93]# [CHG] Transport /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1 State: broadcasting [17-7A-80-64-A7-93]# transport.acquire /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0 [17-7A-80-64-A7-93]# [CHG] Transport /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0 Links: /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1 [17-7A-80-64-A7-93]# Transport /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0 acquiring complete [17-7A-80-64-A7-93]# Acquire successful: fd 8 MTU 40:0 [17-7A-80-64-A7-93]# [CHG] Transport /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0 State: active The btmon log shows that sync has been established with both BISes: < HCI Command: LE Broadcast Isochronous Group Create Sync (0x08|0x006b) BIG Handle: 0x00 BIG Sync Handle: 0x0000 Encryption: Unencrypted (0x00) Broadcast Code[16]: 00000000000000000000000000000000 Maximum Number Subevents: 0x00 Timeout: 20000 ms (0x07d0) Number of BIS: 2 BIS ID: 0x01 BIS ID: 0x02 > HCI Event: Command Status (0x0f) plen 4 LE Broadcast Isochronous Group Create Sync (0x08|0x006b) ncmd 1 Status: Success (0x00) > HCI Event: LE Meta Event (0x3e) plen 19 LE Broadcast Isochronous Group Sync Estabilished (0x1d) Status: Success (0x00) BIG Handle: 0x00 Transport Latency: 0 us (0x000000) NSE: 3 BN: 1 PTO: 1 IRC: 3 Maximum PDU: 40 ISO Interval: 10.00 msec (0x0008) Connection Handle #0: 6 Connection Handle #1: 7 < HCI Command: LE Setup Isochronous Data Path (0x08|0x006e) plen 13 Handle: 6 Data Path Direction: Output (Controller to Host) (0x01) Data Path: HCI (0x00) Coding Format: Transparent (0x03) Company Codec ID: Ericsson Technology Licensing (0) Vendor Codec ID: 0 Controller Delay: 0 us (0x000000) Codec Configuration Length: 0 Codec Configuration[0]: > HCI Event: Command Complete (0x0e) plen 6 LE Setup Isochronous Data Path (0x08|0x006e) ncmd 1 Status: Success (0x00) Handle: 6 < HCI Command: LE Setup Isochronous Data Path (0x08|0x006e) plen 13 Handle: 7 Data Path Direction: Output (Controller to Host) (0x01) Data Path: HCI (0x00) Coding Format: Transparent (0x03) Company Codec ID: Ericsson Technology Licensing (0) Vendor Codec ID: 0 Controller Delay: 0 us (0x000000) Codec Configuration Length: 0 Codec Configuration[0]: > HCI Event: Command Complete (0x0e) plen 6 LE Setup Isochronous Data Path (0x08|0x006e) ncmd 1 Status: Success (0x00) Handle: 7 The second transport can then be acquired and it will go straight to active, since the fd has already been set: [17-7A-80-64-A7-93]# transport.acquire /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1 [17-7A-80-64-A7-93]# [CHG] Transport /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1 Links: /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0 [17-7A-80-64-A7-93]# Transport /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1 acquiring complete [17-7A-80-64-A7-93]# Acquire successful: fd 9 MTU 40:0 [17-7A-80-64-A7-93]# [CHG] Transport /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1 State: active The transports can them be released one by one: [17-7A-80-64-A7-93]# transport.release /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0 [17-7A-80-64-A7-93]# Transport fd disconnected [17-7A-80-64-A7-93]# [CHG] Transport /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis1/fd0 State: idle [17-7A-80-64-A7-93]# Release successful [17-7A-80-64-A7-93]# transport.release /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1 [17-7A-80-64-A7-93]# Transport fd disconnected [17-7A-80-64-A7-93]# [CHG] Transport /org/bluez/hci0/dev_17_7A_80_64_A7_93/bis2/fd1 State: idle [17-7A-80-64-A7-93]# Release successful --- client/player.c | 47 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/client/player.c b/client/player.c index 81d967a28..66a26ef40 100644 --- a/client/player.c +++ b/client/player.c @@ -5173,8 +5173,9 @@ static void set_bcode(const char *input, void *user_data) g_free(bcode); } -static void transport_select(GDBusProxy *proxy, bool prompt) +static void transport_select(void *data, void *user_data) { + GDBusProxy *proxy = data; DBusMessageIter iter, array, entry, value; unsigned char encryption; const char *key; @@ -5220,28 +5221,62 @@ static void transport_unselect(GDBusProxy *proxy, bool prompt) } } +static void set_links_cb(const DBusError *error, void *user_data) +{ + GDBusProxy *link = user_data; + + if (dbus_error_is_set(error)) { + bt_shell_printf("Failed to set link %s: %s\n", + g_dbus_proxy_get_path(link), + error->name); + return bt_shell_noninteractive_quit(EXIT_FAILURE); + } + + bt_shell_printf("Successfully linked transport %s\n", + g_dbus_proxy_get_path(link)); +} static void cmd_select_transport(int argc, char *argv[]) { - GDBusProxy *proxy; + GDBusProxy *proxy = NULL, *link; + struct queue *links = queue_new(); + const char *path; int i; for (i = 1; i < argc; i++) { - proxy = g_dbus_proxy_lookup(transports, NULL, argv[i], + link = g_dbus_proxy_lookup(transports, NULL, argv[i], BLUEZ_MEDIA_TRANSPORT_INTERFACE); - if (!proxy) { + if (!link) { bt_shell_printf("Transport %s not found\n", argv[i]); return bt_shell_noninteractive_quit(EXIT_FAILURE); } - if (find_transport(proxy)) { + if (find_transport(link)) { bt_shell_printf("Transport %s already acquired\n", argv[i]); return bt_shell_noninteractive_quit(EXIT_FAILURE); } - transport_select(proxy, false); + queue_push_tail(links, link); + + if (!proxy) { + proxy = link; + continue; + } + + path = g_dbus_proxy_get_path(link); + + if (g_dbus_proxy_set_property_array(proxy, "Links", + DBUS_TYPE_OBJECT_PATH, + &path, 1, set_links_cb, + link, NULL) == FALSE) { + bt_shell_printf("Linking transport %s failed\n", + argv[i]); + return bt_shell_noninteractive_quit(EXIT_FAILURE); + } } + + queue_foreach(links, transport_select, NULL); } static void cmd_unselect_transport(int argc, char *argv[])