linux/drivers/scsi/xen-scsifront.c

/*
 * Xen SCSI frontend driver
 *
 * Copyright (c) 2008, FUJITSU Limited
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version 2
 * as published by the Free Software Foundation; or, when distributed
 * separately from the Linux kernel or incorporated into other
 * software packages, subject to the following license:
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this source file (the "Software"), to deal in the Software without
 * restriction, including without limitation the rights to use, copy, modify,
 * merge, publish, distribute, sublicense, and/or sell copies of the Software,
 * and to permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */

#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

/* Tuning point. */
#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)
{}

/*
 * Any exception handling (reset or abort) must be forwarded to the backend.
 * We have to wait until an answer is returned. This answer contains the
 * result to be returned to the requestor.
 */
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();