Skip to contentSkip to conversation

main.conf: Split Kernel Experimental UUIDs from Experimental

PATCH Applied Luiz Augusto von Dentz 3 participants 4 messages Jun 14, 2022 – Jun 16, 2022 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/2 main.conf: Split Kernel Experimental UUIDs from Experimental

From: Luiz Augusto von Dentz <[email protected]>

This splits kernel experimental UUIDs from D-Bus Experimental interface so they can be controlled indenpendetly.

---
 src/adapter.c | 28 ++++++++++++++++---------
 src/btd.h     |  5 +++--
 src/main.c    | 57 ++++++++++++++++++++++++++++++---------------------
 src/main.conf |  8 ++++++--
 4 files changed, 61 insertions(+), 37 deletions(-)
src/adapter.c +18 -10
index 3e0b3049a..afefa1d5d 100644
@@ -9583,7 +9583,7 @@ static void set_exp_debug_complete(uint8_t status, uint16_t len,
 					const void *param, void *user_data)
 {
 	struct btd_adapter *adapter = user_data;
-	uint8_t action = btd_opts.experimental ? 0x01 : 0x00;
+	uint8_t action;
 
 	if (status != 0) {
 		error("Set Experimental Debug failed with status 0x%02x (%s)",
@@ -9591,7 +9591,9 @@ static void set_exp_debug_complete(uint8_t status, uint16_t len,
 		return;
 	}
 
-	DBG("Experimental Debug successfully set");
+	action = btd_kernel_experimental_enabled(debug_uuid.str);
+
+	DBG("Experimental Debug successfully %s", action ? "set" : "reset");
 
 	if (action)
 		queue_push_tail(adapter->exps, (void *)debug_uuid.val);
@@ -9631,7 +9633,7 @@ static void set_rpa_resolution_complete(uint8_t status, uint16_t len,
 					const void *param, void *user_data)
 {
 	struct btd_adapter *adapter = user_data;
-	uint8_t action = btd_opts.experimental ? 0x01 : 0x00;
+	uint8_t action;
 
 	if (status != 0) {
 		error("Set RPA Resolution failed with status 0x%02x (%s)",
@@ -9639,7 +9641,9 @@ static void set_rpa_resolution_complete(uint8_t status, uint16_t len,
 		return;
 	}
 
-	DBG("RPA Resolution successfully set");
+	action = btd_kernel_experimental_enabled(rpa_resolution_uuid.str);
+
+	DBG("RPA Resolution successfully %s", action ? "set" : "reset");
 
 	if (action)
 		queue_push_tail(adapter->exps, (void *)rpa_resolution_uuid.val);
@@ -9665,7 +9669,7 @@ static void codec_offload_complete(uint8_t status, uint16_t len,
 					const void *param, void *user_data)
 {
 	struct btd_adapter *adapter = user_data;
-	uint8_t action = btd_opts.experimental ? 0x01 : 0x00;
+	uint8_t action;
 
 	if (status != 0) {
 		error("Set Codec Offload failed with status 0x%02x (%s)",
@@ -9673,7 +9677,9 @@ static void codec_offload_complete(uint8_t status, uint16_t len,
 		return;
 	}
 
-	DBG("Codec Offload successfully set");
+	action = btd_kernel_experimental_enabled(codec_offload_uuid.str);
+
+	DBG("Codec Offload successfully %s", action ? "set" : "reset");
 
 	if (action)
 		queue_push_tail(adapter->exps, (void *)codec_offload_uuid.val);
@@ -9744,20 +9750,22 @@ static void read_exp_features_complete(uint8_t status, uint16_t length,
 
 		for (j = 0; j < ARRAY_SIZE(exp_table); j++) {
 			const struct exp_feat *feat = &exp_table[j];
+			const char *str;
 			uint8_t action;
 
 			if (memcmp(rp->features[i].uuid, feat->uuid->val,
 					sizeof(rp->features[i].uuid)))
 				continue;
 
-			action = btd_experimental_enabled(feat->uuid->str);
+			str = feat->uuid->str;
+			action = btd_kernel_experimental_enabled(str);
 
-			DBG("%s flags %u action %u", feat->uuid->str,
-				rp->features[i].flags, action);
+			DBG("%s flags %u action %u", str,
+					rp->features[i].flags, action);
 
 			/* If already set don't attempt to set it again */
 			if (action == (rp->features[i].flags & BIT(0))) {
-				if (action)
+				if (action & BIT(0))
 					queue_push_tail(adapter->exps,
 						(void *)feat->uuid->val);
 				continue;
src/btd.h +3 -2
index d13646889..c02b2691e 100644
@@ -113,7 +113,8 @@ struct btd_opts {
 	gboolean	debug_keys;
 	gboolean	fast_conn;
 	gboolean	refresh_discovery;
-	struct queue	*experimental;
+	gboolean	experimental;
+	struct queue	*kernel;
 
 	uint16_t	did_source;
 	uint16_t	did_vendor;
@@ -145,6 +146,6 @@ void rfkill_init(void);
 void rfkill_exit(void);
 
 GKeyFile *btd_get_main_conf(void);
-bool btd_experimental_enabled(const char *uuid);
+bool btd_kernel_experimental_enabled(const char *uuid);
 
 void btd_exit(void);
src/main.c +34 -23

137 lines not on this page · raw message

src/main.conf +6 -2
index 91b98b8c4..3816cf362 100644
@@ -111,7 +111,11 @@
 # profile is connected. Defaults to true.
 #RefreshDiscovery = true
 
-# Enables experimental features and interfaces, alternatively a list of UUIDs
+# Enables D-Bus experimental interfaces
+# Possible values: true or false
+#Experimental = false
+
+# Enables kernel experimental features, alternatively a list of UUIDs
 # can be given.
 # Possible values: true,false,<UUID List>
 # Possible UUIDS:
@@ -121,7 +125,7 @@
 # 330859bc-7506-492d-9370-9a6f0614037f (BlueZ Experimental Bluetooth Quality Report)
 # a6695ace-ee7f-4fb9-881a-5fac66c629af (BlueZ Experimental Offload Codecs)
 # Defaults to false.
-#Experimental = false
+#KernelExperimental = false
 
 # The duration to avoid retrying to resolve a peer's name, if the previous
 # try failed.
Signature · 1 line
2.35.3
author maintainer
#1 lore raw

PATCH 2/2 bluetoothd.rst: Document -K/--kernel option

From: Luiz Augusto von Dentz <[email protected]>

This documents -K/--kernel experimental features options.

---
 src/bluetoothd.rst.in | 4 ++++
 1 file changed, 4 insertions(+)
src/bluetoothd.rst.in +4 -0
index 6bce349ef..7a0fa1b24 100644
@@ -67,6 +67,10 @@ OPTIONS
 -E, --experimental  Enable experimental interfaces. Those interfaces are not
                     guaranteed to be compatible or present in future releases.
 
+-K, --kernel=<uuid1>,<uuid2>,...
+    Enable Kernel experimental features. Kernel experimental features are
+    considered unstable and may be removed from future kernel releases.
+
 FILES
 =====
 
Signature · 1 line
2.35.3
#2 lore raw
In reply to Luiz Augusto von Dentz

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=650352

---Test result---

Test Summary:

CheckPatch                    PASS      2.32 seconds
GitLint                       PASS      1.58 seconds
Prep - Setup ELL              PASS      41.64 seconds
Build - Prep                  PASS      0.59 seconds
Build - Configure             PASS      8.10 seconds
Build - Make                  PASS      1198.21 seconds
Make Check                    PASS      11.70 seconds
Make Check w/Valgrind         PASS      441.76 seconds
Make Distcheck                PASS      228.39 seconds
Build w/ext ELL - Configure   PASS      8.13 seconds
Build w/ext ELL - Make        PASS      1183.39 seconds
Incremental Build with patchesPASS      2414.49 seconds

---
Regards,
Linux Bluetooth

#3 lore raw
In reply to Luiz Augusto von Dentz
This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This series was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 10 lines · On Tue, 14 Jun 2022 14:56:08 -0700 you wrote:

From: Luiz Augusto von Dentz <[email protected]>

This splits kernel experimental UUIDs from D-Bus Experimental interface so they can be controlled indenpendetly.

---
 src/adapter.c | 28 ++++++++++++++++---------
 src/btd.h     |  5 +++--
 src/main.c    | 57 ++++++++++++++++++++++++++++++---------------------
 src/main.conf |  8 ++++++--
 4 files changed, 61 insertions(+), 37 deletions(-)

Here is the summary with links:
- [BlueZ,1/2] main.conf: Split Kernel Experimental UUIDs from Experimental

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=a5382ba2f09c
  - [BlueZ,2/2] bluetoothd.rst: Document -K/--kernel option
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=afc8c8f56fa2

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html