linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] adapter: add support for setting NO_ERRQUEUE_POLL experimental feature
@ 2024-04-02 16:44 Pauli Virtanen
  2024-04-02 18:42 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Pauli Virtanen @ 2024-04-02 16:44 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

Add support for setting No Errqueue Poll experimental UUID which enables
the use of the BT_NO_ERRQUEUE_POLL socket option.
---
 src/adapter.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 src/adapter.h |  1 +
 src/main.c    |  1 +
 src/main.conf |  1 +
 4 files changed, 50 insertions(+)

diff --git a/src/adapter.c b/src/adapter.c
index 4bcc464de..2bd6e57a8 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -148,6 +148,13 @@ static const struct mgmt_exp_uuid iso_socket_uuid = {
 	.str = "6fbaf188-05e0-496a-9885-d6ddfdb4e03e"
 };
 
+/* 69518c4c-b69f-4679-8bc1-c021b47b5733 */
+static const struct mgmt_exp_uuid no_errqueue_poll_uuid = {
+	.val = { 0x33, 0x57, 0x7b, 0xb4, 0x21, 0xc0, 0xc1, 0x8b,
+		0x79, 0x46, 0x9f, 0xb6, 0x4c, 0x8c, 0x51, 0x69 },
+	.str = "69518c4c-b69f-4679-8bc1-c021b47b5733"
+};
+
 static DBusConnection *dbus_conn = NULL;
 
 static uint32_t kernel_features = 0;
@@ -10027,6 +10034,44 @@ static void iso_socket_func(struct btd_adapter *adapter, uint8_t action)
 	btd_error(adapter->dev_id, "Failed to set ISO Socket");
 }
 
+static void no_errqueue_poll_complete(uint8_t status, uint16_t len,
+				const void *param, void *user_data)
+{
+	struct exp_pending *pending = user_data;
+	struct btd_adapter *adapter = pending->adapter;
+	uint8_t action;
+
+	if (status != 0) {
+		error("Set No Errqueue Poll failed with status 0x%02x (%s)",
+						status, mgmt_errstr(status));
+		return;
+	}
+
+	action = btd_kernel_experimental_enabled(no_errqueue_poll_uuid.str);
+
+	DBG("No Errqueue Poll successfully %s", action ? "set" : "reset");
+
+	if (action)
+		queue_push_tail(adapter->exps,
+					(void *)no_errqueue_poll_uuid.val);
+}
+
+static void no_errqueue_poll_func(struct btd_adapter *adapter, uint8_t action)
+{
+	struct mgmt_cp_set_exp_feature cp;
+
+	memset(&cp, 0, sizeof(cp));
+	memcpy(cp.uuid, no_errqueue_poll_uuid.val, 16);
+	cp.action = action;
+
+	if (exp_mgmt_send(adapter, MGMT_OP_SET_EXP_FEATURE,
+			MGMT_INDEX_NONE, sizeof(cp), &cp,
+			no_errqueue_poll_complete))
+		return;
+
+	btd_error(adapter->dev_id, "Failed to set No Errqueue Poll");
+}
+
 static const struct exp_feat {
 	uint32_t flag;
 	const struct mgmt_exp_uuid *uuid;
@@ -10041,6 +10086,8 @@ static const struct exp_feat {
 	EXP_FEAT(EXP_FEAT_CODEC_OFFLOAD, &codec_offload_uuid,
 		codec_offload_func),
 	EXP_FEAT(EXP_FEAT_ISO_SOCKET, &iso_socket_uuid, iso_socket_func),
+	EXP_FEAT(EXP_FEAT_NO_ERRQUEUE_POLL, &no_errqueue_poll_uuid,
+							no_errqueue_poll_func),
 };
 
 static void read_exp_features_complete(uint8_t status, uint16_t length,
diff --git a/src/adapter.h b/src/adapter.h
index ca96c1f65..738b62976 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -268,6 +268,7 @@ enum experimental_features {
 	EXP_FEAT_RPA_RESOLUTION		= 1 << 3,
 	EXP_FEAT_CODEC_OFFLOAD		= 1 << 4,
 	EXP_FEAT_ISO_SOCKET		= 1 << 5,
+	EXP_FEAT_NO_ERRQUEUE_POLL	= 1 << 6,
 };
 
 bool btd_adapter_has_exp_feature(struct btd_adapter *adapter, uint32_t feature);
diff --git a/src/main.c b/src/main.c
index f774670e4..78831ad02 100644
--- a/src/main.c
+++ b/src/main.c
@@ -707,6 +707,7 @@ static const char *valid_uuids[] = {
 	"330859bc-7506-492d-9370-9a6f0614037f",
 	"a6695ace-ee7f-4fb9-881a-5fac66c629af",
 	"6fbaf188-05e0-496a-9885-d6ddfdb4e03e",
+	"69518c4c-b69f-4679-8bc1-c021b47b5733",
 	"*"
 };
 
diff --git a/src/main.conf b/src/main.conf
index 815f1c0f8..7708e4dda 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -136,6 +136,7 @@
 # 330859bc-7506-492d-9370-9a6f0614037f (BlueZ Experimental Bluetooth Quality Report)
 # a6695ace-ee7f-4fb9-881a-5fac66c629af (BlueZ Experimental Offload Codecs)
 # 6fbaf188-05e0-496a-9885-d6ddfdb4e03e (BlueZ Experimental ISO socket)
+# 69518c4c-b69f-4679-8bc1-c021b47b5733 (BlueZ Experimental No Errqueue Poll)
 # Defaults to false.
 #KernelExperimental = false
 
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [BlueZ] adapter: add support for setting NO_ERRQUEUE_POLL experimental feature
  2024-04-02 16:44 [PATCH BlueZ] adapter: add support for setting NO_ERRQUEUE_POLL experimental feature Pauli Virtanen
@ 2024-04-02 18:42 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2024-04-02 18:42 UTC (permalink / raw)
  To: linux-bluetooth, pav

[-- Attachment #1: Type: text/plain, Size: 948 bytes --]

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=840719

---Test result---

Test Summary:
CheckPatch                    PASS      0.33 seconds
GitLint                       PASS      0.21 seconds
BuildEll                      PASS      24.60 seconds
BluezMake                     PASS      1717.15 seconds
MakeCheck                     PASS      13.41 seconds
MakeDistcheck                 PASS      176.85 seconds
CheckValgrind                 PASS      249.19 seconds
CheckSmatch                   PASS      357.01 seconds
bluezmakeextell               PASS      121.03 seconds
IncrementalBuild              PASS      1588.00 seconds
ScanBuild                     PASS      993.03 seconds



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-02 18:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-02 16:44 [PATCH BlueZ] adapter: add support for setting NO_ERRQUEUE_POLL experimental feature Pauli Virtanen
2024-04-02 18:42 ` [BlueZ] " bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).