Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * BlueZ - Bluetooth protocol stack for Linux
0004  *
0005  * Copyright (C) 2021 Intel Corporation
0006  */
0007 
0008 typedef int (*hci_cmd_sync_work_func_t)(struct hci_dev *hdev, void *data);
0009 typedef void (*hci_cmd_sync_work_destroy_t)(struct hci_dev *hdev, void *data,
0010                         int err);
0011 
0012 struct hci_cmd_sync_work_entry {
0013     struct list_head list;
0014     hci_cmd_sync_work_func_t func;
0015     void *data;
0016     hci_cmd_sync_work_destroy_t destroy;
0017 };
0018 
0019 /* Function with sync suffix shall not be called with hdev->lock held as they
0020  * wait the command to complete and in the meantime an event could be received
0021  * which could attempt to acquire hdev->lock causing a deadlock.
0022  */
0023 struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
0024                    const void *param, u32 timeout);
0025 struct sk_buff *hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
0026                  const void *param, u32 timeout);
0027 struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen,
0028                   const void *param, u8 event, u32 timeout);
0029 struct sk_buff *__hci_cmd_sync_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
0030                   const void *param, u8 event, u32 timeout,
0031                   struct sock *sk);
0032 int __hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen,
0033               const void *param, u32 timeout);
0034 int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
0035                  const void *param, u8 event, u32 timeout,
0036                  struct sock *sk);
0037 
0038 void hci_cmd_sync_init(struct hci_dev *hdev);
0039 void hci_cmd_sync_clear(struct hci_dev *hdev);
0040 void hci_cmd_sync_cancel(struct hci_dev *hdev, int err);
0041 void __hci_cmd_sync_cancel(struct hci_dev *hdev, int err);
0042 
0043 int hci_cmd_sync_queue(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
0044                void *data, hci_cmd_sync_work_destroy_t destroy);
0045 
0046 int hci_update_eir_sync(struct hci_dev *hdev);
0047 int hci_update_class_sync(struct hci_dev *hdev);
0048 
0049 int hci_update_eir_sync(struct hci_dev *hdev);
0050 int hci_update_class_sync(struct hci_dev *hdev);
0051 int hci_update_name_sync(struct hci_dev *hdev);
0052 int hci_write_ssp_mode_sync(struct hci_dev *hdev, u8 mode);
0053 
0054 int hci_update_random_address_sync(struct hci_dev *hdev, bool require_privacy,
0055                    bool rpa, u8 *own_addr_type);
0056 
0057 int hci_update_scan_rsp_data_sync(struct hci_dev *hdev, u8 instance);
0058 int hci_update_adv_data_sync(struct hci_dev *hdev, u8 instance);
0059 int hci_schedule_adv_instance_sync(struct hci_dev *hdev, u8 instance,
0060                    bool force);
0061 
0062 int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance);
0063 int hci_start_ext_adv_sync(struct hci_dev *hdev, u8 instance);
0064 int hci_enable_ext_advertising_sync(struct hci_dev *hdev, u8 instance);
0065 int hci_enable_advertising_sync(struct hci_dev *hdev);
0066 int hci_enable_advertising(struct hci_dev *hdev);
0067 
0068 int hci_start_per_adv_sync(struct hci_dev *hdev, u8 instance, u8 data_len,
0069                u8 *data, u32 flags, u16 min_interval,
0070                u16 max_interval, u16 sync_interval);
0071 
0072 int hci_remove_advertising_sync(struct hci_dev *hdev, struct sock *sk,
0073                 u8 instance, bool force);
0074 int hci_disable_advertising_sync(struct hci_dev *hdev);
0075 
0076 int hci_update_passive_scan_sync(struct hci_dev *hdev);
0077 int hci_update_passive_scan(struct hci_dev *hdev);
0078 int hci_read_rssi_sync(struct hci_dev *hdev, __le16 handle);
0079 int hci_read_tx_power_sync(struct hci_dev *hdev, __le16 handle, u8 type);
0080 int hci_write_sc_support_sync(struct hci_dev *hdev, u8 val);
0081 int hci_read_clock_sync(struct hci_dev *hdev, struct hci_cp_read_clock *cp);
0082 
0083 int hci_write_fast_connectable_sync(struct hci_dev *hdev, bool enable);
0084 int hci_update_scan_sync(struct hci_dev *hdev);
0085 int hci_update_scan(struct hci_dev *hdev);
0086 
0087 int hci_write_le_host_supported_sync(struct hci_dev *hdev, u8 le, u8 simul);
0088 int hci_remove_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance,
0089                      struct sock *sk);
0090 int hci_remove_ext_adv_instance(struct hci_dev *hdev, u8 instance);
0091 struct sk_buff *hci_read_local_oob_data_sync(struct hci_dev *hdev, bool ext,
0092                          struct sock *sk);
0093 
0094 int hci_reset_sync(struct hci_dev *hdev);
0095 int hci_dev_open_sync(struct hci_dev *hdev);
0096 int hci_dev_close_sync(struct hci_dev *hdev);
0097 
0098 int hci_powered_update_sync(struct hci_dev *hdev);
0099 int hci_set_powered_sync(struct hci_dev *hdev, u8 val);
0100 
0101 int hci_update_discoverable_sync(struct hci_dev *hdev);
0102 int hci_update_discoverable(struct hci_dev *hdev);
0103 
0104 int hci_update_connectable_sync(struct hci_dev *hdev);
0105 
0106 int hci_start_discovery_sync(struct hci_dev *hdev);
0107 int hci_stop_discovery_sync(struct hci_dev *hdev);
0108 
0109 int hci_suspend_sync(struct hci_dev *hdev);
0110 int hci_resume_sync(struct hci_dev *hdev);
0111 
0112 struct hci_conn;
0113 
0114 int hci_abort_conn_sync(struct hci_dev *hdev, struct hci_conn *conn, u8 reason);
0115 
0116 int hci_le_create_conn_sync(struct hci_dev *hdev, struct hci_conn *conn);
0117 
0118 int hci_le_remove_cig_sync(struct hci_dev *hdev, u8 handle);
0119 
0120 int hci_le_terminate_big_sync(struct hci_dev *hdev, u8 handle, u8 reason);
0121 
0122 int hci_le_big_terminate_sync(struct hci_dev *hdev, u8 handle);
0123 
0124 int hci_le_pa_terminate_sync(struct hci_dev *hdev, u16 handle);