All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] emulator: bthost: add function for sending raw L2CAP sig commands
@ 2026-08-30 17:11 Pauli Virtanen
  2026-08-30 17:11 ` [PATCH BlueZ 2/2] tools/l2cap-server: add test for invalid Conn Req on Ext-Flowctl server Pauli Virtanen
  2026-08-30 19:09 ` [BlueZ,1/2] emulator: bthost: add function for sending raw L2CAP sig commands bluez.test.bot
  0 siblings, 2 replies; 3+ messages in thread
From: Pauli Virtanen @ 2026-08-30 17:11 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Pauli Virtanen

Add bthost_l2cap_sig_raw() that tests can use to send raw L2CAP
signaling commands.
---
 emulator/bthost.c | 13 +++++++++++++
 emulator/bthost.h |  4 ++++
 2 files changed, 17 insertions(+)

diff --git a/emulator/bthost.c b/emulator/bthost.c
index 46c6a52f5..b3d48ffb3 100644
--- a/emulator/bthost.c
+++ b/emulator/bthost.c
@@ -811,6 +811,19 @@ static uint8_t l2cap_sig_send(struct bthost *bthost, struct btconn *conn,
 	return ident;
 }
 
+uint8_t bthost_l2cap_sig_raw(struct bthost *bthost, uint16_t handle,
+					uint8_t code, uint8_t ident,
+					const void *data, uint16_t len)
+{
+	struct btconn *conn;
+
+	conn = bthost_find_conn(bthost, handle);
+	if (!conn)
+		return 0;
+
+	return l2cap_sig_send(bthost, conn, code, ident, data, len);
+}
+
 void bthost_add_cid_hook(struct bthost *bthost, uint16_t handle, uint16_t cid,
 				bthost_cid_hook_func_t func, void *user_data)
 {
diff --git a/emulator/bthost.h b/emulator/bthost.h
index e104e68af..ed924eb99 100644
--- a/emulator/bthost.h
+++ b/emulator/bthost.h
@@ -126,6 +126,10 @@ bool bthost_l2cap_req(struct bthost *bthost, uint16_t handle, uint8_t req,
 				const void *data, uint16_t len,
 				bthost_l2cap_rsp_cb cb, void *user_data);
 
+uint8_t bthost_l2cap_sig_raw(struct bthost *bthost, uint16_t handle,
+						uint8_t req, uint8_t ident,
+						const void *data, uint16_t len);
+
 void bthost_write_scan_enable(struct bthost *bthost, uint8_t scan);
 
 void bthost_set_adv_data(struct bthost *bthost, const uint8_t *data,
-- 
2.55.0


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

end of thread, other threads:[~2026-08-30 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-30 17:11 [PATCH BlueZ 1/2] emulator: bthost: add function for sending raw L2CAP sig commands Pauli Virtanen
2026-08-30 17:11 ` [PATCH BlueZ 2/2] tools/l2cap-server: add test for invalid Conn Req on Ext-Flowctl server Pauli Virtanen
2026-08-30 19:09 ` [BlueZ,1/2] emulator: bthost: add function for sending raw L2CAP sig commands bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.