#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <linux/wait.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/spinlock.h>
#include <linux/sched.h>
#include <linux/blkdev.h>
#include <linux/pfn.h>
#include <linux/slab.h>
#include <linux/bitops.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi.h>
#include <scsi/scsi_host.h>
#include <xen/xen.h>
#include <xen/xenbus.h>
#include <xen/grant_table.h>
#include <xen/events.h>
#include <xen/page.h>
#include <xen/interface/grant_table.h>
#include <xen/interface/io/vscsiif.h>
#include <xen/interface/io/protocols.h>
#include <asm/xen/hypervisor.h>
#define VSCSIFRONT_OP_ADD_LUN …
#define VSCSIFRONT_OP_DEL_LUN …
#define VSCSIFRONT_OP_READD_LUN …
#define VSCSIIF_DEFAULT_CMD_PER_LUN …
#define VSCSIIF_MAX_TARGET …
#define VSCSIIF_MAX_LUN …
#define VSCSIIF_RING_SIZE …
#define VSCSIIF_MAX_REQS …
#define vscsiif_grants_sg(_sg) …
struct vscsifrnt_shadow { … };
struct vscsifrnt_info { … };
static DEFINE_MUTEX(scsifront_mutex);
static void scsifront_wake_up(struct vscsifrnt_info *info)
{ … }
static int scsifront_get_rqid(struct vscsifrnt_info *info)
{ … }
static int _scsifront_put_rqid(struct vscsifrnt_info *info, uint32_t id)
{ … }
static void scsifront_put_rqid(struct vscsifrnt_info *info, uint32_t id)
{ … }
static int scsifront_do_request(struct vscsifrnt_info *info,
struct vscsifrnt_shadow *shadow)
{ … }
static void scsifront_set_error(struct vscsifrnt_info *info, const char *msg)
{ … }
static void scsifront_gnttab_done(struct vscsifrnt_info *info,
struct vscsifrnt_shadow *shadow)
{ … }
static unsigned int scsifront_host_byte(int32_t rslt)
{ … }
static void scsifront_cdb_cmd_done(struct vscsifrnt_info *info,
struct vscsiif_response *ring_rsp)
{ … }
static void scsifront_sync_cmd_done(struct vscsifrnt_info *info,
struct vscsiif_response *ring_rsp)
{ … }
static void scsifront_do_response(struct vscsifrnt_info *info,
struct vscsiif_response *ring_rsp)
{ … }
static int scsifront_ring_drain(struct vscsifrnt_info *info,
unsigned int *eoiflag)
{ … }
static int scsifront_cmd_done(struct vscsifrnt_info *info,
unsigned int *eoiflag)
{ … }
static irqreturn_t scsifront_irq_fn(int irq, void *dev_id)
{ … }
static void scsifront_finish_all(struct vscsifrnt_info *info)
{ … }
static int map_data_for_request(struct vscsifrnt_info *info,
struct scsi_cmnd *sc,
struct vscsifrnt_shadow *shadow)
{ … }
static int scsifront_enter(struct vscsifrnt_info *info)
{ … }
static void scsifront_return(struct vscsifrnt_info *info)
{ … }
static int scsifront_queuecommand(struct Scsi_Host *shost,
struct scsi_cmnd *sc)
{ … }
static int scsifront_action_handler(struct scsi_cmnd *sc, uint8_t act)
{ … }
static int scsifront_eh_abort_handler(struct scsi_cmnd *sc)
{ … }
static int scsifront_dev_reset_handler(struct scsi_cmnd *sc)
{ … }
static int scsifront_sdev_configure(struct scsi_device *sdev)
{ … }
static void scsifront_sdev_destroy(struct scsi_device *sdev)
{ … }
static const struct scsi_host_template scsifront_sht = …;
static int scsifront_alloc_ring(struct vscsifrnt_info *info)
{ … }
static void scsifront_free_ring(struct vscsifrnt_info *info)
{ … }
static int scsifront_init_ring(struct vscsifrnt_info *info)
{ … }
static int scsifront_probe(struct xenbus_device *dev,
const struct xenbus_device_id *id)
{ … }
static int scsifront_resume(struct xenbus_device *dev)
{ … }
static int scsifront_suspend(struct xenbus_device *dev)
{ … }
static void scsifront_remove(struct xenbus_device *dev)
{ … }
static void scsifront_disconnect(struct vscsifrnt_info *info)
{ … }
static void scsifront_do_lun_hotplug(struct vscsifrnt_info *info, int op)
{ … }
static void scsifront_read_backend_params(struct xenbus_device *dev,
struct vscsifrnt_info *info)
{ … }
static void scsifront_backend_changed(struct xenbus_device *dev,
enum xenbus_state backend_state)
{ … }
static const struct xenbus_device_id scsifront_ids[] = …;
static struct xenbus_driver scsifront_driver = …;
static int __init scsifront_init(void)
{ … }
module_init(…) …;
static void __exit scsifront_exit(void)
{ … }
module_exit(scsifront_exit);
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;
MODULE_AUTHOR(…) …;