#include <linux/cred.h>
#include <linux/input.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/poll.h>
#include <linux/vbox_utils.h>
#include "vboxguest_core.h"
#define DEVICE_NAME …
#define DEVICE_NAME_USER …
#define VBOX_VENDORID …
#define VMMDEV_DEVICEID …
static DEFINE_MUTEX(vbg_gdev_mutex);
static struct vbg_dev *vbg_gdev;
static u32 vbg_misc_device_requestor(struct inode *inode)
{ … }
static int vbg_misc_device_open(struct inode *inode, struct file *filp)
{ … }
static int vbg_misc_device_user_open(struct inode *inode, struct file *filp)
{ … }
static int vbg_misc_device_close(struct inode *inode, struct file *filp)
{ … }
static long vbg_misc_device_ioctl(struct file *filp, unsigned int req,
unsigned long arg)
{ … }
static const struct file_operations vbg_misc_device_fops = …;
static const struct file_operations vbg_misc_device_user_fops = …;
static int vbg_input_open(struct input_dev *input)
{ … }
static void vbg_input_close(struct input_dev *input)
{ … }
static int vbg_create_input_device(struct vbg_dev *gdev)
{ … }
static ssize_t host_version_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t host_features_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR_RO(host_version);
static DEVICE_ATTR_RO(host_features);
static struct attribute *vbg_pci_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int vbg_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
{ … }
static void vbg_pci_remove(struct pci_dev *pci)
{ … }
struct vbg_dev *vbg_get_gdev(void)
{ … }
EXPORT_SYMBOL(…);
void vbg_put_gdev(struct vbg_dev *gdev)
{ … }
EXPORT_SYMBOL(…);
void vbg_linux_mouse_event(struct vbg_dev *gdev)
{ … }
static const struct pci_device_id vbg_pci_ids[] = …;
MODULE_DEVICE_TABLE(pci, vbg_pci_ids);
static struct pci_driver vbg_pci_driver = …;
module_pci_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;