aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/scsi_debug.c56
-rw-r--r--drivers/scsi/scsi_debug.h24
2 files changed, 29 insertions, 51 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 26979e0185be..be3437c4058c 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -50,7 +50,6 @@
50#include <linux/stat.h> 50#include <linux/stat.h>
51 51
52#include "scsi_logging.h" 52#include "scsi_logging.h"
53#include "scsi_debug.h"
54 53
55#define SCSI_DEBUG_VERSION "1.81" 54#define SCSI_DEBUG_VERSION "1.81"
56static const char * scsi_debug_version_date = "20070104"; 55static const char * scsi_debug_version_date = "20070104";
@@ -167,6 +166,9 @@ static int sdebug_sectors_per; /* sectors per cylinder */
167 166
168#define SDEBUG_SENSE_LEN 32 167#define SDEBUG_SENSE_LEN 32
169 168
169#define SCSI_DEBUG_CANQUEUE 255
170#define SCSI_DEBUG_MAX_CMD_LEN 16
171
170struct sdebug_dev_info { 172struct sdebug_dev_info {
171 struct list_head dev_list; 173 struct list_head dev_list;
172 unsigned char sense_buff[SDEBUG_SENSE_LEN]; /* weak nexus */ 174 unsigned char sense_buff[SDEBUG_SENSE_LEN]; /* weak nexus */
@@ -204,29 +206,6 @@ struct sdebug_queued_cmd {
204}; 206};
205static struct sdebug_queued_cmd queued_arr[SCSI_DEBUG_CANQUEUE]; 207static struct sdebug_queued_cmd queued_arr[SCSI_DEBUG_CANQUEUE];
206 208
207static struct scsi_host_template sdebug_driver_template = {
208 .proc_info = scsi_debug_proc_info,
209 .name = "SCSI DEBUG",
210 .info = scsi_debug_info,
211 .slave_alloc = scsi_debug_slave_alloc,
212 .slave_configure = scsi_debug_slave_configure,
213 .slave_destroy = scsi_debug_slave_destroy,
214 .ioctl = scsi_debug_ioctl,
215 .queuecommand = scsi_debug_queuecommand,
216 .eh_abort_handler = scsi_debug_abort,
217 .eh_bus_reset_handler = scsi_debug_bus_reset,
218 .eh_device_reset_handler = scsi_debug_device_reset,
219 .eh_host_reset_handler = scsi_debug_host_reset,
220 .bios_param = scsi_debug_biosparam,
221 .can_queue = SCSI_DEBUG_CANQUEUE,
222 .this_id = 7,
223 .sg_tablesize = 256,
224 .cmd_per_lun = 16,
225 .max_sectors = 0xffff,
226 .use_clustering = DISABLE_CLUSTERING,
227 .module = THIS_MODULE,
228};
229
230static unsigned char * fake_storep; /* ramdisk storage */ 209static unsigned char * fake_storep; /* ramdisk storage */
231 210
232static int num_aborts = 0; 211static int num_aborts = 0;
@@ -375,7 +354,8 @@ int scsi_debug_queuecommand(struct scsi_cmnd * SCpnt, done_funct_t done)
375 printk("%02x ", (int)cmd[k]); 354 printk("%02x ", (int)cmd[k]);
376 printk("\n"); 355 printk("\n");
377 } 356 }
378 if(target == sdebug_driver_template.this_id) { 357
358 if (target == SCpnt->device->host->hostt->this_id) {
379 printk(KERN_INFO "scsi_debug: initiator's id used as " 359 printk(KERN_INFO "scsi_debug: initiator's id used as "
380 "target!\n"); 360 "target!\n");
381 return schedule_resp(SCpnt, NULL, done, 361 return schedule_resp(SCpnt, NULL, done,
@@ -2923,8 +2903,6 @@ static int __init scsi_debug_init(void)
2923 2903
2924 init_all_queued(); 2904 init_all_queued();
2925 2905
2926 sdebug_driver_template.proc_name = sdebug_proc_name;
2927
2928 host_to_add = scsi_debug_add_host; 2906 host_to_add = scsi_debug_add_host;
2929 scsi_debug_add_host = 0; 2907 scsi_debug_add_host = 0;
2930 2908
@@ -3084,6 +3062,30 @@ static void sdebug_remove_adapter(void)
3084 --scsi_debug_add_host; 3062 --scsi_debug_add_host;
3085} 3063}
3086 3064
3065static struct scsi_host_template sdebug_driver_template = {
3066 .proc_info = scsi_debug_proc_info,
3067 .proc_name = sdebug_proc_name,
3068 .name = "SCSI DEBUG",
3069 .info = scsi_debug_info,
3070 .slave_alloc = scsi_debug_slave_alloc,
3071 .slave_configure = scsi_debug_slave_configure,
3072 .slave_destroy = scsi_debug_slave_destroy,
3073 .ioctl = scsi_debug_ioctl,
3074 .queuecommand = scsi_debug_queuecommand,
3075 .eh_abort_handler = scsi_debug_abort,
3076 .eh_bus_reset_handler = scsi_debug_bus_reset,
3077 .eh_device_reset_handler = scsi_debug_device_reset,
3078 .eh_host_reset_handler = scsi_debug_host_reset,
3079 .bios_param = scsi_debug_biosparam,
3080 .can_queue = SCSI_DEBUG_CANQUEUE,
3081 .this_id = 7,
3082 .sg_tablesize = 256,
3083 .cmd_per_lun = 16,
3084 .max_sectors = 0xffff,
3085 .use_clustering = DISABLE_CLUSTERING,
3086 .module = THIS_MODULE,
3087};
3088
3087static int sdebug_driver_probe(struct device * dev) 3089static int sdebug_driver_probe(struct device * dev)
3088{ 3090{
3089 int error = 0; 3091 int error = 0;
diff --git a/drivers/scsi/scsi_debug.h b/drivers/scsi/scsi_debug.h
deleted file mode 100644
index 965dd5e760c1..000000000000
--- a/drivers/scsi/scsi_debug.h
+++ /dev/null
@@ -1,24 +0,0 @@
1#ifndef _SCSI_DEBUG_H
2
3#include <linux/types.h>
4
5static int scsi_debug_slave_alloc(struct scsi_device *);
6static int scsi_debug_slave_configure(struct scsi_device *);
7static void scsi_debug_slave_destroy(struct scsi_device *);
8static int scsi_debug_queuecommand(struct scsi_cmnd *,
9 void (*done) (struct scsi_cmnd *));
10static int scsi_debug_ioctl(struct scsi_device *, int, void __user *);
11static int scsi_debug_biosparam(struct scsi_device *, struct block_device *,
12 sector_t, int[]);
13static int scsi_debug_abort(struct scsi_cmnd *);
14static int scsi_debug_bus_reset(struct scsi_cmnd *);
15static int scsi_debug_device_reset(struct scsi_cmnd *);
16static int scsi_debug_host_reset(struct scsi_cmnd *);
17static int scsi_debug_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int);
18static const char * scsi_debug_info(struct Scsi_Host *);
19
20#define SCSI_DEBUG_CANQUEUE 255 /* needs to be >= 1 */
21
22#define SCSI_DEBUG_MAX_CMD_LEN 16
23
24#endif