linux/drivers/bluetooth/hci_ldisc.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *
 *  Bluetooth HCI UART driver
 *
 *  Copyright (C) 2000-2001  Qualcomm Incorporated
 *  Copyright (C) 2002-2003  Maxim Krasnyansky <[email protected]>
 *  Copyright (C) 2004-2005  Marcel Holtmann <[email protected]>
 */

#include <linux/module.h>

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

#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/signal.h>
#include <linux/ioctl.h>
#include <linux/skbuff.h>
#include <linux/firmware.h>
#include <linux/serdev.h>

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

#include "btintel.h"
#include "btbcm.h"
#include "hci_uart.h"

#define VERSION

static const struct hci_uart_proto *hup[HCI_UART_MAX_PROTO];

int hci_uart_register_proto(const struct hci_uart_proto *p)
{}

int hci_uart_unregister_proto(const struct hci_uart_proto *p)
{}

static const struct hci_uart_proto *hci_uart_get_proto(unsigned int id)
{}

static inline void hci_uart_tx_complete(struct hci_uart *hu, int pkt_type)
{}

static inline struct sk_buff *hci_uart_dequeue(struct hci_uart *hu)
{}

int hci_uart_tx_wakeup(struct hci_uart *hu)
{}
EXPORT_SYMBOL_GPL();

static void hci_uart_write_work(struct work_struct *work)
{}

void hci_uart_init_work(struct work_struct *work)
{}

int hci_uart_init_ready(struct hci_uart *hu)
{}

int hci_uart_wait_until_sent(struct hci_uart *hu)
{}

/* ------- Interface to HCI layer ------ */
/* Reset device */
static int hci_uart_flush(struct hci_dev *hdev)
{}

/* Initialize device */
static int hci_uart_open(struct hci_dev *hdev)
{}

/* Close device */
static int hci_uart_close(struct hci_dev *hdev)
{}

/* Send frames from HCI layer */
static int hci_uart_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
{}

/* Check the underlying device or tty has flow control support */
bool hci_uart_has_flow_control(struct hci_uart *hu)
{}

/* Flow control or un-flow control the device */
void hci_uart_set_flow_control(struct hci_uart *hu, bool enable)
{}

void hci_uart_set_speeds(struct hci_uart *hu, unsigned int init_speed,
			 unsigned int oper_speed)
{}

void hci_uart_set_baudrate(struct hci_uart *hu, unsigned int speed)
{}

static int hci_uart_setup(struct hci_dev *hdev)
{}

/* ------ LDISC part ------ */
/* hci_uart_tty_open
 *
 *     Called when line discipline changed to HCI_UART.
 *
 * Arguments:
 *     tty    pointer to tty info structure
 * Return Value:
 *     0 if success, otherwise error code
 */
static int hci_uart_tty_open(struct tty_struct *tty)
{}

/* hci_uart_tty_close()
 *
 *    Called when the line discipline is changed to something
 *    else, the tty is closed, or the tty detects a hangup.
 */
static void hci_uart_tty_close(struct tty_struct *tty)
{}

/* hci_uart_tty_wakeup()
 *
 *    Callback for transmit wakeup. Called when low level
 *    device driver can accept more send data.
 *
 * Arguments:        tty    pointer to associated tty instance data
 * Return Value:    None
 */
static void hci_uart_tty_wakeup(struct tty_struct *tty)
{}

/* hci_uart_tty_receive()
 *
 *     Called by tty low level driver when receive data is
 *     available.
 *
 * Arguments:  tty          pointer to tty isntance data
 *             data         pointer to received data
 *             flags        pointer to flags for data
 *             count        count of received data in bytes
 *
 * Return Value:    None
 */
static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data,
				 const u8 *flags, size_t count)
{}

static int hci_uart_register_dev(struct hci_uart *hu)
{}

static int hci_uart_set_proto(struct hci_uart *hu, int id)
{}

static int hci_uart_set_flags(struct hci_uart *hu, unsigned long flags)
{}

/* hci_uart_tty_ioctl()
 *
 *    Process IOCTL system call for the tty device.
 *
 * Arguments:
 *
 *    tty        pointer to tty instance data
 *    cmd        IOCTL command code
 *    arg        argument for IOCTL call (cmd dependent)
 *
 * Return Value:    Command dependent
 */
static int hci_uart_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
			      unsigned long arg)
{}

/*
 * We don't provide read/write/poll interface for user space.
 */
static ssize_t hci_uart_tty_read(struct tty_struct *tty, struct file *file,
				 u8 *buf, size_t nr, void **cookie,
				 unsigned long offset)
{}

static ssize_t hci_uart_tty_write(struct tty_struct *tty, struct file *file,
				  const u8 *data, size_t count)
{}

static struct tty_ldisc_ops hci_uart_ldisc =;

static int __init hci_uart_init(void)
{}

static void __exit hci_uart_exit(void)
{}

module_init();
module_exit(hci_uart_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_VERSION();
MODULE_LICENSE();
MODULE_ALIAS_LDISC();