aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-03-02 04:30:16 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-07 13:15:41 -0400
commit9e603ca06a538ba6eae29f9785aa47bc53920a15 (patch)
tree168102519e6088903691faf70acca1b7331e7957 /drivers/scsi/scsi_debug.c
parent9ff26eefd4f19051ce13bbba6847871626680e91 (diff)
[SCSI] scsi_debug: remove scsi_debug.h
scsi_debug.h just incldues some function declarations. This patch removes it with moving the scsi_host_template. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Douglas Gilbert <dougg@torque.net> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
-rw-r--r--drivers/scsi/scsi_debug.c56
1 files changed, 29 insertions, 27 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;