linux/net/bluetooth/hci_sync.c

// SPDX-License-Identifier: GPL-2.0
/*
 * BlueZ - Bluetooth protocol stack for Linux
 *
 * Copyright (C) 2021 Intel Corporation
 * Copyright 2023 NXP
 */

#include <linux/property.h>

#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/mgmt.h>

#include "hci_codec.h"
#include "hci_debugfs.h"
#include "smp.h"
#include "eir.h"
#include "msft.h"
#include "aosp.h"
#include "leds.h"

static void hci_cmd_sync_complete(struct hci_dev *hdev, u8 result, u16 opcode,
				  struct sk_buff *skb)
{}

struct sk_buff *hci_cmd_sync_alloc(struct hci_dev *hdev, u16 opcode, u32 plen,
				   const void *param, struct sock *sk)
{}

static void hci_cmd_sync_add(struct hci_request *req, u16 opcode, u32 plen,
			     const void *param, u8 event, struct sock *sk)
{}

static int hci_cmd_sync_run(struct hci_request *req)
{}

static void hci_request_init(struct hci_request *req, struct hci_dev *hdev)
{}

/* This function requires the caller holds hdev->req_lock. */
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)
{}
EXPORT_SYMBOL();

/* This function requires the caller holds hdev->req_lock. */
struct sk_buff *__hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
			       const void *param, u32 timeout)
{}
EXPORT_SYMBOL();

/* Send HCI command and wait for command complete event */
struct sk_buff *hci_cmd_sync(struct hci_dev *hdev, u16 opcode, u32 plen,
			     const void *param, u32 timeout)
{}
EXPORT_SYMBOL();

/* This function requires the caller holds hdev->req_lock. */
struct sk_buff *__hci_cmd_sync_ev(struct hci_dev *hdev, u16 opcode, u32 plen,
				  const void *param, u8 event, u32 timeout)
{}
EXPORT_SYMBOL();

/* This function requires the caller holds hdev->req_lock. */
int __hci_cmd_sync_status_sk(struct hci_dev *hdev, u16 opcode, u32 plen,
			     const void *param, u8 event, u32 timeout,
			     struct sock *sk)
{}
EXPORT_SYMBOL();

int __hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen,
			  const void *param, u32 timeout)
{}
EXPORT_SYMBOL();

int hci_cmd_sync_status(struct hci_dev *hdev, u16 opcode, u32 plen,
			const void *param, u32 timeout)
{}
EXPORT_SYMBOL();

static void hci_cmd_sync_work(struct work_struct *work)
{}

static void hci_cmd_sync_cancel_work(struct work_struct *work)
{}

static int hci_scan_disable_sync(struct hci_dev *hdev);
static int scan_disable_sync(struct hci_dev *hdev, void *data)
{}

static int interleaved_inquiry_sync(struct hci_dev *hdev, void *data)
{}

static void le_scan_disable(struct work_struct *work)
{}

static int hci_le_set_scan_enable_sync(struct hci_dev *hdev, u8 val,
				       u8 filter_dup);

static int reenable_adv_sync(struct hci_dev *hdev, void *data)
{}

static void reenable_adv(struct work_struct *work)
{}

static void cancel_adv_timeout(struct hci_dev *hdev)
{}

/* For a single instance:
 * - force == true: The instance will be removed even when its remaining
 *   lifetime is not zero.
 * - force == false: the instance will be deactivated but kept stored unless
 *   the remaining lifetime is zero.
 *
 * For instance == 0x00:
 * - force == true: All instances will be removed regardless of their timeout
 *   setting.
 * - force == false: Only instances that have a timeout will be removed.
 */
int hci_clear_adv_instance_sync(struct hci_dev *hdev, struct sock *sk,
				u8 instance, bool force)
{}

static int adv_timeout_expire_sync(struct hci_dev *hdev, void *data)
{}

static void adv_timeout_expire(struct work_struct *work)
{}

static bool is_interleave_scanning(struct hci_dev *hdev)
{}

static int hci_passive_scan_sync(struct hci_dev *hdev);

static void interleave_scan_work(struct work_struct *work)
{}

void hci_cmd_sync_init(struct hci_dev *hdev)
{}

