mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-04 16:25:34 +00:00

This make use of hci_cmd_sync_queue for the following MGMT commands: Set Device Class Set Device ID Add UUID Remove UUID tools/mgmt-tester -s "Set Device Class" Test Summary ------------ Set Device Class - Success 1 Passed Set Device Class - Success 2 Passed Set Device Class - Invalid parameters 1 Passed Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 0.0599 seconds tools/mgmt-tester -s "Set Device ID" Test Summary ------------ Set Device ID - Success 1 Passed Set Device ID - Success 2 Passed Set Device ID - Disable Passed Set Device ID - Power off and Power on Passed Set Device ID - SSP off and Power on Passed Set Device ID - Invalid Parameter Passed Total: 6, Passed: 6 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 0.107 seconds tools/mgmt-tester -s "Add UUID" Test Summary ------------ Add UUID - UUID-16 1 Passed Add UUID - UUID-16 multiple 1 Passed Add UUID - UUID-16 partial 1 Passed Add UUID - UUID-32 1 Passed Add UUID - UUID-32 multiple 1 Passed Add UUID - UUID-32 partial 1 Passed Add UUID - UUID-128 1 Passed Add UUID - UUID-128 multiple 1 Passed Add UUID - UUID-128 partial 1 Passed Add UUID - UUID mix Passed Total: 10, Passed: 10 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 0.198 seconds tools/mgmt-tester -s "Remove UUID" Test Summary ------------ Remove UUID - Success 1 Passed Remove UUID - All UUID - Success 2 Passed Remove UUID - Power Off - Success 3 Passed Remove UUID - Power Off and On - Success 4 Passed Remove UUID - Not Exist - Invalid Params 1 Passed Total: 5, Passed: 5 (100.0%), Failed: 0, Not Run: 0 Overall execution time: 0.0908 seconds Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
45 lines
1.7 KiB
C
45 lines
1.7 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* BlueZ - Bluetooth protocol stack for Linux
|
|
*
|
|
* Copyright (C) 2021 Intel Corporation
|
|
*/
|
|
|
|
typedef int (*hci_cmd_sync_work_func_t)(struct hci_dev *hdev, void *data);
|
|
typedef void (*hci_cmd_sync_work_destroy_t)(struct hci_dev *hdev, void *data,
|
|
int err);
|
|
|
|
struct hci_cmd_sync_work_entry {
|
|
struct list_head list;
|
|
hci_cmd_sync_work_func_t func;
|
|
void *data;
|
|
hci_cmd_sync_work_destroy_t destroy;
|
|
};
|
|
|
|
/* Function with sync suffix shall not be called with hdev->lock held as they
|
|
* wait the command to complete and in the meantime an event could be received
|
|
* which could attempt to acquire hdev->lock causing a deadlock.
|
|
*/
|
|
struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
|
|
const void *param, u32 timeout);
|
|
struct sk_buff *hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
|
|
const void *param, u32 timeout);
|
|
struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen,
|
|
const void *param, u8 event, u32 timeout);
|
|
struct sk_buff *__hci_cmd_sync_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
|
|
const void *param, u8 event, u32 timeout,
|
|
struct sock *sk);
|
|
int __hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen,
|
|
const void *param, u32 timeout);
|
|
int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
|
|
const void *param, u8 event, u32 timeout,
|
|
struct sock *sk);
|
|
|
|
void hci_cmd_sync_init(struct hci_dev *hdev);
|
|
void hci_cmd_sync_clear(struct hci_dev *hdev);
|
|
|
|
int hci_cmd_sync_queue(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
|
|
void *data, hci_cmd_sync_work_destroy_t destroy);
|
|
|
|
int hci_update_eir_sync(struct hci_dev *hdev);
|
|
int hci_update_class_sync(struct hci_dev *hdev);
|