From patchwork Thu Nov 28 16:01:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13888209 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2081.outbound.protection.outlook.com [40.107.104.81]) (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 000AD1BBBFC for ; Thu, 28 Nov 2024 16:01:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732809690; cv=fail; b=t7PUSlCKotQQJ5SVz1QUwCcwu1S5iB5E49STB6ML7Q3ycF+Owq9rhidD8bPd2R2BKlUJczypeACsWmfh2FsBNtuXeIq1mShm8/OtJKVWEDwRllhptJRRAmcfw5oMWETkP/MBx+QrTgVMsD92OUMtq0fF9J3QwqZuBF+TAljb2Go= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732809690; c=relaxed/simple; bh=aXyHDjj2yHVMDPwt2bb3kqE5NAjLfeMmOZWJiFYLOq0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=naWgZJViAQ/KK2Ujgts2Futysp1aMa2RfOF5OK7cJYLq9BCbFErCKo7uAw7cRjk8zzQacp1kCwuWIELhMEEYc79IC/BvzjFtmgwzud8s8ODlt7fDivrRSJnaDsjJak6xoaEZ/Gv79EqhyK5aNF4z3hmV5KT/YH/VZ5+GiY3dcMw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=hYMR5TIl; arc=fail smtp.client-ip=40.107.104.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="hYMR5TIl" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ANER0f009jrlF98WfKq3kXFmWAlAWrsCGRvG7Z+yzQ+j6KCJXdxcrcq48uHyhbqs+BgYx2N+dCJUxa7gg+qpmWUe2b08DNTz0OqG7Blk2ZDQ5D4Z9xEqY8+zWOSwkWKIT5v5J47AsDBJykvFUKr00h0sKWtXNBePI6/ug697Nr4z/6UK17lBQywIImGVDZ1jsPoSNclUa5j95+1zAgHn8kM4K/prfhWcg1tyVUiT9a6Q4EgorFoZDWsJw8cjiifPEkBIm+IoOhszAWa05hy6H+b0TYF6ZaTnUmVh7cIMLMWh4nGUqpRY1oCwQxt3gmsJaWPuRKlkJeA0N4j8K5gF5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1OdYVl4Yl6GeKI9fiOnJEcnPSQ5wAzf6t5Qkyf0T+U8=; b=QVMNZnfl7p1oJlpaDTMnNBtfUZ1hKCSs4xIyIQvjxtoXOy62NGwrsPcCKlS0xLEL08n0Ia2hV4Zt7XBSvHxqsOHiG29SVeF7gKCECQupt2v++EikiTzSipHwaS+K27M92WqC8g19LC1r1AgYRgM816P83SQlALk8VTNlpCDjINA9cxCq4g3AnBvN2aGVKMAkPujYTpWbFTjWFVceMhaqhgAicAdmh+XlUv0W1ofNfWGI/jz0vDqDgHpjLXwSmawMCRM7Nf2in3XORbJJMpPv/wz1WZF3swQvQhkNfeb4gisDFDGk2HiX4I+f5tpWrlfDtbjYO2sel/TJXUMtB8/yfA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1OdYVl4Yl6GeKI9fiOnJEcnPSQ5wAzf6t5Qkyf0T+U8=; b=hYMR5TIl8n4i0uFRhc1JpjMoGN5oJxTRl3BQB9FVs2MnHB8biB/5ReyMfXoV58LIkIl52TAaLiuW48ljpivQrGE4p70WMg09gtDYEoINgh2XtEuGYiaZb8fB/fpmaJNhymK3B+NzhWVpWBQWjcAk+jua7zFm0IhJGrpV4j2UPOkpkOtmU6Q28HUHjXCt+WLiiS2s3S+QZpi/oXRo0O8WsZJ4lUqEMeN2mekevaDjw+kusl0j2AsuGPHdDhvU/Rlq65f1FhlenaS58mBELUejAlwDCiUGyx66pw55UFg+zVIOAjnW5PuW7NmLyuJP8zD4YrR3EaVlRPgBEUDjpsyezQ== 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 AM7PR04MB7191.eurprd04.prod.outlook.com (2603:10a6:20b:11c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.19; Thu, 28 Nov 2024 16:01:26 +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.8207.010; Thu, 28 Nov 2024 16:01:26 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH BlueZ 2/2] iso-tester: Add test for ISO Broadcaster Receiver Defer Reconnect Date: Thu, 28 Nov 2024 18:01:01 +0200 Message-ID: <20241128160101.15187-3-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241128160101.15187-1-iulia.tanasescu@nxp.com> References: <20241128160101.15187-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM0PR04CA0115.eurprd04.prod.outlook.com (2603:10a6:208:55::20) 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_|AM7PR04MB7191:EE_ X-MS-Office365-Filtering-Correlation-Id: 879ced24-290a-4a83-7b41-08dd0fc5e9c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|366016; X-Microsoft-Antispam-Message-Info: pN7NYgzy8mSMtzn3Xaonh/pIj64TealhG6AaURV5oeRNyVlOFaTWNepqfaDkdRTwbCIRshTt1D/N1ZBYNebngcQX0r63p21Vxo0UiCAP6eBrZ6KVWaCEGsyTaIGo7ImFbeK3JigStjeT0sKXpa4totpcWSt/DUr2EpxckDEg2+m7pEAMjG6WyCyIQryggQg28vgdxeAV9ipOvNu2zenEO1bja1mt8jGkhhEIwau1l5Gj2wa78+3fddLzpNu5rg7Xt3+0rRkLD1ITb9GKPNNdwL24Y+ulexkRo/p4ibqhWNKA40P91eUdTCEBLeB6JGrDyYln11tFNUsHFhWXz7ZRk6JrEt/6LFGrNtC4vQ8mG7QarLc10fy3Iz9q0rXyi8S76LHKJsOJbtxN/ZM4IwokINABINFudsf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6q54E8gU5TSZbCL9NZeLu3Y/05hG2479aKkGbhnGC8rS2U8xdilns/+um8bF5AzcFBZ1NWdcLXXMUhFN1T8RamjMdrzMdlv4vsk7MkjMqLv8DsXMXtZtBph7TktTLatxICY6D+yMIQEDL4PvfPqKmt9kXbmzio6E4MCketb1DXSuRaHbs4fvWI5+kGHfomimlw0nEQ4AMUyKYLzrQPtB5CjefiGRaBw6g46zrMaqrf31RPla+Q05KrFh08xu66jIsB/BPVjUK7qibPtJzA07kb4GDwe9YzogwG8JAzwjQ7KHd8dSMTxJhDedAOGIw/fnAJ0fGo60BlULR/t4aO126Q0jmDLy48Cphgu3vlEnuodmrR99+pcdb0guT8GyatRqd/6pjg66k9yzGM8OXvLN3ZujRhDx8GDMLCflHqkHdxNxjkU42AkmJWeZ8ysE8KF9/PaU8qPWDFVGH9Bl6QQwxxKy+Nq5ryBIupLxbhl2dYAIWM6gCcXGiHZSG7vEw4AS+lVUue2fXOGgRS1rosSX0E3XNBSnC2ZLUu6/VYQvpdAMYlE8aHb5itmSxxyOFH2GmNoxTadeZzi08g6DW70LozlLRLUsp6xmzlrd91Ly1iNUTpApstgbrh42It310Ca7EvA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 879ced24-290a-4a83-7b41-08dd0fc5e9c5 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2024 16:01:26.2728 (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: fXLPAaDyM6gP/o8H3usxzq1gtubbcsGmPefzhyhbBA0YK4wTuyIz/3iKOi5fl7Td2ZX19iVEbe4M2X3yAWn9Kw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7191 This adds a test for a Broadcast Receiver terminating BIG sync and re-establishing it, while keeping PA sync alive: ISO Broadcaster Receiver Defer Reconnect - Success --- tools/iso-tester.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/tools/iso-tester.c b/tools/iso-tester.c index 5ec8634ac..c30c44ce9 100644 --- a/tools/iso-tester.c +++ b/tools/iso-tester.c @@ -1447,6 +1447,17 @@ static const struct iso_client_data bcast_16_2_1_recv_defer = { .big = true, }; +static const struct iso_client_data bcast_16_2_1_recv_defer_reconnect = { + .qos = QOS_IN_16_2_1, + .expect_err = 0, + .defer = true, + .bcast = true, + .server = true, + .pa_bind = true, + .big = true, + .disconnect = true, +}; + static const struct iso_client_data bcast_16_2_1_recv2_defer = { .qos = QOS_IN_16_2_1, .expect_err = 0, @@ -2404,6 +2415,8 @@ static gboolean iso_connect_cb(GIOChannel *io, GIOCondition cond, gpointer user_data); static gboolean iso_accept_cb(GIOChannel *io, GIOCondition cond, gpointer user_data); +static bool iso_defer_accept_bcast(struct test_data *data, GIOChannel *io, + uint8_t num, GIOFunc func); static gboolean iso_disconnected(GIOChannel *io, GIOCondition cond, gpointer user_data) @@ -2421,7 +2434,19 @@ static gboolean iso_disconnected(GIOChannel *io, GIOCondition cond, if (data->reconnect) { data->reconnect = false; - test_connect(data->test_data); + + if (!isodata->server) + test_connect(data->test_data); + else { + GIOChannel *parent = + queue_peek_head(data->io_queue); + + data->step++; + + iso_defer_accept_bcast(data, + parent, 0, iso_accept_cb); + } + return FALSE; } @@ -3405,6 +3430,16 @@ static void test_bcast_recv_defer(const void *test_data) setup_listen(data, 0, iso_accept_cb); } +static void test_bcast_recv_defer_reconnect(const void *test_data) +{ + struct test_data *data = tester_get_data(); + + data->reconnect = true; + data->step = 1; + + setup_listen(data, 0, iso_accept_cb); +} + static void test_bcast_recv2_defer(const void *test_data) { struct test_data *data = tester_get_data(); @@ -3807,6 +3842,10 @@ int main(int argc, char *argv[]) &bcast_16_2_1_recv_defer, setup_powered, test_bcast_recv_defer); + test_iso("ISO Broadcaster Receiver Defer Reconnect - Success", + &bcast_16_2_1_recv_defer_reconnect, + setup_powered, + test_bcast_recv_defer_reconnect); test_iso2("ISO Broadcaster Receiver2 Defer - Success", &bcast_16_2_1_recv2_defer, setup_powered,