static void _hci_cmd_sync_cancel_entry(struct hci_dev *hdev,
				       struct hci_cmd_sync_work_entry *entry,
				       int err)
{}

void hci_cmd_sync_clear(struct hci_dev *hdev)
{}

void hci_cmd_sync_cancel(struct hci_dev *hdev, int err)
{}
EXPORT_SYMBOL();

/* Cancel ongoing command request synchronously:
 *
 * - Set result and mark status to HCI_REQ_CANCELED
 * - Wakeup command sync thread
 */
void hci_cmd_sync_cancel_sync(struct hci_dev *hdev, int err)
{}
EXPORT_SYMBOL();

/* Submit HCI command to be run in as cmd_sync_work:
 *
 * - hdev must _not_ be unregistered
 */
int hci_cmd_sync_submit(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
			void *data, hci_cmd_sync_work_destroy_t destroy)
{}
EXPORT_SYMBOL();

/* Queue HCI command:
 *
 * - hdev must be running
 */
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)
{}
EXPORT_SYMBOL();

static struct hci_cmd_sync_work_entry *
_hci_cmd_sync_lookup_entry(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
			   void *data, hci_cmd_sync_work_destroy_t destroy)
{}

/* Queue HCI command entry once:
 *
 * - Lookup if an entry already exist and only if it doesn't creates a new entry
 *   and queue it.
 */
int hci_cmd_sync_queue_once(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
			    void *data, hci_cmd_sync_work_destroy_t destroy)
{}
EXPORT_SYMBOL();

/* Lookup HCI command entry:
 *
 * - Return first entry that matches by function callback or data or
 *   destroy callback.
 */
struct hci_cmd_sync_work_entry *
hci_cmd_sync_lookup_entry(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
			  void *data, hci_cmd_sync_work_destroy_t destroy)
{}
EXPORT_SYMBOL();

/* Cancel HCI command entry */
void hci_cmd_sync_cancel_entry(struct hci_dev *hdev,
			       struct hci_cmd_sync_work_entry *entry)
{}
EXPORT_SYMBOL();

/* Dequeue one HCI command entry:
 *
 * - Lookup and cancel first entry that matches.
 */
bool hci_cmd_sync_dequeue_once(struct hci_dev *hdev,
			       hci_cmd_sync_work_func_t func,
			       void *data, hci_cmd_sync_work_destroy_t destroy)
{}
EXPORT_SYMBOL();

/* Dequeue HCI command entry:
 *
 * - Lookup and cancel any entry that matches by function callback or data or
 *   destroy callback.
 */
bool hci_cmd_sync_dequeue(struct hci_dev *hdev, hci_cmd_sync_work_func_t func,
			  void *data, hci_cmd_sync_work_destroy_t destroy)
{}
EXPORT_SYMBOL();

int hci_update_eir_sync(struct hci_dev *hdev)
{}

static u8 get_service_classes(struct hci_dev *hdev)
{}

int hci_update_class_sync(struct hci_dev *hdev)
{}

static bool is_advertising_allowed(struct hci_dev *hdev, bool connectable)
{}

static bool adv_use_rpa(struct hci_dev *hdev, uint32_t flags)
{}

static int hci_set_random_addr_sync(struct hci_dev *hdev, bdaddr_t *rpa)
{}

int hci_update_random_address_sync(struct hci_dev *hdev, bool require_privacy,
				   bool rpa, u8 *own_addr_type)
{}

static int hci_disable_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance)
{}

static int hci_set_adv_set_random_addr_sync(struct hci_dev *hdev, u8 instance,
					    bdaddr_t *random_addr)
{}

int hci_setup_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance)
{}

static int hci_set_ext_scan_rsp_data_sync(struct hci_dev *hdev, u8 instance)
{}

static int __hci_set_scan_rsp_data_sync(struct hci_dev *hdev, u8 instance)
{}

int hci_update_scan_rsp_data_sync(struct hci_dev *hdev, u8 instance)
{}

int hci_enable_ext_advertising_sync(struct hci_dev *hdev, u8 instance)
{}

int hci_start_ext_adv_sync(struct hci_dev *hdev, u8 instance)
{}

