Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
scsi_debug.c File Reference
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/timer.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/genhd.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/proc_fs.h>
#include <linux/vmalloc.h>
#include <linux/moduleparam.h>
#include <linux/scatterlist.h>
#include <linux/blkdev.h>
#include <linux/crc-t10dif.h>
#include <net/checksum.h>
#include <asm/unaligned.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_host.h>
#include <scsi/scsicam.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_dbg.h>
#include "sd.h"
#include "scsi_logging.h"

Go to the source code of this file.

Data Structures

struct  sdebug_dev_info
 
struct  sdebug_host_info
 
struct  sdebug_queued_cmd
 
struct  unmap_block_desc
 

Macros

#define SCSI_DEBUG_VERSION   "1.82"
 
#define NO_ADDITIONAL_SENSE   0x0
 
#define LOGICAL_UNIT_NOT_READY   0x4
 
#define UNRECOVERED_READ_ERR   0x11
 
#define PARAMETER_LIST_LENGTH_ERR   0x1a
 
#define INVALID_OPCODE   0x20
 
#define ADDR_OUT_OF_RANGE   0x21
 
#define INVALID_COMMAND_OPCODE   0x20
 
#define INVALID_FIELD_IN_CDB   0x24
 
#define INVALID_FIELD_IN_PARAM_LIST   0x26
 
#define POWERON_RESET   0x29
 
#define SAVING_PARAMS_UNSUP   0x39
 
#define TRANSPORT_PROBLEM   0x4b
 
#define THRESHOLD_EXCEEDED   0x5d
 
#define LOW_POWER_COND_ON   0x5e
 
#define ACK_NAK_TO   0x3
 
#define SDEBUG_TAGGED_QUEUING   0 /* 0 | MSG_SIMPLE_TAG | MSG_ORDERED_TAG */
 
#define DEF_NUM_HOST   1
 
#define DEF_NUM_TGTS   1
 
#define DEF_MAX_LUNS   1
 
#define DEF_ATO   1
 
#define DEF_DELAY   1
 
#define DEF_DEV_SIZE_MB   8
 
#define DEF_DIF   0
 
#define DEF_DIX   0
 
#define DEF_D_SENSE   0
 
#define DEF_EVERY_NTH   0
 
#define DEF_FAKE_RW   0
 
#define DEF_GUARD   0
 
#define DEF_LBPU   0
 
#define DEF_LBPWS   0
 
#define DEF_LBPWS10   0
 
#define DEF_LBPRZ   1
 
#define DEF_LOWEST_ALIGNED   0
 
#define DEF_NO_LUN_0   0
 
#define DEF_NUM_PARTS   0
 
#define DEF_OPTS   0
 
#define DEF_OPT_BLKS   64
 
#define DEF_PHYSBLK_EXP   0
 
#define DEF_PTYPE   0
 
#define DEF_REMOVABLE   false
 
#define DEF_SCSI_LEVEL   5 /* INQUIRY, byte2 [5->SPC-3] */
 
#define DEF_SECTOR_SIZE   512
 
#define DEF_UNMAP_ALIGNMENT   0
 
#define DEF_UNMAP_GRANULARITY   1
 
#define DEF_UNMAP_MAX_BLOCKS   0xFFFFFFFF
 
#define DEF_UNMAP_MAX_DESC   256
 
#define DEF_VIRTUAL_GB   0
 
#define DEF_VPD_USE_HOSTNO   1
 
#define DEF_WRITESAME_LENGTH   0xFFFF
 
#define SCSI_DEBUG_OPT_NOISE   1
 
#define SCSI_DEBUG_OPT_MEDIUM_ERR   2
 
#define SCSI_DEBUG_OPT_TIMEOUT   4
 
#define SCSI_DEBUG_OPT_RECOVERED_ERR   8
 
#define SCSI_DEBUG_OPT_TRANSPORT_ERR   16
 
#define SCSI_DEBUG_OPT_DIF_ERR   32
 
#define SCSI_DEBUG_OPT_DIX_ERR   64
 
#define SCSI_DEBUG_OPT_MAC_TIMEOUT   128
 
#define OPT_MEDIUM_ERR_ADDR   0x1234 /* that's sector 4660 in decimal */
 
#define OPT_MEDIUM_ERR_NUM   10 /* number of consecutive medium errs */
 
#define SAM2_LUN_ADDRESS_METHOD   0
 
#define SAM2_WLUN_REPORT_LUNS   0xc101
 
#define SCSI_DEBUG_CANQUEUE   255
 
#define DEV_READONLY(TGT)   (0)
 
#define SDEBUG_MAX_PARTS   4
 
#define SDEBUG_SENSE_LEN   32
 
