From patchwork Mon Mar 20 14:37:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13181325 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A84CEC6FD1D for ; Mon, 20 Mar 2023 14:38:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231588AbjCTOiM (ORCPT ); Mon, 20 Mar 2023 10:38:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231811AbjCTOiJ (ORCPT ); Mon, 20 Mar 2023 10:38:09 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2057.outbound.protection.outlook.com [40.107.21.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6524B27D61 for ; Mon, 20 Mar 2023 07:37:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eWgL6na0Va3EwKN+6oNBF3AEIta0+6oAN1h+z6f2dRP/nrkc3YNESHxIK3DPyiLAbYAsTc+d1xGcGw7RlQjTf62IEqwtPbovv+AGAYofBXzpQ5kdOLPR3wW+DpVIB2Erp45JdbxKd0tDdHX63poPxSZ1R93CPEhoozlLRW8mM+EVabQ532sdWs8AkXhIZTbj8DFFmSlHapdqTX28z2wKUWtdkzqYpYrQ0QHYmORFuWiXfahGIKD0U2NxBJz+059WEtI5LqjnTYWy9Qqc3VW5C5q4gwTWjmF1kWG6tfFjWgt7BqAP3KQ8mD72T2uFsutVef4P2vKUKwzfgSpSpYC+9A== 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=2LsbZsCo2JAX3nycrmH4HBfYMOxjeY5Mpw93XPrzqnM=; b=UVTCXh3B3HR8dAx66GEgyjy5mj3j9jxZcO6sf5ipWCtCjMOk3zIslLgPV6GFT47ZbZuH1E8VeFD6o3gU9WudRsRfPIuor6bHWRjno7t9Yc9DEgNiOGlh0HG4qcU0J63eBPLvABLcfcS+pAVH0aOJZwo9/ljZBN1WaagnzOJWtIJcPUr8UcZo2z3zfJHCIOQbtuiM+Gm740YVewTJJg3lcWF6zqYadOLX/5NphEi3TSN69aJKDxZXzD8ZnM/nJaorPHwmiROXeOoPZo5w0+JbhGIqO2AlXRAxmIqnmwi3KomVxSfn6F0vxh6garvZvFIXzb3q6XMRh8hOAX68JM6u4A== 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=2LsbZsCo2JAX3nycrmH4HBfYMOxjeY5Mpw93XPrzqnM=; b=ToRN1zSKKcBaWi9W5Lr9K7T2iQReN2aqT6hx/thzbIzQ5uqi19uTkbwnad0QifOT5TiOE+WHrE2y8boN0h+xRayQHjzFU5DfVXjfg/DAHlFEpqkwQvfS/nHMErdfI9LKeGwD8qwhsh8QSRelqsl2Hi8P4GRqUHH3TCzs4HjLJHo= 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 VE1PR04MB7231.eurprd04.prod.outlook.com (2603:10a6:800:1a9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 14:37:32 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98%8]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 14:37:31 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: Iulia Tanasescu Subject: [PATCH BlueZ 1/8] btio: Use unicast structure for ISO QoS options Date: Mon, 20 Mar 2023 16:37:06 +0200 Message-Id: <20230320143713.25449-2-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230320143713.25449-1-iulia.tanasescu@nxp.com> References: <20230320143713.25449-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM3PR07CA0147.eurprd07.prod.outlook.com (2603:10a6:207:8::33) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|VE1PR04MB7231:EE_ X-MS-Office365-Filtering-Correlation-Id: 3518510e-b032-4ee3-52f4-08db2950a355 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lLEyYjeAW2rodNomWB1GHgXub/vyICzE/bXUS/JgRhwQ9jpA9sZNIyYHGWFLLUPy2J/IGudVvyjJvoso5cLfyKQLPfoD3B51p0G4HL8EBXK1aEakjSwoGq9M9da3fD+XSvxnRX/0omLAfPyOamgJ8MeffQhetHv9zwP/ZzhMNW/jXWGDRrPSIVywzy9K3j6LEAHujNdwZEyxOkOMsEZbBJJS2rzEVx6a5cORsdqQbBZmAAFxd0M13WxFsPdOWpXBKiY14drWyFnrst2/pdMr657ytNvFOI15r7VSqXMYRJJBVbRHrAt7hzLia52torLrJGAgb/zPviwnKIJr8bjNjntRgXgh9x06Ac1/4Lc9lqHUj050uiwOuoPm77/gQh8odyk8eUftf8XOSCTWMtXHI/cZLA1FLK4gNNORZ8RUA4wn0mMM1o87MWx4kENcnIaj+YhJ9Z8ED9Ar+0bCb+r02s7Y6bWzIvVG6TeRsUnrK9wbUKpPUKVtJpN/mixyj3LVcHjFp9BowCJN4ah1HUxDQB2wZ7y3d5TmzegepLyDds9TUm4yXzzKbEFgLLnvgIlc1mIYkD4tRFn75vz7E2rW2VEMEq97DrCjAJC3gWP2znAeaq9K0qD/NvEhUvrtEyQIBDa+vQ5IBXkKhifT84nCPwAnkQnI33rFVCXAMH7CSkePUBasBCmViTs8DfT//hDJ0gCQyL8ztKdEos0clOKH1A== 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:(13230025)(4636009)(39860400002)(396003)(366004)(136003)(376002)(346002)(451199018)(6506007)(2616005)(1076003)(55236004)(26005)(6512007)(6666004)(6486002)(8676002)(4326008)(83380400001)(52116002)(316002)(186003)(66476007)(478600001)(66946007)(6916009)(8936002)(5660300002)(44832011)(2906002)(41300700001)(38100700002)(38350700002)(86362001)(66556008)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: yfv8Vr++0kDs4LNAl+qHAC7cdR01aiaFP1hjxfpASF3DX15+9Oy7JQCPmtSlCUsBIerxHv2e0KF2G7+mfC4hfpXJu55ya80A0ZhPnfJZqaxMoKappMhPyKuy8muOygxlOXVtPbjC2GtqOEfLWmp0fGg/wMnqKww4NV7hTrOZwnzGOylFrdpLIvHKtA859JTKMHq3M3s8O78iveRCuPXLBJn64jxXIegzSAE5PNnzxHIwrYPqbRGdfxUzfTFEj+OytfC3QatRvKKbAcJqz1pgX1gKQkicyXoQt/xtF4TstqWbMISqYb4quGsw0r/dcxN3v3kNpizsTOM9kbFdKPTq15GdgJaIgcXmYKT9jmLasd9P37aqKZ4sZxOu/kOlF2zOnpTbCcCtlpsEIvOqcHQaH9bzPjoW03mq/CT/GqciMPimXoani1g9pTeLkZpp11cnVPQ3z+wF2W8NoGzvyerRejeFwz/jW0m7Xrg7U0bjrZ5w4KlpuAQrrVaHpgg7zYXqz/3cceqa7r8i9baMyhvqh0Z5htMzfwtaPN4TZtYrBv/4WSsGOHrHxAQTnRZ+JpAQE1CPvnngxlZMrz097+6ZmObMqLVoTsdrJ/0wp5FaPs1RFaB8Mil6l9N2U2kEgIQizSO9jQHKif2zSq4MXMxNPljfAFUlB51TIrMKoUfvupFQJYiFygg1exNLFn8z9rJ5Jx3QvpxTZVMCFdPaOqBf+o5IWn29BGA2gLJxe9bhlrYm/avGmhe5ysujGaK77cwhFCNi9QJhDfvqdEDK9Kck9ubfUlIzXOO+p35Yf5iGm4v+fxWARc1J2Oqu3Faipd73VlJ91LJLlv3nU20uR+ywQVELZFO1jRWr9iAlwyMAUh+66YNr7DBX5UyLeiF0GFGhmHZZENxShKIhwXICRCZQ9ZjfaVC93FYgTeOgrznQP5BgFJ+S/s+JxuuGnmEdPO1QunN1ial3YjV/WxqQSFMrEuZZRp7kSiUyvJ4qLBcaAYRnK3G/+rWI9n9h+uIwyJ2WpMbtDwQCx1FQr8LUFVk/YThNGM2EZiXiuYAgEREdwyiYBscstjtasaBSsWvOKMsNgsem64QTN0GY1Ag2KIq+RmqeMAVkkfoVdBPZ4WI4k4p56aG1kk8r9UM27kCsWeMp29yNBjKWeFvorwqbydHi2P4XpeY4KRVI65P0KANpczINzKwaQOCrNN/Q/YG+TePlRygESr+IzsNQ0+iq3W8JtFEP5zB9Y4nxgFIfl2zWcDvTHBURVzaU5dllmRk+S1U4VxHnKBD64SXsCrx7iOQRgjQE9Uud2eQXrTdhi3I17G3hYY45r4a7WiZpyLMQw+7R+YNfrm//2EH30qQIMEDX5l7RsBV8HPN9dMmODeeiXzwJpD4+fCJOOzdn5vt8RjDSFMYBR9kEQJhN4zdxWo0+yGRx00h3bQej5VRZlc9bSaPSE4Q07EmIo5pQ9HZZdgVU6YyFR5ufi8v3iNV+eouDbbPepjfFPF/CGwNSt4Lza7gp0Xbd0NtyxrkW8x72+uN26lJL+b+XgcMd+/dnQKHig9S7EZGDGtojsUwBcpxqIjegP32eq7ursPsNWTjeedKKj6Zz0KTBF97xi5Hs06rbZw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3518510e-b032-4ee3-52f4-08db2950a355 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 14:37:31.8238 (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: HPQGRBTCrvp9jcH0ZxL9eIcGzx+0vy0s9Ptzdoa1CxWFnYc/n7GWF667bBsVcUjAkXglZCROTjI/A+WURNXbmg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7231 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Convert the generic bt_iso_qos structure into the dedicated unicast structure for ISO QoS options. --- btio/btio.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/btio/btio.c b/btio/btio.c index 1ad42728d..017b53a54 100644 --- a/btio/btio.c +++ b/btio/btio.c @@ -5,6 +5,7 @@ * * Copyright (C) 2009-2010 Marcel Holtmann * Copyright (C) 2009-2010 Nokia Corporation + * Copyright 2023 NXP * * */ @@ -68,7 +69,7 @@ struct set_opts { int flushable; uint32_t priority; uint16_t voice; - struct bt_iso_qos qos; + struct bt_iso_unicast_qos qos; }; struct connect { @@ -857,11 +858,11 @@ voice: return TRUE; } -static gboolean iso_set(int sock, struct bt_iso_qos *qos, GError **err) +static gboolean iso_set(int sock, struct bt_iso_unicast_qos *qos, GError **err) { - if (setsockopt(sock, SOL_BLUETOOTH, BT_ISO_QOS, qos, + if (setsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, qos, sizeof(*qos)) < 0) { - ERROR_FAILED(err, "setsockopt(BT_ISO_QOS)", errno); + ERROR_FAILED(err, "setsockopt(BT_ISO_UNICAST_QOS)", errno); return FALSE; } @@ -963,7 +964,7 @@ static gboolean parse_set_opts(struct set_opts *opts, GError **err, opts->voice = va_arg(args, int); break; case BT_IO_OPT_QOS: - opts->qos = *va_arg(args, struct bt_iso_qos *); + opts->qos = *va_arg(args, struct bt_iso_unicast_qos *); break; case BT_IO_OPT_INVALID: case BT_IO_OPT_KEY_SIZE: @@ -1570,14 +1571,15 @@ static gboolean iso_get(int sock, GError **err, BtIOOption opt1, va_list args) { BtIOOption opt = opt1; struct sockaddr_iso src, dst; - struct bt_iso_qos qos; + struct bt_iso_unicast_qos qos; socklen_t len; uint32_t phy; len = sizeof(qos); memset(&qos, 0, len); - if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len) < 0) { - ERROR_FAILED(err, "getsockopt(BT_ISO_QOS)", errno); + if (getsockopt(sock, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, &qos, + &len) < 0) { + ERROR_FAILED(err, "getsockopt(BT_ISO_UNICAST_QOS)", errno); return FALSE; } @@ -1624,7 +1626,7 @@ static gboolean iso_get(int sock, GError **err, BtIOOption opt1, va_list args) *(va_arg(args, uint32_t *)) = phy; break; case BT_IO_OPT_QOS: - *(va_arg(args, struct bt_iso_qos *)) = qos; + *(va_arg(args, struct bt_iso_unicast_qos *)) = qos; break; case BT_IO_OPT_HANDLE: case BT_IO_OPT_CLASS: From patchwork Mon Mar 20 14:37:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13181326 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E071C7618A for ; Mon, 20 Mar 2023 14:38:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231846AbjCTOiS (ORCPT ); Mon, 20 Mar 2023 10:38:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231810AbjCTOiP (ORCPT ); Mon, 20 Mar 2023 10:38:15 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2049.outbound.protection.outlook.com [40.107.21.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9C0B28D1D for ; Mon, 20 Mar 2023 07:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oA5NL62NhWlwrsGEntdOFLTeehMKVMN8ryNOOq5e6pr1GXzzBlgv4LYLznPVYRle4sizVeoKVxFOOOaqLhDXqy3nP/TEbnt0+neOK3M9mkkrFVC5bZJLLh7KurnyGlHOVqdIw5OViMUz93DNiDSft2HPTMj0Rdt7WbDkvld5XVdFqkDvWGsoxZ8ZvAqBTV5izChsI98VMCWvzy6NbDNOkSVLpxLgtT3wkEbiiTQbZpxq9ikDL7CbYDhEgq3uGjETRkp+bQaRouVEyYK+AOB+bIYl8hOBIR67iHgvJX1RrabVSt7gfk6A72ozIjBcZnC59W65CwbVr+KOmX1WpuOgPA== 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=cEiqZo+mSFJ0XYUj1u8d0Dphps7jH4PyC6Vsutp3MgQ=; b=cMvpnT5TjYeOSAnlpUw3zkQEtKqdPwnaOBM//+eaTVWibipgbvx7+SEu/+iGVAh4Iruy0poOsOL3EDAGjdPIrk74rR1zN1sBxVmzmCZtVNjjwGqhzAW+FV98422FZKaYP3yHh4y+isUwgFFknTlr6mQuIA5/l+eIgEfQN9kbgfHFHpSV3GQPCg2SWv+2aNqV+z5iycGP//1fAFx66b0KrKh3koeulIh+RgpcBHdcMV+FSCQ2o9hXjPP/YtJI3Ms6CLpwqZlCD6yon9x+4nu+P/Ds+l7r3hf8fQJUeQ5hSPpSoJYKzV3BQ2DqgU9ctOcMQydNCw9XmcWDdNiPC0G2sg== 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=cEiqZo+mSFJ0XYUj1u8d0Dphps7jH4PyC6Vsutp3MgQ=; b=Em2C6gTGKTN281LOfoF37PuHJXQUI8fGLG04oMvJmQ65QXhS9fe9ul1cQzhsHFKg63J+ao1oh9OOEYbSw0V6lO/c55w+VkCy9LFXOrTMVyLyHsGloDQfZhlZOzXrvZmLkipI0TpDUGCSNSaYH/3ov5uc4NJBny4zYoVW+WJqtsI= 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 VE1PR04MB7231.eurprd04.prod.outlook.com (2603:10a6:800:1a9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 14:37:34 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98%8]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 14:37:33 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: Iulia Tanasescu Subject: [PATCH BlueZ 2/8] client/player: Use unicast structure for ISO QoS options Date: Mon, 20 Mar 2023 16:37:07 +0200 Message-Id: <20230320143713.25449-3-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230320143713.25449-1-iulia.tanasescu@nxp.com> References: <20230320143713.25449-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM3PR07CA0147.eurprd07.prod.outlook.com (2603:10a6:207:8::33) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|VE1PR04MB7231:EE_ X-MS-Office365-Filtering-Correlation-Id: 8063c225-00c3-4975-a56c-08db2950a48e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RJxW799H0WGBGhmcb4j7Hn9mp328Ij38/Dj6FwZtazAIY7aH7mZzDShArKk2McJG/b+MnbRoKGYN/s9qLXY9vwb5VgO3OV3cLzbR/YkK2IwohomztkyNr74ownIwfapPZFHzJdW8R7iYD75L8u5f18OtyBfCYHB3sPwvJEDntkupyRnAfVa2aZKHSx3KaWUtxvzRcQsVykQQs9YW2ZZw2cF2O/OeFmVViBZjtN2/6a2OTMzl46fowpRQvdomcHZChMlLXQTJYGcPr6hV/hbWbBRm48jh0nQMG4Ay2XXdhFAQftVViD/Psp70UkqSm+ZcIi9UXgcaCuYzKqZ7+cnl14E2/7aIxl82UufhTWA5KlcUnLB/TvKgHQSk80NgLOhxI5VUgiFTl5V95o0Hkwcl5lblxFBC+Dj4F2KYU5gl6hUJ5x3AmqsAeVDpYQq5HC/94mbFLEz/v6R1qFZEyjyLdGzTPLjsNccZl4bzrxfnztvPZLSvTvvMeuRR4Sgl4QRIlnbM96f+Ef7cjvwOZvmrB67hb93DOQ6/JwZdNHs8+jdtqC32gBYD5AhYLrSh7Oh6tYagoH+RR6gXOugOZxVTLSrBCWtPqx/Mdo/FcYK89gcRalMaxYFz0cofHb1ofa+SIYil6UBWBmdj1hE6o9vHSWXsDRCgHwoCbUgzx7AmNAJ01gtX/h68FZ8GuSRPLqN/gtFJs//ajDom03WEJ9fcLQ== 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:(13230025)(4636009)(39860400002)(396003)(366004)(136003)(376002)(346002)(451199018)(6506007)(2616005)(1076003)(55236004)(26005)(6512007)(6666004)(6486002)(8676002)(4326008)(83380400001)(52116002)(316002)(186003)(66476007)(478600001)(66946007)(6916009)(8936002)(5660300002)(44832011)(2906002)(41300700001)(38100700002)(38350700002)(86362001)(66556008)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RkLb1ppM7pJbK6DRe3BbvGw9Npez1Wefz/VGjg/NfbzP7BkHd4SOLtt/FkZPlS074ERbfu/0TNEEov4Ih6nIy4SdbdkwMrTNNewMIu0g75r3Sd/cMXelPtKr/VoZUkx+KOO+CT5tumsQHF53iBZdMICaik5632fvxi8JgurIQYWtyNbnh6KLHL13em7kdQxqsu2kmN3C+wMBdjCcB7aTUr8NW8u4jei9i4tsJ1/68Gfus+YY4VHFWrOCFx82hNBiLripR+u0OSlgBCnoYL4sHaOtkJrPbuf+dwWhloFkJlQdL0sCjItS7SaLzwENJVDU+ZGXRENGOlesAOHxUw+9lL5UmmsFws31s0WqvhEsP25kRoXH56th0Dx3IbjY5DEa4xqN8OtvzJEmmCpSei8BF09ZqBbkwiqHj+Ul31dWVqCDQypghm58UbuXPh71VG7EfeQWpkwyOb8rFYUnZQn4gG5UoFlhnf7c8Y2kw1mtyQk8asgu7R264qKRNnuI9bMK0b9ngmG9mzU+KUaWQH8tOCDXq4OoEsM2IaxEsd+1NdmsULUCf9Ag4oms+t3+HYZIfR0ZN+ou/nd7crG3y957uh57YAmZqme/w1jWFw5KvOHOZE4xmZo88okrlvLVupJTlf3GNag8N7pWyMuNGWSFRe1iELWjz+vEVNnr4fqDG/JNgdK5ZEGiJKFcRPRJTlx9W3eeaa83TfEgi+LROMMhDKiBsuPDSPJexUr2knXslPnv/hOz+/20nJJc/iRE0qO00jeV7ixTQRl38cCoHWL2FDNoiD2KRAC4Ow+kwmum+cX40jwC3Xl0uHikiEFFIw/nDyA5JybwdSiqoyhN+TE16sgEYHQzBd/m/DY6+jeBlVp8w1fwaWww9GR9fvCejs58B39jU9xRjMe0e6+7kCK0BcBkBvRDpic7ac7QRQ/0rsfIwQxhz7SjNCLGVQjQP90vyLE9NVhS86Lkd93qkdvDmbWzyt6Bec8IGT+BNgMZ3Hb2lr6HUf6RIdq+0hN9KMK+Gm038ryc1Vny3b6JYfQPjIhUYDzl0Ulg9s0aESpbsyR/DP1UP75lKhxe371/h2En/HM7m3dCnkD57b0Lu72KkTFRY+vPyAg7m2BPSKL0mzvH3SA7PORKb7v3BNfTLaQnlIc10QWPziTeT5DdwZ5TPFbrtd1y0acVJErJsvaehcAm9r6Vfvbg699786KdqypTyXyC3nR6SbyeJZ+TmMli9GU9+T1zGlLvXEtKeaMIttXBPInh5VETy1Rq+1x/dfH8pvX+g2fDNbMizzGuvlG7HytFOwuXmKVNg6bdGftKJ/GqT4KAAocXvEf4Ws09WL7+3rh79O7O+6tP0+OBESWW36SLmGU0Ats0dP8hs1/wMUovJbo7tJsuM+G7rImS3V3y9P2KFcflSGKWANQh6Md8KO7X2+vD9Ce5HNinGWuw5ctnhHVfgJcxbHKWR6VyiQ5WywTzJlrmMIj1q1nWixSqT2jI8xxIWFc6lKVoj46ydhCXcgJ6ONF13YkxJj+vdXo69aScv/mNPN6NBJssZL3hXdzZaInHX0xPUjpBw243k0LZoZ6/PyPGCOv39X4Fon0Ju6/TJcENRyZq/JNzqxyBTQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8063c225-00c3-4975-a56c-08db2950a48e X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 14:37:33.9085 (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: ERS63nKSJhhtgnXusS+EVimtRhanU5t3cdnjG+WnH4NVkGecsm++7sHjl94z4qVSKOjxMF5cWhx0bsX3uUHsFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7231 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Convert the generic bt_iso_qos structure into the dedicated unicast structure for ISO QoS options. --- client/player.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/client/player.c b/client/player.c index 63e11db09..83b6092a4 100644 --- a/client/player.c +++ b/client/player.c @@ -4,6 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2020 Intel Corporation. All rights reserved. + * Copyright 2023 NXP * * */ @@ -3506,7 +3507,7 @@ static int transport_send_seq(struct transport *transport, int fd, uint32_t num) static bool transport_timer_read(struct io *io, void *user_data) { struct transport *transport = user_data; - struct bt_iso_qos qos; + struct bt_iso_unicast_qos qos; socklen_t len; int ret, fd; uint32_t num; @@ -3526,9 +3527,10 @@ static bool transport_timer_read(struct io *io, void *user_data) /* Read QoS if available */ memset(&qos, 0, sizeof(qos)); len = sizeof(qos); - if (getsockopt(transport->sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, + if (getsockopt(transport->sk, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, &qos, &len) < 0) { - bt_shell_printf("Failed to getsockopt(BT_ISO_QOS): %s (%d)\n", + bt_shell_printf("Failed to getsockopt(BT_ISO_UNICAST_QOS):" + "%s (%d)\n", strerror(errno), -errno); return false; } @@ -3552,7 +3554,7 @@ static bool transport_timer_read(struct io *io, void *user_data) } static int transport_send(struct transport *transport, int fd, - struct bt_iso_qos *qos) + struct bt_iso_unicast_qos *qos) { struct itimerspec ts; int timer_fd; @@ -3591,7 +3593,7 @@ static void cmd_send_transport(int argc, char *argv[]) GDBusProxy *proxy; struct transport *transport; int fd = -1, err; - struct bt_iso_qos qos; + struct bt_iso_unicast_qos qos; socklen_t len; int i; @@ -3626,8 +3628,8 @@ static void cmd_send_transport(int argc, char *argv[]) /* Read QoS if available */ memset(&qos, 0, sizeof(qos)); len = sizeof(qos); - if (getsockopt(transport->sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, - &len) < 0) + if (getsockopt(transport->sk, SOL_BLUETOOTH, + BT_ISO_UNICAST_QOS, &qos, &len) < 0) err = transport_send(transport, fd, NULL); else err = transport_send(transport, fd, &qos); From patchwork Mon Mar 20 14:37:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13181334 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3881DC7618A for ; Mon, 20 Mar 2023 14:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231861AbjCTOiw (ORCPT ); Mon, 20 Mar 2023 10:38:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231866AbjCTOif (ORCPT ); Mon, 20 Mar 2023 10:38:35 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2057.outbound.protection.outlook.com [40.107.21.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3934252A6 for ; Mon, 20 Mar 2023 07:38:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eRXom/yh7d6I3SCLBpjTcijloEq2Fr1L1QI2WPdKHeDaS5vatCB9r9SPPuUeAA0UoPrIU5gluEDaN+Q9JEdKOD7xDUmQMZrYh+LGaa3rN6gNaTuxAwj4No6B/EwxiRWqJaVuKBYxAUTfr9XMkzEcj4TaJTEVzlYd7dj96aUH2FsErmZ/Ru0WBSrsyhcdMFvoXG2lbq2wBgwfz3BAivoJjmlTLLdVq5aZDlpHOjruaaeSisKMX9kmGULHzxcqrw3PgMDJHrKNPuGHJ0fDrAWPxn+v3aSPDVty7paQ5SO/KXpst1+YdJisXBSS6eK4p9GNQcQV0CEPecg/fsvU6o0afQ== 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=WqmMZmWDKsZfMJW7NK5LGUZesJaZTR2T9i8SorsNixE=; b=DiT3H2dPzKfz8RYFroNfKMWnhn687FnMW0eZpxvWs41HkfNM5xEalzLXgVS9OvKGvfi1jhFv5waJtHaH3a2Th06joTyNO20wHN9Ag6Jx4f5M42qhZdDnjVkdzB0sGrQXPORt6RVLUSydjoRGqO5rkyFjBnyMsEZAj4IAbyUR7wch6jr+oHTKXgGMwIKA4LEAHlytlNPr0cmjrxrGcbbRcw+A/26o4KMLbEhSWBa4bCEyGFZs+vm7T80Se+mqJZR9xNUCd8LjMCMolp2N5RhsiftSxoryawPUBfT6Cy/KVGsC2dk4/bONTHNdVTYNSMuBY31y6Jcw49ioPF+7YRF4zw== 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=WqmMZmWDKsZfMJW7NK5LGUZesJaZTR2T9i8SorsNixE=; b=LqKyrQgH2oPvoSIl/DL4olWCH3KnZhhXwT9skfb2MjQTzCOA5ZUhWggJG7GC9zkYkoOYOPpGSoUGdgED91OJoqRloQH1scq1ToP+ddUSFaF2wXUu44cSSrKz2oyIuSrSjXu53SSO41KjpWQZioEq2Xj60H466bO3uWFK+3QcpfA= 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 VE1PR04MB7231.eurprd04.prod.outlook.com (2603:10a6:800:1a9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 14:37:35 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98%8]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 14:37:35 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: Iulia Tanasescu Subject: [PATCH BlueZ 3/8] emulator/bthost: pass unicast QoS structure to bthost_set_cig_params Date: Mon, 20 Mar 2023 16:37:08 +0200 Message-Id: <20230320143713.25449-4-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230320143713.25449-1-iulia.tanasescu@nxp.com> References: <20230320143713.25449-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM3PR07CA0147.eurprd07.prod.outlook.com (2603:10a6:207:8::33) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|VE1PR04MB7231:EE_ X-MS-Office365-Filtering-Correlation-Id: 362cdd58-35cc-492f-c5d5-08db2950a5ae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7FYITG6NvLOUmPVT8GzzW3aYR7hfe+Dowky+WO5nmEHOLH3vaRlLnOVKHlj2PwTw+Wdt31CbqCPvanVe6aYcB1oQbQcUwvYoXIRe1IfGtSxdM3esJFAGrxaa/lrXz1QD4kM4Gy3ltre7+Nye0UJSlTbQg5mofmVpPMqEDs/8gKAoJwcz6xhJksFfAtmm3M6VHP45umVV8TqT20gghoVotYYJDSnYl8PvR4/q1bZv2sAMI56FPE3/BG/wUu8QV+bMBsqGUctgbG/S4EV6fz/Wtao9LcqWC1skA6IcgVxwR7dp6p/fauPNA+ZS/mrSMNvA3lFM3aQJ0f/BbpCKouruKqK9xxeRW0mHUCQaTCGTPXwR6h83MK/+QL09sCyfhh9kyxuFUxFIFt1PzyNMho1dldGA+oeWHiwk+nMtibU/II1sVxLnoik4+pHXW0Mnq//u1BALXhNDMnKAXMd34cuktesfucgcmq+f2u7VWOXtnE7H2Wiue/cqqJxt3FN2NMvt/3YRZSAQcYgQzfZmSN8wuYS8/NwbiujckZLDRuduznhliIQBXAqV0tQJnmOcH2ywGbu8OZ9TDUTQbZ7C6lbmYi+xRDuM03MDYkXDtLJNwWxO4LvPW/RUHfCtlgFuUx7YyY5ifWnLkBjHnmG2qQT3Gq4jJeSEUMCrheZRogU1VtlyR4EaU+zBlniVyVu6jGaxmgfExzwcrNoAgLm7SHegjg== 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:(13230025)(4636009)(39860400002)(396003)(366004)(136003)(376002)(346002)(451199018)(6506007)(2616005)(1076003)(55236004)(26005)(6512007)(6666004)(6486002)(8676002)(4326008)(83380400001)(52116002)(316002)(186003)(66476007)(478600001)(66946007)(6916009)(8936002)(5660300002)(44832011)(2906002)(41300700001)(38100700002)(38350700002)(86362001)(66556008)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: CYqQEBINaqIslmtZKG5bp6qdQLVR27BlX1tyE21UystA4Kh77pgAWsIcbUfJ3IuKv5GSggqTlZbF8p7ywAlpVW2eDXxdHQkyqukfDt4iDaxT/QdeZVhHPPyQ5GvyxVPV1H3XOh/uMeoSu2zcoZeMw/CZqSc+lSe8RaMRH6rgAMHa4RS4K1fdXjc7IsEBWk/vKq40Tr2bbKiE5EtdCJ/pXyQAvhqEDxF9M02wEeQX4ndOy5jEMoZ/7+IxIoaePP9NrZKk8qKqnULrtjcAHZo7wqdr5IlsBvCscLA+OaFp+qFgoS6px/pMO67TSPrHgQ1KZyhMqzkYwY9DS8dy46gCGSkAiro1PNEdHdi4VYNWy2EymdQiRD4JyQ+znW80tWT9sjjuT4Iym+T54cF3M1VaYaeLSfR8J5IFqL94XSYcmupKJwpmaYXWQ7cFpo0FuyHVCfvYuyXCaOKLmp/qIemtdHxo3pqOjlnHi1gdZcfhtm33uK3cs2fCGSFPxynnzkdbXYFCYRoi/Nef8SYLnDyaIGTfXjcwNzJ2cxnzCaZMH8Hz4Im7CuPq4oekWIuRUOCQZJPg0SUH8OsjRZCOmudG1iFhc4ShEcKWwq497DbkOmA3ZeUUGF2Ad4UzKnEgfw4Y4BZE6vIJEOtMssoRhfr9Gof2FFcqw/E9HNBBP73P8ZVYfxRPyOm+K4GTB5KW3LTcFcaAbn0Ttfc+ThdDOmZVqJHyRHsYx3K1uZeu1QOR2wMwkFEwfH3IteryjOltGS7It4oEihqrddaDvXiBG/1MWJT9nCJPgqKE4HPDOPtAr4fWFN7SyhEdSGCi9o0qG9GAhsMMAp9BTfFOCzBJ94V1WesDmLSiNGgkz6XtmrmDgV0OQltrjjJ/jfJQavuyT/fyIKOoTTj4BL5aTBZxknlb2PSpxA0PzOuPjvXK/UrG8ppcc0bFov3BfBo3oUqLtQ0k+EbPfce681kx8GlEpZ/ujP99MdxE+xQidMrX6t2gWN+/jjhJ2EEIzQWWInQS7N+SCgb3DrEVA/xgB0Q5X1inLxcbMOu+B2MzbJ9WBCQsbPmkk+vccWvceG5W/WDdsyOxlFdX4K6uQnbE1ozeyDI8H0HAi8h0k5y1pHivys96fqRawLFZ/TtfhIGJ+SZUOPOv1rGp+VUlUS1zYIgyUIIm2VL1ejxGoBdJme3ui9fgxzG1R/RPQkVhVrzCvbj0s+4H9MCGKI9Xp7UhW9UBpjg7vM3+yQvtXnHaYqFZnsFy7N0iEmIRhD59P6s9O/piBaOtL+Kkh7PW0ZZH2jmcEVgb2S2Dsjis7STVAvmDdJfNgnjsDq556RVDaBJwWbzvYmBnEsJxqarQs8t2uC9jci/+8EGvbMHyIpuAwolH+vX1eXkGRkDZU+FPY2dLp4lnw7lMqzWZHENm+vnhhT2vApuAny2Dg63B4NQ42zPxEzmpYY92Bp/rxe2EEGmx1jeBI2FaV3zC26U1onqBNk+uePJjKAdpOLR3jUGfQKutlyenU8d5P5TeH//L6jEfQTZ73hKBX84itZDKQAWtL4LbGDEhkWB02ds1tancETGH9pZ/KnZTV+On5GqlOpmdkSqj/9Jg4rRwmyXJyOKK0qtCk6wnTg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 362cdd58-35cc-492f-c5d5-08db2950a5ae X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 14:37:35.7511 (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: Z9YsYajn+FvNA6fJ5j0J9k1ybfUKNVIDZQaE2pgWUhrWKGcRLHvyZxgkCTWtxjTZV9SAADRGs/co/MupExiftg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7231 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Update bthost_set_cig_params prototype to use the dedicated unicast QoS structure. --- emulator/bthost.c | 3 ++- emulator/bthost.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/emulator/bthost.c b/emulator/bthost.c index 4671fe17d..80e4a4963 100644 --- a/emulator/bthost.c +++ b/emulator/bthost.c @@ -5,6 +5,7 @@ * * Copyright (C) 2011-2012 Intel Corporation * Copyright (C) 2004-2010 Marcel Holtmann + * Copyright 2023 NXP * * */ @@ -3171,7 +3172,7 @@ bool bthost_search_ext_adv_addr(struct bthost *bthost, const uint8_t *addr) } void bthost_set_cig_params(struct bthost *bthost, uint8_t cig_id, - uint8_t cis_id, const struct bt_iso_qos *qos) + uint8_t cis_id, const struct bt_iso_unicast_qos *qos) { struct bt_hci_cmd_le_set_cig_params *cp; diff --git a/emulator/bthost.h b/emulator/bthost.h index 92182687f..68aef62be 100644 --- a/emulator/bthost.h +++ b/emulator/bthost.h @@ -5,6 +5,7 @@ * * Copyright (C) 2011-2012 Intel Corporation * Copyright (C) 2004-2010 Marcel Holtmann + * Copyright 2023 NXP * * */ @@ -106,7 +107,7 @@ void bthost_create_big(struct bthost *bthost, uint8_t num_bis); bool bthost_search_ext_adv_addr(struct bthost *bthost, const uint8_t *addr); void bthost_set_cig_params(struct bthost *bthost, uint8_t cig_id, - uint8_t cis_id, const struct bt_iso_qos *qos); + uint8_t cis_id, const struct bt_iso_unicast_qos *qos); void bthost_create_cis(struct bthost *bthost, uint16_t cis_handle, uint16_t acl_handle); From patchwork Mon Mar 20 14:37:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13181335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86BEFC7618A for ; Mon, 20 Mar 2023 14:38:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231839AbjCTOi6 (ORCPT ); Mon, 20 Mar 2023 10:38:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231888AbjCTOio (ORCPT ); Mon, 20 Mar 2023 10:38:44 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2049.outbound.protection.outlook.com [40.107.21.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 776191EFD3 for ; Mon, 20 Mar 2023 07:38:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AI4Mr+PIOcodsksaawVGUK3kUbv1x/GX7EnmwU94SIMoq4Ff0VetkMnBitijBCeA6Uv2r5pMLWoM6XVvlVI5LHBI4Lmf0WDzInqFjTRTOZqfbLeVDJ85mQggqRCyUCsKZyZlzQQF8xyQBslCcxWpfC4h9sjszvAi2hFAhBCVeuTJLZ0+v/UF2XWtpjo14qhugtJon0KgH5kfOmxTmmvTuoni9kaHTu0EnG2hLlLTLlxy63VQ+orjQ6kvhPxzvXz0nEyyETkW5hWYFQQ9rZHDfSgchiAxn3kd95T+EhH6LJN3QnZBwzl5YAsR6J9iwdMoGgDP2fbPtzrhMScmFsBd9Q== 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=+RAB59sNVjt1rQPpe0ASMNJxyUOETmSbGLmOvwJygEo=; b=ZgyKj2E7SbGbFwpg1FNmIr95y+uPBhLTKZNnVFV/UK8/3HDNkhtZtNEZ63KpZBgOtEtCjljQCBpNCB6TaBtG4bAqHUHhgUg1Grtu9imEgpd26Ux2mEwOSagAOBpkhZGk/GU2aKhDLXzh61n9XTD/3wBqes1O+iO2bL4ZN5TrRijAfKeZzKEAe/GqgjO6yyVyV33gp9PSNk7XdqyxdZo9dVECCDkxrjTnjLrLnijJdn8W3C+TL3lveOFdk1WXyfCz7PFEHRfI9uFgWjuBb3is4sQWAV7Q045oVuqVo3pkx4BW5sjJTJPQoSwLhMQOq8gwiU+yb8/k0u6+a6yaXkPw2Q== 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=+RAB59sNVjt1rQPpe0ASMNJxyUOETmSbGLmOvwJygEo=; b=ckJM5thjRVTUVYW6+RYerrQaosKT3xKQUo9Ff9XwOMqwVOCbYbLQdHpnrwigGUsudUacQubdM0kbYTxPpLxjwanRT1OhGvXB80BmJyqFcrObV/7RbYQer6B/1UuB15k36tlqewI9+ggiT4Vs8zNAhPwBgOZkTKacKMqwIMm0udU= 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 VE1PR04MB7231.eurprd04.prod.outlook.com (2603:10a6:800:1a9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 14:37:37 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98%8]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 14:37:37 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: Iulia Tanasescu Subject: [PATCH BlueZ 4/8] lib: split bt_iso_qos into dedicated structures Date: Mon, 20 Mar 2023 16:37:09 +0200 Message-Id: <20230320143713.25449-5-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230320143713.25449-1-iulia.tanasescu@nxp.com> References: <20230320143713.25449-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM3PR07CA0147.eurprd07.prod.outlook.com (2603:10a6:207:8::33) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|VE1PR04MB7231:EE_ X-MS-Office365-Filtering-Correlation-Id: df54bde8-db7f-40fd-e08a-08db2950a6a6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jhk/2i81XMMbq4Nu+IdbPWWsa68pcg1Ahc20e0Ue9IMNRCldNk6Y5TJDHQwPC8qaguMv8wgv52S3R2jjwQq3UNDEet51c9jpL3gHOoQEo71uIkCg1UXfEmnCTaaqUUu342cWCWfcu9Sq8FpqN1jqJauGywzpQmmh6NaR62C8MKxMLy/b70ZTkyUNQEJPfxGro59I3yJI/JlBKRTcBOUr+vuBkTL7NrNN2UtvMOK+yDd99EbVs2HB/BsUzQiP3JYbFNQ/QywTc6rVTuSvCcnizI5XQbp8pX6jFvItDxxL/44KS/9SMyINChsiMnIjGaQZygvaoLFBx4qm5drDJkonTT3G1lZmx3xxih1CE+dqv7z0VTVAXDpnSUslROZVMwGYwOK7pgGlryAIwlR34MdXBwKlIGQjgbBlgtEHYjlD3dmSkG2zlfRVS6lBaz/2ZxdfndS9gTa7lEoBq7o47Nuvp1BpI9Feg2ekAvjox5SvVD2Fz5mrV6KNZNy22U2P79RE1Qvpm6aNoX8+5/ht5k+QrWHxvHCMadRBdWyOznTf9xNIBSkl7ZBpPmpaOvuefmCnR+X1DUnOmoz0IdWxwM3Wt4hh7LqSQ/7zAerErYhezIud13l1NUUPP/rI8sddA8r1ML0S1IJUjwB/+JX4fhA+BqamJXFHyYQPekijkxa+wbsuQYbeQ2b+igWxHlkXii+2xwGSgMIdzFKOESweDD0DaA== 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:(13230025)(4636009)(39860400002)(396003)(366004)(136003)(376002)(346002)(451199018)(6506007)(2616005)(1076003)(55236004)(26005)(6512007)(6666004)(6486002)(8676002)(4326008)(83380400001)(52116002)(316002)(186003)(66476007)(478600001)(66946007)(6916009)(8936002)(5660300002)(44832011)(2906002)(41300700001)(38100700002)(38350700002)(86362001)(66556008)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: c17VnU9TJCJ6YNLoNkpYj/JS/cAoMe3C4WIklEEJcTcK8w3KfscZKdGQa3z4ZRqTXp38EHGSuwZwdm5szBcBxFkqFlhFOhkQTLniC8vMjCNOTCVLnQZ6FOGB2LiLosJX+C5VgpcUajlNyWgtz+Vx3/cz48X96aIoqSQDP/+kzzywZVPuU6c7EzC/IiUBVjxVD1Xs/Jm5Mxz5fzZYwLjmv4yISUvWkKLc74DoJD2GWVgyzO+TH7VYQkHFdwUnzaPn15mdltQHbLUz/X330A3J0WR+7nx0/aGF+vU6mEVRoJPluUbjj9wonoZ0DcC8FoKS8oec3nU+NRZo08+vW3dC3bs2Edva1udkDoxF3CwzFloiJ6CFScAQfxSeba1Lp6MMjXDZiK/cfFkpjlLlSWD/kblO/QyOXXwQQz1ZguRQinFil9cbo3Es2NCbWgWevxxNtiCfYqgNV4QRLHpG/IX3ERN5Nppcs/uSBm4KPgJqhB2EcVVVBqzfmtHQgEpNXkamDacD7yWHi+wUi7uBevuAP3sWEr/KrHDHvXxJgvt2P0hlgHzgu8GrqEWcjps9GuxjmX4qVepSH+U3zf6+s/29fb1tKId8mFdL1945aIy3Tv4Eutt2E3gdXCjLHyqZDwChM9V2pnlh6ESg6grRltDtGivpadQZo4widfQ+mniRAE1NqGGf8KhZ+7EhnBjusBhAWbzyHaPdzVeGhhrFAPP23jvNOhfULCyTyA+shiCGw4lSTN0/xY9vXzWScpz3TzwmeQ8PjjI+Z+9EDRb0hFtTm3TgVLoqM14MxJpZkxDkQAlZFJzK/qo4oMwjS8CwQ1clIaOEk7UTDADbWgCJGOSv6ZL2fqh+Q7aJ6Qn1jYPGIVooMLiAnO+ibFdbJAWeYP96HpVP9Kn+wS32JuijXbS+Rnqs7oScJpUu4zG1kiB6Pz+M2cTuQL6Nik0hIw3zoJmFsEdJwV1r7vC8SrctFtHdDX1WoXx5GxPauz9oYuUvoKKnFJyfBpkZjXvb3lVa5xjAI9ifI15ZkmsJXU7rrUDeKMqwSulDnVnnrPjI4C51jj8mbQEdcTczQ7zdVoIO1chMPaXLjGdfiLhmHNRBOGPvBRFSD6UqJfSVjDNkGbduShXLopfhpgUqwH9HviWjwPTtknI9aYI2Is/dwjPsNC/56G1R3fHOHrJZT18winO2G9/as/CRCkkBa6k3QW877wAPKXbWYboxsuyuajQz8CbUwfzv1C3AC/K+ygkHmb0MVqoLIKCEj1eY467D0N6/oqp29VkkJwQqAsordCsz4yMpsapshT+WZJx19tU5Zu90dHeFFroOuETCQnchKT0eyU4YGvCmjwApkvpBoTH/1BNTcKaDlbxZ7bOixY5TPXy+7EiNwmsU+aNqsuXu7LT+qCaUk2uqs+uV0a3fw2cSKXHCaUTuP0baqtBd6jRYoTYBZCdicYMJWON8P7IqvgG6c0oF+HUsgUr4Z6DZyJcAQyFAWWEtHz/wi5clWBcroIzDfc7hBku79LSq+MVgACIhqDLxT/xleBm7Y4v7/AlfeIJSGjnTGBDYSzqVi7+Dp8bIXTsqCsSqTid3v6DRrhxSMKBT3iTdvdg2Nzqz9QwEOyL4mA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: df54bde8-db7f-40fd-e08a-08db2950a6a6 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 14:37:37.3758 (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: ajTR3J8G2fExjTBQhwEae4ksfXyLouSH7tMPVBoWjVCTJyAKf0QeTJzOz3HIxInzZoosfbRShb/uWAxR2tO2uw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7231 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Split bt_iso_qos into dedicated unicast and broadcast structures. --- lib/bluetooth.h | 50 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/lib/bluetooth.h b/lib/bluetooth.h index af5fbcfbc..d365d681a 100644 --- a/lib/bluetooth.h +++ b/lib/bluetooth.h @@ -6,6 +6,7 @@ * Copyright (C) 2000-2001 Qualcomm Incorporated * Copyright (C) 2002-2003 Maxim Krasnyansky * Copyright (C) 2002-2010 Marcel Holtmann + * Copyright 2023 NXP * * */ @@ -141,11 +142,17 @@ struct bt_voice { #define BT_SCM_PKT_STATUS 0x03 -#define BT_ISO_QOS 17 +#define BT_ISO_UNICAST_QOS 17 #define BT_ISO_QOS_CIG_UNSET 0xff #define BT_ISO_QOS_CIS_UNSET 0xff +#define BT_ISO_BCAST_SINK_QOS 18 +#define BT_ISO_BCAST_SOURCE_QOS 19 + +#define BT_ISO_QOS_BIG_UNSET 0xff +#define BT_ISO_QOS_BIS_UNSET 0xff + struct bt_iso_io_qos { uint32_t interval; uint16_t latency; @@ -154,25 +161,40 @@ struct bt_iso_io_qos { uint8_t rtn; }; -struct bt_iso_qos { - union { - uint8_t cig; - uint8_t big; - }; - union { - uint8_t cis; - uint8_t bis; - }; - union { - uint8_t sca; - uint8_t sync_interval; - }; +struct bt_iso_unicast_qos { + uint8_t cig; + uint8_t cis; + uint8_t sca; uint8_t packing; uint8_t framing; struct bt_iso_io_qos in; struct bt_iso_io_qos out; }; +struct bt_iso_bcast_sink_qos { + uint8_t options; + uint16_t skip; + uint16_t sync_timeout; + uint8_t sync_cte_type; + uint8_t big; + uint8_t encryption; + uint8_t bcode[16]; + uint8_t mse; + uint16_t timeout; + struct bt_iso_io_qos in; +}; + +struct bt_iso_bcast_source_qos { + uint8_t sync_interval; + uint8_t big; + uint8_t bis; + uint8_t packing; + uint8_t framing; + uint8_t encryption; + uint8_t bcode[16]; + struct bt_iso_io_qos out; +}; + #define BT_CODEC 19 struct bt_codec { uint8_t id; From patchwork Mon Mar 20 14:37:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13181336 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 460BBC7618A for ; Mon, 20 Mar 2023 14:39:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231833AbjCTOjM (ORCPT ); Mon, 20 Mar 2023 10:39:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231585AbjCTOi7 (ORCPT ); Mon, 20 Mar 2023 10:38:59 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2057.outbound.protection.outlook.com [40.107.21.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C00528E6A for ; Mon, 20 Mar 2023 07:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kiB/X/v0h6fUuCgXSPxM6cCn/SLpgEy+du5b8ouNAR+U7gJXsdNTLNI5oTW4E2nYxfoY9ouaPl+ikRPIrcDQnqIzX2z2Y9gM4yUNG69n14f3S/I5nvX2Wn0UDlYRIwNj1hPfGhww5ur7LFww08AK3YmvRnrhjSmZZ4UgmMdDBmDN1JqHuRan2gL5VplrWHbcItqrhp2iLfrmrcbyM0czcCtGi8ajylO1FCuJKhDNC9LJ7bN8LozsRJC4q7gWspAjPmkR4Rv2y4el9K+z94GeSuT+tFECLqga+3afhjvNXbnfSVUC88S90JQ/Cnzo84Etkgnsk5B05EGzmtABJken7A== 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=NUmK70d9jZkCrV2pNLqeh6/R9cNahaKXTCKtxVKDF50=; b=Hgh+BoxqELDWwhps1hOZjLmo7w1gNbW6NNgDHOhhETmiUXo1EAIgHfWrsGaOh/s6SsVZ1G8ol7FlXw96M+gklsMA+zleRH5dw/Y+etHqdk9t9+aF9Cw8DkJ0cFKqwESAr2DqPPVhBevXNYZdQio3L7pP55RCM7b5lxOI5vgiJsCRd3TW9AqvSccKPYMhtvGwK512X9s1qvJdgmuBbEu747gtJtyJ8V+Vklp9qLPTGxNYgSLv0mH4ksqQA6aaS35occph4i22R0r/SPv9OtTgRS8EwrVAFWoB+LdsL7d5gM2fKO5oJmXSE0ohbK0OIc3bQhrzuRzg3/bMZjWl+bjLpg== 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=NUmK70d9jZkCrV2pNLqeh6/R9cNahaKXTCKtxVKDF50=; b=XZvBWRlZKWGt6XAMot53xIor/Xn0jP9sI9ufCz7hPMg6hm6g6H7sNo0Di4cEq6KNJ6EOtxmYjhlC7UeDwySjPlXJg0LnCpdqkGV3epJBiPxBB5+VXF81JF+iBcV2xypciEem5kRuH6xOQ+B0pHnUd1dvy9nBQT6y7rQMOxPJ2Vw= 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 VE1PR04MB7231.eurprd04.prod.outlook.com (2603:10a6:800:1a9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 14:37:39 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98%8]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 14:37:39 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: Iulia Tanasescu Subject: [PATCH BlueZ 5/8] profiles/audio/bap: Use unicast structure for ISO QoS options Date: Mon, 20 Mar 2023 16:37:10 +0200 Message-Id: <20230320143713.25449-6-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230320143713.25449-1-iulia.tanasescu@nxp.com> References: <20230320143713.25449-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM3PR07CA0147.eurprd07.prod.outlook.com (2603:10a6:207:8::33) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|VE1PR04MB7231:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b1128bf-a51b-4a8c-d243-08db2950a797 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bTnxfU8MH13Mzd1NryCUz7J7YZIJDeAKx0XUy1VIMzaxIY4h01HQy+8hXy3rdoPIy97Qq7bOuYJxwDNGwVJzYrcJYJng5dv6IrVmagDL75HsQUymMza+4t+Pf3/lsz6fAdSKBZWiv1sYd4m1sSM9JeBO3TWhT48GceK0VbHfxq9egpTOD2YWmHMaBD/8r+gkg3XsGX4r+/kB+4pPpvPdF5Fu/hS/XBoCUIieixJHjynnX9tyXEslKccwc491U3Iw5e2DWzCpAQ0RL84kDZ7q+LeJ3m9LW+A8I4GbWUMZ3nHy+mBCLbqsnozXWigGhdBcUw0yHjvzJQo+X+fi5sUKVeXBZh0MYBXTqIZLcyOqABhWoewoyj3wCH1SDp6jpeG/Qupbdb7OqMxa4GZasqXTLPUO8+92rut0JuQvJLbzhzxfBzz9W6q2cA8aUlGBGGUCOQrIA91m4BLTLdChJX2cUGb0Oww/Fi0BQwHvyc/uRLXMb/afXbt3jZP/N/DVhOddnMmdrxgLy7VDsrw8F59Q92/9O+PVwvnuKQbzdNVNK0xGQPvMiLrvjzQKkc6TJRxrMU7gkdsgL/kx1suc3wci0C+VxZ/mtFAltJR67Lw85+werM9YpkNp9r7EFu+H/cY6S3++kIXItVithP87QPVXO5hQzhgH1wjLKGV3dCgo1QkEaXAhYl19z3dps+A9oXvLGCMj7oHszLBbrbpeHHz7Bw== 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:(13230025)(4636009)(39860400002)(396003)(366004)(136003)(376002)(346002)(451199018)(6506007)(2616005)(1076003)(55236004)(26005)(6512007)(6666004)(6486002)(8676002)(4326008)(83380400001)(52116002)(316002)(186003)(66476007)(478600001)(66946007)(6916009)(8936002)(5660300002)(44832011)(2906002)(41300700001)(38100700002)(38350700002)(86362001)(66556008)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /ootdZmeK3ORveHf8Qy7QBn+O9oWZJqVR3ceu1engWBMN2p3PLTF3EJgoXQViWh+sALToIyzezLrxG9W1o4xayxlockBCRg9D6C6wAWIDE3lw4KQvNGoRoWvrKjDJjChlpGObCrrRE/Xk2g0vt56CYuNcdex5wd+JIT9et41CGJKW21A92ea2VHtVijOn1e9wsmnq+Qs5zXELTZUnzUZPmIPt8sjX3KjUJWmaebCSvsciMp6mVqvDNCVks7E2kwPdsQXX+XeLzEZ9T4utXEik4LpHihDv30/tI9MfIxod8D9iYUB4MoarZeFk5GmMMqsk1/xbp0Ff1ZoDyQo3j/U2b9TaPS7O0bprYehEwseZi1vqXkKGFcWgUrMq7RP3T/N4Ac72TZcNGcQ9oonDE4hJsDouWtwGU/vaqJAW+ze4Mzz8Ue7nCY5sRmeGzpZ52FzCPI3OjR4dPzEvnYMpPCE2vSVsd9iL4DzKeMFxpRDVcW/SDfAvu0NnW6PA7qdonzuRshdsCt3o4vlv01DVwQyYrDNzfM5fW+WU8VUBpATfe48nlels64ELwgr7Jsi2rSX6TB3LxwU4O3E4aYCWEdob5gA5FmdgfXJaj6hZDJ5DI/g7ajd64zDa5aoUVbZqPj3FV2Fpe66uVP1UOpJKZ7Sfk81kz44EbIgStZLae6nEI92pu6z7oGaS99haM5OU4V+AjIvI5PUz3A5yy5Kl6HLyTvxxHc8tovjniWTrRjkJMlk0CV69tF2QUo/onOal8pLyOStI0OPmPsJwNU+/z6Dzuq6IT1J4sOFBqH6SrpnKX/6zQ6O7GaheNWyjHLPQuIqGJyjTU3sgUkx+aL87GdLdu4ebk3fK3UHnHPfMcuXm3INyu/kHFL1uFzJrB++b4IMkMt4wLak4PXzQ/2Wl6BN4Z32VMxSzycOndciNQjq4hQbbaCZyFOOB/0ah8shY2KLVgFVjHoUfdCe2ZZjZKnAj3XQ5FiSc6QZgg1G7GO/SaOieEIV+e716IICDg0QYwOvWVgjw80FjHsEz+SuxeVmbi7RIlr182aluNSo+0EizbOV+YcPz/NMMlZh7w9MgLuENWSTaKphQQOa6IvUZo6UtC/wxbxit+C0wg7XMXz+vAmg2L8QW27qqroh3OW05bQ9ys/POu1kwprMNsnsDSqZpGUHdADWDy6T8A2u13xRkWPo+VbEdJpJh6X29kNEIspRRwRogLLiM2UzjtldJua5g+qVe3xzBwW+Xt6zHXYdGL5yTnibETCV4lW3LC+i3cwKjEr9ju8IoMh8J1KHwj8Eef1Ejl0EyZ20tAFKDhh1J+7d4/iWxs/f8p/IOwoulgEc5tnISS1Gc+8hslxgvp0GM1Ru8t0Grw/W0+oa6YGiEIZUM6YHezthwBdDGsMJRcWGEoOUZ+2Vqna6CXFkD3dDZ0Gglj3SOWDveuvG4U6/v5hlE2feTn+46V26OikbBZDg5MKBE5cNDOc3lPyTY3I+eXQc9eqbiZA0AjhYveib4iCEvHKXW6T3DuYDv+o73var+lHDHup7yZNnpW4i9v1zfiR3T7WKyBO3SCkXsCrl9H7rlPbCFr+JtDhEmoLySEq3+fGdgKE4rOvPw1App79akg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b1128bf-a51b-4a8c-d243-08db2950a797 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 14:37:38.9549 (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: v4V/qjY/KFoPt1bTVwIjup8qIO08LGNrc5+hJE8Gu1+Q7ZOpXvD9EiQGmGLdPh2qKOVX8n2QUrUDjZJoDNqwXw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7231 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Convert the generic bt_iso_qos structure into the dedicated unicast structure for ISO QoS options. --- profiles/audio/bap.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index dfdf87255..49003d351 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -4,6 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2022 Intel Corporation. All rights reserved. + * Copyright 2023 NXP * * */ @@ -741,7 +742,7 @@ static void bap_iso_qos(struct bt_bap_qos *qos, struct bt_iso_io_qos *io) static bool match_stream_qos(const void *data, const void *user_data) { const struct bt_bap_stream *stream = data; - const struct bt_iso_qos *iso_qos = user_data; + const struct bt_iso_unicast_qos *iso_qos = user_data; struct bt_bap_qos *qos; qos = bt_bap_stream_get_qos((void *)stream); @@ -756,7 +757,7 @@ static void iso_confirm_cb(GIOChannel *io, void *user_data) { struct bap_data *data = user_data; struct bt_bap_stream *stream; - struct bt_iso_qos qos; + struct bt_iso_unicast_qos qos; char address[18]; GError *err = NULL; @@ -882,7 +883,7 @@ static void bap_connect_io_cb(GIOChannel *chan, GError *err, gpointer user_data) static void bap_connect_io(struct bap_data *data, struct bap_ep *ep, struct bt_bap_stream *stream, - struct bt_iso_qos *qos, int defer) + struct bt_iso_unicast_qos *qos, int defer) { struct btd_adapter *adapter = device_get_adapter(data->device); GIOChannel *io; @@ -939,7 +940,7 @@ static void bap_connect_io(struct bap_data *data, struct bap_ep *ep, } static void bap_listen_io(struct bap_data *data, struct bt_bap_stream *stream, - struct bt_iso_qos *qos) + struct bt_iso_unicast_qos *qos) { struct btd_adapter *adapter = device_get_adapter(data->device); GIOChannel *io; @@ -974,7 +975,7 @@ static void bap_create_io(struct bap_data *data, struct bap_ep *ep, struct bt_bap_stream *stream, int defer) { struct bt_bap_qos *qos[2] = {}; - struct bt_iso_qos iso_qos; + struct bt_iso_unicast_qos iso_qos; DBG("ep %p stream %p defer %s", ep, stream, defer ? "true" : "false"); @@ -1178,7 +1179,7 @@ static void bap_connecting(struct bt_bap_stream *stream, bool state, int fd, /* Attempt to get CIG/CIS if they have not been set */ if (ep->qos.cig_id == BT_ISO_QOS_CIG_UNSET || ep->qos.cis_id == BT_ISO_QOS_CIS_UNSET) { - struct bt_iso_qos qos; + struct bt_iso_unicast_qos qos; GError *err = NULL; if (!bt_io_get(io, &err, BT_IO_OPT_QOS, &qos, From patchwork Mon Mar 20 14:37:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13181337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B309BC7618A for ; Mon, 20 Mar 2023 14:39:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231808AbjCTOj2 (ORCPT ); Mon, 20 Mar 2023 10:39:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231858AbjCTOjH (ORCPT ); Mon, 20 Mar 2023 10:39:07 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2049.outbound.protection.outlook.com [40.107.21.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8464628EA2 for ; Mon, 20 Mar 2023 07:38:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PAJAZQzDLTHuicN5Vyfw/IJi7rT8+ObiUrtiPvS7ot/o8B1oDi8MhLhy4r4RbjfFjbgKXQVu+hd+FwHe/ZKU4Hgotn1PJ9QBJUNLwoh8KRt+BBiRHklSzuqwdcuSR9NoQvCNRtiu8RBrGpulkIIZ1MuEQ7gG/fcLd69zK5gwnKC2RWKr0BBXzLD0l2f0Ioqq0e5u1LbODwATXrWbhk3IYg39HWaYYFgUa25uLOuvFd/KqrXpHQ1hrvO00+1SBRKA8CbLnTH8y83kciyvUh3EWFuOujg7spCW0YZquUHrs/rdzhQK6UgSn/6/BR9pXSJH6YZmbKClkwYoJ2sneFi5Og== 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=6HOZ1OHjekS1voclBEWMErEta2MSQNgUHIT092IPU8s=; b=feRmW2xNW3eXdQ89ufFFIvws2CxuO0bS2ZjucUklOLY9FQM7vHgKx5F3I6r7uyJH7t4fW4ZXvVStCkY4AZ3uCFs9ndyYOg04kJJV6TZ95oky9Bg3GRa6Spr/xC8SsJATykVj/xT5U4IC40DA6RGEZaCcQdvRjag37pV4uVUKIZB9wI1MSP//9sWUouzg78DvRFDAgEn4pPECSIRKlEG3TqFz3cca/3Mc8myjMi2VaQLsKRSqvkNBlYC+e/A1oUztzps6bQXNHgYzcU2HV09BmBpussmfrQHVk5l8An55dg0/r5gouc0Yh8wmf6oQd2F2Nh/MWUe15+lAErmNVdg86Q== 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=6HOZ1OHjekS1voclBEWMErEta2MSQNgUHIT092IPU8s=; b=l1/f9cGUe5ds6s76GvKDK630f2CDL1X4DuKokiHEObirUzmndXkAVf5PZP/tHo9erpHMOkBaGjSmWyeo761ZvNuwkZW+3z3N+C5zk9cfEp0GTK1HXS1Er856zf+y+kl2uQdwn2yc9S7a5jZhPqnmhtHb5pcXY1TT98KsPH20eHY= 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 VE1PR04MB7231.eurprd04.prod.outlook.com (2603:10a6:800:1a9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 14:37:40 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98%8]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 14:37:40 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: Iulia Tanasescu Subject: [PATCH BlueZ 6/8] tools/btiotest: Use unicast QoS structure for ISO io Date: Mon, 20 Mar 2023 16:37:11 +0200 Message-Id: <20230320143713.25449-7-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230320143713.25449-1-iulia.tanasescu@nxp.com> References: <20230320143713.25449-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM3PR07CA0147.eurprd07.prod.outlook.com (2603:10a6:207:8::33) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|VE1PR04MB7231:EE_ X-MS-Office365-Filtering-Correlation-Id: 5beb70bd-1f76-496a-73b2-08db2950a892 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: SV/zHb70AXvID5vUqdb9naAPIW1wO/coTRNcR/Tt9BnUml21xW8zHimDzA9ihg7b+FTeLYxfa5PSFBzHTaWSEuYB4g7SnkRJiPErJIA2lCCPxykb8YnaY7qa2A7mBJ5jJyKWsNdJVuzBBxw5vwHXG8ntP/QzawPbkXP+pX5kKm5b91EoeIkDTknXzqYajaDR+EXtoHwh2yyER+ewwWnKaj1FIqQuYHPaEiYjzteyzYMDu/O7018ahqSNZ3B3c8R/9+oQYULfReeZTeMAZWzzjl3SR0BARYwNIeFNkU21n+NJNTNqk6mumrdC47luY9JW1TF19GchSS4lmoEM8HTCVKUrSkOqB1BkqQe57vHJV0683ySsgtqSF+acAsBPHmtGtLEtk+4jRLfP7VgUxOnlAFv7nNc+qhroHlf85OBmD3Mm7u5USHI59BDG2Q2x/e3hnUKND4R5pBW9zpCHwQ+qM+k8+ZlpiE6G42CtK8vJQDkBNwag6oH7dNiWOEM9Tlf/ZGRunO0iwPpHPRhrgSBJEr/v0OSqO/Akoqiaega5Lz4qPn0R3jR72qAom2h1mpSRn/+Oi5VK6PkfL+TILXk5nWjt7QVRUhVzrDGmAPatUjdoYxfq0Zfkw08nnyslevhvzmEhluDryMs5RNvj/F7aZ60R9c1DcKaZ9w/D1At+/1NCioVbdZl7e5TCJ3b3DP7eLXSoZvGHJ29Qc+JEQID3Gw== 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:(13230025)(4636009)(39860400002)(396003)(366004)(136003)(376002)(346002)(451199018)(6506007)(2616005)(1076003)(55236004)(26005)(6512007)(6666004)(6486002)(8676002)(4326008)(83380400001)(52116002)(316002)(186003)(66476007)(478600001)(66946007)(6916009)(8936002)(5660300002)(4744005)(44832011)(2906002)(41300700001)(38100700002)(38350700002)(86362001)(66556008)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /MpxblsNlsQjeCvnfJcD+7ijpvxciOKKWldSZ4KfNJ1k7VOQqae0J/03VvJRWuupT4RM9+Jt2EE2EnluyVLdhnduncmI8M5XqI+DD+U6ySUxcTw6URGe5XhTxswHUSdZfQbsRK9uECv1UsOJRLJo/6qzj1N6nbBP2Kkh8yCcC8eGP0Ebxf/JrEtTCXT4tgitH+swyqLa9lGpTHaGMk2L9jPW+gKmwdKZFtrEONkGwDw4qNMDBlwpzV2ZMqVKbykYsF1yK0PkS5t0oKdN1jYzYPS/52wkkcdw8TJln2/l3qef8WwTm8pe+/AsdAKRFTG9FTU/Kf3ULbjKMox1g9PvvhAHvT1jOfznhNuzoKejjb1Mo/LJuuzkwj9+anRVVuckngQQ2isO0K8LjSDd4Xma2jl7zpxgqEOJZbeyoyVilEiDvLhOTBXpZSJgXkmrhnvuEgKiKp8EMuQ5ZA4MEqZqe7Bl8Ulc0zdGYMKp6ulekqA5eLKuceUcL1B5XDHvOFdLtnqz4jAa74qqln/b3SIemdcBnLayN1fEpJg3snh0bD6STIWlK+VElsCnCnONNz7t5G1HV4kedeMvYVQezJ0F6xwtmwB/BEipfefGKs6W5DK4KavN0hBTfmXQ7C01D35Vefy0JmDXDm7SwpzWgJ4V+C0v0NVKlJvyVTO+l1A9vVkFSjnycsS5XznPdwqP44Qr6cKRHdu/mVn6vIraTuAS6s/5m6uVDmfcJMDK7DacCdDrO5LdnJqtvrUYaIKIiSHunpXCTjUahsZ/prNlDVcVU9DemI0XTqycaYzFSkgAUjYtn7wHIBQ0VoeOTL+ypvzdTcwPIx9Qv8dt8H2UQigVsNliGiBLj/v0vDQiJhE2sCGYPmLcuira/11EcxWheCBAQXcBkJLSbVYIYHdgV2At3T3PCeycgoEr4ehbbH9BQxOOvgpyoPEJWayAbaEzKZUHpwfeHOQ1x096w9JYFH038VG9SF8p8/g+SEDWwKWQ+WiyrwJbCFdhyBE+bMBUUUThLr6AWUZ8yqzxtMNDac8vvStiExBjUeD+vuRYbpEUlv86k/LCET7iaPsf3YCcfckUF61JHh7KhyP37k7l98wZeuazjjlBOb29/JvItbKvIXSyOsQAFotb8Z/aYg42+o3oq5bqNSzydzPG6F5/VgzBkK4YDW4ALmhpLIP9fS99mpCVej5VCEmDJ1SWk2ndMJZMnE4Y1Uo0GPpj6D4zkA4rnEotHKQC/3YIU/7pTrIgLESGycjV/eKbUVDOilgd0WxNlEc1f7Ez0L/DnOnpBrEu8V2qq8SyRRiGTUCtjJg4fKW0NlihfuR7SWJaOvrh4VaJcV8tDGauksdMHN3pcUFmKt/04M4ezFwjkwhY9Qu9LspG4RQWKl8ZzSeWluAV3RBVfG1b1AybJDV5q3RiNE+kWJZb5o2VI2IyzitLl5ekSzVl4C+MG96BBBYh7zMp0cCsyJ9UlLmaQGVU6icfd0H865rtKImU168zpQZTLPGGUbeXx5DXa1dFacfbsJHH/g3FpBBWvmljxURjdrLDORctZvsRYin5cmtc+LIDrg9wPNNYczOvmRzE0WcA113oJ5Ve2l/3Y88jQU+DPEsjJ/qKFw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5beb70bd-1f76-496a-73b2-08db2950a892 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 14:37:40.6287 (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: boiWqH/Sf5mib5K3m/sr6tSKS3s4KmubGnySCtDrbcEjbDFW6guVVo0m/6Q/J0wADOT69MxTwsOkytQtKTwtBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7231 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Convert the generic bt_iso_qos structure into the dedicated unicast structure for ISO QoS options. --- tools/btiotest.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/btiotest.c b/tools/btiotest.c index 193e1395b..dd2c132ca 100644 --- a/tools/btiotest.c +++ b/tools/btiotest.c @@ -5,6 +5,7 @@ * * Copyright (C) 2009-2010 Marcel Holtmann * Copyright (C) 2009-2010 Nokia Corporation + * Copyright 2023 NXP * * */ @@ -38,7 +39,7 @@ static int opt_update_sec = 0; .rtn = 2, \ } -struct bt_iso_qos qos = { +struct bt_iso_unicast_qos qos = { .cig = BT_ISO_QOS_CIG_UNSET, .cis = BT_ISO_QOS_CIG_UNSET, .sca = 0x07, @@ -55,7 +56,7 @@ struct io_data { int disconn; int accept; int voice; - struct bt_iso_qos *qos; + struct bt_iso_unicast_qos *qos; }; static void io_data_unref(struct io_data *data) From patchwork Mon Mar 20 14:37:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13181338 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7B02C6FD1D for ; Mon, 20 Mar 2023 14:39:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231873AbjCTOjn (ORCPT ); Mon, 20 Mar 2023 10:39:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231892AbjCTOjX (ORCPT ); Mon, 20 Mar 2023 10:39:23 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2057.outbound.protection.outlook.com [40.107.21.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A5F64EC7 for ; Mon, 20 Mar 2023 07:38:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lmKIEzV0yRWkB2+lr24416MZFV3imWuAuRg9qgRckmJvmGvYI94WdiYqZYVnQZ0HJl7YyNpchsAW8sA210WTc58BU4da0Ik1aYi08zA0A/EC7JGk+QefWHsGlY63a4NoYwghApAqt9fnjzbyK9l7FpuHLhR7uw1ULmLR3F4TDimSsGwDMhPQihGyxkcaPHGyoe4yj5NTzuDK9Q1xFB8SvbXk7oI6GMEnRnrfmtoQufNyRiZU5KfY9o7McrDMQL+zu8uLYsKLXWpYgqvV1Z6PyHMttT1vJLFI+8tVe8hlm7lvBOX9IqhyBVfBKSWyq2qktSjwf7lg08vC7CN3fj5RdQ== 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=pOevsh3RkaSlqyb3JVWJIle7kUDvz3eog+zy+sAEO4w=; b=Ay0v25jw890XUmczfNqX5+KfFM7KrFT96FKslL8Ose9qA/1Z+ztNIXJW+QYa9Wid2DOpnyI6eYGGHLXDwiXqsavJmwXKMdg00Pz5CuqUnACbN+7UNgw1sw3JzJq8+Rt1Oy7Dil36lAR5FJSmhHMKVBc70mupKXeg0VJdmqCXkQYMflT0pK8cRT3HUD1QIA0NMfuvq1V2k0eUWpbovyKIZv8tKEXfrAuOPP0p2QGMJK5CCeU4JSG1tl9yeljah/vV1uTzIvp5/1qCUbPP0xN1ov+ZBH0ZFX9bactN20r4d28LfTXw6FLk93RXLX3REShKQjI+lhnfiG5vMbe1Fkt/mg== 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=pOevsh3RkaSlqyb3JVWJIle7kUDvz3eog+zy+sAEO4w=; b=MwcfoQZ/YV8stcYGW0WH5vjlAGyiJX5M/vmBoNT9Pkaxb/P+1XViGavEBU1YyazTBU/cqASpuARcZBGe4G34BbHInRiewfHzVPBm1xXqC40/WvXtuOK2hj6z8Dm/4UenVCo/tFHuJ0ou/22e2uBCGklfPraPlGEcZlC0tAKYZkM= 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 VE1PR04MB7231.eurprd04.prod.outlook.com (2603:10a6:800:1a9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 14:37:42 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98%8]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 14:37:42 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: Iulia Tanasescu Subject: [PATCH BlueZ 7/8] tools/isotest: Use dedicated ISO QoS options for unicast and broadcast Date: Mon, 20 Mar 2023 16:37:12 +0200 Message-Id: <20230320143713.25449-8-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230320143713.25449-1-iulia.tanasescu@nxp.com> References: <20230320143713.25449-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM3PR07CA0147.eurprd07.prod.outlook.com (2603:10a6:207:8::33) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|VE1PR04MB7231:EE_ X-MS-Office365-Filtering-Correlation-Id: d2b7113f-59a0-4341-18c8-08db2950a994 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tWBLeDsgsDwywdnQ89oPOqboiFizin6bQWW0g1QNoZkAd+El8exa7yt54kkqVUc/8euL0VhSsRHXFT/xT12YSfhRCXSx0vQM9KlYA8UYeWO4VdXD8lm91n9BDJqjJaXbx70xkBk0msALc0wBQOX0wknX1TH44+dDyDB0T8JgfxT5gysshjdd3AtriiUm4K0m0pm6OzjlbeQxgOxhTHH46riXJuoQjjBTH64M4HdSgK6DiWgNrVsfIORysZLXQojgo/BMWVOZJggSqjp24rbZFhmtgLvoMWsuHqRLm41iblw0V7dCmcS96Ips3y7FbdkBbh2D7K1P4pFecH7t7D1/XvZzWrhpkkUOAyFn8Dj4qtye8p0wxgnjPjNETDA5tSvxXnNKXaezM8UI0ClkSNGHq4swSy798MD0zTC9eKVlSm3keH+FH4yHdTxWpbJXMgJJqKTXsoSwxtu3EDtLv7YjnoUo5w4WfPD44EfAdPoqgK0ULaskJ5K5aA7tVBZYT6aUscs9iHQRQ3ulwsy0YjTpdeuUm9JO6eEva+ch8PfEuz8vV7Euepz1cByq9S0/H8KJM0B346/L/ytkAPwrCqe43THjAk0KZJ+6EO6PDzETRY0zX0lgWgoRNvgLlHwTRV440HqQxXjQitP6SBPcQN2c0mcQUBwJ2LQnqUZr7PIJ5wl6JOeDcxo88AwO2puu2Nw+0yaqF2msG13FX7aw5mNlAQ== 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:(13230025)(4636009)(39860400002)(396003)(366004)(136003)(376002)(346002)(451199018)(6506007)(2616005)(1076003)(55236004)(26005)(6512007)(6666004)(6486002)(8676002)(4326008)(83380400001)(52116002)(316002)(186003)(66476007)(478600001)(66946007)(6916009)(8936002)(5660300002)(44832011)(2906002)(41300700001)(38100700002)(38350700002)(86362001)(66556008)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cU6NTS2IaLuw3TbyW1ytvkIKOb4KpZT/BuVdkHg2bs9ZDFHhZCX7h0cWApD8bgfai0dZ/n0UJ9bYPC6SSvnMNU050Z5vTpiOwHIK3rABEasOsI7Hgtkot4vsmIrOQms/Updw0hbbgzVhxLPcQz+eZugYHYpWD2YyaIgSx1gLAp5pP1UAMxLjTn6oUlJjA5ZrLEblnzDUdLJV6R+Z8qDnh4WoFlc1GOyL+AAXDPDzq0Uz1KZpY7tgpeRb76QQm0+bkfcjhUaNOVpQWStlqqtxYQNCZuKNkEk9UFHyoDURjM4qx9nrMinEttpCnBFhzOw+GEaSOVaq6quAPEXDRzW/xevkpt2vmEm2c23ybn4un6uodecHJBIy3jORI7o7YhFZOy8oqETeXG9GaltYbFNoMkWEkvsrZxXMQ4/1xcRUELflHZ1chmUob2TszIWXbfsoJCUwlgj2dci6Xtc5k96Orl0Jahdzce58dlMf+QkM4ZBxm+OReZnpsBfPWS5SW6V3Smz0vPikh0B1Z0x4EyrACi1qmC86S8WcF88QaZm+71lEzICMW4RXTmui5BLF3ZOPz3n/vmPK26omxmlHnsjZzmDaRjg2ZntLxSQOjo2n4KZKRhE3E35u9ItcWiKvLJTQWeW302WTkeHK876ZdXohMDbQaWAxIHr8GUjKiebCqDmyjnWpk7TDis+/6jFI3H1eeuujOqaH5c8JGFokm8708UQKlqHcBW86mP58FQE5OMmyUR7xog/OIk9t7+NKG+oXDkE7nGKIrvQRAZ4WsFN0dhwPf/NoVBUglAENvOJQ39ysSQP0vlKCsKxPipqoF6GGVRtx9kFrQDaIZzQcUx2cjXX12wZ9T39uysC9tkNUryLhNjM1ICcC0rAsxXpwjMAIaR5MEKcx4vQJ4X1ouewotSSnykMQ2xv1tT+pTCFKbbI4SaRi5lyPK6roBZd6EEYybFW8mGqzdFExJNRNUAEO+XVdC9Jh3haup9CyipVQSKDNJnvZ3sH695zXAntkzjf+miNf3Wgoh8byl1GwMQggIYBVELDANvAbFoeBOdNGX/hGoQDdnNQJwtsLbGp9MwvaLRGaYmst8q9jHavqfSdv9YZARMIhHapXALUl6rx0ANzYlzv5qTNJw4SoEDPlBiNxVZ8UBVKv+zzig7QZzJASYg6HtGZyXqa/8+kkuPbefbONxUbldF89gnBOqM778GpZEcCcI9O4RpKfFlosNtvUn4VnenZ6EZqupl38sR+//rzvlYtX4vIrCrxukk3xru/ts8YjAmEev1tAFxgG/jKYQuDnOzL8eqeVD6lERxDf6MGef0nthUOX59FnVxUL2RZ3pfbCjFkO51Svwi3amXJNBsX/L57JdXgrLoyBJ9tbk9Divcw16KO9yYLJZfdW2x8GlkhkDv2bbPfr3iw967A3Tk5Bs+b3RQ1WM90Lw41UbY/9KI8oyzuWmN7Vvc3uSz8uyLlLmyBaGphVSBS6GOMQG8BhnK/AF7GU/yyacM0Joi6kHumTNLbR6WQc8j3jaQJOpT9qawc86AA+kHTLHNMeT8JE4LpFz2UbtShpQ+EHf3o0Qx9Tfvu2re4+tjEw7ipBNDLPti/VCdyBCvljWtxC8w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2b7113f-59a0-4341-18c8-08db2950a994 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 14:37:42.3327 (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: ykFgArHRnnel35s9lT16fnDgdfMG2Nj163M9+cGw59FKyf/RNmHPdtRUht++5jj09IbU4LKEZsHG5RRcf8Lb9Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7231 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Convert the generic bt_iso_qos structure into dedicated ISO QoS structures for unicast or broadcast. --- tools/isotest.c | 159 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 125 insertions(+), 34 deletions(-) diff --git a/tools/isotest.c b/tools/isotest.c index 2b5f164de..f12658812 100644 --- a/tools/isotest.c +++ b/tools/isotest.c @@ -4,6 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2022 Intel Corporation. + * Copyright 2023 NXP * */ @@ -68,7 +69,7 @@ static int sndbuf; static struct timeval sndto; static bool quiet; -struct bt_iso_qos *iso_qos; +struct bt_iso_unicast_qos *iso_qos; static bool inout; struct lookup_table { @@ -239,38 +240,94 @@ fail: return err < 0 ? err : 0; } -static void print_qos(int sk, struct sockaddr_iso *addr) +static void print_unicast_qos(int sk) { - struct bt_iso_qos qos; + struct bt_iso_unicast_qos qos; socklen_t len; /* Read Out QOS */ memset(&qos, 0, sizeof(qos)); len = sizeof(qos); - if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len) < 0) { + if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, &qos, &len) < 0) { syslog(LOG_ERR, "Can't get QoS socket option: %s (%d)", strerror(errno), errno); return; } - if (!bacmp(&addr->iso_bdaddr, BDADDR_ANY)) { - syslog(LOG_INFO, "QoS BIG 0x%02x BIS 0x%02x Packing 0x%02x " - "Framing 0x%02x]", qos.big, qos.bis, qos.packing, - qos.framing); - } else { - syslog(LOG_INFO, "QoS CIG 0x%02x CIS 0x%02x Packing 0x%02x " - "Framing 0x%02x]", qos.cig, qos.cis, qos.packing, - qos.framing); - syslog(LOG_INFO, "Input QoS [Interval %u us Latency %u " - "ms SDU %u PHY 0x%02x RTN %u]", qos.in.interval, - qos.in.latency, qos.in.sdu, qos.in.phy, qos.in.rtn); + syslog(LOG_INFO, "QoS CIG 0x%02x CIS 0x%02x Packing 0x%02x " + "Framing 0x%02x]", qos.cig, qos.cis, qos.packing, + qos.framing); + syslog(LOG_INFO, "Input QoS [Interval %u us Latency %u " + "ms SDU %u PHY 0x%02x RTN %u]", qos.in.interval, + qos.in.latency, qos.in.sdu, qos.in.phy, qos.in.rtn); + + syslog(LOG_INFO, "Output QoS [Interval %u us Latency %u " + "ms SDU %u PHY 0x%02x RTN %u]", qos.out.interval, + qos.out.latency, qos.out.sdu, qos.out.phy, qos.out.rtn); +} + +static void print_bcast_source_qos(int sk) +{ + struct bt_iso_bcast_source_qos qos; + socklen_t len; + + /* Read Out QOS */ + memset(&qos, 0, sizeof(qos)); + len = sizeof(qos); + + if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_BCAST_SOURCE_QOS, + &qos, &len) < 0) { + syslog(LOG_ERR, "Can't get QoS socket option: %s (%d)", + strerror(errno), errno); + return; } + + syslog(LOG_INFO, "QoS BIG 0x%02x BIS 0x%02x Packing 0x%02x " + "Framing 0x%02x]", qos.big, qos.bis, qos.packing, + qos.framing); + syslog(LOG_INFO, "Output QoS [Interval %u us Latency %u " "ms SDU %u PHY 0x%02x RTN %u]", qos.out.interval, qos.out.latency, qos.out.sdu, qos.out.phy, qos.out.rtn); } +static void print_bcast_sink_qos(int sk) +{ + struct bt_iso_bcast_sink_qos qos; + socklen_t len; + + /* Read Out QOS */ + memset(&qos, 0, sizeof(qos)); + len = sizeof(qos); + + if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_BCAST_SINK_QOS, + &qos, &len) < 0) { + syslog(LOG_ERR, "Can't get QoS socket option: %s (%d)", + strerror(errno), errno); + return; + } + + syslog(LOG_INFO, "QoS BIG 0x%02x", qos.big); + + syslog(LOG_INFO, "Input QoS [Interval %u us Latency %u " + "ms SDU %u PHY 0x%02x RTN %u]", qos.in.interval, + qos.in.latency, qos.in.sdu, qos.in.phy, qos.in.rtn); +} + +static void unicast_qos_to_bcast_source(struct bt_iso_unicast_qos *unicast_qos, + struct bt_iso_bcast_source_qos *source_qos) +{ + memset(source_qos, 0, sizeof(*source_qos)); + + source_qos->sync_interval = unicast_qos->sca; + source_qos->big = unicast_qos->cig; + source_qos->bis = unicast_qos->cis; + source_qos->packing = unicast_qos->packing; + source_qos->framing = unicast_qos->framing; + source_qos->out = unicast_qos->out; +} + static int do_connect(char *peer) { struct sockaddr_iso addr; @@ -306,11 +363,25 @@ static int do_connect(char *peer) iso_qos->in.sdu = 0; } - if (setsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, iso_qos, - sizeof(*iso_qos)) < 0) { - syslog(LOG_ERR, "Can't set QoS socket option: " + if (!strcmp(peer, "00:00:00:00:00:00")) { + struct bt_iso_bcast_source_qos source_qos; + + unicast_qos_to_bcast_source(iso_qos, &source_qos); + + if (setsockopt(sk, SOL_BLUETOOTH, + BT_ISO_BCAST_SOURCE_QOS, &source_qos, + sizeof(source_qos)) < 0) { + syslog(LOG_ERR, "Can't set QoS socket option: " "%s (%d)", strerror(errno), errno); - goto error; + goto error; + } + } else { + if (setsockopt(sk, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, + iso_qos, sizeof(*iso_qos)) < 0) { + syslog(LOG_ERR, "Can't set QoS socket option: " + "%s (%d)", strerror(errno), errno); + goto error; + } } } @@ -338,7 +409,10 @@ static int do_connect(char *peer) syslog(LOG_INFO, "Connected [%s]", peer); - print_qos(sk, &addr); + if (!strcmp(peer, "00:00:00:00:00:00")) + print_bcast_source_qos(sk); + else + print_unicast_qos(sk); return sk; @@ -441,7 +515,10 @@ static void do_listen(char *filename, void (*handler)(int fd, int sk), ba2str(&addr->iso_bdaddr, ba); syslog(LOG_INFO, "Connected [%s]", ba); - print_qos(nsk, addr); + if (peer) + print_bcast_sink_qos(nsk); + else + print_unicast_qos(nsk); /* Handle deferred setup */ if (defer_setup) { @@ -648,7 +725,7 @@ static int read_file(int fd, ssize_t count, bool rewind) return len; } -static void do_send(int sk, int fd, struct bt_iso_qos *qos, uint32_t num, +static void do_send(int sk, int fd, struct bt_iso_io_qos *out, uint32_t num, bool repeat) { uint32_t seq; @@ -662,14 +739,14 @@ static void do_send(int sk, int fd, struct bt_iso_qos *qos, uint32_t num, for (seq = 0; ; seq++) { if (fd >= 0) { - len = read_file(fd, qos->out.sdu, repeat); + len = read_file(fd, out->sdu, repeat); if (len < 0) { syslog(LOG_ERR, "read failed: %s (%d)", strerror(-len), -len); exit(1); } } else - len = qos->out.sdu; + len = out->sdu; len = send(sk, buf, len, 0); if (len <= 0) { @@ -686,16 +763,22 @@ static void do_send(int sk, int fd, struct bt_iso_qos *qos, uint32_t num, seq, len, used / len, used); if (seq && !((seq + 1) % num)) - send_wait(&t_start, num * qos->out.interval); + send_wait(&t_start, num * out->interval); } } static void send_mode(char *filename, char *peer, int i, bool repeat) { - struct bt_iso_qos qos; + struct bt_iso_io_qos *out; socklen_t len; int sk, fd = -1; uint32_t num; + int optname; + + union { + struct bt_iso_bcast_source_qos source_qos; + struct bt_iso_unicast_qos unicast_qos; + } qos; if (filename) { char altername[PATH_MAX]; @@ -728,16 +811,24 @@ static void send_mode(char *filename, char *peer, int i, bool repeat) syslog(LOG_INFO, "Sending ..."); /* Read QoS */ + if (!strcmp(peer, "00:00:00:00:00:00")) { + optname = BT_ISO_BCAST_SOURCE_QOS; + out = &qos.source_qos.out; + } else { + optname = BT_ISO_UNICAST_QOS; + out = &qos.unicast_qos.out; + } + memset(&qos, 0, sizeof(qos)); len = sizeof(qos); - if (getsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len) < 0) { + if (getsockopt(sk, SOL_BLUETOOTH, optname, &qos, &len) < 0) { syslog(LOG_ERR, "Can't get Output QoS socket option: %s (%d)", strerror(errno), errno); - qos.out.sdu = ISO_DEFAULT_MTU; + out->sdu = ISO_DEFAULT_MTU; } /* num of packets = latency (ms) / interval (us) */ - num = (qos.out.latency * 1000 / qos.out.interval); + num = (out->latency * 1000 / out->interval); syslog(LOG_INFO, "Number of packets: %d", num); @@ -746,8 +837,8 @@ static void send_mode(char *filename, char *peer, int i, bool repeat) * latency: * jitter buffer = 2 * (SDU * subevents) */ - sndbuf = 2 * ((qos.out.latency * 1000 / qos.out.interval) * - qos.out.sdu); + sndbuf = 2 * ((out->latency * 1000 / out->interval) * + out->sdu); len = sizeof(sndbuf); if (setsockopt(sk, SOL_SOCKET, SO_SNDBUF, &sndbuf, len) < 0) { @@ -768,10 +859,10 @@ static void send_mode(char *filename, char *peer, int i, bool repeat) } } - for (i = 6; i < qos.out.sdu; i++) + for (i = 6; i < out->sdu; i++) buf[i] = 0x7f; - do_send(sk, fd, &qos, num, repeat); + do_send(sk, fd, out, num, repeat); } static void reconnect_mode(char *peer) @@ -844,7 +935,7 @@ static void multy_connect_mode(char *peer) static struct qos_preset { const char *name; bool inout; - struct bt_iso_qos qos; + struct bt_iso_unicast_qos qos; } presets[] = { /* QoS Configuration settings for low latency audio data */ QOS_PRESET("8_1_1", true, 7500, 8, 26, 0x02, 2), From patchwork Mon Mar 20 14:37:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iulia Tanasescu X-Patchwork-Id: 13181339 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90565C7618A for ; Mon, 20 Mar 2023 14:40:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231862AbjCTOkG (ORCPT ); Mon, 20 Mar 2023 10:40:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231834AbjCTOjc (ORCPT ); Mon, 20 Mar 2023 10:39:32 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2049.outbound.protection.outlook.com [40.107.21.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AF38252A6 for ; Mon, 20 Mar 2023 07:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XFGz/nk4ZXFJlpPXm/7yeyWxdXyJFmCUWWwcqVk+VKAfTOXWZeo3tlOnd1L4AeXsn2g98bDjEnj+e4isc2eJVlvPE+jvW+ldKgCMHDMMUznH7dbyhQNwP2BNi9ECbhPI1pDBLwDR8UElCgQIN+AE0zjz80CwtKIa1kSr+HLt9ZpDIzaeB2jLF7NsrBd+m59pAc+B8zKiEV1hAEQsSpHweMKFlhgyAW/pbyq74VZGBTzZiRG21/3sbvCfvUn1InKgTFTCVJzAXWDtE4qceHB9MTBjEOp7VV485U9h/wYT6re08oElZ685TFrmY9ZLMgTLN3Og/7wh5fIE5NGqeutKIQ== 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=NwO7QxuEMM0nKL0CNUeTZsGstAyZ++3JC0cSHXNsZfc=; b=AFacp/PtJQocSflJxYHzGpN8Jm8N52tnLEf6ql7tZ/Sk5A1w2q359UzMoMkEn0fWeKTLD1bbaJcRMnNnMyfFW0Tq968Y6PESfdYHzQY51LFRa0EHFAVWBU/GTcN75KS07Xejpf4IHibhT11lrPSfbwFudiYXuXzlwuJmcICPjqUzKufSvPBSzQ4I1E7WhDUFIwjLzCJ0JY2aLM8ULfmiB+zQDpvHC1BEbh1g7kZHALxFsQOvyFAcdcj/UAwMwtMgCnmDlgohaYpimt39vrwny1uAraZDUSMiN/gtOz41agU5K2BKOBTmoiklrIeZgKGvmSdQ3b2tTh3ttWmv3b5knA== 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=NwO7QxuEMM0nKL0CNUeTZsGstAyZ++3JC0cSHXNsZfc=; b=ZOIvnkTZr0AVbvkeEYhkpe9hpT+scLtTxpf7AxzUlSHDOjoXtPd407d7kqGhkfY7167/Y7udmnVJPZMkeJNouqoTx0fd0ZrxDt3ertXh0W4Y2XSTpuuxX1h+zeVsogl4zQPKWlcV1W2Pm8pg57JUbFXTmuVGNMVEJKeGIJEeDnw= 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 VE1PR04MB7231.eurprd04.prod.outlook.com (2603:10a6:800:1a9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 14:37:44 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::e463:bd8b:f1cf:9a98%8]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 14:37:44 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: Iulia Tanasescu Subject: [PATCH BlueZ 8/8] tools/iso-tester: Use dedicated ISO QoS options for unicast and broadcast Date: Mon, 20 Mar 2023 16:37:13 +0200 Message-Id: <20230320143713.25449-9-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230320143713.25449-1-iulia.tanasescu@nxp.com> References: <20230320143713.25449-1-iulia.tanasescu@nxp.com> X-ClientProxiedBy: AM3PR07CA0147.eurprd07.prod.outlook.com (2603:10a6:207:8::33) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|VE1PR04MB7231:EE_ X-MS-Office365-Filtering-Correlation-Id: 1cc8f048-71bb-4087-c136-08db2950aa95 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lQ55kL9QuuxP+uVicrUQ4mozEj+uuoJvgKm0QKbdJO9oyu2y1Nso7cDbvOH0ZEKZxAAt+7f8ZEqLs97hfyFXlNES12j7q5CWiyrFcriSkK3olbiZ72lesaQ19BPlMCkZe+al3+CRmp3ma+ytRQfP16oBDnOiRLkUv+rWHP8rJcQ3lIFJ7VMTF5VUX6n9wxKvd3KzvOwa7CepwoFuAEU3W3kFEHxJcrHGOhOSafTwIF8Na5tu9wRQjbNy0MIub6lh0f1TrccZq06gezOuxVo7+J6ZEOEj3JBMM/9a64vprSFoto/4l7GLin+BZ8iNmIEq9scuQ+LaHzT3TP6XABH9H+SpsGz0Rc1DIA93BKYUUHpdHwNYEfZBxGZJu0HQOVQKpIroAJmDy3zUwz1PRTfTSNr9xsIz2dV0CiueaiRzrPm6Lu8jVIbyBpglt7cmKSSFNPzq8OrDNMRej5j+Qt/YN6sr+akA5ua8KDxrxger+YVTkeYRbtbL3VIVcCHSr8lDL/PsNktJ5lVJVBPYZJKQfoZp1eI+K37iDxQkJSbT07OTNQ+asJWRazzyWdgKJhGCcM8KLzz0TIX/VBa3yHa2aQazeydMKW8fyPBcAQSSC/MKes9GJnrrWDtYjpVe/0ErcT0vlOjpx7nmJEUzScF4D3TyVpRrlMliR+SAFj/xAbJ823vO1A8X32uR0HB01YT7 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:(13230025)(4636009)(39860400002)(396003)(366004)(136003)(376002)(346002)(451199018)(6506007)(2616005)(1076003)(55236004)(26005)(6512007)(6666004)(6486002)(8676002)(4326008)(83380400001)(52116002)(316002)(186003)(66476007)(478600001)(66946007)(6916009)(30864003)(8936002)(5660300002)(44832011)(2906002)(41300700001)(38100700002)(38350700002)(86362001)(66556008)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JnrWBu8Eq5yXl6Tk1lFERv/oTTO5htaWdxUwQYSuRRuwqrkZMO10iM3Kdt1hvKY6yguMzSD7nz/CmCKfaPAczK+4QE8yCbR372/GPZrxkDXf9/o54mz7i5pY8vtq/HV/F7OxnQ0r42UJQKSvW6UPrV1sAKhuWAXmUHqgWjxjXkxH4HjUVdCCEVC6A4DPDFzzXGs7CVPkS/ZCDf6i8FHTdikYzzYJ0+hv+/aBqlhGkEpck3tX9bgZPyGFTLxsrY+8OmyEdUtwx39dhMc5a54PWilL+XHe8ACNPGO2YneVZZJI6YHa/lU7N7IiWqyjdTzBoOHPx1oeWyqrHhxhPkmGfLAfwDhIX8eyEh6U/csTpPu2XsTDJMtzJ9iSZELoJbSUCbV8sk4tenRvvkMQDXoo0vZ0lyA04frBS4LPADalI0HJWqqbTOqd4cbZG/Kxw3lbHJ6aiIH6ZUrrxEztesO6Fl834zRTYPyiFaj1J8VWXG3ph2Bn78yBdKqW7+ipc61aAL/+R3gC3LY8eWvf423s0Fxd4uhVuCWq0W8GpJXpdItee85Enq5awS40VsOpNAkcwXNs9P3ym8Wek1C4qf699j1DtoTOTqF1zxzahEZdd8rqZFmbthPutCZGw2tJqpeV9W/DXFMfRt2e3NqXKs3NO4cRgNKJ9SkVt1D2Hn0OptQyovxIv0rLQPwr6+DtjNUkqh2OOTMD5856z8zWpXahQMOLHRkSK9FKMDQI/DSRUS5PY16FOhhZ8Modek+RryLnn1PLUuFJ7xRB/dJw07M0pHzFAVnuk8wv6ZHGaq4tS7UE1stzbEamnlhWLySgHCiDmml+J1FG7ugO7ssP0r/lrePW3rNE8CPHInTlHXM3qx9Ia1Vwo5W5XMoxu9i1uLKTc9pemenbqnZ8eRNA1R9MfABBIZdQ/LwZQs9Fz4ghyBF1GqXk2zGWeFUdFsBV6Sy4F+f/iKmDAovm+AjpOLNtJlzY1dsH7ckxPy1pXI0ankN6jzBuUuqvrBbPy+CpatbhmZPke4ExYMdWigd/bRKclGjVtG3dl03cVtvTNLJzz0eOphJ2kU5jlwb/vEkozRaCadKgD1nlm4E0I2kPrkc1ffPCy7CGVdT9DWEv5HoDtT47ji3AP3MQscEXszL0GluA8v2AKjau9ahhKYUSc63V3P2zrHOdgiagzl4KivLGPSojaKWBCXX4LFAuR62aurskMYgJjJzLGwvaWoBqLpFgkvQs3ZS4liQUnme1sJLgTIC9p6+uvjXN5Cwaaiz9mNRH1/hysYnRpinAk8ERNKHpjPuFnnZxCMu3RsOPIg1Ujx5esz4Y8JapSHa3TGzEEVWW7ShFwdM1j6y1JcDOrtroAu+QiVERrBYz2l69p0tJ3Rig1IDefnkZ4KjoI7W4i2FMUF+9MUVV6ZDVJQw9IEY5Kp+6N6ETYMQXRftykF/x5GnB0LgSGe0yWIHCO9KLcDqNIUciK5mT2ePB40g1PD8YPGF+jzWBarCIMqs9R81yBkijJWq9KwTP7ltICegn6x66Z1BVcr7OeIrzl/43ZdFjeAIu2Oi/UqyUhdzkWsKNoHu8Xa0bYw7+IkR8mtaZxZjFSBEETB3iNpMNtxsID2NTog== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1cc8f048-71bb-4087-c136-08db2950aa95 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 14:37:44.0682 (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: 3CwSVdHgTDMUu1mXReqHzu+G8CRCusN2rIBweTHU1olZwe9L0G3MJ4zuMF5+g5k6zUPRdfat4pMTHmJoqjKr4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7231 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Convert the generic bt_iso_qos structure into dedicated ISO QoS structures for unicast or broadcast. --- tools/iso-tester.c | 270 +++++++++++++++++++++++++++++++++------------ 1 file changed, 200 insertions(+), 70 deletions(-) diff --git a/tools/iso-tester.c b/tools/iso-tester.c index e4582573a..a763c6a09 100644 --- a/tools/iso-tester.c +++ b/tools/iso-tester.c @@ -4,6 +4,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2022 Intel Corporation. + * Copyright 2023 NXP * */ @@ -119,10 +120,52 @@ #define QOS_48_5_2 QOS_OUT(7500, 75, 117, 0x02, 13) #define QOS_48_6_2 QOS_OUT(10000, 100, 155, 0x02, 13) -#define QOS_OUT_16_2_1 QOS_OUT(10000, 10, 40, 0x02, 2) -#define QOS_OUT_1_16_2_1 QOS_OUT_1(10000, 10, 40, 0x02, 2) -#define QOS_OUT_1_1_16_2_1 QOS_OUT_1_1(10000, 10, 40, 0x02, 2) -#define QOS_IN_16_2_1 QOS_IN(10000, 10, 40, 0x02, 2) +#define QOS_SINK_FULL(_big, _in) \ +{ \ + .options = 0x00, \ + .skip = 0x0000, \ + .sync_timeout = 0x4000, \ + .sync_cte_type = 0x00, \ + .big = _big, \ + .encryption = 0x00, \ + .bcode = {0}, \ + .mse = 0x00, \ + .timeout = 0x4000, \ + .in = _in, \ +} + +#define QOS_SOURCE_FULL(_big, _bis, _out) \ +{ \ + .sync_interval = 0x07, \ + .big = _big, \ + .bis = _bis, \ + .packing = 0x00, \ + .framing = 0x00, \ + .encryption = 0x00, \ + .bcode = {0}, \ + .out = _out, \ +} + +#define BCAST_QOS_OUT(_interval, _latency, _sdu, _phy, _rtn) \ + QOS_SOURCE_FULL(BT_ISO_QOS_BIG_UNSET, BT_ISO_QOS_BIS_UNSET, \ + QOS_IO(_interval, _latency, _sdu, _phy, _rtn)) + +#define BCAST_QOS_OUT_1(_interval, _latency, _sdu, _phy, _rtn) \ + QOS_SOURCE_FULL(0x01, BT_ISO_QOS_BIS_UNSET, \ + QOS_IO(_interval, _latency, _sdu, _phy, _rtn)) + +#define BCAST_QOS_OUT_1_1(_interval, _latency, _sdu, _phy, _rtn) \ + QOS_SOURCE_FULL(0x01, 0x01, \ + QOS_IO(_interval, _latency, _sdu, _phy, _rtn)) + +#define BCAST_QOS_IN(_interval, _latency, _sdu, _phy, _rtn) \ + QOS_SINK_FULL(BT_ISO_QOS_BIG_UNSET, \ + QOS_IO(_interval, _latency, _sdu, _phy, _rtn)) + +#define QOS_OUT_16_2_1 BCAST_QOS_OUT(10000, 10, 40, 0x02, 2) +#define QOS_OUT_1_16_2_1 BCAST_QOS_OUT_1(10000, 10, 40, 0x02, 2) +#define QOS_OUT_1_1_16_2_1 BCAST_QOS_OUT_1_1(10000, 10, 40, 0x02, 2) +#define QOS_IN_16_2_1 BCAST_QOS_IN(10000, 10, 40, 0x02, 2) struct test_data { const void *test_data; @@ -141,7 +184,9 @@ struct test_data { }; struct iso_client_data { - struct bt_iso_qos qos; + struct bt_iso_unicast_qos unicast_qos; + struct bt_iso_bcast_sink_qos sink_qos; + struct bt_iso_bcast_source_qos source_qos; int expect_err; const struct iovec *send; const struct iovec *recv; @@ -369,182 +414,182 @@ static void test_data_free(void *test_data) test_iso_full(name, data, setup, func, 1, reason) static const struct iso_client_data connect_8_1_1 = { - .qos = QOS_8_1_1, + .unicast_qos = QOS_8_1_1, .expect_err = 0 }; static const struct iso_client_data connect_8_2_1 = { - .qos = QOS_8_2_1, + .unicast_qos = QOS_8_2_1, .expect_err = 0 }; static const struct iso_client_data connect_16_1_1 = { - .qos = QOS_16_1_1, + .unicast_qos = QOS_16_1_1, .expect_err = 0 }; static const struct iso_client_data connect_16_2_1 = { - .qos = QOS_16_2_1, + .unicast_qos = QOS_16_2_1, .expect_err = 0 }; static const struct iso_client_data connect_1_16_2_1 = { - .qos = QOS_1_16_2_1, + .unicast_qos = QOS_1_16_2_1, .expect_err = 0 }; static const struct iso_client_data connect_1_1_16_2_1 = { - .qos = QOS_1_1_16_2_1, + .unicast_qos = QOS_1_1_16_2_1, .expect_err = 0 }; static const struct iso_client_data connect_24_1_1 = { - .qos = QOS_24_1_1, + .unicast_qos = QOS_24_1_1, .expect_err = 0 }; static const struct iso_client_data connect_24_2_1 = { - .qos = QOS_24_2_1, + .unicast_qos = QOS_24_2_1, .expect_err = 0 }; static const struct iso_client_data connect_32_1_1 = { - .qos = QOS_32_1_1, + .unicast_qos = QOS_32_1_1, .expect_err = 0 }; static const struct iso_client_data connect_32_2_1 = { - .qos = QOS_32_2_1, + .unicast_qos = QOS_32_2_1, .expect_err = 0 }; static const struct iso_client_data connect_44_1_1 = { - .qos = QOS_44_1_1, + .unicast_qos = QOS_44_1_1, .expect_err = 0 }; static const struct iso_client_data connect_44_2_1 = { - .qos = QOS_44_2_1, + .unicast_qos = QOS_44_2_1, .expect_err = 0 }; static const struct iso_client_data connect_48_1_1 = { - .qos = QOS_48_1_1, + .unicast_qos = QOS_48_1_1, .expect_err = 0 }; static const struct iso_client_data connect_48_2_1 = { - .qos = QOS_48_2_1, + .unicast_qos = QOS_48_2_1, .expect_err = 0 }; static const struct iso_client_data connect_48_3_1 = { - .qos = QOS_48_3_1, + .unicast_qos = QOS_48_3_1, .expect_err = 0 }; static const struct iso_client_data connect_48_4_1 = { - .qos = QOS_48_4_1, + .unicast_qos = QOS_48_4_1, .expect_err = 0 }; static const struct iso_client_data connect_48_5_1 = { - .qos = QOS_48_5_1, + .unicast_qos = QOS_48_5_1, .expect_err = 0 }; static const struct iso_client_data connect_48_6_1 = { - .qos = QOS_48_6_1, + .unicast_qos = QOS_48_6_1, .expect_err = 0 }; static const struct iso_client_data connect_8_1_2 = { - .qos = QOS_8_1_2, + .unicast_qos = QOS_8_1_2, .expect_err = 0 }; static const struct iso_client_data connect_8_2_2 = { - .qos = QOS_8_2_2, + .unicast_qos = QOS_8_2_2, .expect_err = 0 }; static const struct iso_client_data connect_16_1_2 = { - .qos = QOS_16_1_2, + .unicast_qos = QOS_16_1_2, .expect_err = 0 }; static const struct iso_client_data connect_16_2_2 = { - .qos = QOS_16_2_2, + .unicast_qos = QOS_16_2_2, .expect_err = 0 }; static const struct iso_client_data connect_24_1_2 = { - .qos = QOS_24_1_2, + .unicast_qos = QOS_24_1_2, .expect_err = 0 }; static const struct iso_client_data connect_24_2_2 = { - .qos = QOS_24_2_2, + .unicast_qos = QOS_24_2_2, .expect_err = 0 }; static const struct iso_client_data connect_32_1_2 = { - .qos = QOS_32_1_2, + .unicast_qos = QOS_32_1_2, .expect_err = 0 }; static const struct iso_client_data connect_32_2_2 = { - .qos = QOS_32_2_2, + .unicast_qos = QOS_32_2_2, .expect_err = 0 }; static const struct iso_client_data connect_44_1_2 = { - .qos = QOS_44_1_2, + .unicast_qos = QOS_44_1_2, .expect_err = 0 }; static const struct iso_client_data connect_44_2_2 = { - .qos = QOS_44_2_2, + .unicast_qos = QOS_44_2_2, .expect_err = 0 }; static const struct iso_client_data connect_48_1_2 = { - .qos = QOS_48_1_2, + .unicast_qos = QOS_48_1_2, .expect_err = 0 }; static const struct iso_client_data connect_48_2_2 = { - .qos = QOS_48_2_2, + .unicast_qos = QOS_48_2_2, .expect_err = 0 }; static const struct iso_client_data connect_48_3_2 = { - .qos = QOS_48_3_2, + .unicast_qos = QOS_48_3_2, .expect_err = 0 }; static const struct iso_client_data connect_48_4_2 = { - .qos = QOS_48_4_2, + .unicast_qos = QOS_48_4_2, .expect_err = 0 }; static const struct iso_client_data connect_48_5_2 = { - .qos = QOS_48_5_2, + .unicast_qos = QOS_48_5_2, .expect_err = 0 }; static const struct iso_client_data connect_48_6_2 = { - .qos = QOS_48_6_2, + .unicast_qos = QOS_48_6_2, .expect_err = 0 }; static const struct iso_client_data connect_invalid = { - .qos = QOS(0, 0, 0, 0, 0), + .unicast_qos = QOS(0, 0, 0, 0, 0), .expect_err = -EINVAL }; static const struct iso_client_data connect_reject = { - .qos = QOS_16_1_2, + .unicast_qos = QOS_16_1_2, .expect_err = -ENOSYS }; @@ -561,20 +606,20 @@ static const struct iovec send_48_2_1 = { }; static const struct iso_client_data connect_16_2_1_send = { - .qos = QOS_16_2_1, + .unicast_qos = QOS_16_2_1, .expect_err = 0, .send = &send_16_2_1, }; static const struct iso_client_data listen_16_2_1_recv = { - .qos = QOS_16_2_1, + .unicast_qos = QOS_16_2_1, .expect_err = 0, .recv = &send_16_2_1, .server = true, }; static const struct iso_client_data listen_16_2_1_recv_ts = { - .qos = QOS_16_2_1, + .unicast_qos = QOS_16_2_1, .expect_err = 0, .recv = &send_16_2_1, .server = true, @@ -582,27 +627,27 @@ static const struct iso_client_data listen_16_2_1_recv_ts = { }; static const struct iso_client_data defer_16_2_1 = { - .qos = QOS_16_2_1, + .unicast_qos = QOS_16_2_1, .expect_err = 0, .defer = true, }; static const struct iso_client_data connect_16_2_1_defer_send = { - .qos = QOS_16_2_1, + .unicast_qos = QOS_16_2_1, .expect_err = 0, .send = &send_16_2_1, .defer = true, }; static const struct iso_client_data connect_48_2_1_defer_send = { - .qos = QOS_48_2_1, + .unicast_qos = QOS_48_2_1, .expect_err = 0, .send = &send_16_2_1, .defer = true, }; static const struct iso_client_data listen_16_2_1_defer_recv = { - .qos = QOS_16_2_1, + .unicast_qos = QOS_16_2_1, .expect_err = 0, .recv = &send_16_2_1, .server = true, @@ -610,7 +655,7 @@ static const struct iso_client_data listen_16_2_1_defer_recv = { }; static const struct iso_client_data listen_48_2_1_defer_recv = { - .qos = QOS_48_2_1, + .unicast_qos = QOS_48_2_1, .expect_err = 0, .recv = &send_48_2_1, .server = true, @@ -618,7 +663,7 @@ static const struct iso_client_data listen_48_2_1_defer_recv = { }; static const struct iso_client_data listen_16_2_1_defer_reject = { - .qos = QOS_16_2_1, + .unicast_qos = QOS_16_2_1, .expect_err = -1, .recv = &send_16_2_1, .server = true, @@ -626,50 +671,51 @@ static const struct iso_client_data listen_16_2_1_defer_reject = { }; static const struct iso_client_data connect_16_2_1_send_recv = { - .qos = QOS_16_2_1, + .unicast_qos = QOS_16_2_1, .expect_err = 0, .send = &send_16_2_1, .recv = &send_16_2_1, }; static const struct iso_client_data disconnect_16_2_1 = { - .qos = QOS_16_2_1, + .unicast_qos = QOS_16_2_1, .expect_err = 0, .disconnect = true, }; static const struct iso_client_data reconnect_16_2_1 = { - .qos = QOS_16_2_1, + .unicast_qos = QOS_16_2_1, .expect_err = 0, .disconnect = true, }; static const struct iso_client_data bcast_16_2_1_send = { - .qos = QOS_OUT_16_2_1, + .source_qos = QOS_OUT_16_2_1, .expect_err = 0, .send = &send_16_2_1, .bcast = true, }; static const struct iso_client_data bcast_1_16_2_1_send = { - .qos = QOS_OUT_1_16_2_1, + .source_qos = QOS_OUT_1_16_2_1, .expect_err = 0, .send = &send_16_2_1, .bcast = true, }; static const struct iso_client_data bcast_1_1_16_2_1_send = { - .qos = QOS_OUT_1_1_16_2_1, + .source_qos = QOS_OUT_1_1_16_2_1, .expect_err = 0, .send = &send_16_2_1, .bcast = true, }; static const struct iso_client_data bcast_16_2_1_recv = { - .qos = QOS_IN_16_2_1, + .sink_qos = QOS_IN_16_2_1, .expect_err = 0, .recv = &send_16_2_1, .bcast = true, + .server = true, }; static void client_connectable_complete(uint16_t opcode, uint8_t status, @@ -854,7 +900,7 @@ static void test_getsockopt(const void *test_data) { int sk, err; socklen_t len; - struct bt_iso_qos qos; + struct bt_iso_unicast_qos qos; sk = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_ISO); if (sk < 0) { @@ -867,7 +913,7 @@ static void test_getsockopt(const void *test_data) len = sizeof(qos); memset(&qos, 0, len); - err = getsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len); + err = getsockopt(sk, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, &qos, &len); if (err < 0) { tester_warn("Can't get socket option : %s (%d)", strerror(errno), errno); @@ -885,7 +931,7 @@ static void test_setsockopt(const void *test_data) { int sk, err; socklen_t len; - struct bt_iso_qos qos = QOS_16_1_2; + struct bt_iso_unicast_qos qos = QOS_16_1_2; sk = socket(PF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_ISO); if (sk < 0) { @@ -895,7 +941,8 @@ static void test_setsockopt(const void *test_data) goto end; } - err = setsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, sizeof(qos)); + err = setsockopt(sk, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, + &qos, sizeof(qos)); if (err < 0) { tester_warn("Can't set socket option : %s (%d)", strerror(errno), errno); @@ -906,7 +953,7 @@ static void test_setsockopt(const void *test_data) len = sizeof(qos); memset(&qos, 0, len); - err = getsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len); + err = getsockopt(sk, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, &qos, &len); if (err < 0) { tester_warn("Can't get socket option : %s (%d)", strerror(errno), errno); @@ -1004,8 +1051,14 @@ static int connect_iso_sock(struct test_data *data, uint8_t num, int sk) } } - err = setsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &isodata->qos, - sizeof(isodata->qos)); + if (!isodata->bcast) + err = setsockopt(sk, SOL_BLUETOOTH, BT_ISO_UNICAST_QOS, + &isodata->unicast_qos, sizeof(isodata->unicast_qos)); + else { + err = setsockopt(sk, SOL_BLUETOOTH, BT_ISO_BCAST_SOURCE_QOS, + &isodata->source_qos, sizeof(isodata->source_qos)); + } + if (err < 0) { tester_warn("Can't set socket BT_ISO_QOS option : %s (%d)", strerror(errno), errno); @@ -1080,8 +1133,8 @@ static bool check_io_qos(const struct bt_iso_io_qos *io1, return true; } -static bool check_qos(const struct bt_iso_qos *qos1, - const struct bt_iso_qos *qos2) +static bool check_unicast_qos(const struct bt_iso_unicast_qos *qos1, + const struct bt_iso_unicast_qos *qos2) { if (qos1->cig != BT_ISO_QOS_CIG_UNSET && qos2->cig != BT_ISO_QOS_CIG_UNSET && @@ -1124,6 +1177,62 @@ static bool check_qos(const struct bt_iso_qos *qos1, return true; } +static bool check_bcast_source_qos(const struct bt_iso_bcast_source_qos *qos1, + const struct bt_iso_bcast_source_qos *qos2) +{ + if (qos1->sync_interval != qos2->sync_interval) { + tester_warn("Unexpected QoS sync interval: 0x%02x != 0x%02x", + qos1->sync_interval, qos2->sync_interval); + return false; + } + + if (qos1->big != BT_ISO_QOS_BIG_UNSET && + qos2->big != BT_ISO_QOS_BIG_UNSET && + qos1->big != qos2->big) { + tester_warn("Unexpected BIG ID: 0x%02x != 0x%02x", + qos1->big, qos2->big); + return false; + } + + if (qos1->bis != BT_ISO_QOS_BIS_UNSET && + qos2->bis != BT_ISO_QOS_BIS_UNSET && + qos1->bis != qos2->bis) { + tester_warn("Unexpected BIS ID: 0x%02x != 0x%02x", + qos1->bis, qos2->bis); + return false; + } + + if (qos1->packing != qos2->packing) { + tester_warn("Unexpected QoS packing: 0x%02x != 0x%02x", + qos1->packing, qos2->packing); + return false; + } + + if (qos1->framing != qos2->framing) { + tester_warn("Unexpected QoS framing: 0x%02x != 0x%02x", + qos1->framing, qos2->framing); + return false; + } + + if (qos1->encryption != qos2->encryption) { + tester_warn("Unexpected QoS encryption: 0x%02x != 0x%02x", + qos1->encryption, qos2->encryption); + return false; + } + + if (memcmp(qos1->bcode, qos2->bcode, sizeof(qos1->bcode))) { + tester_warn("Unexpected QoS Broadcast Code"); + return false; + } + + if (!check_io_qos(&qos1->out, &qos2->out)) { + tester_warn("Unexpected Output QoS"); + return false; + } + + return true; +} + static gboolean iso_recv_data(GIOChannel *io, GIOCondition cond, gpointer user_data) { @@ -1249,14 +1358,28 @@ static gboolean iso_connect(GIOChannel *io, GIOCondition cond, const struct iso_client_data *isodata = data->test_data; int err, sk_err, sk; socklen_t len; - struct bt_iso_qos qos; + int optname; + bool ret = true; + + union { + struct bt_iso_unicast_qos unicast_qos; + struct bt_iso_bcast_sink_qos sink_qos; + struct bt_iso_bcast_source_qos source_qos; + } qos; sk = g_io_channel_unix_get_fd(io); + if (!isodata->bcast) + optname = BT_ISO_UNICAST_QOS; + else if (isodata->server) + optname = BT_ISO_BCAST_SINK_QOS; + else + optname = BT_ISO_BCAST_SOURCE_QOS; + len = sizeof(qos); memset(&qos, 0, len); - err = getsockopt(sk, SOL_BLUETOOTH, BT_ISO_QOS, &qos, &len); + err = getsockopt(sk, SOL_BLUETOOTH, optname, &qos, &len); if (err < 0) { tester_warn("Can't get socket option : %s (%d)", strerror(errno), errno); @@ -1264,7 +1387,14 @@ static gboolean iso_connect(GIOChannel *io, GIOCondition cond, return FALSE; } - if (!check_qos(&qos, &isodata->qos)) { + if (!isodata->bcast) + ret = check_unicast_qos(&qos.unicast_qos, + &isodata->unicast_qos); + else if (!isodata->server) + ret = check_bcast_source_qos(&qos.source_qos, + &isodata->source_qos); + + if (!ret) { tester_warn("Unexpected QoS parameter"); tester_test_failed(); return FALSE; @@ -1579,7 +1709,7 @@ static void setup_listen(struct test_data *data, uint8_t num, GIOFunc func) client = hciemu_get_client(data->hciemu, 0); host = hciemu_client_host(client); - bthost_set_cig_params(host, 0x01, 0x01, &isodata->qos); + bthost_set_cig_params(host, 0x01, 0x01, &isodata->unicast_qos); bthost_create_cis(host, 257, data->acl_handle); } }