2021-10-27 16:58:38 -07:00
|
|
|
/* 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);
|
Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 1
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>
2021-10-27 16:58:39 -07:00
|
|
|
|
|
|
|
int hci_update_eir_sync(struct hci_dev *hdev);
|
|
|
|
int hci_update_class_sync(struct hci_dev *hdev);
|
Bluetooth: hci_sync: Make use of hci_cmd_sync_queue set 2
This make use of hci_cmd_sync_queue for the following MGMT commands:
Add Advertising
Remove Advertising
Add Extended Advertising Parameters
Add Extended Advertising Data
mgmt-tester -s "Add Advertising"
Test Summary
------------
Add Advertising - Failure: LE off Passed
Add Advertising - Invalid Params 1 (AD too long) Passed
Add Advertising - Invalid Params 2 (Malformed len) Passed
Add Advertising - Invalid Params 3 (Malformed len) Passed
Add Advertising - Invalid Params 4 (Malformed len) Passed
Add Advertising - Invalid Params 5 (AD too long) Passed
Add Advertising - Invalid Params 6 (ScRsp too long) Passed
Add Advertising - Invalid Params 7 (Malformed len) Passed
Add Advertising - Invalid Params 8 (Malformed len) Passed
Add Advertising - Invalid Params 9 (Malformed len) Passed
Add Advertising - Invalid Params 10 (ScRsp too long) Passed
Add Advertising - Rejected (Timeout, !Powered) Passed
Add Advertising - Success 1 (Powered, Add Adv Inst) Passed
Add Advertising - Success 2 (!Powered, Add Adv Inst) Passed
Add Advertising - Success 3 (!Powered, Adv Enable) Passed
Add Advertising - Success 4 (Set Adv on override) Passed
Add Advertising - Success 5 (Set Adv off override) Passed
Add Advertising - Success 6 (Scan Rsp Dta, Adv ok) Passed
Add Advertising - Success 7 (Scan Rsp Dta, Scan ok) Passed
Add Advertising - Success 8 (Connectable Flag) Passed
Add Advertising - Success 9 (General Discov Flag) Passed
Add Advertising - Success 10 (Limited Discov Flag) Passed
Add Advertising - Success 11 (Managed Flags) Passed
Add Advertising - Success 12 (TX Power Flag) Passed
Add Advertising - Success 13 (ADV_SCAN_IND) Passed
Add Advertising - Success 14 (ADV_NONCONN_IND) Passed
Add Advertising - Success 15 (ADV_IND) Passed
Add Advertising - Success 16 (Connectable -> on) Passed
Add Advertising - Success 17 (Connectable -> off) Passed
Add Advertising - Success 18 (Power -> off, Remove) Passed
Add Advertising - Success 19 (Power -> off, Keep) Passed
Add Advertising - Success 20 (Add Adv override) Passed
Add Advertising - Success 21 (Timeout expires) Passed
Add Advertising - Success 22 (LE -> off, Remove) Passed
Add Advertising - Success (Empty ScRsp) Passed
Add Advertising - Success (ScRsp only) Passed
Add Advertising - Invalid Params (ScRsp too long) Passed
Add Advertising - Success (ScRsp appear) Passed
Add Advertising - Invalid Params (ScRsp appear long) Passed
Add Advertising - Success (Appear is null) Passed
Add Advertising - Success (Name is null) Passed
Add Advertising - Success (Complete name) Passed
Add Advertising - Success (Shortened name) Passed
Add Advertising - Success (Short name) Passed
Add Advertising - Success (Name + data) Passed
Add Advertising - Invalid Params (Name + data) Passed
Add Advertising - Success (Name+data+appear) Passed
Total: 47, Passed: 47 (100.0%), Failed: 0, Not Run: 0
Overall execution time: 2.17 seconds
mgmt-tester -s "Remove Advertising"
Test Summary
------------
Remove Advertising - Invalid Params 1 Passed
Remove Advertising - Success 1 Passed
Remove Advertising - Success 2 Passed
Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0
Overall execution time: 0.0585 seconds
mgmt-tester -s "Ext Adv MGMT Params"
Test Summary:
------------
Ext Adv MGMT Params - Unpowered Passed
Ext Adv MGMT Params - Invalid parameters Passed
Ext Adv MGMT Params - Success Passed
Ext Adv MGMT Params - (5.0) Success Passed
Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0
Overall execution time: 0.0746 seconds
mgmt-tester -s "Ext Adv MGMT -"
Test Summary
------------
Ext Adv MGMT - Data set without Params Passed
Ext Adv MGMT - AD Data (5.0) Invalid parameters Passed
Ext Adv MGMT - AD Data (5.0) Success Passed
Ext Adv MGMT - AD Scan Response (5.0) Success Passed
Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0
Overall execution time: 0.0805 seconds
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
2021-10-27 16:58:40 -07:00
|
|
|
|
|
|
|
int hci_update_eir_sync(struct hci_dev *hdev);
|
|
|
|
int hci_update_class_sync(struct hci_dev *hdev);
|
|
|
|
|
|
|
|
int hci_update_random_address_sync(struct hci_dev *hdev, bool require_privacy,
|
|
|
|
bool rpa, u8 *own_addr_type);
|
|
|
|
|
|
|
|
int hci_update_scan_rsp_data_sync(struct hci_dev *hdev, u8 instance);
|
|
|
|
int hci_update_adv_data_sync(struct hci_dev *hdev, u8 instance);
|
|
|
|
int hci_schedule_adv_instance_sync(struct hci_dev *hdev, u8 instance,
|
|
|
|
bool force);
|
|
|
|
|
|
|
|
int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance);
|
|
|
|
int hci_start_ext_adv_sync(struct hci_dev *hdev, u8 instance);
|
|
|
|
int hci_enable_ext_advertising_sync(struct hci_dev *hdev, u8 instance);
|
|
|
|
int hci_enable_advertising_sync(struct hci_dev *hdev);
|
|
|
|
|
|
|
|
int hci_remove_advertising_sync(struct hci_dev *hdev, struct sock *sk,
|
|
|
|
u8 instance, bool force);
|
|
|
|
int hci_disable_advertising_sync(struct hci_dev *hdev);
|
2021-10-27 16:58:41 -07:00
|
|
|
|
|
|
|
int hci_update_passive_scan_sync(struct hci_dev *hdev);
|
2021-10-27 16:58:42 -07:00
|
|
|
int hci_update_passive_scan(struct hci_dev *hdev);
|