linux/drivers/virt/vboxguest/vboxguest_linux.c

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * vboxguest linux pci driver, char-dev and input-device code,
 *
 * Copyright (C) 2006-2016 Oracle Corporation
 */

#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"

/** The device name. */
#define DEVICE_NAME
/** The device name for the device node open to everyone. */
#define DEVICE_NAME_USER
/** VirtualBox PCI vendor ID. */
#define VBOX_VENDORID
/** VMMDev PCI card product ID. */
#define VMMDEV_DEVICEID

/** Mutex protecting the global vbg_gdev pointer used by vbg_get/put_gdev. */
static DEFINE_MUTEX(vbg_gdev_mutex);
/** Global vbg_gdev pointer used by vbg_get/put_gdev. */
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)
{}

/**
 * vbg_misc_device_close - Close device.
 * @inode:		Pointer to inode info structure.
 * @filp:		Associated file pointer.
 *
 * Return: %0 on success, negated errno on failure.
 */
static int vbg_misc_device_close(struct inode *inode, struct file *filp)
{}

/**
 * vbg_misc_device_ioctl - Device I/O Control entry point.
 * @filp:		Associated file pointer.
 * @req:		The request specified to ioctl().
 * @arg:		The argument specified to ioctl().
 *
 * Return: %0 on success, negated errno on failure.
 */
static long vbg_misc_device_ioctl(struct file *filp, unsigned int req,
				  unsigned long arg)
{}

/* The file_operations structures. */
static const struct file_operations vbg_misc_device_fops =;
static const struct file_operations vbg_misc_device_user_fops =;

/*
 * Called when the input device is first opened.
 *
 * Sets up absolute mouse reporting.
 */
static int vbg_input_open(struct input_dev *input)
{}

/*
 * Called if all open handles to the input device are closed.
 *
 * Disables absolute reporting.
 */
static void vbg_input_close(struct input_dev *input)
{}

/*
 * Creates the kernel input device.
 *
 * Return: 0 on success, negated errno on failure.
 */
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();

/*
 * Does the PCI detection and init of the device.
 *
 * Return: 0 on success, negated errno on failure.
 */
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();

/*
 * Callback for mouse events.
 *
 * This is called at the end of the ISR, after leaving the event spinlock, if
 * VMMDEV_EVENT_MOUSE_POSITION_CHANGED was raised by the host.
 *
 * @gdev:		The device extension.
 */
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();