#define SCSI_DEBUG_MAX_CMD_LEN   32
 
#define to_sdebug_host(d)   container_of(d, struct sdebug_host_info, dev)
 
#define SDEBUG_LONG_INQ_SZ   96
 
#define SDEBUG_MAX_INQ_ARR_SZ   584
 
#define SDEBUG_READCAP_ARR_SZ   8
 
#define SDEBUG_READCAP16_ARR_SZ   32
 
#define SDEBUG_MAX_TGTPGS_ARR_SZ   1412
 
#define SDEBUG_MAX_MSENSE_SZ   256
 
#define SDEBUG_MAX_MSELECT_SZ   512
 
#define SDEBUG_MAX_LSENSE_SZ   512
 
#define SDEBUG_GET_LBA_STATUS_LEN   32
 
#define SDEBUG_RLUN_ARR_SZ   256
 

Typedefs

typedef void(* done_funct_t )(struct scsi_cmnd *)
 

Functions

void dump_sector (unsigned char *buf, int len)
 
 module_param_named (add_host, scsi_debug_add_host, int, S_IRUGO|S_IWUSR)
 
 module_param_named (ato, scsi_debug_ato, int, S_IRUGO)
 
 module_param_named (delay, scsi_debug_delay, int, S_IRUGO|S_IWUSR)
 
 module_param_named (dev_size_mb, scsi_debug_dev_size_mb, int, S_IRUGO)
 
 module_param_named (dif, scsi_debug_dif, int, S_IRUGO)
 
 module_param_named (dix, scsi_debug_dix, int, S_IRUGO)
 
 module_param_named (dsense, scsi_debug_dsense, int, S_IRUGO|S_IWUSR)
 
 module_param_named (every_nth, scsi_debug_every_nth, int, S_IRUGO|S_IWUSR)
 
 module_param_named (fake_rw, scsi_debug_fake_rw, int, S_IRUGO|S_IWUSR)
 
 module_param_named (guard, scsi_debug_guard, int, S_IRUGO)
 
 module_param_named (lbpu, scsi_debug_lbpu, int, S_IRUGO)
 
 module_param_named (lbpws, scsi_debug_lbpws, int, S_IRUGO)
 
 module_param_named (lbpws10, scsi_debug_lbpws10, int, S_IRUGO)
 
 module_param_named (lbprz, scsi_debug_lbprz, int, S_IRUGO)
 
 module_param_named (lowest_aligned, scsi_debug_lowest_aligned, int, S_IRUGO)
 
 module_param_named (max_luns, scsi_debug_max_luns, int, S_IRUGO|S_IWUSR)
 
 module_param_named (max_queue, scsi_debug_max_queue, int, S_IRUGO|S_IWUSR)
 
 module_param_named (no_lun_0, scsi_debug_no_lun_0, int, S_IRUGO|S_IWUSR)
 
 module_param_named (no_uld, scsi_debug_no_uld, int, S_IRUGO)
 
 module_param_named (num_parts, scsi_debug_num_parts, int, S_IRUGO)
 
 module_param_named (num_tgts, scsi_debug_num_tgts, int, S_IRUGO|S_IWUSR)
 
 module_param_named (opt_blks, scsi_debug_opt_blks, int, S_IRUGO)
 
 module_param_named (opts, scsi_debug_opts, int, S_IRUGO|S_IWUSR)
 
 module_param_named (physblk_exp, scsi_debug_physblk_exp, int, S_IRUGO)
 
 module_param_named (ptype, scsi_debug_ptype, int, S_IRUGO|S_IWUSR)
 
 module_param_named (removable, scsi_debug_removable, bool, S_IRUGO|S_IWUSR)
 
 module_param_named (scsi_level, scsi_debug_scsi_level, int, S_IRUGO)
 
 module_param_named (sector_size, scsi_debug_sector_size, int, S_IRUGO)
 
 module_param_named (unmap_alignment, scsi_debug_unmap_alignment, int, S_IRUGO)
 
 module_param_named (unmap_granularity, scsi_debug_unmap_granularity, int, S_IRUGO)
 
 module_param_named (unmap_max_blocks, scsi_debug_unmap_max_blocks, int, S_IRUGO)
 
 module_param_named (unmap_max_desc, scsi_debug_unmap_max_desc, int, S_IRUGO)
 
 module_param_named (virtual_gb, scsi_debug_virtual_gb, int, S_IRUGO|S_IWUSR)
 
 module_param_named (vpd_use_hostno, scsi_debug_vpd_use_hostno, int, S_IRUGO|S_IWUSR)
 
 module_param_named (write_same_length, scsi_debug_write_same_length, int, S_IRUGO|S_IWUSR)
 
 MODULE_AUTHOR ("Eric Youngdale + Douglas Gilbert")
 
 MODULE_DESCRIPTION ("SCSI debug adapter driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_VERSION (SCSI_DEBUG_VERSION)
 
 MODULE_PARM_DESC (add_host,"0..127 hosts allowed(def=1)")
 
 MODULE_PARM_DESC (ato,"application tag ownership: 0=disk 1=host (def=1)")
 
 MODULE_PARM_DESC (delay,"# of jiffies to delay response(def=1)")
 
 MODULE_PARM_DESC (dev_size_mb,"size in MB of ram shared by devs(def=8)")
 
 MODULE_PARM_DESC (dif,"data integrity field type: 0-3 (def=0)")
 
 MODULE_PARM_DESC (dix,"data integrity extensions mask (def=0)")
 
 MODULE_PARM_DESC (dsense,"use descriptor sense format(def=0 -> fixed)")
 
 MODULE_PARM_DESC (every_nth,"timeout every nth command(def=0)")
 
 MODULE_PARM_DESC (fake_rw,"fake reads/writes instead of copying (def=0)")
 
 MODULE_PARM_DESC (guard,"protection checksum: 0=crc, 1=ip (def=0)")
 
 MODULE_PARM_DESC (lbpu,"enable LBP, support UNMAP command (def=0)")
 
 MODULE_PARM_DESC (lbpws,"enable LBP, support WRITE SAME(16) with UNMAP bit (def=0)")
 
 MODULE_PARM_DESC (lbpws10,"enable LBP, support WRITE SAME(10) with UNMAP bit (def=0)")
 
 MODULE_PARM_DESC (lbprz,"unmapped blocks return 0 on read (def=1)")
 
 MODULE_PARM_DESC (lowest_aligned,"lowest aligned lba (def=0)")
 
 MODULE_PARM_DESC (max_luns,"number of LUNs per target to simulate(def=1)")
 
 MODULE_PARM_DESC (max_queue,"max number of queued commands (1 to 255(def))")
 
 MODULE_PARM_DESC (no_lun_0,"no LU number 0 (def=0 -> have lun 0)")
 
 MODULE_PARM_DESC (no_uld,"stop ULD (e.g. sd driver) attaching (def=0))")
 
 MODULE_PARM_DESC (num_parts,"number of partitions(def=0)")
 
 MODULE_PARM_DESC (num_tgts,"number of targets per host to simulate(def=1)")
 
 MODULE_PARM_DESC (opt_blks,"optimal transfer length in block (def=64)")
 
 MODULE_PARM_DESC (opts,"1->noise, 2->medium_err, 4->timeout, 8->recovered_err... (def=0)")
 
 MODULE_PARM_DESC (physblk_exp,"physical block exponent (def=0)")
 
 MODULE_PARM_DESC (ptype,"SCSI peripheral type(def=0[disk])")
 
 MODULE_PARM_DESC (removable,"claim to have removable media (def=0)")
 
 MODULE_PARM_DESC (scsi_level,"SCSI level to simulate(def=5[SPC-3])")
 
 MODULE_PARM_DESC (sector_size,"logical block size in bytes (def=512)")
 
 MODULE_PARM_DESC (unmap_alignment,"lowest aligned thin provisioning lba (def=0)")
 
 MODULE_PARM_DESC (unmap_granularity,"thin provisioning granularity in blocks (def=1)")
 
 MODULE_PARM_DESC (unmap_max_blocks,"max # of blocks can be unmapped in one cmd (def=0xffffffff)")
 
 MODULE_PARM_DESC (unmap_max_desc,"max # of ranges that can be unmapped in one cmd (def=256)")
 
 MODULE_PARM_DESC (virtual_gb,"virtual gigabyte size (def=0 -> use dev_size_mb)")
 
 MODULE_PARM_DESC (vpd_use_hostno,"0 -> dev ids ignore hostno (def=1 -> unique dev ids)")
 
 MODULE_PARM_DESC (write_same_length,"Maximum blocks per WRITE SAME cmd (def=0xffff)")
 
 DRIVER_ATTR (delay, S_IRUGO|S_IWUSR, sdebug_delay_show, sdebug_delay_store)
 
 DRIVER_ATTR (opts, S_IRUGO|S_IWUSR, sdebug_opts_show, sdebug_opts_store)
 
 DRIVER_ATTR (ptype, S_IRUGO|S_IWUSR, sdebug_ptype_show, sdebug_ptype_store)
 
 DRIVER_ATTR (dsense, S_IRUGO|S_IWUSR, sdebug_dsense_show, sdebug_dsense_store)
 
 DRIVER_ATTR (fake_rw, S_IRUGO|S_IWUSR, sdebug_fake_rw_show, sdebug_fake_rw_store)
 
 DRIVER_ATTR (no_lun_0, S_IRUGO|S_IWUSR, sdebug_no_lun_0_show, sdebug_no_lun_0_store)
 
 DRIVER_ATTR (num_tgts, S_IRUGO|S_IWUSR, sdebug_num_tgts_show, sdebug_num_tgts_store)
 
 DRIVER_ATTR (dev_size_mb, S_IRUGO, sdebug_dev_size_mb_show, NULL)
 
 DRIVER_ATTR (num_parts, S_IRUGO, sdebug_num_parts_show, NULL)
 
 DRIVER_ATTR (every_nth, S_IRUGO|S_IWUSR, sdebug_every_nth_show, sdebug_every_nth_store)
 
 DRIVER_ATTR (max_luns, S_IRUGO|S_IWUSR, sdebug_max_luns_show, sdebug_max_luns_store)
 
 DRIVER_ATTR (max_queue, S_IRUGO|S_IWUSR, sdebug_max_queue_show, sdebug_max_queue_store)
 
 DRIVER_ATTR (no_uld, S_IRUGO, sdebug_no_uld_show, NULL)
 
 DRIVER_ATTR (scsi_level, S_IRUGO, sdebug_scsi_level_show, NULL)
 
 DRIVER_ATTR (virtual_gb, S_IRUGO|S_IWUSR, sdebug_virtual_gb_show, sdebug_virtual_gb_store)
 
 DRIVER_ATTR (add_host, S_IRUGO|S_IWUSR, sdebug_add_host_show, sdebug_add_host_store)
 
 DRIVER_ATTR (vpd_use_hostno, S_IRUGO|S_IWUSR, sdebug_vpd_use_hostno_show, sdebug_vpd_use_hostno_store)
 
 DRIVER_ATTR (sector_size, S_IRUGO, sdebug_sector_size_show, NULL)
 
 DRIVER_ATTR (dix, S_IRUGO, sdebug_dix_show, NULL)
 
 DRIVER_ATTR (dif, S_IRUGO, sdebug_dif_show, NULL)
 
 DRIVER_ATTR (guard, S_IRUGO, sdebug_guard_show, NULL)
 
 DRIVER_ATTR (ato, S_IRUGO, sdebug_ato_show, NULL)
 
 DRIVER_ATTR (map, S_IRUGO, sdebug_map_show, NULL)
 
 DRIVER_ATTR (removable, S_IRUGO|S_IWUSR, sdebug_removable_show, sdebug_removable_store)
 
 device_initcall (scsi_debug_init)
 
 module_exit (scsi_debug_exit)
 

Variables

struct devicepseudo_primary
 

Macro Definition Documentation

#define ACK_NAK_TO   0x3

Definition at line 81 of file scsi_debug.c.

#define ADDR_OUT_OF_RANGE   0x21

Definition at line 70 of file scsi_debug.c.

#define DEF_ATO   1

Definition at line 92 of file scsi_debug.c.

#define DEF_D_SENSE   0

Definition at line 97 of file scsi_debug.c.

#define DEF_DELAY   1

Definition at line 93 of file scsi_debug.c.

#define DEF_DEV_SIZE_MB   8

Definition at line 94 of file scsi_debug.c.

#define DEF_DIF   0

Definition at line 95 of file scsi_debug.c.

#define DEF_DIX   0

Definition at line 96 of file scsi_debug.c.

#define DEF_EVERY_NTH   0

Definition at line 98 of file scsi_debug.c.

#define DEF_FAKE_RW   0

Definition at line 99 of file scsi_debug.c.

#define DEF_GUARD   0

Definition at line 100 of file scsi_debug.c.

#define DEF_LBPRZ   1

Definition at line 104 of file scsi_debug.c.

#define DEF_LBPU   0

Definition at line 101 of file scsi_debug.c.

#define DEF_LBPWS   0

Definition at line 102 of file scsi_debug.c.

#define DEF_LBPWS10   0

Definition at line 103 of file scsi_debug.c.

#define DEF_LOWEST_ALIGNED   0

Definition at line 105 of file scsi_debug.c.

#define DEF_MAX_LUNS   1

Definition at line 88 of file scsi_debug.c.

#define DEF_NO_LUN_0   0

Definition at line 106 of file scsi_debug.c.

#define DEF_NUM_HOST   1

Definition at line 86 of file scsi_debug.c.

#define DEF_NUM_PARTS   0

Definition at line 107 of file scsi_debug.c.

#define DEF_NUM_TGTS   1

Definition at line 87 of file scsi_debug.c.

#define DEF_OPT_BLKS   64

Definition at line 109 of file scsi_debug.c.

#define DEF_OPTS   0

Definition at line 108 of file scsi_debug.c.

#define DEF_PHYSBLK_EXP   0

Definition at line 110 of file scsi_debug.c.

#define DEF_PTYPE   0

Definition at line 111 of file scsi_debug.c.

#define DEF_REMOVABLE   false

Definition at line 112 of file scsi_debug.c.

#define DEF_SCSI_LEVEL   5 /* INQUIRY, byte2 [5->SPC-3] */

Definition at line 113 of file scsi_debug.c.

#define DEF_SECTOR_SIZE   512

Definition at line 114 of file scsi_debug.c.

#define DEF_UNMAP_ALIGNMENT   0

Definition at line 115 of file scsi_debug.c.

#define DEF_UNMAP_GRANULARITY   1

Definition at line 116 of file scsi_debug.c.

#define DEF_UNMAP_MAX_BLOCKS   0xFFFFFFFF

Definition at line 117 of file scsi_debug.c.

#define DEF_UNMAP_MAX_DESC   256

Definition at line 118 of file scsi_debug.c.

#define DEF_VIRTUAL_GB   0

Definition at line 119 of file scsi_debug.c.

#define DEF_VPD_USE_HOSTNO   1

Definition at line 120 of file scsi_debug.c.

#define DEF_WRITESAME_LENGTH   0xFFFF

Definition at line 121 of file scsi_debug.c.

#define DEV_READONLY (   TGT)    (0)

Definition at line 201 of file scsi_debug.c.

#define INVALID_COMMAND_OPCODE   0x20

Definition at line 71 of file scsi_debug.c.

#define INVALID_FIELD_IN_CDB   0x24

Definition at line 72 of file scsi_debug.c.

#define INVALID_FIELD_IN_PARAM_LIST   0x26

Definition at line 73 of file scsi_debug.c.

#define INVALID_OPCODE   0x20

Definition at line 69 of file scsi_debug.c.

#define LOGICAL_UNIT_NOT_READY   0x4

Definition at line 66 of file scsi_debug.c.

#define LOW_POWER_COND_ON   0x5e

Definition at line 78 of file scsi_debug.c.

#define NO_ADDITIONAL_SENSE   0x0

Definition at line 65 of file scsi_debug.c.

#define OPT_MEDIUM_ERR_ADDR   0x1234 /* that's sector 4660 in decimal */

Definition at line 151 of file scsi_debug.c.

#define OPT_MEDIUM_ERR_NUM   10 /* number of consecutive medium errs */

Definition at line 152 of file scsi_debug.c.

#define PARAMETER_LIST_LENGTH_ERR   0x1a

Definition at line 68 of file scsi_debug.c.

#define POWERON_RESET   0x29

Definition at line 74 of file scsi_debug.c.

#define SAM2_LUN_ADDRESS_METHOD   0

Definition at line 156 of file scsi_debug.c.

#define SAM2_WLUN_REPORT_LUNS   0xc101

Definition at line 157 of file scsi_debug.c.

#define SAVING_PARAMS_UNSUP   0x39

Definition at line 75 of file scsi_debug.c.

#define SCSI_DEBUG_CANQUEUE   255

Definition at line 161 of file scsi_debug.c.

#define SCSI_DEBUG_MAX_CMD_LEN   32

Definition at line 216 of file scsi_debug.c.

#define SCSI_DEBUG_OPT_DIF_ERR   32

Definition at line 129 of file scsi_debug.c.

#define SCSI_DEBUG_OPT_DIX_ERR   64

Definition at line 130 of file scsi_debug.c.

#define SCSI_DEBUG_OPT_MAC_TIMEOUT   128

Definition at line 131 of file scsi_debug.c.

#define SCSI_DEBUG_OPT_MEDIUM_ERR   2

Definition at line 125 of file scsi_debug.c.

#define SCSI_DEBUG_OPT_NOISE   1

Definition at line 124 of file scsi_debug.c.

#define SCSI_DEBUG_OPT_RECOVERED_ERR   8

Definition at line 127 of file scsi_debug.c.

#define SCSI_DEBUG_OPT_TIMEOUT   4

Definition at line 126 of file scsi_debug.c.

#define SCSI_DEBUG_OPT_TRANSPORT_ERR   16

Definition at line 128 of file scsi_debug.c.

#define SCSI_DEBUG_VERSION   "1.82"

Definition at line 61 of file scsi_debug.c.

#define SDEBUG_GET_LBA_STATUS_LEN   32

Definition at line 2209 of file scsi_debug.c.

#define SDEBUG_LONG_INQ_SZ   96

Definition at line 802 of file scsi_debug.c.

#define SDEBUG_MAX_INQ_ARR_SZ   584

Definition at line 803 of file scsi_debug.c.

#define SDEBUG_MAX_LSENSE_SZ   512

Definition at line 1594 of file scsi_debug.c.

#define SDEBUG_MAX_MSELECT_SZ   512

Definition at line 1496 of file scsi_debug.c.

#define SDEBUG_MAX_MSENSE_SZ   256

Definition at line 1331 of file scsi_debug.c.

#define SDEBUG_MAX_PARTS   4

Definition at line 212 of file scsi_debug.c.

#define SDEBUG_MAX_TGTPGS_ARR_SZ   1412

Definition at line 1097 of file scsi_debug.c.

#define SDEBUG_READCAP16_ARR_SZ   32

Definition at line 1054 of file scsi_debug.c.

#define SDEBUG_READCAP_ARR_SZ   8

Definition at line 1024 of file scsi_debug.c.

#define SDEBUG_RLUN_ARR_SZ   256

Definition at line 2244 of file scsi_debug.c.

#define SDEBUG_SENSE_LEN   32

Definition at line 214 of file scsi_debug.c.

#define SDEBUG_TAGGED_QUEUING   0 /* 0 | MSG_SIMPLE_TAG | MSG_ORDERED_TAG */

Definition at line 83 of file scsi_debug.c.

#define THRESHOLD_EXCEEDED   0x5d

Definition at line 77 of file scsi_debug.c.

#define to_sdebug_host (   d)    container_of(d, struct sdebug_host_info, dev)

Definition at line 243 of file scsi_debug.c.

#define TRANSPORT_PROBLEM   0x4b

Definition at line 76 of file scsi_debug.c.

#define UNRECOVERED_READ_ERR   0x11

Definition at line 67 of file scsi_debug.c.

Typedef Documentation

typedef void(* done_funct_t)(struct scsi_cmnd *)

Definition at line 249 of file scsi_debug.c.

Function Documentation

device_initcall ( scsi_debug_init  )
DRIVER_ATTR ( delay  ,
S_IRUGO S_IWUSR,
sdebug_delay_show  ,
sdebug_delay_store   
)
DRIVER_ATTR ( opts  ,
S_IRUGO S_IWUSR,
sdebug_opts_show  ,
sdebug_opts_store   
)
DRIVER_ATTR ( ptype  ,
S_IRUGO S_IWUSR,
sdebug_ptype_show  ,
sdebug_ptype_store   
)
DRIVER_ATTR ( dsense  ,
S_IRUGO S_IWUSR,
sdebug_dsense_show  ,
sdebug_dsense_store   
)
DRIVER_ATTR ( fake_rw  ,
S_IRUGO S_IWUSR,
sdebug_fake_rw_show  ,
sdebug_fake_rw_store   
)
DRIVER_ATTR ( no_lun_0  ,
S_IRUGO S_IWUSR,
sdebug_no_lun_0_show  ,
sdebug_no_lun_0_store   
)
DRIVER_ATTR ( num_tgts  ,
S_IRUGO S_IWUSR,
sdebug_num_tgts_show  ,
sdebug_num_tgts_store   
)
DRIVER_ATTR ( dev_size_mb  ,
S_IRUGO  ,
sdebug_dev_size_mb_show  ,
NULL   
)
DRIVER_ATTR ( num_parts  ,
S_IRUGO  ,
sdebug_num_parts_show  ,
NULL   
)
DRIVER_ATTR ( every_nth  ,
S_IRUGO S_IWUSR,
sdebug_every_nth_show  ,
sdebug_every_nth_store   
)
DRIVER_ATTR ( max_luns  ,
S_IRUGO S_IWUSR,
sdebug_max_luns_show  ,
sdebug_max_luns_store   
)
DRIVER_ATTR ( max_queue  ,
S_IRUGO S_IWUSR,
sdebug_max_queue_show  ,
sdebug_max_queue_store   
)
DRIVER_ATTR ( no_uld  ,
S_IRUGO  ,
sdebug_no_uld_show  ,
NULL   
)
DRIVER_ATTR ( scsi_level  ,
S_IRUGO  ,
sdebug_scsi_level_show  ,
NULL   
)
DRIVER_ATTR ( virtual_gb  ,
S_IRUGO S_IWUSR,
sdebug_virtual_gb_show  ,
sdebug_virtual_gb_store   
)
DRIVER_ATTR ( add_host  ,
S_IRUGO S_IWUSR,
sdebug_add_host_show  ,
sdebug_add_host_store   
)
DRIVER_ATTR ( vpd_use_hostno  ,
S_IRUGO S_IWUSR,
sdebug_vpd_use_hostno_show  ,
sdebug_vpd_use_hostno_store   
)
DRIVER_ATTR ( sector_size  ,
S_IRUGO  ,
sdebug_sector_size_show  ,
NULL   
)
DRIVER_ATTR ( dix  ,
S_IRUGO  ,
sdebug_dix_show  ,
NULL   
)
DRIVER_ATTR ( dif  ,
S_IRUGO  ,
sdebug_dif_show  ,
NULL   
)
DRIVER_ATTR ( guard  ,
S_IRUGO  ,
sdebug_guard_show  ,
NULL   
)
DRIVER_ATTR ( ato  ,
S_IRUGO  ,
sdebug_ato_show  ,
NULL   
)
DRIVER_ATTR ( map  ,
S_IRUGO  ,
sdebug_map_show  ,
NULL   
)
DRIVER_ATTR ( removable  ,
S_IRUGO S_IWUSR,
sdebug_removable_show  ,
sdebug_removable_store   
)
void dump_sector ( unsigned char buf,
int  len 
)

Definition at line 1855 of file scsi_debug.c.

MODULE_AUTHOR ( "Eric Youngdale + Douglas Gilbert"  )
MODULE_DESCRIPTION ( "SCSI debug adapter driver )
module_exit ( scsi_debug_exit  )
MODULE_LICENSE ( "GPL"  )
module_param_named ( add_host  ,
scsi_debug_add_host  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( ato  ,
scsi_debug_ato  ,
int  ,
S_IRUGO   
)
module_param_named ( delay  ,
scsi_debug_delay  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( dev_size_mb  ,
scsi_debug_dev_size_mb  ,
int  ,
S_IRUGO   
)
module_param_named ( dif  ,
scsi_debug_dif  ,
int  ,
S_IRUGO   
)
module_param_named ( dix  ,
scsi_debug_dix  ,
int  ,
S_IRUGO   
)
module_param_named ( dsense  ,
scsi_debug_dsense  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( every_nth  ,
scsi_debug_every_nth  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( fake_rw  ,
scsi_debug_fake_rw  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( guard  ,
scsi_debug_guard  ,
int  ,
S_IRUGO   
)
module_param_named ( lbpu  ,
scsi_debug_lbpu  ,
int  ,
S_IRUGO   
)
module_param_named ( lbpws  ,
scsi_debug_lbpws  ,
int  ,
S_IRUGO   
)
module_param_named ( lbpws10  ,
scsi_debug_lbpws10  ,
int  ,
S_IRUGO   
)
module_param_named ( lbprz  ,
scsi_debug_lbprz  ,
int  ,
S_IRUGO   
)
module_param_named ( lowest_aligned  ,
scsi_debug_lowest_aligned  ,
int  ,
S_IRUGO   
)
module_param_named ( max_luns  ,
scsi_debug_max_luns  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( max_queue  ,
scsi_debug_max_queue  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( no_lun_0  ,
scsi_debug_no_lun_0  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( no_uld  ,
scsi_debug_no_uld  ,
int  ,
S_IRUGO   
)
module_param_named ( num_parts  ,
scsi_debug_num_parts  ,
int  ,
S_IRUGO   
)
module_param_named ( num_tgts  ,
scsi_debug_num_tgts  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( opt_blks  ,
scsi_debug_opt_blks  ,
int  ,
S_IRUGO   
)
module_param_named ( opts  ,
scsi_debug_opts  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( physblk_exp  ,
scsi_debug_physblk_exp  ,
int  ,
S_IRUGO   
)
module_param_named ( ptype  ,
scsi_debug_ptype  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( removable  ,
scsi_debug_removable  ,
bool  ,
S_IRUGO S_IWUSR 
)
module_param_named ( scsi_level  ,
scsi_debug_scsi_level  ,
int  ,
S_IRUGO   
)
module_param_named ( sector_size  ,
scsi_debug_sector_size  ,
int  ,
S_IRUGO   
)
module_param_named ( unmap_alignment  ,
scsi_debug_unmap_alignment  ,
int  ,
S_IRUGO   
)
module_param_named ( unmap_granularity  ,
scsi_debug_unmap_granularity  ,
int  ,
S_IRUGO   
)
module_param_named ( unmap_max_blocks  ,
scsi_debug_unmap_max_blocks  ,
int  ,
S_IRUGO   
)
module_param_named ( unmap_max_desc  ,
scsi_debug_unmap_max_desc  ,
int  ,
S_IRUGO   
)
module_param_named ( virtual_gb  ,
scsi_debug_virtual_gb  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( vpd_use_hostno  ,
scsi_debug_vpd_use_hostno  ,
int  ,
S_IRUGO S_IWUSR 
)
module_param_named ( write_same_length  ,
scsi_debug_write_same_length  ,
int  ,
S_IRUGO S_IWUSR 
)
MODULE_PARM_DESC ( add_host  ,
"0..127 hosts allowed(def=1)"   
)
MODULE_PARM_DESC ( ato  )
MODULE_PARM_DESC ( delay  ,
"# of jiffies to delay response(def=1)"   
)
MODULE_PARM_DESC ( dev_size_mb  ,
"size in MB of ram shared by devs(def=8)"   
)
MODULE_PARM_DESC ( dif  ,
"data integrity field type: 0-3 (def=0)"   
)
MODULE_PARM_DESC ( dix  ,
"data integrity extensions mask (def=0)"   
)
MODULE_PARM_DESC ( dsense  ,
"use descriptor sense format(def=0 -> fixed)"   
)
MODULE_PARM_DESC ( every_nth  ,
"timeout every nth command(def=0)"   
)
MODULE_PARM_DESC ( fake_rw  ,
"fake reads/writes instead of copying (def=0)"   
)
MODULE_PARM_DESC ( guard  ,
"protection checksum:  0 = crc 
)
MODULE_PARM_DESC ( lbpu  ,
"enable  LBP,
support UNMAP command(def=0)"   
)
MODULE_PARM_DESC ( lbpws  ,
"enable  LBP,
support WRITE SAME(16) with UNMAP bit(def=0)"   
)
MODULE_PARM_DESC ( lbpws10  ,
"enable  LBP,
support WRITE SAME(10) with UNMAP bit(def=0)"   
)
MODULE_PARM_DESC ( lbprz  ,
"unmapped blocks return 0 on read (def=1)"   
)
MODULE_PARM_DESC ( lowest_aligned  ,
"lowest aligned lba (def=0)"   
)
MODULE_PARM_DESC ( max_luns  ,
"number of LUNs per target to simulate(def=1)"   
)
MODULE_PARM_DESC ( max_queue  ,
"max number of queued commands (1 to 255(def))"   
)
MODULE_PARM_DESC ( no_lun_0  ,
"no LU number 0 (def=0 -> have lun 0)"   
)
MODULE_PARM_DESC ( no_uld  ,
"stop ULD   e.g. sd driver) attaching (def=0 
)
MODULE_PARM_DESC ( num_parts  ,
"number of partitions(def=0)"   
)
MODULE_PARM_DESC ( num_tgts  ,
"number of targets per host to simulate(def=1)"   
)
MODULE_PARM_DESC ( opt_blks  ,
"optimal transfer length in block (def=64)"   
)
MODULE_PARM_DESC ( opts  ,
"1->  noise,
2->  medium_err,
4->  timeout,
8->recovered_err...(def=0)"   
)
MODULE_PARM_DESC ( physblk_exp  ,
"physical block exponent (def=0)"   
)
MODULE_PARM_DESC ( ptype  ,
"SCSI peripheral type(def=0[disk])"   
)
MODULE_PARM_DESC ( removable  ,
"claim to have removable media (def=0)"   
)
MODULE_PARM_DESC ( scsi_level  ,
"SCSI level to simulate(def=5[SPC-3])"   
)
MODULE_PARM_DESC ( sector_size  ,
"logical block size in bytes (def=512)"   
)
MODULE_PARM_DESC ( unmap_alignment  ,
"lowest aligned thin provisioning lba (def=0)"   
)
MODULE_PARM_DESC ( unmap_granularity  ,
"thin provisioning granularity in blocks (def=1)"   
)
MODULE_PARM_DESC ( unmap_max_blocks  ,
"max # of blocks can be unmapped in one cmd (def=0xffffffff)"   
)
MODULE_PARM_DESC ( unmap_max_desc  ,
"max # of ranges that can be unmapped in one cmd (def=256)"   
)
MODULE_PARM_DESC ( virtual_gb  ,
"virtual gigabyte size (def=0 -> use dev_size_mb)"   
)
MODULE_PARM_DESC ( vpd_use_hostno  ,
"0 -> dev ids ignore hostno (def=1 -> unique dev ids)"   
)
MODULE_PARM_DESC ( write_same_length  ,
"Maximum blocks per WRITE SAME cmd (def=0xffff)"   
)
MODULE_VERSION ( SCSI_DEBUG_VERSION  )

Variable Documentation

struct device* pseudo_primary

Definition at line 3296 of file scsi_debug.c.