#include <linux/module.h>
#include <linux/blkdev.h>
#include <linux/interrupt.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/string.h>
#include <linux/uaccess.h>
#include <linux/cdrom.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_ioctl.h>
#include <scsi/sg.h>
#include <scsi/scsi_dbg.h>
#include "scsi_logging.h"
#define NORMAL_RETRIES …
#define IOCTL_NORMAL_TIMEOUT …
#define MAX_BUF …
static int ioctl_probe(struct Scsi_Host *host, void __user *buffer)
{ … }
static int ioctl_internal_command(struct scsi_device *sdev, char *cmd,
int timeout, int retries)
{ … }
int scsi_set_medium_removal(struct scsi_device *sdev, char state)
{ … }
EXPORT_SYMBOL(…);
static int scsi_ioctl_get_pci(struct scsi_device *sdev, void __user *arg)
{ … }
static int sg_get_version(int __user *p)
{ … }
static int sg_set_timeout(struct scsi_device *sdev, int __user *p)
{ … }
static int sg_get_reserved_size(struct scsi_device *sdev, int __user *p)
{ … }
static int sg_set_reserved_size(struct scsi_device *sdev, int __user *p)
{ … }
static int sg_emulated_host(struct request_queue *q, int __user *p)
{ … }
static int scsi_get_idlun(struct scsi_device *sdev, void __user *argp)
{ … }
static int scsi_send_start_stop(struct scsi_device *sdev, int data)
{ … }
bool scsi_cmd_allowed(unsigned char *cmd, bool open_for_write)
{ … }
EXPORT_SYMBOL(…);
static int scsi_fill_sghdr_rq(struct scsi_device *sdev, struct request *rq,
struct sg_io_hdr *hdr, bool open_for_write)
{ … }
static int scsi_complete_sghdr_rq(struct request *rq, struct sg_io_hdr *hdr,
struct bio *bio)
{ … }
static int sg_io(struct scsi_device *sdev, struct sg_io_hdr *hdr,
bool open_for_write)
{ … }
static int sg_scsi_ioctl(struct request_queue *q, bool open_for_write,
struct scsi_ioctl_command __user *sic)
{ … }
int put_sg_io_hdr(const struct sg_io_hdr *hdr, void __user *argp)
{ … }
EXPORT_SYMBOL(…);
int get_sg_io_hdr(struct sg_io_hdr *hdr, const void __user *argp)
{ … }
EXPORT_SYMBOL(…);
#ifdef CONFIG_COMPAT
struct compat_cdrom_generic_command { … };
#endif
static int scsi_get_cdrom_generic_arg(struct cdrom_generic_command *cgc,
const void __user *arg)
{ … }
static int scsi_put_cdrom_generic_arg(const struct cdrom_generic_command *cgc,
void __user *arg)
{ … }
static int scsi_cdrom_send_packet(struct scsi_device *sdev, bool open_for_write,
void __user *arg)
{ … }
static int scsi_ioctl_sg_io(struct scsi_device *sdev, bool open_for_write,
void __user *argp)
{ … }
int scsi_ioctl(struct scsi_device *sdev, bool open_for_write, int cmd,
void __user *arg)
{ … }
EXPORT_SYMBOL(…);
int scsi_ioctl_block_when_processing_errors(struct scsi_device *sdev, int cmd,
bool ndelay)
{ … }
EXPORT_SYMBOL_GPL(…);