public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1] adapter: Add btd_adapter_send_cmd_event_sync
@ 2026-02-09 16:34 Luiz Augusto von Dentz
  2026-02-09 18:48 ` [BlueZ,v1] " bluez.test.bot
  2026-02-10 18:00 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2026-02-09 16:34 UTC (permalink / raw)
  To: linux-bluetooth

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

This adds btd_adapter_send_cmd_event_sync which acts as a function
helper to generate MGMT_OP_HCI_CMD_SYNC.
---
 src/adapter.c | 28 ++++++++++++++++++++++++++++
 src/adapter.h | 13 +++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/src/adapter.c b/src/adapter.c
index fb95e8553895..6aa7c0ed0df4 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -11022,3 +11022,31 @@ void btd_adapter_cancel_service_auth(struct btd_adapter *adapter,
 		service_auth_cancel(auth);
 	}
 }
+
+unsigned int btd_adapter_send_cmd_event_sync(struct btd_adapter *adapter,
+					uint16_t opcode,
+					uint16_t length, const void *param,
+					uint8_t event,
+					btd_adapter_reply_event_t callback,
+					void *user_data,
+					btd_adapter_destroy_func_t destroy,
+					uint8_t timeout)
+{
+	struct {
+		struct mgmt_cp_hci_cmd_sync cp;
+		uint8_t data[UINT8_MAX];
+	} pkt;
+
+	memset(&pkt, 0, sizeof(pkt));
+	pkt.cp.opcode = cpu_to_le16(opcode);
+	pkt.cp.event = event;
+	pkt.cp.timeout = timeout;
+	pkt.cp.params_len = cpu_to_le16(length);
+
+	if (length)
+		memcpy(pkt.data, param, length);
+
+	return mgmt_send(adapter->mgmt, MGMT_OP_HCI_CMD_SYNC,
+				adapter->dev_id, sizeof(pkt.cp) + length,
+				&pkt, callback, user_data, destroy);
+}
diff --git a/src/adapter.h b/src/adapter.h
index cdcee69385cb..7a7e5c8f9dfd 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -302,3 +302,16 @@ void btd_adapter_store_conn_param(struct btd_adapter *adapter,
 				uint16_t latency, uint16_t timeout);
 void btd_adapter_cancel_service_auth(struct btd_adapter *adapter,
 				struct btd_device *device);
+
+typedef void (*btd_adapter_reply_event_t)(uint8_t status, uint16_t length,
+					const void *param, void *user_data);
+typedef void (*btd_adapter_destroy_func_t)(void *user_data);
+
+unsigned int btd_adapter_send_cmd_event_sync(struct btd_adapter *adapter,
+					uint16_t opcode,
+					uint16_t length, const void *param,
+					uint8_t event,
+					btd_adapter_reply_event_t callback,
+					void *user_data,
+					btd_adapter_destroy_func_t destroy,
+					uint8_t timeout);
-- 
2.52.0


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

* RE: [BlueZ,v1] adapter: Add btd_adapter_send_cmd_event_sync
  2026-02-09 16:34 [PATCH BlueZ v1] adapter: Add btd_adapter_send_cmd_event_sync Luiz Augusto von Dentz
@ 2026-02-09 18:48 ` bluez.test.bot
  2026-02-10 18:00 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-02-09 18:48 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 1261 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=1052360

---Test result---

Test Summary:
CheckPatch                    PENDING   0.37 seconds
GitLint                       PENDING   0.42 seconds
BuildEll                      PASS      19.89 seconds
BluezMake                     PASS      639.08 seconds
MakeCheck                     PASS      18.75 seconds
MakeDistcheck                 PASS      240.42 seconds
CheckValgrind                 PASS      289.97 seconds
CheckSmatch                   PASS      347.61 seconds
bluezmakeextell               PASS      180.75 seconds
IncrementalBuild              PENDING   0.48 seconds
ScanBuild                     PASS      995.05 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ v1] adapter: Add btd_adapter_send_cmd_event_sync
  2026-02-09 16:34 [PATCH BlueZ v1] adapter: Add btd_adapter_send_cmd_event_sync Luiz Augusto von Dentz
  2026-02-09 18:48 ` [BlueZ,v1] " bluez.test.bot
@ 2026-02-10 18:00 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2026-02-10 18:00 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon,  9 Feb 2026 11:34:20 -0500 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This adds btd_adapter_send_cmd_event_sync which acts as a function
> helper to generate MGMT_OP_HCI_CMD_SYNC.
> ---
>  src/adapter.c | 28 ++++++++++++++++++++++++++++
>  src/adapter.h | 13 +++++++++++++
>  2 files changed, 41 insertions(+)

Here is the summary with links:
  - [BlueZ,v1] adapter: Add btd_adapter_send_cmd_event_sync
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ecf4448a5811

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2026-02-10 18:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-09 16:34 [PATCH BlueZ v1] adapter: Add btd_adapter_send_cmd_event_sync Luiz Augusto von Dentz
2026-02-09 18:48 ` [BlueZ,v1] " bluez.test.bot
2026-02-10 18:00 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox