aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJames Bottomley <jejb@titanic>2005-04-18 14:45:00 -0400
committerJames Bottomley <jejb@titanic>2005-04-18 14:45:00 -0400
commitc46f2ffb9e7fce7208c2639790e1ade42e00b146 (patch)
tree284912295d46a861930d0619788a650f56c2a29b /drivers/scsi
parentc2a9331c62216e222a08de8dd58559367fef0af6 (diff)
parentf59114b7b5dc677bbd7cc7e26a5fcb3572a3445c (diff)
merge by hand (scsi_device.h)
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/53c7xx.c23
-rw-r--r--drivers/scsi/BusLogic.c7
-rw-r--r--drivers/scsi/NCR5380.c9
-rw-r--r--drivers/scsi/advansys.c7
-rw-r--r--drivers/scsi/aha152x.c17
-rw-r--r--drivers/scsi/arm/acornscsi.c9
-rw-r--r--drivers/scsi/arm/fas216.c9
-rw-r--r--drivers/scsi/arm/scsi.h2
-rw-r--r--drivers/scsi/atari_NCR5380.c9
-rw-r--r--drivers/scsi/constants.c2
-rw-r--r--drivers/scsi/ips.c7
-rw-r--r--drivers/scsi/ncr53c8xx.c14
-rw-r--r--drivers/scsi/pci2000.c4
-rw-r--r--drivers/scsi/qla2xxx/qla_dbg.c6
-rw-r--r--drivers/scsi/scsi.c5
-rw-r--r--drivers/scsi/scsi.h43
-rw-r--r--drivers/scsi/scsi_error.c36
-rw-r--r--drivers/scsi/scsi_ioctl.c5
-rw-r--r--drivers/scsi/scsi_lib.c2
-rw-r--r--drivers/scsi/scsi_obsolete.h106
-rw-r--r--drivers/scsi/scsi_priv.h5
-rw-r--r--drivers/scsi/seagate.c5
-rw-r--r--drivers/scsi/sg.c3
-rw-r--r--drivers/scsi/sun3_NCR5380.c9
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_glue.c6
-rw-r--r--drivers/scsi/ultrastor.c4
26 files changed, 80 insertions, 274 deletions
diff --git a/drivers/scsi/53c7xx.c b/drivers/scsi/53c7xx.c
index 8ead55f75d02..2341d27ceed7 100644
--- a/drivers/scsi/53c7xx.c
+++ b/drivers/scsi/53c7xx.c
@@ -280,6 +280,7 @@
280#endif 280#endif
281 281
282#include "scsi.h" 282#include "scsi.h"
283#include <scsi/scsi_dbg.h>
283#include <scsi/scsi_host.h> 284#include <scsi/scsi_host.h>
284#include "53c7xx.h" 285#include "53c7xx.h"
285#include <linux/stat.h> 286#include <linux/stat.h>
@@ -1721,9 +1722,9 @@ NCR53c7xx_run_tests (struct Scsi_Host *host) {
1721 printk ("scsi%d : test 2 INQUIRY to target %d, lun 0 : %s\n", 1722 printk ("scsi%d : test 2 INQUIRY to target %d, lun 0 : %s\n",
1722 host->host_no, i, data + 8); 1723 host->host_no, i, data + 8);
1723 printk ("scsi%d : status ", host->host_no); 1724 printk ("scsi%d : status ", host->host_no);
1724 print_status (status); 1725 scsi_print_status (status);
1725 printk ("\nscsi%d : message ", host->host_no); 1726 printk ("\nscsi%d : message ", host->host_no);
1726 print_msg (&msg); 1727 scsi_print_msg (&msg);
1727 printk ("\n"); 1728 printk ("\n");
1728 } else if (hostdata->test_completed == 3) { 1729 } else if (hostdata->test_completed == 3) {
1729 printk("scsi%d : test 2 no connection with target %d\n", 1730 printk("scsi%d : test 2 no connection with target %d\n",
@@ -2312,7 +2313,7 @@ NCR53c7x0_dstat_sir_intr (struct Scsi_Host *host, struct
2312 printk ("scsi%d : received message", host->host_no); 2313 printk ("scsi%d : received message", host->host_no);
2313 if (c) 2314 if (c)
2314 printk (" from target %d lun %d ", c->device->id, c->device->lun); 2315 printk (" from target %d lun %d ", c->device->id, c->device->lun);
2315 print_msg ((unsigned char *) hostdata->msg_buf); 2316 scsi_print_msg ((unsigned char *) hostdata->msg_buf);
2316 printk("\n"); 2317 printk("\n");
2317 } 2318 }
2318 2319
@@ -3204,7 +3205,7 @@ create_cmd (Scsi_Cmnd *cmd) {
3204 case WRITE_10: 3205 case WRITE_10:
3205#if 0 3206#if 0
3206 printk("scsi%d : command is ", host->host_no); 3207 printk("scsi%d : command is ", host->host_no);
3207 print_command(cmd->cmnd); 3208 __scsi_print_command(cmd->cmnd);
3208#endif 3209#endif
3209#if 0 3210#if 0
3210 printk ("scsi%d : %d scatter/gather segments\n", host->host_no, 3211 printk ("scsi%d : %d scatter/gather segments\n", host->host_no,
@@ -3232,7 +3233,7 @@ create_cmd (Scsi_Cmnd *cmd) {
3232 */ 3233 */
3233 default: 3234 default:
3234 printk("scsi%d : datain+dataout for command ", host->host_no); 3235 printk("scsi%d : datain+dataout for command ", host->host_no);
3235 print_command(cmd->cmnd); 3236 __scsi_print_command(cmd->cmnd);
3236 datain = dataout = 2 * (cmd->use_sg ? cmd->use_sg : 1) + 3; 3237 datain = dataout = 2 * (cmd->use_sg ? cmd->use_sg : 1) + 3;
3237 } 3238 }
3238 3239
@@ -3938,7 +3939,7 @@ intr_scsi (struct Scsi_Host *host, struct NCR53c7x0_cmd *cmd) {
3938 if (cmd) { 3939 if (cmd) {
3939 printk("scsi%d : target %d, lun %d, command ", 3940 printk("scsi%d : target %d, lun %d, command ",
3940 host->host_no, cmd->cmd->device->id, cmd->cmd->device->lun); 3941 host->host_no, cmd->cmd->device->id, cmd->cmd->device->lun);
3941 print_command (cmd->cmd->cmnd); 3942 __scsi_print_command (cmd->cmd->cmnd);
3942 printk("scsi%d : dsp = 0x%x (virt 0x%p)\n", host->host_no, 3943 printk("scsi%d : dsp = 0x%x (virt 0x%p)\n", host->host_no,
3943 NCR53c7x0_read32(DSP_REG), 3944 NCR53c7x0_read32(DSP_REG),
3944 bus_to_virt(NCR53c7x0_read32(DSP_REG))); 3945 bus_to_virt(NCR53c7x0_read32(DSP_REG)));
@@ -4208,7 +4209,7 @@ restart:
4208 if (hostdata->options & OPTION_DEBUG_INTR) { 4209 if (hostdata->options & OPTION_DEBUG_INTR) {
4209 printk ("scsi%d : command complete : pid %lu, id %d,lun %d result 0x%x ", 4210 printk ("scsi%d : command complete : pid %lu, id %d,lun %d result 0x%x ",
4210 host->host_no, tmp->pid, tmp->device->id, tmp->device->lun, tmp->result); 4211 host->host_no, tmp->pid, tmp->device->id, tmp->device->lun, tmp->result);
4211 print_command (tmp->cmnd); 4212 __scsi_print_command (tmp->cmnd);
4212 } 4213 }
4213 4214
4214 tmp->scsi_done(tmp); 4215 tmp->scsi_done(tmp);
@@ -4297,7 +4298,7 @@ NCR53c7x0_intr (int irq, void *dev_id, struct pt_regs * regs)
4297 printk("scsi%d : interrupt for pid %lu, id %d, lun %d ", 4298 printk("scsi%d : interrupt for pid %lu, id %d, lun %d ",
4298 host->host_no, cmd->cmd->pid, (int) cmd->cmd->device->id, 4299 host->host_no, cmd->cmd->pid, (int) cmd->cmd->device->id,
4299 (int) cmd->cmd->device->lun); 4300 (int) cmd->cmd->device->lun);
4300 print_command (cmd->cmd->cmnd); 4301 __scsi_print_command (cmd->cmd->cmnd);
4301 } else { 4302 } else {
4302 printk("scsi%d : no active command\n", host->host_no); 4303 printk("scsi%d : no active command\n", host->host_no);
4303 } 4304 }
@@ -5539,7 +5540,7 @@ print_dsa (struct Scsi_Host *host, u32 *dsa, const char *prefix) {
5539 i > 0 && !check_address ((unsigned long) ptr, 1); 5540 i > 0 && !check_address ((unsigned long) ptr, 1);
5540 ptr += len, i -= len) { 5541 ptr += len, i -= len) {
5541 printk(" "); 5542 printk(" ");
5542 len = print_msg (ptr); 5543 len = scsi_print_msg (ptr);
5543 printk("\n"); 5544 printk("\n");
5544 if (!len) 5545 if (!len)
5545 break; 5546 break;
@@ -5554,7 +5555,7 @@ print_dsa (struct Scsi_Host *host, u32 *dsa, const char *prefix) {
5554 if (cmd) { 5555 if (cmd) {
5555 printk(" result = 0x%x, target = %d, lun = %d, cmd = ", 5556 printk(" result = 0x%x, target = %d, lun = %d, cmd = ",
5556 cmd->result, cmd->device->id, cmd->device->lun); 5557 cmd->result, cmd->device->id, cmd->device->lun);
5557 print_command(cmd->cmnd); 5558 __scsi_print_command(cmd->cmnd);
5558 } else 5559 } else
5559 printk("\n"); 5560 printk("\n");
5560 printk(" + %d : dsa_next = 0x%x\n", hostdata->dsa_next, 5561 printk(" + %d : dsa_next = 0x%x\n", hostdata->dsa_next,
@@ -6028,7 +6029,7 @@ dump_events (struct Scsi_Host *host, int count) {
6028 virt_to_bus(event.dsa), event.dsa); 6029 virt_to_bus(event.dsa), event.dsa);
6029 if (event.pid != -1) { 6030 if (event.pid != -1) {
6030 printk (" event for pid %ld ", event.pid); 6031 printk (" event for pid %ld ", event.pid);
6031 print_command (event.cmnd); 6032 __scsi_print_command (event.cmnd);
6032 } 6033 }
6033 } 6034 }
6034 } 6035 }
diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index 41b5197ce4e6..15e4b122d56e 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -2958,13 +2958,6 @@ static int BusLogic_AbortCommand(struct scsi_cmnd *Command)
2958 struct BusLogic_CCB *CCB; 2958 struct BusLogic_CCB *CCB;
2959 BusLogic_IncrementErrorCounter(&HostAdapter->TargetStatistics[TargetID].CommandAbortsRequested); 2959 BusLogic_IncrementErrorCounter(&HostAdapter->TargetStatistics[TargetID].CommandAbortsRequested);
2960 /* 2960 /*
2961 If this Command has already completed, then no Abort is necessary.
2962 */
2963 if (Command->serial_number != Command->serial_number_at_timeout) {
2964 BusLogic_Warning("Unable to Abort Command to Target %d - " "Already Completed\n", HostAdapter, TargetID);
2965 return SUCCESS;
2966 }
2967 /*
2968 Attempt to find an Active CCB for this Command. If no Active CCB for this 2961 Attempt to find an Active CCB for this Command. If no Active CCB for this
2969 Command is found, then no Abort is necessary. 2962 Command is found, then no Abort is necessary.
2970 */ 2963 */
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 5e71a0beafca..770fa841e389 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -86,6 +86,7 @@
86 * 5. Test linked command handling code after Eric is ready with 86 * 5. Test linked command handling code after Eric is ready with
87 * the high level code. 87 * the high level code.
88 */ 88 */
89#include <scsi/scsi_dbg.h>
89 90
90#if (NDEBUG & NDEBUG_LISTS) 91#if (NDEBUG & NDEBUG_LISTS)
91#define LIST(x,y) {printk("LINE:%d Adding %p to %p\n", __LINE__, (void*)(x), (void*)(y)); if ((x)==(y)) udelay(5); } 92#define LIST(x,y) {printk("LINE:%d Adding %p to %p\n", __LINE__, (void*)(x), (void*)(y)); if ((x)==(y)) udelay(5); }
@@ -2371,7 +2372,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
2371 * 3..length+1 arguments 2372 * 3..length+1 arguments
2372 * 2373 *
2373 * Start the extended message buffer with the EXTENDED_MESSAGE 2374 * Start the extended message buffer with the EXTENDED_MESSAGE
2374 * byte, since print_msg() wants the whole thing. 2375 * byte, since scsi_print_msg() wants the whole thing.
2375 */ 2376 */
2376 extended_msg[0] = EXTENDED_MESSAGE; 2377 extended_msg[0] = EXTENDED_MESSAGE;
2377 /* Accept first byte by clearing ACK */ 2378 /* Accept first byte by clearing ACK */
@@ -2418,7 +2419,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
2418 default: 2419 default:
2419 if (!tmp) { 2420 if (!tmp) {
2420 printk("scsi%d: rejecting message ", instance->host_no); 2421 printk("scsi%d: rejecting message ", instance->host_no);
2421 print_msg(extended_msg); 2422 scsi_print_msg(extended_msg);
2422 printk("\n"); 2423 printk("\n");
2423 } else if (tmp != EXTENDED_MESSAGE) 2424 } else if (tmp != EXTENDED_MESSAGE)
2424 printk("scsi%d: rejecting unknown message %02x from target %d, lun %d\n", instance->host_no, tmp, cmd->device->id, cmd->device->lun); 2425 printk("scsi%d: rejecting unknown message %02x from target %d, lun %d\n", instance->host_no, tmp, cmd->device->id, cmd->device->lun);
@@ -2552,7 +2553,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
2552 2553
2553 if (!(msg[0] & 0x80)) { 2554 if (!(msg[0] & 0x80)) {
2554 printk(KERN_ERR "scsi%d : expecting IDENTIFY message, got ", instance->host_no); 2555 printk(KERN_ERR "scsi%d : expecting IDENTIFY message, got ", instance->host_no);
2555 print_msg(msg); 2556 scsi_print_msg(msg);
2556 abort = 1; 2557 abort = 1;
2557 } else { 2558 } else {
2558 /* Accept message by clearing ACK */ 2559 /* Accept message by clearing ACK */
@@ -2677,7 +2678,7 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) {
2677 Scsi_Cmnd *tmp, **prev; 2678 Scsi_Cmnd *tmp, **prev;
2678 2679
2679 printk(KERN_WARNING "scsi%d : aborting command\n", instance->host_no); 2680 printk(KERN_WARNING "scsi%d : aborting command\n", instance->host_no);
2680 print_Scsi_Cmnd(cmd); 2681 scsi_print_command(cmd);
2681 2682
2682 NCR5380_print_status(instance); 2683 NCR5380_print_status(instance);
2683 2684
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
index 9962c51dc2a7..04cb5c405a2d 100644
--- a/drivers/scsi/advansys.c
+++ b/drivers/scsi/advansys.c
@@ -9198,16 +9198,13 @@ asc_prt_scsi_cmnd(struct scsi_cmnd *s)
9198 s->use_sg, s->sglist_len, s->abort_reason); 9198 s->use_sg, s->sglist_len, s->abort_reason);
9199 9199
9200 printk( 9200 printk(
9201" serial_number 0x%x, serial_number_at_timeout 0x%x, retries %d, allowed %d\n", 9201" serial_number 0x%x, retries %d, allowed %d\n",
9202 (unsigned) s->serial_number, (unsigned) s->serial_number_at_timeout, 9202 (unsigned) s->serial_number, s->retries, s->allowed);
9203 s->retries, s->allowed);
9204 9203
9205 printk( 9204 printk(
9206" timeout_per_command %d, timeout_total %d, timeout %d\n", 9205" timeout_per_command %d, timeout_total %d, timeout %d\n",
9207 s->timeout_per_command, s->timeout_total, s->timeout); 9206 s->timeout_per_command, s->timeout_total, s->timeout);
9208 9207
9209 printk(" internal_timeout %u\n", s->internal_timeout);
9210
9211 printk( 9208 printk(
9212" scsi_done 0x%lx, done 0x%lx, host_scribble 0x%lx, result 0x%x\n", 9209" scsi_done 0x%lx, done 0x%lx, host_scribble 0x%lx, result 0x%x\n",
9213 (ulong) s->scsi_done, (ulong) s->done, 9210 (ulong) s->scsi_done, (ulong) s->done,
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index d7b8efe86401..88d119f4b970 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -257,6 +257,7 @@
257#include <scsi/scsicam.h> 257#include <scsi/scsicam.h>
258 258
259#include "scsi.h" 259#include "scsi.h"
260#include <scsi/scsi_dbg.h>
260#include <scsi/scsi_host.h> 261#include <scsi/scsi_host.h>
261#include "aha152x.h" 262#include "aha152x.h"
262 263
@@ -986,7 +987,7 @@ static int aha152x_internal_queue(Scsi_Cmnd *SCpnt, struct semaphore *sem, int p
986 if (HOSTDATA(shpnt)->debug & debug_queue) { 987 if (HOSTDATA(shpnt)->debug & debug_queue) {
987 printk(INFO_LEAD "queue: %p; cmd_len=%d pieces=%d size=%u cmnd=", 988 printk(INFO_LEAD "queue: %p; cmd_len=%d pieces=%d size=%u cmnd=",
988 CMDINFO(SCpnt), SCpnt, SCpnt->cmd_len, SCpnt->use_sg, SCpnt->request_bufflen); 989 CMDINFO(SCpnt), SCpnt, SCpnt->cmd_len, SCpnt->use_sg, SCpnt->request_bufflen);
989 print_command(SCpnt->cmnd); 990 __scsi_print_command(SCpnt->cmnd);
990 } 991 }
991#endif 992#endif
992 993
@@ -1560,7 +1561,7 @@ static void busfree_run(struct Scsi_Host *shpnt)
1560#if 0 1561#if 0
1561 if(HOSTDATA(shpnt)->debug & debug_eh) { 1562 if(HOSTDATA(shpnt)->debug & debug_eh) {
1562 printk(ERR_LEAD "received sense: ", CMDINFO(DONE_SC)); 1563 printk(ERR_LEAD "received sense: ", CMDINFO(DONE_SC));
1563 print_sense("bh", DONE_SC); 1564 scsi_print_sense("bh", DONE_SC);
1564 } 1565 }
1565#endif 1566#endif
1566 1567
@@ -1846,7 +1847,7 @@ static void msgi_run(struct Scsi_Host *shpnt)
1846#if defined(AHA152X_DEBUG) 1847#if defined(AHA152X_DEBUG)
1847 if (HOSTDATA(shpnt)->debug & debug_msgi) { 1848 if (HOSTDATA(shpnt)->debug & debug_msgi) {
1848 printk(INFO_LEAD "inbound message %02x ", CMDINFO(CURRENT_SC), MSGI(0)); 1849 printk(INFO_LEAD "inbound message %02x ", CMDINFO(CURRENT_SC), MSGI(0));
1849 print_msg(&MSGI(0)); 1850 scsi_print_msg(&MSGI(0));
1850 printk("\n"); 1851 printk("\n");
1851 } 1852 }
1852#endif 1853#endif
@@ -1934,7 +1935,7 @@ static void msgi_run(struct Scsi_Host *shpnt)
1934 break; 1935 break;
1935 1936
1936 printk(INFO_LEAD, CMDINFO(CURRENT_SC)); 1937 printk(INFO_LEAD, CMDINFO(CURRENT_SC));
1937 print_msg(&MSGI(0)); 1938 scsi_print_msg(&MSGI(0));
1938 printk("\n"); 1939 printk("\n");
1939 1940
1940 ticks = (MSGI(3) * 4 + 49) / 50; 1941 ticks = (MSGI(3) * 4 + 49) / 50;
@@ -2032,7 +2033,7 @@ static void msgo_init(struct Scsi_Host *shpnt)
2032 int i; 2033 int i;
2033 2034
2034 printk(DEBUG_LEAD "messages( ", CMDINFO(CURRENT_SC)); 2035 printk(DEBUG_LEAD "messages( ", CMDINFO(CURRENT_SC));
2035 for (i=0; i<MSGOLEN; i+=print_msg(&MSGO(i)), printk(" ")) 2036 for (i=0; i<MSGOLEN; i+=scsi_print_msg(&MSGO(i)), printk(" "))
2036 ; 2037 ;
2037 printk(")\n"); 2038 printk(")\n");
2038 } 2039 }
@@ -2104,7 +2105,7 @@ static void cmd_init(struct Scsi_Host *shpnt)
2104#if defined(AHA152X_DEBUG) 2105#if defined(AHA152X_DEBUG)
2105 if (HOSTDATA(shpnt)->debug & debug_cmd) { 2106 if (HOSTDATA(shpnt)->debug & debug_cmd) {
2106 printk(DEBUG_LEAD "cmd_init: ", CMDINFO(CURRENT_SC)); 2107 printk(DEBUG_LEAD "cmd_init: ", CMDINFO(CURRENT_SC));
2107 print_command(CURRENT_SC->cmnd); 2108 __scsi_print_command(CURRENT_SC->cmnd);
2108 } 2109 }
2109#endif 2110#endif
2110 2111
@@ -2158,7 +2159,7 @@ static void status_run(struct Scsi_Host *shpnt)
2158#if defined(AHA152X_DEBUG) 2159#if defined(AHA152X_DEBUG)
2159 if (HOSTDATA(shpnt)->debug & debug_status) { 2160 if (HOSTDATA(shpnt)->debug & debug_status) {
2160 printk(DEBUG_LEAD "inbound status %02x ", CMDINFO(CURRENT_SC), CURRENT_SC->SCp.Status); 2161 printk(DEBUG_LEAD "inbound status %02x ", CMDINFO(CURRENT_SC), CURRENT_SC->SCp.Status);
2161 print_status(CURRENT_SC->SCp.Status); 2162 scsi_print_status(CURRENT_SC->SCp.Status);
2162 printk("\n"); 2163 printk("\n");
2163 } 2164 }
2164#endif 2165#endif
@@ -2925,7 +2926,7 @@ static void show_command(Scsi_Cmnd *ptr)
2925 printk(KERN_DEBUG "0x%08x: target=%d; lun=%d; cmnd=(", 2926 printk(KERN_DEBUG "0x%08x: target=%d; lun=%d; cmnd=(",
2926 (unsigned int) ptr, ptr->device->id, ptr->device->lun); 2927 (unsigned int) ptr, ptr->device->id, ptr->device->lun);
2927 2928
2928 print_command(ptr->cmnd); 2929 __scsi_print_command(ptr->cmnd);
2929 2930
2930 printk(KERN_DEBUG "); request_bufflen=%d; resid=%d; phase |", 2931 printk(KERN_DEBUG "); request_bufflen=%d; resid=%d; phase |",
2931 ptr->request_bufflen, ptr->resid); 2932 ptr->request_bufflen, ptr->resid);
diff --git a/drivers/scsi/arm/acornscsi.c b/drivers/scsi/arm/acornscsi.c
index 24dd0b890dd2..be2caecbbdd9 100644
--- a/drivers/scsi/arm/acornscsi.c
+++ b/drivers/scsi/arm/acornscsi.c
@@ -150,6 +150,7 @@
150#include <asm/ecard.h> 150#include <asm/ecard.h>
151 151
152#include "../scsi.h" 152#include "../scsi.h"
153#include <scsi/scsi_dbg.h>
153#include <scsi/scsi_host.h> 154#include <scsi/scsi_host.h>
154#include "acornscsi.h" 155#include "acornscsi.h"
155#include "msgqueue.h" 156#include "msgqueue.h"
@@ -866,7 +867,7 @@ void acornscsi_done(AS_Host *host, Scsi_Cmnd **SCpntp, unsigned int result)
866 default: 867 default:
867 printk(KERN_ERR "scsi%d.H: incomplete data transfer detected: result=%08X command=", 868 printk(KERN_ERR "scsi%d.H: incomplete data transfer detected: result=%08X command=",
868 host->host->host_no, SCpnt->result); 869 host->host->host_no, SCpnt->result);
869 print_command(SCpnt->cmnd); 870 __scsi_print_command(SCpnt->cmnd);
870 acornscsi_dumpdma(host, "done"); 871 acornscsi_dumpdma(host, "done");
871 acornscsi_dumplog(host, SCpnt->device->id); 872 acornscsi_dumplog(host, SCpnt->device->id);
872 SCpnt->result &= 0xffff; 873 SCpnt->result &= 0xffff;
@@ -1369,7 +1370,7 @@ void acornscsi_sendmessage(AS_Host *host)
1369 1370
1370 host->scsi.last_message = msg->msg[0]; 1371 host->scsi.last_message = msg->msg[0];
1371#if (DEBUG & DEBUG_MESSAGES) 1372#if (DEBUG & DEBUG_MESSAGES)
1372 print_msg(msg->msg); 1373 scsi_print_msg(msg->msg);
1373#endif 1374#endif
1374 break; 1375 break;
1375 1376
@@ -1391,7 +1392,7 @@ void acornscsi_sendmessage(AS_Host *host)
1391 while ((msg = msgqueue_getmsg(&host->scsi.msgs, msgnr++)) != NULL) { 1392 while ((msg = msgqueue_getmsg(&host->scsi.msgs, msgnr++)) != NULL) {
1392 unsigned int i; 1393 unsigned int i;
1393#if (DEBUG & DEBUG_MESSAGES) 1394#if (DEBUG & DEBUG_MESSAGES)
1394 print_msg(msg); 1395 scsi_print_msg(msg);
1395#endif 1396#endif
1396 i = 0; 1397 i = 0;
1397 if (acornscsi_write_pio(host, msg->msg, &i, msg->length, 1000000)) 1398 if (acornscsi_write_pio(host, msg->msg, &i, msg->length, 1000000))
@@ -1487,7 +1488,7 @@ void acornscsi_message(AS_Host *host)
1487#if (DEBUG & DEBUG_MESSAGES) 1488#if (DEBUG & DEBUG_MESSAGES)
1488 printk("scsi%d.%c: message in: ", 1489 printk("scsi%d.%c: message in: ",
1489 host->host->host_no, acornscsi_target(host)); 1490 host->host->host_no, acornscsi_target(host));
1490 print_msg(message); 1491 scsi_print_msg(message);
1491 printk("\n"); 1492 printk("\n");
1492#endif 1493#endif
1493 1494
diff --git a/drivers/scsi/arm/fas216.c b/drivers/scsi/arm/fas216.c
index 5411e850c833..0a172c1e9f7e 100644
--- a/drivers/scsi/arm/fas216.c
+++ b/drivers/scsi/arm/fas216.c
@@ -52,6 +52,7 @@
52#include <asm/ecard.h> 52#include <asm/ecard.h>
53 53
54#include "../scsi.h" 54#include "../scsi.h"
55#include <scsi/scsi_dbg.h>
55#include <scsi/scsi_host.h> 56#include <scsi/scsi_host.h>
56#include "fas216.h" 57#include "fas216.h"
57#include "scsi.h" 58#include "scsi.h"
@@ -309,7 +310,7 @@ fas216_log_command(FAS216_Info *info, int level, Scsi_Cmnd *SCpnt, char *fmt, ..
309 va_end(args); 310 va_end(args);
310 311
311 printk(" CDB: "); 312 printk(" CDB: ");
312 print_command(SCpnt->cmnd); 313 __scsi_print_command(SCpnt->cmnd);
313} 314}
314 315
315static void 316static void
@@ -2081,7 +2082,7 @@ fas216_std_done(FAS216_Info *info, Scsi_Cmnd *SCpnt, unsigned int result)
2081 info->host->host_no, '0' + SCpnt->device->id, 2082 info->host->host_no, '0' + SCpnt->device->id,
2082 SCpnt->result, info->scsi.SCp.ptr, 2083 SCpnt->result, info->scsi.SCp.ptr,
2083 info->scsi.SCp.this_residual); 2084 info->scsi.SCp.this_residual);
2084 print_command(SCpnt->cmnd); 2085 __scsi_print_command(SCpnt->cmnd);
2085 SCpnt->result &= ~(255 << 16); 2086 SCpnt->result &= ~(255 << 16);
2086 SCpnt->result |= DID_BAD_TARGET << 16; 2087 SCpnt->result |= DID_BAD_TARGET << 16;
2087 goto request_sense; 2088 goto request_sense;
@@ -2170,7 +2171,7 @@ static void fas216_done(FAS216_Info *info, unsigned int result)
2170 info->host->host_no, '0' + SCpnt->device->id, 2171 info->host->host_no, '0' + SCpnt->device->id,
2171 info->scsi.SCp.ptr, info->scsi.SCp.this_residual); 2172 info->scsi.SCp.ptr, info->scsi.SCp.this_residual);
2172 info->scsi.SCp.ptr = NULL; 2173 info->scsi.SCp.ptr = NULL;
2173 print_command(SCpnt->cmnd); 2174 __scsi_print_command(SCpnt->cmnd);
2174 } 2175 }
2175 2176
2176 /* 2177 /*
@@ -2426,7 +2427,7 @@ int fas216_eh_abort(Scsi_Cmnd *SCpnt)
2426 info->stats.aborts += 1; 2427 info->stats.aborts += 1;
2427 2428
2428 printk(KERN_WARNING "scsi%d: abort command ", info->host->host_no); 2429 printk(KERN_WARNING "scsi%d: abort command ", info->host->host_no);
2429 print_command(SCpnt->data_cmnd); 2430 __scsi_print_command(SCpnt->data_cmnd);
2430 2431
2431 print_debug_list(); 2432 print_debug_list();
2432 fas216_dumpstate(info); 2433 fas216_dumpstate(info);
diff --git a/drivers/scsi/arm/scsi.h b/drivers/scsi/arm/scsi.h
index 2f1b3f4bf954..48e1c4d9738b 100644
--- a/drivers/scsi/arm/scsi.h
+++ b/drivers/scsi/arm/scsi.h
@@ -108,7 +108,7 @@ static inline void init_SCp(Scsi_Cmnd *SCpnt)
108#if 0 //def BELT_AND_BRACES 108#if 0 //def BELT_AND_BRACES
109 printk(KERN_WARNING "scsi%d.%c: zero length buffer passed for " 109 printk(KERN_WARNING "scsi%d.%c: zero length buffer passed for "
110 "command ", SCpnt->host->host_no, '0' + SCpnt->target); 110 "command ", SCpnt->host->host_no, '0' + SCpnt->target);
111 print_command(SCpnt->cmnd); 111 __scsi_print_command(SCpnt->cmnd);
112#endif 112#endif
113 SCpnt->SCp.ptr = NULL; 113 SCpnt->SCp.ptr = NULL;
114 } 114 }
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index 5d1e78ebed83..2c12be72c4c6 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -73,6 +73,7 @@
73 * 1. Test linked command handling code after Eric is ready with 73 * 1. Test linked command handling code after Eric is ready with
74 * the high level code. 74 * the high level code.
75 */ 75 */
76#include <scsi/scsi_dbg.h>
76 77
77#if (NDEBUG & NDEBUG_LISTS) 78#if (NDEBUG & NDEBUG_LISTS)
78#define LIST(x,y) \ 79#define LIST(x,y) \
@@ -2354,7 +2355,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
2354 * 3..length+1 arguments 2355 * 3..length+1 arguments
2355 * 2356 *
2356 * Start the extended message buffer with the EXTENDED_MESSAGE 2357 * Start the extended message buffer with the EXTENDED_MESSAGE
2357 * byte, since print_msg() wants the whole thing. 2358 * byte, since scsi_print_msg() wants the whole thing.
2358 */ 2359 */
2359 extended_msg[0] = EXTENDED_MESSAGE; 2360 extended_msg[0] = EXTENDED_MESSAGE;
2360 /* Accept first byte by clearing ACK */ 2361 /* Accept first byte by clearing ACK */
@@ -2407,7 +2408,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
2407 default: 2408 default:
2408 if (!tmp) { 2409 if (!tmp) {
2409 printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO); 2410 printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO);
2410 print_msg (extended_msg); 2411 scsi_print_msg (extended_msg);
2411 printk("\n"); 2412 printk("\n");
2412 } else if (tmp != EXTENDED_MESSAGE) 2413 } else if (tmp != EXTENDED_MESSAGE)
2413 printk(KERN_DEBUG "scsi%d: rejecting unknown " 2414 printk(KERN_DEBUG "scsi%d: rejecting unknown "
@@ -2540,7 +2541,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance)
2540 2541
2541 if (!(msg[0] & 0x80)) { 2542 if (!(msg[0] & 0x80)) {
2542 printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); 2543 printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO);
2543 print_msg(msg); 2544 scsi_print_msg(msg);
2544 do_abort(instance); 2545 do_abort(instance);
2545 return; 2546 return;
2546 } 2547 }
@@ -2646,7 +2647,7 @@ int NCR5380_abort (Scsi_Cmnd *cmd)
2646 unsigned long flags; 2647 unsigned long flags;
2647 2648
2648 printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO); 2649 printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO);
2649 print_Scsi_Cmnd (cmd); 2650 scsi_print_command(cmd);
2650 2651
2651 NCR5380_print_status (instance); 2652 NCR5380_print_status (instance);
2652 2653
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index d625fdebe052..ec161733a82b 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -372,7 +372,7 @@ static void scsi_print_cdb(unsigned char *cdb, int cdb_len, int start_of_line)
372 372
373/** 373/**
374 * 374 *
375 * print_status - print scsi status description 375 * scsi_print_status - print scsi status description
376 * @scsi_status: scsi status value 376 * @scsi_status: scsi status value
377 * 377 *
378 * If the status is recognized, the description is printed. 378 * If the status is recognized, the description is printed.
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index e46096da8db2..47c263e5cd39 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -833,13 +833,6 @@ ips_eh_abort(Scsi_Cmnd * SC)
833 if (!ha->active) 833 if (!ha->active)
834 return (FAILED); 834 return (FAILED);
835 835
836 if (SC->serial_number != SC->serial_number_at_timeout) {
837 /* HMM, looks like a bogus command */
838 DEBUG(1, "Abort called with bogus scsi command");
839
840 return (FAILED);
841 }
842
843 /* See if the command is on the copp queue */ 836 /* See if the command is on the copp queue */
844 item = ha->copp_waitlist.head; 837 item = ha->copp_waitlist.head;
845 while ((item) && (item->scsi_cmd != SC)) 838 while ((item) && (item->scsi_cmd != SC))
diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c
index 7ae13236788e..2a0e42ec27d3 100644
--- a/drivers/scsi/ncr53c8xx.c
+++ b/drivers/scsi/ncr53c8xx.c
@@ -7486,24 +7486,14 @@ static int ncr53c8xx_abort(struct scsi_cmnd *cmd)
7486 struct scsi_cmnd *done_list; 7486 struct scsi_cmnd *done_list;
7487 7487
7488#if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS 7488#if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS
7489 printk("ncr53c8xx_abort: pid=%lu serial_number=%ld serial_number_at_timeout=%ld\n", 7489 printk("ncr53c8xx_abort: pid=%lu serial_number=%ld\n",
7490 cmd->pid, cmd->serial_number, cmd->serial_number_at_timeout); 7490 cmd->pid, cmd->serial_number);
7491#else 7491#else
7492 printk("ncr53c8xx_abort: command pid %lu\n", cmd->pid); 7492 printk("ncr53c8xx_abort: command pid %lu\n", cmd->pid);
7493#endif 7493#endif
7494 7494
7495 NCR_LOCK_NCB(np, flags); 7495 NCR_LOCK_NCB(np, flags);
7496 7496
7497#if defined SCSI_RESET_SYNCHRONOUS && defined SCSI_RESET_ASYNCHRONOUS
7498 /*
7499 * We have to just ignore abort requests in some situations.
7500 */
7501 if (cmd->serial_number != cmd->serial_number_at_timeout) {
7502 sts = SCSI_ABORT_NOT_RUNNING;
7503 goto out;
7504 }
7505#endif
7506
7507 sts = ncr_abort_command(np, cmd); 7497 sts = ncr_abort_command(np, cmd);
7508out: 7498out:
7509 done_list = np->done_list; 7499 done_list = np->done_list;
diff --git a/drivers/scsi/pci2000.c b/drivers/scsi/pci2000.c
index 60ce1cce9497..d58f303127f5 100644
--- a/drivers/scsi/pci2000.c
+++ b/drivers/scsi/pci2000.c
@@ -438,8 +438,8 @@ int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
438 if ( bus ) 438 if ( bus )
439 { 439 {
440 DEB (if(*cdb) printk ("\nCDB: %X- %X %X %X %X %X %X %X %X %X %X ", SCpnt->cmd_len, cdb[0], cdb[1], cdb[2], cdb[3], cdb[4], cdb[5], cdb[6], cdb[7], cdb[8], cdb[9])); 440 DEB (if(*cdb) printk ("\nCDB: %X- %X %X %X %X %X %X %X %X %X %X ", SCpnt->cmd_len, cdb[0], cdb[1], cdb[2], cdb[3], cdb[4], cdb[5], cdb[6], cdb[7], cdb[8], cdb[9]));
441 DEB (if(*cdb) printk ("\ntimeout_per_command: %d, timeout_total: %d, timeout: %d, internal_timout: %d", SCpnt->timeout_per_command, 441 DEB (if(*cdb) printk ("\ntimeout_per_command: %d, timeout_total: %d, timeout: %d", SCpnt->timeout_per_command,
442 SCpnt->timeout_total, SCpnt->timeout, SCpnt->internal_timeout)); 442 SCpnt->timeout_total, SCpnt->timeout));
443 outl (SCpnt->timeout_per_command, padapter->mb1); 443 outl (SCpnt->timeout_per_command, padapter->mb1);
444 outb_p (CMD_SCSI_TIMEOUT, padapter->cmd); 444 outb_p (CMD_SCSI_TIMEOUT, padapter->cmd);
445 if ( WaitReady (padapter) ) 445 if ( WaitReady (padapter) )
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index dcc33daa5913..0e8ebbc56e81 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -1050,10 +1050,8 @@ qla2x00_print_scsi_cmd(struct scsi_cmnd * cmd)
1050 for (i = 0; i < cmd->cmd_len; i++) { 1050 for (i = 0; i < cmd->cmd_len; i++) {
1051 printk("0x%02x ", cmd->cmnd[i]); 1051 printk("0x%02x ", cmd->cmnd[i]);
1052 } 1052 }
1053 printk("\n seg_cnt=%d, allowed=%d, retries=%d, " 1053 printk("\n seg_cnt=%d, allowed=%d, retries=%d\n",
1054 "serial_number_at_timeout=0x%lx\n", 1054 cmd->use_sg, cmd->allowed, cmd->retries);
1055 cmd->use_sg, cmd->allowed, cmd->retries,
1056 cmd->serial_number_at_timeout);
1057 printk(" request buffer=0x%p, request buffer len=0x%x\n", 1055 printk(" request buffer=0x%p, request buffer len=0x%x\n",
1058 cmd->request_buffer, cmd->request_bufflen); 1056 cmd->request_buffer, cmd->request_bufflen);
1059 printk(" tag=%d, transfersize=0x%x\n", 1057 printk(" tag=%d, transfersize=0x%x\n",
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 2e7ab3ab0993..05d2bd075fd4 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -489,7 +489,7 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)
489 scsi_print_command(cmd); 489 scsi_print_command(cmd);
490 if (status_byte(cmd->result) & CHECK_CONDITION) { 490 if (status_byte(cmd->result) & CHECK_CONDITION) {
491 /* 491 /*
492 * XXX The print_sense formatting/prefix 492 * XXX The scsi_print_sense formatting/prefix
493 * doesn't match this function. 493 * doesn't match this function.
494 */ 494 */
495 scsi_print_sense("", cmd); 495 scsi_print_sense("", cmd);
@@ -686,7 +686,6 @@ void scsi_init_cmd_from_req(struct scsi_cmnd *cmd, struct scsi_request *sreq)
686 cmd->request = sreq->sr_request; 686 cmd->request = sreq->sr_request;
687 memcpy(cmd->data_cmnd, sreq->sr_cmnd, sizeof(cmd->data_cmnd)); 687 memcpy(cmd->data_cmnd, sreq->sr_cmnd, sizeof(cmd->data_cmnd));
688 cmd->serial_number = 0; 688 cmd->serial_number = 0;
689 cmd->serial_number_at_timeout = 0;
690 cmd->bufflen = sreq->sr_bufflen; 689 cmd->bufflen = sreq->sr_bufflen;
691 cmd->buffer = sreq->sr_buffer; 690 cmd->buffer = sreq->sr_buffer;
692 cmd->retries = 0; 691 cmd->retries = 0;
@@ -716,7 +715,6 @@ void scsi_init_cmd_from_req(struct scsi_cmnd *cmd, struct scsi_request *sreq)
716 /* 715 /*
717 * Start the timer ticking. 716 * Start the timer ticking.
718 */ 717 */
719 cmd->internal_timeout = NORMAL_TIMEOUT;
720 cmd->abort_reason = 0; 718 cmd->abort_reason = 0;
721 cmd->result = 0; 719 cmd->result = 0;
722 720
@@ -766,7 +764,6 @@ void __scsi_done(struct scsi_cmnd *cmd)
766 * Set the serial numbers back to zero 764 * Set the serial numbers back to zero
767 */ 765 */
768 cmd->serial_number = 0; 766 cmd->serial_number = 0;
769 cmd->serial_number_at_timeout = 0;
770 cmd->state = SCSI_STATE_BHQUEUE; 767 cmd->state = SCSI_STATE_BHQUEUE;
771 cmd->owner = SCSI_OWNER_BH_HANDLER; 768 cmd->owner = SCSI_OWNER_BH_HANDLER;
772 769
diff --git a/drivers/scsi/scsi.h b/drivers/scsi/scsi.h
index cb6b5fbb7e14..e2360c26ef01 100644
--- a/drivers/scsi/scsi.h
+++ b/drivers/scsi/scsi.h
@@ -23,7 +23,6 @@
23#include <linux/config.h> /* for CONFIG_SCSI_LOGGING */ 23#include <linux/config.h> /* for CONFIG_SCSI_LOGGING */
24 24
25#include <scsi/scsi_cmnd.h> 25#include <scsi/scsi_cmnd.h>
26#include <scsi/scsi_dbg.h>
27#include <scsi/scsi_device.h> 26#include <scsi/scsi_device.h>
28#include <scsi/scsi_eh.h> 27#include <scsi/scsi_eh.h>
29#include <scsi/scsi_request.h> 28#include <scsi/scsi_request.h>
@@ -61,48 +60,6 @@ struct scatterlist;
61#define scsi_to_pci_dma_dir(scsi_dir) ((int)(scsi_dir)) 60#define scsi_to_pci_dma_dir(scsi_dir) ((int)(scsi_dir))
62#define scsi_to_sbus_dma_dir(scsi_dir) ((int)(scsi_dir)) 61#define scsi_to_sbus_dma_dir(scsi_dir) ((int)(scsi_dir))
63 62
64/*
65 * Old names for debug prettyprinting functions.
66 */
67static inline void print_Scsi_Cmnd(struct scsi_cmnd *cmd)
68{
69 return scsi_print_command(cmd);
70}
71static inline void print_command(unsigned char *cdb)
72{
73 return __scsi_print_command(cdb);
74}
75static inline void print_sense(const char *devclass, struct scsi_cmnd *cmd)
76{
77 return scsi_print_sense(devclass, cmd);
78}
79static inline void print_req_sense(const char *devclass, struct scsi_request *req)
80{
81 return scsi_print_req_sense(devclass, req);
82}
83static inline void print_driverbyte(int scsiresult)
84{
85 return scsi_print_driverbyte(scsiresult);
86}
87static inline void print_hostbyte(int scsiresult)
88{
89 return scsi_print_hostbyte(scsiresult);
90}
91static inline void print_status(unsigned char status)
92{
93 return scsi_print_status(status);
94}
95static inline int print_msg(const unsigned char *msg)
96{
97 return scsi_print_msg(msg);
98}
99
100/*
101 * This is the crap from the old error handling code. We have it in a special
102 * place so that we can more easily delete it later on.
103 */
104#include "scsi_obsolete.h"
105
106/* obsolete typedef junk. */ 63/* obsolete typedef junk. */
107#include "scsi_typedefs.h" 64#include "scsi_typedefs.h"
108 65
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 9bc597bd13ba..1a135f38e78d 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -79,11 +79,6 @@ int scsi_eh_scmd_add(struct scsi_cmnd *scmd, int eh_flag)
79 */ 79 */
80 scmd->owner = SCSI_OWNER_ERROR_HANDLER; 80 scmd->owner = SCSI_OWNER_ERROR_HANDLER;
81 scmd->state = SCSI_STATE_FAILED; 81 scmd->state = SCSI_STATE_FAILED;
82 /*
83 * Set the serial_number_at_timeout to the current
84 * serial_number
85 */
86 scmd->serial_number_at_timeout = scmd->serial_number;
87 list_add_tail(&scmd->eh_entry, &shost->eh_cmd_q); 82 list_add_tail(&scmd->eh_entry, &shost->eh_cmd_q);
88 set_bit(SHOST_RECOVERY, &shost->shost_state); 83 set_bit(SHOST_RECOVERY, &shost->shost_state);
89 shost->host_failed++; 84 shost->host_failed++;
@@ -481,7 +476,8 @@ static void scsi_eh_done(struct scsi_cmnd *scmd)
481 **/ 476 **/
482static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout) 477static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
483{ 478{
484 struct Scsi_Host *host = scmd->device->host; 479 struct scsi_device *sdev = scmd->device;
480 struct Scsi_Host *shost = sdev->host;
485 DECLARE_MUTEX_LOCKED(sem); 481 DECLARE_MUTEX_LOCKED(sem);
486 unsigned long flags; 482 unsigned long flags;
487 int rtn = SUCCESS; 483 int rtn = SUCCESS;
@@ -492,27 +488,27 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
492 */ 488 */
493 scmd->owner = SCSI_OWNER_LOWLEVEL; 489 scmd->owner = SCSI_OWNER_LOWLEVEL;
494 490
495 if (scmd->device->scsi_level <= SCSI_2) 491 if (sdev->scsi_level <= SCSI_2)
496 scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) | 492 scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) |
497 (scmd->device->lun << 5 & 0xe0); 493 (sdev->lun << 5 & 0xe0);
498 494
499 scsi_add_timer(scmd, timeout, scsi_eh_times_out); 495 scsi_add_timer(scmd, timeout, scsi_eh_times_out);
500 496
501 /* 497 /*
502 * set up the semaphore so we wait for the command to complete. 498 * set up the semaphore so we wait for the command to complete.
503 */ 499 */
504 scmd->device->host->eh_action = &sem; 500 shost->eh_action = &sem;
505 scmd->request->rq_status = RQ_SCSI_BUSY; 501 scmd->request->rq_status = RQ_SCSI_BUSY;
506 502
507 spin_lock_irqsave(scmd->device->host->host_lock, flags); 503 spin_lock_irqsave(shost->host_lock, flags);
508 scsi_log_send(scmd); 504 scsi_log_send(scmd);
509 host->hostt->queuecommand(scmd, scsi_eh_done); 505 shost->hostt->queuecommand(scmd, scsi_eh_done);
510 spin_unlock_irqrestore(scmd->device->host->host_lock, flags); 506 spin_unlock_irqrestore(shost->host_lock, flags);
511 507
512 down(&sem); 508 down(&sem);
513 scsi_log_completion(scmd, SUCCESS); 509 scsi_log_completion(scmd, SUCCESS);
514 510
515 scmd->device->host->eh_action = NULL; 511 shost->eh_action = NULL;
516 512
517 /* 513 /*
518 * see if timeout. if so, tell the host to forget about it. 514 * see if timeout. if so, tell the host to forget about it.
@@ -532,10 +528,10 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
532 * abort a timed out command or not. not sure how 528 * abort a timed out command or not. not sure how
533 * we should treat them differently anyways. 529 * we should treat them differently anyways.
534 */ 530 */
535 spin_lock_irqsave(scmd->device->host->host_lock, flags); 531 spin_lock_irqsave(shost->host_lock, flags);
536 if (scmd->device->host->hostt->eh_abort_handler) 532 if (shost->hostt->eh_abort_handler)
537 scmd->device->host->hostt->eh_abort_handler(scmd); 533 shost->hostt->eh_abort_handler(scmd);
538 spin_unlock_irqrestore(scmd->device->host->host_lock, flags); 534 spin_unlock_irqrestore(shost->host_lock, flags);
539 535
540 scmd->request->rq_status = RQ_SCSI_DONE; 536 scmd->request->rq_status = RQ_SCSI_DONE;
541 scmd->owner = SCSI_OWNER_ERROR_HANDLER; 537 scmd->owner = SCSI_OWNER_ERROR_HANDLER;
@@ -1061,7 +1057,6 @@ static int scsi_try_bus_reset(struct scsi_cmnd *scmd)
1061 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Bus RST\n", 1057 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Bus RST\n",
1062 __FUNCTION__)); 1058 __FUNCTION__));
1063 scmd->owner = SCSI_OWNER_LOWLEVEL; 1059 scmd->owner = SCSI_OWNER_LOWLEVEL;
1064 scmd->serial_number_at_timeout = scmd->serial_number;
1065 1060
1066 if (!scmd->device->host->hostt->eh_bus_reset_handler) 1061 if (!scmd->device->host->hostt->eh_bus_reset_handler)
1067 return FAILED; 1062 return FAILED;
@@ -1093,7 +1088,6 @@ static int scsi_try_host_reset(struct scsi_cmnd *scmd)
1093 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Host RST\n", 1088 SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Host RST\n",
1094 __FUNCTION__)); 1089 __FUNCTION__));
1095 scmd->owner = SCSI_OWNER_LOWLEVEL; 1090 scmd->owner = SCSI_OWNER_LOWLEVEL;
1096 scmd->serial_number_at_timeout = scmd->serial_number;
1097 1091
1098 if (!scmd->device->host->hostt->eh_host_reset_handler) 1092 if (!scmd->device->host->hostt->eh_host_reset_handler)
1099 return FAILED; 1093 return FAILED;
@@ -1313,6 +1307,9 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd)
1313 case DID_IMM_RETRY: 1307 case DID_IMM_RETRY:
1314 return NEEDS_RETRY; 1308 return NEEDS_RETRY;
1315 1309
1310 case DID_REQUEUE:
1311 return ADD_TO_MLQUEUE;
1312
1316 case DID_ERROR: 1313 case DID_ERROR:
1317 if (msg_byte(scmd->result) == COMMAND_COMPLETE && 1314 if (msg_byte(scmd->result) == COMMAND_COMPLETE &&
1318 status_byte(scmd->result) == RESERVATION_CONFLICT) 1315 status_byte(scmd->result) == RESERVATION_CONFLICT)
@@ -1839,7 +1836,6 @@ scsi_reset_provider(struct scsi_device *dev, int flag)
1839 scmd->bufflen = 0; 1836 scmd->bufflen = 0;
1840 scmd->request_buffer = NULL; 1837 scmd->request_buffer = NULL;
1841 scmd->request_bufflen = 0; 1838 scmd->request_bufflen = 0;
1842 scmd->internal_timeout = NORMAL_TIMEOUT;
1843 scmd->abort_reason = DID_ABORT; 1839 scmd->abort_reason = DID_ABORT;
1844 1840
1845 scmd->cmd_len = 0; 1841 scmd->cmd_len = 0;
diff --git a/drivers/scsi/scsi_ioctl.c b/drivers/scsi/scsi_ioctl.c
index 68c9728dfbbb..7a6b530115ac 100644
--- a/drivers/scsi/scsi_ioctl.c
+++ b/drivers/scsi/scsi_ioctl.c
@@ -27,11 +27,6 @@
27 27
28#define NORMAL_RETRIES 5 28#define NORMAL_RETRIES 5
29#define IOCTL_NORMAL_TIMEOUT (10 * HZ) 29#define IOCTL_NORMAL_TIMEOUT (10 * HZ)
30#define FORMAT_UNIT_TIMEOUT (2 * 60 * 60 * HZ)
31#define START_STOP_TIMEOUT (60 * HZ)
32#define MOVE_MEDIUM_TIMEOUT (5 * 60 * HZ)
33#define READ_ELEMENT_STATUS_TIMEOUT (5 * 60 * HZ)
34#define READ_DEFECT_DATA_TIMEOUT (60 * HZ ) /* ZIP-250 on parallel port takes as long! */
35 30
36#define MAX_BUF PAGE_SIZE 31#define MAX_BUF PAGE_SIZE
37 32
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index d230c699c728..d18da21c9c57 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -298,7 +298,6 @@ static int scsi_init_cmd_errh(struct scsi_cmnd *cmd)
298{ 298{
299 cmd->owner = SCSI_OWNER_MIDLEVEL; 299 cmd->owner = SCSI_OWNER_MIDLEVEL;
300 cmd->serial_number = 0; 300 cmd->serial_number = 0;
301 cmd->serial_number_at_timeout = 0;
302 cmd->abort_reason = 0; 301 cmd->abort_reason = 0;
303 302
304 memset(cmd->sense_buffer, 0, sizeof cmd->sense_buffer); 303 memset(cmd->sense_buffer, 0, sizeof cmd->sense_buffer);
@@ -320,7 +319,6 @@ static int scsi_init_cmd_errh(struct scsi_cmnd *cmd)
320 memcpy(cmd->data_cmnd, cmd->cmnd, sizeof(cmd->cmnd)); 319 memcpy(cmd->data_cmnd, cmd->cmnd, sizeof(cmd->cmnd));
321 cmd->buffer = cmd->request_buffer; 320 cmd->buffer = cmd->request_buffer;
322 cmd->bufflen = cmd->request_bufflen; 321 cmd->bufflen = cmd->request_bufflen;
323 cmd->internal_timeout = NORMAL_TIMEOUT;
324 cmd->abort_reason = 0; 322 cmd->abort_reason = 0;
325 323
326 return 1; 324 return 1;
diff --git a/drivers/scsi/scsi_obsolete.h b/drivers/scsi/scsi_obsolete.h
deleted file mode 100644
index abeacb996ea0..000000000000
--- a/drivers/scsi/scsi_obsolete.h
+++ /dev/null
@@ -1,106 +0,0 @@
1/*
2 * scsi_obsolete.h Copyright (C) 1997 Eric Youngdale
3 *
4 */
5
6#ifndef _SCSI_OBSOLETE_H
7#define _SCSI_OBSOLETE_H
8
9/*
10 * These are the return codes for the abort and reset functions. The mid-level
11 * code uses these to decide what to do next. Each of the low level abort
12 * and reset functions must correctly indicate what it has done.
13 * The descriptions are written from the point of view of the mid-level code,
14 * so that the return code is telling the mid-level drivers exactly what
15 * the low level driver has already done, and what remains to be done.
16 */
17
18/* We did not do anything.
19 * Wait some more for this command to complete, and if this does not work,
20 * try something more serious. */
21#define SCSI_ABORT_SNOOZE 0
22
23/* This means that we were able to abort the command. We have already
24 * called the mid-level done function, and do not expect an interrupt that
25 * will lead to another call to the mid-level done function for this command */
26#define SCSI_ABORT_SUCCESS 1
27
28/* We called for an abort of this command, and we should get an interrupt
29 * when this succeeds. Thus we should not restore the timer for this
30 * command in the mid-level abort function. */
31#define SCSI_ABORT_PENDING 2
32
33/* Unable to abort - command is currently on the bus. Grin and bear it. */
34#define SCSI_ABORT_BUSY 3
35
36/* The command is not active in the low level code. Command probably
37 * finished. */
38#define SCSI_ABORT_NOT_RUNNING 4
39
40/* Something went wrong. The low level driver will indicate the correct
41 * error condition when it calls scsi_done, so the mid-level abort function
42 * can simply wait until this comes through */
43#define SCSI_ABORT_ERROR 5
44
45/* We do not know how to reset the bus, or we do not want to. Bummer.
46 * Anyway, just wait a little more for the command in question, and hope that
47 * it eventually finishes. If it never finishes, the SCSI device could
48 * hang, so use this with caution. */
49#define SCSI_RESET_SNOOZE 0
50
51/* We do not know how to reset the bus, or we do not want to. Bummer.
52 * We have given up on this ever completing. The mid-level code will
53 * request sense information to decide how to proceed from here. */
54#define SCSI_RESET_PUNT 1
55
56/* This means that we were able to reset the bus. We have restarted all of
57 * the commands that should be restarted, and we should be able to continue
58 * on normally from here. We do not expect any interrupts that will return
59 * DID_RESET to any of the other commands in the host_queue, and the mid-level
60 * code does not need to do anything special to keep the commands alive.
61 * If a hard reset was performed then all outstanding commands on the
62 * bus have been restarted. */
63#define SCSI_RESET_SUCCESS 2
64
65/* We called for a reset of this bus, and we should get an interrupt
66 * when this succeeds. Each command should get its own status
67 * passed up to scsi_done, but this has not happened yet.
68 * If a hard reset was performed, then we expect an interrupt
69 * for *each* of the outstanding commands that will have the
70 * effect of restarting the commands.
71 */
72#define SCSI_RESET_PENDING 3
73
74/* We did a reset, but do not expect an interrupt to signal DID_RESET.
75 * This tells the upper level code to request the sense info, and this
76 * should keep the command alive. */
77#define SCSI_RESET_WAKEUP 4
78
79/* The command is not active in the low level code. Command probably
80 finished. */
81#define SCSI_RESET_NOT_RUNNING 5
82
83/* Something went wrong, and we do not know how to fix it. */
84#define SCSI_RESET_ERROR 6
85
86#define SCSI_RESET_SYNCHRONOUS 0x01
87#define SCSI_RESET_ASYNCHRONOUS 0x02
88#define SCSI_RESET_SUGGEST_BUS_RESET 0x04
89#define SCSI_RESET_SUGGEST_HOST_RESET 0x08
90/*
91 * This is a bitmask that is ored with one of the above codes.
92 * It tells the mid-level code that we did a hard reset.
93 */
94#define SCSI_RESET_BUS_RESET 0x100
95/*
96 * This is a bitmask that is ored with one of the above codes.
97 * It tells the mid-level code that we did a host adapter reset.
98 */
99#define SCSI_RESET_HOST_RESET 0x200
100/*
101 * Used to mask off bits and to obtain the basic action that was
102 * performed.
103 */
104#define SCSI_RESET_ACTION 0xff
105
106#endif /* SCSI_OBSOLETE_H */
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index aca3b39fe710..c01580df4476 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -30,11 +30,6 @@ struct Scsi_Host;
30#define SCSI_REQ_MAGIC 0x75F6D354 30#define SCSI_REQ_MAGIC 0x75F6D354
31 31
32/* 32/*
33 * Flag bit for the internal_timeout array
34 */
35#define NORMAL_TIMEOUT 0
36
37/*
38 * Scsi Error Handler Flags 33 * Scsi Error Handler Flags
39 */ 34 */
40#define scsi_eh_eflags_chk(scp, flags) \ 35#define scsi_eh_eflags_chk(scp, flags) \
diff --git a/drivers/scsi/seagate.c b/drivers/scsi/seagate.c
index b362ff2811da..4c95abb54057 100644
--- a/drivers/scsi/seagate.c
+++ b/drivers/scsi/seagate.c
@@ -103,6 +103,7 @@
103#include <asm/uaccess.h> 103#include <asm/uaccess.h>
104 104
105#include "scsi.h" 105#include "scsi.h"
106#include <scsi/scsi_dbg.h>
106#include <scsi/scsi_host.h> 107#include <scsi/scsi_host.h>
107#include "seagate.h" 108#include "seagate.h"
108 109
@@ -746,7 +747,7 @@ static int internal_command (unsigned char target, unsigned char lun,
746 747
747#if (DEBUG & PRINT_COMMAND) 748#if (DEBUG & PRINT_COMMAND)
748 printk("scsi%d : target = %d, command = ", hostno, target); 749 printk("scsi%d : target = %d, command = ", hostno, target);
749 print_command((unsigned char *) cmnd); 750 __scsi_print_command((unsigned char *) cmnd);
750#endif 751#endif
751 752
752#if (DEBUG & PHASE_RESELECT) 753#if (DEBUG & PHASE_RESELECT)
@@ -1553,7 +1554,7 @@ connect_loop:
1553 printk("\n"); 1554 printk("\n");
1554#endif 1555#endif
1555 printk("scsi%d : status = ", hostno); 1556 printk("scsi%d : status = ", hostno);
1556 print_status(status); 1557 scsi_print_status(status);
1557 printk(" message = %02x\n", message); 1558 printk(" message = %02x\n", message);
1558#endif 1559#endif
1559 1560
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 32de9aabcb99..ce8332297dfa 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -51,6 +51,7 @@ static int sg_version_num = 30533; /* 2 digits for each component */
51#include <linux/delay.h> 51#include <linux/delay.h>
52 52
53#include "scsi.h" 53#include "scsi.h"
54#include <scsi/scsi_dbg.h>
54#include <scsi/scsi_host.h> 55#include <scsi/scsi_host.h>
55#include <scsi/scsi_driver.h> 56#include <scsi/scsi_driver.h>
56#include <scsi/scsi_ioctl.h> 57#include <scsi/scsi_ioctl.h>
@@ -1368,7 +1369,7 @@ sg_cmd_done(Scsi_Cmnd * SCpnt)
1368 if ((sdp->sgdebug > 0) && 1369 if ((sdp->sgdebug > 0) &&
1369 ((CHECK_CONDITION == srp->header.masked_status) || 1370 ((CHECK_CONDITION == srp->header.masked_status) ||
1370 (COMMAND_TERMINATED == srp->header.masked_status))) 1371 (COMMAND_TERMINATED == srp->header.masked_status)))
1371 print_req_sense("sg_cmd_done", SRpnt); 1372 scsi_print_req_sense("sg_cmd_done", SRpnt);
1372 1373
1373 /* Following if statement is a patch supplied by Eric Youngdale */ 1374 /* Following if statement is a patch supplied by Eric Youngdale */
1374 if (driver_byte(SRpnt->sr_result) != 0 1375 if (driver_byte(SRpnt->sr_result) != 0
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c
index 90811390a37d..7e19589e71a0 100644
--- a/drivers/scsi/sun3_NCR5380.c
+++ b/drivers/scsi/sun3_NCR5380.c
@@ -69,6 +69,7 @@
69 * finally replaced that by the *_PRINTK() macros. 69 * finally replaced that by the *_PRINTK() macros.
70 * 70 *
71 */ 71 */
72#include <scsi/scsi_dbg.h>
72 73
73/* 74/*
74 * Further development / testing that should be done : 75 * Further development / testing that should be done :
@@ -2377,7 +2378,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
2377 * 3..length+1 arguments 2378 * 3..length+1 arguments
2378 * 2379 *
2379 * Start the extended message buffer with the EXTENDED_MESSAGE 2380 * Start the extended message buffer with the EXTENDED_MESSAGE
2380 * byte, since print_msg() wants the whole thing. 2381 * byte, since scsi_print_msg() wants the whole thing.
2381 */ 2382 */
2382 extended_msg[0] = EXTENDED_MESSAGE; 2383 extended_msg[0] = EXTENDED_MESSAGE;
2383 /* Accept first byte by clearing ACK */ 2384 /* Accept first byte by clearing ACK */
@@ -2430,7 +2431,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
2430 default: 2431 default:
2431 if (!tmp) { 2432 if (!tmp) {
2432 printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO); 2433 printk(KERN_DEBUG "scsi%d: rejecting message ", HOSTNO);
2433 print_msg (extended_msg); 2434 scsi_print_msg (extended_msg);
2434 printk("\n"); 2435 printk("\n");
2435 } else if (tmp != EXTENDED_MESSAGE) 2436 } else if (tmp != EXTENDED_MESSAGE)
2436 printk(KERN_DEBUG "scsi%d: rejecting unknown " 2437 printk(KERN_DEBUG "scsi%d: rejecting unknown "
@@ -2565,7 +2566,7 @@ static void NCR5380_reselect (struct Scsi_Host *instance)
2565 2566
2566 if (!(msg[0] & 0x80)) { 2567 if (!(msg[0] & 0x80)) {
2567 printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO); 2568 printk(KERN_DEBUG "scsi%d: expecting IDENTIFY message, got ", HOSTNO);
2568 print_msg(msg); 2569 scsi_print_msg(msg);
2569 do_abort(instance); 2570 do_abort(instance);
2570 return; 2571 return;
2571 } 2572 }
@@ -2691,7 +2692,7 @@ static int NCR5380_abort (Scsi_Cmnd *cmd)
2691 unsigned long flags; 2692 unsigned long flags;
2692 2693
2693 printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO); 2694 printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO);
2694 print_Scsi_Cmnd (cmd); 2695 scsi_print_command(cmd);
2695 2696
2696 NCR5380_print_status (instance); 2697 NCR5380_print_status (instance);
2697 2698
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
index a1dff6d437bc..5ff83d214f12 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -799,12 +799,6 @@ static int sym_eh_handler(int op, char *opname, struct scsi_cmnd *cmd)
799 799
800 dev_warn(&cmd->device->sdev_gendev, "%s operation started.\n", opname); 800 dev_warn(&cmd->device->sdev_gendev, "%s operation started.\n", opname);
801 801
802#if 0
803 /* This one should be the result of some race, thus to ignore */
804 if (cmd->serial_number != cmd->serial_number_at_timeout)
805 goto prepare;
806#endif
807
808 /* This one is queued in some place -> to wait for completion */ 802 /* This one is queued in some place -> to wait for completion */
809 FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) { 803 FOR_EACH_QUEUED_ELEMENT(&np->busy_ccbq, qp) {
810 struct sym_ccb *cp = sym_que_entry(qp, struct sym_ccb, link_ccbq); 804 struct sym_ccb *cp = sym_que_entry(qp, struct sym_ccb, link_ccbq);
diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c
index 7484916fe2aa..a00095cc74c6 100644
--- a/drivers/scsi/ultrastor.c
+++ b/drivers/scsi/ultrastor.c
@@ -945,7 +945,7 @@ static int ultrastor_abort(Scsi_Cmnd *SCpnt)
945 config.mscp[mscp_index].SCint, SCpnt); 945 config.mscp[mscp_index].SCint, SCpnt);
946#endif 946#endif
947 if (config.mscp[mscp_index].SCint == 0) 947 if (config.mscp[mscp_index].SCint == 0)
948 return SCSI_ABORT_NOT_RUNNING; 948 return FAILURE;
949 949
950 if (config.mscp[mscp_index].SCint != SCpnt) panic("Bad abort"); 950 if (config.mscp[mscp_index].SCint != SCpnt) panic("Bad abort");
951 config.mscp[mscp_index].SCint = NULL; 951 config.mscp[mscp_index].SCint = NULL;
@@ -1020,7 +1020,7 @@ static int ultrastor_host_reset(Scsi_Cmnd * SCpnt)
1020#endif 1020#endif
1021 1021
1022 spin_unlock_irqrestore(host->host_lock, flags); 1022 spin_unlock_irqrestore(host->host_lock, flags);
1023 return SCSI_RESET_SUCCESS; 1023 return SUCCESS;
1024 1024
1025} 1025}
1026 1026