From: Luiz Augusto von Dentz <[email protected]>
This adds experimental field to btd_profile so the plugin can indicate
drivers that depends on experimental to be enabled.
---
src/profile.c | 6 ++++++
src/profile.h | 5 +++++
2 files changed, 11 insertions(+)
diff --git a/src/profile.c b/src/profile.c
index e1bebf1ee19c..ea188f36b6dd 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -775,6 +775,12 @@ static struct btd_profile *btd_profile_find_uuid(const char *uuid)
int btd_profile_register(struct btd_profile *profile)
{
+ if (profile->experimental && !(g_dbus_get_flags() &
+ G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) {
+ DBG("D-Bus experimental not enabled");
+ return -ENOTSUP;
+ }
+
profiles = g_slist_append(profiles, profile);
return 0;
}
diff --git a/src/profile.h b/src/profile.h
index 6827f848148c..6871f2f0d7d8 100644
--- a/src/profile.h
+++ b/src/profile.h
@@ -28,6 +28,11 @@ struct btd_profile {
*/
bool external;
+ /* Indicates the profile is experimental and shall only be registered
+ * when experimental has been enabled (see: main.conf:Experimental).
+ */
+ bool experimental;
+
int (*device_probe) (struct btd_service *service);
void (*device_remove) (struct btd_service *service);
--
2.40.1
From: Luiz Augusto von Dentz <[email protected]>
This uses the btd_profile.experimental to mark the driver as
experimental.
---
profiles/audio/bass.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/profiles/audio/bass.c b/profiles/audio/bass.c
index a7fcc9718d56..fae7fe00412a 100644
--- a/profiles/audio/bass.c
+++ b/profiles/audio/bass.c
@@ -276,18 +276,19 @@ static struct btd_profile bass_service = {
.device_remove = bass_remove,
.accept = bass_accept,
.disconnect = bass_disconnect,
+ .experimental = true,
};
static unsigned int bass_id;
static int bass_init(void)
{
- if (!(g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) {
- warn("D-Bus experimental not enabled");
- return -ENOTSUP;
- }
+ int err;
+
+ err = btd_profile_register(&bass_service);
+ if (err)
+ return err;
- btd_profile_register(&bass_service);
bass_id = bt_bass_register(bass_attached, bass_detached, NULL);
return 0;
@@ -295,10 +296,8 @@ static int bass_init(void)
static void bass_exit(void)
{
- if (g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL) {
- btd_profile_unregister(&bass_service);
- bt_bass_unregister(bass_id);
- }
+ btd_profile_unregister(&bass_service);
+ bt_bass_unregister(bass_id);
}
BLUETOOTH_PLUGIN_DEFINE(bass, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
--
2.40.1
From: Luiz Augusto von Dentz <[email protected]>
This uses the btd_profile.experimental to mark the driver as
experimental.
---
profiles/audio/bap.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/profiles/audio/bap.c b/profiles/audio/bap.c
index 8f12fc410f67..1a543a9ce99b 100644
--- a/profiles/audio/bap.c
+++ b/profiles/audio/bap.c
@@ -1354,18 +1354,19 @@ static struct btd_profile bap_profile = {
.accept = bap_accept,
.disconnect = bap_disconnect,
.auto_connect = true,
+ .experimental = true,
};
static unsigned int bap_id = 0;
static int bap_init(void)
{
- if (!(g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) {
- warn("D-Bus experimental not enabled");
- return -ENOTSUP;
- }
+ int err;
+
+ err = btd_profile_register(&bap_profile);
+ if (err)
+ return err;
- btd_profile_register(&bap_profile);
bap_id = bt_bap_register(bap_attached, bap_detached, NULL);
return 0;
@@ -1373,10 +1374,8 @@ static int bap_init(void)
static void bap_exit(void)
{
- if (g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL) {
- btd_profile_unregister(&bap_profile);
- bt_bap_unregister(bap_id);
- }
+ btd_profile_unregister(&bap_profile);
+ bt_bap_unregister(bap_id);
}
BLUETOOTH_PLUGIN_DEFINE(bap, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
--
2.40.1
From: Luiz Augusto von Dentz <[email protected]>
This uses the btd_profile.experimental to mark the driver as
experimental.
---
profiles/audio/mcp.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
diff --git a/profiles/audio/mcp.c b/profiles/audio/mcp.c
index f3ea330f9839..b410b3d2aa03 100644
--- a/profiles/audio/mcp.c
+++ b/profiles/audio/mcp.c
@@ -403,27 +403,18 @@ static struct btd_profile mcp_profile = {
.adapter_probe = media_control_server_probe,
.adapter_remove = media_control_server_remove,
+
+ .experimental = true,
};
static int mcp_init(void)
{
- DBG("");
-
- if (!(g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) {
- warn("D-Bus experimental not enabled");
- return -ENOTSUP;
- }
-
- btd_profile_register(&mcp_profile);
- return 0;
+ return btd_profile_register(&mcp_profile);
}
static void mcp_exit(void)
{
- DBG("");
-
- if (g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL)
- btd_profile_unregister(&mcp_profile);
+ btd_profile_unregister(&mcp_profile);
}
BLUETOOTH_PLUGIN_DEFINE(mcp, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
--
2.40.1
From: Luiz Augusto von Dentz <[email protected]>
If plugin .init returns -ENOTSUP treat it as the system doesn't
support the driver since that is the error returned by
btd_profile_register when experimental is disabled.
---
src/plugin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/plugin.c b/src/plugin.c
index dd7b406c857b..80990f8c3c7e 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -186,7 +186,7 @@ start:
err = plugin->desc->init();
if (err < 0) {
- if (err == -ENOSYS)
+ if (err == -ENOSYS || err == -ENOTSUP)
warn("System does not support %s plugin",
plugin->desc->name);
else
--
2.40.1
From: Luiz Augusto von Dentz <[email protected]>
This uses the btd_profile.experimental to mark the driver as
experimental.
---
profiles/audio/vcp.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/profiles/audio/vcp.c b/profiles/audio/vcp.c
index b42b0a4f79dd..175275f2e977 100644
--- a/profiles/audio/vcp.c
+++ b/profiles/audio/vcp.c
@@ -289,18 +289,20 @@ static struct btd_profile vcp_profile = {
.adapter_probe = vcp_server_probe,
.adapter_remove = vcp_server_remove,
+
+ .experimental = true,
};
static unsigned int vcp_id = 0;
static int vcp_init(void)
{
- if (!(g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL)) {
- warn("D-Bus experimental not enabled");
- return -ENOTSUP;
- }
+ int err;
+
+ err = btd_profile_register(&vcp_profile);
+ if (err)
+ return err;
- btd_profile_register(&vcp_profile);
vcp_id = bt_vcp_register(vcp_attached, vcp_detached, NULL);
return 0;
@@ -308,10 +310,8 @@ static int vcp_init(void)
static void vcp_exit(void)
{
- if (g_dbus_get_flags() & G_DBUS_FLAG_ENABLE_EXPERIMENTAL) {
- btd_profile_unregister(&vcp_profile);
- bt_vcp_unregister(vcp_id);
- }
+ btd_profile_unregister(&vcp_profile);
+ bt_vcp_unregister(vcp_id);
}
BLUETOOTH_PLUGIN_DEFINE(vcp, VERSION, BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
--
2.40.1
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=747773
---Test result---
Test Summary:
CheckPatch FAIL 3.79 seconds
GitLint PASS 2.45 seconds
BuildEll PASS 26.23 seconds
BluezMake PASS 753.81 seconds
MakeCheck PASS 12.07 seconds
MakeDistcheck PASS 153.12 seconds
CheckValgrind PASS 245.43 seconds
CheckSmatch PASS 329.01 seconds
bluezmakeextell PASS 99.56 seconds
IncrementalBuild PASS 4446.45 seconds
ScanBuild PASS 975.65 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ,7/7] plugin: Treat -ENOTSUP as -ENOSYS
WARNING:ENOSYS: ENOSYS means 'invalid syscall nr' and nothing else
#101: FILE: src/plugin.c:189:
+ if (err == -ENOSYS || err == -ENOTSUP)
/github/workspace/src/src/13242265.patch total: 0 errors, 1 warnings, 8 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13242265.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
---
Regards,
Linux Bluetooth