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: 665281 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: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: 665280 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: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: 665279 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: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: 665278 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),