[PATCH 09/13] Bluetooth: hci_sync: Add __hci_reset_sync() for device driver
From: Zijun Hu
Date: Mon Jun 22 2026 - 10:59:07 EST
Many vendor drivers have requirements to send a raw HCI reset
synchronously with HCI_INIT_TIMEOUT.
Add a dedicated API for them to use.
Signed-off-by: Zijun Hu <zijun.hu@xxxxxxxxxxxxxxxx>
---
include/net/bluetooth/hci_sync.h | 1 +
net/bluetooth/hci_sync.c | 14 ++++++++++++++
2 files changed, 15 insertions(+)
diff --git a/include/net/bluetooth/hci_sync.h b/include/net/bluetooth/hci_sync.h
index 73e494b2591d..7005fc9f257a 100644
--- a/include/net/bluetooth/hci_sync.h
+++ b/include/net/bluetooth/hci_sync.h
@@ -59,6 +59,7 @@ int __hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen,
int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
const void *param, u8 event, u32 timeout,
struct sock *sk);
+int __hci_reset_sync(struct hci_dev *hdev);
int hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen,
const void *param, u32 timeout);
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 601d44ef975f..40c9725585cb 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -3684,6 +3684,20 @@ int hci_reset_sync(struct hci_dev *hdev)
return -bt_to_errno(err);
}
+/* Send a raw HCI reset for use by vendor drivers */
+int __hci_reset_sync(struct hci_dev *hdev)
+{
+ int err;
+
+ err = __hci_cmd_sync_status(hdev, HCI_OP_RESET, 0, NULL,
+ HCI_INIT_TIMEOUT);
+ if (err < 0)
+ return err;
+
+ return -bt_to_errno(err);
+}
+EXPORT_SYMBOL(__hci_reset_sync);
+
static int hci_init0_sync(struct hci_dev *hdev)
{
int err;
--
2.34.1