#include <linux/module.h>
#include <asm/unaligned.h>
#include <linux/atomic.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/poll.h>
#include <linux/skbuff.h>
#include <linux/miscdevice.h>
#include <linux/debugfs.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
#define VERSION …
static bool amp;
struct vhci_data { … };
static int vhci_open_dev(struct hci_dev *hdev)
{ … }
static int vhci_close_dev(struct hci_dev *hdev)
{ … }
static int vhci_flush(struct hci_dev *hdev)
{ … }
static int vhci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
{ … }
static int vhci_get_data_path_id(struct hci_dev *hdev, u8 *data_path_id)
{ … }
static int vhci_get_codec_config_data(struct hci_dev *hdev, __u8 type,
struct bt_codec *codec, __u8 *vnd_len,
__u8 **vnd_data)
{ … }
static bool vhci_wakeup(struct hci_dev *hdev)
{ … }
static ssize_t force_suspend_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{ … }
static void vhci_suspend_work(struct work_struct *work)
{ … }
static ssize_t force_suspend_write(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{ … }
static const struct file_operations force_suspend_fops = …;
static ssize_t force_wakeup_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t force_wakeup_write(struct file *file,
const char __user *user_buf, size_t count,
loff_t *ppos)
{ … }
static const struct file_operations force_wakeup_fops = …;
static int msft_opcode_set(void *data, u64 val)
{ … }
static int msft_opcode_get(void *data, u64 *val)
{ … }
DEFINE_DEBUGFS_ATTRIBUTE(…);
static ssize_t aosp_capable_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t aosp_capable_write(struct file *file,
const char __user *user_buf, size_t count,
loff_t *ppos)
{ … }
static const struct file_operations aosp_capable_fops = …;
static int vhci_setup(struct hci_dev *hdev)
{ … }
static void vhci_coredump(struct hci_dev *hdev)
{ … }
static void vhci_coredump_hdr(struct hci_dev *hdev, struct sk_buff *skb)
{ … }
#define MAX_COREDUMP_LINE_LEN …
struct devcoredump_test_data { … };
static inline void force_devcd_timeout(struct hci_dev *hdev,
unsigned int timeout)
{ … }
static ssize_t force_devcd_write(struct file *file, const char __user *user_buf,
size_t count, loff_t *ppos)
{ … }
static const struct file_operations force_devcoredump_fops = …;
static int __vhci_create_device(struct vhci_data *data, __u8 opcode)
{ … }
static int vhci_create_device(struct vhci_data *data, __u8 opcode)
{ … }
static inline ssize_t vhci_get_user(struct vhci_data *data,
struct iov_iter *from)
{ … }
static inline ssize_t vhci_put_user(struct vhci_data *data,
struct sk_buff *skb,
char __user *buf, int count)
{ … }
static ssize_t vhci_read(struct file *file,
char __user *buf, size_t count, loff_t *pos)
{ … }
static ssize_t vhci_write(struct kiocb *iocb, struct iov_iter *from)
{ … }
static __poll_t vhci_poll(struct file *file, poll_table *wait)
{ … }
static void vhci_open_timeout(struct work_struct *work)
{ … }
static int vhci_open(struct inode *inode, struct file *file)
{ … }
static int vhci_release(struct inode *inode, struct file *file)
{ … }
static const struct file_operations vhci_fops = …;
static struct miscdevice vhci_miscdev = …;
module_misc_device(…);
module_param(amp, bool, 0644);
MODULE_PARM_DESC(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_VERSION(…);
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;
MODULE_ALIAS_MISCDEV(…);