Bluetooth: MGMT: Add initial implementation of MGMT_OP_HCI_CMD_SYNC
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 23 Oct 2024 20:55:57 +0000 (16:55 -0400)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thu, 14 Nov 2024 20:41:31 +0000 (15:41 -0500)
commit827af4787e74e8df9e8e0677a69fbb15e0856d2f
treea0227c3aac88d98ba6af9db04824c6fdbb7fe4ca
parent27aabf27fd014ae037cc179c61b0bee7cff55b3d
Bluetooth: MGMT: Add initial implementation of MGMT_OP_HCI_CMD_SYNC

This adds the initial implementation of MGMT_OP_HCI_CMD_SYNC as
documented in mgmt-api (BlueZ tree):

Send HCI command and wait for event Command
===========================================

Command Code: 0x005B
Controller Index: <controller id>
Command Parameters: Opcode (2 Octets)
Event (1 Octet)
Timeout (1 Octet)
Parameter Length (2 Octets)
Parameter (variable)
Return Parameters: Response (1-variable Octets)

This command may be used to send a HCI command and wait for an
(optional) event.

The HCI command is specified by the Opcode, any arbitrary is supported
including vendor commands, but contrary to the like of
Raw/User channel it is run as an HCI command send by the kernel
since it uses its command synchronization thus it is possible to wait
for a specific event as a response.

Setting event to 0x00 will cause the command to wait for either
HCI Command Status or HCI Command Complete.

Timeout is specified in seconds, setting it to 0 will cause the
default timeout to be used.

Possible errors: Failed
Invalid Parameters

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
include/net/bluetooth/mgmt.h
net/bluetooth/mgmt.c