int hci_disable_per_advertising_sync(struct hci_dev *hdev, u8 instance)
{}

static int hci_set_per_adv_params_sync(struct hci_dev *hdev, u8 instance,
				       u16 min_interval, u16 max_interval)
{}

static int hci_set_per_adv_data_sync(struct hci_dev *hdev, u8 instance)
{}

static int hci_enable_per_advertising_sync(struct hci_dev *hdev, u8 instance)
{}

/* Checks if periodic advertising data contains a Basic Announcement and if it
 * does generates a Broadcast ID and add Broadcast Announcement.
 */
static int hci_adv_bcast_annoucement(struct hci_dev *hdev, struct adv_info *adv)
{}

int hci_start_per_adv_sync(struct hci_dev *hdev, u8 instance, u8 data_len,
			   u8 *data, u32 flags, u16 min_interval,
			   u16 max_interval, u16 sync_interval)
{}

static int hci_start_adv_sync(struct hci_dev *hdev, u8 instance)
{}

int hci_enable_advertising_sync(struct hci_dev *hdev)
{}

static int enable_advertising_sync(struct hci_dev *hdev, void *data)
{}

int hci_enable_advertising(struct hci_dev *hdev)
{}

int hci_remove_ext_adv_instance_sync(struct hci_dev *hdev, u8 instance,
				     struct sock *sk)
{}

static int remove_ext_adv_sync(struct hci_dev *hdev, void *data)
{}

int hci_remove_ext_adv_instance(struct hci_dev *hdev, u8 instance)
{}

int hci_le_terminate_big_sync(struct hci_dev *hdev, u8 handle, u8 reason)
{}

static int hci_set_ext_adv_data_sync(struct hci_dev *hdev, u8 instance)
{}

static int hci_set_adv_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)
{}

static int hci_clear_adv_sets_sync(struct hci_dev *hdev, struct sock *sk)
{}

static int hci_clear_adv_sync(struct hci_dev *hdev, struct sock *sk, bool force)
{}

static int hci_remove_adv_sync(struct hci_dev *hdev, u8 instance,
			       struct sock *sk)
{}

/* For a single instance:
 * - force == true: The instance will be removed even when its remaining
 *   lifetime is not zero.
 * - force == false: the instance will be deactivated but kept stored unless
 *   the remaining lifetime is zero.
 *
 * For instance == 0x00:
 * - force == true: All instances will be removed regardless of their timeout
 *   setting.
 * - force == false: Only instances that have a timeout will be removed.
 */
int hci_remove_advertising_sync(struct hci_dev *hdev, struct sock *sk,
				u8 instance, bool force)
{}

int hci_read_rssi_sync(struct hci_dev *hdev, __le16 handle)
{}

int hci_read_clock_sync(struct hci_dev *hdev, struct hci_cp_read_clock *cp)
{}

int hci_read_tx_power_sync(struct hci_dev *hdev, __le16 handle, u8 type)
{}

int hci_disable_advertising_sync(struct hci_dev *hdev)
{}

static int hci_le_set_ext_scan_enable_sync(struct hci_dev *hdev, u8 val,
					   u8 filter_dup)
{}

static int hci_le_set_scan_enable_sync(struct hci_dev *hdev, u8 val,
				       u8 filter_dup)
{}

static int hci_le_set_addr_resolution_enable_sync(struct hci_dev *hdev, u8 val)
{}

static int hci_scan_disable_sync(struct hci_dev *hdev)
{}

static bool scan_use_rpa(struct hci_dev *hdev)
{}

static void hci_start_interleave_scan(struct hci_dev *hdev)
{}

static void cancel_interleave_scan(struct hci_dev *hdev)
{}

/* Return true if interleave_scan wasn't started until exiting this function,
 * otherwise, return false
 */
static bool hci_update_interleaved_scan_sync(struct hci_dev *hdev)
{}

/* Removes connection to resolve list if needed.*/
static int hci_le_del_resolve_list_sync(struct hci_dev *hdev,
					bdaddr_t *bdaddr, u8 bdaddr_type)
{}

static int hci_le_del_accept_list_sync(struct hci_dev *hdev,
				       bdaddr_t *bdaddr, u8 bdaddr_type)
{}

