From patchwork Thu Feb 15 21:23:50 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: 13559155 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2044.outbound.protection.outlook.com [40.107.7.44]) (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 1F08813B795 for ; Thu, 15 Feb 2024 21:24:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032249; cv=fail; b=ZpE0Z7TDgpqqSU95FQmjwyjE5PUDFrOhspnDGdUm2/N6FfAr87E3B5Nl5C/gQVQlWRIqRxwQIZjbpXFJpmdlznYZ34cMwudS/UViJAE8WML3IXHGKQE35UQioom8KRcwJIXsdlvSftfd+LVBdoG0aexxAaUJZP4rfB0+COdwBBw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032249; c=relaxed/simple; bh=lTvzkHmay4ezFcGed9SwVOk9UoDF0/sLXZwak8s4cPY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=pDPcKiauvvR9UUehh/VLUYMqMQA06nc1XJvIFlcMQHzwFGL40udBh5rovwRw/e2pKuy0xE7//yI1baH2n6II/VsVru7pVkDNfXXUhjB9+3SN3ktBc5xP1hAkZSEe38c/iKIHPvHlfIXXWRfrDcXT7TsXeVHCPNfbyQ6bfykr58Q= 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=cRcltspj; arc=fail smtp.client-ip=40.107.7.44 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="cRcltspj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MPmgIsa17s8zARsDz7pd3FKY8Qlpq5MX7Unxor7lx4mh9+Hbv/04jP2Pubwo4rmjcbtC56geQKOuSndIXbGCjp9z01dGp6DURQYaJ6wSkWWAlqmnW7TPd4EXUldQbKiZsQeCAlGWNb7h8xtRpZORHubFbxCdYAYCsnT7/0EEaJvYUQXWuNCvTthdJl0Ug5/1vkW6Ty1xYdMoP8AqlW3Sr2IDc6sk/mkILkj3q8CzqwaPE4KhwT6+tN64iN0zNackmDSk8+kHNh4AWSP1S2yMRaKuUPznbEWPBUaCIeaG6lPrfpqp9mFd3G89IFExcuM6I1KSlhlw0JqGYBnZ11xjqA== 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=nI01aqCMJjs5mzkKiS8NKIHgcatfVUO3Mb82+IgBiag=; b=TZiaTjo/UdnxZXqd0E5NmdrkbSkjQydi8uWG+cy1YUgOkNdpkMTEMOtiMX1NDXuhzZ6q9HT/zbQRVRzbO01ocnOTBLppvybU8YfrIPD6OAGnx1s9RMntzfFoGWNgoUJdV6hb1y8syTYn9ZDq04uQTES+aTpykcpmJ/4BFJGybMowgxElFJV58T+JxTd6Fex93Gfh0TxXb762NgxNTA8MqDQ+SIYpqNvt26TuzTbT+/2YGc0tZogSNl9/xwBQkLEwOJTjGCJpR+ljKevE71U5hVeBc8i8TdpFZ4HePQXQA9l5XlV+poilTWboOAVN0LR2wwy82gctmuMsSKGIvO3Zvg== 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=nI01aqCMJjs5mzkKiS8NKIHgcatfVUO3Mb82+IgBiag=; b=cRcltspjUYx3u2amZ7kFLk+RYocPhwz08fq+HuBUDltk6x98Nou97aq/gcByaoUXc10LyzzVhYV8mnieNH0mJzeY7W90D18kxd/m+gW7zte9eV3jMz+5k8aDb9uA19F331yBmzZB3xjiz8muDWTpes8b3rsEBu24Ze2gkn+7AuE= 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 AS8PR04MB9128.eurprd04.prod.outlook.com (2603:10a6:20b:44b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.29; Thu, 15 Feb 2024 21:24:04 +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.7270.036; Thu, 15 Feb 2024 21:24:04 +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 v3 1/7] bap: Remove set lpac user data at bcast ep register Date: Thu, 15 Feb 2024 23:23:50 +0200 Message-Id: <20240215212356.310301-2-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215212356.310301-1-silviu.barbulescu@nxp.com> References: <20240215212356.310301-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0PR03CA0029.eurprd03.prod.outlook.com (2603:10a6:208:14::42) 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_|AS8PR04MB9128:EE_ X-MS-Office365-Filtering-Correlation-Id: d55a41c3-7982-429b-3223-08dc2e6c6f7b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oU6bcTYYjgoPuFTruILPM3qxRVhZyThd2PhE9/pnLcm6XRSzMxE7LTlXiOwlVewjp2yW6V+NMcfR1PjP8NfOcKYMeHKRkIvcx9p1gnE3o7PQcGGpAL2QDamM9YHjnJhA1RfxuKf433T2JT+JqnUmLdywH6HB2bdq/Z485eenXFZSDu/Ng7PCFbpPNwzfC7raLF6vXN30hsDjlMsi94VMOhyKA6LZDvBIYAssYrfAIiZrXgJpX6HfYR6vQGjvI7MYxyubLL6cPkk5WE7ZIDGX8niHVmv8xKR5JzTEZnXGofnCBZnLJ2wBcQp6A+fbKMhdjz/qrJzIU/FWypt/w4cdj21mlJI3dpK3tgR4iwbZ3IZuX5JfNGEXxostSrHYv58E5KJM07Hz9LecwJ9/OWRoen1mT82v11iP2E7+9SqjvqMynYwpzY+3mlnoP6PX+uaS0g5NeNqsHyxPJ5NmRwyHa5AqQ6JjHDMUwXKiKcadH6TgVhQItO9wrTx+tj79N7T8RC2Yef5ZTz9OiTrqxs8Vm5WeX2IaqHjG2zzLd5sMx22ynm6opkWouf6MtpPTMGsN 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)(136003)(396003)(39860400002)(376002)(346002)(366004)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(6666004)(316002)(66946007)(4744005)(2906002)(5660300002)(66556008)(4326008)(66476007)(86362001)(478600001)(41300700001)(8936002)(6916009)(8676002)(6512007)(6506007)(6486002)(26005)(1076003)(36756003)(2616005)(83380400001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5XPQtgJwA8R3sGW6UiySLaOhbJdh5cub97y1ec4P244j70pNy9ucExslp3CKBzid7FRb+py0mjMhn7Fo1cub5u/snj3L3z9k+qi5HAgZXzSlHE5ptyMG0KlBM9c3/TGOZ22XdCh3KC71qPBqhEAz+7a5LkZ7XD1swq4Ljsp+4djvJkvCiMH2Om2/K5BUU+0rnaEmbFfSirFkr0Z+irkVjOT3wrpg+i5m115tPJHCt/ZEC3QknovHoRq309psYPEkFgwhICh1R1aQ28Aq5I67Ogv/zF91zZT2BqThz9hKXOysUUV7XA/HNGFpx+elrV7iR3RlvMl5xcR4bQ6WRb7Auf74CRDCdvm/nhjNbeAs6q68V2ACZMl+5JWTzxhsbsci3Gv5zrkdVKHUHBRgKUyDEuBD/vqu2CTT9oe27UPoE3E9PYFevtQcF4sA1HPoRnuzpafPtAVp7vvxLDSsd1JuD8vEIGeMkwDZRHoDwlYM++U65SbnJFskcmPT/lAUcXKol0p3NB5aGp79f1FORIP6kACSMW2+AgjlAU01lnlet6ohqS0wn05PgdijMAvdgJy9/ooHBE+7XCd92Z1zJkLHS/02H44Dj/UTwzf1vl5RFENnx7fLCPlSHFv53pEONVq7n/aj2n794P9tSy3fw75/4QV/juuC0PDDEfLHYbUEV4yIcCXKAvhWuKdFFAi6O38KFRCMF4OMyqlx2SezUHw/3DJhtiRO+GVKqGR86RSlK8DH7HIUfayhQrrShoYAnMq3z+EgXD2CyfrwK+NzMMTdpLC1aZ8SxgOtkyCPrkPHjG2EzEV9GholHD+/O9KbdRDzMhjXxfkOOEUggjhy2rMoABrz4Ak7pr7ywm0GPEW3qgPVpFlkxg78Ib6UeBBhkqMzj6Q7WroBFi9fdiIeHnHOTHIfrO8olB4928qi6LnakBYX+HfoQ9apT8uccPUiVbjZqh3kVIorq2kABKJ5Cb3I47v6RBRgPNSVw2zgSC2jexwz0h7FpobmVrFJQ08T0reryYgWFfDmexayunyjvefdCLV0hvk8rbCUrXFKOypizcN+zraZEDOLL4wi5wJI8jU8SWOXdjhBrRWNjkA01xOCb4FNW3YMApXQ4evpMzJD249ftBnU16fA7Ls237ilGD01tKEJ8F6uJsrxB4dataUmuDi8k4uwZPaRSsfQciPuheW8f2vBeI4SD1fINONlbwIlatmnHeoXNf0s+PXWavQzjo4Lt5zNPEzaaip6/YmyYNANevMybhx/56Qx/Y9ine23HlebcvTLCe3kgoFhvho8JfXBTn7hnNcN3kMl+kpodqoXcbDF3NYfO1AWP1tvOT40nPV5hooUgSDUp5m3RXjGNUEzVnTXByHpzmVuBO+K6iOrTeXco4QLee13y1KAGmyEcLwNtu+hRzDnORg72ThDEmG3vlSCUdUqx5QD2LqvF5XrbzHU/bl7iaMZSe/jF+nrpqMCyEXRAu2+uh2ZrWIH5tPX9Jb+1HRzfbKJ7HpFc1X/wUqC4KZGTycdBc2DQhrfoWYvGVrOgqD+amKL8ieE7TCVjAArT4wG03iehBictcl6IYbi+SB8C5NTOmnwfassA/dK1pFPuHrQGu/DFCitTQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d55a41c3-7982-429b-3223-08dc2e6c6f7b X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 21:24:04.3007 (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: UGZ16uskdB4NklxdT7s0CvXNo6ePdTdwn+Qf8ta6/M8JkWIuHt808fkf3pLBjpXcTWPuxqXwCASlRyZuBL9f95x5/O/0CTMSTiB+faLsTgA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9128 Remove set lpac user data at bcast ep register --- profiles/audio/bap.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 88c93127b..38ee42894 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -1207,8 +1207,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 15 21:23:51 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: 13559156 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2044.outbound.protection.outlook.com [40.107.7.44]) (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 6EA9213B7AE for ; Thu, 15 Feb 2024 21:24:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032251; cv=fail; b=muVpAu5MeqeA5E2VmSxo1aUa6L4GMlbf63jDasKQP/Mvq1agGpNAVQe0hjhBpyGl4FegbUycGuHXx5AO00T5tAClRIqMnMpFBvW0dGZ4bZ6nPcRjSXu8lAptqmc0YCBpkCsxyzioEBunH1YqwjgvDHLsKpuJpxKdsdVbJt97+Ng= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032251; c=relaxed/simple; bh=CQuEZfzeX/7i++k6b+51kZsiB+lT9viCeqO3UeglZJI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=N3NOsNavrld8Z1oSkDFcMIXbQkQ3z4PbjJcKcz+DZagGDQl33WNyvu/6PsWzKgSSFjfw5vM3vMBTvP68SnNmYUVRbr/MA6b3Sh/1pptQuLDCCgiNrgboHuW84UcVZhR/fbOdOOGHx8uCIiPh5roZ5XdDkMinsCBCL0ABONgypQ0= 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=Pomrf6Z5; arc=fail smtp.client-ip=40.107.7.44 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="Pomrf6Z5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X1afoYgtPWaXlRbMVNXxQkKEwTPoSqnRryzhG2tLlmj3kxFNiVvwRBrRU5TlDvd+sDEoxqjOmfIvbTSW4BQKiZ96+UyA4WUbo4jcOPXR7ZycNhy8DtcEEeJ91UcCP7XLFnHh3ywLZUh+ydcr8DNiKDl2yhg5jYUaXPjxcvEHUoHHuRQ/yJlCiX3UwmnT8H4vnAU9CMXQV+HcQlffH7K+ck0mVtH/OId9HJC3/n+ts1wA6sH1sJ9vzXiRuY13C/V7L22dlF9sjJFNDl1JhLHvRL5QGDwMiz0gRsoUUI4SsST4TPSojdNDVRAZb7VyyM6V60+O/pJDcqpuyonUeHiAbQ== 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=IzejN/d5rVJlgsEvWR4ctMLH1jEm0TmgBUt+ckCX6Ow=; b=IAOIukepp8TzqlfgWREQP2+2CBjJXK8m4hYXt0yxyRH2FSM63QB0LIUBS/kbx4mf04NiZHo0TJvlTK8FPAHzvwciVb5cX1ZgDQ4qZb4HVhMBVEIg4ej8/e9hI905sdGsYohFUcdQ7y2r3XiFAB+rvGCt3Gwhg/Qy0DkMrmhOLThKAhANY9PCY7XUPELKjj1RVAdr0H1MnEDR/8n6fMhIufBR0aU06nHJf8ndhCqc7QNRtVisMv0NX5HMh8kJsQYuYp8Kw+2GqFkafglHB+tCFKvM3iG2UldEhqQHgf/CDJI7Cc3U42EaaYcGQreCahMyIrpQLpQv7VTFHtfLyb2HGg== 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=IzejN/d5rVJlgsEvWR4ctMLH1jEm0TmgBUt+ckCX6Ow=; b=Pomrf6Z5/3rdm03v47LvLokpIN1n+dOfHhiIFXZEvr+Jxb1tKqjA9GAwdTdKP3URBeGmaKqPy2h2FyrPKvTG/tiwZy4JewJ1vZ4wXDXnTPfkLYKWstgzLEWgPPZrL5VOofXMUBg7v6jGbhIZVj/0YK9Jv2W4xcspADTI05Bsz4o= 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 AS8PR04MB9128.eurprd04.prod.outlook.com (2603:10a6:20b:44b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.29; Thu, 15 Feb 2024 21:24:07 +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.7270.036; Thu, 15 Feb 2024 21:24:06 +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 v3 2/7] bap: Split bap_state and bap_connecting in two functions Date: Thu, 15 Feb 2024 23:23:51 +0200 Message-Id: <20240215212356.310301-3-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215212356.310301-1-silviu.barbulescu@nxp.com> References: <20240215212356.310301-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0PR03CA0008.eurprd03.prod.outlook.com (2603:10a6:208:14::21) 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_|AS8PR04MB9128:EE_ X-MS-Office365-Filtering-Correlation-Id: 1eae22b6-4da6-487d-5a43-08dc2e6c7106 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Sd2QYfqjldewgilbw8grBUB0czp595I1ZgDFNsBgPadYgvZuvqVKWCZP55ONipbcY6p3bri5SbJMPcPbyANo4YcJ1SjA8HR6T3vNNPRH+ULrjgqfnsfMEe7PNOANTsIApCXEPixDlH1StHFFGhMg90AynEMRISgJgnxvKzucievWxAEDAV3wFY26iIqZQil5CW7s+LkAIVY+mXht4D54ZbPJ2iYseQjgDGcT+7jF89IJ/2KoAgZRkSY5UTLB5EIxdPdZVH9ZqFt0+ZHgjDmgRQ95tCQiRM7oKLrS8GobOGgEgkSNIqvoAtATcxP6xhqTpZAzg52m+qnVVtGLfZ1bazgW+TRwpChGF/tBbJm6aGtxT6m7CXsoSj1f5N/rmEcI0pxtVk+fG3RPDEA37smSIJtgjtNS77yvi+2QsGDu+2/mJbxt1FZYdXuP99iVFOJyyh8wbYazdmW8FxaCeZbTMHgXg+RjK0DSP63ZeVw+Q4998R1dMmv9+UtjzyRL4xrP3D9Qnbo17rSu2oIE2T0Bw5cAEQRVwXThcfgCrVLjdCEPwWpJNclOKYHgm5LLsgU3 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)(136003)(396003)(39860400002)(376002)(346002)(366004)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(6666004)(316002)(66946007)(2906002)(5660300002)(66556008)(4326008)(66476007)(86362001)(478600001)(41300700001)(8936002)(6916009)(8676002)(6512007)(6506007)(6486002)(26005)(1076003)(36756003)(2616005)(83380400001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5OTOZLH937qV2W/pqoOdUmHwABrtPDB+8REQDwKIbdsju3JHxO0Q7PPqLijO3DfM48ZOcOZ3ZqD9zt7N4hB+Ht0VaMd694IL4Mb+w3VUbApClMEWO3WNmPSMAc1ieoCq0HY1Y8FnND/qmC+rvufaiVf4dcnHbcoyjDmxgKZMDAq3B5YK4uMQSMY381/Pf3bMPKqIB9BWbKW8Pe/I+0womTVctq1dIAMLWNTv5kguasUxMN/f6I8sdo3URa8tqdFIGC5k9dmv4gqSestmMCrX0EuG4aCrpESwpp94g2o2yutC6kU9U5YfbXBWqCXskUB0rCfKNzbNYthSqGTJzAszAXE3+B9/rG57YUAtLAqtgimlt7RdijauQGTSUaQVOqajYZNRFTdouIsN8rjKex9fQ2jcvqu6eY9d/unnYVjRCk4Pysl3MAFYgHvgy5a5eocFM29dkCk1pZIornXHgJEBG1Eqzo4xpu9mqEtD/ak8Xfeehdn1wDx15G0R0b3xIFEdNJkt9ff3SflI2V7oymqzTX7d+zDIX9u28qhTZfJTjpzpvPM4zDsITqxWJfVZabYV6JO8fV/URiXTOfrJxzXDgOnN3fYhZZ2V8vImMc81VjvsO6zd1SjlpIAFWST3LLGUC2g9bpPS4CtMu84kERvExbjLL4Pai4s14OpenxjShIrSe08x6456X3pmeDQ3C1s6A9PztF8+jiGGdVDOLayOyDT/UFCxUcagtm5LoUHSBiwYAM+Ih1Jjz8RzM1GQvcxgTSoT9ZFuUeed8wDK3GgcvpKsIP3mISdHcsEMRZctxehAkZGWWDS4w9tUS3bctzKDFccXNXxTj52g1MAyEIT4/TiBfF0yLGArblSYq/E+ZEenyEj2q7bUtw2V4vDi03mqJntvfGoQi7IYVHobVwXKt9HVxcMJpA4RHPv50f/ZNJeHdt6HolziVIn28Aat00Ckhcs1s2fI4ZGzZjlUoauSxFNnMsaC6wPCzwVkpr/nVBU7p88Gtgrmy0Y6xNVYsTvXOwvN2FgN4M5wZTzApdUpkFOX3+IHGX24O68aMydZcdHBBnjxT4P6PD6QoiGGln8AfK7eCvMhD9ATnPIhGu1EDIIiedDOjr6ylbuERqbrE6bf0puMXtHq9gcExF/XdwbMoVKOCDtmmSmqO06knYxrSve7dXmwWaovICoHUOst0s0O0vBQ833+7UdEHzjg170V+bkhG6Aw2CJMrv6fnzInOprvGYC9pLkpxNssJ1tZ3Z72GqsL/LNWixLyZ9fWqrQW0mXjhmNynDxx4klMQCC2c8RbbR1yZe5VoQbIGW3voyx1XcVDS37PXACTCspc36uGbgQhs2ydHqD9pn5FEozOJ1ifZzkpbnxEwOLFAmN57Y0q6A+E/boiW0ag7wCUIIgBbOY8DlzPD6p66UE+YpBnArH1raldbYA9ycDNbKXn++2/4/StbH95ziLchBfno8a2SF2CyrZTChvO5jK3Yd0oJWCiVqK9dterD5EvFbqc2qq4/sJrmJTZxp8rHYyxsnZuCjTNKeKJDhPuMytGru55PRm42BibAxszUvT7Gb9NPKRhWb328Sf+6j/Pr0JLWwDBOW3kicPf8j0IIvnHb0Aijg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1eae22b6-4da6-487d-5a43-08dc2e6c7106 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 21:24:06.9078 (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: LBmtyg73AnJIJBs2qnDdoREwsjPKOzxvDEIzSCDNwfauNnF3PUHDu7tD4KP7BLZyyASRpMeFlqk8U1TiyWX8h+TvK/frDvT6OZdVA+Sj6b4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9128 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 | 157 +++++++++++++++++++++++++++++-------------- 1 file changed, 107 insertions(+), 50 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 38ee42894..b4acdd9ef 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -2098,25 +2098,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) @@ -2127,6 +2121,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; @@ -2320,45 +2353,69 @@ 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); +} - 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); +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; + GIOChannel *io; + + if (!state) + return; + + setup = bap_find_setup_by_stream(data, stream); + if (!setup) + return; + + setup->recreate = false; + + 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; + + 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); + setup->qos.bcast.big = iso_qos.bcast.big; + setup->qos.bcast.bis = iso_qos.bcast.bis; + bt_bap_stream_config(setup->stream, &setup->qos, setup->caps, + NULL, NULL); } + + DBG("stream %p fd %d: BIG 0x%02x BIS 0x%02x", stream, fd, + setup->qos.bcast.big, setup->qos.bcast.bis); } static void bap_attached(struct bt_bap *bap, void *user_data) @@ -2456,10 +2513,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); @@ -2611,8 +2668,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 15 21:23:52 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: 13559157 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2044.outbound.protection.outlook.com [40.107.7.44]) (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 E953213B795 for ; Thu, 15 Feb 2024 21:24:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032253; cv=fail; b=qVdYvLfCCzvMJrvze6/WcX1mOFU4YEEE9+X5JTJKftdnqp+ZpY/StdhbR/syjefXhLKX6ybss+Fg7FXClbhppRVds6GQyfZ0TDeGa+zfp/gjqqzf6fjl0t0W7Us2Ty5vLwwZihyXxozEVg3/AWmDPRblF/5zHAQkDBH3/PW1G8M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032253; c=relaxed/simple; bh=OC85jasOIE5LsWNQBFoX1vYMBw+FJiyAA/rfdA2EWYw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=k70zdcZpUgF6F/vcUV8ccbyCyHOph5Ogb1PEYKP5h0hVvZcsaKJ9793sv0/4+JkZyXRL4MwbsTgC8qWrSYwTvA6u2ltwKalapFIgHUJW4v3a04OSRilH1vZGbqyCMbHXGZyv46SThd58vO97zM8fVpCQP5QuUluOtd+AHscf1Dw= 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=cv3Rad+X; arc=fail smtp.client-ip=40.107.7.44 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="cv3Rad+X" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eSKElSexYKuwccz6QUvgy5vjWC7f9E39ns2yXuTwnyKAlxZ+CaAYFajbuyPONaxFx9q+YIlqldovpNPixp9JI8x/OerxPayaGTrPMXqmhUjL8G0Of57DjK5+MRkBGl19TJGEdOgoztIysBUiZxK1/2foeM+E8ctu3HkOdTKbM4uyP6o88SfaMwm4TkIMxC7oej4zuAraQAi+vtIYYVrdhe8dPCnxi4QrJqgJwF+mIFL54WqnYlf4p8vtsGZVkhn0OeiPKI012SudadNLe1UtMOhXnDaia17bo8hajeQ4fDvbxvvzOnPPtGIztni+0a1llzCyIVgTXySLXFPebmCyLA== 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=S2ApdJOnI5t/qG2qRJb+7kMs5u1ujioxiNWvX8YsKvo=; b=IrSkNsWKWpxTrFP9g01n/gXH2MqEPF7VDxyPN3ISljyZxikJhKM3noHE/sedODXLmPdVZJogUnZd11rjYN77RIc7a5MrJ/VvL7MsO69YC63sumQJNgy+Mw0c1Oe7TkJkXFq8LWQIW+nkri14ow7erl56W7d0gWoc28+NbpImKqu4fxcYbOCO8MbcN9HClzdC9VrwHbyTgIOUV60izuhi2r1GRh+Za5rGQOtrWXTS0pU4Utz+jGhrodrw5c+ljvNW9lQThdjxc8K2pNQE8fgS7jLZ306resyLuwLzsN2bmPj1K/JsaAKzqiJFmqH6KtKMm1uL2aXjxiln+nWQprhRQw== 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=S2ApdJOnI5t/qG2qRJb+7kMs5u1ujioxiNWvX8YsKvo=; b=cv3Rad+X0suJTphy6vx47H4ZM9p4xXuFS6OsgilYQHsDgImk1ODTMvySlCB8RYIZlm17Td756QbZgkkEkChlGj8SfBLQ8y9zaPYc8yW5DJrHHcVNYmFEYvJhrdja97tLWz4pd67n/DwOWo0JVCqgPTyd8RTIQ2FUOd+3ariKIts= 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 AS8PR04MB9128.eurprd04.prod.outlook.com (2603:10a6:20b:44b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.29; Thu, 15 Feb 2024 21:24:10 +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.7270.036; Thu, 15 Feb 2024 21:24:10 +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 v3 3/7] shared/bap: Generate one BIS BASE for Date: Thu, 15 Feb 2024 23:23:52 +0200 Message-Id: <20240215212356.310301-4-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215212356.310301-1-silviu.barbulescu@nxp.com> References: <20240215212356.310301-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AS4P191CA0020.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:5d9::8) 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_|AS8PR04MB9128:EE_ X-MS-Office365-Filtering-Correlation-Id: 878efb70-1c78-4c4e-514c-08dc2e6c7312 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LAAWQu6MZCCLhaR9eCOq0PzTUJGa85kRGTjNcGJOFZLi5s2CgKlIJb7Y3P1/Z/3gssbiJ1TFfycoQMD/Oucfo7dN2Nqxy6WltOhBEl2LRHp+Wmv0POo61JsgIDrBDi7vUIXFokTVvkPUIG7rFdOXO5nMhhplKNxNa5mrluTLVM/vZOqSASVN7TK8Ho50uDknJ9O0DEAxdlRZdv4ZmISbQJUKjflzIEvNpmC0XcwUjrGa33t6HiuGiznYpZRnTSIDEinUsu5ZKRQutX3Z5eKm8St/d3cEyGnFC1jwF79VO9+DSEtrHfk+o3BJmbZAxspQr61PT1WKz9AmYjx73K/pDeFS93Tmr8CFyxodwbj1kb0W6JSQfJDVgUA0I1lgtt9JcNFhSrrGd15udd//j+xvH01TvxTjU1mfnfHNxa0rSnpvhYpDd3zTPTpz47J3ginx7oQkWv+tHEDdcIjjIBR2k4SuilfDaIP7+e9SSsUX5f5gBgwg6r/00t6152ADuAmyLY9g4z4mYzqWfXoG3CvPhoKwsOjWf6hj3Ndj2o0AbchMm9Ow2nyL0A9b9mV1uSyV 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)(136003)(396003)(39860400002)(376002)(346002)(366004)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(6666004)(316002)(66946007)(2906002)(5660300002)(66556008)(4326008)(66476007)(86362001)(478600001)(41300700001)(8936002)(6916009)(8676002)(6512007)(6506007)(6486002)(26005)(1076003)(36756003)(2616005)(83380400001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: y6iHvqfFCiyFs+VQmXlw8BRkjrcoT7qMS0yzB5djspA4b1ykh0tZIQ5kgnBe3ZINg35I0Ef043LygziWcKjNnnov9fVWY6uZHf2RrNExDicDd7KhSYyHcxomxtyqutUQViNOcrcNOOXgbsBlsuxGybabCoeXQSBMKRS34yI/9AhfKoeV0Dwc8EYBizV+VSphkpj/mHxO2OD9GvkOVKCALCt6pGOP6snJbDbXufIyucPSRTGgZZRNHtTSNtfMwkShAIEQ/ciTmbpwAnLbIFrRJlYBIMRaNNy9iO34D8TCcEGng7mikVorYlVcN55gH2S8bIcvZcGMJ45OkeOfkr7s04I/+bdNfUAi3AW++CQIdUjJNmUnfitpvbFPJs0UZwM2JPArjSNIO5/3ywCEe046BqzR6SpWmEMwmakNfcPxU1idun2shnD03vIRHIZP6qx/YfomSHNj2unm3oOPW6157lPxuXIvrzEFacFYkBEDW0V3aJbAvbKq3wOQ0Fdz5JaV6b1r/7VBODwsbEteBa4np5MPUBtHXm4oj3OBZmtodVPyVaao6YxmiVyTBiKv7T4MYJdKtPUNk0WNDojr7f+A7XrNs1ghlH0z4jfqrtTT0IYoFGK2xEmutMhejhJ9t/P3aEHiR8lBN5+/8etm9vHR3eIBZq0QWJ/yt2Xkzt2//tySM1m/Gd3FsQoLcpk8zqlS3X09GDfhs2MOoceeDW69TbMnF7E9Jq0PjJnD7b3DuWTn11XgMJlpCU4fWItAtK+GKRtvIq1p3kndL19A7eM2KUrJWyRvdFReWcziIHa6w08prug5rr+FVjebEv3engRq+zEKUsby8KYuBWBLSzyCQ+6DncY5vme5u922dEkpOiJzdxXoFoA1cSFritPMkEXPpauM7ZZ7Thfb3IUBXNs3N9DX52wE0eT9+0i04j5wL3GgCJa6LNIuelSpcJXsMhMU/7P3r1fExyCsXQg1zIhX2fG0LZDsQZ0Z2+QEVOQZsUg5b/baZa2mnhC62x5oXh4Nz6DL4XmLYq6UxOpdF8wd7uRQFfYys+hjTAbLoYJHLmI035P8zf1PagKRNTE3Vi81RlWYYlw6uMqbCOTwv3UfFT4PDJv9k2X/NLNGegSjrdgc5E4MgceNwqJ1frrss/aMgdHqBNhFnPeRgVna2Nb+VDeouuglOZuU5/Kgx0UCntMg6nN0Si4iX/jtIpIZEyea1bHzpGelBtR7+WyY9yjJm/4T+u3EWUVM1UQdyGFA+HqBAtzz0kjH6/Wzlc5KXTL/gnR7QIR55y/RH/iSY/Lv4IaOEtuL9nfnzi+tY4fYlUiGwqyptX4xfeMsbeEFN8H05tVNQ9ODW56kbWLZ6ZbNzYTz8miTcrqN0MrD0wYlgAP5ObdeDdqQAJiSHFFWBDjuOnGm95gUpwKljMF3ewxvQuCcvcvzHjBRELL67VX40sJEnML83dgoyjqMg1lRuZ4xBIe9V9K+7qZVnP82ZHVI4TYNlgVKX5hUrghy2QedGpYM6CvkhsnzdViIgXHsdcD/24ziVEXfS364w8GTauBZrz4E4S5D/BSaeyUr+i2bXdhqCansYorVxcXSCtJuTVgCxV6zQl+SH6Ffm9DAaAifXA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 878efb70-1c78-4c4e-514c-08dc2e6c7312 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 21:24:10.2577 (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: Ijvf0foymbmwrnWHH0oSsUEToNxJXHCyAJxsesUb7JWjQgWgnCUTJzZaRdyBuQj6VQI2e+VLPnmBJKbzx7RuiaCD6TypDTMm4EyePqKvrtI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9128 Generate single BIS BASE for a config with BIG ID 0xFF --- 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 e26dbf944..a39b95407 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -6094,11 +6094,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); From patchwork Thu Feb 15 21:23:53 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: 13559158 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2055.outbound.protection.outlook.com [40.107.7.55]) (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 0E5CD13B795 for ; Thu, 15 Feb 2024 21:24:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032258; cv=fail; b=V492acok5WvR3/mpQw/jEsSwOpmLOq24vsq2WY4i89xd3vXLWK3Oz9Jj6LfkWty1ZTUIctJPf0RiGhgIVvJphXSpVexVqplhl+Uf+5AmNJ5i/eV8r92D/JhMm7iQLlzl1MmGGVyQ98Bwa/eeR5QF88ySocu52PdWIyMZ/4blmgY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032258; c=relaxed/simple; bh=Fqu+6fGJfDrDZJAqjYWxft7xn/tmm3KcoJ5IaSPyypY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=LQp7VSBBRQuFDL9ShWP67qspuIXxHuGI5GJMVGbsUDinQKo172NcrCwLYyhDUPPceflQfdgzG2WVFry/i+Z31mxl894c6IIVwQftKy+raEUdnscpEye9sV2f4skWillEhNfIMwbnwgZ46Loun/RlnlRg7PUDsodXhW84mXOFmeI= 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=VceSSMks; arc=fail smtp.client-ip=40.107.7.55 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="VceSSMks" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cDDcknXlgJPWQfQ095Pxno7UrO5N0TuakZTobzpEsSjgCtkKjVJ4RSEjNpvCGLFSoPXdz1VKyi300Qn63Y8kuEurZkuI/RUoYQfmk6XoqfeDWcEhP/TBw97Ar/bVG+bosF0V8YC524uZtj8Ncv5rKaAlm1Rv3QTGjfyNCzRpXbQ3XBwoJSTZutCNw4fd9rpX4Tu9AjDU64kNLJMS9HMbFXhOC55ScTPU5eay+IFdJMWV8QAlZNDCcS9ucSMso2fV3qTd3rgrtHvgRmeeWakZf18AksEU7QzFrbdRb8soB8J4W8osDmpsloYARZLg0KYRLmlFoCIQui6RfMZsGNRuTw== 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=JjCxE2VAeAS66NRczCu/XlzAnSq83fX93NJ8stVuZ5Q=; b=obUoJv0Bp5zpRM437axBU6Eis4kwaftQXNQFBTY+qrMvzL9XwRQfcYv3tgkipMZ0I8/Dibm7MCoGa16c7ozCIVey900sPwea0zQKldMQCNL2HHeRBdcg3PFk+FnGfFDlyi90v+eH5DH1ULjOIxghZcGW9Hyxpvj5YWcjkPcD/GmZBMyN8Ak6sRsNN0xzVnnKBYjUoHBx3MjbUTjoQaf8riIiP/BC4Tz0m/T82pOQQnCivcKssmKJc2JCaIcwzGat5YY2qJovw/48YZCdVjbfMg42pViytLGj2xlufYgMnB7A2ZDeTWN78ctCH9aoX6RLxQysfRA8iIBF0JHfZaAN0A== 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=JjCxE2VAeAS66NRczCu/XlzAnSq83fX93NJ8stVuZ5Q=; b=VceSSMksQ3DhV1HliGtQS6EC4jqH+McnQzLj4icktgrTTMXB20cS5oV2j8gsQ/FB4jlC+/rOgYULA9hY1zFXITwS6TCyFFjCUOK/fiyAViICM3PG6KN8LChy4VdLLJhxmY/BOhAjd87bL5cylocfypEReKnV0MCBWgkneFZVg1I= 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 AS8PR04MB9128.eurprd04.prod.outlook.com (2603:10a6:20b:44b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.29; Thu, 15 Feb 2024 21:24:13 +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.7270.036; Thu, 15 Feb 2024 21:24:13 +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 v3 4/7] shared/bap: Add state in stream struct for bcast source Date: Thu, 15 Feb 2024 23:23:53 +0200 Message-Id: <20240215212356.310301-5-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215212356.310301-1-silviu.barbulescu@nxp.com> References: <20240215212356.310301-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0PR03CA0009.eurprd03.prod.outlook.com (2603:10a6:208:14::22) 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_|AS8PR04MB9128:EE_ X-MS-Office365-Filtering-Correlation-Id: 59a536c5-e261-4681-df41-08dc2e6c74c1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QeOpbJ5ipIWQ2iRuQerUMwtCl2XadfJOQAnehGbHVh1WhZjPB/U4qrfD395S3vDSdCs6d3pnIObEh0AquPRn6kLq8M5a+Zu9RjCOX+RMsziIVtuaR3t6hdy+aHd2HXoL+kQnMXWBLupAvaPaosTnYJgvfHCp2VSdocOlKZtaoaq8tPYe9+8PvMyIcLlxNrhEQfmHAFShb8INvx6JxTSsKEgMThmUCNqjoiMQFuUEdQoyHfn60CloM9fgUS7olCnSz5xlK2HgVIjFTY+eLjac+cJR1HIHS5jsT+D0XtiiAWacx/kry+77a8ZATheojywdL9MQqvr7XRbIolmVh/DouytaQOb76JNYtkqt9NMXkvGC5oKMxnwB5ybKf2iytzAz3rtTQUbONounYtKyQUN3tiYRaeS91KRefYH9TJcCTnCHUGtZb5HKrEUn3Jl5KihH18+D17rcxiaDBiQL8Bdg6Xp4EQkZ10PcxAc/ljjEGRFARzrIhYA0P+PIzVI3O1JmuvKtV/+F8bccBX5gIxIwMQBalaM0+il79AA5AMszlEEak8GopFnrx4vukvTf+2Rx 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)(136003)(396003)(39860400002)(376002)(346002)(366004)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(6666004)(316002)(66946007)(2906002)(5660300002)(66556008)(4326008)(66476007)(86362001)(478600001)(41300700001)(8936002)(6916009)(8676002)(6512007)(6506007)(6486002)(26005)(1076003)(36756003)(2616005)(83380400001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tCrXL4MnawwYTbBTGECnnmeHvlop9RmT/5Pj8+oKpeMcW4PtNuoDkvDw0hcl3Kqnv3rL008G+O3HoNyg0zsmOtgt5FUkKNiSr72ELII05/F2fsbJNf1qh0cJGB9fu0tMb5WNG1DYrN6wyMovsRbJTFyR2Kk3fj2y+BL4PHg6wxTwWgdWWnJrbdul024piD+Ez73cD7rO8P2iPj4rrPl9gRuZVrW2IS5xVjr2tGo6vuS/CSgETNkXnEOLJ8lPup+JZ/0nUmc5s5PT2kSpJ2gwsajUhYmRdQIjrLC1gv3mbX6KbDgvVITStoOdCmCucUEyu5OAFnoGar0V5H+0eBUdgW7qDPR1sov/S32Z2J269Z5qpH1DwXHTRSJKmTx/SD2ami0cJCO6EsCJL+NON5rERKkk15LDzZcXhSYpJ8eatQeh3lAKNqkvS+b6G6zpMedsRsId3LqvInX6dJUerDjy1PHS/xsevXDM3VRtU5Pt6ibIxixo0c6ct3z+rv16SofTV1UMyzq35+ZaWmOUGqGFNm5ubHWXrYgLbLwtZEs1mxTFuFqHzMr69iiDJS5WLFbHMENrRLGMbafAc1JoutHGbX9zqbaw++Y8EQTb3urjUljNwSZ8oEOaInrMFz+DJZdZ6ODb6QBrlJyphi5my2seEKE39yEpwl5WXy1DmT+lhS0TeONEWhQfmmP9Lw2+vaRdShrm7nx4ruz56J2gw9h5VP3RWdSb8AIlW1an7sK7Z6ekZh5lHOlw3c94KgoxKZleV1QPfl+4ERXkNYPwdmR5AePx0pXh9oOpmW0tZ65PBjCCK0ctvdcTwoBUKmS4Ddsd/b6Xtb3cQAt/pkgtNClWynMiKT0gomYV/HPMBl2JeiYoN7gOjkPRoyfqid0LmhVBamFd50bzdk3TDbRx0oMvmxz++U8jKL076/OL1u8H0S0/16+MNXPwmTLDGkMTYKro+mdcUasEg4xbnqnQBkGUKRaZbZ/h5I0ojgocnDxOyS2fJbjSKbX26p4bHeIONERCKRJuWqWgYsrccGU0tzTkQhtQ7RAeCh3MLaTqrCBYc4n5kNZQPABDl48QcmPiS4k+5alZtId34le4wT3IM9LfS3DnD5wdj3x2dkbiqok0l3EZjecDrIFxZnKbxLp2VXY0j8lZr8bl21kJsxDy5bdmU7NUPv/9NPhyYVdw48Q36tk1+wRa8fKBZMU0FXPMtuJ/22Hq4XCBvHN6YvGZ8NLlVYJIRrvCbLE1OoTzBx2Xv1L94zgRoId7+4vkdLeRX6xkKHrEQqHATuanRK9m+4bONuqKlYt2QdQjPoqZRcrNWQ32zFIexJIDx983amXY9ethxfcsLlFtMKQSoME21cTSgGzJJIRjW9c/0az1hQY45xP599kjNjF4c0WyGnOdt5ykewZXRMDqi2w4jCoBzC8b+WBvku8vYGnaLy4HvcBkJAkXEljGZuCKh1IRoigfTNp6qlJ4CcYjwQB8XmkNWQnOeC0Cw/TKKupvtKEbu+/+efcipIfNS6r5SucAseflNVSEL91TDr3jDyqHxYASxO1pFQMko/OvI4TVXhDfOFbs3kctqdIoAf6cah1ujq5tlOpI9zZnNwUWRCWCGlaiOFkAIg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 59a536c5-e261-4681-df41-08dc2e6c74c1 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 21:24:13.1208 (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: RwYLX0U9dbqBMe/CM2gMys5JsUshg71ulOCi2uhglscwX/SpSF9OtBt8TQpt8GjM6Z4dwnGnhEsvop6j9buF6tC8jJKot2+34n7TpbBLc6M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9128 Add state support in the stream struct for broadcast source. --- src/shared/bap.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index a39b95407..524bfa058 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -251,6 +251,8 @@ struct bt_bap_stream { struct bt_bap_stream *link; struct bt_bap_stream_io *io; const struct bt_bap_stream_ops *ops; + uint8_t bcast_old_state; + uint8_t bcast_state; bool client; void *user_data; }; @@ -1271,7 +1273,6 @@ static void bap_stream_state_changed(struct bt_bap_stream *stream) static void stream_set_state(struct bt_bap_stream *stream, uint8_t state) { - struct bt_bap_endpoint *ep = stream->ep; struct bt_bap *bap = stream->bap; /* Check if ref_count is already 0 which means detaching is in @@ -1283,14 +1284,6 @@ static void stream_set_state(struct bt_bap_stream *stream, uint8_t state) return; } - ep->old_state = ep->state; - ep->state = state; - - DBG(bap, "stream %p dir 0x%02x: %s -> %s", stream, - bt_bap_stream_get_dir(stream), - bt_bap_stream_statestr(stream->ep->old_state), - bt_bap_stream_statestr(stream->ep->state)); - if (stream->ops && stream->ops->set_state) stream->ops->set_state(stream, state); @@ -1527,6 +1520,14 @@ static void bap_ucast_set_state(struct bt_bap_stream *stream, uint8_t state) { struct bt_bap_endpoint *ep = stream->ep; + ep->old_state = ep->state; + ep->state = state; + + DBG(stream->bap, "stream %p dir 0x%02x: %s -> %s", stream, + bt_bap_stream_get_dir(stream), + bt_bap_stream_statestr(stream->ep->old_state), + bt_bap_stream_statestr(stream->ep->state)); + if (stream->lpac->type == BT_BAP_BCAST_SINK || stream->client) goto done; @@ -1942,22 +1943,25 @@ static void bap_bcast_set_state(struct bt_bap_stream *stream, uint8_t state) struct bt_bap *bap = stream->bap; const struct queue_entry *entry; + stream->bcast_old_state = stream->bcast_state; + stream->bcast_state = state; + DBG(bap, "stream %p dir 0x%02x: %s -> %s", stream, bt_bap_stream_get_dir(stream), - bt_bap_stream_statestr(stream->ep->old_state), - bt_bap_stream_statestr(stream->ep->state)); + bt_bap_stream_statestr(stream->bcast_old_state), + bt_bap_stream_statestr(stream->bcast_state)); for (entry = queue_get_entries(bap->state_cbs); entry; entry = entry->next) { struct bt_bap_state *state = entry->data; if (state->func) - state->func(stream, stream->ep->old_state, - stream->ep->state, state->data); + state->func(stream, stream->bcast_old_state, + stream->bcast_state, state->data); } /* Post notification updates */ - switch (stream->ep->state) { + switch (stream->bcast_state) { case BT_ASCS_ASE_STATE_IDLE: bap_stream_detach(stream); break; From patchwork Thu Feb 15 21:23:54 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: 13559159 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2055.outbound.protection.outlook.com [40.107.7.55]) (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 60D7C13B7AB for ; Thu, 15 Feb 2024 21:24:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032260; cv=fail; b=Kb4XxLD8+LUmpC6xiIIBXGNBg+neFFtuwPhkjdiwZb2SW7+nH5zQzkrOlw6w6xlNj3M5WdX3MR5lkYszseWLUItoHbKCspCN5a2Nq7TnTRahaShlhowYUn+53hWgk77TfvcHZJFonKI+8J/g7GWq8QPh+Z+ofCLXZSl7zJDrbvM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032260; c=relaxed/simple; bh=WQv9nzgbA0HJf9t6Ul6JhEdhcUKJYXpvHNVq8EKg5nc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Ah96SK9NjUAEhWTO1fZfb4Vni4Bh9qtSLsbN5TSyerMYY7vl9xnsAht4QYJs3ddL8DDTXKqngAVsLJScIIGAabP+bstXY50fw4aAU4nCgke1eiLOvIV5bar6JnXDPjh/aYZ56fNfc2mrrxZ49g7y1ATw1XCQcuGa1fsftG76e8Q= 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=Vn1BMDhx; arc=fail smtp.client-ip=40.107.7.55 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="Vn1BMDhx" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l5RvL9jYiPDarIi7c4KUJctnk976knUF8dmG/oRq3OQAhXzUKzMnUi9ManyLp5qVeu8jtfoMJnEvREH/wK6oY7pUrtd3oROH0tbK3j5RK7dCULlNQmiVT60er9fMiKrzt3mq0QDjHZqPsYoPideusoqqlX3WqaOc7ogeHLa19HaSvlSnoxQLfMbfrQrSLctHYbNmWaltuZBqeArusDY+QN65KIKWzcFUL1EpK56oPjYLkNdzp2zAR9CFDqBSBWMBQvtqFiT1/wWQHOhNPxp5GkyeooR51NRLDpMFRmZMuPNGW0SBEbaeZeEVKwH+0VQbgRlwjRoea/Ms2ACoMqaH1A== 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=xmPi8+u5IdQwTr0VAz2Ml4KooU3k4eu4lGsZBC+ewHw=; b=WRgJ7wVA8OGTgK4rUg2ADpSZ01ZKY7mSVr2hjKlDljQMzV6yW5fMgvnQldwmWy+FOx/X1hE1qc5UNIiZO29UAEQ8GDIZjQl4+xPmbokngexOQiTlMSm4jmfSI3fVYacLoZVUOo7GrRceRUQ+CqayKb/MECzSMG7c4XSdm7MQ35DqJAjHmqWffrDShubal4qz4nNW2rZ8/tmFCydofIFfJ4Ob2AU8+RDqmSVIXfvQu+/CscQrCdfFlmiwxjEdqDuFchu9Ei5iOn6K18jaD3VuFX/OkMgGCn3+S4pF/lqNqrZofN4IO4htrHq4em5rl5uz603tiK6yd9sqysUxsxtKWw== 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=xmPi8+u5IdQwTr0VAz2Ml4KooU3k4eu4lGsZBC+ewHw=; b=Vn1BMDhxgJPH746VdTFGDVPMPlwR56FNkzd6NvF8VW5GvThP1IsnGZp0diPt2nShguA7epc9BK/7vo039e7De3DnOGaGrHr1RUYd8228hqoXO/qYggs2nDx4/RlKYXOZ2Zl/SctxykWkrzhULVDXgS7UnlYxvKqcWe5Fcx6NzOE= 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 AS8PR04MB9128.eurprd04.prod.outlook.com (2603:10a6:20b:44b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.29; Thu, 15 Feb 2024 21:24:16 +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.7270.036; Thu, 15 Feb 2024 21:24:16 +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 v3 5/7] shared/bap: Check state of all streams with same BIG ID Date: Thu, 15 Feb 2024 23:23:54 +0200 Message-Id: <20240215212356.310301-6-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215212356.310301-1-silviu.barbulescu@nxp.com> References: <20240215212356.310301-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0PR02CA0090.eurprd02.prod.outlook.com (2603:10a6:208:154::31) 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_|AS8PR04MB9128:EE_ X-MS-Office365-Filtering-Correlation-Id: c07289cc-b30f-475b-983e-08dc2e6c766d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0/+yAUOXK8leoxZ6cvSqbutheMu6pkSsNnTMqNr78CvuyXK1Ds+nJLSJ+wW6js5VMtL3VLJp/Bj/rp2LkAN/Vn1uAVZ1Lf0eqpJJpkEkXtsuquDVkoJ0hAGd8XHw1w94qdlCVy/SxFvODlcZsf6tqHJYFFP+JFEfQbzg04KhOFkKGdLn6eyR50+KWJHkMbl+Ikmw2x1JyDiQ0rYI4lF7GUDDZmehL8YypFMfkSI99wjhofk1CKGi1jb01RXvo2RlJ+zPxuqOroad0qwxDCAwPte/K6N3i6CkDwI7dgQU5u3NmiKftsMonOvVj2f0VEHgtYHtnzox0OJ8PFw1edjFwl90SHlGaWXPxZ2CLiZbs6d3FqOkROvILMnO8IGegyHlrsTsCJFUIqGEExc2pkFF65jDTw06AgQDUx5+Wh0+obOTA1IqwNuy/RH81+8G7iPhb2zePblRyF5yGbVZ2oZ3RC/8woO9hEegPpWHDKQLFmv5ksPZXU45BFCDuk5BCslySbk4m1gJtpIqZOZ0WmTZJMeb2dybQxBHiO7zRVVdz5KuafMMKuYth6bsbsAiultF 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)(136003)(396003)(39860400002)(376002)(346002)(366004)(230922051799003)(1800799012)(64100799003)(186009)(451199024)(6666004)(316002)(66946007)(2906002)(5660300002)(66556008)(4326008)(66476007)(86362001)(478600001)(41300700001)(8936002)(6916009)(8676002)(6512007)(6506007)(6486002)(26005)(1076003)(36756003)(2616005)(83380400001)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: PAHF5Vjxq2yTkgns01DbD6d738zWgVM/PfUxbTbfL1e+t2XjlNyEs+E+elnYgZqBrIXTpkgz/pW3pDW6e12Yqi6a+abrOhwJ4gB9Qp6WBeQ4kEwD/3YfmHj8mw5tyGDmcHvoxcEig9oQx2XUF3JL0YKOANchl4wnWjGHCkQLQUnVxb/N/djH5mHYkCIxmn2xmNLBg73f/l7WmR5opGIBKgrae3xwp7Lzf3dwUGjjXysvaUtLcMaQU3zTFHLJtSqoQybFW3OK9ktLJ+ivzie+f2rkyMP+egQEIjGT527VsVhD8Aa4TZw/jVmhgfUm9QdljxfW91VCa1EdVAsK6RtwWRyo91LrH7LkoYbwcIReOiXEgk/gpampNZpypJcuac+XbhPytegfvdN84jDrbaBhmTnQgu4W0W3M7eB1KHHVWQuD8STG/+TSzmh8emyZ9SDVPymrv3VtABeB79+RHQnM0v48fdXZhI8vWNqR4gsBPRM8zHSag2yTExg2tmWrRtE1S5zbjm+B2IMLCsqcXcV/Dkhh7aCWUJO8A6efJv15+l9tyWrI31iE8ua2jguuU5SgDdhAAJI5nK2dzgTTCqCoeIlZGT8G6xdZGZ1gWfAf5tBIb1smDu5Q8U4Y/SM/L2/bzFGH4Kw4OCugg7EuXuh3QrdUigmIbWWCLp2+1AGTHJbwKZrTCW3UQycZnpgJmu4MQvFGxKkObjMB3m5wxpH70YcxLGGb9h+vHxSHkySHVz7Ksc3wcrMqTUS4dAbm2vNDIgBtQ+NQzvwT5JoVhLNq3PKV//kHswI5yV2plRBUJc0WzYoiUJoAmBy9Ri0IlSU4Q+A3WynM2793pJTIRpX87z8s0j6TqamEha7sizfJioRhAZ0trS+O23aEYZsrJfHi7RkN+3xOkwIYPGjOjmkADaGhmC7mzM6+toZ1TxGM3XzzIi1Kxioc0VE6FbGvSAam9nPgjkfoy5uDqCUmtWT7EMvKAUwtNGXBrsPf3Ys0EeTWl/aBw3Tla2dNI7uWgbQFguRD1PNdMNNvBold8kChauvMhMfH35fEc6TSDuNcRFJdfwhBWqKb0VP5zQqUiY4MbpyQRiNU9iIrk2GBRZ2UzvZlNJ2g4imwvLvwxIWtkfOm5xXhaJJlm+KeNOK/qgpAm0LG2csNQ8uY3PZ5c/HGvosB0DMAQOrGwe1MuVdU8jm05zA+iJbnzY9L8LukuIm0Rmw9raoYtW8qeLbBR1X0ji1oDrIc1d6RUv6t2N8+35C7mDiBa5OVve/sxMP3tezBOGbRUnJ+SN3Y7rWjRjaTBlLl1o1+lVOQp9VOHu2yMk7ZUjKt3s/hBaiVogee+G0KjphIVtiuInnkLv5xOh+NjRWE14/mbx1QIu0WxsSPpNY9fdqsuWTlBhTC2od04NNXYdW4pyAA4WWagGJPopGwD6RTV20gbRH2OvpJZ9aWe6S+mA6NQYxVIasCpVOrkHJlRgj8IjLSMeXo7NAyLN2dqnPkV1jqV+cP8BvCZZ2QZOZfDB5BAikO5BEc5fdeotZY+ga/u3xJzaZh7M+hYSyPZqYf7JcvU/BKr3dAgumc21DtbNq8XlI8c6PaUKXL9mCbVU5FXUj9niYR5/0cUZKjEw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c07289cc-b30f-475b-983e-08dc2e6c766d X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 21:24:15.9257 (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: 0rTLcuhc0Um6ZpRdMIz+bIL5qowTt7M9nacfoI4k1DoXkLg5s4ZezFrfkIMZwHMpGpNJmy12ybuRxKvrAZYtczLqZ21FEyj8JrvV9sbM3jA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB9128 The function is used to verify if all the streams from a BIG are in the same state, and if so it returns the number of BISes in the BIG. Else, return 0. --- src/shared/bap.c | 33 +++++++++++++++++++++++++++++++++ src/shared/bap.h | 2 ++ 2 files changed, 35 insertions(+) diff --git a/src/shared/bap.c b/src/shared/bap.c index 524bfa058..49d9838fb 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -6115,3 +6115,36 @@ 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 the streams are in the checked state, return + * number of this streams. Else, return 0. + */ +uint8_t bt_bap_get_streams_by_state(struct bt_bap_stream *stream, + uint8_t test_state) +{ + const struct queue_entry *entry; + struct bt_bap_stream *ent_stream; + uint8_t nb = 0; + + for (entry = queue_get_entries(stream->bap->streams); + entry; entry = entry->next) { + ent_stream = entry->data; + + if (ent_stream == stream) { + nb++; + continue; + } + + if (ent_stream->qos.bcast.big != stream->qos.bcast.big) + continue; + + if (ent_stream->bcast_state != test_state) + return 0; + + nb++; + } + + return nb; +} diff --git a/src/shared/bap.h b/src/shared/bap.h index 2c3550921..a37e1528e 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); +uint8_t bt_bap_get_streams_by_state(struct bt_bap_stream *stream, + uint8_t test_state); From patchwork Thu Feb 15 21:23:55 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: 13559160 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2057.outbound.protection.outlook.com [40.107.7.57]) (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 F053513B2BE for ; Thu, 15 Feb 2024 21:24:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032264; cv=fail; b=f9Hwt6XrMmXmph3FT3v8cWId3mSOQFu+MC1BmnNk2aqM8YeG8CjecV7eSj0+xygAzhGprS+FAtRaRh18tiguoV0d1vVc0Vab2O8XWbZYogYbxCm5zyAXnxWXxVpyD8j41C+ewxoj8+3RjUNZuYvlJ8xxr9EvcVMNb0JhuST69Jw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032264; c=relaxed/simple; bh=NfEaeYMq7wCjgpl1qD5td+SI76wSJ7PhjAp1KvnMlC8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=QBMQ+wTAYoMGqM2GYT6wA68HT0IQvbLuBN62GYDBzZ3fAftkzE/XAJQu9YDvss5/R6iPlUPKdPrWtcPfeBWRqVgjAlMHXUJpkYyCcxH8rY8nraSoGEihTqCJr85/7rq5NMtQXfyM0EeDvtW8k5ZXYCd/fL1XpsLUgdN6WgN4sMw= 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=duBma52b; arc=fail smtp.client-ip=40.107.7.57 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="duBma52b" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SmkEO1CDE2CLdcl9gfNACgBRS9FMLvyDnudHH4b5qXTIZPxsy0nhm71c+vVjJv8vtTTMBbgGNPzGlI33JrwNgyg0pvPX9XHA1312TwnAa/sCPKrmgxBJdx1jLbZVFCXR8vCG/Q5Fx/9A3bSSmzW9ClGR3dPOeHPuuNkrzfe8CePv8Wcb4kGSIwaLUx9/NZH2jM5/tG9TqK+MHjduuDRyHCHs2JZi9CxiybX1UJU//D5WIfN9GrM/2GR/gwVaH0l5hVF2E2k+sdD1+xS64CQALi4rBQU08QlHEvivCpXrbksSPkeyXCdJn8Uv074vdqSzHsDM3QZg6y3ywL6f6TuqWQ== 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=2gulSLYnZfHdePQ2vCN0vcmcXi4PtUs3FQkEWFcDuRo=; b=KzP3LNRR9R0kz658y2xxAJnWgT7VWbSzZI68WoAjP3YclwsUE3MA+mTCdzPN1PfVzNLtbic7ma1lGEveVxyppi2wq55Qs/HUQ1QZ9llRDKpI0ANLn7L5nhCm8+/+CNjn1zrrzrsE/jQ6PLh8WGY4A4QsFcCI4jQVv5g4wnaAtGWuFfnwDxehP5f5YE5tVsmcvpx6MKQxDtS+aLT+vnmBhNDgjo29DoPxIXC3mWdeOBlbsGP2VarDQXNs1N1kThHVrCDXF+Kn+bYZk3yxFphBU2RaUuN5ZKHBQHbyKVLzk7NgSOl6AAjrNUoPUT/6SO9IrcCjkbH/RT3Wir1t0tichw== 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=2gulSLYnZfHdePQ2vCN0vcmcXi4PtUs3FQkEWFcDuRo=; b=duBma52b6ssPnx+VO2xYgovUOxKVsB7+eccsFLp8/zkCTOCjbIeOpINf1TAHb8Kq9LIZXryHi9+Uz0VLHz9msQ2g2h0AvhJHAilsk0YFCkzkH+4piRdAR09WRTeI1qB30FO6dXmN1M2iMdLCwAiHLv8aA2NBwDdqrlBFyyIk+1I= 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 AM9PR04MB8275.eurprd04.prod.outlook.com (2603:10a6:20b:3ec::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.31; Thu, 15 Feb 2024 21:24:19 +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.7270.036; Thu, 15 Feb 2024 21:24:18 +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 v3 6/7] shared/bap: Add support to create stream for bcast source Date: Thu, 15 Feb 2024 23:23:55 +0200 Message-Id: <20240215212356.310301-7-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215212356.310301-1-silviu.barbulescu@nxp.com> References: <20240215212356.310301-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0PR06CA0097.eurprd06.prod.outlook.com (2603:10a6:208:fa::38) 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_|AM9PR04MB8275:EE_ X-MS-Office365-Filtering-Correlation-Id: 91b41c27-047a-4100-5d66-08dc2e6c7810 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jDyql1JIsVJQks48DLriQt7X6dlkWqrkzpSIak5I3MpebNqA0h6JaC+sV3BCYNnz3c/JHMb7cC+YIM8P+AUYTcHgs/IqEQPR/3wQP+/65YFhhAQgiheXCzuGk18mSZNH99/YWDQNIELnhPvUcR6o7ETLOdmiRI0TeRgeUBvpygMfTjNp0D0sZEkHEKH7tRSR45Lx+QtJGDqqfKK9SCbbL8eyBNpndRbyv9j73vyVipPBEmKaHuSS9YSZ/AagjEBxSRjvGFdG+n5uTALUx+Z6w6VZZkYuGWDkJyKjdAhXo/d1zzgk6CaIAyudFOLyXsqS4C6XPGv8vD6NOfNSAdEq+ufM9DUdCx1oN2nAUKKYvEAqGfN0zCHP87qWAxp0H3nW6AZeZlTjJ6DWejsn1nyAzjcgItJGsVJBy5cyS3SD3KTPcqQ7K+Sq3Lznj9kulXpb90t06YNtrWBO/zxey7VrhJpl2ic9BtfpxMFByqLD7ZtBGSXsgOWBp2+HsRRo4LHc2hf/KAOUHG+D0SQSS3Ocyclvn8rrj1z1Z4R+YNEP0ynKT9CxEI1EBxXgBzsC9XSQ 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)(396003)(39860400002)(366004)(136003)(376002)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(83380400001)(2906002)(478600001)(1076003)(2616005)(26005)(316002)(6666004)(41300700001)(6486002)(6506007)(6512007)(5660300002)(66556008)(66476007)(66946007)(4326008)(8936002)(6916009)(8676002)(86362001)(38100700002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: aTzff1fl4Hc3VkZjik5Cyr28Cr3AX+BgngW/KFdJIDmbJzk6Yc68Jabu/xpV1uanCxsGg4+ml9/wn2idbjk8gb8bpzpFCPZjis6HEEx/gOMImtqTw5TNipB0lZciI/asbgFCzC+nUkqS9pxJgINsijQWEE1OiNujvCgQa2xPaHJNclSAUmTvSMa83cIMCe12QZuG7DHzuCsmxyXlCT/nVjmXlLkn1H9EKEbH+G81JKPJDIo5xTtpazov03Wyz+oIXW/EYqlMd+sKxwYOYjJ7maBEsnrR8soQfArcIwNbToo6+lW8CwSg/I+ZjbE/YJ+o9+U2xC53pb7etYJQbwKkD8W4bQnyzFT/v7yh8gT5GWOqoLl1vu9KyiweMQXflSoxtBNgAUu7eW0r3FdlAZ0pevPUETWk0zDfLpB0UWyAhkzNJHvZgQ/ixn9aE7jMhgodnu3ujleuL1kFxaNuCzaeNtlnhl+utT1C4+RGbkt9j6fSnEgN09Y1zgp/KniQ5F3x/r3xOIBvxxYyhHWkN+2We03AjJZfTu43TGu7ZDsFX67HDu2UrcYpcLnj2Ingh9LBCQW7Yg+UpSloJW+5V20kBY9/zCckFPS+Cklh060ALgZ9qNjaUok2WCTbThjEm5NbZuGXuN/N7Mp1YA0bH6y0SVepH3XFGJf7YdMDCXXcV+ADqtXPxiU6iDoPLLcpEJXko3NFz/jmnVh9esWPtITloF7zsgJMPqjceAOlp5KdXLq7CY/swkjSk7BIWgpSUC06N2PREn81YjFbL3HYhIPrgKZDFsof4CD6v4FUD5AACsc181GCrXetFEPx4DJ8AQKDdYntey7YcayhJGVizGsrZYRqenczqbpL2FINkvBqryuD9hEoYftKFeqiD2tg+FSpVe+nltwN5yzd7IVA3IZotDvLZ3c9xJ1x5XQlQJEGEBu/9cSoo8pRJ+0A+hVf+uoLNOY1PheJOqIqVxmUHye1mthIgUNZdKB4Bjo9LkcvsqmsGTUg/3by5mRnuuPx6YMUceCZvEpr7oKJiyP7ideCWeEwXpXDBRr4+BHOM/5n4VbCcskb9w24DF+WlUj5fnJm2b+8U0w/8qcxld+wBKYgwkVRQ/xbtuUfEI4Rdqv/0jmFPxGSuWPwurDzX5u5CsW4qq0Qb4juYFgGyHfbpaa55atp5mxJGxDlOoQQHPstxnYBxxH3wfcPoHvSKx0ICox97nk0tsYZdH3a6hSKvoFgQxTplko63mMNdo3/mYfJY7smdiGJC7QNrGbnfOi4WMH1iRiPng7DXHCidy4U/eJAn7ecew5rxeNuk0Is24qsRkojWom7f8UiRh3invs/xN6iUGkbJdHharG1w3iPERLvUmcsfCSY87SVtcecqo84AvuDsUe6fkhHIIWnca1kZiX1ZZJwAv/oZXwdMco/vK34gocLwBNGEQADWq+RVBAJn0Cj6DwwwningfSu40TEaElfNc5eQfprEj6Z13lKPnJWXjfcSl50R3S478rkoYWD+6j66Kr7OkBRHcHDz87MGDYJyjl2rTS6mdAUZwF7SYfPuPx++jUOvG4Gyadk4HOgm/ebjCZDPLOEwBYW3cu2iCSXa19PmMu0uxhnEQYQvmPh3w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91b41c27-047a-4100-5d66-08dc2e6c7810 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 21:24:18.6441 (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: I1fMQqfy6l+0GjFt0fxfvAznImN0CFF3R7VSU0N2kdrwc/mcIyrGudVajjXDjaEDSMfDpwIlizNRhMkZfR7oHwTcdLvNri5dbI3bP4NkMaI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8275 Add support to create stream for bcast source --- src/shared/bap.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 49d9838fb..97bf65c24 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -5038,6 +5038,10 @@ static bool find_ep_pacs(const void *data, const void *user_data) case BT_BAP_STREAM_STATE_CONFIG: case BT_BAP_STREAM_STATE_QOS: return true; + default: + if (ep->stream->lpac->type == + BT_BAP_BCAST_SOURCE) + return true; } return false; @@ -5159,7 +5163,7 @@ struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap, struct bt_bap_qos *pqos, struct iovec *data) { - struct bt_bap_stream *stream; + struct bt_bap_stream *stream = NULL; struct bt_bap_endpoint *ep; struct match_pac match; @@ -5227,7 +5231,8 @@ struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap, } } - stream = ep->stream; + if (lpac->type != BT_BAP_BCAST_SOURCE) + stream = ep->stream; if (!stream) stream = bap_stream_new(bap, ep, lpac, rpac, data, true); From patchwork Thu Feb 15 21:23:56 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: 13559161 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2057.outbound.protection.outlook.com [40.107.7.57]) (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 177F113B797 for ; Thu, 15 Feb 2024 21:24:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.7.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032267; cv=fail; b=TXXQ0M3DzdCyA3dk6EeT03CheeZ7NtxmM0PLrR3RWS06Niau2xtsZGvc9RlRtAzp5n4kkriqNJDn2jD66jpC9AX8IBtU1rUMh3HDbVSgpp82f+0h8Q647/nyh1gPVlWaZ8AoIY0gwEnjzWy9ztjBgdfwErD2c66FFGyxyQv35zc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708032267; c=relaxed/simple; bh=S3NgYAYWSH4jUus3GVUCs4NAH9loNLYAAZuoLBY+mIM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=LaJTnE4cw/n/j1dhzCDiYugamH1D2hgcKNGrk6aLg6x5pus9xJTOkAnx1xTxWb908dEATSJ0IwzjzSqxwH9i+4CvoqsR603gpYeALbam+v7pO8LnA6yJX82xQ7ZQu7RN1Lc9if32gMddmaj6KCGAJPo2CykeFl3qw40+5+IPYW0= 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=JwAxzPhl; arc=fail smtp.client-ip=40.107.7.57 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="JwAxzPhl" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CyHeD0PFHhfFW1qbw/dHOzTsTHcNRVErYcjt3dNkL9P+4/NVF9g3VGZr/DY/Q/XVapTzCBdSZtLrzlBSkl4ymUGNVRAUl7REEFzyCk+ppWtSsLcd2dw+4o99SAue/ywuvrn1nYt2AOF7bOMWLYmEU4vN8Sm7a6LcLswwbfPHqtcMb9zQ08sAn9a8spfig/SJYmkK4oWUDy0kIV2HVnUqF5hLigJUa4/oSpXFW/wLk9qNgvladO6mrNtIfTUh26YZFUfAWeX/q/M9QNNe0u7lu9sBJjabyPNyou8ciG72GhMmCgbse8RUkSXLGHlgM3KIm+fiYrfacB2L0nQCacxIAg== 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=d7Q6DvTpWtVEAiw+hB+abya7gumyH2qfZneiv9NJ24s=; b=ZfOQgHsiOyJ7RvNy+p+8WkXMPeiJkPwDZcgX77eRx9cH4x0bp0ErP04adDi0yFm6j2bopzBq32n9god1dkPxcSADb9L90JpNlg2QMLtvlPo9piLfaHwAvPKrszCnlFmNOb8YTi4pY733GRXGqRmUN/37Rgn88RlglmgZRPA6PVYbw8Vvl1WVKinY/3nGvPkB2fQOoY8D6mzGLjmPGIRR6a7xlgs/HXBctfnS3LpC9DGwqB/rotTE8PYI2uNQKzT9fJOBH7fbpNAT7nBwnGxWibwrV8eJ7oce7VUXDYieqqtLQc2GRmuzkeWU80P3z/MzqH1GNjkd93WVcq2gtq5O/g== 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=d7Q6DvTpWtVEAiw+hB+abya7gumyH2qfZneiv9NJ24s=; b=JwAxzPhldXJcVXRy3yMnmJ/TYjyPYxpRYTIueM0ocpW/kls0g+96+/Fr1QjkyiGfx6wxI0Hfjk5hzIK1pzmD/sVra1soxF/o1/loxKReDs7GBn/Oo3vRAnxZJuvdMCk9bk2iPxNyyLodogGbrTZxyubcATEg8UtvIEymwG2Guxg= 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 AM9PR04MB8275.eurprd04.prod.outlook.com (2603:10a6:20b:3ec::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.31; Thu, 15 Feb 2024 21:24:21 +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.7270.036; Thu, 15 Feb 2024 21:24:21 +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 v3 7/7] bap: Set generated BASE on all setups from the same BIG Date: Thu, 15 Feb 2024 23:23:56 +0200 Message-Id: <20240215212356.310301-8-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240215212356.310301-1-silviu.barbulescu@nxp.com> References: <20240215212356.310301-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: FR0P281CA0109.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a8::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_|AM9PR04MB8275:EE_ X-MS-Office365-Filtering-Correlation-Id: ad53f06f-5310-4a18-ed1f-08dc2e6c79a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EPP8mSNQ6PK3hSrCeGYhS+nXEt0sxG8nUA1ZA/BOjB5BhJrFznFDcrWJu8Bkprai6GBeR95KyQVfgkrDk3vc2YYZbBBUiBvkDKCGeorDpw3BlE8IJk1tlzbZf9WlfdbEC6w+JcrFABhD97CLmFzUbNCXKnVS8RRDWP3A/IQN9CjcPveKDAb37tTmF99CMpUwHk9Tkku/s7khoH9YuB067ThX8+KrLoYvJ8e0Fq652OsC7Otjc1s4fdsTLLYdgzct/ASvd9Uouyw4RqbBNep2CKQbhYPnBjhl4lOjYrIIbNi8EQZf/A1gusXzw7IjnhDVxKWkdrkdABlue0/vQP3gBZyFqmcawMsUuo0HZ/MJrcI33WmaL9kjB5cBClJrgCpQergJzjEYgk2zLLYTu3fHQGeaFD+cNcUCQ+zedlYYStKujRFYpnmQDwaBZ7D3yp0xMzGXCXqbjsjtGXFHHJH/FXtyFa4DKlhs4APyF9JZBMrlWFBBIZaEtOorJju533NNlZ4sb6dBEc3hQ4oGfgnazisEMG6Nvum/00bbRDhXYP8hSPczsPpxjYgloWUyL/k1 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)(396003)(39860400002)(366004)(136003)(376002)(230922051799003)(451199024)(1800799012)(186009)(64100799003)(83380400001)(2906002)(478600001)(1076003)(2616005)(26005)(316002)(6666004)(41300700001)(6486002)(6506007)(6512007)(5660300002)(66556008)(66476007)(66946007)(4326008)(8936002)(6916009)(8676002)(86362001)(38100700002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ppUCoZuvcvIqL/n/JuvlDN/zkAl/rBW3EqY5Oy54fFYylNBi9Q3P03GTC8QRJAVND7IVDmu2vZwlK1mYvOnoOOkGFxNAThD4mxcxSkrp9jIeSCXnsCgdYR8eJpuDtKqOB6Ta6bfZLszixtnE8tqiFLoDfdH4x1wjqS0RNw2t7aM/zbL85lSvQhw5ux2CAaHjubev4ba8zY1iM2Lulo/xQSmknGTtVuPOAscuaUzwC/5if8hHbQWpnXuDEQL6WvIzthIwfbaR0YLog+H/aYrpZ9Pz0xvG1LTWpkdAbrFAtvkkLw+9J1gWVVHUK0e1OrUvihATLzZrRVIR3VlbSjJYZxNTgsS44qmZyKGJmwUeeaOfRiTa5rhMDX2Q++q8uDwPH79q6HygYlCrfHzSVMo/hodbxiGl/y0a71eUPxoiXyY2mV3j6DW7r02D/AnPdbJl1TntsPdTCwqIFL71sNd3S91M6flmaeTf+oNb83vR6b3WBKMDwa/wN5mCsRHVXE5jncBenXy9gk0KMyBz6Qgy28NBodTqQ7T73RlPis70nCkYG3Yhe7NJ8cVec/YWxFj2i2bozrhgdkQHFD0Nwmgf0P/YM2lq872NytlVQsrHHcNjFAFZmD7ec6ABnxGJww76qb9UizMXuzWZA/jR7stgxJsr6pi7b+lDYl6WvoBDnSKSNAklAEsb139O4p+bbUtEcwb140YVOU213ylPiOqT4g+70y5N3I/6ItodcEXozTUIKM4G3qldjehBUhVpE+KuAzhvX/H9+q+4wvdImlcJULyXvjmMj82XWqmMz4doNyYNHM9vNqUOtauak5VsgaIyoiiBO87CDOEPQ7aQw9R9ZyZHt8iMk8rn/zIMsEHkrtuzmsCbxe2Db3iiP25VzS9dDJ6tmerlQbX3WC38QRFDmdutFz9cbpT9t4hdc3XmySeFXNO/a6F3qQHfVMOQlLsjS88GG6pg+BZozzrJJr8MJNb7FW8J3WQiBs0l2bbFQO+1AdHSNVCK2vPBdB5puvwkiLwMd91lAE2UjY9t0bf6up7VxUm1g9l+3nQ+aIwf49fThd6lCi9szxArK0FS0mPDFWV+K2X+rzp7rl5x2sO6P5FnXvy+531XHu8YXj+LMvTbgcbYfcfJrDP2z4Z9vJQFEAVL1sJCR1R/rrm9Oh99+F93lXbNRLc/TyPglefBsBuxMVgoPNFPy3QU0N9XLKgtWkfmdSyju/jpRFjp1oduyZH9Sm7X+ztyynnRMzCxjR1LMq/NK37UZ+HLhRkYVfuwG0JOsE/93Pzx67TlX8XxAbPKzyYblxoM4zyGQM92Pax31FoWmxV7X7usnf7x2jcVkzRKXAVyaYylGifseRYe1ha3vEm6Qe+w1Z7BtxOXe12llQoHO/lcorfv3dJf81yLeTyX3ltFxcvGK8PzCTHWtMmqYQechDbhLzE/TPQEtB2CB49vjHAu1OS1frEccnRpRoc+fobZydpltTNVDbroTUe8XRFRumYdi9PKthRBtdgKIE65lKB9lg33D69+upFXYw8DFhr7DzRYT++rDy4mUXExNslhfLgnfhtsWvoKpRThjjO0b1HB90DRy4ao+eaQaERIaOoOAjwmx2X3y1DPcw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad53f06f-5310-4a18-ed1f-08dc2e6c79a2 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2024 21:24:21.2780 (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: oromHn8pi5VGIzaYrkXM/HoJ10U5k8YHSFkr5X3StAlG8DQo63jU0vPnqzyugI9TtkEk6CAdV3zKX9tarkcRvYjd/0FtmIszeerhhFjPr+8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8275 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 | 160 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 144 insertions(+), 16 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index b4acdd9ef..def5e1432 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -943,8 +943,12 @@ static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, if (dbus_message_iter_get_arg_type(&props) != DBUS_TYPE_DICT_ENTRY) return btd_error_invalid_args(msg); - /* Disconnect IOs if connecting since QoS is going to be reconfigured */ - ep_close(ep); + /* Broadcast source supports multiple setups, each setup will be BIS + * and will be configured with the set_configuration command + * TO DO reconfiguration of a BIS. + */ + if (bt_bap_pac_get_type(ep->lpac) != BT_BAP_BCAST_SOURCE) + ep_close(ep); setup = setup_new(ep); @@ -980,7 +984,6 @@ static DBusMessage *set_configuration(DBusConnection *conn, DBusMessage *msg, if (bt_bap_pac_get_type(ep->lpac) == BT_BAP_BCAST_SINK) setup->msg = dbus_message_ref(msg); else { - setup->base = bt_bap_stream_get_base(setup->stream); setup->id = 0; } @@ -1846,7 +1849,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; @@ -1883,7 +1886,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) { @@ -2012,9 +2015,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; @@ -2031,9 +2031,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); } @@ -2121,11 +2122,77 @@ static void bap_state(struct bt_bap_stream *stream, uint8_t old_state, } } +/* This function will call setup_create_io on all BISes from a BIG. + * The defer parameter will be set on true on all but the last one. + */ +static bool create_io_bises(struct bap_setup *setup, + uint8_t nb_bises, struct bap_data *data) +{ + const struct queue_entry *entry; + struct bap_setup *ent_setup; + bool defer = true; + + for (entry = queue_get_entries(setup->ep->setups); + entry; entry = entry->next) { + ent_setup = entry->data; + + if (bt_bap_stream_get_qos(ent_setup->stream)->bcast.big != + bt_bap_stream_get_qos(setup->stream)->bcast.big) + continue; + + if (bt_bap_stream_get_qos(ent_setup->stream)->bcast.bis == + nb_bises) + defer = false; + + setup_create_io(data, ent_setup, ent_setup->stream, defer); + if (!ent_setup->io) { + error("Unable to create io"); + goto fail; + } + } + + return true; + +fail: + /* Clear the io of the created sockets if one + * socket creation fails. + */ + for (entry = queue_get_entries(setup->ep->setups); + entry; entry = entry->next) { + ent_setup = entry->data; + + if (bt_bap_stream_get_qos(ent_setup->stream)->bcast.big != + bt_bap_stream_get_qos(setup->stream)->bcast.big) + continue; + + if (setup->io) + g_io_channel_unref(setup->io); + } + return false; +} + +static void iterate_setup_update_base(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 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; + bool defer = false; + uint8_t nb_bises = 0; DBG("stream %p: %s(%u) -> %s(%u)", stream, bt_bap_stream_statestr(old_state), old_state, @@ -2146,14 +2213,75 @@ static void bap_state_bcast(struct bt_bap_stream *stream, uint8_t old_state, 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 || setup->id) + break; + /* If the stream is attached to a + * broadcast sink endpoint. + */ + if (bt_bap_stream_io_dir(stream) == + BT_BAP_BCAST_SOURCE) { + 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); + } + } else { + /* If the stream attached to a broadcast + * source endpoint generate the base. + */ + if (setup->base == NULL) { + setup->base = bt_bap_stream_get_base( + setup->stream); + /* Set the generated BASE on all setups + * from the same BIG. + */ + queue_foreach(setup->ep->setups, + iterate_setup_update_base, setup); + } + /* If there is only one BIS create the io + * with defer false + */ + if (setup->qos.bcast.big == BT_ISO_QOS_BIG_UNSET) { + 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); + } + } else { + /* The kernel has 2 requirements when handling + * multiple BIS connections for the same BIG: + * 1 - setup_create_io for all but the last BIS + * must be with defer true so we can inform the + * kernel when to start the BIG. + * 2 - The order in which the setup_create_io + * are called must be in the order of BIS + * indexes in BASE from first to last. + * To address this requirement we will call + * setup_create_io on all BISes only when all + * transport acquire have been received and will + * send it in the order of the BIS index + * from BASE. + */ + nb_bises = bt_bap_get_streams_by_state( + setup->stream, + BT_BAP_STREAM_STATE_CONFIG); + + if (!nb_bises) + break; + + if (!create_io_bises(setup, nb_bises, data)) { + if (old_state != + BT_BAP_STREAM_STATE_RELEASING) + bt_bap_stream_release(stream, + NULL, NULL); + } } } break;