linux/drivers/bluetooth/hci_ll.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 *  Texas Instruments' Bluetooth HCILL UART protocol
 *
 *  HCILL (HCI Low Level) is a Texas Instruments' power management
 *  protocol extension to H4.
 *
 *  Copyright (C) 2007 Texas Instruments, Inc.
 *
 *  Written by Ohad Ben-Cohen <[email protected]>
 *
 *  Acknowledgements:
 *  This file is based on hci_h4.c, which was written
 *  by Maxim Krasnyansky and Marcel Holtmann.
 */

#include <linux/module.h>
#include <linux/kernel.h>

#include <linux/init.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/firmware.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
#include <linux/poll.h>

#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/signal.h>
#include <linux/ioctl.h>
#include <linux/of.h>
#include <linux/serdev.h>
#include <linux/skbuff.h>
#include <linux/ti_wilink_st.h>
#include <linux/clk.h>

#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#include <linux/gpio/consumer.h>
#include <linux/nvmem-consumer.h>

#include "hci_uart.h"

/* Vendor-specific HCI commands */
#define HCI_VS_WRITE_BD_ADDR
#define HCI_VS_UPDATE_UART_HCI_BAUDRATE

/* HCILL commands */
#define HCILL_GO_TO_SLEEP_IND
#define HCILL_GO_TO_SLEEP_ACK
#define HCILL_WAKE_UP_IND
#define HCILL_WAKE_UP_ACK

/* HCILL states */
enum hcill_states_e {};

struct ll_device {};

struct ll_struct {};

/*
 * Builds and sends an HCILL command packet.
 * These are very simple packets with only 1 cmd byte
 */
static int send_hcill_cmd(u8 cmd, struct hci_uart *hu)
{}

/* Initialize protocol */
static int ll_open(struct hci_uart *hu)
{}

/* Flush protocol data */
static int ll_flush(struct hci_uart *hu)
{}

/* Close protocol */
static int ll_close(struct hci_uart *hu)
{}

/*
 * internal function, which does common work of the device wake up process:
 * 1. places all pending packets (waiting in tx_wait_q list) in txq list.
 * 2. changes internal state to HCILL_AWAKE.
 * Note: assumes that hcill_lock spinlock is taken,
 * shouldn't be called otherwise!
 */
static void __ll_do_awake(struct ll_struct *ll)
{}

/*
 * Called upon a wake-up-indication from the device
 */
static void ll_device_want_to_wakeup(struct hci_uart *hu)
{}

/*
 * Called upon a sleep-indication from the device
 */
static void ll_device_want_to_sleep(struct hci_uart *hu)
{}

/*
 * Called upon wake-up-acknowledgement from the device
 */
static void ll_device_woke_up(struct hci_uart *hu)
{}

/* Enqueue frame for transmittion (padding, crc, etc) */
/* may be called from two simultaneous tasklets */
static int ll_enqueue(struct hci_uart *hu, struct sk_buff *skb)
{}

static int ll_recv_frame(struct hci_dev *hdev, struct sk_buff *skb)
{}

#define LL_RECV_SLEEP_IND

#define LL_RECV_SLEEP_ACK

#define LL_RECV_WAKE_IND

#define LL_RECV_WAKE_ACK

static const struct h4_recv_pkt ll_recv_pkts[] =;

/* Recv data */
static int ll_recv(struct hci_uart *hu, const void *data, int count)
{}

static struct sk_buff *ll_dequeue(struct hci_uart *hu)
{}

#if IS_ENABLED(CONFIG_SERIAL_DEV_BUS)
static int read_local_version(struct hci_dev *hdev)
{}

static int send_command_from_firmware(struct ll_device *lldev,
				      struct hci_command *cmd)
{}

/*
 * download_firmware -
 *	internal function which parses through the .bts firmware
 *	script file intreprets SEND, DELAY actions only as of now
 */
static int download_firmware(struct ll_device *lldev)
{}

static int ll_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
{}

static int ll_setup(struct hci_uart *hu)
{}

static const struct hci_uart_proto llp;

static int hci_ti_probe(struct serdev_device *serdev)
{}

static void hci_ti_remove(struct serdev_device *serdev)
{}

static const struct of_device_id hci_ti_of_match[] =;
MODULE_DEVICE_TABLE(of, hci_ti_of_match);

static struct serdev_device_driver hci_ti_drv =;
#else
#define ll_setup
#endif

static const struct hci_uart_proto llp =;

int __init ll_init(void)
{}

int __exit ll_deinit(void)
{}