diff mbox series

[BlueZ,2/3] vhci: Add function to interact with force_static_address

Message ID 20221008011410.1907549-2-luiz.dentz@gmail.com
State Superseded
Headers show
Series [BlueZ,1/3] btdev: Add support for setting bdaddr | expand

Commit Message

Luiz Augusto von Dentz Oct. 8, 2022, 1:14 a.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This adds functions that can be used to set debugfs
force_static_address.
---
 emulator/vhci.c | 10 ++++++++++
 emulator/vhci.h |  1 +
 2 files changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/emulator/vhci.c b/emulator/vhci.c
index 4295e30ef980..a12b11e0f305 100644
--- a/emulator/vhci.c
+++ b/emulator/vhci.c
@@ -257,3 +257,13 @@  int vhci_set_emu_opcode(struct vhci *vhci, uint16_t opcode)
 {
 	return btdev_set_emu_opcode(vhci->btdev, opcode);
 }
+
+int vhci_set_force_static_address(struct vhci *vhci, bool enable)
+{
+	char val;
+
+	val = (enable) ? 'Y' : 'N';
+
+	return vhci_debugfs_write(vhci, "force_static_address", &val,
+							sizeof(val));
+}
diff --git a/emulator/vhci.h b/emulator/vhci.h
index c42e8bde1cd5..6da56cb589fe 100644
--- a/emulator/vhci.h
+++ b/emulator/vhci.h
@@ -28,3 +28,4 @@  int vhci_set_force_wakeup(struct vhci *vhci, bool enable);
 int vhci_set_msft_opcode(struct vhci *vhci, uint16_t opcode);
 int vhci_set_aosp_capable(struct vhci *vhci, bool enable);
 int vhci_set_emu_opcode(struct vhci *vhci, uint16_t opcode);
+int vhci_set_force_static_address(struct vhci *vhci, bool enable);