From patchwork Mon Jan 30 18:37:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Virtanen X-Patchwork-Id: 648753 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 54854C54EAA for ; Mon, 30 Jan 2023 18:39:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238215AbjA3SjI (ORCPT ); Mon, 30 Jan 2023 13:39:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237916AbjA3Siv (ORCPT ); Mon, 30 Jan 2023 13:38:51 -0500 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BB921E1F4 for ; Mon, 30 Jan 2023 10:38:06 -0800 (PST) Received: from meesny.iki.fi (meesny.iki.fi [IPv6:2001:67c:2b0:1c1::201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lahtoruutu.iki.fi (Postfix) with ESMTPS id C1BDD1B001E5 for ; Mon, 30 Jan 2023 20:38:00 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1675103880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5wqMUAdn/P0OmOJuwUxgCO3BaZYL9+puHVBdgZa+D0U=; b=ocd7vURUPOmpeX5B+IazMEaEk/V9IOlGJYDnc619GFIIba4aA2zZPWgKvgCzktrCoUsCqJ G684Tsb8Zhb9PLFTsfYFZtvrp103uP7nQ62hr+cOzeIGo2gaEzBkLaK6W4gsF+qjXCiRRI TnhuwhX3GJ4FNZeypgZ/yAhIAJdkG+L3unWmqAMAcrSBwm3tRTo09ELpGai/StXwDnEvdF TNnWVNLUfAA7V76Y3iMDYd6LfhW8klJLz73jM1WiJgDDmHrh+fd6X++H1jvl5HaBTu00pQ PK1ygL3gUCbqEnagB9aR8KHABPvKWj06CHdB+zJw7wMybgniUwQztqL8ZCBEPw== Received: from monolith.lan (91-152-121-187.elisa-laajakaista.fi [91.152.121.187]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pav) by meesny.iki.fi (Postfix) with ESMTPSA id A22AA20231; Mon, 30 Jan 2023 20:37:54 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1675103874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5wqMUAdn/P0OmOJuwUxgCO3BaZYL9+puHVBdgZa+D0U=; b=ilbiS5aCCqoZR/gn4OHgBOcSI3iswJW1nuRw8MuM0l7+zx0JCXojazztl7OpsMpkAfCguZ 2mhsSCaruaafOX1UUqiIP5hrlRp42cK3m5YHv9p3IW/3Vg5ryeXBlt3HE44K/TJVJC9MC0 qFgilssB2MjLzJhDy2FV0YDVcYFABpA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1675103874; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5wqMUAdn/P0OmOJuwUxgCO3BaZYL9+puHVBdgZa+D0U=; b=aUa4PuKUWKk7rBrTNo0TV10FjOu8weCBriGsa+Q9cdYQlMaG9Y+tpz7DhMovM272O+/lD1 NvCB+3wDcUp8N63mhDA1qwddbIgurNFU+sAahXw1+yvKXEzFTgBsYMcuaux2hp5kEF4JJ1 WHWZNZcnF0FurB6H2kTWTk5NRvAn7bc= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav smtp.mailfrom=pav@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1675103874; a=rsa-sha256; cv=none; b=mir2axofry3CIuZrpXdxApqn7aeiNgs1ACt4kq3L6LVU/9ItJN2APtB5OL+WsfEY+gsC/A cB2J2EXhXMDAmmOg0eg+RDV2nSq3dIJ78d79HCFRS1KC/uHVIeoHZqNoSNxQCl6Roln3W9 U2GhJRJsi87m0An7eHuE9pD+s1wIfoo= From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 2/8] lib: Add defines for MGMT setting bits for CIS feature support Date: Mon, 30 Jan 2023 20:37:33 +0200 Message-Id: <7e42fb8018045ac29c3e7a6784dd1a43a755e977.1675103676.git.pav@iki.fi> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: <20230127205205.20235-1-pav@iki.fi> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --- lib/mgmt.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/mgmt.h b/lib/mgmt.h index 796190cd9..efbdfb4b1 100644 --- a/lib/mgmt.h +++ b/lib/mgmt.h @@ -96,6 +96,8 @@ struct mgmt_rp_read_index_list { #define MGMT_SETTING_STATIC_ADDRESS 0x00008000 #define MGMT_SETTING_PHY_CONFIGURATION 0x00010000 #define MGMT_SETTING_WIDEBAND_SPEECH 0x00020000 +#define MGMT_SETTING_CIS_CENTRAL 0x00040000 +#define MGMT_SETTING_CIS_PERIPHERAL 0x00080000 #define MGMT_OP_READ_INFO 0x0004 struct mgmt_rp_read_info { From patchwork Mon Jan 30 18:37:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Virtanen X-Patchwork-Id: 648754 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C77CC636D3 for ; Mon, 30 Jan 2023 18:39:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238258AbjA3SjF (ORCPT ); Mon, 30 Jan 2023 13:39:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238352AbjA3Sit (ORCPT ); Mon, 30 Jan 2023 13:38:49 -0500 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA0D9DBEC for ; Mon, 30 Jan 2023 10:38:03 -0800 (PST) Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lahtoruutu.iki.fi (Postfix) with ESMTPS id 968CC1B00284 for ; Mon, 30 Jan 2023 20:38:01 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1675103881; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XGr63m2nawIlWmW54r7Y7bbf5H8d62yr4LMtjIapxLE=; b=SupBJFo2nokol5N585npdxHG/KIHYMeN+e/LqYQfBYcxU17/cGNNQ/WaRCifxYnroMa+2n +y0E1NVdhDQELX/6rj3iJqlcyqQzY1c1a7tQ+MhDKJpF+/iG1pPqmxOeegGsqWeifhOlEI yD6lkHXrXJ95ZZAu2lozRqsa7mbn0lEwfsHzY+2CVEiQqE/ZaNTJXd7aqoZNCpDjj20YyV 7zBKajfdNt3ibMPCAoDsh3a0naumIhT87vX/qpyp/pnAsHiwTv+H1DVaP4z7R6CzCGI+Rz pQw+GwHqkUI07SzKZzgjY5y5p4lAdnvPZ0HARmj2o1K26zCIcw+EK3Z+p0Z+mg== Received: from monolith.lan (91-152-121-187.elisa-laajakaista.fi [91.152.121.187]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pav) by meesny.iki.fi (Postfix) with ESMTPSA id E97EF203AF; Mon, 30 Jan 2023 20:37:54 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1675103875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XGr63m2nawIlWmW54r7Y7bbf5H8d62yr4LMtjIapxLE=; b=Nz45eKaQnASPHKZgbDPtricnlJ24Rd7FJcGIz8HLByoksW4DcfvxmQwA1BoWmkCNnFhhPh wpReRhqMOTbbDleFb5AM3R6ruIBfHKtH2YoS5TRrSNz4oJQp5U4DRIiqG2UXTl6YTNbUPn r0MNyPsix+H2BW5l5gL/hTgFocoJIw8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1675103875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XGr63m2nawIlWmW54r7Y7bbf5H8d62yr4LMtjIapxLE=; b=w/bggFRU2C4xSyCRL9NOjQD9wLEiHESM/P/UxeP0ZHx2aPNCk/+Kvx6FjnQnyG3l9rBfDo rK5phz9eoiJtGV/qRvXMHxmuAdFAHzlTjjuRztU/RpTOt+MeuD5FSfvbTCfmLpRQ59LJ/V RLcW0SaSmDNO5NH/baXmr20s9kj8OnI= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav smtp.mailfrom=pav@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1675103875; a=rsa-sha256; cv=none; b=e+RyE7fasXLu0rBFfJrd/5+76AEcdCycEdfZc/KUJLkFz++FFl/Psa80EPiDjlH4cMfkAy 9c3nPIXA13oTqUavGXgDgK+CAiDF2QzgRQ3ajcvwR5AlqQCvk0sQ8LX/2RYyY3r1QjVSjw GveUIwyQiDVmSmXTQfphbGOnFHSKOqA= From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 4/8] tools/btmgmt: add names for MGMT setting bits for CIS feature support Date: Mon, 30 Jan 2023 20:37:35 +0200 Message-Id: X-Mailer: git-send-email 2.39.1 In-Reply-To: References: <20230127205205.20235-1-pav@iki.fi> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org --- tools/btmgmt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/btmgmt.c b/tools/btmgmt.c index 29f86091f..323c26712 100644 --- a/tools/btmgmt.c +++ b/tools/btmgmt.c @@ -353,6 +353,8 @@ static const char *settings_str[] = { "static-addr", "phy-configuration", "wide-band-speech", + "cis-central", + "cis-peripheral", }; static const char *settings2str(uint32_t settings) From patchwork Mon Jan 30 18:37:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Virtanen X-Patchwork-Id: 648751 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DABB8C636D3 for ; Mon, 30 Jan 2023 18:39:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238149AbjA3Sjm (ORCPT ); Mon, 30 Jan 2023 13:39:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238367AbjA3Sj0 (ORCPT ); Mon, 30 Jan 2023 13:39:26 -0500 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ED405458BC for ; Mon, 30 Jan 2023 10:38:42 -0800 (PST) Received: from meesny.iki.fi (meesny.iki.fi [IPv6:2001:67c:2b0:1c1::201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lahtoruutu.iki.fi (Postfix) with ESMTPS id 7349E1B001DD for ; Mon, 30 Jan 2023 20:38:41 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1675103921; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4KtAWC244lJsYIhkxvCvI19oe6r2Hb0iG6ZLYhRq+XQ=; b=C7xF1n4rt+KDq7IlwC1PCiCd22kMATN1/fDuxodaaAzmkETIqiMUDLdc4rbw8quvp6BP4w fxaCLVeVuRg515m6p0sR/oFo0YvMkK8AqV3lli24EoFJrm0JMc24zt2JIJcJ1YhRN9Sqxx sns0BTyxRYwV5KCNL08AOkLZYFshi/sQvxmm466A7wsCzVbhwryVY4/+RFzUv4tfVl1yvZ AoAnCXLlCwsC5NTtFmdaFfkj2cy8pxGQI8exl/xOE2UlEt1HWuA9xs6hPA+R9NNVsB4GLR NwUOxqMfF+0TmjVR0NODBhO94qg3CefasQC+qPsRqawhzCz0XOPudUzfXTJpBQ== Received: from monolith.lan (91-152-121-187.elisa-laajakaista.fi [91.152.121.187]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pav) by meesny.iki.fi (Postfix) with ESMTPSA id 2CCFF2055D; Mon, 30 Jan 2023 20:37:55 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1675103875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4KtAWC244lJsYIhkxvCvI19oe6r2Hb0iG6ZLYhRq+XQ=; b=l4iOcjJ1yy0/nEECxNeePOCSqA+2+fiRIl5JCuhZrMA32CMdy0L6CBFA336MGJtMOBJLfd y0/5znnkc4vhB4yhZo53M+A7jbV/wM+KSWvQO61/MEkpmSHssLFRL/rS14lYmYbvaW6k3e jdKW2rc/OuZySKllJQqYB/CiniDakPo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1675103875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4KtAWC244lJsYIhkxvCvI19oe6r2Hb0iG6ZLYhRq+XQ=; b=MVmF8dF89++HjdL+zfwaTs6+qfDyEGqT+SON2nArnwGCYVe4cMOikbFR+/kiD65Gltibdr 2n+9OljMYhcNeHbCk5QiZllGGMc67nnxWyecicPYqc+mmBKIcW9H1CtsqGPbpjuVAiBDRw nB07k7BSs/dPw5rskUxdC0z6ZmQbMlg= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav smtp.mailfrom=pav@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1675103875; a=rsa-sha256; cv=none; b=dMNRkAWSbWnRcDAZWwNhv6RJ7IHjRSIrKlAR6MD9MI5DdOmHgVR4Ud1zbEl2ZFwowjoxIk t3Pa4Lkl6V1jx/C70Cvuy9rZl2pRjIzQ3xfcUHHAp6nqFW8YJT7U8HIzG8VIywGO/JkPcA EADwnS7Nk6yzVcqgErSIQow8f1+pnV0= From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 6/8] media: Check adapter CIS support to add BAP in SupportedUUIDs Date: Mon, 30 Jan 2023 20:37:37 +0200 Message-Id: <51806bcde7e2fe5a500023026d4ae68491c64bc2.1675103676.git.pav@iki.fi> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: <20230127205205.20235-1-pav@iki.fi> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Don't indicate BAP support in SupportedUUIDs, if adapter supports neither CIS Central nor Peripheral. --- profiles/audio/media.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/profiles/audio/media.c b/profiles/audio/media.c index fbb350889..d68085514 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -1259,6 +1259,10 @@ static bool experimental_endpoint_supported(struct btd_adapter *adapter) if (!btd_adapter_has_exp_feature(adapter, EXP_FEAT_ISO_SOCKET)) return false; + if (!btd_adapter_cis_central_capable(adapter) && + !btd_adapter_cis_peripheral_capable(adapter)) + return false; + return g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL; } From patchwork Sat Feb 11 10:53:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Virtanen X-Patchwork-Id: 652768 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1ADEBC61DA4 for ; Sat, 11 Feb 2023 10:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230006AbjBKK5P (ORCPT ); Sat, 11 Feb 2023 05:57:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbjBKK5L (ORCPT ); Sat, 11 Feb 2023 05:57:11 -0500 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9B5F30D7 for ; Sat, 11 Feb 2023 02:57:10 -0800 (PST) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id C7C0224072C for ; Sat, 11 Feb 2023 11:57:08 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PDSGr2n8Qz9rxL; Sat, 11 Feb 2023 11:57:08 +0100 (CET) From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ v2 7/9] media: Check adapter CIS support to add BAP in SupportedUUIDs Date: Sat, 11 Feb 2023 10:53:51 +0000 Message-Id: In-Reply-To: <3df45c4a6737b249b519d4c6128e2eb783198abc.1676112710.git.pav@iki.fi> References: <20230127205205.20235-1-pav@iki.fi> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Don't indicate BAP support in SupportedUUIDs, if adapter supports neither CIS Central nor Peripheral. --- Notes: v2: use btd_adapter_has_features profiles/audio/media.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/profiles/audio/media.c b/profiles/audio/media.c index 505c4b3a6..0e0c40dc7 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -1279,6 +1279,10 @@ static bool experimental_endpoint_supported(struct btd_adapter *adapter) if (!btd_adapter_has_exp_feature(adapter, EXP_FEAT_ISO_SOCKET)) return false; + if (!btd_adapter_has_features(adapter, ADAPTER_CIS_CENTRAL) && + !btd_adapter_has_features(adapter, ADAPTER_CIS_PERIPHERAL)) + return false; + return g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL; } From patchwork Mon Jan 30 18:37:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Virtanen X-Patchwork-Id: 648752 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C42A7C636D3 for ; Mon, 30 Jan 2023 18:39:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238359AbjA3Sje (ORCPT ); Mon, 30 Jan 2023 13:39:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238164AbjA3SjP (ORCPT ); Mon, 30 Jan 2023 13:39:15 -0500 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F8F2144B6 for ; Mon, 30 Jan 2023 10:38:34 -0800 (PST) Received: from meesny.iki.fi (meesny.iki.fi [195.140.195.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lahtoruutu.iki.fi (Postfix) with ESMTPS id E7BEE1B001B0 for ; Mon, 30 Jan 2023 20:38:32 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1675103912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KQY/vLLWHWuYfplArOiVKIK/ngXRIxxDaTVrCQ9IXL8=; b=q8VocN5ymP3MmK3HY8TYbV9CIGqs9NaZVgKz6DmULXw2Ml5Rvsav4aQVVFTrF1vRqsFEFo ixdmcsHg9kxUK3wlmAumVZALWuUFfUy516H9Ie61enUAXSgGAzTbxW9j5U8BpELb6nOr5f IR6n2GGri6OASVij2EGnn9X8hz2VWTed/dc0sEE4ViIusSeTLd9Le+ptigsbvKl7quc4Zj GWepW7qky8TUUPaxlg+qBjBVznFLAovApmMwrTNpu2RqHP6L1jyLkmd5oCqTaJXzGp9IN+ qIoCfHS8342sudwKJ9Wgjiox+HXevu8SCEk0dsGzkpCN4LJKNGhGwoLepErjAQ== Received: from monolith.lan (91-152-121-187.elisa-laajakaista.fi [91.152.121.187]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pav) by meesny.iki.fi (Postfix) with ESMTPSA id 6513D2058D; Mon, 30 Jan 2023 20:37:55 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1675103875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KQY/vLLWHWuYfplArOiVKIK/ngXRIxxDaTVrCQ9IXL8=; b=LVabN6st0Qz4K/gixzbcSfoDNSWD9GOQ6S2cjEolQDl/bbY4JOT0ERWgsAYJ6nol2Ysf82 kNJT1QLvLNNLxShBXTCw41cTUKkTT2iJm2h4oWtVow3nntpJ8VbI++NxH601FEAjFqNwUt nSDkGmT9a4HUJ93OPIfs4GWP9RZ1TgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1675103875; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KQY/vLLWHWuYfplArOiVKIK/ngXRIxxDaTVrCQ9IXL8=; b=Fm/p9thT0qFPbRyAXSNuBkNL0FjzAmZcDyvsp3GRwfpNziVXJBLxpIurSoCA2XtF5kyU6x /LIBFKDD+eCCjyn61VTzNMFkp8l1pEdbCBHqkjYzh5jB3WQFVIVtwVp3/9KAtiG2bwHA4s z+yEMAoXivV+RknWNW1ZKHPQwob+o9I= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=pav smtp.mailfrom=pav@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1675103875; a=rsa-sha256; cv=none; b=YFuvvpYxqCbWmw/DJNSiX7x9xgX1c2FoGsRfw3Ob60Pme2XbSNeh92o85MqQ9jVobCtYec FLfHLYe5tTrrh0ySzcro+YQHQkWDsMX357U+XFFmNn7AgxNoPNs/fjHcK/gBm6uhlOYjMX ex39kcDnqLadoVnn8f64gdN/k/+E+JI= From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 8/8] bap: handle adapters that are not CIS Central / Peripheral capable Date: Mon, 30 Jan 2023 20:37:39 +0200 Message-Id: <89c50cadaefa56c85346ad7f2cd86eab756f3987.1675103676.git.pav@iki.fi> X-Mailer: git-send-email 2.39.1 In-Reply-To: References: <20230127205205.20235-1-pav@iki.fi> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org When BT adapter is not CIS Peripheral capable, use the shared/bap code in its central-only mode, and don't register anything in the local GATT database. When BT adapter is not CIS Central capable, ignore the remote device GATT database, so that we work purely in peripheral mode. If BT adapter supports neither feature, don't do anything with BAP. --- profiles/audio/bap.c | 18 ++++++++++++++++-- profiles/audio/media.c | 11 ++++++----- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index e5ffb7230..28c0d139a 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -1254,6 +1254,8 @@ static int bap_probe(struct btd_service *service) struct btd_adapter *adapter = device_get_adapter(device); struct btd_gatt_database *database = btd_adapter_get_database(adapter); struct bap_data *data = btd_service_get_user_data(service); + struct bt_bap_db *ldb; + struct gatt_db *device_db; char addr[18]; ba2str(device_get_address(device), addr); @@ -1264,17 +1266,29 @@ static int bap_probe(struct btd_service *service) return -ENOTSUP; } + if (!btd_adapter_cis_central_capable(adapter) && + !btd_adapter_cis_peripheral_capable(adapter)) { + DBG("BAP requires CIS features, unsupported by adapter"); + return -ENOTSUP; + } + /* Ignore, if we were probed for this device already */ if (data) { error("Profile probed twice for the same device!"); return -EINVAL; } + if (btd_adapter_cis_central_capable(adapter)) + device_db = btd_device_get_gatt_db(device); + else + device_db = NULL; + data = bap_data_new(device); data->service = service; - data->bap = bt_bap_new(btd_gatt_database_get_db(database), - btd_device_get_gatt_db(device)); + ldb = bt_bap_get_local_db(btd_gatt_database_get_db(database), + btd_adapter_cis_peripheral_capable(adapter)); + data->bap = bt_bap_new(ldb, device_db); if (!data->bap) { error("Unable to create BAP instance"); free(data); diff --git a/profiles/audio/media.c b/profiles/audio/media.c index d68085514..6f83b03b5 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -1105,8 +1105,9 @@ static void bap_debug(const char *str, void *user_data) static bool endpoint_init_pac(struct media_endpoint *endpoint, uint8_t type, int *err) { + struct btd_adapter *adapter = endpoint->adapter->btd_adapter; struct btd_gatt_database *database; - struct gatt_db *db; + struct bt_bap_db *ldb; struct iovec data; char *name; @@ -1116,7 +1117,7 @@ static bool endpoint_init_pac(struct media_endpoint *endpoint, uint8_t type, return false; } - database = btd_adapter_get_database(endpoint->adapter->btd_adapter); + database = btd_adapter_get_database(adapter); if (!database) { error("Adapter database not found"); return false; @@ -1128,8 +1129,6 @@ static bool endpoint_init_pac(struct media_endpoint *endpoint, uint8_t type, return false; } - db = btd_gatt_database_get_db(database); - data.iov_base = endpoint->capabilities; data.iov_len = endpoint->size; @@ -1141,7 +1140,9 @@ static bool endpoint_init_pac(struct media_endpoint *endpoint, uint8_t type, return false; } - endpoint->pac = bt_bap_add_pac(db, name, type, endpoint->codec, + ldb = bt_bap_get_local_db(btd_gatt_database_get_db(database), + btd_adapter_cis_peripheral_capable(adapter)); + endpoint->pac = bt_bap_add_pac(ldb, name, type, endpoint->codec, &endpoint->qos, &data, NULL); if (!endpoint->pac) { error("Unable to create PAC"); From patchwork Sat Feb 11 10:53:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Virtanen X-Patchwork-Id: 652767 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 16B7BC636D7 for ; Sat, 11 Feb 2023 10:57:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230011AbjBKK5R (ORCPT ); Sat, 11 Feb 2023 05:57:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229985AbjBKK5M (ORCPT ); Sat, 11 Feb 2023 05:57:12 -0500 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07DB383D2 for ; Sat, 11 Feb 2023 02:57:10 -0800 (PST) Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 6F56F240769 for ; Sat, 11 Feb 2023 11:57:09 +0100 (CET) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PDSGs096Cz9rxF; Sat, 11 Feb 2023 11:57:08 +0100 (CET) From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ v2 9/9] bap: handle adapters that are not CIS Central / Peripheral capable Date: Sat, 11 Feb 2023 10:53:53 +0000 Message-Id: <80fb0196727ff8ea422b0e003be028a99844da70.1676112710.git.pav@iki.fi> In-Reply-To: <3df45c4a6737b249b519d4c6128e2eb783198abc.1676112710.git.pav@iki.fi> References: <20230127205205.20235-1-pav@iki.fi> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org When BT adapter is not CIS Peripheral capable, set client-only for the local db, so that ASCS/PACS are not registered. When BT adapter is not CIS Central capable, ignore the remote device GATT database, and don't start client sessions. --- Notes: v2: * Use bt_bap_set_client_only and btd_adapter_has_features to do the stuff. * Don't attach client in bap_accept, if adapter doesn't support CIS Central. We still mark the service as connected. If we want to mark the service unavailable in this case, we could return error in device_probe. Server connections are handled in bap_attached/detached and work also in this case, this should work based on looking at the code, and it works in testing. The patch series was manually tested with two machines running it, with Central flag forced to false on one end, and Peripheral flag to false on the other, and testing Pipewire being able to play + record audio over the BAP link. Playback + recording on non-BlueZ remote device was also tested with Peripheral flag disabled. bluetoothctl: Server (CIS Central bit disabled): [bluetooth]# endpoint.register 00002bc9-0000-1000-8000-00805f9b34fb 0x06 [/local/endpoint/ep0] Auto Accept (yes/no): yes [/local/endpoint/ep0] CIG (auto/value): a [/local/endpoint/ep0] CIS (auto/value): a Capabilities: 03 01 ff 00 02 02 03 02 03 03 05 04 1e 00 f0 00 ................ Endpoint /local/endpoint/ep0 registered [bluetooth]# endpoint.register 00002bcb-0000-1000-8000-00805f9b34fb 0x06 [/local/endpoint/ep1] Auto Accept (yes/no): yes [/local/endpoint/ep1] CIG (auto/value): a [/local/endpoint/ep1] CIS (auto/value): a Capabilities: 03 01 ff 00 02 02 03 02 03 03 05 04 1e 00 f0 00 ................ Endpoint /local/endpoint/ep1 registered [bluetooth]# show Controller XX:XX:XX:XX:XX:XX (public) Name: xxx Alias: xxx Class: 0x00000000 Powered: yes PowerState: on Discoverable: no DiscoverableTimeout: 0x000000b4 Pairable: no UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb) UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb) UUID: Volume Control (00001844-0000-1000-8000-00805f9b34fb) UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb) UUID: Audio Stream Control (0000184e-0000-1000-8000-00805f9b34fb) UUID: Published Audio Capabil.. (00001850-0000-1000-8000-00805f9b34fb) Modalias: usb:v1D6Bp0246d0542 Discovering: no Roles: central Roles: peripheral ExperimentalFeatures: BlueZ Experimental LL p.. (15c0a148-c273-11ea-b3de-0242ac130004) ExperimentalFeatures: BlueZ Experimental Blue.. (330859bc-7506-492d-9370-9a6f0614037f) ExperimentalFeatures: BlueZ Experimental ISO... (6fbaf188-05e0-496a-9885-d6ddfdb4e03e) Client (CIS Peripheral bit disabled): [bluetooth]# endpoint.register 00002bc9-0000-1000-8000-00805f9b34fb 0x06 [/local/endpoint/ep0] Auto Accept (yes/no): yes [/local/endpoint/ep0] CIG (auto/value): a [/local/endpoint/ep0] CIS (auto/value): a Capabilities: 03 01 ff 00 02 02 03 02 03 03 05 04 1e 00 f0 00 ................ Endpoint /local/endpoint/ep0 registered [bluetooth]# endpoint.register 00002bcb-0000-1000-8000-00805f9b34fb 0x06 [/local/endpoint/ep1] Auto Accept (yes/no): yes [/local/endpoint/ep1] CIG (auto/value): a [/local/endpoint/ep1] CIS (auto/value): a Capabilities: 03 01 ff 00 02 02 03 02 03 03 05 04 1e 00 f0 00 ................ Endpoint /local/endpoint/ep1 registered [bluetooth]# show Controller YY:YY:YY:YY:YY:YY (public) Name: yyy Alias: yyy Class: 0x00000000 Powered: yes PowerState: on Discoverable: no DiscoverableTimeout: 0x000000b4 Pairable: no UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb) UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb) UUID: Volume Control (00001844-0000-1000-8000-00805f9b34fb) UUID: Device Information (0000180a-0000-1000-8000-00805f9b34fb) Modalias: usb:v1D6Bp0246d0542 Discovering: no Roles: central Roles: peripheral ExperimentalFeatures: BlueZ Experimental ISO... (6fbaf188-05e0-496a-9885-d6ddfdb4e03e) The client is client-only, and has no ASCS/PACS. [bluetooth]# connect XX:XX:XX:XX:XX:XX ... [server]# transport.list Transport /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_source0/fd12 Transport /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_sink0/fd13 [server]# endpoint.list Endpoint /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_source0 Endpoint /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_sink0 [server]# endpoint.list local /local/endpoint/ep0 /local/endpoint/ep1 [server]# transport.acquire /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_source0/fd12 Acquire successful: fd 7 MTU 40:40 [CHG] Transport /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_sink0/fd13 State: active [CHG] Transport /org/bluez/hci0/dev_XX_XX_XX_XX_XX_XX/pac_source0/fd12 State: active Server: Auto Acquiring... [CHG] Transport /org/bluez/hci0/dev_YY_YY_YY_YY_YY_YY/fd6 State: pending Acquire successful: fd 7 MTU 40:40 [CHG] Transport /org/bluez/hci0/dev_YY_YY_YY_YY_YY_YY/fd7 State: active [CHG] Transport /org/bluez/hci0/dev_YY_YY_YY_YY_YY_YY/fd6 State: active [client]# endpoint.list [client]# endpoint.list local /local/endpoint/ep0 /local/endpoint/ep1 The server is peripheral-only and has only local endpoints. profiles/audio/bap.c | 26 ++++++++++++++++++++++++-- profiles/audio/media.c | 6 +++++- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c index b8c75f195..426aa89aa 100644 --- a/profiles/audio/bap.c +++ b/profiles/audio/bap.c @@ -1259,6 +1259,7 @@ static int bap_probe(struct btd_service *service) struct btd_adapter *adapter = device_get_adapter(device); struct btd_gatt_database *database = btd_adapter_get_database(adapter); struct bap_data *data = btd_service_get_user_data(service); + struct gatt_db *adapter_db, *device_db; char addr[18]; ba2str(device_get_address(device), addr); @@ -1269,17 +1270,32 @@ static int bap_probe(struct btd_service *service) return -ENOTSUP; } + if (!btd_adapter_has_features(adapter, ADAPTER_CIS_CENTRAL) && + !btd_adapter_has_features(adapter, ADAPTER_CIS_PERIPHERAL)) { + DBG("BAP requires CIS features, unsupported by adapter"); + return -ENOTSUP; + } + /* Ignore, if we were probed for this device already */ if (data) { error("Profile probed twice for the same device!"); return -EINVAL; } + adapter_db = btd_gatt_database_get_db(database); + + if (!btd_adapter_has_features(adapter, ADAPTER_CIS_PERIPHERAL)) + bt_bap_set_client_only(adapter_db); + + if (btd_adapter_has_features(adapter, ADAPTER_CIS_CENTRAL)) + device_db = btd_device_get_gatt_db(device); + else + device_db = NULL; + data = bap_data_new(device); data->service = service; - data->bap = bt_bap_new(btd_gatt_database_get_db(database), - btd_device_get_gatt_db(device)); + data->bap = bt_bap_new(adapter_db, device_db); if (!data->bap) { error("Unable to create BAP instance"); free(data); @@ -1303,6 +1319,7 @@ static int bap_probe(struct btd_service *service) static int bap_accept(struct btd_service *service) { struct btd_device *device = btd_service_get_device(service); + struct btd_adapter *adapter = device_get_adapter(device); struct bt_gatt_client *client = btd_device_get_gatt_client(device); struct bap_data *data = btd_service_get_user_data(service); char addr[18]; @@ -1315,6 +1332,11 @@ static int bap_accept(struct btd_service *service) return -EINVAL; } + if (!btd_adapter_has_features(adapter, ADAPTER_CIS_CENTRAL)) { + btd_service_connecting_complete(service, 0); + return 0; + } + if (!bt_bap_attach(data->bap, client)) { error("BAP unable to attach"); return -EINVAL; diff --git a/profiles/audio/media.c b/profiles/audio/media.c index 0e0c40dc7..d9e133007 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -1110,6 +1110,7 @@ static void bap_debug(const char *str, void *user_data) static bool endpoint_init_pac(struct media_endpoint *endpoint, uint8_t type, int *err) { + struct btd_adapter *adapter = endpoint->adapter->btd_adapter; struct btd_gatt_database *database; struct gatt_db *db; struct iovec data; @@ -1122,7 +1123,7 @@ static bool endpoint_init_pac(struct media_endpoint *endpoint, uint8_t type, return false; } - database = btd_adapter_get_database(endpoint->adapter->btd_adapter); + database = btd_adapter_get_database(adapter); if (!database) { error("Adapter database not found"); return false; @@ -1158,6 +1159,9 @@ static bool endpoint_init_pac(struct media_endpoint *endpoint, uint8_t type, metadata->iov_len = endpoint->metadata_size; } + if (!btd_adapter_has_features(adapter, ADAPTER_CIS_PERIPHERAL)) + bt_bap_set_client_only(db); + endpoint->pac = bt_bap_add_vendor_pac(db, name, type, endpoint->codec, endpoint->cid, endpoint->vid, &endpoint->qos, &data, metadata);