struct conn_params {};

/* Adds connection to resolve list if needed.
 * Setting params to NULL programs local hdev->irk
 */
static int hci_le_add_resolve_list_sync(struct hci_dev *hdev,
					struct conn_params *params)
{}

/* Set Device Privacy Mode. */
static int hci_le_set_privacy_mode_sync(struct hci_dev *hdev,
					struct conn_params *params)
{}

/* Adds connection to allow list if needed, if the device uses RPA (has IRK)
 * this attempts to program the device in the resolving list as well and
 * properly set the privacy mode.
 */
static int hci_le_add_accept_list_sync(struct hci_dev *hdev,
				       struct conn_params *params,
				       u8 *num_entries)
{}

/* This function disables/pause all advertising instances */
static int hci_pause_advertising_sync(struct hci_dev *hdev)
{}

/* This function enables all user advertising instances */
static int hci_resume_advertising_sync(struct hci_dev *hdev)
{}

static int hci_pause_addr_resolution(struct hci_dev *hdev)
{}

struct sk_buff *hci_read_local_oob_data_sync(struct hci_dev *hdev,
					     bool extended, struct sock *sk)
{}

static struct conn_params *conn_params_copy(struct list_head *list, size_t *n)
{}

/* Clear LE Accept List */
static int hci_le_clear_accept_list_sync(struct hci_dev *hdev)
{}

/* Device must not be scanning when updating the accept list.
 *
 * Update is done using the following sequence:
 *
 * use_ll_privacy((Disable Advertising) -> Disable Resolving List) ->
 * Remove Devices From Accept List ->
 * (has IRK && use_ll_privacy(Remove Devices From Resolving List))->
 * Add Devices to Accept List ->
 * (has IRK && use_ll_privacy(Remove Devices From Resolving List)) ->
 * use_ll_privacy(Enable Resolving List -> (Enable Advertising)) ->
 * Enable Scanning
 *
 * In case of failure advertising shall be restored to its original state and
 * return would disable accept list since either accept or resolving list could
 * not be programmed.
 *
 */
static u8 hci_update_accept_list_sync(struct hci_dev *hdev)
{}

static void hci_le_scan_phy_params(struct hci_cp_le_scan_phy_params *cp,
				   u8 type, u16 interval, u16 window)
{}

static int hci_le_set_ext_scan_param_sync(struct hci_dev *hdev, u8 type,
					  u16 interval, u16 window,
					  u8 own_addr_type, u8 filter_policy)
{}

static int hci_le_set_scan_param_sync(struct hci_dev *hdev, u8 type,
				      u16 interval, u16 window,
				      u8 own_addr_type, u8 filter_policy)
{}

static int hci_start_scan_sync(struct hci_dev *hdev, u8 type, u16 interval,
			       u16 window, u8 own_addr_type, u8 filter_policy,
			       u8 filter_dup)
{}

static int hci_passive_scan_sync(struct hci_dev *hdev)
{}

/* This function controls the passive scanning based on hdev->pend_le_conns
 * list. If there are pending LE connection we start the background scanning,
 * otherwise we stop it in the following sequence:
 *
 * If there are devices to scan:
 *
 * Disable Scanning -> Update Accept List ->
 * use_ll_privacy((Disable Advertising) -> Disable Resolving List ->
 * Update Resolving List -> Enable Resolving List -> (Enable Advertising)) ->
 * Enable Scanning
 *
 * Otherwise:
 *
 * Disable Scanning
 */
int hci_update_passive_scan_sync(struct hci_dev *hdev)
{}

static int update_scan_sync(struct hci_dev *hdev, void *data)
{}

int hci_update_scan(struct hci_dev *hdev)
{}

static int update_passive_scan_sync(struct hci_dev *hdev, void *data)
{}

int hci_update_passive_scan(struct hci_dev *hdev)
{}

int hci_write_sc_support_sync(struct hci_dev *hdev, u8 val)
{}

int hci_write_ssp_mode_sync(struct hci_dev *hdev, u8 mode)
{}

int hci_write_le_host_supported_sync(struct hci_dev *hdev, u8 le, u8 simul)
{}

