linux/net/bluetooth/hci_conn.c

/*
   BlueZ - Bluetooth protocol stack for Linux
   Copyright (c) 2000-2001, 2010, Code Aurora Forum. All rights reserved.
   Copyright 2023-2024 NXP

   Written 2000,2001 by Maxim Krasnyansky <[email protected]>

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License version 2 as
   published by the Free Software Foundation;

   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
   SOFTWARE IS DISCLAIMED.
*/

/* Bluetooth HCI connection handling. */

#include <linux/export.h>
#include <linux/debugfs.h>

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

#include "smp.h"
#include "eir.h"

struct sco_param {};

struct conn_handle_t {};

static const struct sco_param esco_param_cvsd[] =;

static const struct sco_param sco_param_cvsd[] =;

static const struct sco_param esco_param_msbc[] =;

/* This function requires the caller holds hdev->lock */
void hci_connect_le_scan_cleanup(struct hci_conn *conn, u8 status)
{}

static void hci_conn_cleanup(struct hci_conn *conn)
{}

int hci_disconnect(struct hci_conn *conn, __u8 reason)
{}

static void hci_add_sco(struct hci_conn *conn, __u16 handle)
{}

static bool find_next_esco_param(struct hci_conn *conn,
				 const struct sco_param *esco_param, int size)
{}

static int configure_datapath_sync(struct hci_dev *hdev, struct bt_codec *codec)
{}

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

static bool hci_setup_sync_conn(struct hci_conn *conn, __u16 handle)
{}

bool hci_setup_sync(struct hci_conn *conn, __u16 handle)
{}

u8 hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, u16 latency,
		      u16 to_multiplier)
{}

void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand,
		      __u8 ltk[16], __u8 key_size)
{}

/* Device _must_ be locked */
void hci_sco_setup(struct hci_conn *conn, __u8 status)
{}

static void hci_conn_timeout(struct work_struct *work)
{}

/* Enter sniff mode */
static void hci_conn_idle(struct work_struct *work)
{}

static void hci_conn_auto_accept(struct work_struct *work)
{}

static void le_disable_advertising(struct hci_dev *hdev)
{}

static void le_conn_timeout(struct work_struct *work)
{}

struct iso_list_data {};

static void bis_list(struct hci_conn *conn, void *data)
{}

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

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

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

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

static void find_bis(struct hci_conn *conn, void *data)
{}

static int hci_le_big_terminate(struct hci_dev *hdev, u8 big, struct hci_conn *conn)
{}

/* Cleanup BIS connection
 *
 * Detects if there any BIS left connected in a BIG
 * broadcaster: Remove advertising instance and terminate BIG.
 * broadcaster receiver: Teminate BIG sync and terminate PA sync.
 */
static void bis_cleanup(struct hci_conn *conn)
{}

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

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

static void find_cis(struct hci_conn *conn, void *data)
{}

/* Cleanup CIS connection:
 *
 * Detects if there any CIS left connected in a CIG and remove it.
 */
static void cis_cleanup(struct hci_conn *conn)
{}

static int hci_conn_hash_alloc_unset(struct hci_dev *hdev)
{}

static struct hci_conn *__hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst,
				       u8 role, u16 handle)
{}

struct hci_conn *hci_conn_add_unset(struct hci_dev *hdev, int type,
				    bdaddr_t *dst, u8 role)
{}

struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst,
			      u8 role, u16 handle)
{}

static void hci_conn_cleanup_child(struct hci_conn *conn, u8 reason)
{}

static void hci_conn_unlink(struct hci_conn *conn)
{}

void hci_conn_del(struct hci_conn *conn)
{}

struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src, uint8_t src_type)
{}
EXPORT_SYMBOL();

/* This function requires the caller holds hdev->lock */
static void hci_le_conn_failed(struct hci_conn *conn, u8 status)
{}

/* This function requires the caller holds hdev->lock */
void hci_conn_failed(struct hci_conn *conn, u8 status)
{}

/* This function requires the caller holds hdev->lock */
u8 hci_conn_set_handle(struct hci_conn *conn, u16 handle)
{}

struct hci_conn *hci_connect_le(struct hci_dev *hdev, bdaddr_t *dst,
				u8 dst_type, bool dst_resolved, u8 sec_level,
				u16 conn_timeout, u8 role, u8 phy, u8 sec_phy)
{}

static bool is_connected(struct hci_dev *hdev, bdaddr_t *addr, u8 type)
{}

/* This function requires the caller holds hdev->lock */
static int hci_explicit_conn_params_set(struct hci_dev *hdev,
					bdaddr_t *addr, u8 addr_type)
{}

static int qos_set_big(struct hci_dev *hdev, struct bt_iso_qos *qos)
{}

