Merge tag 'devicetree-fixes-for-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-block.git] / include / net / bluetooth / hci_sync.h
CommitLineData
6a98e383
MH
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * BlueZ - Bluetooth protocol stack for Linux
4 *
5 * Copyright (C) 2021 Intel Corporation
6 */
7
8typedef int (*hci_cmd_sync_work_func_t)(struct hci_dev *hdev, void *data);
9typedef void (*hci_cmd_sync_work_destroy_t)(struct hci_dev *hdev, void *data,
10 int err);
11
12struct hci_cmd_sync_work_entry {
13 struct list_head list;
14 hci_cmd_sync_work_func_t func;
15 void *data;
16 hci_cmd_sync_work_destroy_t destroy;
17};
18
19/* Function with sync suffix shall not be called with hdev->lock held as they
20 * wait the command to complete and in the meantime an event could be received
21 * which could attempt to acquire hdev->lock causing a deadlock.
22 */
23struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
24 const void *param, u32 timeout);
25struct sk_buff *hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
26 const void *param, u32 timeout);
27struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen,
28 const void *param, u8 event, u32 timeout);
29struct sk_buff *__hci_cmd_sync_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
30 const void *param, u8 event, u32 timeout,
31 struct sock *sk);
32int __hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen,
33 const void *param, u32 timeout);
34int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
35 const void *param, u8 event, u32 timeout,
36 struct sock *sk);
37
38void hci_cmd_sync_init(struct hci_dev *hdev);
39void hci_cmd_sync_clear(struct hci_dev *hdev);
914b08b3 40void hci_cmd_sync_cancel(struct hci_dev *hdev, int err);
744451c1 41void __hci_cmd_sync_cancel(struct hci_dev *hdev, int err);
6a98e383
MH
42
43int hci_cmd_sync_queue(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
44 void *data, hci_cmd_sync_work_destroy_t destroy);
161510cc
LAD
45
46int hci_update_eir_sync(struct hci_dev *hdev);
47int hci_update_class_sync(struct hci_dev *hdev);
cba6b758
LAD
48
49int hci_update_eir_sync(struct hci_dev *hdev);
50int hci_update_class_sync(struct hci_dev *hdev);
6f6ff38a 51int hci_update_name_sync(struct hci_dev *hdev);
3244845c 52int hci_write_ssp_mode_sync(struct hci_dev *hdev, u8 mode);
cba6b758
LAD
53
54int hci_update_random_address_sync(struct hci_dev *hdev, bool require_privacy,
55 bool rpa, u8 *own_addr_type);
56
57int hci_update_scan_rsp_data_sync(struct hci_dev *hdev, u8 instance);
58int hci_update_adv_data_sync(struct hci_dev *hdev, u8 instance);
59int hci_schedule_adv_instance_sync(struct hci_dev *hdev, u8 instance,
60 bool force);
61
62int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance);
63int hci_start_ext_adv_sync(struct hci_dev *hdev, u8 instance);
64int hci_enable_ext_advertising_sync(struct hci_dev *hdev, u8 instance);
65int hci_enable_advertising_sync(struct hci_dev *hdev);
abfeea47 66int hci_enable_advertising(struct hci_dev *hdev);
cba6b758
LAD
67
68int hci_remove_advertising_sync(struct hci_dev *hdev, struct sock *sk,
69 u8 instance, bool force);
70int hci_disable_advertising_sync(struct hci_dev *hdev);
e8907f76
LAD
71
72int hci_update_passive_scan_sync(struct hci_dev *hdev);
ad383c2c 73int hci_update_passive_scan(struct hci_dev *hdev);
47db6b42
BG
74int hci_read_rssi_sync(struct hci_dev *hdev, __le16 handle);
75int hci_read_tx_power_sync(struct hci_dev *hdev, __le16 handle, u8 type);
2f2eb0c9 76int hci_write_sc_support_sync(struct hci_dev *hdev, u8 val);
5a750137 77int hci_read_clock_sync(struct hci_dev *hdev, struct hci_cp_read_clock *cp);
cf75ad8b 78
353a0249 79int hci_write_fast_connectable_sync(struct hci_dev *hdev, bool enable);
451d95a9 80int hci_update_scan_sync(struct hci_dev *hdev);
353a0249 81
d81a494c
BG
82int hci_write_le_host_supported_sync(struct hci_dev *hdev, u8 le, u8 simul);
83int hci_remove_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance,
84 struct sock *sk);
f892244b
BG
85struct sk_buff *hci_read_local_oob_data_sync(struct hci_dev *hdev, bool ext,
86 struct sock *sk);
d81a494c 87
d0b13706 88int hci_reset_sync(struct hci_dev *hdev);
cf75ad8b
LAD
89int hci_dev_open_sync(struct hci_dev *hdev);
90int hci_dev_close_sync(struct hci_dev *hdev);
91
92int hci_powered_update_sync(struct hci_dev *hdev);
93int hci_set_powered_sync(struct hci_dev *hdev, u8 val);
abfeea47 94
2bd1b237
LAD
95int hci_update_discoverable_sync(struct hci_dev *hdev);
96int hci_update_discoverable(struct hci_dev *hdev);
97
f056a657
LAD
98int hci_update_connectable_sync(struct hci_dev *hdev);
99
abfeea47
LAD
100int hci_start_discovery_sync(struct hci_dev *hdev);
101int hci_stop_discovery_sync(struct hci_dev *hdev);
182ee45d
LAD
102
103int hci_suspend_sync(struct hci_dev *hdev);
104int hci_resume_sync(struct hci_dev *hdev);
8e8b92ee
LAD
105
106struct hci_conn;
107
108int hci_le_create_conn_sync(struct hci_dev *hdev, struct hci_conn *conn);