static int hci_powered_update_adv_sync(struct hci_dev *hdev)
{}

static int hci_write_auth_enable_sync(struct hci_dev *hdev)
{}

int hci_write_fast_connectable_sync(struct hci_dev *hdev, bool enable)
{}

static bool disconnected_accept_list_entries(struct hci_dev *hdev)
{}

static int hci_write_scan_enable_sync(struct hci_dev *hdev, u8 val)
{}

int hci_update_scan_sync(struct hci_dev *hdev)
{}

int hci_update_name_sync(struct hci_dev *hdev)
{}

/* This function perform powered update HCI command sequence after the HCI init
 * sequence which end up resetting all states, the sequence is as follows:
 *
 * HCI_SSP_ENABLED(Enable SSP)
 * HCI_LE_ENABLED(Enable LE)
 * HCI_LE_ENABLED(use_ll_privacy(Add local IRK to Resolving List) ->
 * Update adv data)
 * Enable Authentication
 * lmp_bredr_capable(Set Fast Connectable -> Set Scan Type -> Set Class ->
 * Set Name -> Set EIR)
 * HCI_FORCE_STATIC_ADDR | BDADDR_ANY && !HCI_BREDR_ENABLED (Set Static Address)
 */
int hci_powered_update_sync(struct hci_dev *hdev)
{}

/**
 * hci_dev_get_bd_addr_from_property - Get the Bluetooth Device Address
 *				       (BD_ADDR) for a HCI device from
 *				       a firmware node property.
 * @hdev:	The HCI device
 *
 * Search the firmware node for 'local-bd-address'.
 *
 * All-zero BD addresses are rejected, because those could be properties
 * that exist in the firmware tables, but were not updated by the firmware. For
 * example, the DTS could define 'local-bd-address', with zero BD addresses.
 */
static void hci_dev_get_bd_addr_from_property(struct hci_dev *hdev)
{}

struct hci_init_stage {};

/* Run init stage NULL terminated function table */
static int hci_init_stage_sync(struct hci_dev *hdev,
			       const struct hci_init_stage *stage)
{}

/* Read Local Version */
static int hci_read_local_version_sync(struct hci_dev *hdev)
{}

/* Read BD Address */
static int hci_read_bd_addr_sync(struct hci_dev *hdev)
{}

#define HCI_INIT(_func)

static const struct hci_init_stage hci_init0[] =;

int hci_reset_sync(struct hci_dev *hdev)
{}

static int hci_init0_sync(struct hci_dev *hdev)
{}

static int hci_unconf_init_sync(struct hci_dev *hdev)
{}

/* Read Local Supported Features. */
static int hci_read_local_features_sync(struct hci_dev *hdev)
{}

/* BR Controller init stage 1 command sequence */
static const struct hci_init_stage br_init1[] =;

/* Read Local Commands */
static int hci_read_local_cmds_sync(struct hci_dev *hdev)
{}

static int hci_init1_sync(struct hci_dev *hdev)
{}

/* Read Buffer Size (ACL mtu, max pkt, etc.) */
static int hci_read_buffer_size_sync(struct hci_dev *hdev)
{}

/* Read Class of Device */
static int hci_read_dev_class_sync(struct hci_dev *hdev)
{}

/* Read Local Name */
static int hci_read_local_name_sync(struct hci_dev *hdev)
{}

/* Read Voice Setting */
static int hci_read_voice_setting_sync(struct hci_dev *hdev)
{}

/* Read Number of Supported IAC */
static int hci_read_num_supported_iac_sync(struct hci_dev *hdev)
{}

/* Read Current IAC LAP */
static int hci_read_current_iac_lap_sync(struct hci_dev *hdev)
{}

static int hci_set_event_filter_sync(struct hci_dev *hdev, u8 flt_type,
				     u8 cond_type, bdaddr_t *bdaddr,
				     u8 auto_accept)
{}

static int hci_clear_event_filter_sync(struct hci_dev *hdev)
{}

/* Connection accept timeout ~20 secs */
static int hci_write_ca_timeout_sync(struct hci_dev *hdev)
{}

/* BR Controller init stage 2 command sequence */
static const struct hci_init_stage br_init2[] =;

