From patchwork Mon Jan 30 18:37:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Virtanen X-Patchwork-Id: 13121669 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 37D93C54EAA for ; Mon, 30 Jan 2023 18:39:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238187AbjA3SjD (ORCPT ); Mon, 30 Jan 2023 13:39:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238254AbjA3Sis (ORCPT ); Mon, 30 Jan 2023 13:38:48 -0500 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAD55B44B for ; Mon, 30 Jan 2023 10:38:02 -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) server-digest SHA256) (No client certificate requested) by lahtoruutu.iki.fi (Postfix) with ESMTPS id 3FF4D1B000A4 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; bh=jdsUT2XSJyrD2X4/zPGnfk6UagSBuq0Oo+Bi3zY6Q8Q=; b=e6P2PT6IBC1Q0gBKEe1ZORyMyTno/5YjMIw0OIoTnFLZ/+Qf7AkVSNnosIpclQ8mMF0eCI cUIkAUwaM5k3crTe+T8sOPRXzObJgfjYSpH/OMWjwzuVjpc0CKjh5UsP2k+CFuHeBn9EAy hfdJ7DLZRAvyGRc0tKcUPy4BYoNj+vXGJb8QIxuTOpPsqw7axTzGh7kYR59Ex4PvIYVTlv 4vJFIblo1zussjJyNVD5budt4L8kwfmfxalSVOAxNn4KU2BDFAa+9lVeTPTZIatHaTb8Pd gpcdRrSUbcoY2c+e8MjbDHv1JsNex/9jJsLOLhVd5cYhxrQ5pywVOiBbW+uzlA== 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 7644F200E5; 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; bh=jdsUT2XSJyrD2X4/zPGnfk6UagSBuq0Oo+Bi3zY6Q8Q=; b=PZ8lqfnXV4lkg0A+KV49zGii2Rn4cYrZFxcqjMNiFQxkSroQTWG2XPUdI9sPChWDevQxOp sscxHOKcDPUznb40FY4rtveuw0ZICED8RDvJOQwwJzV/Ha/cI0LqLfxhn0gsO9W4KwO9eF ou6uSN21HMhcx/PM/RqGKPs2s9gS5YI= 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; bh=jdsUT2XSJyrD2X4/zPGnfk6UagSBuq0Oo+Bi3zY6Q8Q=; b=cMVfd/eJN3GQgPWxynqRm9flwZ0vjfP7gxU3hUHPgcBPOcjhXqywHV2R03LnlUKsEnu7rz RNW2/NXZlWhncKYo4uvNqSh7wfh9r+6r1C+/qHxLxgMWvJdaYuIdPDEI7uskKxFR0nf6Tg NmXefN5WZ9GZtYgI3lLUlM9Kd/0M33o= 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=kpudVUNNcf5j3proY2BZE4MnRGumyqi3JWTMdx7oYe0Hpbgamkz1Kr4r1M55WncM3CZUEh Gbm/Vex1R24DYOqTg/FUyZeqE62LnLtKUrz0L6TR5omUJKf7t4ZzSNbhzfux5IK8nshRNo MS8BOgF7FrPc90sjh2toeVfA/XMxJqo= From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 1/8] doc: add MGMT setting for CIS features, remove Quality Report Date: Mon, 30 Jan 2023 20:37:32 +0200 Message-Id: X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Add definitions for new MGMT Controller Information settings bits, indicating adapter Connected Isochronous Stream - Central/Peripheral feature support. The Set Quality Report command was removed in commit 0454e2d09570 ("mgmt: Add support for Mesh in the kernel"), but the settings bit was not removed. It's also not implemented on kernel side, so remove it now. --- Notes: Was the quality report setting bit reserved on purpose? From the commit log it looks like it was forgotten to remove from the docs, but this is not clear. doc/mgmt-api.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt index 90d612ed8..58395dc90 100644 --- a/doc/mgmt-api.txt +++ b/doc/mgmt-api.txt @@ -332,7 +332,8 @@ Read Controller Information Command 15 Static Address 16 PHY Configuration 17 Wideband Speech - 18 Quality Report + 18 Connected Isochronous Stream - Central + 19 Connected Isochronous Stream - Peripheral This command generates a Command Complete event on success or a Command Status event on failure. @@ -2925,7 +2926,8 @@ Read Extended Controller Information Command 15 Static Address 16 PHY Configuration 17 Wideband Speech - 18 Quality Report + 18 Connected Isochronous Stream - Central + 19 Connected Isochronous Stream - Peripheral The EIR_Data field contains information about class of device, local name and other values. Not all of them might be present. For 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: 13121672 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:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Virtanen X-Patchwork-Id: 13121671 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 76401C636D4 for ; Mon, 30 Jan 2023 18:39:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238350AbjA3SjH (ORCPT ); Mon, 30 Jan 2023 13:39:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238010AbjA3Siw (ORCPT ); Mon, 30 Jan 2023 13:38:52 -0500 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C4B6B456 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 BCED91B001DD 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=9rhKD4XWV5JCe6+A5sUXbz1z48YBw01O7o5UNjhzPVk=; b=cPAG8j69Ls22s6GB74y+bM+I256/ojuImEy7fpDpKOlQmAYsaFzGxTOvP1ZoIm9EQzr5/W TCkAEv+XHQXN9FEObv+rgR35Jew+RCn4t1+oY7dhL0XdVK58Q4Xkr3im8Re9QfohQBF2Jx hzqO95FqNDPwv2yHMPBlj2i0UbXl+exmLqHH7Oe/k8coNFSPLNqZMc2Ql+/tvpQSBkUPC3 QX0JCCwKp/JBaeEN63hCJht8KhVhZf4jaXOHr2yagnM5rlRRdWlHTEuF2RhLzZrt+kyvyI f1qm/XHz0mfqUwyXm4ZWcjKjG3JB4NJRDbPHW4TiolyUQdXtaMmAuVcXvFleGg== 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 C95F120327; 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=9rhKD4XWV5JCe6+A5sUXbz1z48YBw01O7o5UNjhzPVk=; b=EBvTqmFeu/xLMA8IZ1vmWcwRYvqiyf+W00LdR3Qa54YlIvNLnJ4ncLLfhfu7wLVgeQ+ojI WWJvfottNNgyiToGALwRuaOPboHN+pUdbMRVxX55JShkaqASORotOaXgEC0FGZaaZ/OB1n uslrupbDFhHmR+x62ue40Ckk2XPhHjw= 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=9rhKD4XWV5JCe6+A5sUXbz1z48YBw01O7o5UNjhzPVk=; b=MmDVNLSS/w+wI9mYNRtRW1YH1XIUrWKNoU1YleCdGjwCI7NLpKxIGTnZ3BZSQAZvSOKRuw JaD6VwlrUksI3YWPBzX2t1Y514VCahTpp9/OtlsRTtHVd0kz9Vol0rt+gYzA51CexbxTOz zHZwYQG3u96vq9vqti5E2AZcXMjwSZg= 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=J+fjHb2QXiCAwoLsXQR3o54DJJ/TtfdhmAa7GblFdMTzizYaOtWkMVVAPeJ+FjITDu6Sp5 81qLCd9+w7aflzHMnmmX3odr64fYDc3745o7dTB7iy7gVXyTbPxpwAci3Hg4nxH7/0cGNX Q958ndKKXhHkzaCOz7FA8UFgLXi08vc= From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 3/8] monitor: add names for MGMT setting bits for CIS feature support Date: Mon, 30 Jan 2023 20:37:34 +0200 Message-Id: <6752660792aa222640025a08ba9d95bcf9cf70b6.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 --- monitor/packet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monitor/packet.c b/monitor/packet.c index 44f1941bd..d9e8abf41 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -12649,6 +12649,8 @@ static const struct bitfield_data mgmt_settings_table[] = { { 15, "Static Address" }, { 16, "PHY Configuration" }, { 17, "Wideband Speech" }, + { 18, "CIS Central" }, + { 19, "CIS Peripheral" }, { } }; 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: 13121670 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:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Virtanen X-Patchwork-Id: 13121673 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 7A675C636D6 for ; Mon, 30 Jan 2023 18:39:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238358AbjA3SjJ (ORCPT ); Mon, 30 Jan 2023 13:39:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238052AbjA3Six (ORCPT ); Mon, 30 Jan 2023 13:38:53 -0500 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C8BA23D8C 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 541231B0027A 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=j7x0icnorU2d5QS8/EgbEzJZVUpP8E8+GWy+CNyG/qs=; b=oCQi+6d5JrTL/qsPxnK47ZKCG1EGHmOxPgblNBls20lSXQ+Ck4WW33lH9QD9h87XHvpr+c SFRbEX9me9d4O3x4UxNhJaZc6/z489RfMoG81DNJ6hTTs0EA52ZE7p+ZlXNJRsg8tTO5Fs 499Ly3M28AcX5MseDA1TJw1teh8+ISpJ04VP7rlJI+Q2JMgKiwU6frp93svAFEZv9hnNKJ 8SQlj0NGcPwWAVSeQtpQTZ2goOZW/MX5ZdcmTCgtEHVSVUlhLPsKhCWdCoJ2K+/fAfbGj3 AYbpG6uIq+6p2cHQZI8/eiNk05X47/p8xTYg5Lw8FSZtvg+iDKl8I8a4Az6gwQ== 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 12163203BD; 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=j7x0icnorU2d5QS8/EgbEzJZVUpP8E8+GWy+CNyG/qs=; b=CNyb5u4sYLno1BP5aaxFvLgj8OF/QsRHzUpGaPcQ3BpSljEcRj8eiGoNIzded8aJuFQcDw aBRtCfy1d7l8fZqQWGUjO5TuPg+auTKwKyBxCvidQMlNlccbI+kO32uCUvD/CPud/aTS/H r8gzQetDza9UFeo5IJG3GK7CwZxmBjg= 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=j7x0icnorU2d5QS8/EgbEzJZVUpP8E8+GWy+CNyG/qs=; b=KQqJb++6R4wmUgNvHF/twBt4e8PccTVklbRB7SrxGEVE3F1zhl2C0wSQqh0exymALXljaa xrdH0dCzkwjIHY4zjs/RzISAFv+mRGWfXrv7s9R9TPwR0Dnfj4illCmhuhpCPgLx4F2QmI NTVb9vl1smcPGSZpVU/Ot1JvtpuxE08= 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=HrmaksdFFWSCtzZaBgtkKADTyNiSA96mBvVbbkpwryEeO1RIRKAqSTX3lNx6oIhkoB2qSk EjOLvN+lcuPde/qAT5iIZAGyobZb1IDRntVa1rJomfs57l0EhiAPdsVZLO4GwQEmTC02qx lxRA6nL/naYzgMJ7zeSDBNZ5mp2P5IY= From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 5/8] adapter: add functions indicating adapter CIS capability Date: Mon, 30 Jan 2023 20:37:36 +0200 Message-Id: <32554e8adb382a7e5051f09cd06ca4e0dfe1f86b.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 --- src/adapter.c | 16 ++++++++++++++++ src/adapter.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/src/adapter.c b/src/adapter.c index aadad4016..4f06bce53 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -9033,6 +9033,22 @@ bool btd_adapter_ssp_enabled(struct btd_adapter *adapter) return false; } +bool btd_adapter_cis_central_capable(struct btd_adapter *adapter) +{ + if (adapter->current_settings & MGMT_SETTING_CIS_CENTRAL) + return true; + + return false; +} + +bool btd_adapter_cis_peripheral_capable(struct btd_adapter *adapter) +{ + if (adapter->current_settings & MGMT_SETTING_CIS_PERIPHERAL) + return true; + + return false; +} + void btd_adapter_set_oob_handler(struct btd_adapter *adapter, struct oob_handler *handler) { diff --git a/src/adapter.h b/src/adapter.h index 78eb069ae..3fcee30bc 100644 --- a/src/adapter.h +++ b/src/adapter.h @@ -226,6 +226,9 @@ void btd_adapter_gatt_server_stop(struct btd_adapter *adapter); bool btd_adapter_ssp_enabled(struct btd_adapter *adapter); +bool btd_adapter_cis_central_capable(struct btd_adapter *adapter); +bool btd_adapter_cis_peripheral_capable(struct btd_adapter *adapter); + int adapter_connect_list_add(struct btd_adapter *adapter, struct btd_device *device); void adapter_connect_list_remove(struct btd_adapter *adapter, 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: 13121676 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 Mon Jan 30 18:37:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pauli Virtanen X-Patchwork-Id: 13121675 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 1E78CC54EAA for ; Mon, 30 Jan 2023 18:39:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238363AbjA3Sjh (ORCPT ); Mon, 30 Jan 2023 13:39:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237996AbjA3SjQ (ORCPT ); Mon, 30 Jan 2023 13:39:16 -0500 Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB1D347EC1 for ; Mon, 30 Jan 2023 10:38:36 -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 ACFC61B000A4 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=0chwMACS3s9J8XZ5vhRL/15pJaWkL13ZouPM33dABnw=; b=YLkELrnpfLLhNauWlhI9JiQ1I3kEq+lAz7fyWNGIozgWjkKtVZl/MVqMSdg65wgRUtOQ5P 98suANbB1xCjhJqM4Hg8BawXeRg0YdoeihepyLvmUpupy1cGpl5IMRrAF28UQ1jteZhd+9 52RN+I3qFSJSDNiTOR4iL2sLRA90umYNK2LieYQc5l5Bs7HBHE5J4oRAsOlBGPgEIye8IY +sr6I2l7hx9bY1XcYCyVkM00Cn6iuGcl7mqenIZcAg0cZHWmxLgE5YCX463lCFbrBVvEnt ph5BUHLxqyV3V9AOH1xQU/qGzKkRwAKqnZJ2gaSTqXZw99QjyGj6a6ki3cUpXA== 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 4B08D20581; 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=0chwMACS3s9J8XZ5vhRL/15pJaWkL13ZouPM33dABnw=; b=lL5B3145Hxn3MGJaLBk1rTl6epb/Oeps8PGmprRfznqRnar4jLDQ8x3s2qu4zp1SPyIpMa 5zKqqyTeXot3YV7G54ocZxxs1ItCGC7nt5MzZRJzui98FgfGYwHCVxnrYyDBSjhu6b+wvQ 5xJOGWecBFGErJoTU53YJbIOzDIE7M8= 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=0chwMACS3s9J8XZ5vhRL/15pJaWkL13ZouPM33dABnw=; b=f/497kVF3kwaSpHpbKBjEUIABkMWR21oUpT0IqzIhDpdyTV+EDnAdqAWp2EtWHjpll8C4r 3MazAiO1REpFzT8cAbrFDbdqhRJCFOf04s8qb/V4VC7oiMmdcA3iE7uQ55GW/5fNjVTheD RET4msFiOtEaDJbn6Bv3IsapciqRmgk= 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=UiiQCg6NOw+nk+AFiA6VppNLt9w9zYFXHYSSvvNGOc1TA7yBctwDLQuWqoPSYBPy+KZCRG bq7WKDqJu796Hi/PxTs9iPTPoW3+y8+LmJYmUq72iaI3wcVBLG7x89FOrYoy/Lms9s0AH4 EVKId2drMptnblU0QkfklXvFg8XaP0g= From: Pauli Virtanen To: linux-bluetooth@vger.kernel.org Cc: Pauli Virtanen Subject: [PATCH BlueZ 7/8] shared/bap: handle central-only case Date: Mon, 30 Jan 2023 20:37:38 +0200 Message-Id: <161c4172f60d926d015a5b48de48b890412d57e5.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 Support central-only case, where no local endpoints are created, and nothing is registered in the local GATT database. In this case, we keep track of the local PACs ("sinks" and "sources"), but there are no PACS and ASCS registrations or endpoints. --- src/shared/bap.c | 58 ++++++++++++++++++++++++++---------------------- src/shared/bap.h | 9 +++++--- unit/test-bap.c | 4 +++- 3 files changed, 40 insertions(+), 31 deletions(-) diff --git a/src/shared/bap.c b/src/shared/bap.c index 22f2e6714..24113bb34 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -110,11 +110,13 @@ struct bt_ascs { struct bt_bap_db { struct gatt_db *db; - struct bt_pacs *pacs; - struct bt_ascs *ascs; struct queue *sinks; struct queue *sources; + + /* The following are NULL if central-only (no GATT) */ struct queue *endpoints; + struct bt_pacs *pacs; + struct bt_ascs *ascs; }; struct bt_bap_req { @@ -565,6 +567,7 @@ static void bap_disconnected(int err, void *user_data) static struct bt_bap *bap_get_session(struct bt_att *att, struct gatt_db *db) { const struct queue_entry *entry; + struct bt_bap_db *ldb; struct bt_bap *bap; for (entry = queue_get_entries(sessions); entry; entry = entry->next) { @@ -574,7 +577,8 @@ static struct bt_bap *bap_get_session(struct bt_att *att, struct gatt_db *db) return bap; } - bap = bt_bap_new(db, NULL); + ldb = bt_bap_get_local_db(db, true); + bap = bt_bap_new(ldb, NULL); bap->att = att; bt_bap_attach(bap, NULL); @@ -620,7 +624,7 @@ static struct bt_bap_endpoint *bap_get_endpoint(struct bt_bap_db *db, { struct bt_bap_endpoint *ep; - if (!db || !attr) + if (!db || !attr || !db->endpoints) return NULL; ep = queue_find(db->endpoints, bap_endpoint_match, attr); @@ -652,7 +656,7 @@ static struct bt_bap_endpoint *bap_get_endpoint_id(struct bt_bap *bap, struct gatt_db_attribute *attr = NULL; size_t i; - if (!bap || !db) + if (!bap || !db || !db->endpoints) return NULL; ep = queue_find(db->endpoints, bap_endpoint_match_id, UINT_TO_PTR(id)); @@ -2170,7 +2174,7 @@ static struct bt_ascs *ascs_new(struct gatt_db *db) return ascs; } -static struct bt_bap_db *bap_db_new(struct gatt_db *db) +static struct bt_bap_db *bap_db_new(struct gatt_db *db, bool peripheral) { struct bt_bap_db *bdb; @@ -2181,23 +2185,26 @@ static struct bt_bap_db *bap_db_new(struct gatt_db *db) bdb->db = gatt_db_ref(db); bdb->sinks = queue_new(); bdb->sources = queue_new(); - bdb->endpoints = queue_new(); if (!bap_db) bap_db = queue_new(); - bdb->pacs = pacs_new(db); - bdb->pacs->bdb = bdb; + if (peripheral) { + bdb->endpoints = queue_new(); - bdb->ascs = ascs_new(db); - bdb->ascs->bdb = bdb; + bdb->pacs = pacs_new(db); + bdb->pacs->bdb = bdb; + + bdb->ascs = ascs_new(db); + bdb->ascs->bdb = bdb; + } queue_push_tail(bap_db, bdb); return bdb; } -static struct bt_bap_db *bap_get_db(struct gatt_db *db) +struct bt_bap_db *bt_bap_get_local_db(struct gatt_db *db, bool peripheral) { struct bt_bap_db *bdb; @@ -2205,7 +2212,7 @@ static struct bt_bap_db *bap_get_db(struct gatt_db *db) if (bdb) return bdb; - return bap_db_new(db); + return bap_db_new(db, peripheral); } static struct bt_pacs *bap_get_pacs(struct bt_bap *bap) @@ -2328,6 +2335,9 @@ static void bap_add_sink(struct bt_bap_pac *pac) queue_push_tail(pac->bdb->sinks, pac); + if (!pac->bdb->endpoints) + return; + memset(value, 0, sizeof(value)); iov.iov_base = value; @@ -2346,6 +2356,9 @@ static void bap_add_source(struct bt_bap_pac *pac) queue_push_tail(pac->bdb->sources, pac); + if (!pac->bdb->endpoints) + return; + memset(value, 0, sizeof(value)); iov.iov_base = value; @@ -2373,21 +2386,16 @@ static void notify_session_pac_added(void *data, void *user_data) queue_foreach(bap->pac_cbs, notify_pac_added, user_data); } -struct bt_bap_pac *bt_bap_add_vendor_pac(struct gatt_db *db, +struct bt_bap_pac *bt_bap_add_vendor_pac(struct bt_bap_db *bdb, const char *name, uint8_t type, uint8_t id, uint16_t cid, uint16_t vid, struct bt_bap_pac_qos *qos, struct iovec *data, struct iovec *metadata) { - struct bt_bap_db *bdb; struct bt_bap_pac *pac; struct bt_bap_codec codec; - if (!db) - return NULL; - - bdb = bap_get_db(db); if (!bdb) return NULL; @@ -2417,13 +2425,13 @@ struct bt_bap_pac *bt_bap_add_vendor_pac(struct gatt_db *db, return pac; } -struct bt_bap_pac *bt_bap_add_pac(struct gatt_db *db, const char *name, +struct bt_bap_pac *bt_bap_add_pac(struct bt_bap_db *bdb, const char *name, uint8_t type, uint8_t id, struct bt_bap_pac_qos *qos, struct iovec *data, struct iovec *metadata) { - return bt_bap_add_vendor_pac(db, name, type, id, 0x0000, 0x0000, qos, + return bt_bap_add_vendor_pac(bdb, name, type, id, 0x0000, 0x0000, qos, data, metadata); } @@ -2635,7 +2643,7 @@ static void bap_attached(void *data, void *user_data) cb->attached(bap, cb->user_data); } -struct bt_bap *bt_bap_new(struct gatt_db *ldb, struct gatt_db *rdb) +struct bt_bap *bt_bap_new(struct bt_bap_db *ldb, struct gatt_db *rdb) { struct bt_bap *bap; struct bt_bap_db *bdb; @@ -2643,12 +2651,8 @@ struct bt_bap *bt_bap_new(struct gatt_db *ldb, struct gatt_db *rdb) if (!ldb) return NULL; - bdb = bap_get_db(ldb); - if (!bdb) - return NULL; - bap = new0(struct bt_bap, 1); - bap->ldb = bdb; + bap->ldb = ldb; bap->reqs = queue_new(); bap->pending = queue_new(); bap->notify = queue_new(); diff --git a/src/shared/bap.h b/src/shared/bap.h index 47a15636c..a4e8549a5 100644 --- a/src/shared/bap.h +++ b/src/shared/bap.h @@ -34,6 +34,7 @@ #define BT_BAP_CONFIG_PHY_CODEC 0x03 struct bt_bap; +struct bt_bap_db; struct bt_bap_pac; struct bt_bap_stream; @@ -98,14 +99,14 @@ struct bt_bap_pac_qos { uint32_t ppd_max; }; -struct bt_bap_pac *bt_bap_add_vendor_pac(struct gatt_db *db, +struct bt_bap_pac *bt_bap_add_vendor_pac(struct bt_bap_db *bdb, const char *name, uint8_t type, uint8_t id, uint16_t cid, uint16_t vid, struct bt_bap_pac_qos *qos, struct iovec *data, struct iovec *metadata); -struct bt_bap_pac *bt_bap_add_pac(struct gatt_db *db, const char *name, +struct bt_bap_pac *bt_bap_add_pac(struct bt_bap_db *bdb, const char *name, uint8_t type, uint8_t id, struct bt_bap_pac_qos *qos, struct iovec *data, @@ -135,7 +136,9 @@ unsigned int bt_bap_register(bt_bap_func_t added, bt_bap_func_t removed, void *user_data); bool bt_bap_unregister(unsigned int id); -struct bt_bap *bt_bap_new(struct gatt_db *ldb, struct gatt_db *rdb); +struct bt_bap_db *bt_bap_get_local_db(struct gatt_db *db, bool peripheral); + +struct bt_bap *bt_bap_new(struct bt_bap_db *ldb, struct gatt_db *rdb); bool bt_bap_set_user_data(struct bt_bap *bap, void *user_data); diff --git a/unit/test-bap.c b/unit/test-bap.c index afeefac84..b677f5197 100644 --- a/unit/test-bap.c +++ b/unit/test-bap.c @@ -311,6 +311,7 @@ static void test_client(const void *user_data) { struct test_data *data = (void *)user_data; struct io *io; + struct bt_bap_db *ldb; struct gatt_db *db; io = tester_setup_io(data->iov, data->iovcnt); @@ -321,7 +322,8 @@ static void test_client(const void *user_data) db = gatt_db_new(); g_assert(db); - data->bap = bt_bap_new(db, bt_gatt_client_get_db(data->client)); + ldb = bt_bap_get_local_db(db, true); + data->bap = bt_bap_new(ldb, bt_gatt_client_get_db(data->client)); g_assert(data->bap); bt_bap_set_debug(data->bap, print_debug, "bt_bap:", NULL); 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: 13121674 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");