]> err.no Git - linux-2.6/blobdiff - drivers/scsi/scsi_error.c
[PATCH] W1: cleanups
[linux-2.6] / drivers / scsi / scsi_error.c
index f988418d805d089f3a31b70f0770a14eb83edcc7..1c7d993fa8ad45636967106300435afcefd3207c 100644 (file)
 #include <linux/delay.h>
 
 #include <scsi/scsi.h>
+#include <scsi/scsi_cmnd.h>
 #include <scsi/scsi_dbg.h>
 #include <scsi/scsi_device.h>
 #include <scsi/scsi_eh.h>
 #include <scsi/scsi_transport.h>
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_ioctl.h>
-#include <scsi/scsi_request.h>
 
 #include "scsi_priv.h"
 #include "scsi_logging.h"
@@ -452,7 +452,6 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
                        (sdev->lun << 5 & 0xe0);
 
        shost->eh_action = &done;
-       scmd->request->rq_status = RQ_SCSI_BUSY;
 
        spin_lock_irqsave(shost->host_lock, flags);
        scsi_log_send(scmd);
@@ -461,7 +460,6 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
 
        timeleft = wait_for_completion_timeout(&done, timeout);
 
-       scmd->request->rq_status = RQ_SCSI_DONE;
        shost->eh_action = NULL;
 
        scsi_log_completion(scmd, SUCCESS);
@@ -581,8 +579,7 @@ static int scsi_request_sense(struct scsi_cmnd *scmd)
  *    keep a list of pending commands for final completion, and once we
  *    are ready to leave error handling we handle completion for real.
  **/
-static void scsi_eh_finish_cmd(struct scsi_cmnd *scmd,
-                              struct list_head *done_q)
+void scsi_eh_finish_cmd(struct scsi_cmnd *scmd, struct list_head *done_q)
 {
        scmd->device->host->host_failed--;
        scmd->eh_eflags = 0;
@@ -594,6 +591,7 @@ static void scsi_eh_finish_cmd(struct scsi_cmnd *scmd,
        scsi_setup_cmd_retry(scmd);
        list_move_tail(&scmd->eh_entry, done_q);
 }
+EXPORT_SYMBOL(scsi_eh_finish_cmd);
 
 /**
  * scsi_eh_get_sense - Get device sense data.
@@ -1422,7 +1420,7 @@ static void scsi_eh_ready_devs(struct Scsi_Host *shost,
  * @done_q:    list_head of processed commands.
  *
  **/
-static void scsi_eh_flush_done_q(struct list_head *done_q)
+void scsi_eh_flush_done_q(struct list_head *done_q)
 {
        struct scsi_cmnd *scmd, *next;
 
@@ -1451,6 +1449,7 @@ static void scsi_eh_flush_done_q(struct list_head *done_q)
                }
        }
 }
+EXPORT_SYMBOL(scsi_eh_flush_done_q);
 
 /**
  * scsi_unjam_host - Attempt to fix a host which has a cmd that failed.
@@ -1536,8 +1535,8 @@ int scsi_error_handler(void *data)
                 * what we need to do to get it up and online again (if we can).
                 * If we fail, we end up taking the thing offline.
                 */
-               if (shost->hostt->eh_strategy_handler) 
-                       shost->hostt->eh_strategy_handler(shost);
+               if (shost->transportt->eh_strategy_handler)
+                       shost->transportt->eh_strategy_handler(shost);
                else
                        scsi_unjam_host(shost);
 
@@ -1656,7 +1655,6 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
 
        scmd->request = &req;
        memset(&scmd->eh_timeout, 0, sizeof(scmd->eh_timeout));
-       scmd->request->rq_status        = RQ_SCSI_BUSY;
 
        memset(&scmd->cmnd, '\0', sizeof(scmd->cmnd));
     
@@ -1670,8 +1668,6 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
        scmd->cmd_len                   = 0;
 
        scmd->sc_data_direction         = DMA_BIDIRECTIONAL;
-       scmd->sc_request                = NULL;
-       scmd->sc_magic                  = SCSI_CMND_MAGIC;
 
        init_timer(&scmd->eh_timeout);
 
@@ -1768,14 +1764,6 @@ int scsi_normalize_sense(const u8 *sense_buffer, int sb_len,
 }
 EXPORT_SYMBOL(scsi_normalize_sense);
 
-int scsi_request_normalize_sense(struct scsi_request *sreq,
-                                struct scsi_sense_hdr *sshdr)
-{
-       return scsi_normalize_sense(sreq->sr_sense_buffer,
-                       sizeof(sreq->sr_sense_buffer), sshdr);
-}
-EXPORT_SYMBOL(scsi_request_normalize_sense);
-
 int scsi_command_normalize_sense(struct scsi_cmnd *cmd,
                                 struct scsi_sense_hdr *sshdr)
 {