Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1381286rwb; Tue, 29 Nov 2022 12:47:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf5b9VmMjIee4LSz1UQpsgpCPT4jnAWGDk150tmndCpgCjVXgOsMXZstYzrnNjVARL4zcuVU X-Received: by 2002:a17:90b:4016:b0:219:4f54:34e6 with SMTP id ie22-20020a17090b401600b002194f5434e6mr5152408pjb.208.1669754875766; Tue, 29 Nov 2022 12:47:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669754875; cv=none; d=google.com; s=arc-20160816; b=GwhfGV6KWUMZDmUjhY3GhyJge/t2uvOPYFA56sS5LWYscR8Z58S8gumiKaAOD3lSGs rHajZofKalbX/AJe5H9S4YYn3d7JNjbOFl7TIU6VLGDV+sOJCCja9JbB/NRKhDscm2aW PPpfgcpk0l+evR3hO35h4c16+rNXtAr0UY6kCFXsM7FDuUB9Y81oWdcR4YxluGLUzbGB VJ1sKtV3RL8tg9edL28c5DR/WrWU2f51GiwSL5QsvhytByFMGbFPTVyx4jIsDWtnslSL VS6AWgj7yGKABcMG0tnbXyCCda36Woxui+LsqJcYMQaaTm4tOiMvl5lO1tQCm+WuOB5e JhGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=3I4QWhGq5+m0mrFdydgsfIx9xuQMIkAkxU6vd+76M+8=; b=kN5aPUqK7fzUhLCbSTrQjmrmta66JLO2PqUR+2sEnElaAPWcUZwOZb+zCR3rnnL+cC p2CkA3XXVlIJR5CV2IJ1lbR14DMUGkoRBqG0RpJHJpk97wRJHSrHvwSvM8dA8NazM23O 1gUg7joAe16YzlqV/67tzjSWei66DIJTXmXQzRJCMKRgtkmi3V9ZwL0zHQDTcjwYxiwS z29IjEoO/lqdZJTt/QecUBQjrkQoD2zahBgHiHs4+yfDI8l6v8NvRg0ql/+kAfBhjWek LVmpens+9gFZZE/2PBeMouPZoGVGrtkVezgZDYgS4wKp+HgDoIjr0w5dIxpQMaPmG7fD QpwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Yjxv9jEr; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g36-20020a635224000000b004624e24b4e9si15782331pgb.543.2022.11.29.12.47.17; Tue, 29 Nov 2022 12:47:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Yjxv9jEr; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232970AbiK2UqC (ORCPT + 99 others); Tue, 29 Nov 2022 15:46:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234423AbiK2UqB (ORCPT ); Tue, 29 Nov 2022 15:46:01 -0500 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3E32264AE for ; Tue, 29 Nov 2022 12:46:00 -0800 (PST) Received: by mail-pg1-x535.google.com with SMTP id q71so14124532pgq.8 for ; Tue, 29 Nov 2022 12:46:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=3I4QWhGq5+m0mrFdydgsfIx9xuQMIkAkxU6vd+76M+8=; b=Yjxv9jEr2dO6GmAjU4TbBNCKWyMq2D/lg9uW0+35Q6e4c5tgesC5ojjtaN2WrPdoRe e7X9QzXyV9fLpQmseejIUqtnSMIdo90uT873cYtjxr4NAaFxO8ak9sEBKvt7ErA+rVu3 wKhqtMDUXYRaPQAqd4jVF+rSqmRJFFZmTjeN1s8AND2A4Or+qzsb/EZ51uhH6HLmYRsk 8L5b+a/AKvP6jp1v1CjboxsSEGiFlhj3fF0ZYUu8WVN9ggSOtPFlzxBU8evNQY8csJho l60XOlJkc9vj9Y3HrX8Ax6K1nV0Dz31LJsnDvL4QrxxSv22t3veo3L+fwtu/p02g0rPc Ac/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=3I4QWhGq5+m0mrFdydgsfIx9xuQMIkAkxU6vd+76M+8=; b=R2GfKRha0n2x5nfiwtFoibH17z5viwxpPs7Ales34JfWTkXGROzYdTqMyBaSqhSx92 lCaQEU34Fr1UmVgqF3yef8OjG5SVzlQQso0YBlI3JJQknRsOY44NLtbiZSqCBiEr9Ifp HsQc8KMpQBqKa1regIAxrhKjvExzuNCOjN7Ocd0uKQ27ISAMx9B+DGxR6CGvTBZVNpMy JpFsbcpCVYiloftLNiQobDWFO+m9bgKOM6aR8JF7iAOZKiEEtfBSxa4GgnDQD/lcdTH2 dg/vIBATin2c6q7PF6WzsFJNkgFzWMxArYx1EaxCYNOj408iiS7c3ZMTmNYVPVs3NkDa iSpg== X-Gm-Message-State: ANoB5pmgpDVgz29FSnWYSK8W+rQf3K1377Q9VXa80FqbbPd4tJFAOa4C WXfirjRNISk+v7pJJUO9ho/LCwmxawk2Zg== X-Received: by 2002:a63:2251:0:b0:476:cb2a:b99b with SMTP id t17-20020a632251000000b00476cb2ab99bmr52075953pgm.436.1669754759741; Tue, 29 Nov 2022 12:45:59 -0800 (PST) Received: from lvondent-mobl4.. (c-71-56-157-77.hsd1.or.comcast.net. [71.56.157.77]) by smtp.gmail.com with ESMTPSA id i7-20020a17090332c700b001887e30b9ddsm11216214plr.257.2022.11.29.12.45.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 12:45:58 -0800 (PST) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ 2/5] shared/bap: Fix initiating QoS and Enable procedures as server Date: Tue, 29 Nov 2022 12:45:53 -0800 Message-Id: <20221129204556.1535821-2-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221129204556.1535821-1-luiz.dentz@gmail.com> References: <20221129204556.1535821-1-luiz.dentz@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org From: Luiz Augusto von Dentz According to Table 3.2: ASE state machine transition these procedures can only be initated by clients. --- src/shared/bap.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 7a24824a71fc..f4812a4b9f51 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -4166,14 +4166,12 @@ unsigned int bt_bap_stream_qos(struct bt_bap_stream *stream, struct bt_ascs_qos qos; struct bt_bap_req *req; - if (!bap_stream_valid(stream)) + /* Table 3.2: ASE state machine transition + * Initiating device - client Only + */ + if (!bap_stream_valid(stream) || !stream->client) return 0; - if (!stream->client) { - stream_qos(stream, data, NULL); - return 0; - } - memset(&qos, 0, sizeof(qos)); /* TODO: Figure out how to pass these values around */ @@ -4259,14 +4257,12 @@ unsigned int bt_bap_stream_enable(struct bt_bap_stream *stream, { int ret; - if (!bap_stream_valid(stream)) + /* Table 3.2: ASE state machine transition + * Initiating device - client Only + */ + if (!bap_stream_valid(stream) || !stream->client) return 0; - if (!stream->client) { - stream_enable(stream, metadata, NULL); - return 0; - } - ret = bap_stream_metadata(stream, BT_ASCS_ENABLE, metadata, func, user_data); if (!ret || !enable_links) -- 2.37.3