static int hci_write_ssp_mode_1_sync(struct hci_dev *hdev)
{}

static int hci_write_eir_sync(struct hci_dev *hdev)
{}

static int hci_write_inquiry_mode_sync(struct hci_dev *hdev)
{}

static int hci_read_inq_rsp_tx_power_sync(struct hci_dev *hdev)
{}

static int hci_read_local_ext_features_sync(struct hci_dev *hdev, u8 page)
{}

static int hci_read_local_ext_features_1_sync(struct hci_dev *hdev)
{}

/* HCI Controller init stage 2 command sequence */
static const struct hci_init_stage hci_init2[] =;

/* Read LE Buffer Size */
static int hci_le_read_buffer_size_sync(struct hci_dev *hdev)
{}

/* Read LE Local Supported Features */
static int hci_le_read_local_features_sync(struct hci_dev *hdev)
{}

/* Read LE Supported States */
static int hci_le_read_supported_states_sync(struct hci_dev *hdev)
{}

/* LE Controller init stage 2 command sequence */
static const struct hci_init_stage le_init2[] =;

static int hci_init2_sync(struct hci_dev *hdev)
{}

static int hci_set_event_mask_sync(struct hci_dev *hdev)
{}

static int hci_read_stored_link_key_sync(struct hci_dev *hdev)
{}

static int hci_setup_link_policy_sync(struct hci_dev *hdev)
{}

static int hci_read_page_scan_activity_sync(struct hci_dev *hdev)
{}

static int hci_read_def_err_data_reporting_sync(struct hci_dev *hdev)
{}

static int hci_read_page_scan_type_sync(struct hci_dev *hdev)
{}

/* Read features beyond page 1 if available */
static int hci_read_local_ext_features_all_sync(struct hci_dev *hdev)
{}

/* HCI Controller init stage 3 command sequence */
static const struct hci_init_stage hci_init3[] =;

static int hci_le_set_event_mask_sync(struct hci_dev *hdev)
{}

/* Read LE Advertising Channel TX Power */
static int hci_le_read_adv_tx_power_sync(struct hci_dev *hdev)
{}

/* Read LE Min/Max Tx Power*/
static int hci_le_read_tx_power_sync(struct hci_dev *hdev)
{}

/* Read LE Accept List Size */
static int hci_le_read_accept_list_size_sync(struct hci_dev *hdev)
{}

/* Read LE Resolving List Size */
static int hci_le_read_resolv_list_size_sync(struct hci_dev *hdev)
{}

/* Clear LE Resolving List */
static int hci_le_clear_resolv_list_sync(struct hci_dev *hdev)
{}

/* Set RPA timeout */
static int hci_le_set_rpa_timeout_sync(struct hci_dev *hdev)
{}

/* Read LE Maximum Data Length */
static int hci_le_read_max_data_len_sync(struct hci_dev *hdev)
{}

/* Read LE Suggested Default Data Length */
static int hci_le_read_def_data_len_sync(struct hci_dev *hdev)
{}

/* Read LE Number of Supported Advertising Sets */
static int hci_le_read_num_support_adv_sets_sync(struct hci_dev *hdev)
{}

/* Write LE Host Supported */
static int hci_set_le_support_sync(struct hci_dev *hdev)
{}

/* LE Set Host Feature */
static int hci_le_set_host_feature_sync(struct hci_dev *hdev)
{}

/* LE Controller init stage 3 command sequence */
static const struct hci_init_stage le_init3[] =;

static int hci_init3_sync(struct hci_dev *hdev)
{}

static int hci_delete_stored_link_key_sync(struct hci_dev *hdev)
{}

static int hci_set_event_mask_page_2_sync(struct hci_dev *hdev)
{}

/* Read local codec list if the HCI command is supported */
static int hci_read_local_codecs_sync(struct hci_dev *hdev)
{}

/* Read local pairing options if the HCI command is supported */
static int hci_read_local_pairing_opts_sync(struct hci_dev *hdev)
{}

/* Get MWS transport configuration if the HCI command is supported */
static int hci_get_mws_transport_config_sync(struct hci_dev *hdev)
{}