static int qos_set_bis(struct hci_dev *hdev, struct bt_iso_qos *qos)
{}

/* This function requires the caller holds hdev->lock */
static struct hci_conn *hci_add_bis(struct hci_dev *hdev, bdaddr_t *dst,
				    struct bt_iso_qos *qos, __u8 base_len,
				    __u8 *base)
{}

/* This function requires the caller holds hdev->lock */
struct hci_conn *hci_connect_le_scan(struct hci_dev *hdev, bdaddr_t *dst,
				     u8 dst_type, u8 sec_level,
				     u16 conn_timeout,
				     enum conn_reasons conn_reason)
{}

struct hci_conn *hci_connect_acl(struct hci_dev *hdev, bdaddr_t *dst,
				 u8 sec_level, u8 auth_type,
				 enum conn_reasons conn_reason, u16 timeout)
{}

static struct hci_link *hci_conn_link(struct hci_conn *parent,
				      struct hci_conn *conn)
{}

struct hci_conn *hci_connect_sco(struct hci_dev *hdev, int type, bdaddr_t *dst,
				 __u16 setting, struct bt_codec *codec,
				 u16 timeout)
{}

static int hci_le_create_big(struct hci_conn *conn, struct bt_iso_qos *qos)
{}

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

static bool hci_le_set_cig_params(struct hci_conn *conn, struct bt_iso_qos *qos)
{}

struct hci_conn *hci_bind_cis(struct hci_dev *hdev, bdaddr_t *dst,
			      __u8 dst_type, struct bt_iso_qos *qos)
{}

bool hci_iso_setup_path(struct hci_conn *conn)
{}

int hci_conn_check_create_cis(struct hci_conn *conn)
{}

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

int hci_le_create_cis_pending(struct hci_dev *hdev)
{}

static void hci_iso_qos_setup(struct hci_dev *hdev, struct hci_conn *conn,
			      struct bt_iso_io_qos *qos, __u8 phy)
{}

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

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

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

struct hci_conn *hci_pa_create_sync(struct hci_dev *hdev, bdaddr_t *dst,
				    __u8 dst_type, __u8 sid,
				    struct bt_iso_qos *qos)
{}

int hci_le_big_create_sync(struct hci_dev *hdev, struct hci_conn *hcon,
			   struct bt_iso_qos *qos,
			   __u16 sync_handle, __u8 num_bis, __u8 bis[])
{}

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

struct hci_conn *hci_bind_bis(struct hci_dev *hdev, bdaddr_t *dst,
			      struct bt_iso_qos *qos,
			      __u8 base_len, __u8 *base)
{}

static void bis_mark_per_adv(struct hci_conn *conn, void *data)
{}

struct hci_conn *hci_connect_bis(struct hci_dev *hdev, bdaddr_t *dst,
				 __u8 dst_type, struct bt_iso_qos *qos,
				 __u8 base_len, __u8 *base)
{}

struct hci_conn *hci_connect_cis(struct hci_dev *hdev, bdaddr_t *dst,
				 __u8 dst_type, struct bt_iso_qos *qos)
{}

/* Check link security requirement */
int hci_conn_check_link_mode(struct hci_conn *conn)
{}

/* Authenticate remote device */
static int hci_conn_auth(struct hci_conn *conn, __u8 sec_level, __u8 auth_type)
{}

/* Encrypt the link */
static void hci_conn_encrypt(struct hci_conn *conn)
{}

/* Enable security */
int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type,
		      bool initiator)
{}
EXPORT_SYMBOL();

/* Check secure link requirement */
int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level)
{}
EXPORT_SYMBOL();

/* Switch role */
int hci_conn_switch_role(struct hci_conn *conn, __u8 role)
{}
EXPORT_SYMBOL();

/* Enter active mode */
void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active)
{}

/* Drop all connection on the device */
void hci_conn_hash_flush(struct hci_dev *hdev)
{}

static u32 get_link_mode(struct hci_conn *conn)
{}

int hci_get_conn_list(void __user *arg)
{}

int hci_get_conn_info(struct hci_dev *hdev, void __user *arg)
{}

int hci_get_auth_info(struct hci_dev *hdev, void __user *arg)
{}

struct hci_chan *hci_chan_create(struct hci_conn *conn)
{}

void hci_chan_del(struct hci_chan *chan)
{}

void hci_chan_list_flush(struct hci_conn *conn)
{}

static struct hci_chan *__hci_chan_lookup_handle(struct hci_conn *hcon,
						 __u16 handle)
{}

struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle)
{}

u32 hci_conn_get_phy(struct hci_conn *conn)
{}

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

int hci_abort_conn(struct hci_conn *conn, u8 reason)
{}