Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp384424rdb; Thu, 1 Feb 2024 11:11:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IFSnC0WBcxQ4hI/IRkTec7+Bzp+yTcXl3lBhkF4hK6adN1GLXOQ0lpL2ECJx2jhC7Xg+hAR X-Received: by 2002:a05:6402:3506:b0:55f:9a70:3811 with SMTP id b6-20020a056402350600b0055f9a703811mr3768743edd.12.1706814661583; Thu, 01 Feb 2024 11:11:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706814661; cv=pass; d=google.com; s=arc-20160816; b=R8yNm9PAv1+ChVUYWUFjNfEDgnzPNnyPDvaxSPYBZ9VYa9RmyrJp+inu214IllcGDM D0T0wmByxQSzKceHP8NyAhkW3jwp4zximXnWKxXGSfWHa1g+yOqOvFnbZt9KFIuy75Zl RIgN+lAqTrwc6fMmHujZEiRqAybdOgFQsjMYJOjvG2VlS6AAdlE3quV1lEEQgJ90rfST 7eWfq0hIitzkFpo27gtANOOZoLx7zkm7TNTTynsScqk16ChZdWIGbPj2n9CuZidzTYI2 2z6aZpDHAQpvhNkMQuMdmH4gmiSCdK4XxQ4QMKE+BVFKAHImiBuH8f6T7XA3TFdfu/o8 ytlQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=qIl/eGvO+Rr3euE6aD0rfqQ1CAoMMey4PPG/IxwCfDU=; fh=r87H8ZMXLvkP/PSDLvHhHiAZXIjfkA/DkSmO9AlerjY=; b=LLSCFMK08NmWMu9N8LJfCX8prpywXXuOybiZ3OMxniScGNOxhUL09YzvOI5JT38uHQ zuBPBVzZjZKaEMA5TXOdVxeTtwxm1R8oy+a+GzBStxApiehTo2Z9xju7sFX0c5+yia7p t/Wsu3sdloYq+eY5BfxxdQK5S3gKxYK2e3fAMvqRs3m9sOUrH4GhGGlf/dt+ESQ+vvN3 qQ8HmgCg3JkpeZ3N2FXCdXKDgBRPgI6V5Cfp2Elxg9fv+zgOGN1r/uNFYFa9VVSUADYj iFkzhDNgaIch6uQmcIv5Ja4ubYdU3Qu/cugDA+fwPzvA+v0WxZhlgTq5QH80podvynus Bspg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PTAR8xzw; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-1547-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1547-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=1; AJvYcCWfkgLnszNKMfE8Gu+qFMjVs+yj0ybjefIAx/CQX/PH6uXHGj11WV5ZXdjU9YUAdMqIcsOUvmjsiHRK0McCrq/5n6ACxAQRz/HyofZb0A== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i21-20020aa7c715000000b0055fcabc3708si79126edq.404.2024.02.01.11.11.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:11:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-1547-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PTAR8xzw; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-1547-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1547-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2E2521F241BA for ; Thu, 1 Feb 2024 19:11:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A15A085627; Thu, 1 Feb 2024 19:10:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PTAR8xzw" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DF9C84FD8 for ; Thu, 1 Feb 2024 19:10:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814635; cv=none; b=HMZiRbTYnTu8moqZN9aW0yUarSw2GWLyylej0x7kJ+hY/nZ466PfQoi+SnbWKu0YLDncSgqYH2nb5I0ZC2M98tQqQSQNNtZr434uhqbyH+51MhToSMoeUB0gkVl7VHr5xVa7mGd3ivZwhWqe8F0G4CvA+WE0aLZUKDQudvE1L3E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706814635; c=relaxed/simple; bh=uM8Gep3U13CUEwBIglcJfDvyNyo5H9RIH/fAek0o15c=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V7A7rlFrXqyPnRY+A45L/OVo5nLjwthrfjT7Y4qv2nv8MD5Yof+C2KxUNCn3X4BwxQGI2EerGiKu+xT0c1Di3mFKgHd1ZqsXAHQfM0C4v+6BUV67rGwTeIw0YbCA1Abw0H/EyMNGe0mSoLaBi1dF85CRuJT0klxPxnE+/thnuuA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PTAR8xzw; arc=none smtp.client-ip=209.85.210.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6e133d5271cso628550a34.0 for ; Thu, 01 Feb 2024 11:10:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706814632; x=1707419432; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=qIl/eGvO+Rr3euE6aD0rfqQ1CAoMMey4PPG/IxwCfDU=; b=PTAR8xzwG91cbyQlSJnv+IaiOCrCkoW9i5wUOgnkiM5fi3rVLHtVTSZk0TmBxafwWa F5gUP3WKFqU9rjlPtTaA6ZamJzew1n2CNPzJZhgJLoFRlA0u8+0Ig11oB0Hpvzva4wUQ n95NgDVgxr/TcwEdIG2Yg0MLV1WQiZBVB8S4Qndxp/XPDQ76iyHlqBjgcyg6CrwSJwFR 1kQVgijfQBBXHmjCvTNjxPpkr6kc0AqNL9mVPkRyOLYWx9KZ00gE7zjPdSi2eI49PByk tQqiLJEisQBDDsxVzhM5Dg98mk3jlAMd992RfZuwhVnrUY7suyFf8KRtzTKg3bVELUDx cTvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706814632; x=1707419432; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qIl/eGvO+Rr3euE6aD0rfqQ1CAoMMey4PPG/IxwCfDU=; b=bNa2VxJvJqGZ6faMNXqSmwdI0IU7CQzJuaaAA77PNsYAM9A+29jmg3WN3ac1g5CH2z WBAD0g6wm/Zroageg1Mva1eBp+ZZbLi+FfrubYssp4OiHkkRXv0swzh/mFWaX61wUglE N+JbW4Xs6GOi/yzDx6UQsqtTZ3p1LKgGwWXiSBFCV4gYsOGcPDr8s51FyDXrNJHj5hzE cLeCRGRwL88QdSSHtrv0P8O4H8q4H3/lUusxsIFyYvlt9ecbcEO/c0c1gLp7A0bY7dJ3 uQcStNpD2wO4X595s+47geekI6OC2sgmvfpy0ht7CL1mlj34BeHwOmScfFFiXefeh+AW q14A== X-Gm-Message-State: AOJu0Yz/V5hGP3FyjsfUYn2xo0Udl4NOwz+FqvTxe8HTlsAv0pZsXAfv 0J0VXx3+QUZpczFlVtGMr5gzQ2759rdQ3ev8PV0pp4W+ixFWm2vvY0874x98 X-Received: by 2002:a9d:618e:0:b0:6e1:29f3:6fbd with SMTP id g14-20020a9d618e000000b006e129f36fbdmr5605440otk.22.1706814632091; Thu, 01 Feb 2024 11:10:32 -0800 (PST) Received: from lvondent-mobl4.. (071-047-239-151.res.spectrum.com. [71.47.239.151]) by smtp.gmail.com with ESMTPSA id db16-20020a056130239000b007d2e2f14bd4sm35912uab.29.2024.02.01.11.10.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 11:10:29 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v2 8/8] shared/bap: Make broadcast disable and release more consistent Date: Thu, 1 Feb 2024 14:10:16 -0500 Message-ID: <20240201191016.1122194-8-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201191016.1122194-1-luiz.dentz@gmail.com> References: <20240201191016.1122194-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Luiz Augusto von Dentz This makes bt_bap_stream_disable and bt_bap_stream_release use disabling and releasing states to be more consistent with their procedures. --- src/shared/bap.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index f2d2ca09bb24..ac17eea13556 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -1377,10 +1377,14 @@ static void stream_set_state_broadcast(struct bt_bap_stream *stream, case BT_ASCS_ASE_STATE_IDLE: bap_stream_detach(stream); break; - case BT_ASCS_ASE_STATE_RELEASING: + case BT_ASCS_ASE_STATE_DISABLING: bap_stream_io_detach(stream); stream_set_state_broadcast(stream, BT_BAP_STREAM_STATE_QOS); break; + case BT_ASCS_ASE_STATE_RELEASING: + bap_stream_io_detach(stream); + stream_set_state_broadcast(stream, BT_BAP_STREAM_STATE_IDLE); + break; } bt_bap_unref(bap); @@ -5064,7 +5068,7 @@ unsigned int bt_bap_stream_disable(struct bt_bap_stream *stream, case BT_BAP_STREAM_TYPE_BCAST: stream_set_state_broadcast(stream, - BT_BAP_STREAM_STATE_RELEASING); + BT_BAP_STREAM_STATE_DISABLING); return 1; } @@ -5161,11 +5165,8 @@ unsigned int bt_bap_stream_release(struct bt_bap_stream *stream, /* If stream is broadcast, no BT_ASCS_RELEASE is required */ if (bt_bap_stream_get_type(stream) == BT_BAP_STREAM_TYPE_BCAST) { - if (!bap_stream_valid(stream)) { - stream_set_state_broadcast(stream, - BT_BAP_STREAM_STATE_IDLE); - stream = NULL; - } + stream_set_state_broadcast(stream, + BT_BAP_STREAM_STATE_RELEASING); return 0; } -- 2.43.0