Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp2004340rdb; Tue, 3 Oct 2023 07:37:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpitpkzM6rd5YZFvk8g8cNOWzpurFlSMyBM7eNXiGcFRpIgc4S2rQwrLUpd4TB/gUwZzD+ X-Received: by 2002:a17:903:228a:b0:1bf:2e5c:7367 with SMTP id b10-20020a170903228a00b001bf2e5c7367mr18814511plh.42.1696343876361; Tue, 03 Oct 2023 07:37:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696343876; cv=pass; d=google.com; s=arc-20160816; b=blXbAmEz6O9kep6JK2VYVoddAdmgyWbav+kDH/XATVRjuN+d+xweg6/FBc0fvRtaD6 MEvtrf87CQh+gJPshe9qvndfZU5PQrmZlyc379/pCp9tRO79OdDFJk/V48BEgk72ydYf eXOAIRdOvc7ic/RjJHs/1WvfN9CuH2PjvhcD4Ha/PWkziSm1hrDu4dttxRPdM0ftN9e7 Pj9svmJerYo1UVqCyr3wEOUuSjR5nZg+jdYLdhhWBEQ4xKFHcPvlr2Wrdj1BewBBeddI UCVT3EaIpbJ7RhB5oSJyI1UrBhakDr/RLSIFUEfhyDmorvUDJejx6HMyL7276xJ6oqyD WK9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=17SPUyvtHlFN7eSR/SdGzcvd+XbJQcSrexU17oOEc+o=; fh=gOZmdXQWWYi2KI/CDlaL8bHElbVrtxjT8kPXxzTdvp8=; b=yaHp5grwUqqPsbgi0B4w3bsVMNPTd6rXTUeqMku5kZ4GKYbgUU8dWWDSy3jD819eKi 9HAWNRoFNKtICyofhZ7JjNW7uV34o3znOg+3N2J/HMS540duG+oKbxO9Ip1MczGm+SIB fwDcHaZU19dRpjqbHtNAPQPsBZy9ZSOLynTPxlbWzylWKu5lTizqkLGqBDSQ0LsaVmF6 JaKp1+VhZvMHzlIff7dcWpZlzXhKOQ3pew8jyIDfCmGKlzFZHIkdQOvLDQ2QNlow8BBx YbkGkU4NpQnaqY3Z48i3He8/JUAUxFFMtQiOgjNArzvnXjxyuZbrjYLphBhCtzBTlQNm l2Wg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="HMoJGCy/"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id ij21-20020a170902ab5500b001c386f8dd0asi1548129plb.179.2023.10.03.07.37.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 07:37:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="HMoJGCy/"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4F08C80BA967; Tue, 3 Oct 2023 07:37:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232488AbjJCOhx (ORCPT + 99 others); Tue, 3 Oct 2023 10:37:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235755AbjJCOhw (ORCPT ); Tue, 3 Oct 2023 10:37:52 -0400 Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2082.outbound.protection.outlook.com [40.107.247.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FCF8AB for ; Tue, 3 Oct 2023 07:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eBU97v4uY3Ie5xEnX5Tq+FVRLEylBXrULBwfkT1yD1BYfPp/cEwz96ViLuCoGMQjKKWlIXRXvvkHVGyI4a4r+3HtpgLK4tNIj2rbCEpoIou6LcoI7JylX9Qig7302mi9wtuRb6lvKLqNVte8pPxEO7aEe6EDxObF9+3ZOtfbw5w2Fy1IIPKHjETTfycbMd74aQlEwanp0WuC35dfkMkIigUH6RXi+9P1mPxEyVcEDsfHJNJ2tfuuHFeX+ih3U6qPa6qysayeTs8f1ZC1J0OU7eSzGcPJS1j38gNk7VgQ8AJgHoeL726uLygsIy71uNZsiQzGJBLK405NdSiX8/TQ+Q== 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=17SPUyvtHlFN7eSR/SdGzcvd+XbJQcSrexU17oOEc+o=; b=n7hqrpuJqXLlnEWVtYiweWKwYZx0ddL6fy6h4Xr+7NMgAqgtW1ckJHYt9HEOXfuZ3fJcU39sgmB6lVfFTdkMM8ez0UnvT5eIdDwJHApKSw3W4YBbU3qDugvX2PLk1I4tOB4nS4HjD05cWBeyDUR/n9k+yGlTiCZeSqBIZTr7JztC/Q/zSjZjZXTAPm9o+VT93D+QRYAmoXzkap64yuZOIX4/aMl3NCd8+glzJX/QmQnEq78BA39w1L0nruwNq0PITVvWBhEEVzdA0Sr/1Fmk6shCo8YZxR+weRoEM8bXE6C/0Zsh2Hm0GjCCxQzgDWijPMfkE9ccjLCaSVSA8Hs9PA== 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=17SPUyvtHlFN7eSR/SdGzcvd+XbJQcSrexU17oOEc+o=; b=HMoJGCy/TH1cgYxJKeHhNixJdwOCo/bKRDvJSQ7qhh8BtLx+4m/7fVzjhW8l+x0D8az9HbqmA9q/k6ne+83nnbfk2VXgaV75vrJ70M6tKaWkzcim4/Kwr7wjOG2spdKGakLVlViODiwWlMXmllBL7DOyKCuis8yjKdBx+bopHwQ= 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 DBBPR04MB7882.eurprd04.prod.outlook.com (2603:10a6:10:1e7::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Tue, 3 Oct 2023 14:37:47 +0000 Received: from AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::7763:779b:1a89:47da]) by AS8PR04MB8898.eurprd04.prod.outlook.com ([fe80::7763:779b:1a89:47da%3]) with mapi id 15.20.6838.024; Tue, 3 Oct 2023 14:37:47 +0000 From: Iulia Tanasescu To: linux-bluetooth@vger.kernel.org Cc: claudia.rosu@nxp.com, mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, Iulia Tanasescu Subject: [PATCH 1/1] Bluetooth: ISO: Match QoS adv handle with BIG handle Date: Tue, 3 Oct 2023 17:37:39 +0300 Message-Id: <20231003143739.2925-2-iulia.tanasescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231003143739.2925-1-iulia.tanasescu@nxp.com> References: <20231003143739.2925-1-iulia.tanasescu@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: VI1PR07CA0281.eurprd07.prod.outlook.com (2603:10a6:803:b4::48) To AS8PR04MB8898.eurprd04.prod.outlook.com (2603:10a6:20b:42d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8PR04MB8898:EE_|DBBPR04MB7882:EE_ X-MS-Office365-Filtering-Correlation-Id: d1399659-798a-4e3a-6f04-08dbc41e4fb1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KtN+5ZK0v3inuj4kUFEIZfV7PEF97SZXveszuFO+PNH6RdawmtRw+OqZ6f0fyzICKiGxoAfewv1W+n7zi18vJS99uLL2aFC7/bxkGoVgICKsb6DfxO0y1xW09xlHV7GNTX1SIrMcfMq1Pov2/VL/nFEC8bSQe1lNMjNi30iHRQjJoTdlEczUZI6SnxoNGq1Et5SwGKwB9pBC4gVdpu9wucQ4LNtk0HP70u+SDWT/Jj4dCjGHy2zC0TSUAAw9HqTa3HujEiDNL7Sv6Gl8PRLRreSDWyHl0hlWINToaryn7G24YpZlX+1DEQXoy5SGvsYguHfQoGd3G6CtN0GxzEpvk+oPsmGxxtJCGt4zK0V5FlAIPnxjO8uj9zjRjHHIGWrzyr1zSN+YGvIORSb1xPgDzIt9xJMVxwuIMVEpz8ncfHOBqrT9JdJZAyc04Ne98dRUCvfm+ahp7ifakPr4qNg2JlUzVjVKdFgAfn+JA8ca9arfCjXPOg8xXoEpSRWycoi8W8VIINTTpiZeTuHqdKBcPk0YCdvK2CRz0f2lil/ABMUEHRNDESN4DOKENrm5rTg1 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR04MB8898.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(366004)(136003)(376002)(39860400002)(230922051799003)(186009)(1800799009)(64100799003)(451199024)(478600001)(6506007)(6666004)(6486002)(6512007)(2616005)(1076003)(26005)(2906002)(41300700001)(316002)(6916009)(5660300002)(4326008)(66946007)(44832011)(8936002)(66476007)(66556008)(8676002)(36756003)(86362001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?rxfUSWqhN9WWTXlFRic++HlitXOqKjvtt1MchNT2dgOYAjz1mzbdnkHSEVva?= =?us-ascii?Q?3Kc/QxlNVQsFXiH0yYu4+s3L064NmS34pprIKsOt1hpwjFE62xGjA9as/Sh3?= =?us-ascii?Q?YjP59CJfo1ZSFQcwLbDxJvhSb3TVdbU3arLjIZgQRaeYARPRRi/NecAAGvM0?= =?us-ascii?Q?/hUdjzPC4H5HgR3cDLmGzUtzMbzX7eElv3gVoKE/aJXamqa0TwoKqz328jqa?= =?us-ascii?Q?iwZxfz/qIKgFxNFjvYsG3MPjsfp8JnflzfeJTMP4xVpfJ7964HpIeNn+bF5m?= =?us-ascii?Q?Y6YS5R9aCoscud1svy8UksG6mv1SOEUB15pPDna4egGqm0l0rYuaYbmQtCEL?= =?us-ascii?Q?8x93uOxS7YNTvTUTFU+YWSoK7wbnFKovm50uTdMpkz1UReYsYh2uts+iXTN6?= =?us-ascii?Q?sEhtPeyzFqBKlWZs/V1B3wHxB/FUF9AAn7n723Ip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q?4FoshPkUOmW2W74HyVzD75a7UBF4es9P5xWs2vuomV+iHOpVEJfovjdz2y1Y?= =?us-ascii?Q?nIHynhwBBnWAx1SKO+NH89X/Pj+skgB4Wdkp5Pz8BJBf2+HRI67kAEwHJhIU?= =?us-ascii?Q?t1haM3/to5nirUtTSK++Qr2jHsU+LEcpFlyzT1b+l4Cd+Idwmy4eAs2F/KaO?= =?us-ascii?Q?s3BSDMaDuLrJ5zbeYxTRxRY1+QRDn3llozwRHM4t1lBP72C51xyUb63Re9yM?= =?us-ascii?Q?ARVwra7PPqwAnKsY483E6Iz3cJN20ugGs2UFnUS8PkmlLoFzVDECPyn/CVOd?= =?us-ascii?Q?/A=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d1399659-798a-4e3a-6f04-08dbc41e4fb1 X-MS-Exchange-CrossTenant-AuthSource: AS8PR04MB8898.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Oct 2023 14:37:46.9243 (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: khMOvG9BNCLNJrOPzd42ATeUHd2az9QvAhiLRdcWz+KBjkNfEScr0ltyEfOberDY+UWMUvgZnAC2/Ml2DKPKDw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7882 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 03 Oct 2023 07:37:53 -0700 (PDT) In case the user binds multiple sockets for the same BIG, the BIG handle should be matched with the associated adv handle, if it has already been allocated previously. Signed-off-by: Iulia Tanasescu --- net/bluetooth/hci_conn.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c index e62a5f368a51..7890ec449a7b 100644 --- a/net/bluetooth/hci_conn.c +++ b/net/bluetooth/hci_conn.c @@ -1494,6 +1494,18 @@ static int qos_set_bis(struct hci_dev *hdev, struct bt_iso_qos *qos) /* Allocate BIS if not set */ if (qos->bcast.bis == BT_ISO_QOS_BIS_UNSET) { + if (qos->bcast.big != BT_ISO_QOS_BIG_UNSET) { + conn = hci_conn_hash_lookup_big(hdev, qos->bcast.big); + + if (conn) { + /* If the BIG handle is already matched to an advertising + * handle, do not allocate a new one. + */ + qos->bcast.bis = conn->iso_qos.bcast.bis; + return 0; + } + } + /* Find an unused adv set to advertise BIS, skip instance 0x00 * since it is reserved as general purpose set. */ -- 2.39.2