From patchwork Thu Feb 1 15:28:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 13541256 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2089.outbound.protection.outlook.com [40.107.6.89]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E3CCF1E894 for ; Thu, 1 Feb 2024 15:28:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.6.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801325; cv=fail; b=sPJXJKC6cDz6lDQrbtHFti8fKENf5/gnYGsJUgKd97gzkK7eTFRMnG9tXx31vWCximT04nkXJxqiH+2+mLr6fzgChIvkjnlPjalpLvkXMXftFn886ZZRqkKygMxRmpo/pV9WuzyQJ03fMIDh7lgRAiUdRgZ+QtSXWyfAuoW/Azo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801325; c=relaxed/simple; bh=JxKYLd0QL7PUCoSlPHPxLSq2stR1xxudZqK+aWeRp5Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ECfLKsJwth7W8otbKQMQjSwMqeaSOH4VII3jOC+e2ZIKuU5XpvV+/6avYtje5xtT8W90vBSxQD6FgWRz2oDxARN9VBOk6UpZpalUnpQjygSHjC+sdGnpdq3CDwsTM5bYcU3nF/Drxybrcvm5/2Ep0OVN5c+LmxKWBH9ZQ8UyRU0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=mZj+Walw; arc=fail smtp.client-ip=40.107.6.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="mZj+Walw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i7hGsCl1tvRufBfC3HdzS3ZUojFlLxf7NIVgL42bhJRakkXWS8ez+I+YgWCv/knmqvGdv9FP65CSk6wSg3x/5vX5h/HiGcKT/BRPAQgcyKfHqp6NhFwy4u//G9qIjBm7TWExgAf4eP3sMIdiwYhEf1b7FDzIRckbhw1wlCteGD1vL0+hT0QOZ/J91wEK2vAR/THRipgWOLyGo3W8JwyBmKmVCuyl0V5SRveLUGF1PfmVv+Y9QcT8ZWKYn5IHDvYwMBFu1thVt+7F1zoSiPtxT9ir4AFj8atGjzMqicPhx8yUGZjdEEhC1eFyKBo4TOCBFAXvssH3C8DiDlWDOx4N6Q== 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=jrViA/sWYUIgreLg8qm5JqYNRfiSnTpjX0TG3E/0VvI=; b=Peno0UCMiVc6cQIQpeXO89E1BolL+qtWufZMQUKqnDNM3Y9BG0djhfguQgRfmiOwHASKGGrq0KfJLxFlvgKvejeN8JMiX0HnrsiHvlul0Ezkv3yqBxOFkmW9rEm1mf2E2yo84hjCxS+NCeMJ+DHzFh///MC80T53C/4wsQGQzzZUyhNqV5bVAEIwBjQxxOSOGyoD+0ZuGuOTODJX9b2V5Osh1GCYqzUv1s7GGU27sJoGWVuachBknjio5D0GNfE5i8GMWFyWXoCQDh4+GvnOINiJk7Oim/liOcthR5sFm2oMqPHoEztHgBHiptTrWlkSqVtEkyYlmoZ3hXh0WaMEdQ== 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=jrViA/sWYUIgreLg8qm5JqYNRfiSnTpjX0TG3E/0VvI=; b=mZj+WalwwubAym9uQ+WrfEqlL/1RQzNfvXXxNbOEHLu30zxRn6Qqj36VgaHkQmQlQ+BE25WlFcAeTeBvrcOlBk5V4hQedfgTkencss0wmw2pytLZ+FO10/LboThYOBB4/l7j1ZcY9bit4B4yWegGuIBYOE++wV6GyGhEy39TkZ4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by DBBPR04MB8044.eurprd04.prod.outlook.com (2603:10a6:10:1e5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.23; Thu, 1 Feb 2024 15:28:40 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81%7]) with mapi id 15.20.7249.024; Thu, 1 Feb 2024 15:28:40 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ 1/7] bap: Remove set lpac user data at bcast ep register Date: Thu, 1 Feb 2024 17:28:29 +0200 Message-Id: <20240201152835.196617-2-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240201152835.196617-1-silviu.barbulescu@nxp.com> References: <20240201152835.196617-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AS4P192CA0024.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:5e1::16) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB10073:EE_|DBBPR04MB8044:EE_ X-MS-Office365-Filtering-Correlation-Id: 488cbb3c-7d89-4e28-4728-08dc233a77d1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +awZPKhShu8rXK76PuEpjW6MdJZS+WwC7cJZZPVm3ytsD08640HSfWq53CX4KVPiq9hXshfghMbSXGfJY98QKwkld/pLlJGdvxtWaJZ1NBSGgrcrHxyzLhZlxt41kmlLj4iH4eH1NZf9snZSkxnVZSKqWxPLYzZd4NIzLUMgvlAgeYI6Q3DYSFrch980cMaUqZ4LsNNJyq+3gHRjoGUzrS77AJJs+XF7EsFDhob7MY4PqLoma5GyHkPeBmcNFYxXi1lGtLkzdfqSo7YWfWImEuaxEg3mSzxTkM4NMfxxSAtCjX1Zr+UFgw6SL2HUrEGmKgCAGKrm2boYzGUMkezv9cWm7HHnabYX/KvY20X6hPUnmNoFSmjmqdFYC7mYyjBbEnYBOkM3XZKHcEJZij7Q9E79rCEQuGadudc4rbZTUe0FjCzrwx4EkYO5bFQE4ZG2LTsHOaxcw+lU9ylqtSIgllLcUCfempDMtaeXENY9hvxe+hL9+jPu8OPIAsJH76qulPsooG4SNgYxVZ9Fhgo60S111gC8ghs65VTWcK/xR+mvLuSaG2MGLndxmBRdJ/Ql X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB10073.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(366004)(39860400002)(136003)(396003)(230922051799003)(186009)(1800799012)(64100799003)(451199024)(66556008)(66476007)(5660300002)(2906002)(4744005)(316002)(86362001)(8936002)(4326008)(6916009)(8676002)(66946007)(478600001)(41300700001)(36756003)(38100700002)(6486002)(26005)(6666004)(6512007)(1076003)(83380400001)(6506007)(55236004)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pJPsZK4w+r3d4gAvRmyfHsA9Kea6E78KI4GFm736MDMsQnx77XTumGGgq4kauIWQxTF+cCS31O4KXt1QSeMTkwnUAxGEZgSVHC5DvqN1eNZVaRKHXeo8xcNb2PyN5HL2m1sevSc8fkR4gRrzRXgJ/GcSC2yM5AIdAL0nGIV2mT2uHiuLM2XLelQjF2xg+zi672wc9mqwEIIpI3B7LR7YuFxrs+vVY5K44Ds+T7loO09eBBX6/ibyXZSbNu1e+oYjZDjxhNU/yAHEAbm5/zEUEIMIPD5+pN0Mw+NuFpYjGNAUu++KxjRoTb8TJX534MaJFY9/lxU76JboYpVt6NACkGfEWQshlV1lHrjJrG//Z7mQB5I2c7zwEZn8J3+LwiFAhbP4tLTLIR89M9ndZMyMpq9sYWdExWPPx9sm7axoSySbP4PeUneKhXO7SklUY2H9XgTOgSJ/oylIT745iZ+KWk0hP3u8YJDlMQyOCbJpPkIG7+Dza1pzpZIB6RF60lgCty76uye0p5eIHBQcy0sk6oqYWMbB8lSV4aejQ1hD2F27oXx5RqRmGDdJfhIIEEG/PNgb6wdMsnsKWiDTf9AcGjWQoUkLlkTt+cel7v5uKjlJXCNiZsxIPdiuclrR1ynypFf+jqRYkZU6ZRxNb8bO3Zdps6I6umS3yiMV/Lqdi47Ecj6SxB9X2i/9uZm2YvKSm3Zgj/Q5n8NcTSLszDqntzUr4XVbcVs1CtpcWqMLDMs9WWsG+z0q607tK08KU9FyrZmP1Bvmwpb6XxaIuRNj36T4F+I8eKmgvfP0cI+69yTp044pgmx0/JaqRp1HlKTymvdOrFl/weW/uKvJZUCwoieRkTR83qU1fJJO8csMaHo32SuBZhg/dlD/vPXwUgE+rBhJh1OnTZ0Sv2aoYEZOIjK8riLHZk+YAqvmHK2038ccZqn7q9cPnAGNCgbhAwZNgJK7mHBQ5pHey6bcARxXtTFZDyF4L7QjQzixot+Jcd+OMvpNsYTug3Kz78ivuTkNTpVE8UsYUMX3Eygpz4B3af4BEgOpnQTude0KSek1C3Q5bgF1Ei8yiUDLT6kx8HrKntomoi6dgx31paIc5YzLhQi2RY0uxWq6cyCDQu4RJ8/HEDVoDq6b43Zd38rt+u0FiqXiyynci/gndp3VGSmt87U7s8FwgQ5TbMWidoScby/75EE3cOTh5727uk21n7tLyMkZttC+kKWSVTuNKWpzUo4UHAnKlz7vZcbtyJXsOm6q2Ruyx+chmfQHRIQQWoOgGAOo28+NKreXpxQFOR2q6XYj6UvRkJFYgkstrbPSdNwQfoDWh1sSgy4HqId6WeItroE//IzMyXo0AmyY7yofDP8rA+SX+9B9innUcPA6G29YPaJGqUc34bOJw1lZ7629e7NfwKak8ANE455uAmNRXCZRTo7haXyG6POOzAxvQMO5Qa3OQZ+QRe7ycu/3ZssClIbGRLitvtm/+PEYE3E0SQID6IHeEVPQQg2nt8+HXT42TFaHFn8NwfkxfRxAUheWp1wfevsC6OQP6AnzyC4wu7Rbd5Uj4uTUw9UG2zCDslZOGlfWH8UnvZ1aIOkdc92nXX+NqAMnRmMcqn8Q49Ix0w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 488cbb3c-7d89-4e28-4728-08dc233a77d1 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 15:28:40.5998 (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: ELJ7HtDCw26rz1HWu0ezlgCO4xNAkGSnw36A3/g+UkVM0UNVAotFuvA5wWrEf0MADaSeeM/vMjLSohBuekW0x0ffjJ/DdSHDhrE6XwWjbxM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8044 Fix a wrongful set of user data with endpoint pat for the local PAC. Local pac user data is set endpoint_init_pac form media.c with the media_endpoint --- profiles/audio/bap.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 7faa6be7f..209f21471 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -1195,8 +1195,6 @@ static struct bap_ep *ep_register_bcast(struct bap_data *data, */ if (rpac) bt_bap_pac_set_user_data(rpac, ep->path); - else - bt_bap_pac_set_user_data(lpac, ep->path); DBG("ep %p lpac %p rpac %p path %s", ep, ep->lpac, ep->rpac, ep->path); From patchwork Thu Feb 1 15:28:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 13541257 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2088.outbound.protection.outlook.com [40.107.7.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1D04E626B5 for ; Thu, 1 Feb 2024 15:28:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801331; cv=fail; b=Bnu2AxjevRe72MvkbANNvty9m0YoQbPnnat9Zn35clAvsY/fBSuNn+1FZmbmyNbwXirqkoqW4bewRbcLxWq1HgKw3wbSFFFYlTqhZOaSkY8lGqEfEUJqJJT9mTDuIZF9FFu6wPkwcgMt16n0bLEAsFReawqX7Hdc1z0E8MiR70E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801331; c=relaxed/simple; bh=DzYScYs5CwiCjM1lmpfstQ5fMbl1LyupE6olmMckZdw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Lo/llMrAmjmpPTepvYjEQQc21Sg3iQELUQZseRdTClgdnu3UKXY0741ivA8GwUeaDw/z1kOUCCKAwcMtJftcy+/hrdxvVAKNIvRWVRp6R1GpaGGXbaKWZFSEKrctxmkRlj1dx52nGcdxfGq7A1em4BqMyyAbgAkBcE9d/Y80af0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=oxcQ0k8O; arc=fail smtp.client-ip=40.107.7.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="oxcQ0k8O" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Afb+/JcOHUsjmwLN2CxLhVbzMBx+a5pjkSCShgHS3rRkwCZYcC4tCrN++1EsZUb8NcbgXvof3UZapmgQOwF+BDz20ncwx5vcdQWIkoIX/xlenDh+3vlAwHTUPHZsNMkg6IkOAMhMtUDSDrz4g744ka6PwpsWqHmKExktvLwRp76JAGJWkCh/iL279Ca9vjo4hhzJBsZCQjX6cJJE8nEVSxdWYVxQEqYB9OZ+itbIudkHv4KiRPJewbWJAidaVBej1CUtUMAVhiB/xbCabFXWsL4GPzPQMFBxYrHCC+pfL/nl8DismHz46PJZ3lwhhXPe3zLjLm3iZ4JDwvuZuAO/pg== 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=yGbWGgkwWR63iLlImqRYYfSQ++iMxnFJJbOJGFWTREc=; b=m/8110aMj8h11njqiSaToZTUXB/KX1G0n6i7jNVAGTOb5w9q2rFXV5wDQLLs3YNWwrwEFJwhNg26YBqBGG835YK80vQN+6gyhr6t85h0qnnX3mrJL6L3lS7LHvIax/E7zD7X0Ar20D4dGlTafxMxJ1S2nUIcq7g7vmcnEPSGsp6CSVAhl5lzdu3zJ0zGYvQ1CxjsomEQQgdq8J3f7htZo27TI5LBnRKFFV44kVhlnaEM/PxRoCcMheyLxPGReT7Libg9FuDSyZXll3wYJfDjyoNioqvkeD647Qi5W2oaSGyvR9n0IYJJNynb8Nm9cZqJPVIDmLoxamXwZnaahwsVDQ== 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=yGbWGgkwWR63iLlImqRYYfSQ++iMxnFJJbOJGFWTREc=; b=oxcQ0k8OAlLIx1OEkWmoE+kpt2l9puI6mCydkjzLWXLQY5FxWlXkINNlnEr9ZpJQRhA4Mvk1wFyq1lNHsz5ZUWLEcxktWTj0urv3RQt0Vo9LBzqdPY/NNgniewwG9lwp1Aa2ip5/QuDTISzaoDo811OKRO1fyWAUE/UB8JIwIz8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by DBBPR04MB8044.eurprd04.prod.outlook.com (2603:10a6:10:1e5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.23; Thu, 1 Feb 2024 15:28:46 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81%7]) with mapi id 15.20.7249.024; Thu, 1 Feb 2024 15:28:46 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ 2/7] shared/bap: Add support to create multiple streams for the same pac Date: Thu, 1 Feb 2024 17:28:30 +0200 Message-Id: <20240201152835.196617-3-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240201152835.196617-1-silviu.barbulescu@nxp.com> References: <20240201152835.196617-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM9P195CA0020.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:21f::25) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB10073:EE_|DBBPR04MB8044:EE_ X-MS-Office365-Filtering-Correlation-Id: 8842d0a8-8613-49d2-61cd-08dc233a7b08 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Tx8cDW0yXXlvzw8JxOHoxCqHwDHSDAFa1NOldRuGoKakbLPWf84FNopG8sBRAS0M0rpHFgiWfNeRXrhsx5mGhJgA7NaOBkPJ/TA6n9IOpfS5jTXt2GYuoW15ImsshZcEZEqvhaGlej81vmt5aUEViK+/lfCfg9bPiVOqnEj/7ZEqedNDCyQBKtC6EkIHKLnype+DR1IBRyb5IlCaIBh6bpJBAKNP943m8WoaO8tqXlk4hEZ6aA1Hbd1h3U7lNeDn+h9WWM62rmXTEY07cPhsmqvvWmjsFW2kyLKEBDFzXdyQHClIXr83HlhXdkHaEieHiwhO5Fdr3K0+a5+BSKUoUHDvx1ARhJXxbInpQqUE+elIHCLLZPP9J+I/Y4HrnOJ/eG2UFngy2COHEMO8r7ouW8hYeQNz/4FHR1SpElDTLlNw94ynlKVd17WtMMG7utEBN6bLCEeufcJZmmYQRKUOVsMkN248usD9ENhMDi3EVP25/vFLNzjfIZ+4XJvGZBGrLTq8jiY0044ue3mHTAF0DueBxpYXAfwmf0v7nN7b1bKNwVd0+kgQAQJEVVSOMd3p X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB10073.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(366004)(39860400002)(136003)(396003)(230922051799003)(186009)(1800799012)(64100799003)(451199024)(66556008)(66476007)(5660300002)(2906002)(316002)(86362001)(8936002)(4326008)(6916009)(8676002)(66946007)(478600001)(41300700001)(36756003)(38100700002)(6486002)(26005)(6666004)(6512007)(1076003)(83380400001)(6506007)(55236004)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZSFM1gyjRgG6cEaheG1qJppeBfsw3Vmy/MxENu29oz5D0odh1IF338wxWsPAXStJCI6Mt61/d42nDvopgV2GLpKsut6RTjv0eF1Y+Emhi21d5+LhvHvZLN1q5OVThDBo0Rq3+lxpdfdGLnA5bUPrXLL3/QdPS5CvrPoRpYTcQs8L1+1chUR5BQVImTVffzP9uIltHFwvN6pB7e9vL+QQljSES8QhBFK1AkdGxuqzKksyOqV83X5t5ZRSyNhn3j8iyhV3pTtdASrLH4gn559uKlNT59+NGgUmsvhc5fGxG16bSUgPUVbDZgQD8suanb8ygu2QSAEt9KNhQ6Xx4mRXzW/KVfDzsVpMRo+m2R+l8U3TPV59IDuMLsSU6PBmm0hDRwnOi0XeCiZcZkJIsftmCQPY/yWpyAd0ozgldc+zkLngcpmDCfeoF3IFCgPyvO379gg8DBwLHqaq7PL9FJipWMT3NFW+HI5vwaqMh69FxdTjJ/Rf0h63nRp5/0B125ZzVp/eU5EJnT+ARLRiD4Uf3OJunWW+09WBZy6JW+T5CR7tQyIduGsONXDp6p/3PCqxShSTwdEpW1rVYQVWS3cBkYIdNP1hP6LR3Vg9+aUXcTMPqZwsXnMmlZntgL5IWtBd+xirYWRqT63wpi5wP+CBwHbdPHSwdGrdElyYuwEa1f4iZm3qgfwaqVipLSKTqXXtR7wLhpYxACo/93mJ0wo3gB86SeTDunEOV1BzsOtC35ABLNy1aAPoVIduECZ27/C6mrDsrNS6NQlBm15XkxJuOBUmOeSG0PQoLxQ0yXZnppbxbpk0W55qldKlMPdqf649qcO5X+3dXRS0nEcYagXWeeI4SU1EFyo4xFyUkNLISfeF5vU2F2XKBie3dw2imXo3lL3R0aPEaUf18WxDuzskrgANf4kjOKaJ7cZ8KgTRWGJd2G26PIQOveuDg1f1N9JcpDzJ68xKLQuQEiWpFPn1m3nRio7qFLp7eFEdEiiF4iK/NyikQTf7z3UMg0J2DnXId3GAbONyc1FR7W+hD0YDjQmtSm+TBVuPxs81bQwTtJZQVU5dh7g6NHz1L+fgF2NilPhfryVydqp/wBZCpIjE4Oc9kOHSipQAHTjy5FTwl5DwPSe3fNbp6CrXY3W7wfyf6Oe8sm7cFFrapOAhnAQerbSK+yVocvghK+v7lKxwQ5aWi1jrkE+rymtfvtkPf7ieToPaTcbLlD2FBGGd2Tv25Xw1IxY5nxez7eaxCkKCJosPji1c2ZBir19KrdJwsGLGzbJoS8gU15U19qVNQ8PXWMFDLlbnoPjh9oHjCs2zzQLM544G+Yg7D2qoAbraomtRmsmUlf3FleHMUJNP1mlMPiTNJzy+lHnaVRnVSR/oTU5o/xfGPee5x0MEfL02+8U8piZoZtBo8Q96Z6xM+SFci9Fsr9nJyKHmw/2j3WCCPRlhNoa19f+hwKq3E97vTOHk1gQAnYp/k+PRrnWyr02lb7pQkRisWoD3crgSHbDFD2CCuHQ+0Ncz5jCJYzxFrIsFmjKAXZPNXiQ+C0be5RkJ0/jtqfkF0vd0qxtdyX5icxktMCkHtc8kW5FmjXr84u4r/ki9KtxZ8hg5TbFtipQO8A== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8842d0a8-8613-49d2-61cd-08dc233a7b08 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 15:28:46.0166 (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: Vz/ucRp4UCPYNqX87CDSsvb7xTZIoQQ4dMSuBoTWyKsdowA0GBozEG64JLEyOS3KOBwkEl422THbI+ogTHs7XhfiIgdMUMZQDgA9/mVS2EI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8044 Broadcast source requires to create multiple streams for one pac. This is required for multiple BISes support. --- src/shared/bap.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 851d6a5fa..a4c6a1bcd 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -4739,7 +4739,7 @@ struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap, struct iovec *data) { struct bt_bap_stream *stream; - struct bt_bap_endpoint *ep; + struct bt_bap_endpoint *ep = NULL; struct match_pac match; if (!bap) @@ -4795,12 +4795,32 @@ struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap, match.lpac = lpac; match.rpac = rpac; - /* Check for existing stream */ - ep = queue_find(bap->remote_eps, find_ep_pacs, &match); + /* Broadcast source supports multiple endpoints (multiple BISes) + * for one pac so allow it to register a new endpoint even if + * others already exist. + */ + if (lpac->type != BT_BAP_BCAST_SOURCE) { + /* Check for existing stream */ + ep = queue_find(bap->remote_eps, find_ep_pacs, &match); + } + if (!ep) { /* Check for unused ASE */ ep = queue_find(bap->remote_eps, find_ep_unused, &match); - if (!ep) { + if (!ep && lpac->type == BT_BAP_BCAST_SOURCE) { + /* Push a new remote endpoint with direction + * broadcast source + */ + ep = bap_endpoint_new_broadcast(bap->rdb, + BT_BAP_BCAST_SOURCE); + + if (ep) + queue_push_tail(bap->remote_eps, ep); + else { + DBG(bap, "Unable to create endpoint"); + return NULL; + } + } else if (!ep) { DBG(bap, "Unable to find unused ASE"); return NULL; } From patchwork Thu Feb 1 15:28:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 13541258 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2088.outbound.protection.outlook.com [40.107.7.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A6A115A485 for ; Thu, 1 Feb 2024 15:28:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801333; cv=fail; b=kpFCFDBLVTMWnv3RCiJn/CPCNjdK58QLh0WNjPJC/gZQtH28v+Zk1+PXJNIVXQENH9pWlGW1gYvNNT/UMB7YOJU0yb6eqN9FDRpCjULwlBeeML8Pyqh2skvQfi/2IwXeHgzoXD9Ho8wjvRGQeQN32mpxQvTDsbFXIf2JTnD9p0c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801333; c=relaxed/simple; bh=8F2j1n+VLb//X5vcdy4lDKqXi0nsp+WRC8HLR7hpdJU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=igsK+Ys9fhiHLA8Mdjz6i22fFSwNp1uGry2GF1P2XDfcV9k/W4A4sMtlpzr5D5VR+waX87UitdrxYgFrvfxwbUwrL2MwdHo5N94wHPJPsC7Aaf8B5t7VnyGNfGS0uNuQhsBRV8smArqUTZYdVLW6M/fbSN70KH7+AEJoTfoirMI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=R4Hj8QT3; arc=fail smtp.client-ip=40.107.7.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="R4Hj8QT3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PBK/+wLxJAb+YCVepGdZXDs+2/+g2gv50u0j/K1o/JJv72NMfUicrE3Bl5jvar0vE87mvqsF+4phkUdjOeaizeQ6ufVWD3UxhMxysDpzy41Ml8dPL9cC/N/BLfY441bIZW2GHlMDG1gZHOoo08iMVkTrilb4emS0LlvqKgGw36krSZ2wBOlCKQYM31GELhe/wpKsDcNjki7rRJEWvKUgRSicQrCJNvDUxCB8KalgsFtPmIQ76+0ZtQFG+2xhFq/7lQdwSG07+TOSpD6wo5t8fP3gh6sgjWGM7MhpE0zCrvOd5lYWdaJo3l0F00V6NwIGQIYh//SZr4UetHq1Wh4dyg== 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=2sMlhjmIhOiKbJfqaCBElJgoXGpyGAVhJ3+iQLTo+RY=; b=UPUcVN2bmjgznDysq9dUVkFVinO2t7KRpETSfC+sWSYNDw+Ornx+tIEDpZviH1DKqwkbnwqk9xspvJQli+ATmxMqYQqMhZ3F8ZzEN89uyeN3ZeXkTQShHkKjfn0jw1EmVAePIA1JkS2KbPCJj2SeYUCheftoiXEve4Syf5q67QBPe53mkmfSpCinytFAc26G8SYGAUirAFCo/hHO+yGkKLLHi4kP2YJ0eRO7Fwhjqmi6jCiOcx9Mt7z5+mPqB42jSE6TH+45YM4pzEZGVrNaja/XSKRs6WrdEK7+ViO2AEP9/APh/JI4TaJBenoWGjmIUAkxXowLQj4KeXdYO09oqA== 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=2sMlhjmIhOiKbJfqaCBElJgoXGpyGAVhJ3+iQLTo+RY=; b=R4Hj8QT3Kji1L1nQN6s7UouPpcaxev58Pl2csAIITDKS4JkudhFjqq9rCJ6/g3lG3xd6gICpsbFVErpcjT/Lfa33h0rydTETWoTd22bEowAuIu3gJqXDmDUQnR3vhgRBuy/zRkie4A/+TlUk6cv1MjdQX4A1rbW48AaxQStId/M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by DBBPR04MB8044.eurprd04.prod.outlook.com (2603:10a6:10:1e5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.23; Thu, 1 Feb 2024 15:28:48 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81%7]) with mapi id 15.20.7249.024; Thu, 1 Feb 2024 15:28:48 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ 3/7] bap: Create a new endpoint to be available for the next BIS configuration Date: Thu, 1 Feb 2024 17:28:31 +0200 Message-Id: <20240201152835.196617-4-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240201152835.196617-1-silviu.barbulescu@nxp.com> References: <20240201152835.196617-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0PR02CA0202.eurprd02.prod.outlook.com (2603:10a6:20b:28f::9) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB10073:EE_|DBBPR04MB8044:EE_ X-MS-Office365-Filtering-Correlation-Id: 0275f803-d5e2-467d-b000-08dc233a7cb1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vCDRbRZXZ/NxnPIdtFSRmsHP3621YdS5QgPLsj36DTMp4JfR9eWlXqXNCM/vThrxgH2FtTZsTpKBsmchbeRVHdgXgF0uqh7qE/mxlOhKiKQCt9FCZJvQl9eG9Zub0MN0mNAE3xgypniSFgQp9F6xY7rLwLcsKR8P/aeVHCpFT6LIL2RDqh0kU9/vo7Kx6KS4yisMGZ1pN6JAVRcgTga51kLwkIB9NEPPIgL0SenrPib2SoIStAW+rTEhvL5gHrqvDLYsL2IlRd+sZT30Z6hcrADDFx6WT7B3/yV9JnJ1BYvKcDc4ySHnihgkO3TvVF9XIIKUFqabGBgB06KIJxqyDafArvThL+z5u9dfVncQm281kdA0GkWR2LX4QOMKUcJ5xSmpJyLIygWGzowWjqt3twp+U9ArU7aVtlFwWPOfmNy6hOhqCz6Tcx1rsQQD9+G53p46/HgpnAFHVTLinpSa0mHtdTbvTtUZ1X/ATGIA9JbhU/XXoy/0IlYBsDgA/RUAb3/N9HezWKT8YQypw6z/eBqcvrR+/f9O8ivbSMF5TzIe/FqCnr7uM7OW2/+E3gvs X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB10073.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(366004)(39860400002)(136003)(396003)(230922051799003)(186009)(1800799012)(64100799003)(451199024)(66556008)(66476007)(5660300002)(2906002)(316002)(86362001)(8936002)(4326008)(6916009)(8676002)(66946007)(478600001)(41300700001)(36756003)(38100700002)(6486002)(26005)(6666004)(6512007)(1076003)(83380400001)(6506007)(55236004)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: urCADEkrXxXf1qruSbb+QkbKx6QiE2snnW3GF8vuKtlWayXZE7pvpeNyPZCCoTQ71qtR1+JiA7YnU7mp300q60PIVUfAyFqUygcBTe1QD+6qsyab7vSeMi74RngENQQlTbRdow5dFFgiNcvO+eT1YEhadopvLPQzQQPxc1dJwjobpO5qyAySSBBytOA1V00HRdsmKVnp4bZ4Sw122SCpTpVFTo4CFZue8O4WgplaoS5mEJ0VSB+gXKbmbmEhyaPz4L9Ao5WCnEwRiKpZdmK+gEoz9tMgiNcXiG2TQdaMsFX0nSyxrjydDDf4xWbsPKv8GaxO34AQf0j1DQzTtKYGd9h52mC8gEqisl6iyvhU4KFRXSUpsOfyC+bwkYJCLDTPTFcZOEkP9CnM94Xlt9IBb3/WSzveusTyqCBmwsvL8e3Ng/9TJUh1/YqXYsyX9id9+c2FldlOu/1C43xCsT5or92JbiU1vstsy0AE5e7ftTCxJ+QR2JjLmO8fdVkb8e8ZS+hKheb1tLjDeeMUZSm27jKJUZao071DM/0mOhDb5mKSo4Bhty3hk1YNAVrJKyQiijKflQ6QdVmhCU5zjGmaj2go4tKJxsVeZoa5oVlhoAyBks7WNhFsZspNMWrppojthEUW/3YvJaccdYtQSGNX7aBcR7nlFhMOy6vaTs3xLd0SamkdQbHsciXTR4uqaIKE55FW7o8UrIUoNe77/xRSxAbiTm/yCRoEi6pv5ZIgdRS6D51mO2N3uKr35oS0JE7rF/ocJXcyX8pfduSwP67NFF+jgXHSl9A83VRFX5iVsgWZ5qLwK1HqL8Z1FP3b9njg3Fi3lTCFfNWw1qsIKnHIPW7w3lc85WFagbqQepwdreXWFKVo75ynOkF4I4f0lgbI9cAegxRqNt3SjO33bHK85Qvy573zpszH9Ann2j3x0h16jzF57UJ5tWrQYrueZhvgbOY7XFxqQPWe+qOmbL/+t4+VlrLcKh2w9y4W5xd+HHWMVzR2OXMrbqkSgYWys4NQiLDPUc6rMwZO4N+HG86B5F43IKc8s9fRbM9e41CJsR3D1ffv+ZD+hxguXeNFDuUSShusBUjhbhMQGnSefEjU5J6ri/yzVBXTBq47jYQclqhy5geKQCVFPFEwvTK9RJm2UY64zOOnnpnsaYoHeA2fN9uqR8xDwWYyb2t0tmbk0/VZl7IzKGM2Qae6eAmzby3D3RBFAGNxRZTgq9kI1souX3TaW9KKUyXjaqx1zjZNJfPkgjL4VaSYfAlFS1BvK3ZAo9Kt1AEFuh0gMOYBKjuKn/zSV2dHmpKo8pOeydW+Tk5ZEZik96yi4Dm2xtPKmTg37gk491K41J34yuDjEvoN8lpWzYIKQVTeh0CldgsytyMIl1FcGD5hVuBbleE6xzZWs/sllkfXsDXGvzTVAPppucU1NpokqT1oc4LKC43a/OmOHJGp5TVAzXswDxxgxF6a5DulDWEnkLbEzyqsefA/JNQO1gdDpeL/C9o3v3rdFMby5bSrYgHTCMUEkf6gwTBp7eeSC4vtTHWukvAFRjSIKMbYKt/pNVOa3n8vZHzfcC3mRLOYqlJJuBN1HOrR3rjXJeAfrc1klGQGEo0/RJqoDA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0275f803-d5e2-467d-b000-08dc233a7cb1 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 15:28:48.7793 (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: scYM+iSqksZbExCc7VURiJjw1JSIawv7JVnkr1LQsUHdQY9crgXrKfVhNE/5wxtrGXkrUPhIqNyD7ReTjeiCRAFtYtXR1ImqB1Tj6D8jVbU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8044 Add support to create a new endpoint to be available for the next BIS configuration. Broadcast source requires the creation of multiple endpoints, one for each BIS for the multiple BISes scenario. --- profiles/audio/bap.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 209f21471..9300e98ec 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -916,6 +916,10 @@ static void setup_free(void *data) free(setup); } +static struct bap_ep *ep_register_bcast(struct bap_data *data, + struct bt_bap_pac *lpac, + struct bt_bap_pac *rpac); + static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, void *data) { @@ -972,6 +976,10 @@ static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, else { setup->base = bt_bap_stream_get_base(setup->stream); setup->id = 0; + /* Create a new endpoint for a new BIS */ + if (!ep_register_bcast(ep->data, ep->lpac, ep->rpac)) + error("Unable to register endpoint for pac %p", + ep->lpac); } return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); @@ -1150,9 +1158,14 @@ static struct bap_ep *ep_register_bcast(struct bap_data *data, return NULL; } - ep = queue_find(queue, match_ep, &match); - if (ep) - return ep; + /* Broadcast source creates multiple endpoints (multiple BISes) + * for one pac so queue_find will return always true. + */ + if (bt_bap_pac_get_type(lpac) == BT_BAP_BCAST_SINK) { + ep = queue_find(queue, match_ep, &match); + if (ep) + return ep; + } ep = new0(struct bap_ep, 1); ep->data = data; From patchwork Thu Feb 1 15:28:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 13541259 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2088.outbound.protection.outlook.com [40.107.7.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B105815B110 for ; Thu, 1 Feb 2024 15:28:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801335; cv=fail; b=asTGinmNZcLHUkD81ghD4nqKwRbsYAUvDFEGGQlJbGt4Q8X6Gx8xiYg9FMuqbSEKdfM01P7r1kFW27NeU3o3+blp5jxgb1NKSfD8q6LUgLN3KyZcTmF26+SveDECnPItJupPEzLhmuECuetXaNZ83vEZfvHAuyxKexII4AUrUyg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801335; c=relaxed/simple; bh=2+rnxZS5GAbHXvmsMT7aTo2xah1MLOHPkv9IU8guoqA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=IMK2OQ+p3PMz6dfzHezICfYq0Z+c+6AcA+TysgZICV7U8DV35Yyq6++6lcqG4mT8I3Mn+U3NfN1+7p4p70sYCxZa8FVwYn1iu25vlLKvURE5iZ7DkrNyHe8A0TAos4r85Ql6bqdSQWMCh1wQeRXZ5lZCwreVn/ctCnQC/ct/BrY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=Oyxj5OUj; arc=fail smtp.client-ip=40.107.7.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Oyxj5OUj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CHW7bNqvBqz3N5ZIgHwc8y0pfHpTnOHDLtiPEfhyM5XkVEeQ8M3eESKkfzBdbJizMTCUmufN4g3rca37j1T4Xvjs4r+VCLAkmRpew/YAeruVj3psa7uQlk+X3S3LRZl7XBxNEahCPWrvUfhWbRqpROCtMPCxODNOVVdz8um3fJrlSNPqZF4sU11t18nWq/aFq3iTsh+VMCoAJC5ZP8WbrFJCJazrfbgwgcCqSMxgzzRuMmTO4obqyaQVGk/ejAjNK1g5KYuv9pQDSLXK8yoe1pdxJ7u0M4giIVFEgpSPogRbHlNfKK17UMjkM9uToqwAz4ojqX5kkcVtO0JwTw6P3A== 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=JlBl5FkjzHqZrIjpRfWCN1ec8DZjoWESmbYhsbwfsVc=; b=FgFat9iZ9qHwPAoFyDsXidwZOoA20A5oZPm/WfrjwLNTqW4CCxNvxBimFhh63/Yd3u/f6hvFgslEIdS2HFYEjsPXafQDWqRJEJf3tewJyzeC6ApTPG+qptlOuRc3K/XXY6FuV4IfxmSVJCeJJKBqvH8ly9/GSTkdosTYCWziZTlZtZw+rIrFn09L8bfXP/2wdyGWa+vNgyn+qqJVDq/7uBUmJeXic0YlmlZhC4zP6R299YzVIi6LuNHAMGtMXSlNX/CSmCd7/jFWMCALAWVyhdltbVsOsZeQ9mGvbaJ6Wh1/+2kjKlCpntQ0rcssdqJXoJnnsmeU6ToXKyFqF2mqbg== 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=JlBl5FkjzHqZrIjpRfWCN1ec8DZjoWESmbYhsbwfsVc=; b=Oyxj5OUjoGecBfKRjn2p2h6xXcEkh1/XAa9aL/fZzFCE2C5Hqp/FeX3OnRLkufs4GX+ixOHGEJUrm8ophxPEgxE2zuXvrW6uNjUNlcZxeTPsfCtbrYVvAY3e18xr6G0nLr1qk3eNM4TjB+g2V4Qj0MyOFuuwJNAjk1lZSnhJ3jM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by DBBPR04MB8044.eurprd04.prod.outlook.com (2603:10a6:10:1e5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.23; Thu, 1 Feb 2024 15:28:51 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81%7]) with mapi id 15.20.7249.024; Thu, 1 Feb 2024 15:28:51 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ 4/7] bap: Split bap_state and bap_connecting in two functions Date: Thu, 1 Feb 2024 17:28:32 +0200 Message-Id: <20240201152835.196617-5-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240201152835.196617-1-silviu.barbulescu@nxp.com> References: <20240201152835.196617-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM9P195CA0018.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:21f::23) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB10073:EE_|DBBPR04MB8044:EE_ X-MS-Office365-Filtering-Correlation-Id: 26ee59a8-8aa3-4749-8dff-08dc233a7df5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dZISoujeAToMs7r4ddBzBOIpxzQndCMnO1NQqCAkqm3ziO+jyRcdRkRSF0oJSc4vrulnAxuLddVQKrhJM6gshpqOBIXpfyGT62/m64DqFCtHIIX1CLUjcwoKahs1HxVI3GndZ/NFwrRfWCKhcDpYUAbGqwCFiEvU2MqSFQmJCDy58vdJfdiIJXst79wv7xsZyD/REbKPxp+nPysM8wvvECEShSU/EGV/M5+IJIQJ1GnZFbPiSJ2jBS53Y0QJS/gzAt5fGkcjeRVYVjHY2yd9+oRTbki/Yv1QlInTGaMvnKVDjDfUpy6t/XNlJo/54dNmoP8Z7PUOYLdb5f+je+hboQaVg7S3d/HHXkvHhSuZyH9fSe1ACOvJJiOX0v8eSbBPv0x9WLcOskOZ1wRbLsXg0+nT6HSxrXQYsr3ndtwpA6tLv8rI2doKPrymcdGKuNiF3dU7mOgfC+qoUEqxjfSVwzFB/YkTLvjkaqxX8/V5DWUEzEHXR5nCnX0SPJZBY/Zmxy4zayk2SOXeuFUsuNjNBwrWObN3uR53RngbIqlSMiKBYq7Au7u0yVWYE5fX91fj X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB10073.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(366004)(39860400002)(136003)(396003)(230922051799003)(186009)(1800799012)(64100799003)(451199024)(66556008)(66476007)(5660300002)(2906002)(316002)(86362001)(8936002)(4326008)(6916009)(8676002)(66946007)(478600001)(41300700001)(36756003)(38100700002)(6486002)(26005)(6666004)(6512007)(1076003)(83380400001)(6506007)(55236004)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: /C1TBn5jmTt7+tdjokTPrmy0KucuD0RCKZTNcWVfr0ku/y181wIcw+PpalknSI78/VrUkBYtuniqP7pEGXS5s8Du55svzHj7LVOEuRKFVkX17GPAJ5sQ4UqY4xfZcH0UzWIO+C5HeqrYf1l6hX0gbwVyrYbC1df8hy4C5nFbQSpMgrcIIUJ1wKIkQ0tSRbQsgGZPjtvEvFR1i/jZ9jTlTd8T7rhSMWq5g6tdxj4jPYSV3Ive/IZFQjRxbvJQko/LsTxJPGA9lVeMGFu3Pi4/vlzC41U+8zbXmMW1eI8a1TwbU0VTMjf5Pc0RwTVC0UtWaW9cMU1BopeWLpWa5jJh+OzPc/qDBD5JEn1V0K1YJIvUZIpFBuzk8JLjg0JcoyrPTvERv9b2DDKVVDfDoyytHYsgQUwp/hrCMPCueTrbGNN2PiFydia2ZXOdJBfZxYxVrsYUaDh46ymgt9/o2C605LYaZk4olafmFxAnRbPj6rSFg4pczxNEtYj0exAI6Dd351JGT5hymA1ndHpNNJw0mBAzt/w/ECnhkHGofd4Utv588UTzYqrg6gxaGx0j3YG1WtnlwM7qJXPpKKxyxsOlx+Tbv9OrfXXycdn4SHiJo5fH/aXM4XbDpNEbBprYxFyJfJaeP1sI5EeTVXm2xfibmVoARdvqhp6xnFr2ONIWNyYaPjkqSAAS0R7ca0kE85q0e/VAVWruYObGF5+akb4Fh8Q7NCdkgvzsMmMsdOnI/JWOrRTUfWfE5Khas6R4VzQNKiEYMHaLriWt7X9jGGDkjyUSSghGh8qkF1GojUzIAaJrGD/GV1eEa/0uGABsUdQgk9pI4GFlz+Phe2B8PNa4niN7t/NfSeAcIDvVKNT++RRoqJ/02tfxMqkTNLEbmTPlPXR5mpz4B30bWwhgks2eq+i1U+dsd4jEGdgBC5HJvTHWFjjMH8b/hXCrfbCRWlQq9jOFXKOkvaNNXzDrZkCnZxeS0bcPgZYdIldeQ85ep0dk/Rcc9a1cnHEVREBxvY+1Vjmpa0dw4bzhE5D+Xf8xeP7N8+BccLzL+rczr+aUAoGMa+ZlCpEWNbftJoRpjWCr+7nflg2UvLvyrJSo4PObf5jU5yj/3PhDnjea+LAgM1GniG2Glc3kX2lCJubwm+VOeY5I84PMLqXAVjKh/d387V0rY4f0PZGIOegevILHjT6SzE2gdnGF5UzQafYkdXVWfxxU7TnU6Re3eJg/YKuGllS0S+Nc4iJwF/n9Hd4766tUJwn1oMM4iXreiqMAV4zzKqAiDbxcrFoBMzZj7iM3dtWLcDfkd8fQb1+kl6bzCoylC7tcp7w+aRnOh4Js1sa2GYsV1s/u0kNhG4fywbnwMvn/LeSDA2tM6oWbgAaloO2/FdEU/c0Q4rkPJEzysqJMiPfnQ3/CzARFMmwkQkc7HH4Koyzm1ZQljiIFdqDaesgKvQvzcpES+ArgDIzkQoh1kC5Fu0iMWau7uQ6M0N4A9E+h58+d+jdyfHiOuuTrEe7xkEdS7fcPnATGY4qmuYUTftEgbAGDqVLTWCXN3ghtAfYuoNpzIVVd3Sn2sYLALKche0zCdyw5ARv4lBVJUdcL09x4sx3mWnfe6DIWBUV+Vw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26ee59a8-8aa3-4749-8dff-08dc233a7df5 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 15:28:50.9490 (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: zX27KroztoYwGQueMYxuVnrlGZiA7z6wiOLizwomhcNuQVX0JkUQtbUOPJGcbG/5xldhymIRyZ5JLAWFePcJ4LL0BLb38Bhwa8X9DKPffpY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8044 Split bap_state and bap_connecting in two specific functions for unicast (bap_state, bap_connecting) and broadcast (bap_state_bcast, bap_connecting_bcast). --- profiles/audio/bap.c | 159 +++++++++++++++++++++++++++++-------------- 1 file changed, 109 insertions(+), 50 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 9300e98ec..7d7a3ce02 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -2099,25 +2099,19 @@ static void bap_state(struct bt_bap_stream *stream, uint8_t old_state, return; } - if (bt_bap_stream_get_type(stream) == - BT_BAP_STREAM_TYPE_UCAST) { - /* Wait QoS response to respond */ - setup->id = bt_bap_stream_qos(stream, - &setup->qos, - qos_cb, setup); - if (!setup->id) { - error("Failed to Configure QoS"); - bt_bap_stream_release(stream, - NULL, NULL); - } + /* Wait QoS response to respond */ + setup->id = bt_bap_stream_qos(stream, + &setup->qos, + qos_cb, setup); + if (!setup->id) { + error("Failed to Configure QoS"); + bt_bap_stream_release(stream, + NULL, NULL); } } break; case BT_BAP_STREAM_STATE_QOS: - if (bt_bap_stream_get_type(stream) == - BT_BAP_STREAM_TYPE_UCAST) { setup_create_io(data, setup, stream, true); - } break; case BT_BAP_STREAM_STATE_ENABLING: if (setup) @@ -2128,6 +2122,45 @@ static void bap_state(struct bt_bap_stream *stream, uint8_t old_state, } } +static void bap_state_bcast(struct bt_bap_stream *stream, uint8_t old_state, + uint8_t new_state, void *user_data) +{ + struct bap_data *data = user_data; + struct bap_setup *setup; + + DBG("stream %p: %s(%u) -> %s(%u)", stream, + bt_bap_stream_statestr(old_state), old_state, + bt_bap_stream_statestr(new_state), new_state); + + /* Ignore transitions back to same state */ + if (new_state == old_state) + return; + + setup = bap_find_setup_by_stream(data, stream); + + switch (new_state) { + case BT_BAP_STREAM_STATE_IDLE: + /* Release stream if idle */ + if (setup) + setup_free(setup); + else + queue_remove(data->streams, stream); + break; + case BT_BAP_STREAM_STATE_CONFIG: + if (setup && !setup->id) { + setup_create_io(data, setup, stream, true); + if (!setup->io) { + error("Unable to create io"); + if (old_state != BT_BAP_STREAM_STATE_RELEASING) + bt_bap_stream_release(stream, NULL, + NULL); + return; + } + } + break; + } +} + static void pac_added(struct bt_bap_pac *pac, void *user_data) { struct btd_service *service = user_data; @@ -2321,45 +2354,71 @@ static void bap_connecting(struct bt_bap_stream *stream, bool state, int fd, g_io_channel_set_close_on_unref(io, FALSE); - switch (bt_bap_stream_get_type(setup->stream)) { - case BT_BAP_STREAM_TYPE_UCAST: - /* Attempt to get CIG/CIS if they have not been set */ - if (qos->ucast.cig_id == BT_ISO_QOS_CIG_UNSET || - qos->ucast.cis_id == BT_ISO_QOS_CIS_UNSET) { - struct bt_iso_qos iso_qos; + /* Attempt to get CIG/CIS if they have not been set */ + if (qos->ucast.cig_id == BT_ISO_QOS_CIG_UNSET || + qos->ucast.cis_id == BT_ISO_QOS_CIS_UNSET) { + struct bt_iso_qos iso_qos; - if (!io_get_qos(io, &iso_qos)) { - g_io_channel_unref(io); - return; - } - - qos->ucast.cig_id = iso_qos.ucast.cig; - qos->ucast.cis_id = iso_qos.ucast.cis; + if (!io_get_qos(io, &iso_qos)) { + g_io_channel_unref(io); + return; } - DBG("stream %p fd %d: CIG 0x%02x CIS 0x%02x", stream, fd, - qos->ucast.cig_id, qos->ucast.cis_id); - break; - case BT_BAP_STREAM_TYPE_BCAST: - /* Attempt to get BIG/BIS if they have not been set */ - if (setup->qos.bcast.big == BT_ISO_QOS_BIG_UNSET || - setup->qos.bcast.bis == BT_ISO_QOS_BIS_UNSET) { - struct bt_iso_qos iso_qos; + qos->ucast.cig_id = iso_qos.ucast.cig; + qos->ucast.cis_id = iso_qos.ucast.cis; + } - if (!io_get_qos(io, &iso_qos)) { - g_io_channel_unref(io); - return; - } + DBG("stream %p fd %d: CIG 0x%02x CIS 0x%02x", stream, fd, + qos->ucast.cig_id, qos->ucast.cis_id); +} + +static void bap_connecting_bcast(struct bt_bap_stream *stream, bool state, + int fd, void *user_data) +{ + struct bap_data *data = user_data; + struct bap_setup *setup; + struct bt_bap_qos *qos; + GIOChannel *io; + + if (!state) + return; + + setup = bap_find_setup_by_stream(data, stream); + if (!setup) + return; + + setup->recreate = false; + qos = &setup->qos; + + if (!setup->io) { + io = g_io_channel_unix_new(fd); + setup->io_id = g_io_add_watch(io, + G_IO_HUP | G_IO_ERR | G_IO_NVAL, + setup_io_disconnected, setup); + setup->io = io; + } else + io = setup->io; + + g_io_channel_set_close_on_unref(io, FALSE); + + /* Attempt to get BIG/BIS if they have not been set */ + if (setup->qos.bcast.big == BT_ISO_QOS_BIG_UNSET || + setup->qos.bcast.bis == BT_ISO_QOS_BIS_UNSET) { + struct bt_iso_qos iso_qos; - qos->bcast.big = iso_qos.bcast.big; - qos->bcast.bis = iso_qos.bcast.bis; - bt_bap_stream_config(setup->stream, qos, setup->caps, - NULL, NULL); + if (!io_get_qos(io, &iso_qos)) { + g_io_channel_unref(io); + return; } - DBG("stream %p fd %d: BIG 0x%02x BIS 0x%02x", stream, fd, - qos->bcast.big, qos->bcast.bis); + qos->bcast.big = iso_qos.bcast.big; + qos->bcast.bis = iso_qos.bcast.bis; + bt_bap_stream_config(setup->stream, qos, setup->caps, + NULL, NULL); } + + DBG("stream %p fd %d: BIG 0x%02x BIS 0x%02x", stream, fd, + qos->bcast.big, qos->bcast.bis); } static void bap_attached(struct bt_bap *bap, void *user_data) @@ -2452,10 +2511,10 @@ static int bap_bcast_probe(struct btd_service *service) data->ready_id = bt_bap_ready_register(data->bap, bap_ready, service, NULL); - data->state_id = bt_bap_state_register(data->bap, bap_state, - bap_connecting, data, NULL); + data->state_id = bt_bap_state_register(data->bap, bap_state_bcast, + bap_connecting_bcast, data, NULL); data->pac_id = bt_bap_pac_register(data->bap, pac_added_broadcast, - pac_removed_broadcast, data, NULL); + pac_removed_broadcast, data, NULL); bt_bap_set_user_data(data->bap, service); @@ -2607,8 +2666,8 @@ static int bap_adapter_probe(struct btd_profile *p, return -EINVAL; } - data->state_id = bt_bap_state_register(data->bap, bap_state, - bap_connecting, data, NULL); + data->state_id = bt_bap_state_register(data->bap, bap_state_bcast, + bap_connecting_bcast, data, NULL); data->pac_id = bt_bap_pac_register(data->bap, pac_added_broadcast, pac_removed_broadcast, data, NULL); From patchwork Thu Feb 1 15:28:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 13541260 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2088.outbound.protection.outlook.com [40.107.7.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B0D515B965 for ; Thu, 1 Feb 2024 15:28:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801338; cv=fail; b=AevZc91SDLVHDD//+jtZJwmU0qtijFlFEBKNUx2t3eU2QPtAMlpbzKabujen0XPLTw+xd8kp5WF2HQ9O5yMkL7i7ZFUROscS3TE8T5/rWMBNJIci3zb2fkJ8YEY9s7wXDviYPi1CQCm5vfOXYYsrzXbGlEWwkkgSzkVVayzqMa0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801338; c=relaxed/simple; bh=XK0PXUtPlHvgCZkfYSl76tsrh3UUPdljYPVssToFD3o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=VPkPcsMe1dlwcyq/ZLZpkohjYlmoRQM5Yp1sUaNVbv/kELnqnm278vJtvbChhr131lQaYO21M69M8EYfRDJLSaigOQCm0WOGN5scaJbWTMKn0lMSou2zX2kAzTKAcljT/R/7MheOA2sMbrl2kNeqAaXAybcLE1Oeg6OQ1jE1dLY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=UB9ygCx+; arc=fail smtp.client-ip=40.107.7.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="UB9ygCx+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M2o5XYDtBt5gCwjDeS+d4QE0YBwp19rNt8eVJOTG/kWoKRUK2m7w9r/d2DTebw9zloRfRHZip9qXA9f39pIzVik5Odls2POflvqIM5UoXeULz1WlgxaGZLjoS6vUGZtFhGJY48bLKAllqJ77SrTvoq4eKSopLG4rz2VROp+SvvQpWa0E+MN5JKxteNTdzD9tubelogTAOsGbzNuSazLgGGmSKNwzVZawVKaV47RWItCr0D5rr6T2WXGzKgZOaKrRNUSC59mmdmLHjXr3RYYCqPAo4QTKIpnXUbHn2Azy2oa79QwI2ZS0NDPxEa1TFErtTj23d0ha5noH7P2KeGYJMg== 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=l+sn7aVtj0Pcb+hkp8gBV1cVx1cF/wfUv+WE4FEIORg=; b=SPHT34aSn33U/2mrJPOdGsi0i24fb4H4l55MQEn4qX6QqcexMxC3WYtjkq+YSTf9GOdi7P50nGmEiSkV7K2ILAUwBt1vd6kHuquiLCTHJGzS0b9QeoznwwwXzBMTHUIRQAWkkvBWTDAZU/h9at+bvLG9r4SIEiCJt+DjoYtVv3Rz+wK1QfZ4I+wK4lMO2t6oVKKOXtKWRk+uhEC611vsyG+7Sy91tJvxAy0QH4MeCRkuL09Tm7U8bdlToidXgnflFYiAx2c0/1gOneDw4yXq+13EWcTc+CEXzSNTXEHJ6JbCnWlPCVkDU8gOH5TPgVsthuooJM92/rMW/95o2pxErw== 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=l+sn7aVtj0Pcb+hkp8gBV1cVx1cF/wfUv+WE4FEIORg=; b=UB9ygCx+RJCza6us9WL336YjjS8iWEO8umvLzJQ2o79oWPT0lpb5cg0FNiFeqyssUkzm5448alLub6Deah3Ojkv8bdQada2C8hwrY95FBJGhUMaLiS//jiGuG/zZ7MQQDGTF+eYRLwG98DYQXhaTPPuYDzu3WtBZ47ttEtP9avs= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by DBBPR04MB8044.eurprd04.prod.outlook.com (2603:10a6:10:1e5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.23; Thu, 1 Feb 2024 15:28:53 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81%7]) with mapi id 15.20.7249.024; Thu, 1 Feb 2024 15:28:53 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ 5/7] shared/bap: Check the state of all the streams with the same BIG ID Date: Thu, 1 Feb 2024 17:28:33 +0200 Message-Id: <20240201152835.196617-6-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240201152835.196617-1-silviu.barbulescu@nxp.com> References: <20240201152835.196617-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AS4P251CA0001.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d2::19) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB10073:EE_|DBBPR04MB8044:EE_ X-MS-Office365-Filtering-Correlation-Id: a784232e-b75c-4785-529f-08dc233a7f4e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: veWsA5DrUPldWFpCb1QIkrfmK1TG2oYG45Eawk6XYS/GV+AWIQ/ht+qkqtb2+lfvDRMqY9raNu4dpOlu+2V0fvac/En706wAr1bsVD51ijsPgm0c91QBNk8R+w9xEh4IzAL98c41F+RJgzRjD+2EPELvOGdFtIy+Orv8swlPTgF36cAnEHYwk7E0Z+HKMGEPMK2FA5LO6DwpXFYx6GLqBjUVYt0Hvb3GxRbuuAoRW5e/7kQiJfE3fNLCiEf/xcFhtSyPXU4CD6lZ6Z+weGStM6uyq2UzFjNKx3l4Pn26IXj1XCQrAqTtm61Yvj7+k9Y4dXT3/HPBK98PX02XDMLhdvnJ3zKK6dESvYrn13ObpgcC7uBMZCeSzSxNWx6L/Ck+NLMNbatvx15/cGunAaKKXkHjIFvXlsgCVq7ydEzpBK1M2cl9Hy7nPl30Fk7INs19Un6ZT07M4pqornxaTJuXk2TBsni12UPmDPbkVtuvXbMmHwqpl/Yp89hFeKIjdMe11UFFlA0J23TPFq7HzZkJL6TZtRkh1fphh1tOlJpFlEPXOH4EJ3hrDa2TYl/alRvk X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB10073.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(366004)(39860400002)(136003)(396003)(230922051799003)(186009)(1800799012)(64100799003)(451199024)(66556008)(66476007)(5660300002)(2906002)(316002)(86362001)(8936002)(4326008)(6916009)(8676002)(66946007)(478600001)(41300700001)(36756003)(38100700002)(6486002)(26005)(6666004)(6512007)(1076003)(83380400001)(6506007)(55236004)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kBlzIF6piUSubVC7tugsZri+jmmLwcIh3oLJmmrTQFUn7pDtsMUUYufnjIJEhtndKi+ODfb8MvKJhbvo0/qfwXbEDAAZqEi4zKzMqzfSt32cOh08DQrkAan+xUyB2ENrEWaK0d6bfGfP67/JAfj0cnDT1ck9u86te8hd/e02FuNg9OkpcKmqpxNrPIxsf76nPcbbVhzP1yEIV/82XBRCG3wfyqn5ZXlQuuYLyuuP4anESp1AP95YGzwAwyjh1m6nAj/FnePxNGxCQlyeQw/D6N4MVmmUtgRUaeI1KFlHWa0gMjMfK95aV9geKEs0ThL0dbTEp0Aa4XlfGYpRqRfkmJhEQG/S0EkeO7k62CxT/a/rPL17mPEH27uV/NkkPlFYTJVlNfw0moeITrHyzaxftCUEf+bAU0LnOHzyD0cFNm8YDwwYyDFSQLF86g2W4jWTKPrGGbMqpY1NQfS1j6/QEzN/4vbIppUnk58QEr8tWTsRRTx8zuUEeCecpLh9s/+9ZWFffYBaMMnW/pD7FCW/Zq9fRNMAnlJP5r7f8cQHklghMga/x7rP9xj6JKZNYsFqrpdfPftWkGgTLEgViXxkS9IWftpHZ+ql0TdWOHXMxPKpD7kduMi64S3qowkBhO6A3HCO0UkXRfqeG0hrE6KoheqxZ+RXbuj29FedMJ8MjMDdXSAg3/NEMM6GUHWn7pYcQb1WDduOWl2mON5uzZG3IpEw/trEqXbzMalrXjigNH5w4eO1C/esCzFX74cuqb55gRyPUIJYNpYJbRYeKg5cU3HEi+65LceaYFGyU3qgC2GdCc633gsCi8P9LWH4LoFvsdT8r+QfXBsG7H1RpN34Ko8Y+kizHoZhFJt/zROHkV8lV7YTrn5saEkgLwDdWUfzZ1k9vG/WRN4MmwV8VVNVN76z86pLPn+IqEPDuuyNgELmnkBZYwuTaR7o4iBzAvhiZkxINUKVfkKPaEXQ0rYZcMwZS5XNO/MhadWX346mqhDF4AvIGzgVEjdsCn7faDl/fwk6DNeOkECxv3zoblUG7sQn682U2Xb0G+KBu09Mdryz4d8CsS+A5KDKDhrCLwvGhn/Ph1/TVDdsRQQmvbMQ1FdH53jpSTIabCcsEfG7TubiTUw1uCChsK/ZxtN9hDSMTiJzP5vH107fiIWVcOxCAvB0wjd3P6hHU6dZjkwRqGKu4Q1Ng2n8K07eIbCxx318drWxg3HwRDrNDL4qN4mzYk9wQeUpx6Y2McDTxKZjPXyw+oQ6YYCs3Of3VZjYnrM3yNu6Fn45E04cb/PKmS4oOlrx+swrRFuOkTmCa4u7M5eD7C3rwDqfWY/mk2F+k4JXCMJjXRxeQ+qZG10YOINQLYwRsXYWbwI/J3kPHRT6RYVhAY6LlEZDWjTlkYiyKZK5b+SfehFenaP/GFjb7Bcf0Pej91RXiJMvS2Zq6zFvyTdzhEq6Em7v9voov1bdVj/gC5dI6wWkUw5IQaSpN3wqt2dxPqdUGZYhMX7spph5h4IxxDFk0kCravmKj92BLbxacgLlrvwKNFPXFopWPL6VS15d1h04QLlj/b4uhU8oCx5YlX4QtqXNRcKt8sCtMyv8QVG4mHfLiSpuA5BP61Yiig== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a784232e-b75c-4785-529f-08dc233a7f4e X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 15:28:53.1896 (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: 34R7rxJ1KIiW/FVi/dQB4+gw6agVxSg1fzpfLka1SItJpGKrf5NsRJNuPVlsT4Gty4A89ojScLe/+iagcHXPRrpw9DskzvaG2//4JlS8IaM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8044 Add a function to check the state of all the streams with the same BIG ID --- src/shared/bap.c | 26 ++++++++++++++++++++++++++ src/shared/bap.h | 2 ++ 2 files changed, 28 insertions(+) diff --git a/src/shared/bap.c b/src/shared/bap.c index a4c6a1bcd..244bd8c4e 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -5884,3 +5884,29 @@ struct iovec *bt_bap_stream_get_base(struct bt_bap_stream *stream) return base_iov; } + +/* + * Check the state of all streams with the same BIG ID. + * If all these streams are in the checked state, return true. + * Else, return false. + */ +bool bt_bap_test_bcast_streams_state(struct bt_bap_stream *stream, + uint8_t test_state) +{ + const struct queue_entry *entry; + struct bt_bap_stream *e_str; + + for (entry = queue_get_entries(stream->bap->streams); + entry; entry = entry->next) { + e_str = entry->data; + + if ((e_str == stream) || + (e_str->qos.bcast.big != stream->qos.bcast.big)) + continue; + + if (e_str->ep->state != test_state) + return false; + } + + return true; +} diff --git a/src/shared/bap.h b/src/shared/bap.h index 2c3550921..9d46c5ad4 100644 --- a/src/shared/bap.h +++ b/src/shared/bap.h @@ -323,3 +323,5 @@ void bt_bap_update_bcast_source(struct bt_bap_pac *pac, bool bt_bap_pac_bcast_is_local(struct bt_bap *bap, struct bt_bap_pac *pac); struct iovec *bt_bap_stream_get_base(struct bt_bap_stream *stream); +bool bt_bap_test_bcast_streams_state(struct bt_bap_stream *stream, + uint8_t test_state); From patchwork Thu Feb 1 15:28:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 13541261 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2088.outbound.protection.outlook.com [40.107.7.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95BAD15B984 for ; Thu, 1 Feb 2024 15:28:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801340; cv=fail; b=hmMJ9+/iLokKMLp3MLx1TCQvNWBjJm9JNIoV5vLMtCG6DHcdjggpxgT/DMxW8mQmZRMEGJcqro99OTstj/hsKxdxvGE1Bi5LPrF0gNyi//q9A73/lmNo52kBuU+iftfsk638gAktnPOLn7aybwhst35pRi3fO8edQSfouRJXP7k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801340; c=relaxed/simple; bh=4lLcQqRFVm3PM7nbl723fnrK+wQJ1SLeSGLzhGmkCjc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=pLoyV0kcVDNTJ8+mtzFTHldn8s/VEoeFeoZjSk2Tia6+D67Mcyw4cJmPAn6NHwOKFFkGHpE4/dwFSKEa2mx/K5fhzi6bgOiC6ehElV0DJFB98tcxhr5UUasEI0/FraY9bznjqYU7qEdG9bt8WOIrXGMBWX4TdTTMgrju6O49b6Y= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=CL4Yp6ei; arc=fail smtp.client-ip=40.107.7.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="CL4Yp6ei" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UaKQ4m4aBjWL4OoEiGy4c42vG6X+DFiUri0kGamTbhD4h05PYVeoRL8SdkjBngLMkaw+Xu66/PtkLqOToWabcNtYbFkrrV3Rbci2kirotLH+pgwYLGOT1zWDJaiil6TKfdmFs4UDDg5gsdkua8ERc+ebvLAT0oOu1/w6mWCZdY2Liin0iRd66LpuivVh38g/ZPK8MLAkE6+H+ATwR+2Fz9Unwn+Ofa+cBpj1FwXYk+5XQn7beovRRr2vKHe50K6CgWQYG0LOWCYvhzUvnUT1cepV3iyqAUwKhoWRhLIYawIMt3YHxKOzyfRw/de+eUEdA32wZFhS7hYjLKVgKxkDVg== 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=VKUWxnow+inp9KOweGFU9AJ/Sga5RGhZn7SfuY3jOwc=; b=lUe1i8PkQgJ9MkGYM990hz4MYrxc1nN/X5bduQruwr4/VnB9pF+avEf6E4YAkO1u3co0wjPaWWt1ufCvfz4pA4YAHK5W+yz7oHgrVFPhYYsCwByEEr4hT1WNaZmST3CviYTizJ5oXvwf99k/FOg58Be3WMSvRPwdwc5hkdUwcteAicagAfqF/UxkW+rg0GSaHZZW9EuFkU7TMGsiP3XeVVKK2HBIFneU6RVHH2qoQuuvotWtlbkqoRULeLh4tEBnOxdzSZlu/yccepnT+EpJXbC/RwgArR5LlBNEaH6PqNKQjXcuP2VcV9d0H2aR76/s0KNOgOaxM6ryPWzvSw5p+A== 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=VKUWxnow+inp9KOweGFU9AJ/Sga5RGhZn7SfuY3jOwc=; b=CL4Yp6eiyaPfzBywdCoS4MY4iGqYuctC8hdXxOOtfL0RpJwC8+pWMDzomRwtPdImrjAby6Jk2Uez7aj79JxuLrRs9LHhnjPTlasctRf1mpUcm6vKkhFdQdbfWWVHlTQrmbMuqBxkcztGGDj+UStyZ9AT63QciWS/mkzeoDiiRes= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by DBBPR04MB8044.eurprd04.prod.outlook.com (2603:10a6:10:1e5::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.23; Thu, 1 Feb 2024 15:28:55 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81%7]) with mapi id 15.20.7249.024; Thu, 1 Feb 2024 15:28:55 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ 6/7] bap: Set the generated BASE on all setups from the same BIG Date: Thu, 1 Feb 2024 17:28:34 +0200 Message-Id: <20240201152835.196617-7-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240201152835.196617-1-silviu.barbulescu@nxp.com> References: <20240201152835.196617-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0PR04CA0071.eurprd04.prod.outlook.com (2603:10a6:208:1::48) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB10073:EE_|DBBPR04MB8044:EE_ X-MS-Office365-Filtering-Correlation-Id: 36b07651-ef21-4151-b401-08dc233a80b4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1FbH8w9eMK8WnkpONyX6uLUKUAKs0ySfm0QM/UaQWe4crlEjQZ8qv7ThBsZsKrOKJNYmYCEcaTsiq2dfYHQvh3j7NqbZhBfIXPhB+qPCYe7TDm9iC0c/lc7N+VaAk6Lo5bRIS2KdXFAm6VO2yV0RM59wRX6ar0a705x+ewtqXkJtd7L2Hx4hNBmlf3uPcsRjjA8hNYsXAO7V5XtaG/gNs+kNwpAP6iAeRYcm4MXUic0H6mnQQ3DbUe4UBXYKBLtJaCgpBgev1GJSUMtFVMvDKFhmBYaffoG7T9VYFmiw//lvr+cFKA21+0wrgwgMd/NEOgHW870Zs6y7k1xo7cqliH5jccoiJ6pGCMmdPSned5nlxxttdTtMdUwaVxuSSIHXbjhIRx0hcfx5trGjPQxBxpwVlyCvsin0maBbqmTtuhjmYf0C3okOrXaltnZc4mrKgMmYzcNLvpAqsv8/vRicTEGeSclrqWF5WmSHCn+7/Y1esFKpVhfxUlIv3FgAU14PKEoi7mZL2ppGbzKL8CUkW/sC4jVqf7eX6Oq6qt6/FFI87239GhQeuNUJF+GNT2/W X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB10073.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(376002)(366004)(39860400002)(136003)(396003)(230922051799003)(186009)(1800799012)(64100799003)(451199024)(66556008)(66476007)(5660300002)(2906002)(316002)(86362001)(8936002)(4326008)(6916009)(8676002)(66946007)(478600001)(41300700001)(36756003)(38100700002)(6486002)(26005)(6666004)(6512007)(1076003)(83380400001)(6506007)(55236004)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JA4SbNLdyPrcz0b1MGb/4K+fA+cYN3lQT6u54PnP4zgqh9AvkbI3jFS3ZF/0fed3jGOPcEnhwlc0fwi5JiDoHw1+PRd/b5Pjbs1ENw9bRBzSBn6YzRDCzMppBXYLt5NjXFxaBa50S4NNm4zDF38a5vdZxfO/0jZm58dFB0kXgGWpUvWSzbArZUCn+CThUSVPw0Kp05/70H9R0+D5eIwCigfkaaAz9sEs+S6JxfDXuhSkskNNtwzLHgemBSz0SfrYSqBGjgAORD8ky1Uns14JJ/nL8PsN1RhSpdIJmBHnLy6CsC4CBcVO0wxETWVxqquBmyOvEI1kJIn8xaoj8xyQbop/XKNgIA+op6W+BuB0q0yWJ3Awm7klyrfFs26KvirEquhOe/sJhVOM/zcP7FSxEQENSeTdntLhYwRCdopthF1hxTRCWNR699JY931A+ykCC9OXRRMrI4jTSvfiI0EmPfXTcKTLmeQT1/4rqgEOJoU0tvapEnCJbfk7pCsiC2CY3/16nk+53wFZbmg/bGczuMyD0D4ErHpvzziiyBXuQHz+5eMGlY4neT9yg58gVFpiNaY/ZJ5TIBF4QeOe8XAsrkoL74WH6FmqgNa3rO7z2a3pqO0l63GU+pf6NIEQjmZt0IFfq+icGnW4NNg+r+zNtR1ZZnvJK5gFvIH3oZ/10SB+KjoG2VdMM6Oy0pBCBPtmsEb8tf6M2NtZWOfiGETDi5A3EUt8guhUlBtCrma1L2lZjD/EXiOJjGrRO8YYCC3XbpVlDDo2z4WAd7rk8beZot4wdr98JDbAmBYxIxQXNvnSIoXsd5mQepfkHCFct4hllzQPrOsXhSszGCJSLrLSOHaSh25vcfwbxUvB9jUBEmT1XAFM9zlaSc7vv55X1OzDa2yVv+XyHcu1/FTizy829mL4OAkfA1fl7Cr0lC19bli4uY/JWhAfww6A2ybAm3G4sN//2mFR7u7dD8t6YVPcdXyS7NTCo2xG6DzF5vZopbDIH6o1SkfWtxp2Yto6nWZ0c882iNURwlY6DNcQ87akp1I7AprPT/H9UGDm+mFe5/2GAqA9H7g9uL/v57qy9CsMxExTpxwjCzAR+K3bUGDhHrXEtu+pVpQLSwI7NJrYXEC6g+40+JgnETPxu4p6Gck+GjpZEfOa6s72C/7+cpoWT7HFjduoOkA/RKwiuh1bAL6GU8wXnHP//CvV+8Wow3OCPkdIXL1pVo5vgmMsu3tMi892tqDIPnqydNvave/8E8V4NvXlC47dkSN3WFr9OkHCKpYX0QoWWtsr0OcMjS+zKduTJlxprzG62nKeelyEGjj/e7cFmiPILKTsFU9yIG8FiRJ/ar4GY6Zl7vhIw4TpA64dAPcRlz3ydlaji7YNzKRZLlQ62H+0Ca3Z5x67RhSRM8AXzbK3b7aYyvI5VfMITOoj7MnwqMBqWDMqUzhyXmgfWqttIfRTmPwehyYsyL6Wv+GgYVDNekVUuR3rQQuteqT5Lko0WQkitu+2GrOyQuyssqeFdYiwAoyarIFGea2q6B6VdXLkqCkTt5fx0jueyIzhRw8qICs2LVM6tV5C7CSkjGcfsOnhg6BJNdrzWZ9b9XVyjTWYbBI1lFuRLiXuiQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 36b07651-ef21-4151-b401-08dc233a80b4 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 15:28:55.5420 (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: vhH47dmQg0w7MKeBrB9egpHY2gXCRz8MQMqzC6HkGUqFBR0fnn3WJn1cLetXMPDYruHJKjm8gca6OoerohUrjPUS5IMge/LoOBMMRnFzSgw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB8044 Set the BASE generated in BlueZ on all setups from the same BIG, and use defer to inform the kernel when to create the BIG. --- profiles/audio/bap.c | 69 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 57 insertions(+), 12 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 7d7a3ce02..729860fbd 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -916,6 +916,35 @@ static void setup_free(void *data) free(setup); } +static void update_stream(void *data, void *user_data) +{ + struct bap_setup *setup = data; + struct bap_setup *data_setup = user_data; + + if ((setup->stream != data_setup->stream) && + (setup->qos.bcast.big == data_setup->qos.bcast.big)) { + + if (setup->base) + util_iov_free(setup->base, 1); + + setup->base = util_iov_dup(data_setup->base, 1); + } +} + +static void update_setup(void *data, void *user_data) +{ + struct bap_ep *ep = data; + struct bap_setup *setup = user_data; + + queue_foreach(ep->setups, update_stream, setup); +} + +static void update_base(struct bap_setup *setup, + struct bap_data *data) +{ + queue_foreach(data->bcast, update_setup, setup); +} + static struct bap_ep *ep_register_bcast(struct bap_data *data, struct bt_bap_pac *lpac, struct bt_bap_pac *rpac); @@ -975,6 +1004,10 @@ static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, setup->msg = dbus_message_ref(msg); else { setup->base = bt_bap_stream_get_base(setup->stream); + /* Set the generated BASE on all setups + * from the same BIG. + */ + update_base(setup, ep->data); setup->id = 0; /* Create a new endpoint for a new BIS */ if (!ep_register_bcast(ep->data, ep->lpac, ep->rpac)) @@ -1847,7 +1880,7 @@ static void setup_connect_io(struct bap_data *data, struct bap_setup *setup, static void setup_connect_io_broadcast(struct bap_data *data, struct bap_setup *setup, struct bt_bap_stream *stream, - struct bt_iso_qos *qos) + struct bt_iso_qos *qos, int defer) { struct btd_adapter *adapter = data->user_data; GIOChannel *io = NULL; @@ -1884,7 +1917,7 @@ static void setup_connect_io_broadcast(struct bap_data *data, BT_IO_OPT_MODE, BT_IO_MODE_ISO, BT_IO_OPT_QOS, qos, BT_IO_OPT_BASE, &base, - BT_IO_OPT_DEFER_TIMEOUT, false, + BT_IO_OPT_DEFER_TIMEOUT, defer, BT_IO_OPT_INVALID); if (!io) { @@ -2013,9 +2046,6 @@ static void setup_create_bcast_io(struct bap_data *data, memset(&iso_qos, 0, sizeof(iso_qos)); - if (!defer) - goto done; - iso_qos.bcast.big = setup->qos.bcast.big; iso_qos.bcast.bis = setup->qos.bcast.bis; iso_qos.bcast.sync_factor = setup->qos.bcast.sync_factor; @@ -2032,9 +2062,10 @@ static void setup_create_bcast_io(struct bap_data *data, iso_qos.bcast.timeout = setup->qos.bcast.timeout; memcpy(&iso_qos.bcast.out, &setup->qos.bcast.io_qos, sizeof(struct bt_iso_io_qos)); -done: + if (bt_bap_pac_get_type(setup->ep->lpac) == BT_BAP_BCAST_SOURCE) - setup_connect_io_broadcast(data, setup, stream, &iso_qos); + setup_connect_io_broadcast(data, setup, stream, &iso_qos, + defer); else setup_listen_io_broadcast(data, setup, stream, &iso_qos); } @@ -2127,6 +2158,7 @@ static void bap_state_bcast(struct bt_bap_stream *stream, uint8_t old_state, { struct bap_data *data = user_data; struct bap_setup *setup; + bool defer = false; DBG("stream %p: %s(%u) -> %s(%u)", stream, bt_bap_stream_statestr(old_state), old_state, @@ -2148,13 +2180,26 @@ static void bap_state_bcast(struct bt_bap_stream *stream, uint8_t old_state, break; case BT_BAP_STREAM_STATE_CONFIG: if (setup && !setup->id) { - setup_create_io(data, setup, stream, true); + /* If the BIG ID was explicitly set, keep creating each + * stream io with defer setup until all streams + * belonging to the BIG have been configured + * (i.e. transport acquire received on appropriate + * transport). If the BIG id was left unset, just + * create the io without defer, and a BIG with an + * arbitrary handle will be created in kernel space. + */ + if (setup->qos.bcast.big != 0xFF) + defer = !bt_bap_test_bcast_streams_state( + setup->stream, + BT_BAP_STREAM_STATE_CONFIG); + + setup_create_io(data, setup, stream, defer); if (!setup->io) { error("Unable to create io"); - if (old_state != BT_BAP_STREAM_STATE_RELEASING) - bt_bap_stream_release(stream, NULL, - NULL); - return; + if (old_state != + BT_BAP_STREAM_STATE_RELEASING) + bt_bap_stream_release(stream, + NULL, NULL); } } break; From patchwork Thu Feb 1 15:28:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Silviu Florian Barbulescu X-Patchwork-Id: 13541262 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2050.outbound.protection.outlook.com [40.107.13.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85DE415B965 for ; Thu, 1 Feb 2024 15:29:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.13.50 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801345; cv=fail; b=pVqLFFYM2E+WqHRP406/+kPdoDykmGJOs/uVB4lvzyD8cZMyDJhaC+bU3+X6RnoZO4A6KYINlcBNAs5FUFywNBmlEWxjqsqWJ6CXZ6VYGl1E0sRzwBNbWovq/9DVtRjItUVt8SWFyM5gnWvHnRtOumRzSVEebh32YlLw5lwcbcA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706801345; c=relaxed/simple; bh=8PsmsPJ4gTL6dU/NrWvwLX/m42Fq76BlmWs6FA5xpYs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=A6oKvHjDfXhL3tlLE0r2Fs8n5cOSyvk7w+ZfgZGrj7An5cbb6FHviBo3Zt7N3yg81i+YT7PWAPtkSvVnlJw/IruZ/mqdqXaSoX/GlgvzvDZtbaZ+cl5CN0hXIOE8W+O6j5D6yJCf9uvv5S0L4jhi2vrg00akjSC59W8OyVCeEWE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=T//PEW6g; arc=fail smtp.client-ip=40.107.13.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="T//PEW6g" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MCp2h8gRYkFSSuiQpkAUbJXSTpta0Mzw4L9vgOwDLWHb/ixceRWT18S6B/ZyqaRXoQxCRWBu3zWDnpf1R5+lrDXAWmdeIh5nHom3HVhe/AH5te0OPpnG/lGPpYgYWpcbalzJnr639V4Dcvh0l/18KUBXQ9M6Vyq+WZiBOa5L0fzthP+/7W1rC0P/3ENMUyn+rq0N8Qc2TsH634dWatxVA4l1E5P53RImSmLk07c4j6z5ErAYbpuPz51nbN1cpJXIyssLuto8bpEgKBf6OxAjV4fB7SgY+0ioSoydb6jbyt+2A1VqzXp+1znvgVuPgpWIrPa9Ue7S/v05AkU4cDhUfQ== 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=duMycqCLYwgFlSxhvzMw8kjbNbFvFlH/u39cFn6v/+g=; b=Ujt7TFUNac2XM5Aj8mb3lb57SWg8p/lxvKemtCamrSxUy6epnOyiDzAWlyjqWgYUGKrH7nbvop1n5cZQ3y9quKQVSeXFBfNgeTwDYpnq/X1VNCoZFyi8R8BiEl50tN8DI9hf08anhgIfAkMD8soOFjEQBZUJ/VLIVpIT8X88b0eAvFNzLVhO6fC5GHWL3n0xyVhJLnwQ9fGX8bsxGOMSk0O1tKH8w1TCSpChfnY4TjTVDBZZc42LiGSKIg2/BkSe4mcN/cFOm/Lv9TyIB4/a/VYwk2elwHT0GqM6Whhx68kAnZPWpjBw/0lYxgeph+HD6W8XmmcNPA0MUCaXazbBEA== 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=duMycqCLYwgFlSxhvzMw8kjbNbFvFlH/u39cFn6v/+g=; b=T//PEW6grZ083N32CuIVSR6iReOYx5TOTuppgNsuz4B3XIypPSrNIFD0bhzxnjn5Ayl8HyJDdsXVayJUwft6+g3rXj34/9mgom/m4HXOzPBCPBDZXEWfrB6uPkuDbb4sFnPKAPQv7bdgmDkd4mUHYSXlutlp89B+OXryKFw9aS8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) by DU2PR04MB8997.eurprd04.prod.outlook.com (2603:10a6:10:2e0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.24; Thu, 1 Feb 2024 15:28:57 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::c5e1:5be0:c78e:5d81%7]) with mapi id 15.20.7249.024; Thu, 1 Feb 2024 15:28:57 +0000 From: Silviu Florian Barbulescu To: linux-bluetooth@vger.kernel.org Cc: mihai-octavian.urzica@nxp.com, silviu.barbulescu@nxp.com, vlad.pruteanu@nxp.com, andrei.istodorescu@nxp.com, luiz.dentz@gmail.com, iulia.tanasescu@nxp.com Subject: [PATCH BlueZ 7/7] shared/bap: Generate single BIS BASE for a configuration with BIG ID 0xFF Date: Thu, 1 Feb 2024 17:28:35 +0200 Message-Id: <20240201152835.196617-8-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240201152835.196617-1-silviu.barbulescu@nxp.com> References: <20240201152835.196617-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AS4P191CA0015.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:5d5::12) To VI1PR04MB10073.eurprd04.prod.outlook.com (2603:10a6:800:1dd::8) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR04MB10073:EE_|DU2PR04MB8997:EE_ X-MS-Office365-Filtering-Correlation-Id: 10b93111-416e-409b-4a05-08dc233a8206 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: h68XttE7rnDLSELN40gyP/FE20dbpweajwz7q2EJsxkPBzRLcPpQh0/olqCzszzeEn2GNYAzGu/950GXHkh/ZMRreOBFXgnmLcIEk/XJO/qw9uijMVf4AHyPts86UmoEGIDrvWemW3YuDrNgeq7Fly5sn9/WF8F/av5kT5g2N2c8LhvsDFL8ucwVAr7l1FF1I8rW5rpKkh60jrBfTWFwdxbLK7dPnAL1H412S6J+SCXkfyF9RdvC2NgE+fJrlDTgdYig4AlDuLvC1xghzaGc3vsPfCeFskAtW9qKtyturcvQ/fMJe+0uDv2VI3VnopExvGOjssK0duGJyUGzzOAVeA2haLnnbT+ycEgTfdk53MzPRS6ZRPDqCwoz0V1D4xn4OAR2TDfdm8zQSWrnXzPO/tpC0DdEaqTLwG1OsNYKjMexfglcefNY88ds9vIoyJ8MnSilT4xQR8wcMadzZa41GA4Hxs8ynAIJ1YxOl4QLR5aV+Hqnb/iUyqBO0JT/q6uRNjYKi3flxX854/ZXjUJSfjdTwhZZGse0tBOtAwdtvfwfh/L0NAp8hnWxw92ggme2 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB10073.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366004)(396003)(39860400002)(136003)(346002)(376002)(230922051799003)(1800799012)(186009)(64100799003)(451199024)(83380400001)(6512007)(1076003)(38100700002)(26005)(2616005)(8936002)(4326008)(8676002)(55236004)(478600001)(6486002)(6506007)(2906002)(6666004)(5660300002)(66946007)(6916009)(66556008)(316002)(66476007)(41300700001)(86362001)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Q+kJq7DgEFQW+B2/fUMCzGoRnqFrOJgxGRqjlpVkTHk+pHPbVakrqlGpLY+T8CI2sVCnGHsxmRlqOyPNsZ29/B5S1KIl+TIWizMUnn1ivYunlHWqro93ScEQd5VaPeaEpCdor01+XRTGHxS2RrGHdZyVUhOKulknHKjBvX6m5MFQQXF+d6v45f1KQ7A/uPu3OfboDazkHeVhW/0Yu82+VjNbkDKc7dJ5bgdZSBQD0olCZD7wAubEXposC9EpyeU0nQzd+nclwAAH2cRm7Ynl5d7b7zJ0ftBft8lyR3kRQN5Dyh19oz69r9Z1S99KoN0Sztkb0MnSrnSQZ8pstr4SN1rmZ4+HxBrOcQw/4PEyTcyw/ULAaSu99LdfuoGcLIRJfA4k0Z3S0eIvBQDfc/Rz8i3u/CQOFqG+j9ZoKKif1VDUuVHR3N729LpKoio3c2H4I9IvEpWdCSR3DfPVaCwjegH2vKmqcCd2ADh/9y4MUmws3WWKcfbNyA9lhApZxJ2jEyS/8QxIaaFRWbSP+L2/YuqytTaB/n4rEilZdoXE7/jeppic9ycdDyCu4jrUgVFnMNTouQ8/MtJd+z9KjudfWYR9zd78mfI9Nj+J0hhvrWDkn/q85l4O98npeF8haBPEoe9oruDFjxmK07ZglB3BqXv7aU0qOEPC5cvULeXYaY3RsoQ1rnGFkxlZZA4C3uC4HbmzQHc3XWyZqgEfsoCFUi/Qlg9mSq/eOph1Kh2fqC4ZwnsqI1+4m5RNfslJilpZIRYF/4GZ6WISdDI5ms28claMXlut9nHMZ/MQbGCx3D3ZAZzzAjpjsLkFVcVVeK5cWdTTnjhfTgiVSzBuEpbPGXs+tvv8PApsO9jwYRaUltHxjbLvPmsAtvafzRrDgBYlGyLyu5ObnlXwPq7iyKbv5NFLIhKcs4tS6AzfdrM29D6h5tUxHm4chmVBdRaA+LROhGfq8tgSPxPVnLvs5/54asCxHoQeOSD0eAnLEULnndXob49BloOA2+hfSjqbPoWsk4KPA/LM6ZbIeB51wKilGLQgnryGhVyDukbp6s2As2IYsOgghAWK7tdc35j8pRUT3fZivXwiWZ2VWoARXmQVb3EPbu/Q/00Wr7motfLhEUp2UUmSQg2sUj/JgUuuqrzeHcfZBOOtXSedb/ysDAZOEpArGNpGjh1od7liDIUOdBF/nG8yeZ2EWbn8D33M7vNkh8cH/mCAgjpnTSxszXa9z0KEh9vURFwTl7r5SM1bGGwNMaegsQGvKo0pyi5jA2ne28HAFje9V/0qXYdMc1bXrBGWMwVk85vgxwT+kGdeT3cWysUmBtTEyTmz1L5T7bTW5cstU+GC/42/RPQjNgZ6XBl6i42AT3gmW78/nNh2Mjlx0yp2Y+mWnBA9suZ/oXRuIirQ4cKAkyP2YY6CO+FLN/u+9alxQMt4paH0WNVy0wzaLDg9bI/rZoGTjez2WZyYLC8ibM7wbo0leTSu91jCWUteOe2CFVWPDjRVPjwY83t57zOe4btCJec7ZhqZ5yLT5UHPkmtcxOG/VwzoHjLYIt+4Yic+5EeiYlLk3qbMTGQ0hbw1AjphkSDJa/uCFBVfcZApKo74n4gixeq9W7oIlg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 10b93111-416e-409b-4a05-08dc233a8206 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 15:28:57.7302 (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: hOyVzC6mvQVarOaxWEK5SrtxGlXqK8obxM5BTj3rOb/GRdL6wJ3VfqN2YcU3Tphrj/bliq4PZmrmvv0dT7fBAVwdGkdHDu36TJkrXECeL9E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8997 If the BIG ID was explicitly set, create a BASE with information from all streams belonging to this BIG. Otherwise, create a BASE with only this BIS. --- src/shared/bap.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 244bd8c4e..c144d4b3b 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -5872,11 +5872,16 @@ struct iovec *bt_bap_stream_get_base(struct bt_bap_stream *stream) base.next_bis_index = 1; base.big_id = stream->qos.bcast.big; - /* - * Create subgroups with each different Metadata and Codec - * Specific Configuration from all streams having the same BIG ID. + /* If the BIG ID was explicitly set, create a BASE with information + * from all streams belonging to this BIG. Otherwise, create a BASE + * with only this BIS. */ - queue_foreach(stream->bap->streams, set_base_subgroup, &base); + if (stream->qos.bcast.big != 0xFF) + queue_foreach(stream->bap->streams, set_base_subgroup, &base); + else { + base.pres_delay = stream->qos.bcast.delay; + set_base_subgroup(stream, &base); + } base_iov = generate_base(&base);