linux/drivers/bluetooth/hci_bcsp.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *
 *  Bluetooth HCI UART driver
 *
 *  Copyright (C) 2002-2003  Fabrizio Gennari <[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/bitrev.h>
#include <linux/unaligned.h>

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

#include "hci_uart.h"

static bool txcrc =;
static bool hciextn =;

#define BCSP_TXWINSIZE

#define BCSP_ACK_PKT
#define BCSP_LE_PKT

struct bcsp_struct {};

/* ---- BCSP CRC calculation ---- */

/* Table for calculating CRC for polynomial 0x1021, LSB processed first,
 * initial value 0xffff, bits shifted in reverse order.
 */

static const u16 crc_table[] =;

/* Initialise the crc calculator */
#define BCSP_CRC_INIT(x)

/* Update crc with next data byte
 *
 * Implementation note
 *     The data byte is treated as two nibbles.  The crc is generated
 *     in reverse, i.e., bits are fed into the register from the top.
 */
static void bcsp_crc_update(u16 *crc, u8 d)
{}

/* ---- BCSP core ---- */

static void bcsp_slip_msgdelim(struct sk_buff *skb)
{}

static void bcsp_slip_one_byte(struct sk_buff *skb, u8 c)
{}

static int bcsp_enqueue(struct hci_uart *hu, struct sk_buff *skb)
{}

static struct sk_buff *bcsp_prepare_pkt(struct bcsp_struct *bcsp, u8 *data,
					int len, int pkt_type)
{}

/* This is a rewrite of pkt_avail in ABCSP */
static struct sk_buff *bcsp_dequeue(struct hci_uart *hu)
{}

static int bcsp_flush(struct hci_uart *hu)
{}

/* Remove ack'ed packets */
static void bcsp_pkt_cull(struct bcsp_struct *bcsp)
{}

/* Handle BCSP link-establishment packets. When we
 * detect a "sync" packet, symptom that the BT module has reset,
 * we do nothing :) (yet)
 */
static void bcsp_handle_le_pkt(struct hci_uart *hu)
{}

static inline void bcsp_unslip_one_byte(struct bcsp_struct *bcsp, unsigned char byte)
{}

static void bcsp_complete_rx_pkt(struct hci_uart *hu)
{}

static u16 bscp_get_crc(struct bcsp_struct *bcsp)
{}

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

	/* Arrange to retransmit all messages in the relq. */
static void bcsp_timed_event(struct timer_list *t)
{}

static int bcsp_open(struct hci_uart *hu)
{}

static int bcsp_close(struct hci_uart *hu)
{}

static const struct hci_uart_proto bcsp =;

int __init bcsp_init(void)
{}

int __exit bcsp_deinit(void)
{}

module_param(txcrc, bool, 0644);
MODULE_PARM_DESC();

module_param(hciextn, bool, 0644);
MODULE_PARM_DESC();