Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp533586rdb; Sat, 19 Aug 2023 11:45:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHJzZRK6jEwPlwGunribHoYUZqD+w2MZMRpU7SdWxvcK07ar6m7bN1O3di6Rwb3sF/w2xzZ X-Received: by 2002:a81:5b0a:0:b0:583:a354:f259 with SMTP id p10-20020a815b0a000000b00583a354f259mr2242712ywb.3.1692470721784; Sat, 19 Aug 2023 11:45:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1692470721; cv=pass; d=google.com; s=arc-20160816; b=UrYzoJ4sXmWjZFmYuXUM5kKT4JgUS+iZg+raKr0pHWTiItYbTYMGWwtoSYGv31ueF9 VdAANc+9KuDr3HQUjjp98X67QG7bZW/q8tHrMOu7Fuj5OwM3x0Id+ZxXD14aYK8rxiug pPVYYAGSqLx2dCJL+Oi1+8tNeISqjEKyywcwR0am3mg2+2M/2EwRAQ8UeCRxOpQ1eZ9f QQ5q26OKIhM8Wsm2HostVg9tLVF1AUuozVHIVhozPaCIwRe2pQnHJZo9XD/JNoMdwUQR quMsuQJJUfprXXBS5bnIrV7hGaQ/8w/kmTZupssvI8TdSVYRDH4cG5dNtjdf13ZYqdZz BGEg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZO8Pw7dftjVj1fh7Cws008FoAT/bdgZLUHoJRZDJoSw=; fh=0idCJA5F4mjToaJW2rF/paT1Yn19zWG4bojHuty9A3g=; b=MbJddcbpJPvYG4e4G6262ENAS9KpvSfJ/EyvZSmbKTdkKMh13Am8q+y7NNl2giin8W q5HWvCY/wGUXA7lho5jb1I3jblVPIBCdE/PyCU+sdWZI7k1Fcq5oJh0//nfogo3TH7Tf nnlfXqJub3ThfVyu9+XPBBorrQ3FG7HFocPX3wKei8TDDGZR9FxlVbMmp/fX/TgsA0CB 0F1Wk4Ui41bKLOs4hoIht4GuRjaPsiyCcM9lDnbFBkkBUaJGfNPa1ydZ8j2KuXDaAVDc Y4WIhdO0gFju0C01dkivtrnBpnkUf4O9ATiqfuLOESq5QQ6KnA9UwNYbyBiaQoLD5w/p Q7hg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=fB287GXk; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id g26-20020a639f1a000000b005694e223cafsi3484456pge.182.2023.08.19.11.45.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Aug 2023 11:45:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=fB287GXk; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C2AA5207D4; Sat, 19 Aug 2023 01:26:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344022AbjHPPKW (ORCPT + 99 others); Wed, 16 Aug 2023 11:10:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344042AbjHPPJ5 (ORCPT ); Wed, 16 Aug 2023 11:09:57 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2078.outbound.protection.outlook.com [40.107.7.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 142191BE8 for ; Wed, 16 Aug 2023 08:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Le9045jElWDDeaeoTnFZR1wHFWNNLgsf/TML8wh4Yktzvmtl6pBfX4HUMR1DhiDR3wwGVF6htdEqtPiw/CRacusd2daHCrQtsZjzMgBHrUCjqjYbdGSHTZftJ79+Zf7oJ82f0yGwYjG468NUFzkOABn9KBJNTifKcMS3CCCIOuivsLurIIFkRqZYIdikBaw6CwJf64lyy0yvJgAl9hghLkSuKQ5jubHR5gD3Mn0SdkDws9ez22vj12pKcT/mHgAg+5WWyyghpAbCiAUb6Qa+5194w2FwHM7hJhqrVp53ICOi89xvixmMCZI2lW/tGYTZ3OdzTSLuoF9tAi+CrZcQWg== 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=ZO8Pw7dftjVj1fh7Cws008FoAT/bdgZLUHoJRZDJoSw=; b=ob/B3gJIe+oK5HfEE4n8OXK289sY+u00tss2cJe7GkVeh+GEjdPs2w4PNnL1MTQpR9mGLeVechBWttf6xKWXWgeGfq2h/70RfU8ZoDPY+doBRgXLwQFp/zjONtMRmQIfSrvWvpU+fiiYzQiEvyLha/hKQVx5xCLK0u1wjAg1TtG+3pIB7YRGV5Apignwdfc21IHQP2DyoT6+ryVB3n5dXhWC1vHw8aJKbmKbXb3SzHvb6J2w4jeH7PB+mIJrwWFR5Hy7Z+/g5HlmNWJeMvKeb77CugL/G6eaclAaZNBoFC44FHawg1QuFYedrjLRWizXuuCvn061ARXVHi1mClGAgw== 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=ZO8Pw7dftjVj1fh7Cws008FoAT/bdgZLUHoJRZDJoSw=; b=fB287GXkpQ8dHvKuSFA/oiFsGJjQIos/XnynVm//gfiguurZuVRGqVPhukVQdTIOYMPSLdEecqMqoOfZffn/8mWjGbdbaS7SCi5sGZoZVWVTchk1x9nsNE4VsV4XriQEZkC2PRk9jELp1GQg3Am4zOdyuog8b6n7AnUN6jUMvh0= 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 AS8PR04MB9189.eurprd04.prod.outlook.com (2603:10a6:20b:44c::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.29; Wed, 16 Aug 2023 15:09:41 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::6e75:56f3:fc37:277b]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::6e75:56f3:fc37:277b%7]) with mapi id 15.20.6678.029; Wed, 16 Aug 2023 15:09:41 +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, Iulia Tanasescu Subject: [PATCH BlueZ 1/1] iso-tester: Add test for bcast receiver defer setup Date: Wed, 16 Aug 2023 18:09:17 +0300 Message-Id: <20230816150917.7896-2-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230816150917.7896-1-iulia.tanasescu@nxp.com> References: <20230816150917.7896-1-iulia.tanasescu@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: AM9P195CA0009.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:21f::14) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|AS8PR04MB9189:EE_ X-MS-Office365-Filtering-Correlation-Id: 3cad8d9a-d828-4298-e2f2-08db9e6ad117 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 41wQcuSTljqqu9cn2gV00WrWWxPGsX56FRen29Yk2Nqp1HCJl+I2UEyPyxEDfNm0Uj0HGF+Gvd2Hp9SNAdgumwRH04+D5Tm7cC+SBnKrMlFKw/z3g9fKpk7QONB1FLgqN/xfdoOCBYD3zKZTElocJmd/5G1lNMa2HxpbmWYQ+LoD/cj37tY/6ZnpqmpYHO5uZGqlNmPY4N4Mz2DpQdaVLeklL1DNx+PKGrxM3rE/leOkky1DMzLzON5xeOH+kpZYuesinXotBgvqJrd78q0051HzN6/MJyse0j17BUpwYnzC7ytT6bC41a7r2IKxq1EkGrMEfMAEV7P8epVWbKunVJbV7EHmoEjRlYgEi/luP+stEYXYLtAxv7ydViRIaumz5jPjx1mxno5OjoVwmaDCMVCUV3lp0Jpn+G6K7xwj0ApJ6bZBZDUzVMsxQjyuTqIb+wXQHZstp4ztUFPTCGXdMTVRibtX6bi6elZOKer+qpOiT3IIXP1lRnlDXNulNUIPDJtmQ6yeMN2iODzhKtn3NceadvDFIuZqDUdrnYOFm6Dh+ZvytWjlUQTtZNOsmRnUGDyr6m98BA40Dj85TT4xYKAI6NblMfJVJjM9zyAJ//kIu8dTxj+iL6EYtYoJwL7t 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)(396003)(39860400002)(346002)(366004)(376002)(136003)(1800799009)(451199024)(186009)(316002)(6916009)(66946007)(66476007)(66556008)(41300700001)(5660300002)(44832011)(38350700002)(38100700002)(8676002)(4326008)(8936002)(2906002)(83380400001)(26005)(478600001)(86362001)(6512007)(52116002)(55236004)(6506007)(36756003)(6666004)(1076003)(2616005)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?xGA22TZYrJ4xXgR8juOfwN8UQmuDF0sNJCOfZJC0cbD67akGxzeJATMDBSAa?= =?us-ascii?Q?vWr+y1qNDfCclZ+jtcEMr5KrDQ6jBp5UfK8TlC5Fty8+VtqO+51QbRgwp1YW?= =?us-ascii?Q?el2HZ15XGlHJ/hWl5PrdbcSLNZh4FWA7Rf4WRQsKhpU3LCy0P9vNgZ0janKT?= =?us-ascii?Q?3Ign1YntbrADFS8H5NRJXxFZ93Goyg4KgO9ERR0QYUGvgo06+EVPt2wLEZfS?= =?us-ascii?Q?qkQR84rg1/QOcLjHvkWLHdXYqwn1lbI2RcZz2+W5t0AOttfyEUKFkz2FOC14?= =?us-ascii?Q?HlW2Bw2EL8gSRb/aFWkwAkdUT+Qg6cTFhfphBk4BmtqhKZ3JPpXn81+NnZBG?= =?us-ascii?Q?9hLPyMeWplU3D9bTBpg3iew/0Av76IiiwiX1KfU69asFnSubTwS30E/Ch58k?= =?us-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iEziwM6HIuzb?= =?us-ascii?Q?OySlZco7zGpBtXD89n5dyMxuUp0WPRH3QByCA7hC26BrmSx0vvjZWeL5NIFd?= =?us-ascii?Q?rRW7mK07tJNoaRp/dUT5E8MzzkPIqqyGGW/ElQPIil0ZZSE3XRvGQCRndvJb?= =?us-ascii?Q?ThzoHzf1Zg7CSsYEzvjiHE+6vLLUNm0nw6zcfWqq8S9fI6yYrp55ZtXi2CRe?= =?us-ascii?Q?qbqmEr0jYnRnUTZfw0XN9BmbcYPUiiuZDe6+ghGp5RZxyji/Q9XrH11aGKSP?= =?us-ascii?Q?0E7qzqTy65B4wbwxdB98LbVHAZJu/yI0hER5Bu2eqDHhI1y9Ds+YW+fcciu1?= =?us-ascii?Q?Xg=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3cad8d9a-d828-4298-e2f2-08db9e6ad117 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2023 15:09:41.5759 (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: dcCkPWBBnqR3RhjRcZk+Rtf3m8VIBu6ZDDtGJXWIda0sMy2FEyoEUd7356ioETogOo4BQresjf8R8yQzKwuw2w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9189 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This adds the following test to validate defer setup support for the Broadcast Receiver scenario: ISO Broadcaster Receiver Defer - Success --- tools/iso-tester.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/tools/iso-tester.c b/tools/iso-tester.c index b1a2afba0..d5d2284ab 100644 --- a/tools/iso-tester.c +++ b/tools/iso-tester.c @@ -1134,6 +1134,15 @@ static const struct iso_client_data bcast_enc_16_2_1_recv = { .server = true, }; +static const struct iso_client_data bcast_16_2_1_recv_defer = { + .qos = QOS_IN_16_2_1, + .expect_err = 0, + .defer = true, + .recv = &send_16_2_1, + .bcast = true, + .server = true, +}; + static const struct iso_client_data bcast_ac_12 = { .qos = BCAST_AC_12, .expect_err = 0, @@ -2341,11 +2350,15 @@ static void setup_listen(struct test_data *data, uint8_t num, GIOFunc func) } } +static gboolean iso_accept_cb(GIOChannel *io, GIOCondition cond, + gpointer user_data); + static bool iso_defer_accept(struct test_data *data, GIOChannel *io) { int sk; char c; struct pollfd pfd; + const struct iso_client_data *isodata = data->test_data; sk = g_io_channel_unix_get_fd(io); @@ -2368,7 +2381,13 @@ static bool iso_defer_accept(struct test_data *data, GIOChannel *io) tester_print("Accept deferred setup"); data->io = io; - data->io_id[0] = g_io_add_watch(io, G_IO_OUT, iso_connect_cb, NULL); + + if (isodata->bcast) { + data->io_id[0] = g_io_add_watch(io, G_IO_IN, iso_accept_cb, NULL); + data->step++; + } else { + data->io_id[0] = g_io_add_watch(io, G_IO_OUT, iso_connect_cb, NULL); + } return true; } @@ -2400,6 +2419,11 @@ static gboolean iso_accept_cb(GIOChannel *io, GIOCondition cond, return false; } + if (isodata->bcast && data->step > 1) { + data->step--; + goto connect; + } + if (!iso_defer_accept(data, io)) { tester_warn("Unable to accept deferred setup"); tester_test_failed(); @@ -2419,6 +2443,7 @@ static gboolean iso_accept_cb(GIOChannel *io, GIOCondition cond, } } +connect: return iso_connect(io, cond, user_data); } @@ -2963,6 +2988,9 @@ int main(int argc, char *argv[]) &bcast_enc_16_2_1_recv, setup_powered, test_bcast_recv); + test_iso("ISO Broadcaster Receiver Defer - Success", &bcast_16_2_1_recv_defer, + setup_powered, + test_bcast_recv); test_iso("ISO Broadcaster AC 12 - Success", &bcast_ac_12, setup_powered, test_bcast); -- 2.34.1