From patchwork Mon May 27 07:54:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 799315 Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2056.outbound.protection.outlook.com [40.107.249.56]) (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 375B939AC3 for ; Mon, 27 May 2024 07:54:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716796482; cv=fail; b=ncohE5/OxVG9TMIpH45nag6IwUyR87Ay7oO0YfytA3pwvZko+hh0TuwwfChBT8T2sg0xiJGudgwCSh8DQnGLhi4dMq5R2f5JCgYm3zO4P8Yk5zwhybBy922cGhiq/w2FTdA+XOJof3w4s+KrPez+elprNLR3yONtDq5gVrpGXUs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716796482; c=relaxed/simple; bh=BtJOKrOdqCprj0yovc1LQQfI8uZFVtWs9JZZKBL8qHI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=LHapQ9urWYTodU4ow+BFldjEBmTfeQjim8RMp6/NnHuvGW96p+9kaPa3YkVB+kqtI9Goe70tldwB+JXK4PZxyRGGR3qZKnjzrg9svZQs/FD6iSmlBnWLMEvgZQw3uBVWqM3wC7EOGxWZmbE+93qL3+rASNp6XAMGRLiKFG7YcoI= 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=c9BM6hDU; arc=fail smtp.client-ip=40.107.249.56 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="c9BM6hDU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YV6pebizoeQO8Gd7bJqh4CTkJCYdqIPyn1SbxoOKEKrTxzDUbT1+nVoglbNKj3167As1ODyK01ln2CkEFTVUS563XTKh3r+5KakvU9iECLyN3M34qgrxUbowByOk+faw86XArlt17pGR9FPN48oZqpYSNSYTzpQRPYuB1LfDjdh6poWiLu0c/YZCveEck9lQn3VGgh2Qh2twkn/+dTyPD5OZtxXUL+Ij/ptc81HvcAdxw74l9FEFYVoWLqeTOqMMp0aDEbBcZn3ss0o4XD1jEB+LVn2v8oc+h2m20fjQXe+DocgOqwliuSx/Cy0NKkWdmfezdvWoPly0kt3JQ9fFaQ== 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=1PZVrN6dULAzICf15J50Nc8jByuY0ZPJYaFHhaeT19o=; b=YaBG5RUE2GWRbtJkiiwOVmEdfjgseOA8lPQm4S5xgl6jYDaP1GN35YmOOnXXFD15hbF7uEQtK7gy2B0/BypjgYOF7ZWx6uygo/aI6EtVkjgsvhfePVq022ayYaH72n62hv1U0j8kA/O334nXOHAiLkkZNLHSSsyLtOHk85Z7p/Cw9p20OdbXQuSGA44Q4i3dkQlbAQc/sPWLTc/t8YtDeDmb/7hjzBMAWIgXFuwVT795HuQeA5sZB4xiZ3wPZVuQYUGqjntjzmYpa+CzVUEXxgbdCeAti+/9B1fLxT30M1LJMGKgS7Bahg6U/xn1dZ+LF3soPuFLWuSYNEJOjO5+1w== 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=1PZVrN6dULAzICf15J50Nc8jByuY0ZPJYaFHhaeT19o=; b=c9BM6hDUQG3wNgeEot6rq5P19XJpTSrXb4RDp2dy8gf3eozTs8kPWrr94k95c74l0I1fPTVPiWKZqXJ3POGsghRf/xSNbwQ8s1kko4oIWeQwMXwjxwPc8CR5FiKB2v5Qxgx5JW9yQVqW2M4QOMdap6pFBfmBBSAIHh1m3si0oUA= 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 GV1PR04MB10726.eurprd04.prod.outlook.com (2603:10a6:150:20f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Mon, 27 May 2024 07:54:31 +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.7611.025; Mon, 27 May 2024 07:54:31 +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/6] shared/bap: Remove DISABLING case from bcast state cb Date: Mon, 27 May 2024 10:54:17 +0300 Message-Id: <20240527075422.18953-2-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240527075422.18953-1-iulia.tanasescu@nxp.com> References: <20240527075422.18953-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AS4P189CA0022.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5db::6) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|GV1PR04MB10726:EE_ X-MS-Office365-Filtering-Correlation-Id: 2fbd82bd-bbed-4468-5d4c-08dc7e223d8d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|1800799015|366007; X-Microsoft-Antispam-Message-Info: bSUOoSf2aG/ATGvDrTnWX3vsxcq9XJirYgOqvsdKu2DOwGoWhqYOcH80ABDjdA+vrz+XKY9k5Oluu2j+L5dYkzbN8gqGXpEq09rl4zg3CUulST3cSz/gYQa8FgdaqknH32CY4M6L3ekAyv/4WPDhq9DS411Aruo0VAZzM5MCVKjX/401kSVQVxk1gdviy1mUc5L5h4tovSEs8ijoxAvkDdzpDDvq8s2OkuA7NLNzp5Kt6y0IlVuuE4/Z1Sfz38xr5oBUrAycXN6DAURMP/QBC3cyBJplbYVqGFJEHZaDZEFxf4LCdS0lSE/+U9fCvfPTReVv8OKpPkP+Ob7hTwvF/LQMyuESK12YGTM/B9XLxLsem/8ppvXgDUygRvCoL7gQ/EpaVZQ5rIsB8seK2QS/a8cPaFSp1xoVNXr+bTA84JBe8pCyZC8kAlKBxPoAkna+0JR9rejN7GsgUQcRWi2preVP/1/dGdoK/4tc/tPnfD9O0ZKQ+YiI5wxLN7BFoTYa0Gd4AxXPMDq7o6PnCf06NXrpfUOCsLG38+m2BC+66Xi7F8s0XY0B4o3zfOArJAyfP8m4OtxyxsNEH40ylWPbey/9JRLrJRTdeWw8tU+PFmIwip67MN9CsOQ8EIioYprqskuXDavA2aeSOAm1/lmtkNtvCxUvNLsN04odXYMJyKvEapd5Xoyf3recfh4zc/oiCbHvWDNJ6b24CCib08z+hQqZfuY1tHj4S8haDWA8FoA+sYZsV6N/FEs5Uccpd0yPsixEKLnhhiibsyu5frUrHn5Vh+qMbv9u/i5WB+jWCxvA3Mpa5eXT0mMCQTvcHiM/9ebIOPnVQG69eC3Dq3b28S77b2AtE/9ScGg1gNKjIRis/ywMxYhH67fCpzo6UUv5SV8QUf1o8bRpqDBgJLv+izuH4W9OMtvw8vmr9zNCh5uJVDLHDho/MChzZPmZZnteH4NU5cYL3TElkVYYRJ0uTRMoYA2WLEjrzgGwEAIouagVlIQwers5eXYrp5Qo8UVLVWh5UzJhoV0eiSYCkbK+fDDQYLK3sh7GFmOIIPKPd6HJR3VVUJfkmxBEF7biLzQEvza1+U7ZnwOoY+9ny3jc+eqsYsqPL8hQ91eEJlEBpSBTPz4FrDqfkUjJxdmsHVrz8DDji5SLSTfgUL0UuWuznFRjycPOwG00RoZHlraMm+xMRUX5LDGext6fyOs8zJe8fO4b3krLcocLPkUur3k7UJJHZmzlmsDSsY1yRp1SsipBZs7Vi6p+6AW4aegI2seAHXaP0jDO+dCp61Mt7apSjA== 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)(376005)(1800799015)(366007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: baFz/z3vPAGgADby/qL3lcLXJv3gVWLZ+hF6hdP9O/OxYBYY8idebzpZ527oUyD9FazhuWI+F84wRdtK0HjKSEWU20giB6LRw3116m/+H4T86uBI6GLOYVAwtyUBb1gIzIzycIatnZVvTPfbV4kylyt5N/xy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4CVBZJuRsMPL84U+vgGrqpv4J+BBzTSQMUavfwkNHfn5eGQUlS3iZYNwi7CboHYQNr882+W4QcnUJJ2HUxU+Wtz9UAtxqGVG1SEkxfwIY7EH7oNLXWDKD39IA7mFrBinpU3Wu+tY06XN5o0Wc98g4utE0ujkz3Cq5XiA/5PbIFMaKVYW8g8y7R9T48mOKfTLEWXVkO5mnTQF15f110xRVM2Rs9ilCwr8Llk7UAxJoCXhibxdmlfy4w9+J6Oe8U/IkwHS9W7XYrCNMZ+8bB7BPQWwX7mpkEwt8yNaRjX/vDD6TBOcgfaZVdfVFs1Yax7DN3EGpkxurGgE7r6FepnoLFX64eIfvAwnIIE7bD/iXnNaRZtYQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fbd82bd-bbed-4468-5d4c-08dc7e223d8d X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2024 07:54:31.0738 (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: Jubit1kqUIlUcu0G6CUM0fI7ToR3bPHtrxbpxWzgWLWWY9cDpxenkKuwOQf4sGyaiLeCJ21ojjSLjQT2uZ4t7Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10726 This removes the switch case for the DISABLING state from bap_bcast_set_state, since this state is not used for broadcast. --- src/shared/bap.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 639149520..1d9f59f21 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -2056,10 +2056,6 @@ static void bap_bcast_set_state(struct bt_bap_stream *stream, uint8_t state) if (stream->ops && stream->ops->detach) stream->ops->detach(stream); break; - case BT_ASCS_ASE_STATE_DISABLING: - bap_stream_io_detach(stream); - stream_set_state(stream, BT_BAP_STREAM_STATE_QOS); - break; case BT_ASCS_ASE_STATE_RELEASING: bap_stream_io_detach(stream); stream_set_state(stream, BT_BAP_STREAM_STATE_IDLE); From patchwork Mon May 27 07:54:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 799608 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2048.outbound.protection.outlook.com [40.107.6.48]) (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 C8C6B3A1B6 for ; Mon, 27 May 2024 07:54:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716796482; cv=fail; b=orisdQ0NikxeI0Yny3qcAU5V/hHPrB5kNHWqlje0vSnbOsL9OVhZdshjlRixB/rcputoXlt8FxlSFLs+bDGA+bPndo6upirxxVFeDWeHenkAf+vPZR1dMRg1NQzqeYh4iixd+KTuduXAEPTY7+Y9LCz6KRby77JseRaNv38jLI0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716796482; c=relaxed/simple; bh=Bp2p/cuPgyJ2j0vslNig35ZKmtAEA4Bk9oRt9nJgQg4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=onhH8ZSWxII5GpcmelsQTS7pFXW1w/fkzBpXPYjKIVHd+yEv98yi2vEbofvFDvRbZvDQ7Udd46LaMWf8nPLHaSnN6iKDD1pHEXXIcaBx3AFnuHyWzuYQAv0C6R9NHP89gAbL88YbjA/u3m9MLkTB3f/r00B1dTDNFxDX+0DmmGE= 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=aO1qpG5v; arc=fail smtp.client-ip=40.107.6.48 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="aO1qpG5v" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VYdoti3Ue5NrAZXs3pQ+WWBFm9FUi0hyIeWgImc4/Zo7LjjP6MI7pcJfQCw5V4vdqdBWXyYJnK6AqU3mQTXoy2JsktWINuLYrLAsDNiGskbnWq1a0RlpiDzwrLlEYU0JJcAhefZovfDxORpewunL16U/nrpbTQrUswCdKOKc9WknkCKt13VV6Z/WCJe5wjZkOLtxb8H8PKTXRdUdtIzSyUowtNK+6D2YonEzK2JyZI3xlj++LMyh8h3aagD8wGiFvDKQecHNmu/fpVsasCF1+tsyFiskt9JAtClY9jfcPgTDDFfcx9TQuzCQp1LX/ImxSLXSXifyJmsXs6s7qKwowA== 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=hQHXE/HxLqVTnaRnvdEYUIRzv6kvDAjdnREaFDEG+d8=; b=ntIdjpAci8uBqVLJexxVIPjKDHJJAUduAwDdlML4QORfFGDKhOlhAbB0ZaZZYzRwvprZO+qD8BergFMNDBurcSZQf7oSrMslKkhRW97zbx/NZT3KOMBCL2xOuFesgq4VGwqfLFB+qPrYmA/6Z38PlnZSekD9AvLEq39SkfbF3FrKGs2/55O3M3CfFQv5jI5QbDfLCXT2gN7uI6cdfRUu/jr8sYwQIAX29/K2YLv6bohMl2wqyHrQJ59RHOt2/tTXXT5TbbrkjRT8xc7+lxchta3FpcTPaxxvqqqsvxXLzhwZ0MapplNhIjvoOg/cv2FAmB7Z8MDYtE7qYYrjpiolRQ== 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=hQHXE/HxLqVTnaRnvdEYUIRzv6kvDAjdnREaFDEG+d8=; b=aO1qpG5v+aqtvT2P5Euknknz8dHBKpiuwm8Y77RgStRQILJ8Cf0xXsMNaIyvpy/bxztLs6jHvU4XStb00GyDMNYLSG10skdtw1G1vTfmn9D+NTvNK9GoJEhFHaECW/w7z08JFYY2shlZddoyyCWTgrkg4Bc6EFZlLzRan2MtBQw= 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 DBBPR04MB7836.eurprd04.prod.outlook.com (2603:10a6:10:1f3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.28; Mon, 27 May 2024 07:54:38 +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.7611.025; Mon, 27 May 2024 07:54:37 +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/6] shared/bap: Fix potential stream access after free Date: Mon, 27 May 2024 10:54:18 +0300 Message-Id: <20240527075422.18953-3-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240527075422.18953-1-iulia.tanasescu@nxp.com> References: <20240527075422.18953-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM0PR10CA0082.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:15::35) 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_|DBBPR04MB7836:EE_ X-MS-Office365-Filtering-Correlation-Id: a9223ef2-7877-4035-5736-08dc7e2241d4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: ji9gWxVDMFRZAPo3pcsoJaaas0q9rzyNNl6nimlQD/Rc2HpEctcNguej6EKlQx6j04xYbfNw7mYap6Mv2msbZLhKcWuavvxJU8prQBPfY1/STa9Noa7ImGggSJelbtREXGy9qCZgj9vXqkT6fdrmSGBKJMa/i5Yjw8t7GiKE65vAJvuu/sttVtR9hbnyn4IMpjp5mR5o7ZZHpY+E5DXJHQVF7KnBKScvQzeYPbZD2UfHgUxlWV5W1jvw4fK6H4aCZSWGlp1pfY6DQnS4qolCgHpmtdKUg8xLMAuRJ8VdSGvU3eUau3ikCWOWBZt8u+IP+tm9/4nbYhnOAFEccK8a74nqbVBpRgAQB++g4f8mp37ANupn4ibd/Ya/ruRpLF/ZOvN8wMJA/1hF0tUy9I84glpKR5BdrcmrBJg6tgdSBE2UffEvxdlz6iKB+L+JOl9TAUZE/tQHZaQJPq3G+B5ShWxBiNYccrsPJtG8aypbT4RD1HTFm4LFq1My6iDQSQGTcztAg5h9brDbFnSdIVwNQ8TNjFB03o/iUUxmz1BsH1CeHJcL/3gb9mDpkpg2t5FcITC2gW7rkof4GMSTeBcqUH5cXJrU/lR0U3b1aUVgdO5nnRTKhCbPXodWmyfagArLOIh626wLeifVmFib2fa4NOGMaQ8cjYuTm8A4TbtWHTfmYw4V3aHkp+kedzIGTLCtXv75iyTnkxRa7U2n8boeIHzTQwGGposUqHCm688cdp/HdkGLhwPt1wDOf8nFUDKg4LCK/TVv7PNs6LdUbY9ZNLDkbBmtHnjZT7fjrp6lOBnG63zAHAofjhADegIx0NkkIm/xd3ELASLLUsqI1UFhqSibANBQTquHn9aNqmU/avtM+dCM3kDuG+88MxER0sUau1zOFJw+5bInTM1NcAiq9HOXCHiRsW0J1BEZ8qCjuKC+VUTW/9zFIeBrFsk3+OFXkcFF8+kpT8EYCnDBn6IuVIGk/ngh7V2+DdlSABkmqqYSyyHiJzy+ckJoav6JYV5nGsQBiodz7Vz1oMpHizgTqqJlYBzX31tV1yWMJACLhMqDLYc4+fJdPOQq3Hb494l2xwtRjOD8ifguaaURZ8zu6TFREHoyPG1LTUcEU/SKu5Ej+Eq13PoKCkCUdQfAeyiTKR1PXThzMd1utjchRb+bLy65p2fk7iSMKxOzPluiNSPxnZgLqeno0WflCLG/PZEErN24KRbpPg+lRCy8bHQte81+Y41EehZeU5MOIyuOkpzHhjQDFBjZxzWwiJeRYS/slLi9ZFBJL5ajCr4SuNS59Q== 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)(376005)(366007)(1800799015); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-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qQXuGhsKGym9ltdWthp5BBWskMAH8Sz2LX0ZXuS7zmvVeL0OCyZ5EiUD8ehRmsV3LEKg+axVbfpFcSKU3cJHptYWRxZxznbZb9n/X/rZx8oLyj4pRXwh2I4Ty2JxM7O1fmemI0djiNHX4jXVIdPXEqvrCMUFk6/fcXGBqiHX/XFdvtlK1gL23ndfj1tI3bAPZqDcvRJbSVVpKznOQUiLhj21gL9qxHqt/U+sXHgMZ8YHz4ThTyF4FfTjRIuVdaT5DEgZ0L+S6LgD/obJwHuKulIEFoQuGBAsU/8kc8nM1Gwl0cJ3Ba9Yo1a3qz9e8BMK+xTxB+zgufxubOoUznfEA4knJlY2JXOo5ldMLeG26lelfnpoij37ehOTHc4ELkQMpy4LohRu+2DLMQolIiqst7vNjbaGQYHhZDn8jjKN2qcyrLrVJFT924Z+7MePoMXMhQc2k/AYBuULOqDO6PbmtwsMbkCoAm21epca5orQnVsxqQE3WnUaV5WGsMFIAZXHHCY+RDOHBs2MVVSkSFEmuxeq3lVwcd/rdnbZl50rgHtV0hIQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9223ef2-7877-4035-5736-08dc7e2241d4 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2024 07:54:37.9112 (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: g3k71U0gXMM4SS9kIx5gbuxdH9CTzUSjUDvpTJC1gX9KzGn7bUnM19a2OExIgKHlS68lilXn03YSm7CAA7N6Gg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7836 In bap_bcast_set_state, state->func might trigger the stream to be released, thus the stream would have been freed before reaching the switch. After calling stream->func, the stream reference should not be accessed anymore, apart from when the stream has not yet been released and those cases will be handled inside the switch. This commit also handles the case when stream ops might lead to a state machine that ends with stream release, so the stream should avoid being accessed after the ops are executed. --- src/shared/bap.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 1d9f59f21..ec54da341 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -2051,7 +2051,7 @@ static void bap_bcast_set_state(struct bt_bap_stream *stream, uint8_t state) } /* Post notification updates */ - switch (stream->state) { + switch (state) { case BT_ASCS_ASE_STATE_IDLE: if (stream->ops && stream->ops->detach) stream->ops->detach(stream); @@ -5293,6 +5293,7 @@ unsigned int bt_bap_stream_config(struct bt_bap_stream *stream, void *user_data) { unsigned int id; + struct bt_bap *bap; if (!bap_stream_valid(stream)) return 0; @@ -5303,9 +5304,11 @@ unsigned int bt_bap_stream_config(struct bt_bap_stream *stream, if (!bt_bap_ref_safe(stream->bap)) return 0; + bap = stream->bap; + id = stream->ops->config(stream, qos, data, func, user_data); - bt_bap_unref(stream->bap); + bt_bap_unref(bap); return id; } @@ -5565,6 +5568,7 @@ unsigned int bt_bap_stream_enable(struct bt_bap_stream *stream, void *user_data) { unsigned int id; + struct bt_bap *bap; if (!bap_stream_valid(stream)) return 0; @@ -5575,10 +5579,12 @@ unsigned int bt_bap_stream_enable(struct bt_bap_stream *stream, if (!bt_bap_ref_safe(stream->bap)) return 0; + bap = stream->bap; + id = stream->ops->enable(stream, enable_links, metadata, func, user_data); - bt_bap_unref(stream->bap); + bt_bap_unref(bap); return id; } @@ -5588,6 +5594,7 @@ unsigned int bt_bap_stream_start(struct bt_bap_stream *stream, void *user_data) { unsigned int id; + struct bt_bap *bap; if (!bap_stream_valid(stream)) return 0; @@ -5598,9 +5605,11 @@ unsigned int bt_bap_stream_start(struct bt_bap_stream *stream, if (!bt_bap_ref_safe(stream->bap)) return 0; + bap = stream->bap; + id = stream->ops->start(stream, func, user_data); - bt_bap_unref(stream->bap); + bt_bap_unref(bap); return id; } @@ -5611,6 +5620,7 @@ unsigned int bt_bap_stream_disable(struct bt_bap_stream *stream, void *user_data) { unsigned int id; + struct bt_bap *bap; if (!bap_stream_valid(stream)) return 0; @@ -5621,9 +5631,11 @@ unsigned int bt_bap_stream_disable(struct bt_bap_stream *stream, if (!bt_bap_ref_safe(stream->bap)) return 0; + bap = stream->bap; + id = stream->ops->disable(stream, disable_links, func, user_data); - bt_bap_unref(stream->bap); + bt_bap_unref(bap); return id; } From patchwork Mon May 27 07:54:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 799314 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2043.outbound.protection.outlook.com [40.107.6.43]) (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 AA4BC3B298 for ; Mon, 27 May 2024 07:54:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716796486; cv=fail; b=p4EYCF9118I9KrRrZKrxy056SZC7mbKbjPnLaxMVyy4lUAw1FziiVvzCAOCDN0hF5qQzClXiVO7XCOBsqB7TKfVrIFgLCg2WpfBLedsJzeUOQdTVKMh/XxXudLr0G5y8jnLa5O1zW4onSTmVyC75q0Z3rtrHmnItEgsk8nAhpxY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716796486; c=relaxed/simple; bh=rtFWfKrpnLcIMk+JHAgGMZyzn9vIbKTI1e+S9Oopoeg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=nn/46aw1BpFj2tilgRTXcbH4bUkCjv04NqnLRlwPGle1mLIc8HCRMVlRW3u5xO0UmxjSBlZwur9hZdh6bTn1V6UaVsvbS2IDNidWQnkNTD1q6e8OyhyLvZl2o0ymZsV9jFi71f136GfU1pxmM4VaXLL13d7ec8wGnviyXo9CGZM= 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=MIyLKrcL; arc=fail smtp.client-ip=40.107.6.43 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="MIyLKrcL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JQw84SRxM4WuSJREYw4bSD+cmX/ZlhywLusoA+htKyNvplSiUmLP8dkOv2FDhVd0CYO63xasSXJriIH18ISbiYb2kiZNUR79R516djkeIGa5wJ3Bsdec1FeSj0ubP7vuy01Pcip/7dexSfMT+JEoKvGBJXwI+ggyGIR66QAqKnJGZmlkhgmn0qBS7gkH8mZ12woBoLJI9hrq0oQ5E4F6J3s6rD8SbwT9Yfu2iNI/LlJIbCnlbCsrrVJzMm0obQ0vKu0SKKS9KkGY/HnghVQyPAael83c8KyleurGldSu6V/o220ZytANF4DiYq7VhLGQTzlQ7NHUGFeCNZ8+6clHxg== 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=W0ue5+hpOW0cg64pu9ttu8TzAmNBk3651pCHXR3v5R8=; b=WOXcndUYBYUjgxrb+fqqhLnHBR/vOrYgXK8n1DuiWpCD/MTl/opqlqqJcU6FKqX1/5XUH3F5BFQm8RwvMkT5Hwd3+nEn+mclpTUPX/uDf9Q7p+JO67RJ957hVr+XeoSWJySzcPVw58+M2A5EBh14EOAm21H5Gjw6KD8OuDt9Ayu/JYLfHDU8U+v0fbTrLM/cnnQixJbKnASYfF4wlGNfb/I9g/JWgY07kJDao3d8W0iDiURml49wUNedMOhrh5nbEEWaeSH078h5D++syOaVSfCCtSkYBuM6cPGva/9xuadIYq9ghAycJPUzoSOtFd16SHgpIaH9VQKWEx3HFO60Cw== 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=W0ue5+hpOW0cg64pu9ttu8TzAmNBk3651pCHXR3v5R8=; b=MIyLKrcLCPXFuorW0bmxQvJGRNhHbUEctD+KWlVnLUSVBkR7AI/aLIL4lRsI9H73/srDbFliL2UdYx/Hq6WvGX6iWXyheSadst1Y/KMnl9Q6l6yBSompu3bGzfRWjh9obizEmJsAOiz33SdxccKZXDUwSasjQvwe9PUtDcZoo9o= 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 DBBPR04MB7836.eurprd04.prod.outlook.com (2603:10a6:10:1f3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.28; Mon, 27 May 2024 07:54:42 +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.7611.025; Mon, 27 May 2024 07:54:42 +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/6] test-bap: Update bsrc_state to just handle CONFIG state Date: Mon, 27 May 2024 10:54:19 +0300 Message-Id: <20240527075422.18953-4-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240527075422.18953-1-iulia.tanasescu@nxp.com> References: <20240527075422.18953-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM8P251CA0022.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:21b::27) 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_|DBBPR04MB7836:EE_ X-MS-Office365-Filtering-Correlation-Id: f8aaa9d8-ad07-49b2-6991-08dc7e2243db X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: 7Gd80o1eYU30Kzk4Y04FIiG9dPegHEzZzwIgnyIn/qYeexmjc+z19h1ZJ1uvFTqeTygemqVIHX75bF2RzAl7Sn7VK3tbEwMZLRO9urxbfnlVX1Asf+KyQkqIA/nVzazk8M+fwEscE+ctuGnXqf/lzCyou3w4T6BcpgFg5cqCXwwP9EXQq5FV2T46P5o2GDKML6liJS/ShWPUb/2pn8qH89Q6wEpxllBydhWDR1bUHd7yLwAWZltRccEZh6yX1VfiF5SKc5NulvNIVeu2iB2SEykozW2LcFKEZMEH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M; H:AS8PR04MB8898.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(1800799015); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FBgUX8q7L41Zl1aq1wKbPhWgTW6QxNZZSOExORVMCb4B616i/p8+XX1GKnDC+gJ7kaJpdVTF0vaApvoyWPtJZHv1SyzbfLznxXm9mXNeNp1W/ofcewxpgJzg+9/m3+tSsYikkw4I9+ACElqAqzzxUUNTx6n0O1Jm5JaAHsk7hZRlM2VObKnLnkWiVGLclq0yQhrPpoy4o7I56nxhiLCFSauXFp8klcKWokun7pY3ro2gyGahyCXr4IZOnZ1p15ldheLhvVYTEhJ6G6fMUXE1+JDgNjIG6iIsLbzRjbCdOflHo0uDw+prGmKxjx7VTg2xMLuAxbvmXsKYquZN07i7c1jXXhb+D/YhoCyGalPVw1bxrkntizcz5ADW9bIoK9spV2oZRauC3kJuFz0EKP3I9dFvZYaBFvPuGQYXFXv1Rjb8a8tGeOsb6mSYlQ352HVD2oPxOCzh+MtVdVUv7MCNyvfITmHSiOubjy+ckYmMPH3uXO47ZGdEWpkQ53T0PIgW/qkJlyqzWDcJXNyRwK5L6cPWW6xvJxoBCa1No3hipgAo92o07x29DLFOGMMg6XR2ojEr5DtUVsRrMPdAaKXNgZHSae+NelH0b4jzgpe4lV6BNuWF3vtOJcyTLgqfPGM2g0BVg/Oz9VE9paXOtGBYqkW8Vn+nOLgnhUzwrS1SC1XCjcecHtMt6sQQStlk1mDh1ESgZJeWldTCHpwq+0cHMjNNiJENKvuvHNjLGAZi6gbgkpkSaSGTY7plXma+wRfNsVCirEo0Kc1vew7Vh3zbDW5WGDGnCc/Gs4y1OxFwVwm1j4TPW5iAXhN4+k44eAjQxFY6lbDu0LMshnTBqEYXmXCBQAw32Re1JZAhSzTA+azZIKq0ett5RJyoaqwYUJvUuzNymaymro71dwO08los7HVVxwigvsPQqVOFCj9CJBqcUfclPBH2/AOIpWpyRYEtp5dZIdMB+fr+rtPH/bRxTEJ4L1CKx/To8xA7zBG68F7Or6e0HEm6W4C30rkYSbUGF25gF9+lgX60xKEHIvWL8zqAHZNFqjRcnoIu0YzxiUaW5/QuvLHESzk4r8deePYg2GakHwpkc4TRTEWMMxUN5DjPGdIkEbYAo+whTGK+rMQl/feSevBzWbGZ8s3o8LhJVn5eA8BkPsOC36P+gKMJaq5ePjqwP9i71z6gZcGxMyAGMeMaqdRWjfdq8VjDmKGSxnKuhBNzowsaj3EvsNiZiDWgFvnZnmAFpaRjaDwQsyMNQRl4K3heRvsD4PU0tVc3+pKWozkPqRgIYm5swKcdoPyKd5R/pS4xYzSQoVT/zIiNVCtmJLcjLUdVBaKafVJktzqVgAukQT+qYytl0Nklme08BNwbVlLOuE6mQ+c/IugxjTvU/oepwUoE7hZ+g+MkdIX7kZTeQ+/U32rjTwPF4UtKxqJnE/LwhcJOlpIVW9gE6X/DfQ+ezWiy2zErSytKbHpu5Wlwn3zwqdH0x5S0nGEsMxuotaMKug7j8Geq61gJsPLB2ojfloVx/8Qr2Nu15GjEo7rXiELOT+y5XLbXCmZMJtmQpY3vohE4qv1Br0P7xFhbGR2LOYHQtPk7rxJu5dOPYVhHpUa8l6ttiJ5UGg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f8aaa9d8-ad07-49b2-6991-08dc7e2243db X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2024 07:54:41.9437 (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: 42pCyFPbu/V57V7c4MAJKniVC2d0Y6gCgnw0Yn0Rs2jDKAabp4P9ZrXqBQzMfs+DRyf3B8KV7yleF63hQTDEGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7836 This updates bsrc_state to just handle the CONFIG stream state. Dedicated state changed callbacks will be implemented for tests that require streams to be established, disabled etc. --- unit/test-bap.c | 74 +++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 40 deletions(-) diff --git a/unit/test-bap.c b/unit/test-bap.c index b59f642ca..9cb4ae8d8 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -549,16 +549,13 @@ static void bsrc_pac_added(struct bt_bap_pac *pac, void *user_data) &data->cfg->cc, NULL, data); } -static void bsrc_state(struct bt_bap_stream *stream, uint8_t old_state, +static void bsrc_state_cfg(struct bt_bap_stream *stream, uint8_t old_state, uint8_t new_state, void *user_data) { struct test_data *data = user_data; switch (new_state) { case BT_BAP_STREAM_STATE_CONFIG: - bt_bap_stream_enable(stream, true, NULL, NULL, NULL); - break; - case BT_BAP_STREAM_STATE_ENABLING: data->base = bt_bap_stream_get_base(stream); g_assert(data->base); @@ -566,9 +563,6 @@ static void bsrc_state(struct bt_bap_stream *stream, uint8_t old_state, g_assert(memcmp(data->base->iov_base, data->cfg->base.iov_base, data->base->iov_len) == 0); - bt_bap_stream_start(stream, NULL, NULL); - break; - case BT_BAP_STREAM_STATE_STREAMING: tester_test_passed(); break; } @@ -5608,7 +5602,7 @@ static struct test_config cfg_bsrc_8_1_1 = { .qos = LC3_QOS_8_1_1_B, .base = UTIL_IOV_INIT(BASE_LC3_8_1), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_8_1_2 = { @@ -5616,7 +5610,7 @@ static struct test_config cfg_bsrc_8_1_2 = { .qos = LC3_QOS_8_1_2_B, .base = UTIL_IOV_INIT(BASE_LC3_8_1), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_8_2 \ @@ -5632,7 +5626,7 @@ static struct test_config cfg_bsrc_8_2_1 = { .qos = LC3_QOS_8_2_1_B, .base = UTIL_IOV_INIT(BASE_LC3_8_2), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_8_2_2 = { @@ -5640,7 +5634,7 @@ static struct test_config cfg_bsrc_8_2_2 = { .qos = LC3_QOS_8_2_2_B, .base = UTIL_IOV_INIT(BASE_LC3_8_2), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_16_1 \ @@ -5656,7 +5650,7 @@ static struct test_config cfg_bsrc_16_1_1 = { .qos = LC3_QOS_16_1_1_B, .base = UTIL_IOV_INIT(BASE_LC3_16_1), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_16_1_2 = { @@ -5664,7 +5658,7 @@ static struct test_config cfg_bsrc_16_1_2 = { .qos = LC3_QOS_16_1_2_B, .base = UTIL_IOV_INIT(BASE_LC3_16_1), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_16_2 \ @@ -5680,7 +5674,7 @@ static struct test_config cfg_bsrc_16_2_1 = { .qos = LC3_QOS_16_2_1_B, .base = UTIL_IOV_INIT(BASE_LC3_16_2), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_16_2_2 = { @@ -5688,7 +5682,7 @@ static struct test_config cfg_bsrc_16_2_2 = { .qos = LC3_QOS_16_2_2_B, .base = UTIL_IOV_INIT(BASE_LC3_16_2), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_24_1 \ @@ -5704,7 +5698,7 @@ static struct test_config cfg_bsrc_24_1_1 = { .qos = LC3_QOS_24_1_1_B, .base = UTIL_IOV_INIT(BASE_LC3_24_1), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_24_1_2 = { @@ -5712,7 +5706,7 @@ static struct test_config cfg_bsrc_24_1_2 = { .qos = LC3_QOS_24_1_2_B, .base = UTIL_IOV_INIT(BASE_LC3_24_1), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_24_2 \ @@ -5728,7 +5722,7 @@ static struct test_config cfg_bsrc_24_2_1 = { .qos = LC3_QOS_24_2_1_B, .base = UTIL_IOV_INIT(BASE_LC3_24_2), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_24_2_2 = { @@ -5736,7 +5730,7 @@ static struct test_config cfg_bsrc_24_2_2 = { .qos = LC3_QOS_24_2_2_B, .base = UTIL_IOV_INIT(BASE_LC3_24_2), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_32_1 \ @@ -5752,7 +5746,7 @@ static struct test_config cfg_bsrc_32_1_1 = { .qos = LC3_QOS_32_1_1_B, .base = UTIL_IOV_INIT(BASE_LC3_32_1), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_32_1_2 = { @@ -5760,7 +5754,7 @@ static struct test_config cfg_bsrc_32_1_2 = { .qos = LC3_QOS_32_1_2_B, .base = UTIL_IOV_INIT(BASE_LC3_32_1), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_32_2 \ @@ -5776,7 +5770,7 @@ static struct test_config cfg_bsrc_32_2_1 = { .qos = LC3_QOS_32_2_1_B, .base = UTIL_IOV_INIT(BASE_LC3_32_2), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_32_2_2 = { @@ -5784,7 +5778,7 @@ static struct test_config cfg_bsrc_32_2_2 = { .qos = LC3_QOS_32_2_2_B, .base = UTIL_IOV_INIT(BASE_LC3_32_2), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_44_1 \ @@ -5800,7 +5794,7 @@ static struct test_config cfg_bsrc_44_1_1 = { .qos = LC3_QOS_44_1_1_B, .base = UTIL_IOV_INIT(BASE_LC3_44_1), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_44_1_2 = { @@ -5808,7 +5802,7 @@ static struct test_config cfg_bsrc_44_1_2 = { .qos = LC3_QOS_44_1_2_B, .base = UTIL_IOV_INIT(BASE_LC3_44_1), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_44_2 \ @@ -5824,7 +5818,7 @@ static struct test_config cfg_bsrc_44_2_1 = { .qos = LC3_QOS_44_2_1_B, .base = UTIL_IOV_INIT(BASE_LC3_44_2), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_44_2_2 = { @@ -5832,7 +5826,7 @@ static struct test_config cfg_bsrc_44_2_2 = { .qos = LC3_QOS_44_2_2_B, .base = UTIL_IOV_INIT(BASE_LC3_44_2), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_48_1 \ @@ -5848,7 +5842,7 @@ static struct test_config cfg_bsrc_48_1_1 = { .qos = LC3_QOS_48_1_1_B, .base = UTIL_IOV_INIT(BASE_LC3_48_1), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_48_1_2 = { @@ -5856,7 +5850,7 @@ static struct test_config cfg_bsrc_48_1_2 = { .qos = LC3_QOS_48_1_2_B, .base = UTIL_IOV_INIT(BASE_LC3_48_1), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_48_2 \ @@ -5872,7 +5866,7 @@ static struct test_config cfg_bsrc_48_2_1 = { .qos = LC3_QOS_48_2_1_B, .base = UTIL_IOV_INIT(BASE_LC3_48_2), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_48_2_2 = { @@ -5880,7 +5874,7 @@ static struct test_config cfg_bsrc_48_2_2 = { .qos = LC3_QOS_48_2_2_B, .base = UTIL_IOV_INIT(BASE_LC3_48_2), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_48_3 \ @@ -5896,7 +5890,7 @@ static struct test_config cfg_bsrc_48_3_1 = { .qos = LC3_QOS_48_3_1_B, .base = UTIL_IOV_INIT(BASE_LC3_48_3), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_48_3_2 = { @@ -5904,7 +5898,7 @@ static struct test_config cfg_bsrc_48_3_2 = { .qos = LC3_QOS_48_3_2_B, .base = UTIL_IOV_INIT(BASE_LC3_48_3), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_48_4 \ @@ -5920,7 +5914,7 @@ static struct test_config cfg_bsrc_48_4_1 = { .qos = LC3_QOS_48_4_1_B, .base = UTIL_IOV_INIT(BASE_LC3_48_4), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_48_4_2 = { @@ -5928,7 +5922,7 @@ static struct test_config cfg_bsrc_48_4_2 = { .qos = LC3_QOS_48_4_2_B, .base = UTIL_IOV_INIT(BASE_LC3_48_4), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_48_5 \ @@ -5944,7 +5938,7 @@ static struct test_config cfg_bsrc_48_5_1 = { .qos = LC3_QOS_48_5_1_B, .base = UTIL_IOV_INIT(BASE_LC3_48_5), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_48_5_2 = { @@ -5952,7 +5946,7 @@ static struct test_config cfg_bsrc_48_5_2 = { .qos = LC3_QOS_48_5_2_B, .base = UTIL_IOV_INIT(BASE_LC3_48_5), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define LC3_CFG_48_6 \ @@ -5968,7 +5962,7 @@ static struct test_config cfg_bsrc_48_6_1 = { .qos = LC3_QOS_48_6_1_B, .base = UTIL_IOV_INIT(BASE_LC3_48_6), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; static struct test_config cfg_bsrc_48_6_2 = { @@ -5976,7 +5970,7 @@ static struct test_config cfg_bsrc_48_6_2 = { .qos = LC3_QOS_48_6_2_B, .base = UTIL_IOV_INIT(BASE_LC3_48_6), .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; #define VS_CC \ @@ -6012,7 +6006,7 @@ static struct test_config cfg_bsrc_vs = { .base = UTIL_IOV_INIT(BASE_VS), .vs = true, .src = true, - .state_func = bsrc_state, + .state_func = bsrc_state_cfg, }; /* Test Purpose: From patchwork Mon May 27 07:54:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 799607 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2043.outbound.protection.outlook.com [40.107.6.43]) (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 20CD2381C7 for ; Mon, 27 May 2024 07:54:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.43 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716796488; cv=fail; b=tx5sqjzbyHAsqWFEleKK17yxGOEtU7D7JaIDOK/7ETNpl2CpE/B9QSO+r/BfvXor928aICl3cwVE+8FhZ0fzvi0JonwW9A61aM/NudFW8qG5MJbDjr2aQEYj187JFnRP5swjkeiu2PHisQYk4f7V/L5R1Ju7deDt7E3q9VMo4Dw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716796488; c=relaxed/simple; bh=D5X6+l9KJxJnYEPYv/8q8VXyM3QN7mBAltpooAsDSug=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ch+D2ndtzftligYWVznh2mpKrDmgMXXvEcclkY533Q2sdCldD8MalnUhgX9IGzxBSSV9C/G4Dy1PzHc9Pc4sk+mQ8mmBllgyNJ8+kPTmTypWLgF4YZHojEyZ1D8BM5sybuAlMOCMmOlSWgL1HztDayPj9A8FsDcIdjGL7K7OSpQ= 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=GjxhZliP; arc=fail smtp.client-ip=40.107.6.43 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="GjxhZliP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RWvgB8/Ej7ZO2abt+Px4CRec0wowVNeljvsLsD2cDYxCkUartR8vqQ8jFnqwyIVgOjqJWddVapuleaouWmDIK/zlwRUInQUfthuvk0JtQVIuFurNvShb+vxLkTOiIoYkKn4LUTZHN2ZQV9GS/qBjkM+o19D/z5MSoaneorHo1Nd/cYSIXOB7lixJStcbU7IRBUFwNUeXR+p4q83zY+8LvIxHQrsuz8ABxdQ3CUHxPGCUesymKnZd3Q4AKDp8ajjE1rbm5J6zduvxJ/BPMKKceBRgCwH7DEH8P2NB5jRY89WOJSUec5LWwqLsm46L5sk7F9IrvNI5GqC1li2KL9MfOA== 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=xEbmjwckAdgsx/Mi6bzehewNIASH8ahNLE6WytM+6Oc=; b=JOGCWM6WlXhXcYNGudQ/PMOgcOtiZKEZ5+loa0BGKP6oT8QJx2bkvEeUmCjfIjk/O7hFkZhxChw9nsOU7jDcO7gEdOcAI3DtbKFWHCoVmahk+QBk0vunuDoQDhzC4cO16bNi52wmTUGCXmBeX5a7XUDCz0H4KrmzvEksMBLYla51oRPYALkykpBeQkdpi/IkBU8OOIMl19qfd09p6g5/z5AwXH96Q8o8rBUp3wKJVnJWmoSXA9e7gfrqglfzeRVK601QNycOXvwyPzxRma2430Dxf+CpGt0l0P698DKTOWooywxtt/jLZBhwzyw7pQucrNs/ZcOzXFLjhP4VeWksqg== 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=xEbmjwckAdgsx/Mi6bzehewNIASH8ahNLE6WytM+6Oc=; b=GjxhZliPz1heiCa86l3NObDx1k3UNqwSAmQz4tIABAb3XubLowlW6wQPp4gTrT/CcjUNvKEPkqiMkujypX810pE6golbFDO1DgvdkE7Sbd9BkouD6uP6HMyVsBj97zQrEcZXofvRYtZp6SoF0NqQPb4QmKzEcYDyFbFuv5PjOQE= 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 DBBPR04MB7836.eurprd04.prod.outlook.com (2603:10a6:10:1f3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.28; Mon, 27 May 2024 07:54:45 +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.7611.025; Mon, 27 May 2024 07:54:45 +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/6] test-bap: Add Broadcast Source Establish test Date: Mon, 27 May 2024 10:54:20 +0300 Message-Id: <20240527075422.18953-5-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240527075422.18953-1-iulia.tanasescu@nxp.com> References: <20240527075422.18953-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM8P251CA0003.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:21b::8) 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_|DBBPR04MB7836:EE_ X-MS-Office365-Filtering-Correlation-Id: 160d25f6-caa7-416b-a1e6-08dc7e224613 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: FDr2lrTUQAwYIrhAjEZLKnexXAz07R2m8mKD+kKEZgZ/vcnTJxzibihrEqXTvImj0FHR/FdyYHElFOBw8KhRbO2N57C+n4vzrhQ63eEcyilxdwdgJdbMJiGBPqKnzKHa3rLf4rbJK5cAqYQcJpTTIleasF2U7dCe2hSWOofX5F9PBZcfahSYNdwbDi32cp61+bej6Sys4Y6TKQQFBsrqanFC+/wGTofw/BpJNSrwl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NCA== 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)(376005)(366007)(1800799015); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KTLrGB/KnpZ+tJJJ3YHE+Y0Vy4NZZT27hBM1CYhsIhxL2AzaweeDVY3gVfmjbom9EG1kWtfUQNeYKV0rTiYImh0/dekFSgpvqrGaooxw6kF8txI6KuQI2wL9UUpHGNxYkTRkHCIsP394Oj6hfapFHVn8H08K0uonShThJ/J52o+mbwBJpfknfazA5AP13Q05Ww5scOmvHcp20itcSf7df1Qy5YbdK11EChPRUzJxX3SUM0DjHUXQJ8c2kzhDcADgJtyPiKiAVFFbu0Qf0jRCO+A+2z5yUPnpMmqXtymHSK5f+iY6lbf0KIdA4RKQtlQMFi7AXLmylG/2MDHs3kRrAOXZVcWbMCcAKyIf7kEgrh4CinhU/OD6KGDoSKTj+FF9/H4BEfrLgIYIFTPNauxBR+x61fj62UDoPcXXaqlo++ACixcvH4imibSnbm+GgTY+bwPzmPUxQYAPcqbLKs0ZjyDRhIhQv6OjV7QiXMNH9d4vfGT42BePAGk3sMFdStKB/UCB7p9LvAnh4mqgtglBymrlJk2mm1gDV+7LJZEVFx3gKQVW7xW9+fnByZlz5/XiWbZhekgATaFlWfXBgQSb09BQF2eDKWh1UiOPoEF7Wfgrw8pLdRLmD8IPoLeRfVYr+5/OW0TuiJl+h7zI72m9BYpjzd4rLomPGNK6icqj3sZTKUfm9b0GZTBK/USP4Xph2GzoUOzPLO7dnIexLQRGQQCZdqiAjAE6qK9vlvydL2kGR9lRwIquhwFHrSmf8QccJJDJV3abnQg8CpZfkWEz32W+YEGoShxcNBmsVJPUyiybBAiMZNS23WCihWB/cztG6RSqMpXi2+knP3ttzlP2EMzgpdd1iK00T8/AbxmJbXNm4FEaXxoBhYA9UAIYVdskH0+ncVpXIWYV3zVcg5q6VBHIESk/RzbHnmY/1ENsw1/Ez1uM02sWhvUP9fNSdrisWCRMb6eQlG/94YVinbB8E6sAPdXrZbxFeDvNWG8DZeJ1CjBjk+QV1yW2eGadzIjA2mG4yE1cimICRxsQW++6f7QkZKkUA82KPCglmCrjiDItVjmcWeuFYaYwY119b8liNnTzX7cBxxdtqaorM0RgIEnKgnhFV8uOvxk3jqdaRS8WjL8VTkxt7piJXGspATZ0ZPwRkizlEUO5VduCn6mbL1YRovp3GHkzmkNDBEikpfME5Pf3MhAlDnxntkQJWBkOsNnru/Q+yQwjERAItA2BzuNo+aLjvJrJTcgVcgiWCQAUq2lFxLXnbHQq6V0cvaEmt0IbYi1efzSP2LCDGSfHQu9cNbNkVgsu/Ixpb7WsxXgl2SlqgGUcX9rlN/VOKflkkSeAeif1FSuE4P9VJwSpJKLPoH44MwZirt8p52AJPdKCJ7ymtULoR/IkBEL3/mboOrey60sAxTMv1WOxdN2wkMMRuAQuPQ9ZRdtxGRIMjUXI52icyIGW4csjnk7FC33uDaDKNoKFfwa1zZCeQ8NDjwB+LwJDQ2ORwLTv8UA+fq0YI3nVs1MPWGB7GFpfV6tEQssgYu/z/mKZKQ+6JYBUIgt58+vdLn0HoHML9WulhO/8gEQYTM0W9TKtMvamw5OKcqbJpB7JauD3xGQX+8iXdQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 160d25f6-caa7-416b-a1e6-08dc7e224613 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2024 07:54:45.0394 (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: RhyAY5JXKtZb8+2Jx3AkFtZgm3/UxQq4NOGZhD/tMsIs4ffCAuGHSSDa8sgjd2A/fQmqJeeKRBBVrcmgjcfcSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7836 BAP/BSRC/SCC/BV-35-C [Establishes Broadcast] (page 175): Test Purpose: Verify that a Broadcast Source IUT can establish a broadcast Audio Stream. Pass verdict: The IUT sends AUX_SYNC_IND PDUs with an Extended Header containing BIGInfo in the ACAD field. The IUT sends BIS Data PDUs over the broadcast Audio Stream. Test Summary ------------ BAP/BSRC/SCC/BV-35-C [Establishes Broadcast] Passed --- unit/test-bap.c | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/unit/test-bap.c b/unit/test-bap.c index 9cb4ae8d8..59e056e05 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -6029,7 +6029,7 @@ static struct test_config cfg_bsrc_vs = { * Each value included in the Codec_Specific_Configuration is formatted in * an LTV structure with the length, type, and value specified in Table 4.74. */ -static void test_bsrc_scc(void) +static void test_bsrc_scc_config(void) { define_test("BAP/BSRC/SCC/BV-01-C [Config Broadcast, LC3 8_1_1]", NULL, test_bcast, &cfg_bsrc_8_1_1, IOV_NULL); @@ -6131,6 +6131,50 @@ static void test_bsrc_scc(void) NULL, test_bcast, &cfg_bsrc_vs, IOV_NULL); } +static void bsrc_state_estab(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + switch (new_state) { + case BT_BAP_STREAM_STATE_CONFIG: + bt_bap_stream_enable(stream, true, NULL, NULL, NULL); + break; + case BT_BAP_STREAM_STATE_ENABLING: + bt_bap_stream_start(stream, NULL, NULL); + break; + case BT_BAP_STREAM_STATE_STREAMING: + tester_test_passed(); + break; + } +} + +static struct test_config cfg_bsrc_8_1_1_estab = { + .cc = LC3_CONFIG_8_1, + .qos = LC3_QOS_8_1_1_B, + .src = true, + .state_func = bsrc_state_estab, +}; + +/* Test Purpose: + * Verify that a Broadcast Source IUT can establish a broadcast + * Audio Stream. + * + * Pass verdict: + * The IUT sends AUX_SYNC_IND PDUs with an Extended Header + * containing BIGInfo in the ACAD field. The IUT sends BIS Data + * PDUs over the broadcast Audio Stream. + */ +static void test_bsrc_scc_estab(void) +{ + define_test("BAP/BSRC/SCC/BV-35-C [Establishes Broadcast]", + NULL, test_bcast, &cfg_bsrc_8_1_1_estab, IOV_NULL); +} + +static void test_bsrc_scc(void) +{ + test_bsrc_scc_config(); + test_bsrc_scc_estab(); +} + static struct test_config cfg_bsnk_8_1 = { .cc = LC3_CONFIG_8_1, .qos = QOS_BCAST, From patchwork Mon May 27 07:54:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 799313 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2083.outbound.protection.outlook.com [40.107.6.83]) (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 97B532E636 for ; Mon, 27 May 2024 07:54:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716796492; cv=fail; b=Ez1oQPmbi+SgkSBnq1FH7HHHRClTazmZ71J6AanxJMQY7mVTAEKaeNuEz6cA/4rlSO5FGOGtjawCnmcy3NzXuQkLIRU+xi5TPB+b+Xk7roH0eqvUpsbNmZw3aKxqqGEbFBbk7VX97CklNjz5+7ow9iqyumaepEoa/hsUe2rgnmo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716796492; c=relaxed/simple; bh=bQGL1IuzXVETFZzzD4yA3LQn/UuvZIG0oy2oJQj6Vgc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=rsvcnhuKRH6Jv+LOaTaopCTHuZzO+kULNWSgOc+lmD9kGKZDlnFeOZ1CroLmAzsmgMWfsI6PBMGpSdADq2eBxm3Xym2RUQ5WYV2ianmyt6LAV1MWizEbHoWp9GVsB7lj0WW3KRBxpupBZDWUqVkQscyS5GsWjiL8kT5rXZgf7QM= 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=pZgp7r7B; arc=fail smtp.client-ip=40.107.6.83 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="pZgp7r7B" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MahlKdVBM9mCaKBGGGepmag7n9QrWk6NYthzUmmPUmE5QmffhFwZ3k857cU/LVteMREV2vApC2E6keKnUQxTQqbBianwAi3ClvVUwY5RVfBSfEjdpjdr7mD4uC8t6z9m1+/BIcFsiJDgIDBDdPqBQZUozUsrMTVc7hZIsnx6GulnsYDKQOySuBdjICEUcYKGp9tqwMdlHKO60FDZe/4jalifrau2XUeHhv33MK5jVKNz7/yo8yLhC+pCmK/WwsPHEqATm+t7bDlGzAORdncJTDRNF7pOAJChVIy1YTmciJyT3fRcRHZmJZHQoQeOhMmqgbPZsoNu987ActAyT3MnkQ== 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=7HZhsr81iO98KszrjrO7ZP85AEn4ILHxE4LzGv01g5w=; b=S/lm0Bv2kt1jAOQfXk9vRPj6EIYIBokesIz23S1/0kIFIa8zALr27AwIi0s5LV1LoVw+gKi4P8yWuH1VqB1dedKhltCntZ443+E+aW1rDmbhFFGMgba3c+hr6r7IPJMxmM2hb6Z87ygfT0m/3o8+akNyEKKDMRWdorRYgySeGKGc8MnKByH6E0+XHhb0IJonz3MkJFxF+n7Sq1IQIy3G9kW6sKwrNZmYdOPP0qqFZvK2EFNTPUKSPNI6j+elD1RKDMZrLndA1kJ4GCby1SEF4BUhuD6z/069P98zHJK2rh377WqF4cMTb+Czu+7lq3a1hgxxOVn9OLjU7I33A0ZB6w== 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=7HZhsr81iO98KszrjrO7ZP85AEn4ILHxE4LzGv01g5w=; b=pZgp7r7BOZqTn/Gvs/Nwfg17YVgVkFdOI4f3JA+4hGHZsoEgaOz9IOZOAyEDLXjAnthB44Xz+I3f0wLiKrJsalgRoWFeStQQV6knL3gTq8xR+lsDRAP1FeR7/53tng1UuWI7ob3ruscrmLYCsRkNsODINlwLmTIIfHaapbYvj0M= 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 DBBPR04MB7836.eurprd04.prod.outlook.com (2603:10a6:10:1f3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.28; Mon, 27 May 2024 07:54:48 +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.7611.025; Mon, 27 May 2024 07:54:48 +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/6] test-bap: Add Broadcast Source Disable test Date: Mon, 27 May 2024 10:54:21 +0300 Message-Id: <20240527075422.18953-6-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240527075422.18953-1-iulia.tanasescu@nxp.com> References: <20240527075422.18953-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM8P251CA0014.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:21b::19) 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_|DBBPR04MB7836:EE_ X-MS-Office365-Filtering-Correlation-Id: 8d7ce2ba-3e64-4eb6-9ee3-08dc7e224804 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: FGxckqeTYOlC1U6iexko04pBheriG4zrMbW/MBJ8VicCQiWhJkx12e/y/rO3+nQHcIRdo5d/319jfvAfGzHR140G1EzkYmu9Nv1v+xEI/SdI5HTyXv8dgTW7RVaRMkUaPkNX9gxz5OYZRa7LrOXHgHq9pLP1PXuJsAfC0BJG2XWcHZlbJX4zww6xRYfFF6e/35GMlBR3IJT2sYYBR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BYVYpm0Lg== 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)(376005)(366007)(1800799015); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SvVc7IeGICpKL6bERCpj+2YmHb9PP+iAFhsOT81FlLLebwpSUyRD1cTePkZ44t3utN4FL7UnT+phacGwW3aDaZhC/Nq/hQNWiYC1NiGuK9XCgaZG7Cq8kteUxJRyGjFxWGUHPuz26gwJXZrHR2k6gApouovKW8TEr767FRTg43a0s30PF8PalQf6THTX/cNte0o2lM00Yj7zS6GyqpGzRHmob9x5+9gAimt0rGaLcX+K1eGteCtu/r3KDFw8qZg56FdOGV0U3uy3i2oVgXLOk9s71Dtam8qDWxbB+JwCcAE29YGXflBW6/GlVsYFDTedDZ6NzTXXIAdrQO9ESvBj9lOAeAuL7qLdmE//YL/opbAek4fGaqDdc/9+ZGBxwUeLE9+Y4WSsJur9vde4Z13XOeaq7OuewpRv7iLQ2mxF++9QUh08jOxRtcjSiK7KIGTrqEdyFPi0HPNhnN3ioPdD3nnuspE7TiSrodax2OCpI2LXkrSJmXKTbjtzo8O1EQsYiJUm3MeYQC39PPQ2DkENAUzisjch/LA7U2l1900bZXaVoLqPAYRKLkJVOYTTnvFFtfoCu9nsXwK8zb24Eq3HxY0Bc6HzkviOAag/ReEXSdKM4d+BdKDxYqOZsghOmoUsFVyJ68Hr795kcPx8U2Q/Az5xux26X2FNZKMqKLJYXGgpGjKMk4fURTUKJ0FzVk3501fI5OianDztYkGS+dalyIhmTZhUx9T5XsedilP4n7KKccccGwu1XxR4Xc2xX5MPt2EudBKvIoqo4OMFiRbCQNJA0wq3u598a3LoaztLEl+YIm+g3yHiuvzHL246/OgBvwMN48mMmaKoHqTlPU/f3aHGCH+nXMsbI3HsL1A1dslUWgOLybJJtnV0nLsJhTCecKYu5ZSLEuFpxb2uZPMV4IT/hu1Q2xQ+OXDq+8FZya4WZ9s5HlXsXLPVGLoFLGLZ8KhBPXr2ar8l+nPuKsBQ6kA+cZQgAPNCYeNBgAN5E9p1FMPuvXb8PQsVh9guEae2GlcPweRdrxybgyBW3xoT6JG/LHeEPA73Vyg+3e3PDWC6whZor94zn58Zzl4cnYJyXQizv2veJUwhDkDzpG9D2GbqMnrzxaN4dtVpKZUjD+mZavlXgipgPyheKd1z/eYQ9SrSfr3Hrm5swlU1ygcag52c/QenlOo5a0P8aup2GimSXmbK+OsBNZLXBGACqNGQliumWQXvW56Gi2pQW1EMiy8XzpsZs+9QideXzDG++YzZKaSDziiRQoiVuAyQFiQ24pPCvvQwdMJbPPMJGVz0yWKupWNGbyMVmSJz99mtfcqTeKD/PwSl+VUG6eMgMp/2W16E7lk/dQ/znPQdeKaZ19TFYXUI6TFqx/IvECzKW+EYW0tvrl1V95sMyH/gqUjlZATw+AWA1pQPnn1ZdKuNcK7+8OEQKWRbw9i3cQlwaMCRFSLfYR3ut1D7OIdSlD5bqe5ZXf/cWGQbrOoM14lkwBq79jhRyDYxtzzO2zovLQVmiqlpzar2d6FUspDJHw//mweAJCJhWcF2QAPDeOiXcnZ6uOrIDqpaH3bawjd7AHbM/ZDt0d4qRRpUaJDrM86RIGM5l9svwxC7g04r0JbtKw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d7ce2ba-3e64-4eb6-9ee3-08dc7e224804 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2024 07:54:48.2803 (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: Scunvim2u/Ipe0Pv+ZPCimXkWOTHtZ/Q+NCyH3J6YXMoHfD2/VPD5CKpbtvWHFQiIVWuEMhZyB6coJcUaMO1Sg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7836 BAP/BSRC/SCC/BV-36-C [Disables Broadcast] (page 176): Test Purpose: Verify that a Broadcast Source IUT can disable a broadcast Audio Stream. Pass verdict: The IUT sends a BIG_TERMINATE_IND PDU. Test Summary ------------ BAP/BSRC/SCC/BV-36-C [Disables Broadcast] Passed --- unit/test-bap.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/unit/test-bap.c b/unit/test-bap.c index 59e056e05..3fc3b5f02 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -6169,10 +6169,53 @@ static void test_bsrc_scc_estab(void) NULL, test_bcast, &cfg_bsrc_8_1_1_estab, IOV_NULL); } +static void bsrc_state_disable(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + switch (new_state) { + case BT_BAP_STREAM_STATE_CONFIG: + if (old_state == BT_BAP_STREAM_STATE_IDLE) + bt_bap_stream_enable(stream, true, NULL, NULL, NULL); + else if (old_state == BT_BAP_STREAM_STATE_STREAMING) + tester_test_passed(); + else + /* Other transitions to CONFIG state are invalid. */ + tester_test_failed(); + break; + case BT_BAP_STREAM_STATE_ENABLING: + bt_bap_stream_start(stream, NULL, NULL); + break; + case BT_BAP_STREAM_STATE_STREAMING: + bt_bap_stream_disable(stream, true, NULL, NULL); + break; + } +} + +static struct test_config cfg_bsrc_8_1_1_disable = { + .cc = LC3_CONFIG_8_1, + .qos = LC3_QOS_8_1_1_B, + .src = true, + .state_func = bsrc_state_disable, +}; + +/* Test Purpose: + * Verify that a Broadcast Source IUT can disable a broadcast + * Audio Stream. + * + * Pass verdict: + * The IUT sends a BIG_TERMINATE_IND PDU in step 1. + */ +static void test_bsrc_scc_disable(void) +{ + define_test("BAP/BSRC/SCC/BV-36-C [Disables Broadcast]", + NULL, test_bcast, &cfg_bsrc_8_1_1_disable, IOV_NULL); +} + static void test_bsrc_scc(void) { test_bsrc_scc_config(); test_bsrc_scc_estab(); + test_bsrc_scc_disable(); } static struct test_config cfg_bsnk_8_1 = { From patchwork Mon May 27 07:54:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 799606 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2056.outbound.protection.outlook.com [40.107.6.56]) (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 2268F2E636 for ; Mon, 27 May 2024 07:54:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.56 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716796495; cv=fail; b=TaJkQUFCxHqpE6RzDxJxkMPaMekbT3rQ8nZ3QIisB84+GzaJEH/m++IaiWFAQXriTFmj3UOC8p2OsWHpjQG+ZtIGl0oivNoNREt48fNn8fikA84J1pY27tvjxFJmECkUSu0CSlrYItliU4NgPp3AeXm+HRSEeqHlGZez3hSb0dw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716796495; c=relaxed/simple; bh=uF3dVtg2xbratddzgTVurKfcLNrlWqZm2sipYdVHitg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Ct7aua3Her5d4MBsTOJLvlFqhlX+XcWf6hW5a6W3JP4i/fxzOvt596pVmHi7uEyYkFqMwWpPZMwDA+Fdln1AEV0wpy8L39bFNsd9HgVH+jPjenEDj/lbiZxTU5URVCJOqkeciRvHnEdMKYQo/of/VAcNp7jdoYk+i9Kc1JZv/Hg= 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=P/J844Vc; arc=fail smtp.client-ip=40.107.6.56 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="P/J844Vc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CrtRx7iF6Ro0M0PYestoHESvq5n/1NLxMpTB7aDsiHu1lUg6Y8JjBpx7NRyYqHJpE5vZXPys9Sc/H+G7v9540l9Ywza7kpyZu7FllWRYcwL1/FZrLTLjivxT0qZmjA8MbsazzeyyCnHPUg6XdBRUPQYa3XnBaKevO0pGuBQKlo4NhbMPzATTBpufWj268tXzf+NyYjSzPA5l0hjkIiU/ESGR0SsGROsp8bwXxxdP1Zfl0D40vu/rLWgm41Eb6eR2QOHCcGfqr77QYd9/RwrfShkZAj5GujAQKbmOwZN+EhGyYmyqgzYAtWnId3i4zESKYcdRB5oLzFdn0muKA6Us5w== 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=ZtFtycgseYDZtaGFkkzlb0ASvHE9l9o2b/SlFw8qKqQ=; b=LXL5EGmuRESzdynQ+VcjsMnAsJLn1glsoLMZPfrWryiEJLFviFYT0Wcf5ZNBxZlX6nJJf6gLJYrSgl5iSrtxl+b99niQfuGsKxTHcS+e5iVYEqjWCxVw16SArTIeV0eO5yY7P0RigrylIQpEcHfYn4C3qznx2lSO6fUGB1lcDGxLQ7/RaKmaJ5LymB523wa5zpz56M0VrUCfbrWp/g7/0odWzYHTa6BUuA0rvxnHG0PRE0Lus92zmozCLBOKJO9rEVwAHqPyeeI7PNMWk/WBouyJkm6/M1lb7VC5WU+Ybjlb0yWydqPI+BGcuw2cI7xVC74r2V7hi4bJm764KHOiDg== 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=ZtFtycgseYDZtaGFkkzlb0ASvHE9l9o2b/SlFw8qKqQ=; b=P/J844Vceq2EQPX6VcbNkZtNTHjBFWF2HgGCw2nFjvKHNjqojl2tfbCHRmsvGAMUbUMopw3RrNxM3SOQpOEtrx327+vW9rppEKdeECr8+0LJ217xEAx6KyD3Qa3LYlgYv10Sx11i/oisvYYnf2s++Caq2+fbcB+DgzvEcpvt+cQ= 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 DBBPR04MB7836.eurprd04.prod.outlook.com (2603:10a6:10:1f3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.28; Mon, 27 May 2024 07:54:51 +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.7611.025; Mon, 27 May 2024 07:54:51 +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 6/6] test-bap: Add Broadcast Source Release test Date: Mon, 27 May 2024 10:54:22 +0300 Message-Id: <20240527075422.18953-7-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240527075422.18953-1-iulia.tanasescu@nxp.com> References: <20240527075422.18953-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM8P189CA0028.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:218::33) 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_|DBBPR04MB7836:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c10ad66-0d0e-4db3-2cf6-08dc7e2249f7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|1800799015; X-Microsoft-Antispam-Message-Info: rqf7PdcHHCksiVX3imePr1qeiHq43zMxEdjSn6FHGdKtTFWX6mWwtTmblieYRuXFrNTN9+QNlarSa2UlKQkSjgqP1yS8SLdGY5WcRHQybcpIIKD32DdAcewmVEZtH3UvHquNtc/AuijQ1qT6qD93UGj0hGQdF17HVIQuW2/ZEdOpXk3EXX+YRiUkP97FBJZsLpADH3U2j+wrTY+4acokPu3nah/yQUwc3TA3UyxIkROhdaZT8eZZ2Oape25tJZX/NHpv32GtNpaszZnYe2TsryhrYRS1AkZG5YGQPbZ6oIcvo7e3jFuWplR8WVbbJ6vR3uJKH+58ZBUs0dgglocTmAiZI1M6mW9lW2vM4rpBm+MAdr3CGrHzYRZ8XrCgYw8AWLUQUcMk9mu/vbKPT/H3sF+IGT/3bEeA/HEVXlCKn1XfvFxWkcbeEfNQNZBJhIf2SUNnImaVPI2Bmd92upIBuwmeyqA1JCalfeQVSLi6P9WO5fOki9l+GuM6pKpCqAyruktyih0yPF1W/aUa3nDXG+H3Iqexr2V+6Pdn45MI8KZDwnvs1Q7cJOnlok6Y6F+/+zfkF7sG1+IqWajSpUec1xM4yp8gIlmC9uauB+O+hfzDKtJE4jurgPUPOQstGt1G+eK+5611Ej02fzo8c1x2dIT8RascggQqqPIWJy8pLsd7ogbKxEwxSglyGXae57bY4YOb1BQ3xEIxmXMxSiGUtUrwfhSHsMaiKscazp1Vs2CbvZ1YUv+ORRizdQKeIxElHK3ZfAA7b/IO7hzphBDgIzCYlYIqDvq0UAbyFnPlrNBn+b1ttGbYDJ9m2BoPYahuGcKVH3RVjKajUJ/G0Fn4hVwnHjqL7CTRa1XIO/c2MCklqrXgJwF8XVD+fDiD/BZONAuZoYw8oABArE1ioKal+nEawjgA1YOzUxPoKCSYl99g2H1ZQt/eudx++rEkhlFm33bdeTLofBWD9UTPr39raxCCaXk0fmowoHsSQSa4fKFGUrEOhCn8UQSDgYEMcnOecqAEnrY3rG5cAeekv9M+hhZlPCfw18QM4/wjGfDJRj66VEpkmOr5sLOXjF7/dPBzxQEJUmIQSZ3J+W3EnzAgT19ktmTCve/lOLa2JEsaQlrNy6IjKlaW34grs2XZ+TOaIKEm41bDSBZAiEMO00ALsdfs0vHyR5EYj19pRMxYQ5P1C9y841KMiLvk9cKvb1KRBRj+V/YSyHY4Odnqfb0j+nwPABv3mFYAWhoJMK7wt+85q/D7wWt6264+Vtf/nayI0GYeqH4YPMoGkyYJBbdh9A== 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)(376005)(366007)(1800799015); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-M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BxjGMD2tHYx434IIFgllpZSeSlTAuveE+x9JRwVD75rUTIF3kbyGIRm0ka+FxBthEJS6EVLlL2pgOOBUwvwY56h9ebHbfTqgmLGl8I+X3aX9Ie7vK0dhQ0SME1mBulBe53R+j5aaiwJH2+sGdrcgjSQJpz+IOZdhPkeoZqC6DeAY+SwcSavUKEz+uktDjPZ3HhYW9s7kimSmHLDpmdMdi4IYN972gDkvRKP3DcaVXEceiaaivUSktoRiKKbZ1t+yfJoQcvJVOvb/Is33h2ItVHrhWw3chYz2pY5vES3TPMw7NpOpWJW7zjDQmHLuqq4s6ySxb+yJ34AcYMzfy/zd3uGvfabZdzfO/WgRMr3CyLogX+iNJpKtJIQHPu4tpNoPBWQbbAyRKjwh2mbFIdV+kKJwfCT2iPNwLtSUWqfE0q3x7FvBnX4nth0awjH4l/hwVgsPRWMmiytYriKPBE6GOyWgh7bpcJM8ysQTXHpyI6joi/aKr0WeJ9U8g2wGsSfYsCoKXG4gOcBasR6AnADXywkSvj5lkJS4ieMU8ZAcWsHyQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c10ad66-0d0e-4db3-2cf6-08dc7e2249f7 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2024 07:54:51.6052 (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: slzUbHCqPorOuqwwPGA6m65nJF1+PZgcVvcNPFPTThaF4ZlJmLNcdc3xEX3Q3M2pzVoamYByD6VH4E+twzb0gQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7836 BAP/BSRC/SCC/BV-37-C [Releases Broadcast] (page 176): Test Purpose: Verify that a Broadcast Source IUT can release a broadcast Audio Stream and transition from Configured state to Idle state. Pass verdict: The IUT stops transmitting periodic advertising. Test Summary ------------ BAP/BSRC/SCC/BV-37-C [Releases Broadcast] Passed --- unit/test-bap.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/unit/test-bap.c b/unit/test-bap.c index 3fc3b5f02..47a19b8c3 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -6211,11 +6211,58 @@ static void test_bsrc_scc_disable(void) NULL, test_bcast, &cfg_bsrc_8_1_1_disable, IOV_NULL); } +static void bsrc_state_release(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + switch (new_state) { + case BT_BAP_STREAM_STATE_CONFIG: + if (old_state == BT_BAP_STREAM_STATE_IDLE) + bt_bap_stream_enable(stream, true, NULL, NULL, NULL); + else if (old_state == BT_BAP_STREAM_STATE_STREAMING) + bt_bap_stream_release(stream, NULL, NULL); + else + /* Other transitions to CONFIG state are invalid. */ + tester_test_failed(); + break; + case BT_BAP_STREAM_STATE_ENABLING: + bt_bap_stream_start(stream, NULL, NULL); + break; + case BT_BAP_STREAM_STATE_STREAMING: + bt_bap_stream_disable(stream, true, NULL, NULL); + break; + case BT_BAP_STREAM_STATE_IDLE: + tester_test_passed(); + break; + } +} + +static struct test_config cfg_bsrc_8_1_1_release = { + .cc = LC3_CONFIG_8_1, + .qos = LC3_QOS_8_1_1_B, + .src = true, + .state_func = bsrc_state_release, +}; + +/* Test Purpose: + * Verify that a Broadcast Source IUT can release a broadcast + * Audio Stream and transition from Configured state to Idle + * state. + * + * Pass verdict: + * The IUT stops transmitting periodic advertising. + */ +static void test_bsrc_scc_release(void) +{ + define_test("BAP/BSRC/SCC/BV-37-C [Releases Broadcast]", + NULL, test_bcast, &cfg_bsrc_8_1_1_release, IOV_NULL); +} + static void test_bsrc_scc(void) { test_bsrc_scc_config(); test_bsrc_scc_estab(); test_bsrc_scc_disable(); + test_bsrc_scc_release(); } static struct test_config cfg_bsnk_8_1 = {