From patchwork Mon Feb 12 15:32:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 772123 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2062.outbound.protection.outlook.com [40.107.20.62]) (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 E96AF3C092 for ; Mon, 12 Feb 2024 15:32:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751953; cv=fail; b=tE4oGKxn9vU3b3yfPdUxwYtU6SGnUy6YeUCMaXpuEYYqUHAFSdMXabg+3H5rAh4YywAyEvxqWkYopkB/LKx9l7nAvPU9LmLR75rgQ5EydeyOxiGv8LyUevJjMyvDFnlBRqO7bunB9GfvZB5GLFZ0p7nnC14CPMLBHUwpfQG8Bgk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751953; c=relaxed/simple; bh=lTvzkHmay4ezFcGed9SwVOk9UoDF0/sLXZwak8s4cPY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=DBSyMSb3oDAwqtfJ1H9sPD29rNsy8mVT+x8ICKC0sDgIX4tqP/XNUNJtlvTkiK1AVuM46R9AZsqER0ltXwKnQraTwLunNNpF5cpX9Y3lT8qw+2nUa5DDVlDaULjBymUI9K/sWyYzdAIomH3wuFx6gzQlV3FP7IRrzrEkldpMT84= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=l832cEKY; arc=fail smtp.client-ip=40.107.20.62 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="l832cEKY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H8SzjZXBFemX2jywRsSwKSPJHC0vhemq6F5Xxaiw6yT4b0Gb/E9eYwt98T8RFK8+kwydt1zBaLA00f1qE0yR5q5EXyMl10vZFIhE6ZY1F/NnSTYy47MeTdhjIn1LFBC570RIAmcmoHJ6BI2UL8qcXNdb2bLmJoSzzno+nth2TjGQ1h6zoExhs/cj/zhdYKsFdwCpsvfn0jsDYDgZNrAx2DDxhrVf9coIOjeOwgY74Hl4j8/8LHutQZj05+UkSfsMMAnoY4YGYZ3Ww2U3WZWYkVo6OJWqflk5CUcMWWRpAzGsKoJF7QcRmWHHW7qfdXsCQoKQaFCliX9UoR2y2xe78Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=nI01aqCMJjs5mzkKiS8NKIHgcatfVUO3Mb82+IgBiag=; b=lyA51wT0TUqZ95iwgtT2tDgZHEizV90MzSM2fgXrb3dJns/u8+gi0P5NnqQB07M3up62nYR1LwUbkGcuI+FsYFUVNicx/ca0XsLJBJ5mF0WHyCwNPUYWH30urQkDE86ToyRpkUz6pbep0PW2ZITEo1HOBB/3b2WILPUpSDak8ZXLY2tMrub4XQTpKgFWn9Em54t654FGAXNfW8CHrpWIPyI0krCGpv1VcbgQ0nfxzwDLUc4Rgm7vEo177njIOm/xQzU4ggZQwToBxMldhHhvY0igOm71uxu1Ch7d3vFl6B3ttUQ4YFjc5arp4MSkR7P2yXeIvT4kCmdIuHItC7F5Rw== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nI01aqCMJjs5mzkKiS8NKIHgcatfVUO3Mb82+IgBiag=; b=l832cEKYAHtQNsdm3Blc4jN0DiXFU9u2wzKZsyYTNkr7e0MjJUuwOcdk0HcrtmAdsTWX1CAwLgF1smbJiu2oHPRQOSLWsgP3pT6AjJTNNEhE5ZzOAnUePv6ROsP253ZKl/c3x5vjjKXOD9Ju1d2XPBIfbrOV+kTKGfc23NxwYlE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by VE1PR04MB7439.eurprd04.prod.outlook.com (2603:10a6:800:1ab::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.39; Mon, 12 Feb 2024 15:32:28 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81%7]) with mapi id 15.20.7270.025; Mon, 12 Feb 2024 15:32:28 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ v2 1/7] bap: Remove set lpac user data at bcast ep register Date: Mon, 12 Feb 2024 17:32:16 +0200 Message-Id: <20240212153222.8191-2-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212153222.8191-1-silviu.barbulescu@nxp.com> References: <20240212153222.8191-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AS4P195CA0030.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:5d6::17) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) 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: VI1PR04MB10073:EE_|VE1PR04MB7439:EE_ X-MS-Office365-Filtering-Correlation-Id: 07200f1e-6255-45bb-d48e-08dc2bdfd267 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qkUtUuAUSz7Y3CqdBLpHBYP1SKBkCsCQ+M4dgwa2DkSRM/9Yerw9QMZHP9tCPdCHBlvYKwZ+YmMvf6dPbkgeeL3o8K7oDBiG1/SSAxr6lXPzurp/rxRVO+Ik+ng/1qSR8iMF+RPS21OR8ituKJ2TeAnJAJJTF4tzcD0qLJ936QACB1QRdyyfKCVwrbFKOl4OgrkNXHbHOvhfIjL8YIb3iqSpcX3GNxavrs7s9T3eoyaVBBZtb/WK6wKGX101C0/ZX9td0LX8Su+0W9Sa/wX5eP0Lc+vOL2UkkflV6qRN6/5DqNqveoiGtRJysgzOZDtygVSS6NAjXZvqXutvWq64R8ZzZCraskmkZmjTzzHjAIUuY+fbQ0vozULdM91g1yVw5mETck55vrQZeMB8VCOhR20Bzy0hKYEPCm5ADHbtRrqCVjjnJdqqQRftUpT8V14dlvVIhXsQZplEgLizduHtFCN5fv8SS32O/ZIje//BAEOBfwMwJ/rjoJVd6suiyBUCxXVhiO/e/jWocZ1lelDUqmB0aIGS0W2nF3k4sYnRnuSwuMdM2HCEHGEGHMrkhGxX X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB10073.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(39860400002)(376002)(136003)(366004)(346002)(396003)(230922051799003)(1800799012)(64100799003)(451199024)(186009)(478600001)(83380400001)(6666004)(2616005)(316002)(1076003)(2906002)(4744005)(6512007)(6916009)(26005)(66476007)(66556008)(4326008)(66946007)(8676002)(38100700002)(8936002)(36756003)(5660300002)(86362001)(6506007)(6486002)(41300700001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1ULBcuJTokloAZ8I5c/LFAJehds0V9OyH4fN96nWPLEGg8WhS9YSvTk/vqTMGRK2uTsztRlvZ8D5JzCzFlW9a8Yz1hV/PGSwt2/UqQnzIiDdmt47P100+AuJT757qEZYaepnjE3qd/U46zqtjnrDedA5Y9l9X+Ue34Q1jD0IoWGnhb8Abf4m4Hoss/bDG/4JHK45O6TeVl3VWEjoZC0lfPoECjVO19SCa2QQjHp1gAuaohbZG5sCu8Y1pxdijJ5fUeOO2nKHRUh3NYqQofPsLKmM8qwmpV5LZbA/1jfsl4vwZjEYZQQQPRwZBHB+/anExxgeUOTbhFNLTmyzaCE11t/5soewmWS2KhCl/rixA7FyPCOKMkQteGXbZZYpsM8KZz3Qk0hJshBkGTol0Nitbo/Mu3nAj7fUZjmZFQZMoSxzkXcEAkqUDj2h81aWejGEZKhRayC4iy0VZ+oBDpZx2BAqqzZeiJAOJ/3kwFiWDfCZx8+cnuKBQNXPBasPjdE19uBGqgTypkkFLgBfJw1SLw3fQwJV19aHxe/jDTF+QWWYTzW7mPAvUrUauoTJlFhog1ae7pR1uuHeb36et4r8QIPKTLihaEVXlldzlei2ReHqxKGQwXRgYS2bCCHZzyRuYTSbe6GxK02k5COEfseLaT5ow/Pkxc4YOo/kdxXdzK8zC00Oolr+75fDXPo2I8Q5wRMwvK+suftQnQLug9dTdlMCKN2bP7f54gJZId9Ms1w+UYu31RFgsZavQ4z4V5eCSjYjov2xVhTdnszho4YvQSXyWw1eMFWcPG2e1CpYm3eqPALoPXWrm9f3AA4R4vUgniVgq9JeMYeh8Awezc4feikkU7P98dTrthkOWLiT4JV2pho7UkGPeKYePjBHK7eTnIJIoWtmI7TBmBMajs1VFSeL+cGldr8CWA8DsSOyW8hCOtgu6TNqLGbbRpAknLaFLTXyWWth1OXg9tuQkXMXsqdkFH3L2C1ciTb/m8AMo1PGQ0eS5p6nNQoMfWYtlT4M2ESWAMH72bKvd+IxUkegHomaWlRt5iz/jRtyBC4y2QLeEG0JO5OH43VJygclau1RuhRJeRJbq8HwKirlYIlCLr6m0dGL42lMI5+68s1ATijlCuiwFL4LUBtIQNSgPR2knsWLnYM5rJM1rO/zce7D4uWQ1MyLvD3TOZ14SF4f+5s5LxRf/+2TQXAhOKTFZVZmMyKfNdQlb5cjKWBlWGgGLonqhK0vqjUUF2dPbetsEx+2g9WJCuabscyH9ghXZ5b092al3ZAs20r9cq7UFDHC/Cs3PSTouht7qGvaU36/uHk+p0h+qKTTjF/cYDch+Yfk4vcex0ievDedTbZHfRwwq2nX5e95RwiuLAl9GtdxMvmwyzJKoo5JZExhUq6NA394d+3//o6Hhb+0p3bl86iFbWMlHLEnWpCWzOeERku3a/b3YCa8r8Xf0XBKTFVv8QrV3ZzS1LbZM32uYc0SuNLdaaqw7ZH53It7z0ZAmxzhjsJdVBzQvsj6zkDtntJ1ui+kBeRVMqztRq3t5ggsaxL8VadcdJspdPv7Ge50XvhpMDS2duwI3YxlOWEZJSxq5yXo3BbwK4q55gRoqMN6stKW6A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 07200f1e-6255-45bb-d48e-08dc2bdfd267 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2024 15:32:28.8561 (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: 7c9xvoCu3BkuYdby3n9GniTFQL9LTRHwQx5rQI9ATzUL43hozLwAZAHkyeWQ66q/qVmJKWJt5Tdr6+14WjhrmvWwhk1DxidVVpIVeYHf7hw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7439 Remove set lpac user data at bcast ep register --- profiles/audio/bap.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 88c93127b..38ee42894 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -1207,8 +1207,6 @@ static struct bap_ep *ep_register_bcast(struct bap_data *data, */ if (rpac) bt_bap_pac_set_user_data(rpac, ep->path); - else - bt_bap_pac_set_user_data(lpac, ep->path); DBG("ep %p lpac %p rpac %p path %s", ep, ep->lpac, ep->rpac, ep->path); From patchwork Mon Feb 12 15:32:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 772472 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2077.outbound.protection.outlook.com [40.107.6.77]) (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 52A8B3B799 for ; Mon, 12 Feb 2024 15:32:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751958; cv=fail; b=FjhMhkl9zWaow5B1eAEh1BmfUHlAo458Qvzfcx3SMxxIY7HL7F5T4NvpBK4lI0HrMfeVGlh9tGRREViVpFjApqK5gJNvCJV7PqQ/piWIwHi2KpQqiGqJ2fJHZeDFOJa6uOkbgY6dtzJ6BI9Fazd8AfeiSiLSpzjVGF0LbepTadM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751958; c=relaxed/simple; bh=xS6M/O8tSwyfrlxN8+PJhsViXY5oGgaKQx4pXIC7xxs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Y9CmAwUMC5imzCWPrlm3dXbETegKmcq5JJC2KkBT0uxmcmkCjnshyifdAcWJ0AYG5PYl6fZ+W7SJlPQDEYjyoAeOAyK5ceGUwIf/KIYGPZavTVHZSQMBFC6AiUA2vRXFDz/66kzPKPvw2kw/VDykqNq9dJDqji7k6rcBahbyuXo= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=RgrIqBEE; arc=fail smtp.client-ip=40.107.6.77 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="RgrIqBEE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N0wOuEbU+SgOG5WykxDPRi7w5JC9ASIvqJNuqzztoJ/mas7inB45z/LpaXAp1KJgvpLB4z5NVAxA9J4ZZeLpOODotL4zjjdTJGYWJFCKtJXc3LqgmhSpHPmjUvLMWg3U7tl57wm8HD/J7Ner/eDQ98SmGGKAk0JxQOT0NULR40obe3OkT6/ywUaCaLB1e3JqGXMZSlvB+APC7l+PHBmm4aco0ZbZsi8ktBtDmr0EzawkxSIAVf+RldaVvbkIRfJg3xNft1kLeQUrBZvVPVv8poJU5Xf8P0rukBCip9jkG1k9BpM53oeblDl7AK4kVxKxDJfNsAlI4R2SY+XlcQFUGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=TtmvMp1VEYbPPe3+MDwerFMwl5w3/RRPBAPxjQjF1/c=; b=XZHSRMNnCeLqNQMbegaH5KYg19JWQvV2pTyD4yVSiGM8JnbbL2WJJ806eBkyALNNcgJi3oYoCC0PaQodug1Nby/PGTW2LrZlwVZ10ROVwps5VTZq/SXyO0tZTMW7bIi3Hc7OAwCG0G83bCW2goJZUdaCXv0rlUSsj3qZb/37FkakndhtbPf22erOAwmGylwfAB3Q1ADNojzpzV6xRUQEeO6AjJ4xdgBm9rFF4kyE6GL8pMA+VzAhyxVHCGmM5KafMw4PC+E0UV5R3X15oUMliigthETBCUHjHTXZ5DQgAoSaQusSrhBjTQEW2ZOyBdWF6PAzzKaax249dk4BdLNL9A== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TtmvMp1VEYbPPe3+MDwerFMwl5w3/RRPBAPxjQjF1/c=; b=RgrIqBEErJeltoa4svlXsf52aqT/dv5Q1z7/pcLcNqd6jUkWF+8Pyag4uJ1LQ4Bh28Rv5Uw+bJGIMF+f8tVUNnzoAkN9D6HFpGMLIvg0QqBCGDD3cjfjy5Fr3PxkFh88eE21YfnGQWlyMoveYTA1XU/sJW0yHrbkLBHbwQBKTNs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by PAXPR04MB8301.eurprd04.prod.outlook.com (2603:10a6:102:1c5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.33; Mon, 12 Feb 2024 15:32:33 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81%7]) with mapi id 15.20.7270.025; Mon, 12 Feb 2024 15:32:31 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ v2 2/7] shared/bap: Create multiple streams for the same pac Date: Mon, 12 Feb 2024 17:32:17 +0200 Message-Id: <20240212153222.8191-3-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212153222.8191-1-silviu.barbulescu@nxp.com> References: <20240212153222.8191-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AS4P191CA0033.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:657::20) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) 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: VI1PR04MB10073:EE_|PAXPR04MB8301:EE_ X-MS-Office365-Filtering-Correlation-Id: e1c5e8de-bc49-42f0-18fe-08dc2bdfd3cc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jIZ3bc6EJdR8tYfIgXQngqWXn3gWwZA0AYC7vr04oba3if0+OVYsC16HQBym5A90seZA/CDYFbDLSvpCV4kBEEtTUERJOL49UI/A5f2TXmGGyYg4MA03l15nVjs4WRwQzqVNasUJG9uUb3SEx0pz1j8BoKciK9Q/ykYD23wlC9J7jUblOd/YReLbPLXjye/lAzw7xEatOlnm5rR+YbhIXcFRonCbCqqoI2ADBGQziBpSQEHR2MQySYR2d51OOkPsqJjIR8whLvA3rN//kp3ZQXi52M+3I/J5eXSn2SCdmTgHYB9BZxwtQeIG35yeeGGyFDOzJZZjec3V7rPwvCZqf95pJVoumGuFJT4HZoHwjqzqhRx5LVetyD+SzVR2A5ZvIkeoLYDJpuhzzMQ4U1waZ1CsCGegsO3waQ5OHM06mrHunTXOifmlFJCLJnBh0QwMwX9yeg7wezh5eeyvrFj5AU/Lv1HmR3U1IVGNuEnQ6gfkn1dmO+z9X3iIrd4XVUsoKvYxIvs+l7LMw2x5wix5B58+wHLrFNmmYs+toCHDDXsjRub2liUFHmY82kpT/lJH X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB10073.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(376002)(366004)(39860400002)(346002)(136003)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(6666004)(316002)(2906002)(5660300002)(66556008)(66476007)(4326008)(66946007)(86362001)(8936002)(8676002)(6916009)(6512007)(6506007)(478600001)(26005)(2616005)(41300700001)(1076003)(36756003)(6486002)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 31oxRRpJ2j8N8Qi4n6pQ5fzWc0S8lopJnVCQ4uchyfgzNPK1EDzJ+Q5aGy+9h1wDfmsLOPUhBxyg0xlAaGqsDqEBMnuHoiUo6xstcx11QHskbwYRfzmsz43KfE+a+j2JxsPves++JfS/m2GyLv3kQ8pLvIt1yYz6h6C8faTl/Q0oOqjwwMHoO6tgWLOiswjG8Rj8GbiiLM1bunsRzWacwgt7Z/YgAdZdJZqoMi3LnLhQlDxkwgD7KqBnjivjf8931PDA1DJaFnt3thr68reL+ANmZvRuR9OI5Ch2uHVXS4ivDYfKeT5yriiswOcBV+dWP86FjidRl9jhQGOeb0Oi5QEj7NKuXqc+MpL939BGI56tV+nvEzJCTnbkbwm9BcPZFsiMwyuLiy6r1M6dCpPeBsc6CsD61NC8CYfov46aMJMfRt2PP6TYh4xkWyQyG0QwTiFAKdbPTmexKhx5t1o00kzmuYqXxo4TJh6aPlbbbqgaH567K60WEabrdTPHeK9NWNZkvs+y0hG2G9+uHsbe2Amz+ve6mijo8TahwW4kNCPDaHpLWSVPoqF2nUmRaasEi9NAcIPG3sVDwH2kgcuuHfiT9ANEdiK2PHUNZZ35eLwE78WeFEJTgaWvZ9VKK5xnoBV50rMsejVQ86PzjFrfvHzfhCU5DyApEWsEJss+qSC0InrrT9CbTpvYOH6oI7MrU3zi+AorFEJJh1igi3l+dcSX7lQ+a1W0lRFu9mAy+I9ZvWKC03P4+jCHvOjRkEIx/4WcNq4fIh9LMsL6jhymlEi8S7UNV7AyyLJxw+YXVJ/LNXII4n5oFV9ZPFk9GIuQ4tOfS4gszaulmX61WPZtcpnDVYyBKM31OBNbDpqdmbgT3+C4fNMP3+P83T8lL9rnkrVncHna8MksH2RISu73i5dvRmZjCrZckVFCRAOnB5DiV59RP4SIo6aJkVikTiDAfbG8NT5R9yq0iyFcm4myTeef3YIgoSuvhr3yRn8QbAtGj+BBx7uwz57TUYS6j7DGG7+0ngRkdAssXmoAQznuCWQwKuqyLnwgxd21blOe5T5gHnIygJmw/jceiuaZGjkTQQfiG4WpUFCyA3ehoJW0uwjOQXhtwjOV0QRIBnRgML13Om1b4C27e2/DGF2exWWWdQD3LxipQdPZFtxJYPXo+KbpkCwX96L3uBp3hkgWohYitMFehHl6/XNxo4BnzaHu4We5GHoZJsTwcphS7VF+dhMNZFXnyfRdRnZHLvomE9z/GadCWvbj69dRfQIIbVz9RqQjEY5L5VbqQL8buq4k63uT5vJLXaVOh6hn/M2lgeP6OSFa1vrlC5KY4VAuwH6c5ZAsokFwKFG9g/8+ArT+MBF9t5sLnGaFSCaEeDaHJwIVKmMtaWuhnaPLfTD6FOQZF5zADPSmgQHWn33bsr/hM2Z0EdFN6ks9arqcuA97sQm5cdT1om9ikLSwr88VWhWQjekXWPvkJDNAaxXXToK7cELkAYWpj93RTCy/KEQa2VUCsx0nWoihNBJpn1apWlg8CHKr7KqJYOdpsG5tfiEBbfd5U5Zh/qgKQQRAtvq2sGX7PLL8SO9WoHXb46FE6KmT76NvTI4+Y+JfFInIFowEQg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1c5e8de-bc49-42f0-18fe-08dc2bdfd3cc X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2024 15:32:31.1848 (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: ElM7ovHrOpA7/irrCHQ6sg5dtMIUJAkUZSqqwYue1g3G7bEekswjtXPHP608zQn2euNwkZlUNxeKVEvsvLMzOtrXHEtEIqjvBfXlzIKsJ7s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8301 Broadcast source requires to create multiple streams for one pac. This is required for multiple BISes support. --- src/shared/bap.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index e26dbf944..f0ffdebfe 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -5156,7 +5156,7 @@ struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap, struct iovec *data) { struct bt_bap_stream *stream; - struct bt_bap_endpoint *ep; + struct bt_bap_endpoint *ep = NULL; struct match_pac match; if (!bap) @@ -5212,12 +5212,32 @@ struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap, match.lpac = lpac; match.rpac = rpac; - /* Check for existing stream */ - ep = queue_find(bap->remote_eps, find_ep_pacs, &match); + /* Broadcast source supports multiple endpoints (multiple BISes) + * for one pac so allow it to register a new endpoint even if + * others already exist. + */ + if (lpac->type != BT_BAP_BCAST_SOURCE) { + /* Check for existing stream */ + ep = queue_find(bap->remote_eps, find_ep_pacs, &match); + } + if (!ep) { /* Check for unused ASE */ ep = queue_find(bap->remote_eps, find_ep_unused, &match); - if (!ep) { + if (!ep && lpac->type == BT_BAP_BCAST_SOURCE) { + /* Push a new remote endpoint with direction + * broadcast source + */ + ep = bap_endpoint_new_broadcast(bap->rdb, + BT_BAP_BCAST_SOURCE); + + if (ep) + queue_push_tail(bap->remote_eps, ep); + else { + DBG(bap, "Unable to create endpoint"); + return NULL; + } + } else if (!ep) { DBG(bap, "Unable to find unused ASE"); return NULL; } From patchwork Mon Feb 12 15:32:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 772122 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2077.outbound.protection.outlook.com [40.107.6.77]) (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 13D523B799 for ; Mon, 12 Feb 2024 15:32:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751961; cv=fail; b=Pfoj7+3JBGRfjMb3SRylJqxGJOZLYh5lxQQcFX+QDby0ufzPotfaF/zXDK8dzIdaclNuOPkIbISI1rjwXR+InihKXiwB210TvMklFTGB7RgiGrTrBb6+VwcMGLn588VQNwpo1c1jAavV/6ubuSmQe/0s90EH3o7BBhzHA/PAEN4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751961; c=relaxed/simple; bh=CRCGugpck/+qO6ArnikxW4NC0SJVfFatAx2T/CW/Hc8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=b67UUPaw1yqkBJC8Bn30ZebkAvV1QaIkdPIkrspFoRLnY8UPzcwECgxsXjdfNoBGSt3K9E0nc0Z54H5XaXLTx1umAQamDnW+Rjn5Dkhg4T2pbB8uGHgVO0shZOrOBkOH378gZVM/RSvsS5LVtHB+8bjZibSiyOlmSMQaQHzbbF0= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=GV5kIeYm; arc=fail smtp.client-ip=40.107.6.77 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="GV5kIeYm" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GuVMaIS2msEGVl4Opvk4tJq/FiNl/lI39NyDNAHgwt8nbNtwGyh28fG0pkbclvDWMA4OVGBn6HHKelbgg9p/hXWA9QHMbIKCBWSEEVXfQgA2nEZt636uAZ3dihyxpAAYF6Hpfdw1q7+L7lw/WCMfAq0AV34vRQHHTHfh2HIXZJJGQWY7Vrj3vxQ1y0GzjyhetMCa5NOCH6ftfMYzqRHVlOyNV4Wo8VdqkymDwlkNKutKmt9fmGfHE6I9ZGBXkdRgRY9P1taZepMNsH1yNL0QNosLKT50iheyITOa2f7zr6quR0QbfXn85iC6CCOWBJUmTFU7tDLuS7clZrjq6k/bAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=ycROY/n45NnvxlaM4coSi1tjNHuEdZI61E+owK/S9l4=; b=DNg9WyoQ5ADxN0kIjhgy3bRtRUs+kzmdYcPMoJfdqGF/x3qiWqlU7j6qK0CNCEuPjULdjBJgIRZ1n5C7ZvCkx93cxvjEW/dvk9C8Q/Ve2DR1E0A20kZmb61OdFNq2OPzq4JquxhWEsa7qlJ5DxmxuEVZCH+GfE4S0436HtptnNo1V4L69rhdV0wK079V3uaUOaJK2QOl5JJFWbDBqlbyXjXW0H8atyJKt7BuVlid+LDZskYalbIlDhULa5LhVN5oflwdkc8ke4NxBLHa0aR6RwFuoGxY4IvYT/0Yvp0PeySp4D1bfwwyrI1tKKkLIiiqquaYJAT9GgGTHOmyBlT8eQ== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ycROY/n45NnvxlaM4coSi1tjNHuEdZI61E+owK/S9l4=; b=GV5kIeYm7katRiHNuuKF2vOR44X0hEG+ejW0QFdAkuswqHjjtKZNLkJ/b9PVoq+AnWa41qTZxER/YQFf/3oiRZ4ItchrPDYif8bXG+ZBOxCRZPdSkf6krsmPLcwQ+VMvDHNfnQ1TBkkanT2eAHyIJJKJbkw2H9PO/qT7OOIXzZ4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by PAXPR04MB8301.eurprd04.prod.outlook.com (2603:10a6:102:1c5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.33; Mon, 12 Feb 2024 15:32:33 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81%7]) with mapi id 15.20.7270.025; Mon, 12 Feb 2024 15:32:33 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ v2 3/7] bap: Create a new endpoint for the next BIS configuration Date: Mon, 12 Feb 2024 17:32:18 +0200 Message-Id: <20240212153222.8191-4-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212153222.8191-1-silviu.barbulescu@nxp.com> References: <20240212153222.8191-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0PR02CA0009.eurprd02.prod.outlook.com (2603:10a6:208:3e::22) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) 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: VI1PR04MB10073:EE_|PAXPR04MB8301:EE_ X-MS-Office365-Filtering-Correlation-Id: a5b23c92-9bc8-46de-cf0f-08dc2bdfd52a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0DICoEOcMvo4qnZkD1X1Pc4dcTqGf4Hbo0zFKlPWcG9mWvCTv+nrp0Mu/vYjcYd13KS0x7bXaXudj8vEsDJfseM4gw5DPe5PqW2mUlouOZhiSKstaV2s1RmfO6zlFA2A6T71djfSEGQG4jzAzzg+7M0RfV3uV7M+ovAz5rWJNf2Q0Fyl1qBGabfU7LWk8tx7anUBEr5K6TWRoV7y8O4nwkMkK82kcAb5jZYTINaPr++oMo++SG4SKXkQTddQQonsnqcuL2g7Fngv7RVFh8MiGpMT4FaGew4mMntjUXfk5WFsz3eiOsOe3sx83ASeibqQqFrqzjOwtlUDY2Nh/AMlCQBsIMkmsL75wDqblS977UoFTmjQpCr4UJ1FnPP/7uvdf1HUsO7mWaMu1yetE4SUdw0HKo9ehmMUAb+u3/Y+OYpt89e9jG32qYhu4Z01b9NgHrw+JwQ9xHTCy+rpYqFJQuXnyEcSKudZ3mq6SdTYQm5+7Vzt8xqj6i/G9EynMT1lxJtgfKYA+YbjGo/tr8TJWRdVmygX5+W7DxLWCcKFDkgF84m0EwZywK2CqC+orum7 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB10073.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(376002)(366004)(39860400002)(346002)(136003)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(6666004)(316002)(2906002)(5660300002)(66556008)(66476007)(4326008)(66946007)(86362001)(8936002)(8676002)(6916009)(6512007)(6506007)(478600001)(26005)(2616005)(41300700001)(1076003)(36756003)(6486002)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: gPmNt8QworZsp9IKcPZP+BV7yaZ+WIr6Z6BgwhcFRa+R6AFnb66En6lx9lTSbKUGyx1aCEVccOz2idzIF8IxXMb3lRcBwlCt8iw/NJQo8viimnET8DNuUSZzQLunUEiRolj2htCT42uvu7OxZTtY5fMZlRRKjr965OPc4OZrSEcBeXuLOYScu0V3U9OYKdbPY/KjuJD+n/F/8kLK4Bs4JoFqKst6X1UNygjsy+m4tjyHIB8r71S4IJx+EOEDboi+XF2GspUkGTgFkE2nQnjRyLlXnVs5onRl5u5++ZwN9cMJQBKxVl1N0AI4y5+AJ70pdQHpt7eXP+N4M5RWad1C+OOdi8JOkFV/Yq7DWDtTuveHO+pkbawJguDpVA2CWL92BE55H7HBb4zjaiCvy6ds9GLt2C9K5lvVyCHBiWQu2isOcXuFYp2uGso6JzDyg4qCkEZSEcTIZWomAcErZ3nqRLMOfjzCrXtavVvAzrMTWidOkBlWitKhvmdaJ+IeCOGvC0VdvLRzOZ57evxgae84mXLZDrb4lsj/sQIRin+WEypbeEIgmS8Ajau9a1l/IP6cOSSdL1iFtb8o0JSOTTB8OBnl5qAcAkFjLxjHumiILlQWmqZRt3gLFI1cnjaKewTkyHb6KUryyWRhTlFIAPl78i0PJW2WJ13D8rnjXOFhM5ffp9X6JxAZylsrmRjzezw4kji9DIrNEUCzEdYKGkR/MnTvqd3s627gyiVJyFgQjq9rNLtdVucRQUt+ukmJiIcaZ4rhwxks+k8Skjnb6RKW46rbC2Jr+R9BJ18csW8jUQ8dQajPhw66JYFZQcK9wuejBpKvDPvPyi6DCFCBiBDSn2h/bWlmB5SIQzI498GV00kQIs+Hi8SV/Okg9c7kQYlt5nb1IeCovVwk5euBFeMR565kWH6pSP/WL3ar8dIGhl9BowGW5MBOdPX4LXWpfu5UGC/RoEcK2atxDY+9AUwOMpXRcce7K0e7qyLoSVy7aZG4OItgUQrxOAeEK4SHMrRvT1swZsT16KG8WWaSxPPDNZomNrxqNK/uKwWvEMdIjePtRHotUWAbpqBgyROFxyBH/n4ajzDB+hjJe2wxm+qMzyvhl1XFfOkEZB0GVWv3oK1Ms+pzTmWEvcMJ/Lg5AA4IDKZSQCLLoDyciuM2st6WyaPxToV5TCRTzR7B3Htgc5F75B55UCoDMxnxnC7yq2xTjG2XnnOnz0qspnckgLHaFeVkRulwRXfBJ+Wa2BVYtsE29bquX/r8VEi+QZsyeeRiY8UlOr6AGVOAGO16ZaDSeAVxaQvWctANBSFGeLl6K5u3JFHm8ng/UCOhb+kI2mXETHHzE8cH5dsKsnsvUxTBqAUhHWK71V3zQZPUnJamSmSDxxqg5SyclVmWWPdN6DzO53vj31jSwk5SSLC6CInqnkw4ETNys3DtHIhM7l17dEgyznj2aF2bUf2yp7yHpFaIYTz54XWV3X6Hs/r1VgyziwyAxYVBAaaxiNEevFV2UO2etmBxuMvRSqn0S8pPoEIAdp97yn1Jyw3iTrNnpIQJO0VaEiR6VYUa1J44vb3fdQts5yokG9KD72Lzh4++PIeU0gvK6w77he4pSqvbE+LWvQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a5b23c92-9bc8-46de-cf0f-08dc2bdfd52a X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2024 15:32:33.5159 (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: wa4g4KxwlD4LQ2rXlGKbULxnFRbP9ivn+OgrRzrNjN7mLZg8n8ICRLdqE6nMWXT5ZFZVKasCnMVJsWXD51w5nmYDfdLmtfQoqPoLXcpD42A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8301 Add support to create a new endpoint to be available for the next BIS configuration. Broadcast source requires the creation of multiple endpoints, one for each BIS for the multiple BISes scenario. --- profiles/audio/bap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 38ee42894..ffd742d7d 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -926,6 +926,10 @@ static void setup_free(void *data) free(setup); } +static struct bap_ep *ep_register_bcast(struct bap_data *data, + struct bt_bap_pac *lpac, + struct bt_bap_pac *rpac); + static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, void *data) { @@ -982,6 +986,10 @@ static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, else { setup->base = bt_bap_stream_get_base(setup->stream); setup->id = 0; + /* Create a new endpoint for a new BIS */ + if (!ep_register_bcast(ep->data, ep->lpac, ep->rpac)) + error("Unable to register endpoint for pac %p", + ep->lpac); } if (ep->data->service) @@ -1133,6 +1141,10 @@ static bool match_ep(const void *data, const void *user_data) const struct bap_ep *ep = data; const struct match_ep *match = user_data; + if ((!ep->lpac) || (!ep->rpac) || + (!match->lpac) || (!match->rpac)) + return false; + if (ep->lpac != match->lpac) return false; From patchwork Mon Feb 12 15:32:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 772471 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2077.outbound.protection.outlook.com [40.107.6.77]) (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 3D3683C092 for ; Mon, 12 Feb 2024 15:32:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751964; cv=fail; b=JXeTv64/WAvZIMeoKy4r+XXs9mwIEiXb/Hpq0Sjoh0kKczlpohXzEXr9iVCJjfCWOe1N57E7CEXBuFEpwc3772iDaq6puf2XeO1rgmTEKaPWlXbBjFuqFuTaZfHjlXTHVgMsTuSkWMsRUqelTCvAK8CthEaESZOhDmRVUQ9O9fQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751964; c=relaxed/simple; bh=N9NxA+u0BsScDfm4y2vZT9Y9GTicbxxgxCiSMXE58qo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=NBvnTGzAQ6devZCCbsvFZmabeL+NCrr0P+LPZS7JYmgxi7FGDsMGAGbi/vt7x94QYm3cfoABpg5J3LZ/iv0w3RTutRBz9ZlC39DTdxYm6Y52uSsKQ+6LUTakfUdhj6BzmO0HU9WkuX1m+qbD8cqEseexOlcPSz0m++XsyFiGTTE= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=K4OhfRxQ; arc=fail smtp.client-ip=40.107.6.77 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="K4OhfRxQ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CJEGyWnZihxBbO+sb9c2rOm6htDUrCyLRkchwVmblNpgja3AEYmGqrUHDMhopZRwxlsRsXt/aY4lcyH3/XB2WlrCisM899Q+l6rdC+YAOkZkWEs8p3iESaKWWH2r5OMfQOuK6JeWZIGJVZ9oHXxQeU+helZH5OgjJirvF0emXlG/OYRGQeURZkuVDhcuUXl33ntCxzBT+9cDSFHV+yejPXI0pHc+Y4MSZrkcxFOd0PB5PoZc8r1s5tn9ou6MHtx7uanFXPKWuIosuW2SPEmGUJI/wg/hxOuRuuH6u87AkKAcNvBseC0gP4/OOJ0WPaAIU4iAkIeuj1fYA0holvF1nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=/H/wMe4ThMz2C/RsU1grmhMzmim4s5YA2NYbFaIJeFA=; b=ajujRuV4WUJQZbIA7G+d1a2hWfmufNl0+n9NaoVTPGgqO+V8m8J+YZjdqrTv20BmzmhKnjmc/BemBu6n+rYmoDbgre7SbrdP1eP7dV+xmg/UwXOKD8keNancmKFmyit0wVLi/AMffI60uyqOFJ70VhoT12fCu05a/KwFsnAyWh8ArlwXr6SGvNv3FWgaIC889OpzSsFcGyzAxBq4wR7mCof7bBXG5j7LLyBoytOAPt0POaJoC24/Y2T+s8wwcyjzrsByGLbnLQ4F1/WgrNlTSRmx6pQ4YCuWpymHxv+kHBO4X/O71z+Un3eStvBzON5Ipu1ZysIdaE1UtAyVEAMZZw== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/H/wMe4ThMz2C/RsU1grmhMzmim4s5YA2NYbFaIJeFA=; b=K4OhfRxQ02YmJ6lpIWaWOvcHIAGjAxRFDbGR7g/6PGr0nblSGBpuYO9/HLcr/N4HdmlUCQWW2kCkpISM/zUZJE2VURn9GWrh244iA/qw2thwlT+5VSp+ZXfO7bxz7B0MvYbKmG1FkC1mjb5V24bshGXk4PqvvK3dNYIiVs5kVow= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by PAXPR04MB8301.eurprd04.prod.outlook.com (2603:10a6:102:1c5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.33; Mon, 12 Feb 2024 15:32:35 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81%7]) with mapi id 15.20.7270.025; Mon, 12 Feb 2024 15:32:35 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ v2 4/7] bap: Split bap_state and bap_connecting in two functions Date: Mon, 12 Feb 2024 17:32:19 +0200 Message-Id: <20240212153222.8191-5-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212153222.8191-1-silviu.barbulescu@nxp.com> References: <20240212153222.8191-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0P190CA0002.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::12) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) 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: VI1PR04MB10073:EE_|PAXPR04MB8301:EE_ X-MS-Office365-Filtering-Correlation-Id: cda5b45d-8c68-40da-7542-08dc2bdfd668 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qLxdKVullgoFOhE8ebhWxDL8wMGHsb++Amf8XReiPY/TWbykZmdxxBC3JONrtw9lIR2QXvad4COGbnTz+jHksX5b5z3wRmUH9dBJzfUgrgceiLzIIS4++hyL1bxU55Rjq2NRUF40QV4P9QTbCIVtG/wNmQQ8ppX0agnLIfEIyswKt0ntcEbpmqjitOPg3d+lHSyqGH4KNtfHgnyW2fTQJQG4ojqKcmbHQmParrCS8lUcMvx7IkCEMK6MHBEQ+7cY1TtTRj4wu6kJD2T6lxm1DI8dIoApDcSffqGjtyZHODLCO8yJtWDOBiKXV9i8XJVIuOu5oQAEe1/pGh0OC3xL+SLuIb+u34gnO+er2rmvCb0N88Kmz2PBUJ0od/sPZg5bXOscCDSc9OTmvaOODxhGfN2qeVtEfIeAh12O78yYfVFihHGxySy6NQYVl5hPi+59e4Yriek79abNT5aSJ8OoCI17lnZFcn/eWT9D94jkpBaizZ18ksQG6P9lBz0W/97ZVCBeXm02s0N67tZGxv14wyr/nf13e2SaJhnzdJZzrRNZeem0asUntC6b+Y1ip2hV X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB10073.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(376002)(366004)(39860400002)(346002)(136003)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(6666004)(316002)(2906002)(5660300002)(66556008)(66476007)(4326008)(66946007)(86362001)(8936002)(8676002)(6916009)(6512007)(6506007)(478600001)(26005)(2616005)(41300700001)(1076003)(36756003)(6486002)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: dtaVRfiFOPPoi6kYiMOVGhLVUi+/NHVYuh3TzqySxAXmVXDPXtJFxyEkRaCv10iTAbQLYa/no0WKDuzQCexLdF7HLg794dho/5MwVnuvjHJktpTAWpiWzFID7Eu1GfdTiueZbhBLUTi9oEJQ59dH8XhPOV0pByURfM+ASXGQ79RNtk/TCEMdDS4gzc34Yy60eeIsaAyiaMmX6zywPwKCy633Hj5sGbCF5JCMU4zwtFBqOpG9+JYtOVNb0BqEx459keYLZmW1LHAxWB5eSULyYAxqKBOEjb7zL/zN5o/D8+BldAugFFVSsYsUJ8FQGRvkQw2suWUkEkAxZcWZu8c64JCmAnf0r7i+m/flJ+Cfz9b8L9cWgVPCGsztr18ckhxxERxBjRHyuWzRbDAnBCgV1Fpwsxq/YN7lnM0YAML/duh6xtNzdo4pMrtGfAILAgcQCV8CPpECoSNDMA1rjLxtJ8htOF58zYdUCk+zwQuEtnAQVsLmp4mV+3d9y+qgomalBHuwNskoQ2IASwIcHOfSr6qxw6RnQxBzqQloO4Ljy6UTGW7gQ3x9uk+R5ybXTh1zhfkBzZtH0MBNO3HnfgHRXDmD6Sj1wQAYRwtcfLyCk3fcmy68ns2keZ3QxxX1NVEpSEB7AzIf7cBsOWdiikTuBK0ncid8ccTU98rjjT1d37t7VIWLTL0ekKhpTxWJzzKWgKhTt7Hc6yk+cgYNm3oNHjb0NLI4S3QTVrLGTlLz+uz2OZoVwCFziycdnutTjwI6FyGQImWIClpesqwZV3GLlVF6hOGU/Wq49nG31+jcGQYc/f5Wk9NL+BP0XWLzsrkrSxRm0teZziwxoIGaXF/JcftQaq1Ms0EgV9OvizE7CPlEnBAuGv+JGGG8lGJCQt58fgkDpSILfo9++8VUVMc4yOQGgKdr0DFplZgt0vVOvq30dgaSLDm/2ILnpQB0QLjIDiHcrnQTBbOY+aJFBs13jcrXHxMVEq2OQ3MEzLd1ILh4m10oxiqRr36UhDdpEo3ODFhd9QdOblekVo+HV8yAsEDcY0RPIcsEJqQJE0BelaYWzjA9QRmGlYIgxc3t8N92Y/ggHJMcs882n1jKvSg6pL7eIsP4OWQ2ABhfvn+SfKaIYkTPlBZxeyZAsGCNarUgAT/A8T8OfyeNcbVMYCID0dq1U+vesJF5H/PgE0IwLt7GOKFNxpo05hskjLzaS9eBeQZ+DMQu84AKQ79LWb7tmlK9zKaRPOi9C6lLbpj+muYg3Y1LATCNpXhxbJTf798zi/Nr90/E2fzpgDncfzF2JKV2csjLVg5mNIW3OJlCqDcEZB74f4FAj/B6EBkQ7ISZ0cFtwUHsObd0gSF51ex1HSw89ba8TpgOIbTy85NE45iNvb2u5L0oPLVIpSocQozSzOOr9/ix7neup3sb59qDnCFiz4r6LGunKZSBXcGlFJYvdaec/xpz6w2kes9aGj/ZaZuYbldqxJ46rwkZoWbcVncIrLgABpjgJFT5gw9NNOOxihLO9B+GVBtwxJ0zlN1aoFId9trINPVb8Brla4Wp5SNHU01vHCcZLvdhi0GK59X/FjWKGPyLsb0OOMt/D7pfN7b33PnSxFvvOQAGnBK6fA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: cda5b45d-8c68-40da-7542-08dc2bdfd668 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2024 15:32:35.5822 (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: 2VQ+f6HGEUu8kYs/eVZyq4kKAR9GX8jxfL5FLmhWqD2gVi6xlxUlFykNArGH/7S2i5HNl6AXxbOyzdrcM3IeaHLQ+YByzgAMjGL14aS4h3E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8301 Split bap_state and bap_connecting in two specific functions for unicast (bap_state, bap_connecting) and broadcast (bap_state_bcast, bap_connecting_bcast). --- profiles/audio/bap.c | 157 +++++++++++++++++++++++++++++-------------- 1 file changed, 107 insertions(+), 50 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index ffd742d7d..cf1c53b30 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -2110,25 +2110,19 @@ static void bap_state(struct bt_bap_stream *stream, uint8_t old_state, return; } - if (bt_bap_stream_get_type(stream) == - BT_BAP_STREAM_TYPE_UCAST) { - /* Wait QoS response to respond */ - setup->id = bt_bap_stream_qos(stream, - &setup->qos, - qos_cb, setup); - if (!setup->id) { - error("Failed to Configure QoS"); - bt_bap_stream_release(stream, - NULL, NULL); - } + /* Wait QoS response to respond */ + setup->id = bt_bap_stream_qos(stream, + &setup->qos, + qos_cb, setup); + if (!setup->id) { + error("Failed to Configure QoS"); + bt_bap_stream_release(stream, + NULL, NULL); } } break; case BT_BAP_STREAM_STATE_QOS: - if (bt_bap_stream_get_type(stream) == - BT_BAP_STREAM_TYPE_UCAST) { setup_create_io(data, setup, stream, true); - } break; case BT_BAP_STREAM_STATE_ENABLING: if (setup) @@ -2139,6 +2133,45 @@ static void bap_state(struct bt_bap_stream *stream, uint8_t old_state, } } +static void bap_state_bcast(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + struct bap_data *data = user_data; + struct bap_setup *setup; + + DBG("stream %p: %s(%u) -> %s(%u)", stream, + bt_bap_stream_statestr(old_state), old_state, + bt_bap_stream_statestr(new_state), new_state); + + /* Ignore transitions back to same state */ + if (new_state == old_state) + return; + + setup = bap_find_setup_by_stream(data, stream); + + switch (new_state) { + case BT_BAP_STREAM_STATE_IDLE: + /* Release stream if idle */ + if (setup) + setup_free(setup); + else + queue_remove(data->streams, stream); + break; + case BT_BAP_STREAM_STATE_CONFIG: + if (setup && !setup->id) { + setup_create_io(data, setup, stream, true); + if (!setup->io) { + error("Unable to create io"); + if (old_state != BT_BAP_STREAM_STATE_RELEASING) + bt_bap_stream_release(stream, NULL, + NULL); + return; + } + } + break; + } +} + static void pac_added(struct bt_bap_pac *pac, void *user_data) { struct btd_service *service = user_data; @@ -2332,45 +2365,69 @@ static void bap_connecting(struct bt_bap_stream *stream, bool state, int fd, g_io_channel_set_close_on_unref(io, FALSE); - switch (bt_bap_stream_get_type(setup->stream)) { - case BT_BAP_STREAM_TYPE_UCAST: - /* Attempt to get CIG/CIS if they have not been set */ - if (qos->ucast.cig_id == BT_ISO_QOS_CIG_UNSET || - qos->ucast.cis_id == BT_ISO_QOS_CIS_UNSET) { - struct bt_iso_qos iso_qos; + /* Attempt to get CIG/CIS if they have not been set */ + if (qos->ucast.cig_id == BT_ISO_QOS_CIG_UNSET || + qos->ucast.cis_id == BT_ISO_QOS_CIS_UNSET) { + struct bt_iso_qos iso_qos; - if (!io_get_qos(io, &iso_qos)) { - g_io_channel_unref(io); - return; - } - - qos->ucast.cig_id = iso_qos.ucast.cig; - qos->ucast.cis_id = iso_qos.ucast.cis; + if (!io_get_qos(io, &iso_qos)) { + g_io_channel_unref(io); + return; } - DBG("stream %p fd %d: CIG 0x%02x CIS 0x%02x", stream, fd, - qos->ucast.cig_id, qos->ucast.cis_id); - break; - case BT_BAP_STREAM_TYPE_BCAST: - /* Attempt to get BIG/BIS if they have not been set */ - if (setup->qos.bcast.big == BT_ISO_QOS_BIG_UNSET || - setup->qos.bcast.bis == BT_ISO_QOS_BIS_UNSET) { - struct bt_iso_qos iso_qos; + qos->ucast.cig_id = iso_qos.ucast.cig; + qos->ucast.cis_id = iso_qos.ucast.cis; + } - if (!io_get_qos(io, &iso_qos)) { - g_io_channel_unref(io); - return; - } + DBG("stream %p fd %d: CIG 0x%02x CIS 0x%02x", stream, fd, + qos->ucast.cig_id, qos->ucast.cis_id); +} - qos->bcast.big = iso_qos.bcast.big; - qos->bcast.bis = iso_qos.bcast.bis; - bt_bap_stream_config(setup->stream, qos, setup->caps, - NULL, NULL); +static void bap_connecting_bcast(struct bt_bap_stream *stream, bool state, + int fd, void *user_data) +{ + struct bap_data *data = user_data; + struct bap_setup *setup; + GIOChannel *io; + + if (!state) + return; + + setup = bap_find_setup_by_stream(data, stream); + if (!setup) + return; + + setup->recreate = false; + + if (!setup->io) { + io = g_io_channel_unix_new(fd); + setup->io_id = g_io_add_watch(io, + G_IO_HUP | G_IO_ERR | G_IO_NVAL, + setup_io_disconnected, setup); + setup->io = io; + } else + io = setup->io; + + g_io_channel_set_close_on_unref(io, FALSE); + + /* Attempt to get BIG/BIS if they have not been set */ + if (setup->qos.bcast.big == BT_ISO_QOS_BIG_UNSET || + setup->qos.bcast.bis == BT_ISO_QOS_BIS_UNSET) { + struct bt_iso_qos iso_qos; + + if (!io_get_qos(io, &iso_qos)) { + g_io_channel_unref(io); + return; } - DBG("stream %p fd %d: BIG 0x%02x BIS 0x%02x", stream, fd, - qos->bcast.big, qos->bcast.bis); + setup->qos.bcast.big = iso_qos.bcast.big; + setup->qos.bcast.bis = iso_qos.bcast.bis; + bt_bap_stream_config(setup->stream, &setup->qos, setup->caps, + NULL, NULL); } + + DBG("stream %p fd %d: BIG 0x%02x BIS 0x%02x", stream, fd, + setup->qos.bcast.big, setup->qos.bcast.bis); } static void bap_attached(struct bt_bap *bap, void *user_data) @@ -2468,10 +2525,10 @@ static int bap_bcast_probe(struct btd_service *service) data->ready_id = bt_bap_ready_register(data->bap, bap_ready, service, NULL); - data->state_id = bt_bap_state_register(data->bap, bap_state, - bap_connecting, data, NULL); + data->state_id = bt_bap_state_register(data->bap, bap_state_bcast, + bap_connecting_bcast, data, NULL); data->pac_id = bt_bap_pac_register(data->bap, pac_added_broadcast, - pac_removed_broadcast, data, NULL); + pac_removed_broadcast, data, NULL); bt_bap_set_user_data(data->bap, service); @@ -2623,8 +2680,8 @@ static int bap_adapter_probe(struct btd_profile *p, return -EINVAL; } - data->state_id = bt_bap_state_register(data->bap, bap_state, - bap_connecting, data, NULL); + data->state_id = bt_bap_state_register(data->bap, bap_state_bcast, + bap_connecting_bcast, data, NULL); data->pac_id = bt_bap_pac_register(data->bap, pac_added_broadcast, pac_removed_broadcast, data, NULL); From patchwork Mon Feb 12 15:32:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 772121 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2077.outbound.protection.outlook.com [40.107.6.77]) (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 1F7C03C48D for ; Mon, 12 Feb 2024 15:32:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751968; cv=fail; b=lEOtExE9S3D3ptyZs7/CWUe3pkoiEk4YeF9JixDoaBnGvGeobDD1ToJg0M5qEeulN6kcRy5PqQ80Zp6wUsu6fsXRBdfbFtsg0fGmIyXSIMpZ+v6VzHzCRQjKi5oJZmoIWm8DptZZ9bNScsmpcbd4sUXCklyEXbZZJ6cJNQmVADU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751968; c=relaxed/simple; bh=rQ2BK9wSZZBW4MU+ZjzMmowPBHtl+yKtF7KYLy0f0rk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=HXfxufajAiFw6Mah2a42aVD84jmir32IJuLMwZM08YLQK/IikKoKgfj7ankzpkww1/iS+KWSBdN1sIu8cHlKvf47Zsd9xoLMMc1274reDg5P55tImOqiFtrx5WL+RLE3/5sSNsdXz6npcGa8Qi8pTgATApLxXhK4d/BkleVbNMI= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=dPqkRRAk; arc=fail smtp.client-ip=40.107.6.77 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="dPqkRRAk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BCo3hjrxMdHpK2kVmhLeWQnlcc+3WWzKz9G32BnGvuOpGBYS39o+KNzFxrRZO0ot5QQAKTmQrt011d5HzPm/wnH4XgCzORYBd5muvtdnwejv1Ra3UqHPyagbXKqlG8gn4OZEio+BFzxHXbi4S/e51JDA+I06W1w+hG7cnmcQ1rmVeFXNP//6XSceGEXZHXzuskoJc3b6UloeSBAGXVJaSRXgQBT2RXF9qaWA2rB2Rp+qDdQGY0n4EQu1yT+pAO54mxlykjkGS/T0F80b+Ik3G9MLQvSEhCB1y6KiYuar5mJhg33gnjlgONBbHwHyrwRC6jdHPCKm9z4qEWOwrI2Oaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=FTC9gPbWd/ul2xncTm8P28xh+GIbSi4ISeruqlif6HI=; b=BulgBeZZ0xfJBitcUKliTtLJOF95k8EMpQzOb/DzBMkusw5AKJyN9LxvYSi4Mfr27j4aDYyB+lbWc67D1Sz00zw7UwZRH2xL0KLl0yV/kS9Z3l207WwNeSuUYag/OijXWrf+c41FqB5W9/+5v4ZFcBTk66U2kOnRRWdKqkyMt6Si7glTKMUbFwPXopiaMZLrTX63UhnyUsXKRaM9mF2wzh1pOJzVyNgNYn9Jo0565rHy6PLmo+eWeR/phx02ykcjY4joFSuBhB8kesJm83CmCvYf6ZQ9lAcs+SSxSgd2aczq1CeEs5A/XSvtMftgPqRzGssGjVcsrqxEUYG/trJBTg== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FTC9gPbWd/ul2xncTm8P28xh+GIbSi4ISeruqlif6HI=; b=dPqkRRAk0dH++wG6QeeLBwK6w/Pz5exbpqJ0WEV2K9Xa7zAoIMDogdT7L7LBmTKY1Wd4cCDROcrDBV8/NPtu6SLgoRbpbmAKPPLkmPajk1Ds+UOO/fSGvuvssyd2K/fgLtdpxrSi4Ig/6uFW0ty/NKABrHfAcRn7bsmjJtcrNH8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by PAXPR04MB8301.eurprd04.prod.outlook.com (2603:10a6:102:1c5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.33; Mon, 12 Feb 2024 15:32:37 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81%7]) with mapi id 15.20.7270.025; Mon, 12 Feb 2024 15:32:37 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ v2 5/7] shared/bap: Check state of all streams with same BIG ID Date: Mon, 12 Feb 2024 17:32:20 +0200 Message-Id: <20240212153222.8191-6-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212153222.8191-1-silviu.barbulescu@nxp.com> References: <20240212153222.8191-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0PR05CA0087.eurprd05.prod.outlook.com (2603:10a6:208:136::27) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) 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: VI1PR04MB10073:EE_|PAXPR04MB8301:EE_ X-MS-Office365-Filtering-Correlation-Id: e8f11759-d611-416e-62e6-08dc2bdfd7b9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QpECMZH4PeXtkZ7iotk2igDWEOgg7QPTqEGKYjT3NlIeYzp4euRzMnCIiB6ddpz7PMopC+Z1qT3Zz/anhgrUazp926VObu5MjD88b4i6524DU8CmOIBulb6ooN3pS9JF6ptq/2uSOliPsD0TbfYt9r3nfxGakkUFyF9PjCgsp1xRGSq9SVes/kcANOPZZmZ9wZNilJPalLS7S0yERkEO5wP+1o7tPKWzRqeq9VeJvYv0+cGMnPA4btCYi0iyzlEohhi5/t4D0nl7YRs/wZp8xI0XOkrnFpWEQSYxu2IDEuCNUsOaaafQ7Mi3p7p0SFk+FfwxGITb1HGbbVDOS0Xjzch4HyhpsOVwUdgQ/P3t8xkKIklF1iTme063ZV2y7Kkc9T3zaEcSWxG4MYcD2gOlXqLl3ZMzUm2o0KTtNjz9+EYVO9g5HGXjgiFR05FQwl3fMdEeqsDgLmMbNGa6Y4H/r3ay+oTxD1p2siik35V5j+bTDsq2ea4eDPDxl4suJQEfM2X/FyUNeIiE9ndLkAr1UAQ+KO+7vthXGRBYz1RyVg9+GOKNNJMnVG/tmbO36XXs X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB10073.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(376002)(366004)(39860400002)(346002)(136003)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(6666004)(316002)(2906002)(5660300002)(66556008)(66476007)(4326008)(66946007)(86362001)(8936002)(8676002)(6916009)(6512007)(6506007)(478600001)(26005)(2616005)(41300700001)(1076003)(36756003)(6486002)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zhhgOr5eM6DcWwDYZdS4f9UpWU1TltQUMjPKZZYU+9ZdiJVMtWvjZ7BkvUvY8Xsr21ttufyGdiTAdDEo2u79VRQtWD2FtT89T9pXz3qKijfOhZ4MiOv6dFML+LVK0nnwp/MUEBNpzxKdfycYKifE+sBN1VWhruWUHz/tTLAPxxbtmwf4nOOI+bZh/ryRTGeGQydrMQhaHyt1TjnrIkrB9OoNOmz6EMRxm5CcOPstF171ykde+cUJjo9+zUuw5IUMfSjaCzsGV9fxK/82G0mOVjmX91NgVQ/PHRSmbst4/w6WBSYoNLNMcAFQG6JQYYBOAzI9MqX3rM4ZkGWPXhwEdBvBWOPkfhWg/Ot6+lBiM+9llvmBG2yGDcBMM5HC/4dKB46SYSQ7HqpGw6/JDDqaR/EaPJC9mT7RzsHlSNMiViDIQZNEkx03GXgdXgkFeUUnd6uuwf9gQz/pgm1pGwLW3f8o3lLLuMSzDd0ZMyt4g67P/AYS1y/EMpjLmf4xLLGYAldFg/TiIAGqOWuGbYGHPOpEd/43KAdKi8H6wY7qol5lKpgN2GHyCwf29V/pBuSYIPtrEPorfuoU6uwfVe3D60IAaObhiMfOQZsXOGAV1Y3wn43scU8jMv4tzHO4yQpoXYlv817eN/dAslDz89kz7vVjiAgta09HcasTX1nPQ9ZM3MBTU/NWE0P27RbhOaj4mjJQAtBI9h61yQ/x4wb98xAozOim5rEYTeHguLakt2wAsbiFKexafGh/PK8U0dQJOs58gjFobT3pDD1UPbRBosdRNXJak/DvTl8bX4e71b+23L8drDuZQKxeLiRuaIGkx1xPoxVcXF26XXxSvnnH/xvtx6yNQnDMYmF0Qtuqh//wlasxXox7ca5BK5JxnYBWU4RuH9J3B/XAV3nyUkx+CV6QkIsHZyfI99ysYcbiFI54tAe8eXhRFpXsx0eAD+29UkEQw9jQs7qHpJHpcyHM30bHiYJftrW0j3AEXtsu6AmKGaI6VJLvbHOMaQY2jGmpWxZbzbYDD7dOWP3wgGf1krn9TQy3iRpdJ+lZalp0rtY0LDGEJbKhIsu48uh507D9hEMREEGsuEy7D4I4DqbgHwRcE1W832JjQzQhhJV+Er/DjJI//zZKPP7soyDSrlrVUw93PFD39iosZadbh/UKmdBwYMs/bMe71jcMxIU79WU+MO44QeesH9ElQgrs6Na68V1NTIdqaMqm41hSty0hrJVOPRJDlx+P2vy73MJSOIJDdhBAt8tTSo25qvusbcsPDn/iHE1sDTOpkDqdc/11Ohvjh7cw5OUb460hxcjUhDO+voaqIbHRdqhbtPQ2oq/XcP/70HbK00rC/IxxCspXMduHAGsEeKA6tThZ5JfAj/f36rHx7PeR4Um5gzoODIDH8KcxO60t7zbHbc0/47V0SBsAgUdW38ogtQZLEPjSqScOn7LxCJdh24rOWFV/J3nEZM4d+wJcFGcF/lDeTkCVgHzYp3lB/If6/qVbb/w/qbn3ZVrlWiQfm3sHixPopGiY6mUZFxBHnwPR44bYwbJK19aFucUieioYU0BhZjiNw6x0qg+LWnoIuwxHO1UC5yjjeLpAXHIFLVz5SidAGhvnPQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8f11759-d611-416e-62e6-08dc2bdfd7b9 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2024 15:32:37.8129 (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: OstxsmJIIQgmIxg+lJ8H3cxXdwZM3c+GDhE7Gs+LOa9U61n4n9Yw+m91XS8+m2AbNB4ObYkRa4lIl3hmfNUoIhWScuKFMc+pp1QZtWG1wps= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8301 The function is used to verify if all the streams from a BIG are in the same state, and if so it returns a new queue with all these streams. This queue will be used to iterate through all configured streams in order of their creation, and create the IOs. --- src/shared/bap.c | 37 +++++++++++++++++++++++++++++++++++++ src/shared/bap.h | 2 ++ 2 files changed, 39 insertions(+) diff --git a/src/shared/bap.c b/src/shared/bap.c index f0ffdebfe..2c5979b96 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -6126,3 +6126,40 @@ struct iovec *bt_bap_stream_get_base(struct bt_bap_stream *stream) return base_iov; } + +/* + * Check the state of all streams with the same BIG ID. + * If all the streams are in the checked state, return + * a queue with this streams. + * Else, return NULL. + */ +struct queue *bt_bap_get_streams_by_state(struct bt_bap_stream *stream, + uint8_t test_state) +{ + const struct queue_entry *entry; + struct bt_bap_stream *e_str; + struct queue *return_queue = queue_new(); + + for (entry = queue_get_entries(stream->bap->streams); + entry; entry = entry->next) { + e_str = entry->data; + + if ((e_str->lpac->type != BT_BAP_BCAST_SOURCE) || + (e_str->qos.bcast.big != stream->qos.bcast.big)) + continue; + + if (e_str == stream) { + queue_push_tail(return_queue, e_str); + continue; + } + + if (e_str->ep->state != test_state) { + queue_destroy(return_queue, NULL); + return NULL; + } + + queue_push_tail(return_queue, e_str); + } + + return return_queue; +} diff --git a/src/shared/bap.h b/src/shared/bap.h index 2c3550921..ad6bf2d97 100644 --- a/src/shared/bap.h +++ b/src/shared/bap.h @@ -323,3 +323,5 @@ void bt_bap_update_bcast_source(struct bt_bap_pac *pac, bool bt_bap_pac_bcast_is_local(struct bt_bap *bap, struct bt_bap_pac *pac); struct iovec *bt_bap_stream_get_base(struct bt_bap_stream *stream); +struct queue *bt_bap_get_streams_by_state(struct bt_bap_stream *stream, + uint8_t test_state); From patchwork Mon Feb 12 15:32:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 772470 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2077.outbound.protection.outlook.com [40.107.6.77]) (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 7EC753CF68 for ; Mon, 12 Feb 2024 15:32:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751970; cv=fail; b=F5ZTLRljGMrX6aEkxPI6KBMX3GCxJS/Nitpp1TFYubucJ3JVPzySfY2+aBjhDa7cnrHXklyk0O0F5hjeqgdJtM3uT3k2PThlh+4WmjPmoWiJDMDF0c7+JDmgTVkKfxN2hDKcJwBjia4gUaH6hgB8MtEawfB3FMeHNSDEMLMScSk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751970; c=relaxed/simple; bh=RzlkD6KNOZmKLx+zCox2q23qA0sp8u9N6cpEE3sZkhI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=C3HSQ6CBMP1toK7Qf4yWon3XaCXg+KhbS6xDOtPBJa3k49ymod1Kl62htqtVmCZdWfySGmT6c4xEwK6PhJQRBnTSDHxD/S48qiZdKAYyj0DQRoF0EMsxi2O+ty/8YlqVmvbsNcNDca5CYudzLYkTFXhAX3Dx9bBPqQj4Jvtq6Zs= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=j7OdPOag; arc=fail smtp.client-ip=40.107.6.77 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="j7OdPOag" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RaHLZg34F0ckB8PjvP3KHngUMJu2hoRLiBMrAG5ZR9W45i7CKTAkxZRcmk5p3UpE/ZdqXxZqY3et6MtdNRGgalG2zkPv+shOhHjhjcGA2VD0ljVNjSBN4Ri8u7JzDDS+B0amX/PStixHN4qbUjIJ/ucyz82bjBPoxnGuRLgaKr+gESrEPV5wsv91dnOndqJSwd9vjbURpHiKnarvCFO69/3GIJ45dd1vN9T1IYpKwvtApLckw53qC3CGpBCzExWMfM0vr9wyy9/59/0/Pw9waAo2ZwN0HQ9Kk4yvP6Fl+SMZZCc4RVFfHj0rvtvMlfcPo7/jn793jjlvP+zSMEW8JA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=7ojkTCw59GfNc8LVZA0S1aZrC/JiN/eM8zfl+bIHyak=; b=Go2ClnpL5v8PzlzVxNl+lvVUeoKN0Cu3X7O+/lbCc9+DUxFxgvBfohNVnLY9USxB0vJc9W/TUrONjwO7BtOhoIida+cD1+FX8kGtzlt/zqnVlBw/WuOcAb83oJet2QS0DiTYwYvQerkjdqFMsp0e3DXUX/cAgk088oCxWliZHYN/BYt6z7q20q6hkpwQFt5DXttTyetrQjyn8OKVYE+KkUdhlxp6tj1WKoQKGNEsP9luQ1A+AcZxJjuyoqKH6GEtUxxHeHFeKkkJ94yOuBoR5DAEice1SBm+TemNhS6plXW0/oNx3tX/jvX5FSTMXyly4xRWns7iA+cHQU6nle1FhA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7ojkTCw59GfNc8LVZA0S1aZrC/JiN/eM8zfl+bIHyak=; b=j7OdPOaggQM8Ympc/N8p/DAZY/qkYFdnULdmi74jg7wUMz/zu1zaVIt1Ry1KaWk2/cGQBPoSdZRgfgVG1LnX6RychgAqZKNNwK4Ob+1MDwXMgfhzURFjwCUbf0gtRVEYWNjTgh10QSMYK2W6M4uJwMujPtwTSJOuUWT3Kzm31iQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by PAXPR04MB8301.eurprd04.prod.outlook.com (2603:10a6:102:1c5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.33; Mon, 12 Feb 2024 15:32:40 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81%7]) with mapi id 15.20.7270.025; Mon, 12 Feb 2024 15:32:40 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ v2 6/7] bap: Set generated BASE on all setups from the same BIG Date: Mon, 12 Feb 2024 17:32:21 +0200 Message-Id: <20240212153222.8191-7-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212153222.8191-1-silviu.barbulescu@nxp.com> References: <20240212153222.8191-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0PR05CA0085.eurprd05.prod.outlook.com (2603:10a6:208:136::25) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) 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: VI1PR04MB10073:EE_|PAXPR04MB8301:EE_ X-MS-Office365-Filtering-Correlation-Id: eeef9b64-6e96-45a3-bc59-08dc2bdfd90e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3AJJdkjSGySUCOmCGHu3RANuQ33SGdatWYWxuDxlUhkgULqfpCjlGADFeYl8dEjHBfKD42C+kqpvHk33dcQ6+BMflmBZjyzMjC8WpF2/54tM+ynArA0++RQqMxNh6WvtNBoiWmPIGZ6kftd1R2Q1K7Mtw1hnGvulo4kAWZFMIwS1Mr04Mc6/Z154FciTEMwKnu5ktXJOvHJYsOK2z8cWew+PQknnp+JBiuFpbRoRVs62hoz8ELTDVj24hz66Ki3hfrBspgBrBv9D6baada1g+qbn1KZkOnSHcBzDmK63zEYrlgwTlSib/PEgShs1EwLxGBQM/c6RdekY1xDOHGeWYyvhhUieSZ17hpZE6va+kUS+NrM+xmSBW4JrGugWhDfON6fhotsodrulhBrPtq8M5hYPOTSFuSpKzptush3lXJyEvYs3N/DD/dM0Y6SF2mFlaZEelOwqfsqjyXbP9xfLjpM1ChZR8WD0IklWV13NUs0fHmRe88xNkOOpuRbOlIF7MlkdfH5EnCoJAFA17f8be+vD72hkaL3vqblxFSv5zylc6tomXrLrGr7vD8F/0XOT X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB10073.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(376002)(366004)(39860400002)(346002)(136003)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(6666004)(316002)(2906002)(5660300002)(66556008)(66476007)(4326008)(66946007)(86362001)(8936002)(8676002)(6916009)(6512007)(6506007)(478600001)(26005)(2616005)(41300700001)(1076003)(36756003)(6486002)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: M46klUuI49TpQqVrTq4X5ChjYYBAZTlD5YnzP2WnRih8UCdUbbBZXDznBUXYE4yQMjX62e/j52F0GNtxCkuRmA1ArNkFHgbv0PhEZAfdjCTsfPWnIPgZRApJPCJLfnpCi5vNj6JwbcPao0x2Y8fq5HhphmPaC5g+NugRCLGU7h2obWJT9O+/QNGwNehzdagrWzcH8yibYcCT2ukWMM0M+6OuHhfHVvS/mELgidcx5uCr2aqLRUlHv7821AVHL8zVlt2emUhQAnjmnyrmb1wT1Fp2AEO8dYmq9Db4FcudJdTOgECiD5el2PQjlyU/M5Z/fDtUZfy22EL0ZDxNWNt4FgCXZCWC2i2BHIMjGdC9UelyRz1wkaihAh8paHKVLCGpwt+Z1G5Bu5p0Fo+3owf31MGJGvrbub1TB0pGcLBFpNLGQAQujwbKfioAo6I3brXiwt5woi7DryQOcYrbaWd4IH2mQOPcTYoyR8Wb7GqMtYhvvTKN6lLhuKFWgr4DEqW/Yu6nJh2zzSO83+9HkafVN273sK5n64YC9L6J9txE7trBygoI2i6qC8ppnuNhlKZbtPw5T0mmZ99uipOVTRgw1UbLEl9t1mjDi6EFOobS2iaaKAbmaCy29BuXEIJnUVgJwQS0k8fF8Shg7fUo75FH6bfGq1sUVle8J7z7mJs6WKuxZn5l2+wk4gBAz3lajqsxuozoRvHyk531Sp5PpzLKr5mN2mwcQ0U1McNc7UpFVTXNJCwWO01LxG5SKdkRmgTA10T8fa+NqHzl0F/PoP+a7TEa8v7sKOErALPnVedOiGg6qMDYmFQyDyk5TE+QdKf3/91Bv84bVhngNRj//gTUc8pBLLE5uF6SHDW0KsqtZlcq9erKgASLcXqrBzMrIlr7cSOMBPCSn9JTvRW/xgDSx2OLafAXZCRfvyO858Gok2khgG1m3gJ0tOfxb6UEGHBiR0deUqCISscaOHTAQwSzMM/bwTzSezXwtWN0UTHXbv/ayBaClF2YiZ4siv+s+W7NoaAjLP07TCV7bRFxmRP8LQbbg5xUA/5c53/0kn1tJwDeh0cFacShA1LWQevl9n/QirmCuu65EP9EhpgIY+4TY5NY1LZTj1WNpDUbEs8zrf9ir/N1xl0CpaD2/BQyEg1K2fwZbJHAIvnikx1IHmgEOUCGk8cDDGXNFs5exaK4V0RXKgxql4ZvbPIUWITA1W9HC1BzfjAoYfcIHoC73csYeX/y/PuSeuM+JXdZo93FCW8wyB+W2O7ESxEqHVLjMBamcdTVv7Og8LjY87iOz0PJ+UX4zXd3klbZd46Ndphd2+LItyTQ8mpcF0KCsF03T2GEvkHgvgYuyd3XQgN8YR2OejI0IUf6Gbb//sBmODeonuYDMO3wTdxF+1PFHgC9CD1wPqqDCHJsbnK8NseodomQC45TWGYJXLrgMr5AfF5jY13+asjdFFnMbcYVlLoQotNboilM5irlGXH1jUqb8zAdhXqutOBhKqnACn4Uz8Y41lWy23scSCfYCiEODqtAgvM6ja753kl0xhkPtDF+UF0HtPeR5RqKh0+9v0xQxrbUBs6a15EM4HYjRCPrx/GwEmSJk3l5CTqGo7GRgkq8pKWpaw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: eeef9b64-6e96-45a3-bc59-08dc2bdfd90e X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2024 15:32:40.0460 (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: YOD6Xk7LbP2913uXnRlvxTGNZGEa5kY6dHtY533/xefh0njRKvhfNTi9vcKLELwp4hke6kebAI54Jp7/V8j+9LvWFp0d/bqOoGN37tYuILc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8301 Set the BASE generated in BlueZ on all setups from the same BIG, and use defer to inform the kernel when to create the BIG. --- profiles/audio/bap.c | 159 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 145 insertions(+), 14 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index cf1c53b30..3a53873e5 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -926,6 +926,29 @@ static void setup_free(void *data) free(setup); } +static void iterate_setup_update_base(void *data, void *user_data) +{ + struct bap_setup *setup = data; + struct bap_setup *data_setup = user_data; + + if ((setup->stream != data_setup->stream) && + (setup->qos.bcast.big == data_setup->qos.bcast.big)) { + + if (setup->base) + util_iov_free(setup->base, 1); + + setup->base = util_iov_dup(data_setup->base, 1); + } +} + +static void iterate_endpoints(void *data, void *user_data) +{ + struct bap_ep *ep = data; + struct bap_setup *setup = user_data; + + queue_foreach(ep->setups, iterate_setup_update_base, setup); +} + static struct bap_ep *ep_register_bcast(struct bap_data *data, struct bt_bap_pac *lpac, struct bt_bap_pac *rpac); @@ -984,7 +1007,6 @@ static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, if (bt_bap_pac_get_type(ep->lpac) == BT_BAP_BCAST_SINK) setup->msg = dbus_message_ref(msg); else { - setup->base = bt_bap_stream_get_base(setup->stream); setup->id = 0; /* Create a new endpoint for a new BIS */ if (!ep_register_bcast(ep->data, ep->lpac, ep->rpac)) @@ -1858,7 +1880,7 @@ static void setup_connect_io(struct bap_data *data, struct bap_setup *setup, static void setup_connect_io_broadcast(struct bap_data *data, struct bap_setup *setup, struct bt_bap_stream *stream, - struct bt_iso_qos *qos) + struct bt_iso_qos *qos, int defer) { struct btd_adapter *adapter = data->user_data; GIOChannel *io = NULL; @@ -1895,7 +1917,7 @@ static void setup_connect_io_broadcast(struct bap_data *data, BT_IO_OPT_MODE, BT_IO_MODE_ISO, BT_IO_OPT_QOS, qos, BT_IO_OPT_BASE, &base, - BT_IO_OPT_DEFER_TIMEOUT, false, + BT_IO_OPT_DEFER_TIMEOUT, defer, BT_IO_OPT_INVALID); if (!io) { @@ -2024,9 +2046,6 @@ static void setup_create_bcast_io(struct bap_data *data, memset(&iso_qos, 0, sizeof(iso_qos)); - if (!defer) - goto done; - iso_qos.bcast.big = setup->qos.bcast.big; iso_qos.bcast.bis = setup->qos.bcast.bis; iso_qos.bcast.sync_factor = setup->qos.bcast.sync_factor; @@ -2043,9 +2062,10 @@ static void setup_create_bcast_io(struct bap_data *data, iso_qos.bcast.timeout = setup->qos.bcast.timeout; memcpy(&iso_qos.bcast.out, &setup->qos.bcast.io_qos, sizeof(struct bt_iso_io_qos)); -done: + if (bt_bap_pac_get_type(setup->ep->lpac) == BT_BAP_BCAST_SOURCE) - setup_connect_io_broadcast(data, setup, stream, &iso_qos); + setup_connect_io_broadcast(data, setup, stream, &iso_qos, + defer); else setup_listen_io_broadcast(data, setup, stream, &iso_qos); } @@ -2132,12 +2152,60 @@ static void bap_state(struct bt_bap_stream *stream, uint8_t old_state, break; } } +/* + * Function receives a list of streams ordered by BIS index + * and calls setup_create_io with defer true on all but the + * last one. + */ +static bool create_io_in_bis_order(struct bap_data *data, + struct queue *order_queue) +{ + const struct queue_entry *entry; + struct bt_bap_stream *stream; + struct bap_setup *setup; + bool defer = true; + uint8_t length = queue_length(order_queue); + + for (entry = queue_get_entries(order_queue); + entry; entry = entry->next) { + stream = entry->data; + setup = bap_find_setup_by_stream(data, stream); + + if (bt_bap_stream_get_qos(stream)->bcast.bis == length) + defer = false; + + setup_create_io(data, setup, stream, defer); + if (!setup->io) { + error("Unable to create io"); + goto fail; + } + } + + return true; + +fail: + /* Clear the io of the created sockets if one + * socket creation fails. + */ + for (entry = queue_get_entries(order_queue); + entry; entry = entry->next) { + stream = entry->data; + setup = bap_find_setup_by_stream(data, stream); + + if (setup->io) + g_io_channel_unref(setup->io); + } + + return false; +} static void bap_state_bcast(struct bt_bap_stream *stream, uint8_t old_state, uint8_t new_state, void *user_data) { struct bap_data *data = user_data; struct bap_setup *setup; + bool defer = false; + struct queue *order_queue = NULL; DBG("stream %p: %s(%u) -> %s(%u)", stream, bt_bap_stream_statestr(old_state), old_state, @@ -2158,14 +2226,77 @@ static void bap_state_bcast(struct bt_bap_stream *stream, uint8_t old_state, queue_remove(data->streams, stream); break; case BT_BAP_STREAM_STATE_CONFIG: - if (setup && !setup->id) { - setup_create_io(data, setup, stream, true); + if (!setup || setup->id) + break; + /* If the stream is attached to a + * broadcast sink endpoint. + */ + if (bt_bap_stream_io_dir(stream) == + BT_BAP_BCAST_SOURCE) { + setup_create_io(data, setup, stream, defer); if (!setup->io) { error("Unable to create io"); - if (old_state != BT_BAP_STREAM_STATE_RELEASING) - bt_bap_stream_release(stream, NULL, - NULL); - return; + if (old_state != + BT_BAP_STREAM_STATE_RELEASING) + bt_bap_stream_release(stream, + NULL, NULL); + } + } else { + /* If the stream attached to a broadcast + * source endpoint generate the base. + */ + if (setup->base == NULL) { + setup->base = bt_bap_stream_get_base( + setup->stream); + /* Set the generated BASE on all setups + * from the same BIG. + */ + queue_foreach(data->bcast, + iterate_endpoints, setup); + } + /* If there is only one BIS create the io + * with defer false + */ + if (setup->qos.bcast.big == 0xFF) { + setup_create_io(data, setup, + stream, defer); + if (!setup->io) { + error("Unable to create io"); + if (old_state != + BT_BAP_STREAM_STATE_RELEASING) + bt_bap_stream_release(stream, + NULL, NULL); + } + } else { + /* The kernel has 2 requirements when handling + * multiple BIS connections for the same BIG: + * 1 - setup_create_io for all but the last BIS + * must be with defer true so we can inform the + * kernel when to start the BIG. + * 2 - The order in which the setup_create_io + * are called must be in the order of BIS + * indexes in BASE from first to last. + * To address this requirement we will call + * setup_create_io on all BISes only when all + * transport acquire have been received and will + * send it in the order of the BIS index + * from BASE. + */ + order_queue = bt_bap_get_streams_by_state( + setup->stream, + BT_BAP_STREAM_STATE_CONFIG); + if (!order_queue) + break; + + if (!create_io_in_bis_order(data, + order_queue)) { + if (old_state != + BT_BAP_STREAM_STATE_RELEASING) + bt_bap_stream_release(stream, + NULL, NULL); + } + + queue_destroy(order_queue, NULL); } } break; From patchwork Mon Feb 12 15:32:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 772120 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2077.outbound.protection.outlook.com [40.107.6.77]) (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 D233A3C092 for ; Mon, 12 Feb 2024 15:32:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751972; cv=fail; b=V6L4wKYpnjZKVEIylnWk8QeXWEniTqmiicifPSNo1UfuYsacjTN16dryx1/Ph6gqichXwAcMHi2bXG/cWgzgdyuzcYUqDkZVvtyQjG393uQChxPiPgUHw/OYy8cSTBhs86dhiXKwv8yvesc5ViRXuzYPOCvB5TcVAtCD3cNdJvY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707751972; c=relaxed/simple; bh=hbCH3QjkALvlhVDTBs2LrPjXZhdY9arnxRzR7jAUZDc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=JLVjYx+Os5SQPTm05KevdpoFc10wbPEK8MahxQYUHoBprO2chCQNk7d21yusQFsItQpKM7H/IL3ZHa85KVr3xdaUenjxsACaQakzfS3QkQ8CLx0jjgV4+l+VnbLhOr7iGeeURjDN1aRwKEyw7oUwd+VeKjoh6jBBWcNTwNxefZA= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=ak2uw5YW; arc=fail smtp.client-ip=40.107.6.77 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="ak2uw5YW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P6n6uXZHSGRavzf/FrEAyyZxGXMKwmvmHYEJDiwOzAd7CkH1+A+vzVHiwjPlfvIBBTNpXk/T0wxa+HEGU0Wvfz4BxLj7PVyxXOXUyDtzYv+Ewb4pGJqppANOLdL0/kL5S0uMtvFBX3wwJUwyO0Jls22p/tv+MdNbrONXvXNGSRfaMkeiTysATdukjH9sqefwrEVt7UXvKnfiWy23YRXW2SIh3/sYzeyKA07mS98A6UxxOiE71yl5CPCPswkT5wiSFRrL+dY3I18F5UN3wiBQtnwfLSIbxYZx95/fMfKW4Du9JbVlGNuf91LTzMb8rtAAnh7NetLMzXxinuznzHl+dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=+fgSkaqcVp5WhhPJsOe+TSTpwWHo8S9GtLOw++4Y0HI=; b=dk4oPmCVqy25l7LcJeOhY9q2Gh2FZpKm9q7NovdsNlg3WpUbo7McJ2CVlBbRfGxPkUACPkdbYz3viL/55QRa0iVVOgvB7bybyGpTghY62iuL4SJB1ZpLSyD9fLhrbh3gqyXJ3PJcEmR5tL1i13yy+3bSNahQMNkJvGo9VyRgOFNf3RbMVumPywRy3zGKf5qRQaRWxEvd5ipMvZFgWmyqyUbexSlY8Kz/3rEh01Ge//S1X1oWi4ix4/7r6VqVTKsDluFMAdsBKpYGfilExKqw81eRb4pW5yV4B1pgQfsprtHYwtj7OL1A/An43/sByuMQUdhUd5njfa34tIGaTzFpNA== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+fgSkaqcVp5WhhPJsOe+TSTpwWHo8S9GtLOw++4Y0HI=; b=ak2uw5YWyMQphTRbn/HOIWT1edTxR1c1i8Nte0RQZ6Bp9U+u5UoL+DhFhWyVgWfkB/FDdMLXj5gGpa4v2Whtf7Sy7ADYlDNF7hgMhki3wMCDlKW07vd+w0dnrQFNY14yJiTdxze7eYkvZhgpWkOPepXNGd0ST+EQUOuxkLuu/hg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by PAXPR04MB8301.eurprd04.prod.outlook.com (2603:10a6:102:1c5::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.33; Mon, 12 Feb 2024 15:32:42 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81%7]) with mapi id 15.20.7270.025; Mon, 12 Feb 2024 15:32:42 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ v2 7/7] shared/bap: Generate one BIS BASE for config BIG ID 0xFF Date: Mon, 12 Feb 2024 17:32:22 +0200 Message-Id: <20240212153222.8191-8-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240212153222.8191-1-silviu.barbulescu@nxp.com> References: <20240212153222.8191-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0P190CA0014.EURP190.PROD.OUTLOOK.COM (2603:10a6:208:190::24) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) 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: VI1PR04MB10073:EE_|PAXPR04MB8301:EE_ X-MS-Office365-Filtering-Correlation-Id: 36fce844-3d6c-4f44-41df-08dc2bdfda60 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RK90Y6ccbWe5sGVKqHjMlTZLbq+/HLK149/b1IsHmvyUjdbRiOlxIEckkTrVT/kxF8bIxM6fNZp4WjzyA4jKY2en44aCb580lWcf8U2UHEr/mPyVPrqOdUfB+bCzDiDQkIqEc0OprQ7mLr2mKE4/4PfoVDZqdFzFhM2EUlUfs5MZGhnbD82cIxtaj5xchEkFB4KxsKMyGoscokjHH5pXUd75YzGG7dgpamf6e7rWbUe7OxtSRXKK1zlhU8ZBKA0N1H3XL5fQIxzgtkQD/vzR3Nn7igmvM+fVSWRDdVXFpqY5Qc7b7xzwWSFOtOikiDPb6Igl8NLcihMJYuMgZY4HsukibdZAOCzbe55Tx2Dg/NIPeVtGc72FQBXQiBgVSbJc+LEwig+8S5mz4SwT8hZMYZpSMb0wMRhiFI1WN4V5tyWVDaYN3HRCLXGkY8wmO+akV60/1nL6JmEiBubgPlaLZPzHUW2s8aLS7z0hvu/kUMeHwq6GpCLf3LZfvwMEzhN/a+Pt09Wk1nxdqCDb/MeRG9pdzwu02jiWdcslaRw7HXHoPtPCbQQGQd7N2147PSId X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR04MB10073.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(396003)(376002)(366004)(39860400002)(346002)(136003)(230922051799003)(186009)(64100799003)(451199024)(1800799012)(6666004)(316002)(2906002)(5660300002)(66556008)(66476007)(4326008)(66946007)(86362001)(8936002)(8676002)(6916009)(6512007)(6506007)(478600001)(26005)(2616005)(41300700001)(1076003)(36756003)(6486002)(83380400001)(38100700002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: B+8gA23RS3lJ+FhiDTkil+wAuC+iyNF4qVzVRWWjpGDE+r32ZGYp2Wxg3O9/8k0dLBnlYm8PRiAStA2iXr2w9VeijrKLnwG9BTBdQl31seel/71QiFiqZ3oGukOv5WBdtykHxD3btw0M6ggtz2Jf54wPxm4oBXxR02yHJ7WXC/+6oL8BihdBkLP5NyYtRyQls37rmqATlN4zbZEb8dmB7sUknwo8/SFldNhgOLkDUNiYNfLDBx53sAgYCOUsnB31NjdsfWAtf9T8wdDUjBuixzt/ASnzlwnDHdizdg9kBnY1i6CRaJ6W66CSKl8dRhij+8WCSZ/UKB5JV3W1arcupjb89/DC1X0NOtIWXUhyYviiGQuXg85NnTgJVDHC8TCvqNbuo8xbfSrAOotfbVO4OZwSTwwDGSbAFh8wkG47SwpvTlDozHGLdmcMaEQ5BpgF2a1urxTtUXn0kplnRhKFdRJWX1QNV6wUL5GGtyYzJ2uSgPX4zNSRPjuSmlRrmeUtg5fSw5RZUkAbDx37lHGhqoDRxsTSSn/MG1fSH/U4qjRCS6BALSaAY7Y80r6PBWYXbpji/jYl5sGy7fWaEE7VgXTrCzo8RN6TGWsoFR4WPnl1irc4+DRkCApauEFZCfzC+K6FJ7ui8wCgTFbayldOl8kZZLWSga7rvjKxKu6FJzQOF/9Ho+KIJ8liEDKKWiePs3EaQNNVtwPfO6gVXjV8/k31P49U9pjgrd7CvyauZgex8g8pNc4lte062xxCs3EUWAmvTb33ql6x7mLyoRKJ/S38e1lOPyjab+HZCnq9iaiPT2WOwKGmI4tGAm49Lrk5rLFz+p0tMM4rm6g8vS5WaF45ynvzBlJivJQoypJQdn4knhLuQsIx6p7ZEEimZiLcGwobk/ioplGahRZMREfVJHo2QzOoOSbOdHpdulQC0HOJ/EVJ6rp8WwlO0iljp512/Ep3OxuRDnn88tfq05BSpyWGYWufPTFk/cs4pDh96mnSrmDDmCxCSd452ZVhNzO0E+IRaDF44dT4cIcph1dFvwnTDf8j1KpIEXh45e1VV4hGLVKAseStbbbXPXbqoFsjPCa7I1LJaWboeSsC/lwWXLT+vT8rz9In/y8LbUnGkxHUMoyzuBqVwyKB08EFuz896pa5T+uBhrA6Yd/pMvbP0uA35qkAiLHKhZH6dXYLZ0LKv8RsT6hyrlGZl/JFHzVuWouEUN6OAiyQtFEV37YGoN9nuXih/9dPPTdezwHsSeaifBjmzQayBjwg5XXMW+VFO64ZLU3/8xsT3u5QJXy1cROl1GGLpXf3PZGFDR+Ug2vFvu0mxFu3Cgw5BOmbkH7Zkpr/dAxGdgkTmj0No85+x8ztQkTH+KpJGGQapV4vuVwFQL9B3+4tZL/M/r42dptauKg06mWtnmqJBcWtgo25SqUZDdw/1uyXYIgpCQRUFMjHT+7WH/kwz8w4QnlWldf9Z9LcmnNHR5xUZ1Qohf/mZ+I+nfEyZYg7kUGSXxAY1cB5upuCWdwWL4IpP5mPFw4+kEsqVP9vHxGti0+mhCS54qnJECLqoFEZ0N5tc9iyakj3Aw3/h20I+THdGQIxE0miMABy9L1PV99iAUVLjnYFpA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36fce844-3d6c-4f44-41df-08dc2bdfda60 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2024 15:32:42.2241 (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: DTCjHoIPAu5ILLvFbmMN9OUrIyRkH674Js60PVgSeadtAiokw2WnNL2nZf2a9J4Dn9kmKzFv2/Has+kjX13caarVWSrrYFmI4Tuq0rMEqF4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB8301 Generate single BIS BASE for a config with BIG ID 0xFF --- src/shared/bap.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 2c5979b96..31f8f2ef4 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -6114,11 +6114,16 @@ struct iovec *bt_bap_stream_get_base(struct bt_bap_stream *stream) base.next_bis_index = 1; base.big_id = stream->qos.bcast.big; - /* - * Create subgroups with each different Metadata and Codec - * Specific Configuration from all streams having the same BIG ID. + /* If the BIG ID was explicitly set, create a BASE with information + * from all streams belonging to this BIG. Otherwise, create a BASE + * with only this BIS. */ - queue_foreach(stream->bap->streams, set_base_subgroup, &base); + if (stream->qos.bcast.big != 0xFF) + queue_foreach(stream->bap->streams, set_base_subgroup, &base); + else { + base.pres_delay = stream->qos.bcast.delay; + set_base_subgroup(stream, &base); + } base_iov = generate_base(&base);