Commit bb70b680 authored by Douglas Gilbert's avatar Douglas Gilbert Committed by James Bottomley

Here is an update for scsi_debug that utilizes driverfs

support for per driver parameters added in lk 2.5.31

1.62 changes:
  - driverfs support for these options (more to come):
    /driverfs/bus/scsi/drivers/scsi_debug/delay [rw]
    /driverfs/bus/scsi/drivers/scsi_debug/num_devs [r]
    /driverfs/bus/scsi/drivers/scsi_debug/opts [rw]
  - start using some C99
  - fdisk requires EINVAL from unsupported ioctls
    (scsi_debug previously used ENOTTY)

1.61 changes:
  - simulate delayed responses, controlled by
    'scsi_debug_delay'
  - support REPORT LUNS
  - support more MODE SENSE pages
  - [following Doug Ledford's suggestion] do autosense
    (i.e. set Scsi_Cmnd::sense_buffer array appropriately
     when a status of CHECK CONDITION is set)
  - minor driverfs support
  - start adding error injection logic, see
    "scsi_debug_every_nth"

Doug Gilbert
parent fcc6fcc6
This diff is collapsed.
#ifndef _SCSI_DEBUG_H #ifndef _SCSI_DEBUG_H
#include <linux/types.h> #include <linux/types.h>
#include <linux/kdev_t.h>
static int scsi_debug_detect(Scsi_Host_Template *); static int scsi_debug_detect(Scsi_Host_Template *);
static int scsi_debug_release(struct Scsi_Host *);
/* static int scsi_debug_command(Scsi_Cmnd *); */ /* static int scsi_debug_command(Scsi_Cmnd *); */
static int scsi_debug_queuecommand(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *)); static int scsi_debug_queuecommand(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
static int scsi_debug_abort(Scsi_Cmnd *); static int scsi_debug_ioctl(Scsi_Device *, int, void *);
static int scsi_debug_biosparam(Disk *, struct block_device *, int[]); static int scsi_debug_biosparam(Disk *, struct block_device *, int[]);
static int scsi_debug_abort(Scsi_Cmnd *);
static int scsi_debug_bus_reset(Scsi_Cmnd *); static int scsi_debug_bus_reset(Scsi_Cmnd *);
static int scsi_debug_device_reset(Scsi_Cmnd *); static int scsi_debug_device_reset(Scsi_Cmnd *);
static int scsi_debug_host_reset(Scsi_Cmnd *); static int scsi_debug_host_reset(Scsi_Cmnd *);
...@@ -20,29 +23,29 @@ static const char * scsi_debug_info(struct Scsi_Host *); ...@@ -20,29 +23,29 @@ static const char * scsi_debug_info(struct Scsi_Host *);
/* /*
* This driver is written for the lk 2.5 series * This driver is written for the lk 2.5 series
*/ */
#define SCSI_DEBUG_CANQUEUE 255 #define SCSI_DEBUG_CANQUEUE 255 /* needs to be >= 1 */
#define SCSI_DEBUG_MAX_CMD_LEN 16 #define SCSI_DEBUG_MAX_CMD_LEN 16
#define SCSI_DEBUG_TEMPLATE \ static Scsi_Host_Template driver_template = {
{proc_info: scsi_debug_proc_info, \ .proc_info = scsi_debug_proc_info,
name: "SCSI DEBUG", \ .name = "SCSI DEBUG",
info: scsi_debug_info, \ .info = scsi_debug_info,
detect: scsi_debug_detect, \ .detect = scsi_debug_detect,
release: scsi_debug_release, \ .release = scsi_debug_release,
ioctl: scsi_debug_ioctl, \ .ioctl = scsi_debug_ioctl,
queuecommand: scsi_debug_queuecommand, \ .queuecommand = scsi_debug_queuecommand,
eh_abort_handler: scsi_debug_abort, \ .eh_abort_handler = scsi_debug_abort,
eh_bus_reset_handler: scsi_debug_bus_reset, \ .eh_bus_reset_handler = scsi_debug_bus_reset,
eh_device_reset_handler: scsi_debug_device_reset, \ .eh_device_reset_handler = scsi_debug_device_reset,
eh_host_reset_handler: scsi_debug_host_reset, \ .eh_host_reset_handler = scsi_debug_host_reset,
bios_param: scsi_debug_biosparam, \ .bios_param = scsi_debug_biosparam,
can_queue: SCSI_DEBUG_CANQUEUE, \ .can_queue = SCSI_DEBUG_CANQUEUE,
this_id: 7, \ .this_id = 7,
sg_tablesize: 64, \ .sg_tablesize = 64,
cmd_per_lun: 3, \ .cmd_per_lun = 3,
unchecked_isa_dma: 0, \ .unchecked_isa_dma = 0,
use_clustering: ENABLE_CLUSTERING, \ .use_clustering = ENABLE_CLUSTERING,
} }; /* the name 'driver_template' is used by scsi_module.c */
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment