From patchwork Thu May 23 15:47: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: 13671992 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2060.outbound.protection.outlook.com [40.107.21.60]) (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 DD289171C2 for ; Thu, 23 May 2024 15:48:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716479286; cv=fail; b=l47j0z5Bhq6T7kbOfDAxLp8l2iBmD7YSkRhN3m1c2YDjs48gwK94xvZMroCtzKd2v+PkYpiOmc2yKPPmnmhyUVyhHyUfUedsEuK/ASAdGZOa26e33mBn1gfa6tRg6BSSMYN1mdDEJXqkJT9jTfS7xKXEvpnRr7avPlqurkc+bgU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716479286; c=relaxed/simple; bh=TreIvJmyRqECPnHV3uU4VxTJz+tFbTbJ3EJ41rWU5MU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=YGsbPZhqDUIwtN50r03ppNH9RpcHtlgMRbhgUuVyaB+m8RCzMvMR8wixnQv79fElgqLKMt7/e/A3RmAmYmb3UsBS5acJTqej9dlG6DYcygCW3enN/ZlkKIaGz3L2KTMtuN0A/YYzksfbq9ZXADYnpV3/fv36zYbn7bmrYFe+tIY= 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=m/vXuWxE; arc=fail smtp.client-ip=40.107.21.60 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="m/vXuWxE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J9SdrcFJeaREkx8XOP9RQhmKjG1ZRYrOOnYLmmMTsnAYTRlMPKxsXIXGeu3AoJ1xCOW9CWkH5Hf8Fapunql1sJDgwSF/XrgY8Oles4bzrUuSv78diN5TN7mYIi4lfLS6M7i4/36ywXGJv3ZlgjlF16fCs322W/NDSG7I7/C8dnR+80rGpAg0lGk99wYuhvzv9PEMmc8bZBQcWMHEuA/7Y9Ckr+Y8Dx/K8vjS1eZBZjOY3SCqvljrzx7Lik2VKP2cOygehovkJvoKJFLVt6T5aI4R+NcfrcCgJePW5UCTQSjwZDP7uMdWesQFcNzSjLO3nXs289d/w3y0sfVyzAOobQ== 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=gB6tQGfZLGCv4UAvDOJhSFDvyJqB2PP6R9zEPGRJIEg=; b=YylQtDEpzkBKmIV3fSJQIlHx15KbwMHQyb049SBEphPgsuJ3qGQGrKBx5NX76HziaqeBrOh0jsvN4JB+fK8nCo3C4M69Mop7nNVwghVuhAUGeDpYed/8bDWAYv2qTslqjtoGoB6r1IXx7PfhnNqvLZcKr6ONt07yPs6q5VQaBadD+y6FR1gudo6bmRD1Ou9Tf8T5rd4xu6C9s2ukIWIc9Gh8RB/kGJRyAgo20HBqF5kJPhlOQczIZaiz4OFMeL3yCH7l8b2UVWU7lTK9lav9Po86+Us+RcxRkWb0jrR/MNzASJmlGpg5hAMcTZ/uMMrCaOTuZWYWUiHxh9SqI4ImCw== 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=gB6tQGfZLGCv4UAvDOJhSFDvyJqB2PP6R9zEPGRJIEg=; b=m/vXuWxEwoHpu1XiomxOL3iC23ODalYtuM5s8rsv+g7b7/NrSaKtbEYYUdT83pFwlEXRhXX5PuaZ04rRxI0uUpfq1u+LTNKMqPsbpnoAMX7a75jSIwMlcdGQc9UR1Zx7fx2ir3dSJn4yiIoj3vRy4UWsLx9j0sBHzGrvREFMkww= 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 GVXPR04MB10658.eurprd04.prod.outlook.com (2603:10a6:150:21a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.19; Thu, 23 May 2024 15:48:01 +0000 Received: from VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::5d49:58b0:19c5:a38]) by VI1PR04MB10073.eurprd04.prod.outlook.com ([fe80::5d49:58b0:19c5:a38%5]) with mapi id 15.20.7611.016; Thu, 23 May 2024 15:48:01 +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 v2 2/2] bap: Update BAP Broadcast Source state machine states Date: Thu, 23 May 2024 18:47:54 +0300 Message-Id: <20240523154754.39451-3-silviu.barbulescu@nxp.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240523154754.39451-1-silviu.barbulescu@nxp.com> References: <20240523154754.39451-1-silviu.barbulescu@nxp.com> X-ClientProxiedBy: AM0PR02CA0144.eurprd02.prod.outlook.com (2603:10a6:20b:28d::11) 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_|GVXPR04MB10658:EE_ X-MS-Office365-Filtering-Correlation-Id: 294bd601-6f6e-445f-99b2-08dc7b3fba01 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|376005|366007; X-Microsoft-Antispam-Message-Info: J+7ppO4sO5GvSzfR1GNW+5TaVi3Wd0V9Us/6eaaSGtO4rBNenhZij66IJWY38Pg3UJCDIoaCcup8tcaCfT9mtVe6H4h3+ezP9owZi7IFdXsONiVy7Cvt7WFB5+u8uaa9KRPhae1rKViQwbd0gNbVIiv7EgqkAwvpPr54TfBgBBEnquOTONM8K2j8rhTvc0vuDOZGm8cpXjFAt9YEttZ+JTVrKEAl8EkAV4m86bFIXcdkbZGaUy/H5eFpW840aEP6Xn5cLZxX/4JzkidlhLrN+39T531vhVh2gzc3VSU3xUfHesJ91z8nEu1FXApTJVmDjA+N5dtRQ5iXWnLOOcSs4DxhyZ7SAWbgZXfLIDt4qKigPqiOLpmX/RhSHkWCRswktfAxiTIYUPtCOTjfHXqocvIba6+DMe+oUwhxs0iNcnl/Bw42kFtHIsGdpbNzBJDrE2EwZUVIBlx7+W+rbI/nnZGhKJk0XMaGT9fnMsjD7W+ML0byWym5MhFsHDDi5KOeXQdjfvwSQI6CCZixeCfASOgpSFaiT4ymbvdfdcxwBZREBClI2+Yg7+j0ULVTEjggrgqMY0lS1BMmeHHiXx401nMb84x7wqxYtcyJDH8014nDCdB815iVEUab7Ix3gM+LabQIZo0ZNYyVp2evQJ3WNPS4Lkn+zQt+ABIH1NDnTZ1Pvm1/J6pWImq3Dbxo+Av66cr3ADuMLlDRTaL74UhcJVuzTDoQnmK4uqPWP/y3Nsto3vWp1+YwYWHWNr0Nwn1Iy9c54Jte2t26FLlWnfXcPIrQSy/yqL1UNjvqekyn75WCFmPHhIdBHkXyO7U1S7ff1HzpFRcfiWC0KrcjVisG81LTwJoQEW7LKMQKocYXmUvJEzIaWzE4XVVQZ4fjEz9Gfj3dSLA5tOsDJw4aflSKGlPW9lWc50wPIwRuT0O8Suhx+fYQbTUu9ru3qT7pRhCimfs1nzhO5fWkNtjzgeWuQcmkhDeoUsLSLnW6RRU4VPUQxRV0XY6qi+QdYGG7Ofg7caAPJYDk7E491xj1XNz61+iGCwfvbZZxdWw9MaRIU1trizfLe4s+uPaeHO12Fs+DX6AIin4CLLAKGVXhnoku/rMvpmRfq3MypMfZZyRNB3+qWNM7NI6gJI8rLWaWDbGb3gqGCQbINickD9+ePUanen2oZ31bm8f8umxLQWH7rH2Zi9fcEs9PXT0pV/bRjOqWzQI8HrIvu5a7g4wMNKCLovgoQqPbjkG9Su7OUAQxhnL1eaZt2mapGV7jF4xsQCKtCjNJHFt5qXBQB/YSiKz65w== 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)(1800799015)(376005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: r1UF3bLtE1Wboubd7eUgrezHWxZHwVh7sctxD/m18WJfGCzDRx0YKQOCpm3U2sYmj2Hq6SIRJ8EIzHW+WXSvLuI4RJmfkH7XB+A7mB568el17ShQitW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Z+vlq9pfsqKWH8UIwtd+Cj61mODDMvp/wzVnpGi1LMsJZIci2aZfTgzEn2M/aXd2vP8WTaWLYugc4eK1NDExG0688Zyr7WeZKf+QJFW8h2WW7XS82J/T+ya6g0gQ/LQjdtiNBe7mddhftexeg/AFx0wvmOX0rIp74oPsUS++2Pn3XjT1E8Hd+PvwI1PEK5rVaPa6K74qWt8TgQUbPBCRLejhcvCAK5EVTL4kzxGqTlBqYvyB3reos4XG5gaUKbVMHgHoj+Zq8xmaXEgg5m7+fWYDAIHYpw7HLuabdti9F5Zw2QCnMyiE9Al/nENV0b397GajdXpNZO99R/3/cZWf0wS7hyNv0u4OCOpIOJ6Gb6dMDGKU/bC+oeOVOj86drBbBdmXaFDw57vYkrHr9CNgdC8AGs0wCzKDaUpZuRWkoCAwgvg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 294bd601-6f6e-445f-99b2-08dc7b3fba01 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB10073.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2024 15:48:01.4609 (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: Ikpms+XEFWjXbbboahZ9K9X/qS2Ssvg56K8BPZbIjFfwX7lWYnaKXEzJtLPAfhetOjQZCqYQBfF0o0L/kA+7wDGvbmta37iIVkECkX+qJUg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB10658 Update BAP Broadcast Source state machine states --- profiles/audio/bap.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index 06dc4e254..3fcf21df5 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -2474,7 +2474,7 @@ static uint8_t get_streams_nb_by_state(struct bap_setup *setup) */ return 1; else if (bt_bap_stream_get_state(ent_setup->stream) != - BT_BAP_STREAM_STATE_CONFIG) + BT_BAP_STREAM_STATE_ENABLING) /* Not all streams form a BIG have received transport * acquire, so wait for the other streams to. */ @@ -2516,8 +2516,21 @@ static void bap_state_bcast_src(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) - break; + // TO DO Reconfiguration + break; + /* Use the ENABLING state to know when a transport + * linked to a stream has been acquired by a process + * and in the case of a BIG with one BIS stream goes + * in the ENABLING state waiting for the response + * from the kernel that the BIG has been created + * so it can go to the streaming state. + * For the case of a BIG with multiple BISes, + * the BIG is created when all BISes are acquired. + * So we use the ENABLING state to verify that all + * transports attached to that streams form BIG have + * been acquired so we can create the BIG. + */ + case BT_BAP_STREAM_STATE_ENABLING: /* If the stream attached to a broadcast * source endpoint generate the base. */ @@ -2855,8 +2868,7 @@ static void bap_connecting_bcast(struct bt_bap_stream *stream, bool state, 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); + bt_bap_stream_qos(setup->stream, &setup->qos, NULL, NULL); } DBG("stream %p fd %d: BIG 0x%02x BIS 0x%02x", stream, fd,