linux/drivers/bluetooth/hci_h5.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *
 *  Bluetooth HCI Three-wire UART driver
 *
 *  Copyright (C) 2012  Intel Corporation
 */

#include <linux/acpi.h>
#include <linux/errno.h>
#include <linux/gpio/consumer.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/serdev.h>
#include <linux/skbuff.h>

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

#include "btrtl.h"
#include "hci_uart.h"

#define SUSPEND_TIMEOUT_MS

#define HCI_3WIRE_ACK_PKT
#define HCI_3WIRE_LINK_PKT

/* Sliding window size */
#define H5_TX_WIN_MAX

#define H5_ACK_TIMEOUT
#define H5_SYNC_TIMEOUT

/*
 * Maximum Three-wire packet:
 *     4 byte header + max value for 12-bit length + 2 bytes for CRC
 */
#define H5_MAX_LEN

/* Convenience macros for reading Three-wire header values */
#define H5_HDR_SEQ(hdr)
#define H5_HDR_ACK(hdr)
#define H5_HDR_CRC(hdr)
#define H5_HDR_RELIABLE(hdr)
#define H5_HDR_PKT_TYPE(hdr)
#define H5_HDR_LEN(hdr)

#define SLIP_DELIMITER
#define SLIP_ESC
#define SLIP_ESC_DELIM
#define SLIP_ESC_ESC

/* H5 state flags */
enum {};

struct h5 {};

enum h5_driver_info {};

struct h5_vnd {};

struct h5_device_data {};

static void h5_reset_rx(struct h5 *h5);

static void h5_link_control(struct hci_uart *hu, const void *data, size_t len)
{}

static u8 h5_cfg_field(struct h5 *h5)
{}

static void h5_timed_event(struct timer_list *t)
{}

static void h5_peer_reset(struct hci_uart *hu)
{}

static int h5_open(struct hci_uart *hu)
{}

static int h5_close(struct hci_uart *hu)
{}

static int h5_setup(struct hci_uart *hu)
{}

static void h5_pkt_cull(struct h5 *h5)
{}

static void h5_handle_internal_rx(struct hci_uart *hu)
{}

static void h5_complete_rx_pkt(struct hci_uart *hu)
{}

static int h5_rx_crc(struct hci_uart *hu, unsigned char c)
{}

static int h5_rx_payload(struct hci_uart *hu, unsigned char c)
{}

static int h5_rx_3wire_hdr(struct hci_uart *hu, unsigned char c)
{}

static int h5_rx_pkt_start(struct hci_uart *hu, unsigned char c)
{}

static int h5_rx_delimiter(struct hci_uart *hu, unsigned char c)
{}

static void h5_unslip_one_byte(struct h5 *h5, unsigned char c)
{}

static void h5_reset_rx(struct h5 *h5)
{}

static int h5_recv(struct hci_uart *hu, const void *data, int count)
{}

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

static void h5_slip_delim(struct sk_buff *skb)
{}

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

static bool valid_packet_type(u8 type)
{}

static struct sk_buff *h5_prepare_pkt(struct hci_uart *hu, u8 pkt_type,
				      const u8 *data, size_t len)
{}

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

static int h5_flush(struct hci_uart *hu)
{}

static const struct hci_uart_proto h5p =;

static int h5_serdev_probe(struct serdev_device *serdev)
{}

static void h5_serdev_remove(struct serdev_device *serdev)
{}

static int __maybe_unused h5_serdev_suspend(struct device *dev)
{}

static int __maybe_unused h5_serdev_resume(struct device *dev)
{}

#ifdef CONFIG_BT_HCIUART_RTL
static int h5_btrtl_setup(struct h5 *h5)
{}

static void h5_btrtl_open(struct h5 *h5)
{}

static void h5_btrtl_close(struct h5 *h5)
{}

/* Suspend/resume support. On many devices the RTL BT device loses power during
 * suspend/resume, causing it to lose its firmware and all state. So we simply
 * turn it off on suspend and reprobe on resume. This mirrors how RTL devices
 * are handled in the USB driver, where the BTUSB_WAKEUP_DISABLE is used which
 * also causes a reprobe on resume.
 */
static int h5_btrtl_suspend(struct h5 *h5)
{}

struct h5_btrtl_reprobe {};

static void h5_btrtl_reprobe_worker(struct work_struct *work)
{}

static int h5_btrtl_resume(struct h5 *h5)
{}

static const struct acpi_gpio_params btrtl_device_wake_gpios =;
static const struct acpi_gpio_params btrtl_enable_gpios =;
static const struct acpi_gpio_params btrtl_host_wake_gpios =;
static const struct acpi_gpio_mapping acpi_btrtl_gpios[] =;

static struct h5_vnd rtl_vnd =;

static const struct h5_device_data h5_data_rtl8822cs =;

static const struct h5_device_data h5_data_rtl8723bs =;
#endif

#ifdef CONFIG_ACPI
static const struct acpi_device_id h5_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, h5_acpi_match);
#endif

static const struct dev_pm_ops h5_serdev_pm_ops =;

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

static struct serdev_device_driver h5_serdev_driver =;

int __init h5_init(void)
{}

int __exit h5_deinit(void)
{}