From patchwork Fri May 17 12:34:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13666936 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2082.outbound.protection.outlook.com [40.107.6.82]) (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 6C10E3D546 for ; Fri, 17 May 2024 12:35:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715949317; cv=fail; b=hq86ypTO1YXx0N6oZq6oEgWRVxqIZ1VbU6JvhE0tCBqO9nY6nz2G+6Xddr3awa5rfceaU7OKICdLqg7Od197O3cXY2fFCU1pxQEjl8LMfj2O41vOuyYF3vlGepGrJDLjREd6to3kMPdJdCc/Wi2NBoW2boCNdRm68W6CGSmL1xY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715949317; c=relaxed/simple; bh=dIEGoQh3tcZXqmdjGBl8GlhKWEUDlt5KJo+9a+6Mqcw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=SotdFIgs2cnnwy1bkhMHtJX+A+1S98QXRuiWmrNdONodjLv4YSiCputkXoYABmpxmgvPOUIKs2210AYjtbpQnL5Gj+LsqVuZ37aR1aWna7VfZ3KZjo4y6efS0ltT13J8bAuZIdYNknymAVX61T52Rg64j9yVLRoFmf7EvYCiGeo= 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=qQW30vXE; arc=fail smtp.client-ip=40.107.6.82 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="qQW30vXE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c9jSS/rYJaH0Lw4wu+RAZa3gQkKlrn4g4TUqMzH4bAuPzOgcCZ4U5Ke4TC4F9CgNAepX75WGqzZoiMdn69UVwZJR6tL/kMSZMsTWm6hTTSkbi+wdDkIM2TdJH8qIX2/OxmLBHLpH+CmQRIkaNQwA44zh9ydxjpTk5kuLfl7woXUP71mibrX/yjRvTDKj9X1B9mLXpsKjvpyX/ROhEeJ6ZzrM08cWrwYwlBuxt5c0jLjuVpFzN/jP5q2dnDndGGdhzPUSj8QTc0PXRbpIjOijag40+24iFIpYhIU1PVmepc+HZngeXvVwzlsz14Xv+E5mNspYJnghfzcw0hu3xNOEOw== 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=Dp8j/1Oa0UWhpTWzPpaV5vDFjMwlY8Rk00XQLnRPIj8=; b=EOduranyh5IjuJ53M6bSqia6xcWo9rW9Rop9xDnHtfptEqo+vaxNU36hI72IrOYihtW5BxFMjOQtRcL3OA3NHuSvVIP2c9xXiIyowTzy04FB8nAOSMt7sQWgftJfv/g20rglDi9HNiW27qlZ2oGGlEdc5AsQjrQUm4JRu0vxYmPcJ2d1grQBGC/JbmNp6ooBQyopaUtvsLxwRT74DCk4VWcQyNJOTv8hjuN6Kf+5XmTNi6TfJLC53+DTl0yW7nlVgYVLrMWWg/lnTstZ/YRMlbCjEXTAipENIH/+UtbhRbSxm8TiY2w8JPcHNMIjCjnIcGL0GDxrUdJ9XzLcJUjMtw== 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=Dp8j/1Oa0UWhpTWzPpaV5vDFjMwlY8Rk00XQLnRPIj8=; b=qQW30vXEB4emyYLzSlIuHZCvGRAbvSaRJ+fLmYpbpiBQgbCjMVK4152K9FkdAlr4aNdR2r0dAkuf4zOTzATp3UGC+KmmHvdUeBnuCF7RHsB+ccCY3GMXejszGrNFWVrfR5jCVMq+f1K8dV0yUGRnLNatv+B5eqWYgGovfRl2InQ= 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 DU2PR04MB8934.eurprd04.prod.outlook.com (2603:10a6:10:2e1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.27; Fri, 17 May 2024 12:35:13 +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.7587.028; Fri, 17 May 2024 12:35:12 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 1/5] shared/bap: Handle NULL caps at bis verify Date: Fri, 17 May 2024 15:34:32 +0300 Message-Id: <20240517123436.146332-2-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240517123436.146332-1-iulia.tanasescu@nxp.com> References: <20240517123436.146332-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM0PR04CA0012.eurprd04.prod.outlook.com (2603:10a6:208:122::25) 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_|DU2PR04MB8934:EE_ X-MS-Office365-Filtering-Correlation-Id: 74964baa-9def-434a-9c0e-08dc766dcc23 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|366007; X-Microsoft-Antispam-Message-Info: wCr2g6ZTh1O7k2Z1NIhdE2GcOhpo48gexTso6ewCP5rwyiy6YOrJeqA8Tn3pjaZiCm+NgWe1GbYCBP4e2bv0lW/v++zdhs8P5RkR+5K0Yy8qC1U4mjc7LkEKcnon1j4k/VpcaX+CNb00uJ7Sv39SG3Ddmzhc9LSxEggE+SeRHJ9Rd/OdhNZcyk7RA93Nf41up6RBDMVQ+MesYWTZQq1VIj8zonR1PpBdOifAjQu+LZ+X74RXRnbmu0/FXMNVqREVCG559d4KoRbHaOHT6vd1fdjmTYaAqut0rT1CBxTA2eKMgBeoGMA7THmDFu5vh4YmG5zwp6HCXA6ETEyJZaLREHGL8y8Hsgz+sCNnR4nlOtBKaqbpWe4LmTSaMcB7bOTH1+gBrF/kyy+uYvc5msdBM0izIV7bdorGyGMd6Q3DAeGOCkfgyO0Gyv+k0xzjJ/dYR4QFhHKTjERtd9Db8vUXo9v0uCnUnFvQugKETzzn9S1Ml+n8YHxXdnaWevgqh09E59oPoOpGiRGz64XNRpcTGYjEdKuTHSyA9kLbG03UXqJvIQ8Rsw4s/KMdbuvYUvbwuF6n6bg7k+8WMUTZ3S2BvXDsN8og4UuSHVTmO9bY1opttey1if2UDQScTik22qrdgr+ytCBT7cBDdjfRkIN956M6xOQCb5yKSuEdL5uPzQIUYLBXhblrgVhJkDNWgucqawVh0peJSL8BYD2RAaT1PC9aAfRJTCv1dRuoeceLIMloZzejTSMNdTYnsEVhlZI4m/uiZdtrFAmZo5iA13Pg3N6JU3rI8mZ7fpCllk4tnG47TfVyXxkE/SMaPU4pnziFPop8HPTizDzET8LyDN7cxMcz6//IDJfhjnMeip4teeZqsEfctABCJ6toWTyPm9668BzgpxbgDXzhD1ksJ76WTax8s3fTOhzrzf2Drq6UvdbpvMtR0jLmp+xrRglsBadx5eNyU3AbezJv5UcGRRUs1V5tqRfvVgSP1pLOhCFib4drDRdQiIqiPD+cepWpcC2y97DWpYk7F8sU3u0Lc/FuxtThWw/UGYT//iZrSHyLaAGmnLtcRwdg4jJjWM1/rOocE6HMGIQZXyX/I3AbkMxZt9fPnaAMyvxGWx1Oon3Dy1UR6i/BdBpdGEVLJZgGWnTgOOCmt4UFiIwwo7s+bO9G8C8Lu07YFqW9pT7QIREua9xAvtndVXz7x0EQFXVsUtJzFW1LAp7QfSFnHigWVGcRP+Fm7zU2OlzNuq6F2hTyHDKRtAkqk4begKZtYYJtKo6P9eh9jRPE06sWy5mLQlHLfw== 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:(13230031)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /N7cKKd9oKN005877Z2pblSxpTedRiKuWiQbaH5MSVH7aofSUFaRkwU6qx6YS9rBQoZyv3WWw5eOVkzcn/4kUje7rCIVsxiAYe52KjRewrdZqiGBR+PsnZEIvAbyLH3zDnmTtm/N8qw42UoT12kO/fXRXDJvjfbPDXF81mvnzI3wYNjl3j+EbF+vL+3N4UkwS/OSVXymFceYiTeWTAR/etV6HS2BkJWE83weuZuP81ITagclummXeXIkz7zyFQX2kqtKJJ1W9VHrYhG5LanA/i/JN2cWY3pBlFxZAMHk3BCOuHCf0tvcfJR1ZjuVQz5xbeokuFHsXeCx+QTcYHyywkQkfgSEFXxOmmt1qULH+/vpQAx/0Z2CbsS+af+XWoFFbBjLJ47lwkY6Jg6Vpqm9A6IgSWaxXJs49aHgPiyLcj+z4zz4MpxUedXS5Qd1zAEyph48O33qAG4H0dxxtTiGit0XCMy4Ldxr/v5OK9i17liRX7qwTP0GkXZLvoTOgiNZTwLjQZrqiYiwaz5devpV3f3TR/KLiK89LmysU9zgsfSd/Nq+G4ascEth15hpMlN/gl06m2rsGIMA7h3mKu4rOkZtugYlb3SalxJbB1/Ur+THWt286ncMj7pwud5hyMhrTKoK+qiL3J0mA65PchZgqxdtQCpVMZTjYAO3q3Hi1Gl07YCBZOmJpAlCk37HukqU8yGENorDczeQJwlZ0yeETws+AoDowBUgfU1Yjb8109Y2PVTgxlxxOKRc6+Fi/4atxmbR0muFT3zYDxrOJkxowCSqchQrhHCBgEtlTFHaMWHaM2ypnO9V7k02LhglOg4dD5YGMXBSnCq0rZxX3VdnXOmGsK2MAeEAeorAUPlybDiXiAAVGKX3XoBAz1/YM7EZxEwwAb2Dg1rzVh17Kcp4zx2eLKu679P6i7O8E/F+ox4BQAiMjk5utlw468dacQkHFX6r8ZRdxZS4Xl1qjwXhn4HigZ5b+Z5r+SFmELrmnrluH68g0ZtnnwS2kSDTMSDbAFwi9/Jh2IYAo6EzoT9jp9RknnOhS2YMDMn0ApMR0JkKCTPt7XxEhkZzr82apGQRPqP7qMvyT64deOZHtiak+NFA5lNgwt17OHpdlemLFVsge29YsrV3uUr/bCs4nlz45m+tZi05G3tr5mnpx8O6Zg5CJpZ9z75aVkfedZR2D5sCMokn7lmFxG6nsO+c8dJRI6TCQiETc2NblQER2NWAWPoxJraGTnzJxwLfGXBOIpOmcYg9VobeBD8oAQ84v0Uk6QEY1JL3S5Lh3qjFIuntdCV/P6Sv6WNhyWelUUE5Z8yUdpguJMKrDjZT9ThpjW42EddtMUzxqY177MC3ZmzkuwB5MEti4aoCbGKxD1oayrQgSJwIAlDVvV5PR3vGdPxOMy4sTRn+W+h1JYpXbfWOy4ibyoIf1rmfWuq8/t4GUaNSQrweDw+cFeWZlii5r+KHlR2wYe7EVua0t6kEkqeAG7eRs51VOSk5Fx7YngVkjTldHDU7wwvIAuP9sTG3bKDdq31zkoeN592Bedjn0dp0UC1H9lcfwlde9Xd7MslGIREVCJBzisitiemXEgzjWR3PybdpWK19UI8b+3x2cZ/YpA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74964baa-9def-434a-9c0e-08dc766dcc23 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2024 12:35:12.9191 (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: 4bqAltkQ4SFLO5t7/Tsuifv2gu4HneD3XXTAQz/bErwSSq/iW9qp1xQfthYK7WMU2dc6F0kBw6xDm1lZIn6GLA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8934 This updates bt_bap_verify_bis to handle NULL L2 and/or L3 caps. --- src/shared/bap.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/shared/bap.c b/src/shared/bap.c index 38c353a6d..40ce16d75 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -6531,6 +6531,20 @@ void bt_bap_verify_bis(struct bt_bap *bap, uint8_t bis_index, struct bt_ltv_extract merge_data = {0}; struct bt_ltv_match match_data; + if (!l2_caps) + /* Codec_Specific_Configuration parameters shall + * be present at Level 2. + */ + return; + + if (!l3_caps) { + /* Codec_Specific_Configuration parameters may + * be present at Level 3. + */ + merge_data.result = util_iov_dup(l2_caps, 1); + goto done; + } + merge_data.src = l3_caps; merge_data.result = new0(struct iovec, 1); @@ -6542,6 +6556,7 @@ void bt_bap_verify_bis(struct bt_bap *bap, uint8_t bis_index, NULL, bap_sink_check_level2_ltv, &merge_data); +done: /* Check each BIS Codec Specific Configuration LTVs against our Codec * Specific Capabilities and if the BIS matches create a PAC with it */ From patchwork Fri May 17 12:34:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13666937 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2082.outbound.protection.outlook.com [40.107.6.82]) (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 A0EB94778E for ; Fri, 17 May 2024 12:35:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715949319; cv=fail; b=Dz7YK0JVWGjo9NDqLt6Q7NJhDWb5ONhwiRk67PEPE1PivnGf8IFDhkvROA91/3KgU8mCdHMRlQcFjZSryVzrrsz0YQfn44dU+di1RWmWwBDl1vTALWX4S1f9iegdl97RTrjzXilgE2k13dbyRIyYabJcdCHyEMmhMf1lOmKVDZc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715949319; c=relaxed/simple; bh=qAvax0zB9j2L4+i/TgbnL//3KZDco5Yz+PYZIf7JBRI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=JRpaOdFw0LzcUqqW9wC0DLEvsgQmvXdyBRdolCGed4GLRAgAowWSE7f2BopPiTiiGxfmb6Gao6hl8+VfV8QAEXlM8Dirusj3CxNntSx0cm34xtc3vWIPDnbkzAW+srhrfJ8SSESBHO9uQShzZkMIReTmd5apSQki4Y2ckRAwidw= 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=bzmyyeK6; arc=fail smtp.client-ip=40.107.6.82 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="bzmyyeK6" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fRqknCrsTLVWQY/gX54Sd3uYNUVGLg6VcyY+JgME1RWFw/ic+9ZUr2Md6En4s8t56odih4JrDUmXW314tc/caa+xfTxV1IprRKIKdCpQAIZS8iwtZMNbdpZADBuP8LkmIBcpAk0F5rDlun3KXVK20QhqwG2fnh3RxGTaxeNc9jc7KQEWDmmcGIg5dhwaC6xnHli28exJF1jvxxOBjjd2BEhuEVJjKfJmfPjcdaA+dlThwRVfCGQoLpvhIZsXOqBF+J77zAg9k4mEzguV80Ue2eV7J2kZ/HioZIuI2NwZuVhlGSwoQiEUBk/SWKru+kz1iwia4nDPtYATRddYeeI4ZQ== 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=3IvHQ5wdcDziVYYnY2bELUDP4mnMsFwYmrWMcffc0yw=; b=SWaf7VGt7+kLuS75SJBF1OClez1xlhKR4xFntIqiyh0ZiX20YUyzG5EzzS7/eBh7EGItMpUpttKiHZWRlE2MjTU2D3JY+g4a2B53q132YCPaT6warhO6gyl3tdhqFolFNe1F+puj+9jnxiXSwWwXhMrJARXB6K1lDfjDiH3lEvpHLq5lB4vTFWPlzQCkLvDpwLAAQ1xkj8Owlmd8TGtTyh9MUVwFY9x6ZqBjGwCfgLBznkhsh2JhMkXH7C9M3+acdtIHPfnQfAFf2HDsjU4WaaX/b1SiLidRPmmz35J+bi9NJseGrPVWaSPrzXRWgvBy54CBInN6uJVVYLm+YWyk5g== 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=3IvHQ5wdcDziVYYnY2bELUDP4mnMsFwYmrWMcffc0yw=; b=bzmyyeK6dbZSoAPLr1+b+IJNnQb0zUV0WXZ8hLFeEf5CeDyYKAycI48FNKLt0yY8h6SscNCCr1L3ylBfkWAlntXOM2V9Qo2XkHVO7JQifEstCyUoDQeWkxiFNQiQFb1H3Y6QOQynZkqP1H34Ub0Zr38CMuOhF5CVuWPd41Z/XE4= 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 DU2PR04MB8934.eurprd04.prod.outlook.com (2603:10a6:10:2e1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.27; Fri, 17 May 2024 12:35:15 +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.7587.028; Fri, 17 May 2024 12:35:15 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 2/5] shared/bap: Add detach stream op Date: Fri, 17 May 2024 15:34:33 +0300 Message-Id: <20240517123436.146332-3-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240517123436.146332-1-iulia.tanasescu@nxp.com> References: <20240517123436.146332-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AS4P192CA0021.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:5e1::15) 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_|DU2PR04MB8934:EE_ X-MS-Office365-Filtering-Correlation-Id: d555f04f-dce0-4a26-51af-08dc766dcd9a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|366007; X-Microsoft-Antispam-Message-Info: is5iQuEg28L2PLGlo3DtYMV+3l4M2vTPAANZiXfTcIwx205VF9pSgvtGFg6xu4ac910HuWseTByP+Rypz7uHE85mAQxJ+U0fJiA9M5pjzDPFc5LdipZ3B/v0LJ8+ecNyw/l6M+JPiHPulJmzxEVlF3kUcRnnZI4xziyiZHhcsaTMkEvvWf7BDkzJJWJBG08kYELoBn17Sbrcnm3qFh6r2IyRs+ySDi1W9x1vBRZlM4QOdqAQO3j4OKOj4Ikkc50z+4a1vO+mudp14mw3+eC8czR9zjrBq6aqT+ivisURdirOu7RWIkO7dztn9SKOoc9gxdUay/e57RT88d+Huxx6K8pGn2ZkOslUX7Nrs4pS9cNTUEmwuO7Qj85TfWGOeTTKEjxEpKdxYh7UMR5KhVBVtny94nF1vvEVZCYN5jxUG/6CDMl235AwxHNMiTBG4mWabKc+SMGebYdZLSUTN02flFBgGD8iEbcYebQ3Kda/3KZxhtaCw2Vodw5MI0J7TBte1MFxgGWM1UKsEUB01x/hVjL0oZJuTIzc086RGisBK6bwf0vifPUFUfU6mZo/8YhFOoneTD78bAFDS/5+O9SeHcPclU0FyL6ZY4DSFyHMv0FFltWap1NnHtoeRJ2OsOwUGhc7qMCz0hh2zBvZHiQnMUHXWFY/t/auteyHTiIl3nXn/PJ4tip7dMa7oR2Gpd99EZYbPfco7Ji3WX60E5N7IB/Ei0DvRTNw+KCow5xqGZ6FzTlJ1pveIsCSX5LE0/phyaIJeQ/yDvHtf5jyt80NKVceEtKftVOvV821OoFuIfaSY0hXhWM4j87mEQj+0+acteGBahMK1z3UZimPY7f3GaWUUqGc1P/LQoAr8Bizcr8DDORJ+qOeNReNzpll0+hs+mHKDt6D8chgMSkqyn1gS0iKMGjyWlhsu4lFYAjkc5KBsk+B5jMGXZAwxMRL2Pm9/oxkGAWY3Ak+aQkxskNverIA+hcITly7betL40yOrgLT94id8ErJH3sv6/UD3vrX0n12YDEVhKC/wFiRN2Trr9ENJlhIp7TnVtSWkKV6FPasrR26R51B9QVxSpvZMvlsgh0N8YYCME5FR2TYtsYh5JNey07GN9/dRm/pg03BsUFqTfjlLVQ41EWakQPh3mcGlG/JNU6nDO9GAGLI3HEJfNTI4GJ1L1ggim5Myqlz/fruNQSFpYLmqzjdo/WhgiG218brkveVt8T3i5FgZY1l9HxmOoSP5peYQA5sYKwYLMARy7SoZf5Mf3crklaN6xUwHAHGBUqmVk8mgtOmZ6bxNg== 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:(13230031)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9G/arBaZr/jJA8lgG0UWwQUOkMOS2eEI8we6e8DPkrVegI3PW8nxbngvlBzyGdQ8M/ZXSlMNm6VMNVkUVbEh6MUyR5jCRUbEBCZEt9A1042G/qjVyOcrxCPXWWLNOGROdCvgjqsJM+RDGfxsGHgeQf+xnrpnRIFJcMytCxvPcwksiP7d6JaBTPl482c54b8PyBQXCDay5YKDoxIl6vcvp3PUVMkFKL5ELx3Jcqr8Ciu1/azCodwy8sgAx+NTLmoCZA/RtuFfExWfYnQ/Ar/tJsFSo3jn0mnjRUMf/PtG0MbZhyDR3OweUyDhgYLWua0OnHitmliNPrMq8TWUaChxridvalQHq2/RI5Y01DnPsDEEr+xqqZ1CS+Wtvcu1PYF7PJQSymcpsEO4mYNrNwDyvNVi/KJMwUjKNbpVYrA3K14tQg9tewTmkFZiLNF3d9RYB/02zYy08zD0GVakeo+gxRF2SxMYJ12WkbYKz1Us9GL9OgjWwYK+IheP39vq7nXKZeb7X18smLP1Zm+ThBQPKSCZxUkgyondjVCj37cF/AmZwRIwVgAo1XHRDu2V4FO+T6ZV4vo5XD3dieoyuWJNRg7gQV11FUR0SmlK+B/qVjMBS6Lc5/IoqV30b2h3z/yZtP5eROmfUzvjkIIiHiFsoomnu4dhOV4j5fr9Wq01SHZ1hfvw9asI4rd7aWsu6vJVr2IbPbSdk7YIdNmQYv30PZCazwBptZSW43GJ0L2dMaoGelnacdIJetOsPOhr8qf/mv39FZHtJfTlXNMCop0HOMd1YUdA3Cym7Hjq/XfAkxHQLOePYT5YV6gXn9zOwL+fXALj+UmegLKEQqIIooW9jTIvre1QfhVsyT9bT6sEv3phiG4Zb4Hc3m6MpwofK6juGiEOxTO2XhY2QB3YafOY//6bYE8oB6lnK/aDclMOgd8gf8Syrp8uPPlFWKiLuPixmcyJraavxLLa2qiDpX4qJAjOduOMkCKkWndJFEi21W3+OjiIZgFF8RMCWbrHvKgAxljJ2wmIAMuW2dXSPjkkeI77q46ahSpBOA6HhuTjkFGrHyxhCPlD6IfGsptKuCJ24zUdIv0/tw/hnv+QcC6fX4GLgwepoVT8So7eoNcQnISxXBchEI1IUsksaw78VR397Q6IsrCP4tZt1k9o8fgFHPUv7EUZPEgaw13zBjMhDD1tcuiBfJmHEUxlhLuSYZxgHCASrNoZrVzRF4lcnxaVPCCcV+KExl//nMMK1+HIBmoCbPZR8BybbeCWZK7jiapvS2GMEYzugjKbRvPP0Lh5OKFRCthxTk12Dsx8xPuFOfsdPQ51LknM/zbDjOoVoEzny8RPqKiPjC9/98OKTxBfWAP9fdoypkGRc/g8gKc/H+ZiF0M7zHk8WBS0sWJ6D12/pJf3vjF1LZBYxqbmi9SD/vCRPEKzQtC4b37fWzmbIeHenr6MFZXiQ7BwAH63/BFKIMrWuEtGU0GXHyyRQTTGT01ndNTuyXEtI1BGG0fhM9clapHXW/a4qzzvoHqvIq4hOaDeNJlGCT/hESbaQISZu4g+H1Eqi4jKgcqi97ckr2iWpIyfhN/ZzUlSJAcW+UWAbJu/zFz2vCetayFyBh7/Uw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d555f04f-dce0-4a26-51af-08dc766dcd9a X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2024 12:35:15.4391 (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: hMmKUw3YxZDmFyHyt6AtzaZndkbO0GvN3whbt2lSkX6mSW8/ZWrUcWSdYw882qPTDXlBRvSKeBl+1NdXYJORNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8934 Since a Broadcast Sink stream is not attached to an endpoint, bap_stream_detach must be adapted accordingly. This splits bap_stream_detach into dedicated stream op functions for ucast, bcast source and bcast sink. --- src/shared/bap.c | 55 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 40ce16d75..6572ef1d1 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -250,6 +250,7 @@ struct bt_bap_stream_ops { unsigned int (*get_loc)(struct bt_bap_stream *stream); unsigned int (*release)(struct bt_bap_stream *stream, bt_bap_stream_func_t func, void *user_data); + void (*detach)(struct bt_bap_stream *stream); }; struct bt_bap_stream { @@ -1171,7 +1172,7 @@ static void bap_abort_stream_req(struct bt_bap *bap, queue_remove_all(bap->reqs, match_req_stream, stream, bap_req_abort); } -static void bap_stream_detach(struct bt_bap_stream *stream) +static void bap_ucast_detach(struct bt_bap_stream *stream) { struct bt_bap_endpoint *ep = stream->ep; @@ -1190,6 +1191,34 @@ static void bap_stream_detach(struct bt_bap_stream *stream) bap_stream_free(stream); } +static void bap_bcast_src_detach(struct bt_bap_stream *stream) +{ + struct bt_bap_endpoint *ep = stream->ep; + + if (!ep) + return; + + DBG(stream->bap, "stream %p ep %p", stream, ep); + + queue_remove(stream->bap->streams, stream); + bap_stream_clear_cfm(stream); + + stream->ep = NULL; + ep->stream = NULL; + + bap_stream_free(stream); +} + +static void bap_bcast_sink_detach(struct bt_bap_stream *stream) +{ + DBG(stream->bap, "stream %p", stream); + + queue_remove(stream->bap->streams, stream); + bap_stream_clear_cfm(stream); + + bap_stream_free(stream); +} + static bool bap_stream_io_link(const void *data, const void *user_data) { struct bt_bap_stream *stream = (void *)data; @@ -1285,7 +1314,10 @@ static void bap_stream_state_changed(struct bt_bap_stream *stream) bap_req_complete(bap->req, NULL); bap->req = NULL; } - bap_stream_detach(stream); + + if (stream->ops && stream->ops->detach) + stream->ops->detach(stream); + break; case BT_ASCS_ASE_STATE_QOS: break; @@ -1311,7 +1343,9 @@ static bool stream_set_state(struct bt_bap_stream *stream, uint8_t state) */ bap = bt_bap_ref_safe(bap); if (!bap) { - bap_stream_detach(stream); + if (stream->ops && stream->ops->detach) + stream->ops->detach(stream); + return false; } @@ -2018,7 +2052,8 @@ static void bap_bcast_set_state(struct bt_bap_stream *stream, uint8_t state) /* Post notification updates */ switch (stream->state) { case BT_ASCS_ASE_STATE_IDLE: - bap_stream_detach(stream); + if (stream->ops && stream->ops->detach) + stream->ops->detach(stream); break; case BT_ASCS_ASE_STATE_DISABLING: bap_stream_io_detach(stream); @@ -2134,7 +2169,8 @@ static unsigned int bap_bcast_release(struct bt_bap_stream *stream, } #define STREAM_OPS(_type, _set_state, _get_state, _config, _qos, _enable, \ - _start, _disable, _stop, _metadata, _get_dir, _get_loc, _release) \ + _start, _disable, _stop, _metadata, _get_dir, _get_loc, _release, \ + _detach) \ { \ .type = _type, \ .set_state = _set_state, \ @@ -2149,6 +2185,7 @@ static unsigned int bap_bcast_release(struct bt_bap_stream *stream, .get_dir = _get_dir,\ .get_loc = _get_loc, \ .release = _release, \ + .detach = _detach, \ } static const struct bt_bap_stream_ops stream_ops[] = { @@ -2158,28 +2195,28 @@ static const struct bt_bap_stream_ops stream_ops[] = { bap_ucast_start, bap_ucast_disable, bap_ucast_stop, bap_ucast_metadata, bap_ucast_get_dir, bap_ucast_get_location, - bap_ucast_release), + bap_ucast_release, bap_ucast_detach), STREAM_OPS(BT_BAP_SOURCE, bap_ucast_set_state, bap_ucast_get_state, bap_ucast_config, bap_ucast_qos, bap_ucast_enable, bap_ucast_start, bap_ucast_disable, bap_ucast_stop, bap_ucast_metadata, bap_ucast_get_dir, bap_ucast_get_location, - bap_ucast_release), + bap_ucast_release, bap_ucast_detach), STREAM_OPS(BT_BAP_BCAST_SINK, bap_bcast_set_state, bap_bcast_get_state, bap_bcast_config, NULL, bap_bcast_enable, bap_bcast_start, bap_bcast_sink_disable, NULL, bap_bcast_metadata, bap_bcast_sink_get_dir, bap_bcast_get_location, - bap_bcast_release), + bap_bcast_release, bap_bcast_sink_detach), STREAM_OPS(BT_BAP_BCAST_SOURCE, bap_bcast_set_state, bap_bcast_get_state, bap_bcast_config, NULL, bap_bcast_enable, bap_bcast_start, bap_bcast_disable, NULL, bap_bcast_metadata, bap_bcast_src_get_dir, bap_bcast_get_location, - bap_bcast_release), + bap_bcast_release, bap_bcast_src_detach), }; static const struct bt_bap_stream_ops * From patchwork Fri May 17 12:34:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13666938 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2082.outbound.protection.outlook.com [40.107.6.82]) (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 26DA547F7F for ; Fri, 17 May 2024 12:35:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715949322; cv=fail; b=uPoOl7nwgiWNazJWopeedu+tPBX9J62G0mLANHhKiPnnOo2VX3UCe/Ghn36wdPnkJXoVuTcYFsRd2Nu0+EetLGDpCgW70MLxJB8w6a/2DA4/eAXc5DmAKoVIdiXE5tt0HlLJ2HUvp2XrROCgBbvdbei8GiMb/ErTXVaoW/9Dzm4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715949322; c=relaxed/simple; bh=c6dMa51jBq+v/MTrljsH9kDkmSYRHg2UEtC2ZJ6AfqI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ALpnXQKJDSfLHrj+kSag3HS/w5UNp2vB1RrbxRiSkI50KLpaXzsWuIuUihZyEBhXVdMYbcNyXyPc4KmpRmh5K0DSZfcx0049ti36rHO1X4/TkvdJ1DdYfCtOgL64Kez6OrQKZF1oxjJNdK8F6UjJ8rkD4pRLtz44jCVGnODAopc= 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=ZkWSybwi; arc=fail smtp.client-ip=40.107.6.82 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="ZkWSybwi" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GgNWAtOvdqMSJ0j3JuDyIkp08k7xu0+uMBmzGmW3MfZkm0PDhYGVuAz/VxEhrr9xUxWAtJbEgXjoHCJ3oJYLA2XhiR7UrIVA0R1n6EiXolpi4IKH3RAe9yb8kR4+DLw5IZ+40f02csVXyHQP9XVCmr6A2RMiL/alMhPCKi8cIH+OhKh17rwk+scP54OzVBaAUntjnLjeVL6wxtYTzDAQJrc++ebJUuFwSLwDS+lQdkdRNHXW3ZhqYfEdmBt0aLAXtHBgY5g6SYVeSM8g5dUKwAAZph9boFHevKhYZSh+lHkczW8b1s3fcXhNB+9j1K5cT/IDPpBlpAQyHsi9FVY9Mg== 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=uZwWolUlkRiZ1moOv7v1VNHRHSgKLXFsIGtdXfKZhHM=; b=aCGFsymoIfWtcqOmIE/tP3kUl+b58o++3N1LbJXHk2cfC7Van6byvCffjZTzTI62jSDTN2lUwirV9Z4HlFGNdqzamRwR6QdUqOdn3bsB69klKkEPVtuT2aqT/xNMzXKlu02qBPVMv7Wb8lPmKZHw4zIwQ0cd91ZnwRsUTafpnUOI9yd1f0qcqA6pTOmerRd1UwRgAqclHcuZHjJl0YqQLw9yM8fOEx5Z87/91wR+cqzrAVhT3B9zo7E8q72182HURqHX/fuzn96wU456fN9rbxPAfhenT9tIi8X77nasWa98vHmzSoCFfgXLHgtF6olJC+JwC1Dc1z9oa8C4fSSs4Q== 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=uZwWolUlkRiZ1moOv7v1VNHRHSgKLXFsIGtdXfKZhHM=; b=ZkWSybwi83PNC/ZB7x/zys4Cuyk1yGTHon8qlBe7TsTCy0hpvacQOdlX5WjoXVqaZhUuIn6/Ub6wYua7Jwv9KwJM9SDRyOC0c0Ucm+zyjMXUeyPQQqI9XGWVneBNqGuNecxgK01U4FuI3KRgX/hgbz7sR5KYOWYScEAM5Rar3UE= 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 DU2PR04MB8934.eurprd04.prod.outlook.com (2603:10a6:10:2e1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.27; Fri, 17 May 2024 12:35:17 +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.7587.028; Fri, 17 May 2024 12:35:17 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 3/5] test-bap: Update caps to accommodate 8_1 config Date: Fri, 17 May 2024 15:34:34 +0300 Message-Id: <20240517123436.146332-4-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240517123436.146332-1-iulia.tanasescu@nxp.com> References: <20240517123436.146332-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AS4P192CA0028.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:5e1::13) 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_|DU2PR04MB8934:EE_ X-MS-Office365-Filtering-Correlation-Id: ccad2d98-291b-4f36-290e-08dc766dcf14 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|366007; X-Microsoft-Antispam-Message-Info: 1g3jcbMOMl+JuXl4jMuhxEGDYMB/8Cmw2j4h85HewSOER1yvtE4CzjRmsDY6EcaQTXpCnmRNxWqflXXuYQX4Xe89zPHCmht3n3xb+OBdYmHdQOnCplWilyyfKixFGQczgVMJHSxgra3kmLgQ00IR8Sdedm4MTO9czTxh1lFVjElQo2nbCJ4ojiV9A3nmKfFllbs1M99paOLfeibnhxiJQkqqO3T+Ldk5ZUAjHt99l5nqjMe8d/oqqNULKjcRlnm0VQsWY2VSPgTyAJg89TfSez3XX0aWESLEp86Uv50CoLJloPUZ2o47mC4MqFwqlpfN186JvYOrQ2mrTkneahZbEEZ1whdAc6us7sBa3FABY60pPt04Deu4JqjvFLPqKk91Jbx58X+X5kM+hqZFq2yiLlmWQQ0Qe68z7c2djygdFp0oiXUK8jcdCj0zh05RiOpVD472uhIJ7Wz9oPnqH9kF5TYvZdyqgwP/Qh29MTrP5md2nLgXrmRuGnvaFxLXtkRRHgUkywUDatslhizQntnksksDO79Mt+Xg958p3JgeDVovZWncT+YdgDxBWqm5R3tcJdTkOQypYsvYRcv+SfD1CMyorHJ9Kza8EJUyyB26shyDahsXQxQ2YSKgHhAc3eabdNXSOeDVk1IH1M8pJ7k4zK017PVF2vJ1RbpWFhCJ8tJqoFl9ryqa5sByvl1Bciy3W2LpXFZ6sdg31pVbFUg3ssZg/7j1FiDKCgQGWTV44SVbj/TyHgFmhcuGgtC77yWK8ZsvV6l9Lvrie8hSrYrw8ZEWcLGPfndbFeTusmpcWB0+XU1BOUIUh6KEd36rRa+/x/RR31ymqfWMq/jkIfYRvEacm+LcLRJ6G73r1RXYx6R6vh84qnvnpjOqRbWqMiADRrbSnzQt+auBf2YOpY8141n5l9VPXtfgwGKQUGEoyvpDEOunOG35pZezxAQu5hLYavIlwzx2BorJPqZ1g5c+7UXBZ8DypD4UykHNp7rOY8Vo95H42JJtlZ7aauqnfa4KjgPTDf+7IO14K0/WhQH9+DAaHSQgiFw6H7iSOrfUeUJ2sIXwzW44pFQYlcBJyW64gPNBq27LG1QkrvZ6sgtuO0FAgc7YDal9fDLFIifHbmc4Kt/QfZuUwe3BREZyKiG1EGU3Hd42GHcCDH1DSEGYG9L7psA39638ccSC41T60rdz15UmWPq8QueHGHj6jAPc4FnCC5RUv9qSV9Fpeg2PrOD/G1IT7QxfBuP6a0yEplb0yyT4lAJCIW/N6AhQae0iAmuJeRGpNRGRkNIvLXZz/Q== 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:(13230031)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: hBwnEvb6QatR4j8TFXdvi33eNmy+KzWsF/QUBCeE3BatIVC5rSZWdmxQfEPYwnkRCeE1Y0xef1O9J4EWaNhsQTztaGuSwBNYczppezOraeOmOc+0nGHB9iX/hO4vkzHW7UC2CbyU0ZekBl6z5r8BNM02O2aFrfjsJd0+aUt7suXLLGf5/KMGnBQ7QilvNeB56ni/QJYuZcfAGJnPCt4fNgGuegklyMfT9qSCFh5wsK4Az89JTRTJIjEgiDMOQC9ADr3vfbMbliBJ5nMCQ4SeMEqmvS+bXDhTLUuglU65buO9RD9/xC0q3YEL5G+aHp8eUVfkNTnIIVLhW4XOo3bCtWwNW20VQUo626RYZtDJdfVM0WR9/8vTtJMtkqFqqokeukZaYoAT8UiEOuecPGYozytd5yyGowCA/jPJhk8tso2/i5he4fsaUSWqqnLa4AHfzI8Yjk+G97OgMRzOU45faFb1KXTy1oFMSg5bx57R8cCr9qMkz40Ia+CvmJthuSCqP2VJ2+eyJNJlKdl1q79FyjpFAfWu313nUrhmnXg69VbprBF52wnHNwYC5+ycqs3r9IU0pIpQuUCmUG8G4ikKLPGJyWjs5OFsCrpQ7CZH27My8uRRkOmECRT3FjLiq3z+Tm9Q43MmguqaEIVI1nbkZ6sRjL85UVujsXumXnET7ZOTPLCXCRG9ttgaMdpzygNOAtmvUs9TDOY0qyMrWyJGjK8ENdWxmk5H1g9H+e4fpAzOEX6kMIfqnMMZmE7SB3BAh8xTrpO5bY+tNzgMWMMrHl1ngHF+ZM6fPgQzegiqols/EB4BWeYFSq9jzBxF+BO1E8+8/oa50VPhQhjMTxy9Q1UwSW7jgkbLv5nRbUDzjAEklFbqMfvxI+7GszygtoEtwZ/GHLPOJBRNLSiwgZ8GLmSQjAo9xTzysoj5bUo4iAcwnImGOVxXpDokHNESo5XfpJzb2wThhGZHFdXMShXtDs7wgCgsiCVx/fRUzPzAihcgpj6dqTm+TCxQQtQ0oXm+TBDcXz867mOPSmZhzyfL1CUlnWmmm1bisMuqwd3MHBxLK9LOPyXY3kS7Kf3yOkMik87b1NTlf4aTGWPVSDIKNTJjUZtPIFgmqD0xIChYh5D6yLRLQ+nOSmRRbE3NnYeuhmsK3HucdlDf8WDjCui2fn/QBmReJCTQ20SeheyJqvakp897uWfYnJPwMShXyzzckuYAp+q5PaVd9EUJrG2YjUGFbxHZ21jxdMcoelUqaMKhFg79jHnAmqjtCHJ3mt7a6zbp/jdknvWN1pvDe9R+XNUrene+rXxuvKTaCaRoETBxESp9XSqmQMnhGkE5YQJgKD4k4gFysHPcDWm8VuXS6Iw7/22TG5Y3K7YW+qJjqfQpzVJrtgTc3fWjtbbTJUE+UrazAX9WBJ9IYsGbbaJi9Z4q5Xs4P0uF4TCprFPJOddTAKlJX1MhMZ5/a/D0jwWC/xgbiTCkEzS8DNd4x+5haMDny+yI5O+CtT0Ekp6khZgH7r59ASlZzvy5qVK/rNYEXovO3hPZ6MujKABmFj8d03zSREwzx0Qm2JNBITzxyVQiSUcVhk/A9fumTnBaAIfm+g+q8zyDX+r0g9W29UJBYw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ccad2d98-291b-4f36-290e-08dc766dcf14 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2024 12:35:17.8158 (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: exVYdChkm4C3KnSKplGSYSqiRbJG/Y/4nDYo7ykRoEILjmgY4r+sZZguVzUqGK65MSakhERsonlT0H+7LR6n8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8934 This adjusts the min SDU size in lc3_caps, to accommodate the 8_1 config. --- unit/test-bap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unit/test-bap.c b/unit/test-bap.c index ac9d7ff38..e930ca604 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -64,10 +64,10 @@ struct test_data { * Frequencies: 8Khz 11Khz 16Khz 22Khz 24Khz 32Khz 44.1Khz 48Khz * Duration: 7.5 ms 10 ms * Channel count: 3 - * Frame length: 30-240 + * Frame length: 26-240 */ static struct iovec lc3_caps = LC3_CAPABILITIES(LC3_FREQ_ANY, LC3_DURATION_ANY, - 3u, 30, 240); + 3u, 26, 240); #define iov_data(args...) ((const struct iovec[]) { args }) From patchwork Fri May 17 12:34:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13666939 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2041.outbound.protection.outlook.com [40.107.22.41]) (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 385FB43AA0 for ; Fri, 17 May 2024 12:35:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715949325; cv=fail; b=Dq6PyY57ElL3ZEBzMjBzDiA84RkZiCxmN7cVHoYQFXVbBVxbwedlXmIFs2TJ0Xom11nf7sMKSdiOlii6V4YQR/b3WihDLANtp8i9NgJTfr25XlSwOHOzcK6OuNI8Lo1ya777+TwlmWdgzOYgFLWdmKvYATTDtTOhyt4v7qqglkM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715949325; c=relaxed/simple; bh=qsduHTIPafhfsSPZixQ8D4RTNS7IanUBnbN6wVuOUCU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=KId7hf8llkLkrV34jPC2TqWOiZQclhaLWndEvGI4U6rjV+5BMyFkgnuWAB9L/x7XhbvxeYmrpntv8c5btGAXSEstmxZHXa2Ltvi8KVc7Hu9o2y2fxRwtjyoMxKK/aUwZVn2uenwcbF6XO4MjEPG5uOwxQLrn/P/OW5lNJH4fP9w= 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=h4nh61m/; arc=fail smtp.client-ip=40.107.22.41 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="h4nh61m/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YHx8vVVLnwBXI5gM2svEyBccpd/Zlc7jJ5n0jNJvjfejgyRdznMR+PXSSWe1vOnevFNJR708I5PPRxfR/pVSWQko8cEjOf6LfrYx/8S4LTs7/nRIEa2mNJUs3AGG7E0bBrsnwBjDv9Qj9cW00UL0CBX48N2h1shTivAtFWjdKWr5QsMROyZToVng+NGCN47CPv2XxmVLP4NxCVonvNxdEDlL6gsrxgPM2uotvLCFn+80UqJq8VV0zQYv/Ed6WwIp/6W4SHgLd/UgdYkBfMXirwS4/vM5hL/d1fSzFb6RXgKhXmaXHX57adt6xhsy3s0TRdmJRC7vnJC6jUt/bBDyHA== 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=6IK3ze+fdUYY+y8nwfj8lJScMtXPNbliKupOdYk/Lbw=; b=E9RbE+fzGuozQH8Uv52cL/y2q70qfDPTXSQnJFL+EWuKnY8uHAs+lHDt3tv8mtHNBh+7coSHtcbKBN/gD5ds+Id1UB9X6AKKda/iSBpPXIbncOsLlyL2IFEu8khs/rXlAEEr+G4rIjeqm7Q7ZbXlElEpblQYmdh8F+zO2GtTs/JA++vs9GuMtGc1KGYl0Bn1AZzAXxA3e0hlE0Omj2fDSI0HzPsEsTVQ+nZBCPetIxw/s76ewCKGCSwoH4bwXURA9i2bAefQahDJrhNA9vFukY4pD+nOTMPNqyQJsylseQrQBFwOtv8nEisIWiNldZPjWbHoUP8tFCveXUVTm7KVeQ== 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=6IK3ze+fdUYY+y8nwfj8lJScMtXPNbliKupOdYk/Lbw=; b=h4nh61m/LALF8omH68O2BjftUerCOAbjDPEKsOfCSxkT5DRP/5R+hXxmsVrULo0zmntVI/F51EdiarHJYZJlT9hNNJDine2W4zftSKLayqYoKt/y4XxuaWavkXBjDTPQNURunJBHQfC3PQhAgPhQwm29QTJNW4RlbWEzsluHwkc= 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 DB9PR04MB8362.eurprd04.prod.outlook.com (2603:10a6:10:241::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.30; Fri, 17 May 2024 12:35:20 +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.7587.028; Fri, 17 May 2024 12:35:20 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 4/5] test-bap: Make test_bsrc generic Date: Fri, 17 May 2024 15:34:35 +0300 Message-Id: <20240517123436.146332-5-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240517123436.146332-1-iulia.tanasescu@nxp.com> References: <20240517123436.146332-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AS4P192CA0027.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:5e1::17) 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_|DB9PR04MB8362:EE_ X-MS-Office365-Filtering-Correlation-Id: 333345af-bad6-4514-86b8-08dc766dd075 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: MAh+ZTeR7IV6BDHok3c2vLSm7zu8y3dkWPM/MAVolOYLB9vnoXybmn0JVzqPI56E56+d6uMHTWtvCfeQQlT5NIhKk37aFqqpU8LCDNJ24x9pTCsQV/u0jhdbaTfv/lKaTa1NNgg7KcXBk1dQLufPV+UEbMcXdH7FbIFyxVSxwTW0m+plTFT0gR+/Rd1PKQPzd/ewQWllq9glfVWkD8Qw6D29IYswKzDxzDcxnEtx2v8wXVquzKIanB13UPHvHLgXn249gydOk3OWHJS3BjNMqkALy6gL7bHnpy56zdVJjiwpkwViTK77HigGCUGpNbweSTAq8el9flSdSp79zojVRgG8DywTHr1Whp36nsZq6D/Kh5XXm57qJzNmljxf1DMkQkqZ/sJB1aLTMfv2ISo84NHtMo74zEcpEPRw9/cgB9uE1NI97S3XDrqOzAU7k0CBND2EXjQPzFpZAYGfEXGEsAFg0M0lNGKDLEU8ntvcy1jcPX3a/mbBdcK7qon8pPzuwq3ERJfiAHXufygiM2WtkTveAsonBlVmcrWv5TNyyXe6UncdEfUwFABxhN3JPRDPwIl146K7rZzzgiRa4lMx0IKe+WKQj2ZwYcjve12dRAJAQwVB6ihj32SsgqmR67792iNNS4KFOVEc2OwmwjajMmNHvzgCOWzKWYDG6uVaSG1NuMZOQwHcpGIr38bUaTWoNIHAYMREPH31Ls50zp/BbHddXYWE29Gm9lJHF06pS+wAB4l2TFxxVDaRCseFkxdXTjUmhBCqr5rm/6s/WqsZWb5CUHD0jjGJkEGYuunr+2enNjyf3V92rV/2ODg0xIm1wWYUCNn5E1e0n+xb9teH3vJWophL/FsiCeeDVPEpvQTmGBFU0L+oV1yjjc56uhnqhuzn2/5BjJeGuSUDRiEIeUvs2GDuKuJCuimJyKj+Jk5E41th7E76LrPunaiujev07bGN6GoPZwwqoodsQ4D9GxwdWPQnmr2Ga5m1kS8UyCgepdXe9lxf7Qq190Eve+NoEZLmiW3bnwoJFXA44iiRVsiim4s2DDWSBLd2he3IFfUdo8Vn4bBCC1PNLA+snSbY6SZRO2reb8GpV4AKKQl7q75yG/pZCsPDiIJ1LjEm25yB9Zr6UDMCevb2/bGzNs8205T5CgIpa9wl3Rs69G4ERFoEtELmqoPuSmoD4x9r+OLiYljZwkU7XWe7iPEBpozMB7+v8Nqt/M8fXjSENGs0iQ69XbNtL7/GgkhvxwuO3FGBQs+8+CD0GSDW5foyksDijn6IQkDaTaVgYSvYAOnL7g== 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:(13230031)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZPWVcs4z12IX1HdAMfNIjolCQn0Ti4oyDURwhPXSpu8P1rZ1WeRBZQfUGLqw/6UjB0lbd/w2EEX42KQpWuTy/hw1bufUYRtwryWpEPCsVdXVup9hThQwvUHDSLYmuHy9lOIasXsukOKpfrTAX0XMeyjZMWVQmtIG4lcjWXvT/tVdeic0Nn8yTNFzzjW1J+OKQsqElVSl077rHwDp9iTbaIzxRQuvbYDSpQJ/dYqTl5SKPNnxidBiWov1aQforLcyoFhfFGlVoopsnMWg2YVzW5SdaQG7zm38jaJXtjiP4u97lghTQknsf3KmI875zHaiLQ3WoUBJnItzX7JL26sEfRSu0h+/yHo/++8jEpQQ2KB4sCszx31vEeIhKJRzJS6kX82Bgfs759wiQIRckhcy8+fxKkv1i4r25cdtXw57lqPE64+MzOTUqTHLHHFy5Ti4Y7+LFKW9U+bidxpDj8AA+p2k/afmIyMVpGSGiKvmnjzqc3UeQyYd1R4uqgs+lcEhZpaJuxTH+MEXQN0gHIW2wm6e251/cQAeFoecCSv+FExtXHcipSRLdKa5NEHo45EppD8UgHJcax+7RQuBIiXCQa5uh7NVYrceETiAtXV6mfz8nAXnIPzVevi2fwfnyEK72QclUzRDJ//9bbu8YqQv6n7gE1z5skUv79y1PgEj8gA65pj21FLnQ3a9YoZ9kkxWlCeBr13dRXKoTp5NE7ZfLv+bp4XL0rtxiVoUvqeilNvqmm6JOrX3zv+Jz7NqRD2fqymd1t7dthliLMwA60BSnQepXRpwgker9dZrcr3XXxFqLEGdJy56SA1Up/5twKcSOODuK+EU952cOY+zCd6CTDVI7otBaYHnLAnoTytwm9YYJmBDBYEjihd8VUiOzKyexzdBhaIMJKdqIoTgRa4ZLfsaH+T9aZS5B37QoNAYiqv58eJc1jVvLXHJROKXaNrVSKkIFuU8EPwtQ03ZVziChL/SBS8n0r8roAzbxv+7bV81TaFzt4bDK0uoGB/pN35WpxFSy3TabRF0AMOMf3w3uN/7TJ+Xchmnl9hX8/xBrRA1R5ZPfw/od2ECdgs6q18x7cs6n0YTZXVIU8L1eESndRjwaA2G574jdUhDSjucHT0o4NYYDNUCcs+8fW//PEEfSgua0L5B80y4yW01cR1UpW1sKl4h027SbXFtmaccSACwcpBCI8uzLGSEDOA0XYiK74Z5FX51VJ21WmzmNXnSVMrzfBPCLVGxh48Qb8IvPCVgpClIEtgOfie9UwED3oyWtfFX5Wuh/2I0Yl4ybl6iJhmfsIyPNiBv+zGUSHgQrbHGk8ileiZ/y/IpSPC9+NAyYjqmcH/9c0Iao6W60HduxI7Iio7hAZCgNz7Aq5sNE8Vdx88S8/zwZwus8A7RTpHO9jf2M3izqkC5bY7p3hTcv7SbAri8iWNAwmIoDW7eRDwzBV0BYCsjH5Nyox15klYzCX+FAeBvVoILbKVMksljrK0u31+BmsTSuPYWyzpOOj0xiiCJ9JQmcWgfWPHYaeBhdO7UDfn/JxkDOKTSD4//9wp3IE+w19YMJCvrWt+QZcYOcFEZZaJY8Knad4Q1jVD/Vu0OX1FTF91xvGLKY44t+Q== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 333345af-bad6-4514-86b8-08dc766dd075 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2024 12:35:20.3736 (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: 2es0J+k2C0oDEWErc/OYYNdpRo24M1TE9wwgLRh5aXmwH0zTC7mNCdE2iloBOoXrAWYBK7y1dwO1p+wWnmWspg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8362 This makes test_bsrc more generic, to accommodate Broadcast Sink tests as well, following the unicast design for handling source/sink configurations. --- unit/test-bap.c | 182 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 131 insertions(+), 51 deletions(-) diff --git a/unit/test-bap.c b/unit/test-bap.c index e930ca604..a6e24e605 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -565,7 +565,34 @@ static void bsrc_state(struct bt_bap_stream *stream, uint8_t old_state, } } -static void test_bsrc(const void *user_data) +static void test_bcast_config(struct test_data *data) +{ + if (!data->cfg) + return; + + if (data->cfg->src) { + bt_bap_pac_register(data->bap, bsrc_pac_added, + NULL, data, NULL); + + if (data->cfg->vs) + data->bsrc = bt_bap_add_vendor_pac(data->db, + "test-bap-bsrc", + BT_BAP_BCAST_SOURCE, + 0x0ff, 0x0000, 0x0000, + NULL, data->caps, + NULL); + else + data->bsrc = bt_bap_add_pac(data->db, "test-bap-bsrc", + BT_BAP_BCAST_SOURCE, + LC3_ID, + NULL, data->caps, + NULL); + + g_assert(data->bsrc); + } +} + +static void test_bcast(const void *user_data) { struct test_data *data = (void *)user_data; @@ -579,24 +606,11 @@ static void test_bsrc(const void *user_data) bt_bap_attach_broadcast(data->bap); - bt_bap_state_register(data->bap, bsrc_state, - NULL, data, NULL); - - bt_bap_pac_register(data->bap, bsrc_pac_added, - NULL, data, NULL); - - if (data->cfg->vs) - data->bsrc = bt_bap_add_vendor_pac(data->db, - "test-bap-bsrc", - BT_BAP_BCAST_SOURCE, 0x0ff, - 0x0000, 0x0000, - NULL, data->caps, NULL); - else - data->bsrc = bt_bap_add_pac(data->db, "test-bap-bsrc", - BT_BAP_BCAST_SOURCE, LC3_ID, - NULL, data->caps, NULL); + if (data->cfg && data->cfg->state_func) + bt_bap_state_register(data->bap, data->cfg->state_func, NULL, + data, NULL); - g_assert(data->bsrc); + test_bcast_config(data); } static void test_teardown(const void *user_data) @@ -5501,12 +5515,16 @@ static struct test_config cfg_bsrc_8_1_1 = { .cc = LC3_CONFIG_8_1, .qos = LC3_QOS_8_1_1_B, .base = UTIL_IOV_INIT(BASE_LC3_8_1), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_8_1_2 = { .cc = LC3_CONFIG_8_1, .qos = LC3_QOS_8_1_2_B, .base = UTIL_IOV_INIT(BASE_LC3_8_1), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_8_2 \ @@ -5521,12 +5539,16 @@ static struct test_config cfg_bsrc_8_2_1 = { .cc = LC3_CONFIG_8_2, .qos = LC3_QOS_8_2_1_B, .base = UTIL_IOV_INIT(BASE_LC3_8_2), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_8_2_2 = { .cc = LC3_CONFIG_8_2, .qos = LC3_QOS_8_2_2_B, .base = UTIL_IOV_INIT(BASE_LC3_8_2), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_16_1 \ @@ -5541,12 +5563,16 @@ static struct test_config cfg_bsrc_16_1_1 = { .cc = LC3_CONFIG_16_1, .qos = LC3_QOS_16_1_1_B, .base = UTIL_IOV_INIT(BASE_LC3_16_1), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_16_1_2 = { .cc = LC3_CONFIG_16_1, .qos = LC3_QOS_16_1_2_B, .base = UTIL_IOV_INIT(BASE_LC3_16_1), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_16_2 \ @@ -5561,12 +5587,16 @@ static struct test_config cfg_bsrc_16_2_1 = { .cc = LC3_CONFIG_16_2, .qos = LC3_QOS_16_2_1_B, .base = UTIL_IOV_INIT(BASE_LC3_16_2), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_16_2_2 = { .cc = LC3_CONFIG_16_2, .qos = LC3_QOS_16_2_2_B, .base = UTIL_IOV_INIT(BASE_LC3_16_2), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_24_1 \ @@ -5581,12 +5611,16 @@ static struct test_config cfg_bsrc_24_1_1 = { .cc = LC3_CONFIG_24_1, .qos = LC3_QOS_24_1_1_B, .base = UTIL_IOV_INIT(BASE_LC3_24_1), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_24_1_2 = { .cc = LC3_CONFIG_24_1, .qos = LC3_QOS_24_1_2_B, .base = UTIL_IOV_INIT(BASE_LC3_24_1), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_24_2 \ @@ -5601,12 +5635,16 @@ static struct test_config cfg_bsrc_24_2_1 = { .cc = LC3_CONFIG_24_2, .qos = LC3_QOS_24_2_1_B, .base = UTIL_IOV_INIT(BASE_LC3_24_2), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_24_2_2 = { .cc = LC3_CONFIG_24_2, .qos = LC3_QOS_24_2_2_B, .base = UTIL_IOV_INIT(BASE_LC3_24_2), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_32_1 \ @@ -5621,12 +5659,16 @@ static struct test_config cfg_bsrc_32_1_1 = { .cc = LC3_CONFIG_32_1, .qos = LC3_QOS_32_1_1_B, .base = UTIL_IOV_INIT(BASE_LC3_32_1), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_32_1_2 = { .cc = LC3_CONFIG_32_1, .qos = LC3_QOS_32_1_2_B, .base = UTIL_IOV_INIT(BASE_LC3_32_1), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_32_2 \ @@ -5641,12 +5683,16 @@ static struct test_config cfg_bsrc_32_2_1 = { .cc = LC3_CONFIG_32_2, .qos = LC3_QOS_32_2_1_B, .base = UTIL_IOV_INIT(BASE_LC3_32_2), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_32_2_2 = { .cc = LC3_CONFIG_32_2, .qos = LC3_QOS_32_2_2_B, .base = UTIL_IOV_INIT(BASE_LC3_32_2), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_44_1 \ @@ -5661,12 +5707,16 @@ static struct test_config cfg_bsrc_44_1_1 = { .cc = LC3_CONFIG_44_1, .qos = LC3_QOS_44_1_1_B, .base = UTIL_IOV_INIT(BASE_LC3_44_1), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_44_1_2 = { .cc = LC3_CONFIG_44_1, .qos = LC3_QOS_44_1_2_B, .base = UTIL_IOV_INIT(BASE_LC3_44_1), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_44_2 \ @@ -5681,12 +5731,16 @@ static struct test_config cfg_bsrc_44_2_1 = { .cc = LC3_CONFIG_44_2, .qos = LC3_QOS_44_2_1_B, .base = UTIL_IOV_INIT(BASE_LC3_44_2), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_44_2_2 = { .cc = LC3_CONFIG_44_2, .qos = LC3_QOS_44_2_2_B, .base = UTIL_IOV_INIT(BASE_LC3_44_2), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_48_1 \ @@ -5701,12 +5755,16 @@ static struct test_config cfg_bsrc_48_1_1 = { .cc = LC3_CONFIG_48_1, .qos = LC3_QOS_48_1_1_B, .base = UTIL_IOV_INIT(BASE_LC3_48_1), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_48_1_2 = { .cc = LC3_CONFIG_48_1, .qos = LC3_QOS_48_1_2_B, .base = UTIL_IOV_INIT(BASE_LC3_48_1), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_48_2 \ @@ -5721,12 +5779,16 @@ static struct test_config cfg_bsrc_48_2_1 = { .cc = LC3_CONFIG_48_2, .qos = LC3_QOS_48_2_1_B, .base = UTIL_IOV_INIT(BASE_LC3_48_2), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_48_2_2 = { .cc = LC3_CONFIG_48_2, .qos = LC3_QOS_48_2_2_B, .base = UTIL_IOV_INIT(BASE_LC3_48_2), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_48_3 \ @@ -5741,12 +5803,16 @@ static struct test_config cfg_bsrc_48_3_1 = { .cc = LC3_CONFIG_48_3, .qos = LC3_QOS_48_3_1_B, .base = UTIL_IOV_INIT(BASE_LC3_48_3), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_48_3_2 = { .cc = LC3_CONFIG_48_3, .qos = LC3_QOS_48_3_2_B, .base = UTIL_IOV_INIT(BASE_LC3_48_3), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_48_4 \ @@ -5761,12 +5827,16 @@ static struct test_config cfg_bsrc_48_4_1 = { .cc = LC3_CONFIG_48_4, .qos = LC3_QOS_48_4_1_B, .base = UTIL_IOV_INIT(BASE_LC3_48_4), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_48_4_2 = { .cc = LC3_CONFIG_48_4, .qos = LC3_QOS_48_4_2_B, .base = UTIL_IOV_INIT(BASE_LC3_48_4), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_48_5 \ @@ -5781,12 +5851,16 @@ static struct test_config cfg_bsrc_48_5_1 = { .cc = LC3_CONFIG_48_5, .qos = LC3_QOS_48_5_1_B, .base = UTIL_IOV_INIT(BASE_LC3_48_5), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_48_5_2 = { .cc = LC3_CONFIG_48_5, .qos = LC3_QOS_48_5_2_B, .base = UTIL_IOV_INIT(BASE_LC3_48_5), + .src = true, + .state_func = bsrc_state, }; #define LC3_CFG_48_6 \ @@ -5801,12 +5875,16 @@ static struct test_config cfg_bsrc_48_6_1 = { .cc = LC3_CONFIG_48_6, .qos = LC3_QOS_48_6_1_B, .base = UTIL_IOV_INIT(BASE_LC3_48_6), + .src = true, + .state_func = bsrc_state, }; static struct test_config cfg_bsrc_48_6_2 = { .cc = LC3_CONFIG_48_6, .qos = LC3_QOS_48_6_2_B, .base = UTIL_IOV_INIT(BASE_LC3_48_6), + .src = true, + .state_func = bsrc_state, }; #define VS_CC \ @@ -5841,6 +5919,8 @@ static struct test_config cfg_bsrc_vs = { .qos = QOS_BCAST, .base = UTIL_IOV_INIT(BASE_VS), .vs = true, + .src = true, + .state_func = bsrc_state, }; /* Test Purpose: @@ -5866,103 +5946,103 @@ static struct test_config cfg_bsrc_vs = { static void test_bsrc_scc(void) { define_test("BAP/BSRC/SCC/BV-01-C [Config Broadcast, LC3 8_1_1]", - NULL, test_bsrc, &cfg_bsrc_8_1_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_8_1_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-02-C [Config Broadcast, LC3 8_2_1]", - NULL, test_bsrc, &cfg_bsrc_8_2_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_8_2_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-03-C [Config Broadcast, LC3 16_1_1]", - NULL, test_bsrc, &cfg_bsrc_16_1_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_16_1_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-04-C [Config Broadcast, LC3 16_2_1]", - NULL, test_bsrc, &cfg_bsrc_16_2_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_16_2_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-05-C [Config Broadcast, LC3 24_1_1]", - NULL, test_bsrc, &cfg_bsrc_24_1_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_24_1_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-06-C [Config Broadcast, LC3 24_2_1]", - NULL, test_bsrc, &cfg_bsrc_24_2_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_24_2_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-07-C [Config Broadcast, LC3 32_1_1]", - NULL, test_bsrc, &cfg_bsrc_32_1_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_32_1_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-08-C [Config Broadcast, LC3 32_2_1]", - NULL, test_bsrc, &cfg_bsrc_32_2_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_32_2_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-09-C [Config Broadcast, LC3 44.1_1_1]", - NULL, test_bsrc, &cfg_bsrc_44_1_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_44_1_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-10-C [Config Broadcast, LC3 44.1_2_1]", - NULL, test_bsrc, &cfg_bsrc_44_2_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_44_2_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-11-C [Config Broadcast, LC3 48_1_1]", - NULL, test_bsrc, &cfg_bsrc_48_1_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_48_1_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-12-C [Config Broadcast, LC3 48_2_1]", - NULL, test_bsrc, &cfg_bsrc_48_2_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_48_2_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-13-C [Config Broadcast, LC3 48_3_1]", - NULL, test_bsrc, &cfg_bsrc_48_3_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_48_3_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-14-C [Config Broadcast, LC3 48_4_1]", - NULL, test_bsrc, &cfg_bsrc_48_4_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_48_4_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-15-C [Config Broadcast, LC3 48_5_1]", - NULL, test_bsrc, &cfg_bsrc_48_5_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_48_5_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-16-C [Config Broadcast, LC3 48_6_1]", - NULL, test_bsrc, &cfg_bsrc_48_6_1, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_48_6_1, IOV_NULL); define_test("BAP/BSRC/SCC/BV-17-C [Config Broadcast, LC3 8_1_2]", - NULL, test_bsrc, &cfg_bsrc_8_1_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_8_1_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-18-C [Config Broadcast, LC3 8_2_2]", - NULL, test_bsrc, &cfg_bsrc_8_2_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_8_2_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-19-C [Config Broadcast, LC3 16_1_2]", - NULL, test_bsrc, &cfg_bsrc_16_1_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_16_1_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-20-C [Config Broadcast, LC3 16_2_2]", - NULL, test_bsrc, &cfg_bsrc_16_2_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_16_2_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-21-C [Config Broadcast, LC3 24_1_2]", - NULL, test_bsrc, &cfg_bsrc_24_1_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_24_1_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-22-C [Config Broadcast, LC3 24_2_2]", - NULL, test_bsrc, &cfg_bsrc_24_2_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_24_2_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-23-C [Config Broadcast, LC3 32_1_2]", - NULL, test_bsrc, &cfg_bsrc_32_1_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_32_1_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-24-C [Config Broadcast, LC3 32_2_2]", - NULL, test_bsrc, &cfg_bsrc_32_2_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_32_2_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-25-C [Config Broadcast, LC3 44.1_1_2]", - NULL, test_bsrc, &cfg_bsrc_44_1_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_44_1_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-26-C [Config Broadcast, LC3 44.1_2_2]", - NULL, test_bsrc, &cfg_bsrc_44_2_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_44_2_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-27-C [Config Broadcast, LC3 48_1_2]", - NULL, test_bsrc, &cfg_bsrc_48_1_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_48_1_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-28-C [Config Broadcast, LC3 48_2_2]", - NULL, test_bsrc, &cfg_bsrc_48_2_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_48_2_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-29-C [Config Broadcast, LC3 48_3_2]", - NULL, test_bsrc, &cfg_bsrc_48_3_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_48_3_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-30-C [Config Broadcast, LC3 48_4_2]", - NULL, test_bsrc, &cfg_bsrc_48_4_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_48_4_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-31-C [Config Broadcast, LC3 48_5_2]", - NULL, test_bsrc, &cfg_bsrc_48_5_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_48_5_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-32-C [Config Broadcast, LC3 48_6_2]", - NULL, test_bsrc, &cfg_bsrc_48_6_2, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_48_6_2, IOV_NULL); define_test("BAP/BSRC/SCC/BV-33-C [Config Broadcast, VS]", - NULL, test_bsrc, &cfg_bsrc_vs, IOV_NULL); + NULL, test_bcast, &cfg_bsrc_vs, IOV_NULL); } int main(int argc, char *argv[]) From patchwork Fri May 17 12:34:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13666940 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2041.outbound.protection.outlook.com [40.107.22.41]) (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 DDB334642D for ; Fri, 17 May 2024 12:35:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.41 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715949328; cv=fail; b=mCkkhi5lzCgt1YwjCrxRB2yJ8E+MNyJ57AGclfsUtDYU62MMFxTDmaapg+Jh4oIfGIAQU2dqgGoQIHX4+oW54jOE1KxtfawC7DXWpnqagWZmrVWQMZSh4Iw4jgZ2xCOlsRRHS8LkCGD/VBEOC2u3MMPE90PBOXx3ODhfcIl0mjc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715949328; c=relaxed/simple; bh=/Nyqy/68Kh7eRtPv1rEqUgATksdq2geBo2SS3/yJAd8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=S1zLmozmEIuzYSXcDgquaNckoSpzUkl4lOS/F/aUoQ6YK6DfV2cbRAWEL6Z47Mb3CITsb4tvf2azjLITDKd3gxGw4axTVHPZxBxNbCtOUf6CXBQ6Z8nW66WFz3e2ne5P/CdUM9ohmD2x2mQPnVxGRJF4b66losPc0dO20X5tPmU= 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=QNQ12LuI; arc=fail smtp.client-ip=40.107.22.41 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="QNQ12LuI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d234aw9H62B3I7rrO7rQtl3umvi4vazGEmeoXh4+Sr0kdawsYGXbAu9cPJyjSWLc8aTeg7qwuqRUOPOrH07XFGRYRXPOb9maLl0pWBBio5HO9462pxV7sWUwuJwh/bR7ymRGbw1A0VBMQCALy3Y1w3Jc2cIqFiSoiJcIAOA86sbB9iUELiH8Ce/VOYXTVcRqBSxuY9BeaWp1DIrdArYuW8AZCbHyq+5bC5b/DDVnBaFqrTm9fwO9N9Gr6dF8ZVIsPbsx4N+9kQSUSNN30taHzGhQ+d1BDhOv7f/85ST8D/gfgtags8kCzwJwmnEzfjk1TCJVFr6qt707DXC0PScF4Q== 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=HhSrGx32/Yy41Iwx2LPjAAT6oXUevPw8EPAEhBE32Zs=; b=gs0ZJlqInI1Zdc50kLFWDkYm0L/sssnPN2xtJ1EKiIjZA/fQDHdhseTdnyjqbliq76mmCwfawIPty8Nyyly9fObOu0OCPmiXZp9xmkUjr1wClNejqCbYBhh/4MAV8bWc8h+5JbKLnXYj9SRgBZ2wq1nztV6HmjwGuyGFUDuP9sKZuvog3SVoau/vw1UsaQJtwPjiNI72mJFxL3ABFzYJeRF1+ZMkm7GZP8/WyDDpRHsM2QdzvcqdIc+oPzoCMViQuToKyp6Cmqbx2dcEDhD20tjF09p8LKF8io8j5cngNRVB+nghPs1XMJ+2T91MNv+DgVxmcQAMg3mzSNG3ph+tsw== 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=HhSrGx32/Yy41Iwx2LPjAAT6oXUevPw8EPAEhBE32Zs=; b=QNQ12LuIEyHcTq35B+5a5xbiXHuJhILRXh1vnTNzvSRKnL6JcsD+QsCJSgzae3S0LDAQaUTsrpvaEEcEkSWsOpNsMZjV06MrUhUeDucYYkthH3ogygg1ZtLjpSApbadPMskrdyaa8/oTRg3l3wlExfZjHhOolz6T4HfhRtR0HH0= 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 DB9PR04MB8362.eurprd04.prod.outlook.com (2603:10a6:10:241::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.30; Fri, 17 May 2024 12:35:22 +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.7587.028; Fri, 17 May 2024 12:35:22 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 5/5] test-bap: Add Broadcast Sink SCC tests Date: Fri, 17 May 2024 15:34:36 +0300 Message-Id: <20240517123436.146332-6-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240517123436.146332-1-iulia.tanasescu@nxp.com> References: <20240517123436.146332-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM0PR03CA0096.eurprd03.prod.outlook.com (2603:10a6:208:69::37) 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_|DB9PR04MB8362:EE_ X-MS-Office365-Filtering-Correlation-Id: a2eafe7e-f3e4-439f-31b7-08dc766dd1f3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: TO3n/WYvUJkC201QayUfxlHjR+fcfwGxZuwe9UJfL1X0/kC+ry9EuF9dfOHmHksp7oYvoA9R3mvP8RNkMQcF1reHYOVFZnHJ3jS0EinnrUa+6x8SzBspaTkaCiTyz9TG2RMeKp2y3cKA7jcZsEZZA/zKEqcPHzscDgDwxuDTHi1TZMaISxmHO3UDps6foNxiKdEwJIg/+B/HTRg7Fs62IsIMludDYDcoiqfwT7ZKjE31fyjXvWSxenXHL5M4n0dT/1FFSxToCLzy0/II0e/uljUwsm7EzbXHalSYlt5YLn7uydbxJoV0Sdhxis8ime2DWQ0CwEUL/zaO04FnPbE8RB/c6XhQSaCoMbOIDuK9V2SQa2qnxwfHbWks6wnGK8e9FWkT80tyLXTR3JDSsuKSakJVlErzj9l8Pz330i0qgF328F4+G6yn+QJF94B93i/GLKL1Q8oXUTp3h1esyNZxH+J65kAO2wSeuynceWCh7O3qnVLUCcy0XWD2i6ukQGMew05ZglFlJqsNN88Bg7jEol+UjXbbYVyy5sUhR32C0lrIij4lAX2o/2FLnTmc2aTX1oBWBOCPOTt8hnPQnVHmSQLLxWvTJK3azcM4tAfCC9GYkj6taV7/n48PtFYVxJs5V9b17kA5nAvzVOryomKFFijxLAHO7OwnX/AsPa/0P4yIPnWzZCvoK+/4GyjKFywEMX7MrDsN12HYy842IhGFQ/MAZx4R1URPPFfC+ipV501iyuncqWvJNzCwUcF8mKCNqlk1JnRR9SUpDslUc3nSl3t5IG1L1W7KCHHQjcNbZGNiIvkQ+WfGlYdIfZHyzKq1HveH1kAHpkuDTNkf+LYgXWxvurKlqePZKjOWKxEh7Xb8DGUl14fJUESpYi/uv6DRrxOwvDsf2gGKmFV771kzLr/+alJ/jMzsSsmATXPQYfQ9jAKnYWlGEV6owsVCtMFJmDbgpyaYV+POPmh/Fm5gkrzAwBRFBXVDAl9AklVQSrSZwwXud6rXKBcRLSxBfWWAkROtQ5sozjVLWKkx/o9GuH4C5M5BhBSTb5+LuiPU13LDLTPdFEp/qnA7CDA1smQV++5q16secay+59YhFHr1iXjDmRmaCkWdL0wouPvuROIWtzY0Gua7oFAOk4rUGlZZEdpq5hx8jLcbV3fxCqyah+InSF3M/VHxiMXMTO2aEbj9L5jq6VkkV5knzrjF6EZTv2Dv2fRDQh5LP2Rc0s8NWuiL0c1F+6iP0lO9g2gBOBoi52ru5gw1vbNf3I0E7VP7qmwAx7IfuJvMhXHEMbRWdw== 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:(13230031)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4Z4P5N4jxuHylF0BNq3OP+SSTxYxrgofgh2wos/oqK9f0Ok9QExshLONoLpEFVJFTTnQunW4AiOMsqwFYbRHZZHCLjQOfKnmcakFuU4xB1EV+yCzAbMiqMfMcd9JeZRu3ZtOe76rs2s9LMndA5cB39ttXbva/vQlN+elWYlyz9T0wSaozgXhEO7K/Ed+1AHIIl19EONsPTNdxFDQLfQ6FQaPzBs0iPfrp5tk11elHQJs1iBNvcH0YxmtzVTNfnCDVTEun8WfbKkFz1EGR9aHE1xMuOfODTEcL8ogJTpvSLb3SrOK/wah0z5GtP7OsUDnqGsy65TkYdTd7oPlREW6Gib2Wj8lZprDH93h5MOnFs6WrJ8+phQIuctiA4DPXAntMd/vQkvRqdP+t7iXeoaIgltx/JECKvjwoA1ZXc4+euNgQzHoXb/7ZYXGxAZ53Z8WQrR/qPCpzsWZvzc59eG5e6/OhRCjOyu8x9ps40aCXs2VltLJirCSUBU2S0y1zXsNva1srj5UsTPY313zjTgYo4/k9xwLpoprW7pCJ5eD/3VNOjVydM4BTLursrbH2P81R7AAf1FBXz6Byme7fPo+x+KJuTbiCrYPLn9/jck/6mvDFyypkCqlzjWqe0P2L1CC8ogY0dR2v2JvBfT2OH8WOOsCs7q70legOpXxqxe5XseoN4dzx/KFv3OlvWZhjojeDPKJjBLlZRod25pixMOAv7rmcAmTabz3oFrnzdUg+6Yo9crfCGWnyKIy3sTP+rnxqm6yAuIiCtV+u+oQQoPf/jPEThKxWn9NvfdOMt+KaGxcsx/fpyvBtMzgPqQvwEInbtiL99k3bSfhybmDOH6Z6AxGOw7Jgt6G1E5d01fUczwEbysDKiu4uHAKpbTMNIoXweKsYB1FGoZnCVEkzSTaUMFcZ4gjykPGgwnVUuY9ORd7K5Pugr+84XeYyPDfOOeOPAt8m5mTkbkX2rv1MgL1A33vEh7DM4nzNaUA/8Mo4NMPRYfpptXe8/2FexNXwa7w+bjNoFYqmtDiYT/aN6X3vAw82ICeaeNH5vQjYlRRpfUwl8W3/2ydHJRm6cbUoFPF9uNA0GaLC4ymrjCU8k62a+9JWNehb56bik0NKaWKnjsXS+JxVqgaCDoOswnZTO/LRavnqxuhQ+RtLKbQOKwWnlzb2v4nLXzps1FHF99E0B8NplikwiVWftyo1bc/JrlUBQnlXOmba0W54wDxHavG7XYCUCxJWPz1PmDsanfUx6lwKBCrwZGU35rXwGEun+uyGEPj4VEHXg9MgRaDDfdi8rWDPtC05ryzflQtxDljLTVKmgoc4mKmAhmv4hZ5DN8ICvySIE8CDeYgpFiIyHrnRcvgOypesbQviGqKuNY4TF8/01591IjH6DxA7ZB1IVhNLnemDg9pwwtmiFBW99q/hGYyipOzH86fciG4l/GobygN5BSYmjDmJZ6QumtbAxWVhCru/4gLwpHC0GrqcaDjUxmhm+dMrWCcs8wvMJ1LsVCQpn9DtRkPLIJjo1eRzMNx6raV/eizx4KYZ9stkH2T0R/3K/Q41LJWXbQcY6XweM+y7zmzps8WMq43ZoZKRW1P/4r6xF8tEehN9ji0H+Hk4Q== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a2eafe7e-f3e4-439f-31b7-08dc766dd1f3 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2024 12:35:22.7333 (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: RK3V72Nyd1SWSkBDcLsBpUmMsy0+7f0J4m+jCTwW2mmZH/j/emJzzqsWFPNikoHGk0CUmA0tpVEJ2VV7hLOHLw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8362 4.13.2 Broadcast Sink Synchronizes to PA (page 177) Test Purpose: Verify that a Broadcast Sink IUT can synchronize to the PA associated with a broadcast Audio Stream transmitted by a Broadcast Source. Test Case Configuration: BAP/BSNK/SCC/BV-01-C [Sync to PA, LC3 8_1_1] BAP/BSNK/SCC/BV-02-C [Sync to PA, LC3 8_2_1] BAP/BSNK/SCC/BV-03-C [Sync to PA, LC3 16_1_1] BAP/BSNK/SCC/BV-04-C [Sync to PA, LC3 16_2_1] BAP/BSNK/SCC/BV-05-C [Sync to PA, LC3 24_1_1] BAP/BSNK/SCC/BV-06-C [Sync to PA, LC3 24_2_1] BAP/BSNK/SCC/BV-07-C [Sync to PA, LC3 32_1_1] BAP/BSNK/SCC/BV-08-C [Sync to PA, LC3 32_2_1] BAP/BSNK/SCC/BV-09-C [Sync to PA, LC3 44.1_1_1] BAP/BSNK/SCC/BV-10-C [Sync to PA, LC3 44.1_2_1] BAP/BSNK/SCC/BV-11-C [Sync to PA, LC3 48_1_1] BAP/BSNK/SCC/BV-12-C [Sync to PA, LC3 48_2_1] BAP/BSNK/SCC/BV-13-C [Sync to PA, LC3 48_3_1] BAP/BSNK/SCC/BV-14-C [Sync to PA, LC3 48_4_1] BAP/BSNK/SCC/BV-15-C [Sync to PA, LC3 48_5_1] BAP/BSNK/SCC/BV-16-C [Sync to PA, LC3 48_6_1] BAP/BSNK/SCC/BV-17-C [Sync to PA, LC3 8_1_2] BAP/BSNK/SCC/BV-18-C [Sync to PA, LC3 8_2_2] BAP/BSNK/SCC/BV-19-C [Sync to PA, LC3 16_1_2] BAP/BSNK/SCC/BV-20-C [Sync to PA, LC3 16_2_2] BAP/BSNK/SCC/BV-21-C [Sync to PA, LC3 24_1_2] BAP/BSNK/SCC/BV-22-C [Sync to PA, LC3 24_2_2] BAP/BSNK/SCC/BV-23-C [Sync to PA, LC3 32_1_2] BAP/BSNK/SCC/BV-24-C [Sync to PA, LC3 32_2_2] BAP/BSNK/SCC/BV-25-C [Sync to PA, LC3 44.1_1_2] BAP/BSNK/SCC/BV-26-C [Sync to PA, LC3 44.1_2_2] BAP/BSNK/SCC/BV-27-C [Sync to PA, LC3 48_1_2] BAP/BSNK/SCC/BV-28-C [Sync to PA, LC3 48_2_2] BAP/BSNK/SCC/BV-29-C [Sync to PA, LC3 48_3_2] BAP/BSNK/SCC/BV-30-C [Sync to PA, LC3 48_4_2] BAP/BSNK/SCC/BV-31-C [Sync to PA, LC3 48_5_2] BAP/BSNK/SCC/BV-32-C [Sync to PA, LC3 48_6_2] BAP/BSNK/SCC/BV-33-C [Sync to PA, VS] Pass verdict: The received AdvData field of AUX_SYNC_IND and optionally AUX_CHAIN_IND PDUs contains the configured BASE information. Test Summary ------------ BAP/BSNK/SCC/BV-01-C [Sync to PA, LC3 8_1_1] Passed BAP/BSNK/SCC/BV-02-C [Sync to PA, LC3 8_2_1] Passed BAP/BSNK/SCC/BV-03-C [Sync to PA, LC3 16_1_1] Passed BAP/BSNK/SCC/BV-04-C [Sync to PA, LC3 16_2_1] Passed BAP/BSNK/SCC/BV-05-C [Sync to PA, LC3 24_1_1] Passed BAP/BSNK/SCC/BV-06-C [Sync to PA, LC3 24_2_1] Passed BAP/BSNK/SCC/BV-07-C [Sync to PA, LC3 32_1_1] Passed BAP/BSNK/SCC/BV-08-C [Sync to PA, LC3 32_2_1] Passed BAP/BSNK/SCC/BV-09-C [Sync to PA, LC3 44.1_1_1] Passed BAP/BSNK/SCC/BV-10-C [Sync to PA, LC3 44.1_2_1] Passed BAP/BSNK/SCC/BV-11-C [Sync to PA, LC3 48_1_1] Passed BAP/BSNK/SCC/BV-12-C [Sync to PA, LC3 48_2_1] Passed BAP/BSNK/SCC/BV-13-C [Sync to PA, LC3 48_3_1] Passed BAP/BSNK/SCC/BV-14-C [Sync to PA, LC3 48_4_1] Passed BAP/BSNK/SCC/BV-15-C [Sync to PA, LC3 48_5_1] Passed BAP/BSNK/SCC/BV-16-C [Sync to PA, LC3 48_6_1] Passed BAP/BSNK/SCC/BV-17-C [Sync to PA, LC3 8_1_2] Passed BAP/BSNK/SCC/BV-18-C [Sync to PA, LC3 8_2_2] Passed BAP/BSNK/SCC/BV-19-C [Sync to PA, LC3 16_1_2] Passed BAP/BSNK/SCC/BV-20-C [Sync to PA, LC3 16_2_2] Passed BAP/BSNK/SCC/BV-21-C [Sync to PA, LC3 24_1_2] Passed BAP/BSNK/SCC/BV-22-C [Sync to PA, LC3 24_2_2] Passed BAP/BSNK/SCC/BV-23-C [Sync to PA, LC3 32_1_2] Passed BAP/BSNK/SCC/BV-24-C [Sync to PA, LC3 32_2_2] Passed BAP/BSNK/SCC/BV-25-C [Sync to PA, LC3 44.1_1_2] Passed BAP/BSNK/SCC/BV-26-C [Sync to PA, LC3 44.1_2_2] Passed BAP/BSNK/SCC/BV-27-C [Sync to PA, LC3 48_1_2] Passed BAP/BSNK/SCC/BV-28-C [Sync to PA, LC3 48_2_2] Passed BAP/BSNK/SCC/BV-29-C [Sync to PA, LC3 48_3_2] Passed BAP/BSNK/SCC/BV-30-C [Sync to PA, LC3 48_4_2] Passed BAP/BSNK/SCC/BV-31-C [Sync to PA, LC3 48_5_2] Passed BAP/BSNK/SCC/BV-32-C [Sync to PA, LC3 48_6_2] Passed BAP/BSNK/SCC/BV-33-C [Sync to PA, VS] Passed --- unit/test-bap.c | 299 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 299 insertions(+) diff --git a/unit/test-bap.c b/unit/test-bap.c index a6e24e605..46ee0e4e5 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -52,6 +52,7 @@ struct test_data { struct bt_bap_pac *snk; struct bt_bap_pac *src; struct bt_bap_pac *bsrc; + struct bt_bap_pac *bsnk; struct iovec *base; struct iovec *caps; struct test_config *cfg; @@ -565,6 +566,59 @@ static void bsrc_state(struct bt_bap_stream *stream, uint8_t old_state, } } +static void bsnk_pac_added(struct bt_bap_pac *pac, void *user_data) +{ + struct test_data *data = user_data; + struct bt_bap_pac *lpac; + struct iovec *cc; + struct bt_bap_codec codec = {0}; + + if (data->cfg->vs) + codec.id = 0xff; + else + codec.id = LC3_ID; + + bt_bap_verify_bis(data->bap, 1, &codec, + &data->cfg->cc, NULL, &lpac, &cc); + + g_assert(lpac); + g_assert(pac == lpac); + g_assert(cc); + + bt_bap_pac_set_ops(pac, &bcast_pac_ops, NULL); + + data->stream = bt_bap_stream_new(data->bap, + pac, NULL, &data->cfg->qos, cc); + + g_assert(data->stream); + + bt_bap_stream_config(data->stream, &data->cfg->qos, + cc, NULL, NULL); + + util_iov_free(cc, 1); +} + +static void bsnk_state(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + struct test_data *data = user_data; + struct iovec *cc; + + switch (new_state) { + case BT_BAP_STREAM_STATE_CONFIG: + /* Check that stream has been configured as expected */ + cc = bt_bap_stream_get_config(stream); + + g_assert(cc); + g_assert(cc->iov_len == data->cfg->cc.iov_len); + g_assert(memcmp(cc->iov_base, data->cfg->cc.iov_base, + cc->iov_len) == 0); + + tester_test_passed(); + break; + } +} + static void test_bcast_config(struct test_data *data) { if (!data->cfg) @@ -590,6 +644,27 @@ static void test_bcast_config(struct test_data *data) g_assert(data->bsrc); } + + if (data->cfg->snk) { + bt_bap_pac_register(data->bap, bsnk_pac_added, + NULL, data, NULL); + + if (data->cfg->vs) + data->bsnk = bt_bap_add_vendor_pac(data->db, + "test-bap-bsnk", + BT_BAP_BCAST_SINK, + 0xff, 0x0000, 0x0000, + NULL, data->caps, + NULL); + else + data->bsnk = bt_bap_add_pac(data->db, "test-bap-bsnk", + BT_BAP_BCAST_SINK, + LC3_ID, + NULL, data->caps, + NULL); + + g_assert(data->bsnk); + } } static void test_bcast(const void *user_data) @@ -626,6 +701,7 @@ static void test_teardown(const void *user_data) bt_bap_remove_pac(data->snk); bt_bap_remove_pac(data->src); bt_bap_remove_pac(data->bsrc); + bt_bap_remove_pac(data->bsnk); gatt_db_unref(data->db); tester_teardown_complete(); @@ -6045,6 +6121,228 @@ static void test_bsrc_scc(void) NULL, test_bcast, &cfg_bsrc_vs, IOV_NULL); } +static struct test_config cfg_bsnk_8_1 = { + .cc = LC3_CONFIG_8_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_8_2 = { + .cc = LC3_CONFIG_8_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_16_1 = { + .cc = LC3_CONFIG_16_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_16_2 = { + .cc = LC3_CONFIG_16_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_24_1 = { + .cc = LC3_CONFIG_24_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_24_2 = { + .cc = LC3_CONFIG_24_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_32_1 = { + .cc = LC3_CONFIG_32_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_32_2 = { + .cc = LC3_CONFIG_32_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_44_1 = { + .cc = LC3_CONFIG_44_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_44_2 = { + .cc = LC3_CONFIG_44_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_48_1 = { + .cc = LC3_CONFIG_48_1, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_48_2 = { + .cc = LC3_CONFIG_48_2, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_48_3 = { + .cc = LC3_CONFIG_48_3, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_48_4 = { + .cc = LC3_CONFIG_48_4, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_48_5 = { + .cc = LC3_CONFIG_48_5, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_48_6 = { + .cc = LC3_CONFIG_48_6, + .qos = QOS_BCAST, + .snk = true, + .state_func = bsnk_state, +}; + +static struct test_config cfg_bsnk_vs = { + .cc = UTIL_IOV_INIT(VS_CC), + .qos = QOS_BCAST, + .snk = true, + .vs = true, + .state_func = bsnk_state, +}; + +static void test_bsnk_scc(void) +{ + define_test("BAP/BSNK/SCC/BV-01-C [Sync to PA, LC3 8_1_1]", + NULL, test_bcast, &cfg_bsnk_8_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-02-C [Sync to PA, LC3 8_2_1]", + NULL, test_bcast, &cfg_bsnk_8_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-03-C [Sync to PA, LC3 16_1_1]", + NULL, test_bcast, &cfg_bsnk_16_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-04-C [Sync to PA, LC3 16_2_1]", + NULL, test_bcast, &cfg_bsnk_16_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-05-C [Sync to PA, LC3 24_1_1]", + NULL, test_bcast, &cfg_bsnk_24_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-06-C [Sync to PA, LC3 24_2_1]", + NULL, test_bcast, &cfg_bsnk_24_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-07-C [Sync to PA, LC3 32_1_1]", + NULL, test_bcast, &cfg_bsnk_32_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-08-C [Sync to PA, LC3 32_2_1]", + NULL, test_bcast, &cfg_bsnk_32_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-09-C [Sync to PA, LC3 44.1_1_1]", + NULL, test_bcast, &cfg_bsnk_44_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-10-C [Sync to PA, LC3 44.1_2_1]", + NULL, test_bcast, &cfg_bsnk_44_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-11-C [Sync to PA, LC3 48_1_1]", + NULL, test_bcast, &cfg_bsnk_48_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-12-C [Sync to PA, LC3 48_2_1]", + NULL, test_bcast, &cfg_bsnk_48_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-13-C [Sync to PA, LC3 48_3_1]", + NULL, test_bcast, &cfg_bsnk_48_3, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-14-C [Sync to PA, LC3 48_4_1]", + NULL, test_bcast, &cfg_bsnk_48_4, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-15-C [Sync to PA, LC3 48_5_1]", + NULL, test_bcast, &cfg_bsnk_48_5, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-16-C [Sync to PA, LC3 48_6_1]", + NULL, test_bcast, &cfg_bsnk_48_6, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-17-C [Sync to PA, LC3 8_1_2]", + NULL, test_bcast, &cfg_bsnk_8_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-18-C [Sync to PA, LC3 8_2_2]", + NULL, test_bcast, &cfg_bsnk_8_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-19-C [Sync to PA, LC3 16_1_2]", + NULL, test_bcast, &cfg_bsnk_16_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-20-C [Sync to PA, LC3 16_2_2]", + NULL, test_bcast, &cfg_bsnk_16_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-21-C [Sync to PA, LC3 24_1_2]", + NULL, test_bcast, &cfg_bsnk_24_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-22-C [Sync to PA, LC3 24_2_2]", + NULL, test_bcast, &cfg_bsnk_24_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-23-C [Sync to PA, LC3 32_1_2]", + NULL, test_bcast, &cfg_bsnk_32_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-24-C [Sync to PA, LC3 32_2_2]", + NULL, test_bcast, &cfg_bsnk_32_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-25-C [Sync to PA, LC3 44.1_1_2]", + NULL, test_bcast, &cfg_bsnk_44_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-26-C [Sync to PA, LC3 44.1_2_2]", + NULL, test_bcast, &cfg_bsnk_44_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-27-C [Sync to PA, LC3 48_1_2]", + NULL, test_bcast, &cfg_bsnk_48_1, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-28-C [Sync to PA, LC3 48_2_2]", + NULL, test_bcast, &cfg_bsnk_48_2, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-29-C [Sync to PA, LC3 48_3_2]", + NULL, test_bcast, &cfg_bsnk_48_3, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-30-C [Sync to PA, LC3 48_4_2]", + NULL, test_bcast, &cfg_bsnk_48_4, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-31-C [Sync to PA, LC3 48_5_2]", + NULL, test_bcast, &cfg_bsnk_48_5, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-32-C [Sync to PA, LC3 48_6_2]", + NULL, test_bcast, &cfg_bsnk_48_6, IOV_NULL); + + define_test("BAP/BSNK/SCC/BV-33-C [Sync to PA, VS]", + NULL, test_bcast, &cfg_bsnk_vs, IOV_NULL); +} + int main(int argc, char *argv[]) { tester_init(&argc, &argv); @@ -6052,6 +6350,7 @@ int main(int argc, char *argv[]) test_disc(); test_scc(); test_bsrc_scc(); + test_bsnk_scc(); return tester_run(); }