diff options
Diffstat (limited to 'drivers/scsi/NCR5380.c')
-rw-r--r-- | drivers/scsi/NCR5380.c | 137 |
1 files changed, 64 insertions, 73 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index bcd223868227..93d13fc9a293 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c | |||
@@ -27,8 +27,6 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | /* | 29 | /* |
30 | * $Log: NCR5380.c,v $ | ||
31 | |||
32 | * Revision 1.10 1998/9/2 Alan Cox | 30 | * Revision 1.10 1998/9/2 Alan Cox |
33 | * (alan@lxorguk.ukuu.org.uk) | 31 | * (alan@lxorguk.ukuu.org.uk) |
34 | * Fixed up the timer lockups reported so far. Things still suck. Looking | 32 | * Fixed up the timer lockups reported so far. Things still suck. Looking |
@@ -89,13 +87,6 @@ | |||
89 | #include <scsi/scsi_dbg.h> | 87 | #include <scsi/scsi_dbg.h> |
90 | #include <scsi/scsi_transport_spi.h> | 88 | #include <scsi/scsi_transport_spi.h> |
91 | 89 | ||
92 | #ifndef NDEBUG | ||
93 | #define NDEBUG 0 | ||
94 | #endif | ||
95 | #ifndef NDEBUG_ABORT | ||
96 | #define NDEBUG_ABORT 0 | ||
97 | #endif | ||
98 | |||
99 | #if (NDEBUG & NDEBUG_LISTS) | 90 | #if (NDEBUG & NDEBUG_LISTS) |
100 | #define LIST(x,y) {printk("LINE:%d Adding %p to %p\n", __LINE__, (void*)(x), (void*)(y)); if ((x)==(y)) udelay(5); } | 91 | #define LIST(x,y) {printk("LINE:%d Adding %p to %p\n", __LINE__, (void*)(x), (void*)(y)); if ((x)==(y)) udelay(5); } |
101 | #define REMOVE(w,x,y,z) {printk("LINE:%d Removing: %p->%p %p->%p \n", __LINE__, (void*)(w), (void*)(x), (void*)(y), (void*)(z)); if ((x)==(y)) udelay(5); } | 92 | #define REMOVE(w,x,y,z) {printk("LINE:%d Removing: %p->%p %p->%p \n", __LINE__, (void*)(w), (void*)(x), (void*)(y), (void*)(z)); if ((x)==(y)) udelay(5); } |
@@ -1005,7 +996,7 @@ static int NCR5380_queue_command_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *) | |||
1005 | LIST(cmd, tmp); | 996 | LIST(cmd, tmp); |
1006 | tmp->host_scribble = (unsigned char *) cmd; | 997 | tmp->host_scribble = (unsigned char *) cmd; |
1007 | } | 998 | } |
1008 | dprintk(NDEBUG_QUEUES, ("scsi%d : command added to %s of queue\n", instance->host_no, (cmd->cmnd[0] == REQUEST_SENSE) ? "head" : "tail")); | 999 | dprintk(NDEBUG_QUEUES, "scsi%d : command added to %s of queue\n", instance->host_no, (cmd->cmnd[0] == REQUEST_SENSE) ? "head" : "tail"); |
1009 | 1000 | ||
1010 | /* Run the coroutine if it isn't already running. */ | 1001 | /* Run the coroutine if it isn't already running. */ |
1011 | /* Kick off command processing */ | 1002 | /* Kick off command processing */ |
@@ -1040,7 +1031,7 @@ static void NCR5380_main(struct work_struct *work) | |||
1040 | /* Lock held here */ | 1031 | /* Lock held here */ |
1041 | done = 1; | 1032 | done = 1; |
1042 | if (!hostdata->connected && !hostdata->selecting) { | 1033 | if (!hostdata->connected && !hostdata->selecting) { |
1043 | dprintk(NDEBUG_MAIN, ("scsi%d : not connected\n", instance->host_no)); | 1034 | dprintk(NDEBUG_MAIN, "scsi%d : not connected\n", instance->host_no); |
1044 | /* | 1035 | /* |
1045 | * Search through the issue_queue for a command destined | 1036 | * Search through the issue_queue for a command destined |
1046 | * for a target that's not busy. | 1037 | * for a target that's not busy. |
@@ -1048,7 +1039,7 @@ static void NCR5380_main(struct work_struct *work) | |||
1048 | for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, prev = NULL; tmp; prev = tmp, tmp = (Scsi_Cmnd *) tmp->host_scribble) | 1039 | for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, prev = NULL; tmp; prev = tmp, tmp = (Scsi_Cmnd *) tmp->host_scribble) |
1049 | { | 1040 | { |
1050 | if (prev != tmp) | 1041 | if (prev != tmp) |
1051 | dprintk(NDEBUG_LISTS, ("MAIN tmp=%p target=%d busy=%d lun=%d\n", tmp, tmp->target, hostdata->busy[tmp->target], tmp->lun)); | 1042 | dprintk(NDEBUG_LISTS, "MAIN tmp=%p target=%d busy=%d lun=%d\n", tmp, tmp->device->id, hostdata->busy[tmp->device->id], tmp->device->lun); |
1052 | /* When we find one, remove it from the issue queue. */ | 1043 | /* When we find one, remove it from the issue queue. */ |
1053 | if (!(hostdata->busy[tmp->device->id] & (1 << tmp->device->lun))) { | 1044 | if (!(hostdata->busy[tmp->device->id] & (1 << tmp->device->lun))) { |
1054 | if (prev) { | 1045 | if (prev) { |
@@ -1066,7 +1057,7 @@ static void NCR5380_main(struct work_struct *work) | |||
1066 | * On failure, we must add the command back to the | 1057 | * On failure, we must add the command back to the |
1067 | * issue queue so we can keep trying. | 1058 | * issue queue so we can keep trying. |
1068 | */ | 1059 | */ |
1069 | dprintk(NDEBUG_MAIN|NDEBUG_QUEUES, ("scsi%d : main() : command for target %d lun %d removed from issue_queue\n", instance->host_no, tmp->target, tmp->lun)); | 1060 | dprintk(NDEBUG_MAIN|NDEBUG_QUEUES, "scsi%d : main() : command for target %d lun %d removed from issue_queue\n", instance->host_no, tmp->device->id, tmp->device->lun); |
1070 | 1061 | ||
1071 | /* | 1062 | /* |
1072 | * A successful selection is defined as one that | 1063 | * A successful selection is defined as one that |
@@ -1095,7 +1086,7 @@ static void NCR5380_main(struct work_struct *work) | |||
1095 | tmp->host_scribble = (unsigned char *) hostdata->issue_queue; | 1086 | tmp->host_scribble = (unsigned char *) hostdata->issue_queue; |
1096 | hostdata->issue_queue = tmp; | 1087 | hostdata->issue_queue = tmp; |
1097 | done = 0; | 1088 | done = 0; |
1098 | dprintk(NDEBUG_MAIN|NDEBUG_QUEUES, ("scsi%d : main(): select() failed, returned to issue_queue\n", instance->host_no)); | 1089 | dprintk(NDEBUG_MAIN|NDEBUG_QUEUES, "scsi%d : main(): select() failed, returned to issue_queue\n", instance->host_no); |
1099 | } | 1090 | } |
1100 | /* lock held here still */ | 1091 | /* lock held here still */ |
1101 | } /* if target/lun is not busy */ | 1092 | } /* if target/lun is not busy */ |
@@ -1125,9 +1116,9 @@ static void NCR5380_main(struct work_struct *work) | |||
1125 | #endif | 1116 | #endif |
1126 | && (!hostdata->time_expires || time_before_eq(hostdata->time_expires, jiffies)) | 1117 | && (!hostdata->time_expires || time_before_eq(hostdata->time_expires, jiffies)) |
1127 | ) { | 1118 | ) { |
1128 | dprintk(NDEBUG_MAIN, ("scsi%d : main() : performing information transfer\n", instance->host_no)); | 1119 | dprintk(NDEBUG_MAIN, "scsi%d : main() : performing information transfer\n", instance->host_no); |
1129 | NCR5380_information_transfer(instance); | 1120 | NCR5380_information_transfer(instance); |
1130 | dprintk(NDEBUG_MAIN, ("scsi%d : main() : done set false\n", instance->host_no)); | 1121 | dprintk(NDEBUG_MAIN, "scsi%d : main() : done set false\n", instance->host_no); |
1131 | done = 0; | 1122 | done = 0; |
1132 | } else | 1123 | } else |
1133 | break; | 1124 | break; |
@@ -1159,8 +1150,8 @@ static irqreturn_t NCR5380_intr(int dummy, void *dev_id) | |||
1159 | unsigned char basr; | 1150 | unsigned char basr; |
1160 | unsigned long flags; | 1151 | unsigned long flags; |
1161 | 1152 | ||
1162 | dprintk(NDEBUG_INTR, ("scsi : NCR5380 irq %d triggered\n", | 1153 | dprintk(NDEBUG_INTR, "scsi : NCR5380 irq %d triggered\n", |
1163 | instance->irq)); | 1154 | instance->irq); |
1164 | 1155 | ||
1165 | do { | 1156 | do { |
1166 | done = 1; | 1157 | done = 1; |
@@ -1173,14 +1164,14 @@ static irqreturn_t NCR5380_intr(int dummy, void *dev_id) | |||
1173 | NCR5380_dprint(NDEBUG_INTR, instance); | 1164 | NCR5380_dprint(NDEBUG_INTR, instance); |
1174 | if ((NCR5380_read(STATUS_REG) & (SR_SEL | SR_IO)) == (SR_SEL | SR_IO)) { | 1165 | if ((NCR5380_read(STATUS_REG) & (SR_SEL | SR_IO)) == (SR_SEL | SR_IO)) { |
1175 | done = 0; | 1166 | done = 0; |
1176 | dprintk(NDEBUG_INTR, ("scsi%d : SEL interrupt\n", instance->host_no)); | 1167 | dprintk(NDEBUG_INTR, "scsi%d : SEL interrupt\n", instance->host_no); |
1177 | NCR5380_reselect(instance); | 1168 | NCR5380_reselect(instance); |
1178 | (void) NCR5380_read(RESET_PARITY_INTERRUPT_REG); | 1169 | (void) NCR5380_read(RESET_PARITY_INTERRUPT_REG); |
1179 | } else if (basr & BASR_PARITY_ERROR) { | 1170 | } else if (basr & BASR_PARITY_ERROR) { |
1180 | dprintk(NDEBUG_INTR, ("scsi%d : PARITY interrupt\n", instance->host_no)); | 1171 | dprintk(NDEBUG_INTR, "scsi%d : PARITY interrupt\n", instance->host_no); |
1181 | (void) NCR5380_read(RESET_PARITY_INTERRUPT_REG); | 1172 | (void) NCR5380_read(RESET_PARITY_INTERRUPT_REG); |
1182 | } else if ((NCR5380_read(STATUS_REG) & SR_RST) == SR_RST) { | 1173 | } else if ((NCR5380_read(STATUS_REG) & SR_RST) == SR_RST) { |
1183 | dprintk(NDEBUG_INTR, ("scsi%d : RESET interrupt\n", instance->host_no)); | 1174 | dprintk(NDEBUG_INTR, "scsi%d : RESET interrupt\n", instance->host_no); |
1184 | (void) NCR5380_read(RESET_PARITY_INTERRUPT_REG); | 1175 | (void) NCR5380_read(RESET_PARITY_INTERRUPT_REG); |
1185 | } else { | 1176 | } else { |
1186 | #if defined(REAL_DMA) | 1177 | #if defined(REAL_DMA) |
@@ -1210,7 +1201,7 @@ static irqreturn_t NCR5380_intr(int dummy, void *dev_id) | |||
1210 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); | 1201 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); |
1211 | } | 1202 | } |
1212 | #else | 1203 | #else |
1213 | dprintk(NDEBUG_INTR, ("scsi : unknown interrupt, BASR 0x%X, MR 0x%X, SR 0x%x\n", basr, NCR5380_read(MODE_REG), NCR5380_read(STATUS_REG))); | 1204 | dprintk(NDEBUG_INTR, "scsi : unknown interrupt, BASR 0x%X, MR 0x%X, SR 0x%x\n", basr, NCR5380_read(MODE_REG), NCR5380_read(STATUS_REG)); |
1214 | (void) NCR5380_read(RESET_PARITY_INTERRUPT_REG); | 1205 | (void) NCR5380_read(RESET_PARITY_INTERRUPT_REG); |
1215 | #endif | 1206 | #endif |
1216 | } | 1207 | } |
@@ -1304,7 +1295,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag) | |||
1304 | hostdata->restart_select = 0; | 1295 | hostdata->restart_select = 0; |
1305 | 1296 | ||
1306 | NCR5380_dprint(NDEBUG_ARBITRATION, instance); | 1297 | NCR5380_dprint(NDEBUG_ARBITRATION, instance); |
1307 | dprintk(NDEBUG_ARBITRATION, ("scsi%d : starting arbitration, id = %d\n", instance->host_no, instance->this_id)); | 1298 | dprintk(NDEBUG_ARBITRATION, "scsi%d : starting arbitration, id = %d\n", instance->host_no, instance->this_id); |
1308 | 1299 | ||
1309 | /* | 1300 | /* |
1310 | * Set the phase bits to 0, otherwise the NCR5380 won't drive the | 1301 | * Set the phase bits to 0, otherwise the NCR5380 won't drive the |
@@ -1333,7 +1324,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag) | |||
1333 | goto failed; | 1324 | goto failed; |
1334 | } | 1325 | } |
1335 | 1326 | ||
1336 | dprintk(NDEBUG_ARBITRATION, ("scsi%d : arbitration complete\n", instance->host_no)); | 1327 | dprintk(NDEBUG_ARBITRATION, "scsi%d : arbitration complete\n", instance->host_no); |
1337 | 1328 | ||
1338 | /* | 1329 | /* |
1339 | * The arbitration delay is 2.2us, but this is a minimum and there is | 1330 | * The arbitration delay is 2.2us, but this is a minimum and there is |
@@ -1347,7 +1338,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag) | |||
1347 | /* Check for lost arbitration */ | 1338 | /* Check for lost arbitration */ |
1348 | if ((NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST) || (NCR5380_read(CURRENT_SCSI_DATA_REG) & hostdata->id_higher_mask) || (NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST)) { | 1339 | if ((NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST) || (NCR5380_read(CURRENT_SCSI_DATA_REG) & hostdata->id_higher_mask) || (NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST)) { |
1349 | NCR5380_write(MODE_REG, MR_BASE); | 1340 | NCR5380_write(MODE_REG, MR_BASE); |
1350 | dprintk(NDEBUG_ARBITRATION, ("scsi%d : lost arbitration, deasserting MR_ARBITRATE\n", instance->host_no)); | 1341 | dprintk(NDEBUG_ARBITRATION, "scsi%d : lost arbitration, deasserting MR_ARBITRATE\n", instance->host_no); |
1351 | goto failed; | 1342 | goto failed; |
1352 | } | 1343 | } |
1353 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_SEL); | 1344 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_SEL); |
@@ -1360,7 +1351,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag) | |||
1360 | (NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST)) { | 1351 | (NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST)) { |
1361 | NCR5380_write(MODE_REG, MR_BASE); | 1352 | NCR5380_write(MODE_REG, MR_BASE); |
1362 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); | 1353 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); |
1363 | dprintk(NDEBUG_ARBITRATION, ("scsi%d : lost arbitration, deasserting ICR_ASSERT_SEL\n", instance->host_no)); | 1354 | dprintk(NDEBUG_ARBITRATION, "scsi%d : lost arbitration, deasserting ICR_ASSERT_SEL\n", instance->host_no); |
1364 | goto failed; | 1355 | goto failed; |
1365 | } | 1356 | } |
1366 | /* | 1357 | /* |
@@ -1370,7 +1361,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag) | |||
1370 | 1361 | ||
1371 | udelay(2); | 1362 | udelay(2); |
1372 | 1363 | ||
1373 | dprintk(NDEBUG_ARBITRATION, ("scsi%d : won arbitration\n", instance->host_no)); | 1364 | dprintk(NDEBUG_ARBITRATION, "scsi%d : won arbitration\n", instance->host_no); |
1374 | 1365 | ||
1375 | /* | 1366 | /* |
1376 | * Now that we have won arbitration, start Selection process, asserting | 1367 | * Now that we have won arbitration, start Selection process, asserting |
@@ -1422,7 +1413,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag) | |||
1422 | 1413 | ||
1423 | udelay(1); | 1414 | udelay(1); |
1424 | 1415 | ||
1425 | dprintk(NDEBUG_SELECTION, ("scsi%d : selecting target %d\n", instance->host_no, scmd_id(cmd))); | 1416 | dprintk(NDEBUG_SELECTION, "scsi%d : selecting target %d\n", instance->host_no, scmd_id(cmd)); |
1426 | 1417 | ||
1427 | /* | 1418 | /* |
1428 | * The SCSI specification calls for a 250 ms timeout for the actual | 1419 | * The SCSI specification calls for a 250 ms timeout for the actual |
@@ -1487,7 +1478,7 @@ part2: | |||
1487 | collect_stats(hostdata, cmd); | 1478 | collect_stats(hostdata, cmd); |
1488 | cmd->scsi_done(cmd); | 1479 | cmd->scsi_done(cmd); |
1489 | NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); | 1480 | NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); |
1490 | dprintk(NDEBUG_SELECTION, ("scsi%d : target did not respond within 250ms\n", instance->host_no)); | 1481 | dprintk(NDEBUG_SELECTION, "scsi%d : target did not respond within 250ms\n", instance->host_no); |
1491 | NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); | 1482 | NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); |
1492 | return 0; | 1483 | return 0; |
1493 | } | 1484 | } |
@@ -1520,7 +1511,7 @@ part2: | |||
1520 | goto failed; | 1511 | goto failed; |
1521 | } | 1512 | } |
1522 | 1513 | ||
1523 | dprintk(NDEBUG_SELECTION, ("scsi%d : target %d selected, going into MESSAGE OUT phase.\n", instance->host_no, cmd->device->id)); | 1514 | dprintk(NDEBUG_SELECTION, "scsi%d : target %d selected, going into MESSAGE OUT phase.\n", instance->host_no, cmd->device->id); |
1524 | tmp[0] = IDENTIFY(((instance->irq == SCSI_IRQ_NONE) ? 0 : 1), cmd->device->lun); | 1515 | tmp[0] = IDENTIFY(((instance->irq == SCSI_IRQ_NONE) ? 0 : 1), cmd->device->lun); |
1525 | 1516 | ||
1526 | len = 1; | 1517 | len = 1; |
@@ -1530,7 +1521,7 @@ part2: | |||
1530 | data = tmp; | 1521 | data = tmp; |
1531 | phase = PHASE_MSGOUT; | 1522 | phase = PHASE_MSGOUT; |
1532 | NCR5380_transfer_pio(instance, &phase, &len, &data); | 1523 | NCR5380_transfer_pio(instance, &phase, &len, &data); |
1533 | dprintk(NDEBUG_SELECTION, ("scsi%d : nexus established.\n", instance->host_no)); | 1524 | dprintk(NDEBUG_SELECTION, "scsi%d : nexus established.\n", instance->host_no); |
1534 | /* XXX need to handle errors here */ | 1525 | /* XXX need to handle errors here */ |
1535 | hostdata->connected = cmd; | 1526 | hostdata->connected = cmd; |
1536 | hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); | 1527 | hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); |
@@ -1583,9 +1574,9 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance, unsigned char *phase | |||
1583 | NCR5380_setup(instance); | 1574 | NCR5380_setup(instance); |
1584 | 1575 | ||
1585 | if (!(p & SR_IO)) | 1576 | if (!(p & SR_IO)) |
1586 | dprintk(NDEBUG_PIO, ("scsi%d : pio write %d bytes\n", instance->host_no, c)); | 1577 | dprintk(NDEBUG_PIO, "scsi%d : pio write %d bytes\n", instance->host_no, c); |
1587 | else | 1578 | else |
1588 | dprintk(NDEBUG_PIO, ("scsi%d : pio read %d bytes\n", instance->host_no, c)); | 1579 | dprintk(NDEBUG_PIO, "scsi%d : pio read %d bytes\n", instance->host_no, c); |
1589 | 1580 | ||
1590 | /* | 1581 | /* |
1591 | * The NCR5380 chip will only drive the SCSI bus when the | 1582 | * The NCR5380 chip will only drive the SCSI bus when the |
@@ -1620,11 +1611,11 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance, unsigned char *phase | |||
1620 | break; | 1611 | break; |
1621 | } | 1612 | } |
1622 | 1613 | ||
1623 | dprintk(NDEBUG_HANDSHAKE, ("scsi%d : REQ detected\n", instance->host_no)); | 1614 | dprintk(NDEBUG_HANDSHAKE, "scsi%d : REQ detected\n", instance->host_no); |
1624 | 1615 | ||
1625 | /* Check for phase mismatch */ | 1616 | /* Check for phase mismatch */ |
1626 | if ((tmp & PHASE_MASK) != p) { | 1617 | if ((tmp & PHASE_MASK) != p) { |
1627 | dprintk(NDEBUG_HANDSHAKE, ("scsi%d : phase mismatch\n", instance->host_no)); | 1618 | dprintk(NDEBUG_HANDSHAKE, "scsi%d : phase mismatch\n", instance->host_no); |
1628 | NCR5380_dprint_phase(NDEBUG_HANDSHAKE, instance); | 1619 | NCR5380_dprint_phase(NDEBUG_HANDSHAKE, instance); |
1629 | break; | 1620 | break; |
1630 | } | 1621 | } |
@@ -1660,7 +1651,7 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance, unsigned char *phase | |||
1660 | 1651 | ||
1661 | /* FIXME - if this fails bus reset ?? */ | 1652 | /* FIXME - if this fails bus reset ?? */ |
1662 | NCR5380_poll_politely(instance, STATUS_REG, SR_REQ, 0, 5*HZ); | 1653 | NCR5380_poll_politely(instance, STATUS_REG, SR_REQ, 0, 5*HZ); |
1663 | dprintk(NDEBUG_HANDSHAKE, ("scsi%d : req false, handshake complete\n", instance->host_no)); | 1654 | dprintk(NDEBUG_HANDSHAKE, "scsi%d : req false, handshake complete\n", instance->host_no); |
1664 | 1655 | ||
1665 | /* | 1656 | /* |
1666 | * We have several special cases to consider during REQ/ACK handshaking : | 1657 | * We have several special cases to consider during REQ/ACK handshaking : |
@@ -1681,7 +1672,7 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance, unsigned char *phase | |||
1681 | } | 1672 | } |
1682 | } while (--c); | 1673 | } while (--c); |
1683 | 1674 | ||
1684 | dprintk(NDEBUG_PIO, ("scsi%d : residual %d\n", instance->host_no, c)); | 1675 | dprintk(NDEBUG_PIO, "scsi%d : residual %d\n", instance->host_no, c); |
1685 | 1676 | ||
1686 | *count = c; | 1677 | *count = c; |
1687 | *data = d; | 1678 | *data = d; |
@@ -1828,7 +1819,7 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase | |||
1828 | c -= 2; | 1819 | c -= 2; |
1829 | } | 1820 | } |
1830 | #endif | 1821 | #endif |
1831 | dprintk(NDEBUG_DMA, ("scsi%d : initializing DMA channel %d for %s, %d bytes %s %0x\n", instance->host_no, instance->dma_channel, (p & SR_IO) ? "reading" : "writing", c, (p & SR_IO) ? "to" : "from", (unsigned) d)); | 1822 | dprintk(NDEBUG_DMA, "scsi%d : initializing DMA channel %d for %s, %d bytes %s %0x\n", instance->host_no, instance->dma_channel, (p & SR_IO) ? "reading" : "writing", c, (p & SR_IO) ? "to" : "from", (unsigned) d); |
1832 | hostdata->dma_len = (p & SR_IO) ? NCR5380_dma_read_setup(instance, d, c) : NCR5380_dma_write_setup(instance, d, c); | 1823 | hostdata->dma_len = (p & SR_IO) ? NCR5380_dma_read_setup(instance, d, c) : NCR5380_dma_write_setup(instance, d, c); |
1833 | #endif | 1824 | #endif |
1834 | 1825 | ||
@@ -1857,7 +1848,7 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase | |||
1857 | NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE); | 1848 | NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE); |
1858 | #endif /* def REAL_DMA */ | 1849 | #endif /* def REAL_DMA */ |
1859 | 1850 | ||
1860 | dprintk(NDEBUG_DMA, ("scsi%d : mode reg = 0x%X\n", instance->host_no, NCR5380_read(MODE_REG))); | 1851 | dprintk(NDEBUG_DMA, "scsi%d : mode reg = 0x%X\n", instance->host_no, NCR5380_read(MODE_REG)); |
1861 | 1852 | ||
1862 | /* | 1853 | /* |
1863 | * On the PAS16 at least I/O recovery delays are not needed here. | 1854 | * On the PAS16 at least I/O recovery delays are not needed here. |
@@ -1934,7 +1925,7 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase | |||
1934 | } | 1925 | } |
1935 | } | 1926 | } |
1936 | 1927 | ||
1937 | dprintk(NDEBUG_DMA, ("scsi%d : polled DMA transfer complete, basr 0x%X, sr 0x%X\n", instance->host_no, tmp, NCR5380_read(STATUS_REG))); | 1928 | dprintk(NDEBUG_DMA, "scsi%d : polled DMA transfer complete, basr 0x%X, sr 0x%X\n", instance->host_no, tmp, NCR5380_read(STATUS_REG)); |
1938 | 1929 | ||
1939 | NCR5380_write(MODE_REG, MR_BASE); | 1930 | NCR5380_write(MODE_REG, MR_BASE); |
1940 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); | 1931 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); |
@@ -1948,7 +1939,7 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase | |||
1948 | #ifdef READ_OVERRUNS | 1939 | #ifdef READ_OVERRUNS |
1949 | if (*phase == p && (p & SR_IO) && residue == 0) { | 1940 | if (*phase == p && (p & SR_IO) && residue == 0) { |
1950 | if (overrun) { | 1941 | if (overrun) { |
1951 | dprintk(NDEBUG_DMA, ("Got an input overrun, using saved byte\n")); | 1942 | dprintk(NDEBUG_DMA, "Got an input overrun, using saved byte\n"); |
1952 | **data = saved_data; | 1943 | **data = saved_data; |
1953 | *data += 1; | 1944 | *data += 1; |
1954 | *count -= 1; | 1945 | *count -= 1; |
@@ -1957,13 +1948,13 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase | |||
1957 | printk("No overrun??\n"); | 1948 | printk("No overrun??\n"); |
1958 | cnt = toPIO = 2; | 1949 | cnt = toPIO = 2; |
1959 | } | 1950 | } |
1960 | dprintk(NDEBUG_DMA, ("Doing %d-byte PIO to 0x%X\n", cnt, *data)); | 1951 | dprintk(NDEBUG_DMA, "Doing %d-byte PIO to 0x%X\n", cnt, *data); |
1961 | NCR5380_transfer_pio(instance, phase, &cnt, data); | 1952 | NCR5380_transfer_pio(instance, phase, &cnt, data); |
1962 | *count -= toPIO - cnt; | 1953 | *count -= toPIO - cnt; |
1963 | } | 1954 | } |
1964 | #endif | 1955 | #endif |
1965 | 1956 | ||
1966 | dprintk(NDEBUG_DMA, ("Return with data ptr = 0x%X, count %d, last 0x%X, next 0x%X\n", *data, *count, *(*data + *count - 1), *(*data + *count))); | 1957 | dprintk(NDEBUG_DMA, "Return with data ptr = 0x%X, count %d, last 0x%X, next 0x%X\n", *data, *count, *(*data + *count - 1), *(*data + *count)); |
1967 | return 0; | 1958 | return 0; |
1968 | 1959 | ||
1969 | #elif defined(REAL_DMA) | 1960 | #elif defined(REAL_DMA) |
@@ -2013,7 +2004,7 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase | |||
2013 | foo = NCR5380_pwrite(instance, d, c); | 2004 | foo = NCR5380_pwrite(instance, d, c); |
2014 | #else | 2005 | #else |
2015 | int timeout; | 2006 | int timeout; |
2016 | dprintk(NDEBUG_C400_PWRITE, ("About to pwrite %d bytes\n", c)); | 2007 | dprintk(NDEBUG_C400_PWRITE, "About to pwrite %d bytes\n", c); |
2017 | if (!(foo = NCR5380_pwrite(instance, d, c))) { | 2008 | if (!(foo = NCR5380_pwrite(instance, d, c))) { |
2018 | /* | 2009 | /* |
2019 | * Wait for the last byte to be sent. If REQ is being asserted for | 2010 | * Wait for the last byte to be sent. If REQ is being asserted for |
@@ -2024,19 +2015,19 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase | |||
2024 | while (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ) && (NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH)); | 2015 | while (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_DRQ) && (NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH)); |
2025 | 2016 | ||
2026 | if (!timeout) | 2017 | if (!timeout) |
2027 | dprintk(NDEBUG_LAST_BYTE_SENT, ("scsi%d : timed out on last byte\n", instance->host_no)); | 2018 | dprintk(NDEBUG_LAST_BYTE_SENT, "scsi%d : timed out on last byte\n", instance->host_no); |
2028 | 2019 | ||
2029 | if (hostdata->flags & FLAG_CHECK_LAST_BYTE_SENT) { | 2020 | if (hostdata->flags & FLAG_CHECK_LAST_BYTE_SENT) { |
2030 | hostdata->flags &= ~FLAG_CHECK_LAST_BYTE_SENT; | 2021 | hostdata->flags &= ~FLAG_CHECK_LAST_BYTE_SENT; |
2031 | if (NCR5380_read(TARGET_COMMAND_REG) & TCR_LAST_BYTE_SENT) { | 2022 | if (NCR5380_read(TARGET_COMMAND_REG) & TCR_LAST_BYTE_SENT) { |
2032 | hostdata->flags |= FLAG_HAS_LAST_BYTE_SENT; | 2023 | hostdata->flags |= FLAG_HAS_LAST_BYTE_SENT; |
2033 | dprintk(NDEBUG_LAST_WRITE_SENT, ("scsi%d : last bit sent works\n", instance->host_no)); | 2024 | dprintk(NDEBUG_LAST_BYTE_SENT, "scsi%d : last byte sent works\n", instance->host_no); |
2034 | } | 2025 | } |
2035 | } | 2026 | } |
2036 | } else { | 2027 | } else { |
2037 | dprintk(NDEBUG_C400_PWRITE, ("Waiting for LASTBYTE\n")); | 2028 | dprintk(NDEBUG_C400_PWRITE, "Waiting for LASTBYTE\n"); |
2038 | while (!(NCR5380_read(TARGET_COMMAND_REG) & TCR_LAST_BYTE_SENT)); | 2029 | while (!(NCR5380_read(TARGET_COMMAND_REG) & TCR_LAST_BYTE_SENT)); |
2039 | dprintk(NDEBUG_C400_PWRITE, ("Got LASTBYTE\n")); | 2030 | dprintk(NDEBUG_C400_PWRITE, "Got LASTBYTE\n"); |
2040 | } | 2031 | } |
2041 | } | 2032 | } |
2042 | #endif | 2033 | #endif |
@@ -2045,9 +2036,9 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase | |||
2045 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); | 2036 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); |
2046 | 2037 | ||
2047 | if ((!(p & SR_IO)) && (hostdata->flags & FLAG_NCR53C400)) { | 2038 | if ((!(p & SR_IO)) && (hostdata->flags & FLAG_NCR53C400)) { |
2048 | dprintk(NDEBUG_C400_PWRITE, ("53C400w: Checking for IRQ\n")); | 2039 | dprintk(NDEBUG_C400_PWRITE, "53C400w: Checking for IRQ\n"); |
2049 | if (NCR5380_read(BUS_AND_STATUS_REG) & BASR_IRQ) { | 2040 | if (NCR5380_read(BUS_AND_STATUS_REG) & BASR_IRQ) { |
2050 | dprintk(NDEBUG_C400_PWRITE, ("53C400w: got it, reading reset interrupt reg\n")); | 2041 | dprintk(NDEBUG_C400_PWRITE, "53C400w: got it, reading reset interrupt reg\n"); |
2051 | NCR5380_read(RESET_PARITY_INTERRUPT_REG); | 2042 | NCR5380_read(RESET_PARITY_INTERRUPT_REG); |
2052 | } else { | 2043 | } else { |
2053 | printk("53C400w: IRQ NOT THERE!\n"); | 2044 | printk("53C400w: IRQ NOT THERE!\n"); |
@@ -2139,7 +2130,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2139 | --cmd->SCp.buffers_residual; | 2130 | --cmd->SCp.buffers_residual; |
2140 | cmd->SCp.this_residual = cmd->SCp.buffer->length; | 2131 | cmd->SCp.this_residual = cmd->SCp.buffer->length; |
2141 | cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); | 2132 | cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); |
2142 | dprintk(NDEBUG_INFORMATION, ("scsi%d : %d bytes and %d buffers left\n", instance->host_no, cmd->SCp.this_residual, cmd->SCp.buffers_residual)); | 2133 | dprintk(NDEBUG_INFORMATION, "scsi%d : %d bytes and %d buffers left\n", instance->host_no, cmd->SCp.this_residual, cmd->SCp.buffers_residual); |
2143 | } | 2134 | } |
2144 | /* | 2135 | /* |
2145 | * The preferred transfer method is going to be | 2136 | * The preferred transfer method is going to be |
@@ -2219,7 +2210,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2219 | case LINKED_FLG_CMD_COMPLETE: | 2210 | case LINKED_FLG_CMD_COMPLETE: |
2220 | /* Accept message by clearing ACK */ | 2211 | /* Accept message by clearing ACK */ |
2221 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); | 2212 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); |
2222 | dprintk(NDEBUG_LINKED, ("scsi%d : target %d lun %d linked command complete.\n", instance->host_no, cmd->device->id, cmd->device->lun)); | 2213 | dprintk(NDEBUG_LINKED, "scsi%d : target %d lun %d linked command complete.\n", instance->host_no, cmd->device->id, cmd->device->lun); |
2223 | /* | 2214 | /* |
2224 | * Sanity check : A linked command should only terminate with | 2215 | * Sanity check : A linked command should only terminate with |
2225 | * one of these messages if there are more linked commands | 2216 | * one of these messages if there are more linked commands |
@@ -2235,7 +2226,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2235 | /* The next command is still part of this process */ | 2226 | /* The next command is still part of this process */ |
2236 | cmd->next_link->tag = cmd->tag; | 2227 | cmd->next_link->tag = cmd->tag; |
2237 | cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); | 2228 | cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); |
2238 | dprintk(NDEBUG_LINKED, ("scsi%d : target %d lun %d linked request done, calling scsi_done().\n", instance->host_no, cmd->device->id, cmd->device->lun)); | 2229 | dprintk(NDEBUG_LINKED, "scsi%d : target %d lun %d linked request done, calling scsi_done().\n", instance->host_no, cmd->device->id, cmd->device->lun); |
2239 | collect_stats(hostdata, cmd); | 2230 | collect_stats(hostdata, cmd); |
2240 | cmd->scsi_done(cmd); | 2231 | cmd->scsi_done(cmd); |
2241 | cmd = hostdata->connected; | 2232 | cmd = hostdata->connected; |
@@ -2247,7 +2238,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2247 | sink = 1; | 2238 | sink = 1; |
2248 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); | 2239 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); |
2249 | hostdata->connected = NULL; | 2240 | hostdata->connected = NULL; |
2250 | dprintk(NDEBUG_QUEUES, ("scsi%d : command for target %d, lun %d completed\n", instance->host_no, cmd->device->id, cmd->device->lun)); | 2241 | dprintk(NDEBUG_QUEUES, "scsi%d : command for target %d, lun %d completed\n", instance->host_no, cmd->device->id, cmd->device->lun); |
2251 | hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); | 2242 | hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); |
2252 | 2243 | ||
2253 | /* | 2244 | /* |
@@ -2281,13 +2272,13 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2281 | if ((cmd->cmnd[0] != REQUEST_SENSE) && (status_byte(cmd->SCp.Status) == CHECK_CONDITION)) { | 2272 | if ((cmd->cmnd[0] != REQUEST_SENSE) && (status_byte(cmd->SCp.Status) == CHECK_CONDITION)) { |
2282 | scsi_eh_prep_cmnd(cmd, &hostdata->ses, NULL, 0, ~0); | 2273 | scsi_eh_prep_cmnd(cmd, &hostdata->ses, NULL, 0, ~0); |
2283 | 2274 | ||
2284 | dprintk(NDEBUG_AUTOSENSE, ("scsi%d : performing request sense\n", instance->host_no)); | 2275 | dprintk(NDEBUG_AUTOSENSE, "scsi%d : performing request sense\n", instance->host_no); |
2285 | 2276 | ||
2286 | LIST(cmd, hostdata->issue_queue); | 2277 | LIST(cmd, hostdata->issue_queue); |
2287 | cmd->host_scribble = (unsigned char *) | 2278 | cmd->host_scribble = (unsigned char *) |
2288 | hostdata->issue_queue; | 2279 | hostdata->issue_queue; |
2289 | hostdata->issue_queue = (Scsi_Cmnd *) cmd; | 2280 | hostdata->issue_queue = (Scsi_Cmnd *) cmd; |
2290 | dprintk(NDEBUG_QUEUES, ("scsi%d : REQUEST SENSE added to head of issue queue\n", instance->host_no)); | 2281 | dprintk(NDEBUG_QUEUES, "scsi%d : REQUEST SENSE added to head of issue queue\n", instance->host_no); |
2291 | } else | 2282 | } else |
2292 | #endif /* def AUTOSENSE */ | 2283 | #endif /* def AUTOSENSE */ |
2293 | { | 2284 | { |
@@ -2327,7 +2318,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2327 | hostdata->disconnected_queue; | 2318 | hostdata->disconnected_queue; |
2328 | hostdata->connected = NULL; | 2319 | hostdata->connected = NULL; |
2329 | hostdata->disconnected_queue = cmd; | 2320 | hostdata->disconnected_queue = cmd; |
2330 | dprintk(NDEBUG_QUEUES, ("scsi%d : command for target %d lun %d was moved from connected to" " the disconnected_queue\n", instance->host_no, cmd->device->id, cmd->device->lun)); | 2321 | dprintk(NDEBUG_QUEUES, "scsi%d : command for target %d lun %d was moved from connected to" " the disconnected_queue\n", instance->host_no, cmd->device->id, cmd->device->lun); |
2331 | /* | 2322 | /* |
2332 | * Restore phase bits to 0 so an interrupted selection, | 2323 | * Restore phase bits to 0 so an interrupted selection, |
2333 | * arbitration can resume. | 2324 | * arbitration can resume. |
@@ -2373,14 +2364,14 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2373 | extended_msg[0] = EXTENDED_MESSAGE; | 2364 | extended_msg[0] = EXTENDED_MESSAGE; |
2374 | /* Accept first byte by clearing ACK */ | 2365 | /* Accept first byte by clearing ACK */ |
2375 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); | 2366 | NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); |
2376 | dprintk(NDEBUG_EXTENDED, ("scsi%d : receiving extended message\n", instance->host_no)); | 2367 | dprintk(NDEBUG_EXTENDED, "scsi%d : receiving extended message\n", instance->host_no); |
2377 | 2368 | ||
2378 | len = 2; | 2369 | len = 2; |
2379 | data = extended_msg + 1; | 2370 | data = extended_msg + 1; |
2380 | phase = PHASE_MSGIN; | 2371 | phase = PHASE_MSGIN; |
2381 | NCR5380_transfer_pio(instance, &phase, &len, &data); | 2372 | NCR5380_transfer_pio(instance, &phase, &len, &data); |
2382 | 2373 | ||
2383 | dprintk(NDEBUG_EXTENDED, ("scsi%d : length=%d, code=0x%02x\n", instance->host_no, (int) extended_msg[1], (int) extended_msg[2])); | 2374 | dprintk(NDEBUG_EXTENDED, "scsi%d : length=%d, code=0x%02x\n", instance->host_no, (int) extended_msg[1], (int) extended_msg[2]); |
2384 | 2375 | ||
2385 | if (!len && extended_msg[1] <= (sizeof(extended_msg) - 1)) { | 2376 | if (!len && extended_msg[1] <= (sizeof(extended_msg) - 1)) { |
2386 | /* Accept third byte by clearing ACK */ | 2377 | /* Accept third byte by clearing ACK */ |
@@ -2390,7 +2381,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2390 | phase = PHASE_MSGIN; | 2381 | phase = PHASE_MSGIN; |
2391 | 2382 | ||
2392 | NCR5380_transfer_pio(instance, &phase, &len, &data); | 2383 | NCR5380_transfer_pio(instance, &phase, &len, &data); |
2393 | dprintk(NDEBUG_EXTENDED, ("scsi%d : message received, residual %d\n", instance->host_no, len)); | 2384 | dprintk(NDEBUG_EXTENDED, "scsi%d : message received, residual %d\n", instance->host_no, len); |
2394 | 2385 | ||
2395 | switch (extended_msg[2]) { | 2386 | switch (extended_msg[2]) { |
2396 | case EXTENDED_SDTR: | 2387 | case EXTENDED_SDTR: |
@@ -2456,7 +2447,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2456 | NCR5380_transfer_pio(instance, &phase, &len, &data); | 2447 | NCR5380_transfer_pio(instance, &phase, &len, &data); |
2457 | if (!cmd->device->disconnect && should_disconnect(cmd->cmnd[0])) { | 2448 | if (!cmd->device->disconnect && should_disconnect(cmd->cmnd[0])) { |
2458 | NCR5380_set_timer(hostdata, USLEEP_SLEEP); | 2449 | NCR5380_set_timer(hostdata, USLEEP_SLEEP); |
2459 | dprintk(NDEBUG_USLEEP, ("scsi%d : issued command, sleeping until %ul\n", instance->host_no, hostdata->time_expires)); | 2450 | dprintk(NDEBUG_USLEEP, "scsi%d : issued command, sleeping until %lu\n", instance->host_no, hostdata->time_expires); |
2460 | return; | 2451 | return; |
2461 | } | 2452 | } |
2462 | break; | 2453 | break; |
@@ -2468,7 +2459,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2468 | break; | 2459 | break; |
2469 | default: | 2460 | default: |
2470 | printk("scsi%d : unknown phase\n", instance->host_no); | 2461 | printk("scsi%d : unknown phase\n", instance->host_no); |
2471 | NCR5380_dprint(NDEBUG_ALL, instance); | 2462 | NCR5380_dprint(NDEBUG_ANY, instance); |
2472 | } /* switch(phase) */ | 2463 | } /* switch(phase) */ |
2473 | } /* if (tmp * SR_REQ) */ | 2464 | } /* if (tmp * SR_REQ) */ |
2474 | else { | 2465 | else { |
@@ -2476,7 +2467,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2476 | */ | 2467 | */ |
2477 | if (!cmd->device->disconnect && time_after_eq(jiffies, poll_time)) { | 2468 | if (!cmd->device->disconnect && time_after_eq(jiffies, poll_time)) { |
2478 | NCR5380_set_timer(hostdata, USLEEP_SLEEP); | 2469 | NCR5380_set_timer(hostdata, USLEEP_SLEEP); |
2479 | dprintk(NDEBUG_USLEEP, ("scsi%d : poll timed out, sleeping until %ul\n", instance->host_no, hostdata->time_expires)); | 2470 | dprintk(NDEBUG_USLEEP, "scsi%d : poll timed out, sleeping until %lu\n", instance->host_no, hostdata->time_expires); |
2480 | return; | 2471 | return; |
2481 | } | 2472 | } |
2482 | } | 2473 | } |
@@ -2517,7 +2508,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) { | |||
2517 | hostdata->restart_select = 1; | 2508 | hostdata->restart_select = 1; |
2518 | 2509 | ||
2519 | target_mask = NCR5380_read(CURRENT_SCSI_DATA_REG) & ~(hostdata->id_mask); | 2510 | target_mask = NCR5380_read(CURRENT_SCSI_DATA_REG) & ~(hostdata->id_mask); |
2520 | dprintk(NDEBUG_SELECTION, ("scsi%d : reselect\n", instance->host_no)); | 2511 | dprintk(NDEBUG_SELECTION, "scsi%d : reselect\n", instance->host_no); |
2521 | 2512 | ||
2522 | /* | 2513 | /* |
2523 | * At this point, we have detected that our SCSI ID is on the bus, | 2514 | * At this point, we have detected that our SCSI ID is on the bus, |
@@ -2597,7 +2588,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) { | |||
2597 | do_abort(instance); | 2588 | do_abort(instance); |
2598 | } else { | 2589 | } else { |
2599 | hostdata->connected = tmp; | 2590 | hostdata->connected = tmp; |
2600 | dprintk(NDEBUG_RESELECTION, ("scsi%d : nexus established, target = %d, lun = %d, tag = %d\n", instance->host_no, tmp->target, tmp->lun, tmp->tag)); | 2591 | dprintk(NDEBUG_RESELECTION, "scsi%d : nexus established, target = %d, lun = %d, tag = %d\n", instance->host_no, tmp->device->id, tmp->device->lun, tmp->tag); |
2601 | } | 2592 | } |
2602 | } | 2593 | } |
2603 | 2594 | ||
@@ -2682,8 +2673,8 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) { | |||
2682 | 2673 | ||
2683 | NCR5380_setup(instance); | 2674 | NCR5380_setup(instance); |
2684 | 2675 | ||
2685 | dprintk(NDEBUG_ABORT, ("scsi%d : abort called\n", instance->host_no)); | 2676 | dprintk(NDEBUG_ABORT, "scsi%d : abort called\n", instance->host_no); |
2686 | dprintk(NDEBUG_ABORT, (" basr 0x%X, sr 0x%X\n", NCR5380_read(BUS_AND_STATUS_REG), NCR5380_read(STATUS_REG))); | 2677 | dprintk(NDEBUG_ABORT, " basr 0x%X, sr 0x%X\n", NCR5380_read(BUS_AND_STATUS_REG), NCR5380_read(STATUS_REG)); |
2687 | 2678 | ||
2688 | #if 0 | 2679 | #if 0 |
2689 | /* | 2680 | /* |
@@ -2693,7 +2684,7 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) { | |||
2693 | */ | 2684 | */ |
2694 | 2685 | ||
2695 | if (hostdata->connected == cmd) { | 2686 | if (hostdata->connected == cmd) { |
2696 | dprintk(NDEBUG_ABORT, ("scsi%d : aborting connected command\n", instance->host_no)); | 2687 | dprintk(NDEBUG_ABORT, "scsi%d : aborting connected command\n", instance->host_no); |
2697 | hostdata->aborted = 1; | 2688 | hostdata->aborted = 1; |
2698 | /* | 2689 | /* |
2699 | * We should perform BSY checking, and make sure we haven't slipped | 2690 | * We should perform BSY checking, and make sure we haven't slipped |
@@ -2721,14 +2712,14 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) { | |||
2721 | * from the issue queue. | 2712 | * from the issue queue. |
2722 | */ | 2713 | */ |
2723 | 2714 | ||
2724 | dprintk(NDEBUG_ABORT, ("scsi%d : abort going into loop.\n", instance->host_no)); | 2715 | dprintk(NDEBUG_ABORT, "scsi%d : abort going into loop.\n", instance->host_no); |
2725 | for (prev = (Scsi_Cmnd **) & (hostdata->issue_queue), tmp = (Scsi_Cmnd *) hostdata->issue_queue; tmp; prev = (Scsi_Cmnd **) & (tmp->host_scribble), tmp = (Scsi_Cmnd *) tmp->host_scribble) | 2716 | for (prev = (Scsi_Cmnd **) & (hostdata->issue_queue), tmp = (Scsi_Cmnd *) hostdata->issue_queue; tmp; prev = (Scsi_Cmnd **) & (tmp->host_scribble), tmp = (Scsi_Cmnd *) tmp->host_scribble) |
2726 | if (cmd == tmp) { | 2717 | if (cmd == tmp) { |
2727 | REMOVE(5, *prev, tmp, tmp->host_scribble); | 2718 | REMOVE(5, *prev, tmp, tmp->host_scribble); |
2728 | (*prev) = (Scsi_Cmnd *) tmp->host_scribble; | 2719 | (*prev) = (Scsi_Cmnd *) tmp->host_scribble; |
2729 | tmp->host_scribble = NULL; | 2720 | tmp->host_scribble = NULL; |
2730 | tmp->result = DID_ABORT << 16; | 2721 | tmp->result = DID_ABORT << 16; |
2731 | dprintk(NDEBUG_ABORT, ("scsi%d : abort removed command from issue queue.\n", instance->host_no)); | 2722 | dprintk(NDEBUG_ABORT, "scsi%d : abort removed command from issue queue.\n", instance->host_no); |
2732 | tmp->scsi_done(tmp); | 2723 | tmp->scsi_done(tmp); |
2733 | return SUCCESS; | 2724 | return SUCCESS; |
2734 | } | 2725 | } |
@@ -2750,7 +2741,7 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) { | |||
2750 | */ | 2741 | */ |
2751 | 2742 | ||
2752 | if (hostdata->connected) { | 2743 | if (hostdata->connected) { |
2753 | dprintk(NDEBUG_ABORT, ("scsi%d : abort failed, command connected.\n", instance->host_no)); | 2744 | dprintk(NDEBUG_ABORT, "scsi%d : abort failed, command connected.\n", instance->host_no); |
2754 | return FAILED; | 2745 | return FAILED; |
2755 | } | 2746 | } |
2756 | /* | 2747 | /* |
@@ -2780,11 +2771,11 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) { | |||
2780 | 2771 | ||
2781 | for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue; tmp; tmp = (Scsi_Cmnd *) tmp->host_scribble) | 2772 | for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue; tmp; tmp = (Scsi_Cmnd *) tmp->host_scribble) |
2782 | if (cmd == tmp) { | 2773 | if (cmd == tmp) { |
2783 | dprintk(NDEBUG_ABORT, ("scsi%d : aborting disconnected command.\n", instance->host_no)); | 2774 | dprintk(NDEBUG_ABORT, "scsi%d : aborting disconnected command.\n", instance->host_no); |
2784 | 2775 | ||
2785 | if (NCR5380_select(instance, cmd, (int) cmd->tag)) | 2776 | if (NCR5380_select(instance, cmd, (int) cmd->tag)) |
2786 | return FAILED; | 2777 | return FAILED; |
2787 | dprintk(NDEBUG_ABORT, ("scsi%d : nexus reestablished.\n", instance->host_no)); | 2778 | dprintk(NDEBUG_ABORT, "scsi%d : nexus reestablished.\n", instance->host_no); |
2788 | 2779 | ||
2789 | do_abort(instance); | 2780 | do_abort(instance); |
2790 | 2781 | ||