/* Check for Synchronization Train support */
static int hci_read_sync_train_params_sync(struct hci_dev *hdev)
{}

/* Enable Secure Connections if supported and configured */
static int hci_write_sc_support_1_sync(struct hci_dev *hdev)
{}

/* Set erroneous data reporting if supported to the wideband speech
 * setting value
 */
static int hci_set_err_data_report_sync(struct hci_dev *hdev)
{}

static const struct hci_init_stage hci_init4[] =;

/* Set Suggested Default Data Length to maximum if supported */
static int hci_le_set_write_def_data_len_sync(struct hci_dev *hdev)
{}

/* Set Default PHY parameters if command is supported, enables all supported
 * PHYs according to the LE Features bits.
 */
static int hci_le_set_default_phy_sync(struct hci_dev *hdev)
{}

static const struct hci_init_stage le_init4[] =;

static int hci_init4_sync(struct hci_dev *hdev)
{}

static int hci_init_sync(struct hci_dev *hdev)
{}

#define HCI_QUIRK_BROKEN(_quirk, _desc)

static const struct {} hci_broken_table[] =;

/* This function handles hdev setup stage:
 *
 * Calls hdev->setup
 * Setup address if HCI_QUIRK_USE_BDADDR_PROPERTY is set.
 */
static int hci_dev_setup_sync(struct hci_dev *hdev)
{}

/* This function handles hdev init stage:
 *
 * Calls hci_dev_setup_sync to perform setup stage
 * Calls hci_init_sync to perform HCI command init sequence
 */
static int hci_dev_init_sync(struct hci_dev *hdev)
{}

int hci_dev_open_sync(struct hci_dev *hdev)
{}

/* This function requires the caller holds hdev->lock */
static void hci_pend_le_actions_clear(struct hci_dev *hdev)
{}

static int hci_dev_shutdown(struct hci_dev *hdev)
{}

int hci_dev_close_sync(struct hci_dev *hdev)
{}

/* This function perform power on HCI command sequence as follows:
 *
 * If controller is already up (HCI_UP) performs hci_powered_update_sync
 * sequence otherwise run hci_dev_open_sync which will follow with
 * hci_powered_update_sync after the init sequence is completed.
 */
static int hci_power_on_sync(struct hci_dev *hdev)
{}

static int hci_remote_name_cancel_sync(struct hci_dev *hdev, bdaddr_t *addr)
{}

int hci_stop_discovery_sync(struct hci_dev *hdev)
{}

static int hci_disconnect_sync(struct hci_dev *hdev, struct hci_conn *conn,
			       u8 reason)
{}

static int hci_le_connect_cancel_sync(struct hci_dev *hdev,
				      struct hci_conn *conn, u8 reason)
{}

static int hci_connect_cancel_sync(struct hci_dev *hdev, struct hci_conn *conn,
				   u8 reason)
{}

static int hci_reject_sco_sync(struct hci_dev *hdev, struct hci_conn *conn,
			       u8 reason)
{}

static int hci_le_reject_cis_sync(struct hci_dev *hdev, struct hci_conn *conn,
				  u8 reason)
{}

static int hci_reject_conn_sync(struct hci_dev *hdev, struct hci_conn *conn,
				u8 reason)
{}

int hci_abort_conn_sync(struct hci_dev *hdev, struct hci_conn *conn, u8 reason)
{}

static int hci_disconnect_all_sync(struct hci_dev *hdev, u8 reason)
{}

/* This function perform power off HCI command sequence as follows:
 *
 * Clear Advertising
 * Stop Discovery
 * Disconnect all connections
 * hci_dev_close_sync
 */
static int hci_power_off_sync(struct hci_dev *hdev)
{}

int hci_set_powered_sync(struct hci_dev *hdev, u8 val)
{}

static int hci_write_iac_sync(struct hci_dev *hdev)
{}

int hci_update_discoverable_sync(struct hci_dev *hdev)
{}

static int update_discoverable_sync(struct hci_dev *hdev, void *data)
{}

int hci_update_discoverable(struct hci_dev *hdev)
{}

int hci_update_connectable_sync(struct hci_dev *hdev)
{}

