Commit e59aa73e authored by Christoph Hellwig's avatar Christoph Hellwig

[PATCH] kill of ->command

It's unused now.  Also kill off the stupid = NULL initializations
in usb-storage that made this not compile the first time..
parent 9810ba52
...@@ -440,29 +440,18 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd) ...@@ -440,29 +440,18 @@ int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
goto out; goto out;
} }
if (host->can_queue) { SCSI_LOG_MLQUEUE(3, printk("queuecommand : routine at %p\n",
SCSI_LOG_MLQUEUE(3, printk("queuecommand : routine at %p\n", host->hostt->queuecommand));
host->hostt->queuecommand));
spin_lock_irqsave(host->host_lock, flags);
spin_lock_irqsave(host->host_lock, flags); rtn = host->hostt->queuecommand(cmd, scsi_done);
rtn = host->hostt->queuecommand(cmd, scsi_done); spin_unlock_irqrestore(host->host_lock, flags);
spin_unlock_irqrestore(host->host_lock, flags); if (rtn) {
if (rtn) { scsi_queue_insert(cmd,
scsi_queue_insert(cmd,
(rtn == SCSI_MLQUEUE_DEVICE_BUSY) ? (rtn == SCSI_MLQUEUE_DEVICE_BUSY) ?
rtn : SCSI_MLQUEUE_HOST_BUSY); rtn : SCSI_MLQUEUE_HOST_BUSY);
SCSI_LOG_MLQUEUE(3, SCSI_LOG_MLQUEUE(3,
printk("queuecommand : request rejected\n")); printk("queuecommand : request rejected\n"));
}
} else {
SCSI_LOG_MLQUEUE(3, printk("command() : routine at %p\n",
host->hostt->command));
spin_lock_irqsave(host->host_lock, flags);
cmd->result = host->hostt->command(cmd);
scsi_done(cmd);
spin_unlock_irqrestore(host->host_lock, flags);
rtn = 0;
} }
out: out:
......
...@@ -435,6 +435,7 @@ static void scsi_eh_done(struct scsi_cmnd *scmd) ...@@ -435,6 +435,7 @@ static void scsi_eh_done(struct scsi_cmnd *scmd)
static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
{ {
struct Scsi_Host *host = scmd->device->host; struct Scsi_Host *host = scmd->device->host;
DECLARE_MUTEX_LOCKED(sem);
unsigned long flags; unsigned long flags;
int rtn = SUCCESS; int rtn = SUCCESS;
...@@ -448,72 +449,54 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) ...@@ -448,72 +449,54 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) | scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) |
(scmd->device->lun << 5 & 0xe0); (scmd->device->lun << 5 & 0xe0);
if (host->can_queue) { scsi_add_timer(scmd, timeout, scsi_eh_times_out);
DECLARE_MUTEX_LOCKED(sem);
scsi_add_timer(scmd, timeout, scsi_eh_times_out); /*
* set up the semaphore so we wait for the command to complete.
*/
scmd->device->host->eh_action = &sem;
scmd->request->rq_status = RQ_SCSI_BUSY;
/* spin_lock_irqsave(scmd->device->host->host_lock, flags);
* set up the semaphore so we wait for the command to complete. host->hostt->queuecommand(scmd, scsi_eh_done);
*/ spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
scmd->device->host->eh_action = &sem;
scmd->request->rq_status = RQ_SCSI_BUSY;
spin_lock_irqsave(scmd->device->host->host_lock, flags); down(&sem);
host->hostt->queuecommand(scmd, scsi_eh_done);
spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
down(&sem); scmd->device->host->eh_action = NULL;
scmd->device->host->eh_action = NULL; /*
* see if timeout. if so, tell the host to forget about it.
* in other words, we don't want a callback any more.
*/
if (scsi_eh_eflags_chk(scmd, SCSI_EH_REC_TIMEOUT)) {
scsi_eh_eflags_clr(scmd, SCSI_EH_REC_TIMEOUT);
scmd->owner = SCSI_OWNER_LOWLEVEL;
/* /*
* see if timeout. if so, tell the host to forget about it. * as far as the low level driver is
* in other words, we don't want a callback any more. * concerned, this command is still active, so
* we must give the low level driver a chance
* to abort it. (db)
*
* FIXME(eric) - we are not tracking whether we could
* abort a timed out command or not. not sure how
* we should treat them differently anyways.
*/ */
if (scsi_eh_eflags_chk(scmd, SCSI_EH_REC_TIMEOUT)) { spin_lock_irqsave(scmd->device->host->host_lock, flags);
scsi_eh_eflags_clr(scmd, SCSI_EH_REC_TIMEOUT); if (scmd->device->host->hostt->eh_abort_handler)
scmd->owner = SCSI_OWNER_LOWLEVEL; scmd->device->host->hostt->eh_abort_handler(scmd);
spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
/*
* as far as the low level driver is
* concerned, this command is still active, so
* we must give the low level driver a chance
* to abort it. (db)
*
* FIXME(eric) - we are not tracking whether we could
* abort a timed out command or not. not sure how
* we should treat them differently anyways.
*/
spin_lock_irqsave(scmd->device->host->host_lock, flags);
if (scmd->device->host->hostt->eh_abort_handler)
scmd->device->host->hostt->eh_abort_handler(scmd);
spin_unlock_irqrestore(scmd->device->host->host_lock,
flags);
scmd->request->rq_status = RQ_SCSI_DONE; scmd->request->rq_status = RQ_SCSI_DONE;
scmd->owner = SCSI_OWNER_ERROR_HANDLER; scmd->owner = SCSI_OWNER_ERROR_HANDLER;
rtn = FAILED; rtn = FAILED;
}
SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd: %p, rtn:%x\n",
__FUNCTION__, scmd, rtn));
} else {
int temp;
/*
* we damn well had better never use this code. there is no
* timeout protection here, since we would end up waiting in
* the actual low level driver, we don't know how to wake it up.
*/
spin_lock_irqsave(host->host_lock, flags);
temp = host->hostt->command(scmd);
spin_unlock_irqrestore(host->host_lock, flags);
scmd->result = temp;
/* fall through to code below to examine status. */
} }
SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd: %p, rtn:%x\n",
__FUNCTION__, scmd, rtn));
/* /*
* now examine the actual status codes to see whether the command * now examine the actual status codes to see whether the command
* actually did complete normally. * actually did complete normally.
......
...@@ -365,24 +365,15 @@ struct scsi_host_template usb_stor_host_template = { ...@@ -365,24 +365,15 @@ struct scsi_host_template usb_stor_host_template = {
.name = "usb-storage", .name = "usb-storage",
.proc_name = "usb-storage", .proc_name = "usb-storage",
.proc_info = usb_storage_proc_info, .proc_info = usb_storage_proc_info,
.proc_dir = NULL,
.info = usb_storage_info, .info = usb_storage_info,
.ioctl = NULL,
/* old-style detect and release */
.detect = NULL,
.release = NULL,
/* command interface -- queued only */ /* command interface -- queued only */
.command = NULL,
.queuecommand = usb_storage_queuecommand, .queuecommand = usb_storage_queuecommand,
/* error and abort handlers */ /* error and abort handlers */
.eh_abort_handler = usb_storage_command_abort, .eh_abort_handler = usb_storage_command_abort,
.eh_device_reset_handler = usb_storage_device_reset, .eh_device_reset_handler = usb_storage_device_reset,
.eh_bus_reset_handler = usb_storage_bus_reset, .eh_bus_reset_handler = usb_storage_bus_reset,
.eh_host_reset_handler = NULL,
.eh_strategy_handler = NULL,
/* queue commands only, only one command per LUN */ /* queue commands only, only one command per LUN */
.can_queue = 1, .can_queue = 1,
...@@ -391,21 +382,9 @@ struct scsi_host_template usb_stor_host_template = { ...@@ -391,21 +382,9 @@ struct scsi_host_template usb_stor_host_template = {
/* unknown initiator id */ /* unknown initiator id */
.this_id = -1, .this_id = -1,
/* no limit on commands */
.max_sectors = 0,
/* pre- and post- device scan functions */
.slave_alloc = NULL,
.slave_configure = NULL,
.slave_destroy = NULL,
/* lots of sg segments can be handled */ /* lots of sg segments can be handled */
.sg_tablesize = SG_ALL, .sg_tablesize = SG_ALL,
/* use 32-bit address space for DMA */
.unchecked_isa_dma = FALSE,
.highmem_io = FALSE,
/* merge commands... this seems to help performance, but /* merge commands... this seems to help performance, but
* periodically someone should test to see which setting is more * periodically someone should test to see which setting is more
* optimal. * optimal.
...@@ -415,9 +394,6 @@ struct scsi_host_template usb_stor_host_template = { ...@@ -415,9 +394,6 @@ struct scsi_host_template usb_stor_host_template = {
/* emulated HBA */ /* emulated HBA */
.emulated = TRUE, .emulated = TRUE,
/* sorry, no BIOS to help us */
.bios_param = NULL,
/* module management */ /* module management */
.module = THIS_MODULE .module = THIS_MODULE
}; };
......
...@@ -95,25 +95,11 @@ struct scsi_host_template { ...@@ -95,25 +95,11 @@ struct scsi_host_template {
* I/O pressure in the system if there are no other outstanding * I/O pressure in the system if there are no other outstanding
* commands. * commands.
* *
* STATUS: REQUIRED (for exceptions see below) * STATUS: REQUIRED
*/ */
int (* queuecommand)(struct scsi_cmnd *, int (* queuecommand)(struct scsi_cmnd *,
void (*done)(struct scsi_cmnd *)); void (*done)(struct scsi_cmnd *));
/*
* This is used instead of queuecommand if can_queue == 0;
*
* The return value has the following meaning:
* Byte What:
* 0 SCSI status code
* 1 SCSI 1 byte message
* 2 host error return.
* 3 mid level error return
*
* Status: OBSOLETE
*/
int (* command)(struct scsi_cmnd *);
/* /*
* This is an error handling strategy routine. You don't need to * This is an error handling strategy routine. You don't need to
* define one of these if you don't want to - there is a default * define one of these if you don't want to - there is a default
......
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