aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/NCR5380.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/NCR5380.c')
-rw-r--r--drivers/scsi/NCR5380.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 23392ae7df8b..cc9ecb35b412 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -1247,13 +1247,13 @@ static void collect_stats(struct NCR5380_hostdata *hostdata, Scsi_Cmnd * cmd)
1247 case WRITE: 1247 case WRITE:
1248 case WRITE_6: 1248 case WRITE_6:
1249 case WRITE_10: 1249 case WRITE_10:
1250 hostdata->time_write[cmd->device->id] += (jiffies - hostdata->timebase); 1250 hostdata->time_write[scmd_id(cmd)] += (jiffies - hostdata->timebase);
1251 hostdata->pendingw--; 1251 hostdata->pendingw--;
1252 break; 1252 break;
1253 case READ: 1253 case READ:
1254 case READ_6: 1254 case READ_6:
1255 case READ_10: 1255 case READ_10:
1256 hostdata->time_read[cmd->device->id] += (jiffies - hostdata->timebase); 1256 hostdata->time_read[scmd_id(cmd)] += (jiffies - hostdata->timebase);
1257 hostdata->pendingr--; 1257 hostdata->pendingr--;
1258 break; 1258 break;
1259 } 1259 }
@@ -1385,7 +1385,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag)
1385 * the host and target ID's on the SCSI bus. 1385 * the host and target ID's on the SCSI bus.
1386 */ 1386 */
1387 1387
1388 NCR5380_write(OUTPUT_DATA_REG, (hostdata->id_mask | (1 << cmd->device->id))); 1388 NCR5380_write(OUTPUT_DATA_REG, (hostdata->id_mask | (1 << scmd_id(cmd))));
1389 1389
1390 /* 1390 /*
1391 * Raise ATN while SEL is true before BSY goes false from arbitration, 1391 * Raise ATN while SEL is true before BSY goes false from arbitration,
@@ -1430,7 +1430,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag)
1430 1430
1431 udelay(1); 1431 udelay(1);
1432 1432
1433 dprintk(NDEBUG_SELECTION, ("scsi%d : selecting target %d\n", instance->host_no, cmd->device->id)); 1433 dprintk(NDEBUG_SELECTION, ("scsi%d : selecting target %d\n", instance->host_no, scmd_id(cmd)));
1434 1434
1435 /* 1435 /*
1436 * The SCSI specification calls for a 250 ms timeout for the actual 1436 * The SCSI specification calls for a 250 ms timeout for the actual
@@ -1483,7 +1483,7 @@ part2:
1483 1483
1484 if (!(NCR5380_read(STATUS_REG) & SR_BSY)) { 1484 if (!(NCR5380_read(STATUS_REG) & SR_BSY)) {
1485 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 1485 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
1486 if (hostdata->targets_present & (1 << cmd->device->id)) { 1486 if (hostdata->targets_present & (1 << scmd_id(cmd))) {
1487 printk(KERN_DEBUG "scsi%d : weirdness\n", instance->host_no); 1487 printk(KERN_DEBUG "scsi%d : weirdness\n", instance->host_no);
1488 if (hostdata->restart_select) 1488 if (hostdata->restart_select)
1489 printk(KERN_DEBUG "\trestart select\n"); 1489 printk(KERN_DEBUG "\trestart select\n");
@@ -1499,7 +1499,7 @@ part2:
1499 NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); 1499 NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
1500 return 0; 1500 return 0;
1501 } 1501 }
1502 hostdata->targets_present |= (1 << cmd->device->id); 1502 hostdata->targets_present |= (1 << scmd_id(cmd));
1503 1503
1504 /* 1504 /*
1505 * Since we followed the SCSI spec, and raised ATN while SEL 1505 * Since we followed the SCSI spec, and raised ATN while SEL
@@ -2190,7 +2190,8 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
2190 * If the watchdog timer fires, all future accesses to this 2190 * If the watchdog timer fires, all future accesses to this
2191 * device will use the polled-IO. 2191 * device will use the polled-IO.
2192 */ 2192 */
2193 printk("scsi%d : switching target %d lun %d to slow handshake\n", instance->host_no, cmd->device->id, cmd->device->lun); 2193 scmd_printk(KERN_INFO, cmd,
2194 "switching to slow handshake\n");
2194 cmd->device->borken = 1; 2195 cmd->device->borken = 1;
2195 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN); 2196 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN);
2196 sink = 1; 2197 sink = 1;
@@ -2429,9 +2430,11 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
2429 scsi_print_msg(extended_msg); 2430 scsi_print_msg(extended_msg);
2430 printk("\n"); 2431 printk("\n");
2431 } else if (tmp != EXTENDED_MESSAGE) 2432 } else if (tmp != EXTENDED_MESSAGE)
2432 printk("scsi%d: rejecting unknown message %02x from target %d, lun %d\n", instance->host_no, tmp, cmd->device->id, cmd->device->lun); 2433 scmd_printk(KERN_INFO, cmd,
2434 "rejecting unknown message %02x\n",tmp);
2433 else 2435 else
2434 printk("scsi%d: rejecting unknown extended message code %02x, length %d from target %d, lun %d\n", instance->host_no, extended_msg[1], extended_msg[0], cmd->device->id, cmd->device->lun); 2436 scmd_printk(KERN_INFO, cmd,
2437 "rejecting unknown extended message code %02x, length %d\n", extended_msg[1], extended_msg[0]);
2435 2438
2436 msgout = MESSAGE_REJECT; 2439 msgout = MESSAGE_REJECT;
2437 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN); 2440 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE | ICR_ASSERT_ATN);