int hci_inquiry_sync(struct hci_dev *hdev, u8 length, u8 num_rsp)
{}

static int hci_active_scan_sync(struct hci_dev *hdev, uint16_t interval)
{}

static int hci_start_interleaved_discovery_sync(struct hci_dev *hdev)
{}

int hci_start_discovery_sync(struct hci_dev *hdev)
{}

static void hci_suspend_monitor_sync(struct hci_dev *hdev)
{}

/* This function disables discovery and mark it as paused */
static int hci_pause_discovery_sync(struct hci_dev *hdev)
{}

static int hci_update_event_filter_sync(struct hci_dev *hdev)
{}

/* This function disables scan (BR and LE) and mark it as paused */
static int hci_pause_scan_sync(struct hci_dev *hdev)
{}

/* This function performs the HCI suspend procedures in the follow order:
 *
 * Pause discovery (active scanning/inquiry)
 * Pause Directed Advertising/Advertising
 * Pause Scanning (passive scanning in case discovery was not active)
 * Disconnect all connections
 * Set suspend_status to BT_SUSPEND_DISCONNECT if hdev cannot wakeup
 * otherwise:
 * Update event mask (only set events that are allowed to wake up the host)
 * Update event filter (with devices marked with HCI_CONN_FLAG_REMOTE_WAKEUP)
 * Update passive scanning (lower duty cycle)
 * Set suspend_status to BT_SUSPEND_CONFIGURE_WAKE
 */
int hci_suspend_sync(struct hci_dev *hdev)
{}

/* This function resumes discovery */
static int hci_resume_discovery_sync(struct hci_dev *hdev)
{}

static void hci_resume_monitor_sync(struct hci_dev *hdev)
{}

/* This function resume scan and reset paused flag */
static int hci_resume_scan_sync(struct hci_dev *hdev)
{}

/* This function performs the HCI suspend procedures in the follow order:
 *
 * Restore event mask
 * Clear event filter
 * Update passive scanning (normal duty cycle)
 * Resume Directed Advertising/Advertising
 * Resume discovery (active scanning/inquiry)
 */
int hci_resume_sync(struct hci_dev *hdev)
{}

static bool conn_use_rpa(struct hci_conn *conn)
{}

static int hci_le_ext_directed_advertising_sync(struct hci_dev *hdev,
						struct hci_conn *conn)
{}

static int hci_le_directed_advertising_sync(struct hci_dev *hdev,
					    struct hci_conn *conn)
{}

static void set_ext_conn_params(struct hci_conn *conn,
				struct hci_cp_le_ext_conn_param *p)
{}

static int hci_le_ext_create_conn_sync(struct hci_dev *hdev,
				       struct hci_conn *conn, u8 own_addr_type)
{}

static int hci_le_create_conn_sync(struct hci_dev *hdev, void *data)
{}

int hci_le_create_cis_sync(struct hci_dev *hdev)
{}

int hci_le_remove_cig_sync(struct hci_dev *hdev, u8 handle)
{}

int hci_le_big_terminate_sync(struct hci_dev *hdev, u8 handle)
{}

int hci_le_pa_terminate_sync(struct hci_dev *hdev, u16 handle)
{}

int hci_get_random_address(struct hci_dev *hdev, bool require_privacy,
			   bool use_rpa, struct adv_info *adv_instance,
			   u8 *own_addr_type, bdaddr_t *rand_addr)
{}

static int _update_adv_data_sync(struct hci_dev *hdev, void *data)
{}

int hci_update_adv_data(struct hci_dev *hdev, u8 instance)
{}

static int hci_acl_create_conn_sync(struct hci_dev *hdev, void *data)
{}

int hci_connect_acl_sync(struct hci_dev *hdev, struct hci_conn *conn)
{}

static void create_le_conn_complete(struct hci_dev *hdev, void *data, int err)
{}

int hci_connect_le_sync(struct hci_dev *hdev, struct hci_conn *conn)
{}

int hci_cancel_connect_sync(struct hci_dev *hdev, struct hci_conn *conn)
{}

int hci_le_conn_update_sync(struct hci_dev *hdev, struct hci_conn *conn,
			    struct hci_conn_params *params)
{}