[PATCH v2 08/10] adapter: Add support for experimental flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

This adds experimental field to btd_adapter_driver so the plugin can
indicate drivers that depends on experimental to be enabled.
---
 src/adapter.c | 6 ++++++
 src/adapter.h | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/src/adapter.c b/src/adapter.c
index cc7f891d96d9..74ed52468b81 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -7447,6 +7447,12 @@ static void adapter_stop(struct btd_adapter *adapter)
 
 int btd_register_adapter_driver(struct btd_adapter_driver *driver)
 {
+	if (driver->experimental && !(g_dbus_get_flags() &
+					G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) {
+		DBG("D-Bus experimental not enabled");
+		return -ENOTSUP;
+	}
+
 	adapter_drivers = g_slist_append(adapter_drivers, driver);
 
 	if (driver->probe == NULL)
diff --git a/src/adapter.h b/src/adapter.h
index a45ac1bab00e..32e49a933b13 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -127,6 +127,11 @@ struct btd_adapter_driver {
 						struct btd_device *device);
 	void (*device_resolved)(struct btd_adapter *adapter,
 						struct btd_device *device);
+
+	/* Indicates the driver is experimental and shall only be registered
+	 * when experimental has been enabled (see: main.conf:Experimental).
+	 */
+	bool experimental;
 };
 
 void device_resolved_drivers(struct btd_adapter *adapter,
-- 
2.40.1




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux