aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/atari_NCR5380.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/atari_NCR5380.c')
-rw-r--r--drivers/scsi/atari_NCR5380.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index a9680b5e8ac6..93b61f148653 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -511,9 +511,9 @@ static inline void initialize_SCp(Scsi_Cmnd *cmd)
511 * various queues are valid. 511 * various queues are valid.
512 */ 512 */
513 513
514 if (cmd->use_sg) { 514 if (scsi_bufflen(cmd)) {
515 cmd->SCp.buffer = (struct scatterlist *)cmd->request_buffer; 515 cmd->SCp.buffer = scsi_sglist(cmd);
516 cmd->SCp.buffers_residual = cmd->use_sg - 1; 516 cmd->SCp.buffers_residual = scsi_sg_count(cmd) - 1;
517 cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); 517 cmd->SCp.ptr = sg_virt(cmd->SCp.buffer);
518 cmd->SCp.this_residual = cmd->SCp.buffer->length; 518 cmd->SCp.this_residual = cmd->SCp.buffer->length;
519 /* ++roman: Try to merge some scatter-buffers if they are at 519 /* ++roman: Try to merge some scatter-buffers if they are at
@@ -523,8 +523,8 @@ static inline void initialize_SCp(Scsi_Cmnd *cmd)
523 } else { 523 } else {
524 cmd->SCp.buffer = NULL; 524 cmd->SCp.buffer = NULL;
525 cmd->SCp.buffers_residual = 0; 525 cmd->SCp.buffers_residual = 0;
526 cmd->SCp.ptr = (char *)cmd->request_buffer; 526 cmd->SCp.ptr = NULL;
527 cmd->SCp.this_residual = cmd->request_bufflen; 527 cmd->SCp.this_residual = 0;
528 } 528 }
529} 529}
530 530
@@ -936,21 +936,21 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
936 } 936 }
937# endif 937# endif
938# ifdef NCR5380_STAT_LIMIT 938# ifdef NCR5380_STAT_LIMIT
939 if (cmd->request_bufflen > NCR5380_STAT_LIMIT) 939 if (scsi_bufflen(cmd) > NCR5380_STAT_LIMIT)
940# endif 940# endif
941 switch (cmd->cmnd[0]) { 941 switch (cmd->cmnd[0]) {
942 case WRITE: 942 case WRITE:
943 case WRITE_6: 943 case WRITE_6:
944 case WRITE_10: 944 case WRITE_10:
945 hostdata->time_write[cmd->device->id] -= (jiffies - hostdata->timebase); 945 hostdata->time_write[cmd->device->id] -= (jiffies - hostdata->timebase);
946 hostdata->bytes_write[cmd->device->id] += cmd->request_bufflen; 946 hostdata->bytes_write[cmd->device->id] += scsi_bufflen(cmd);
947 hostdata->pendingw++; 947 hostdata->pendingw++;
948 break; 948 break;
949 case READ: 949 case READ:
950 case READ_6: 950 case READ_6:
951 case READ_10: 951 case READ_10:
952 hostdata->time_read[cmd->device->id] -= (jiffies - hostdata->timebase); 952 hostdata->time_read[cmd->device->id] -= (jiffies - hostdata->timebase);
953 hostdata->bytes_read[cmd->device->id] += cmd->request_bufflen; 953 hostdata->bytes_read[cmd->device->id] += scsi_bufflen(cmd);
954 hostdata->pendingr++; 954 hostdata->pendingr++;
955 break; 955 break;
956 } 956 }
@@ -1352,21 +1352,21 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id)
1352static void collect_stats(struct NCR5380_hostdata* hostdata, Scsi_Cmnd *cmd) 1352static void collect_stats(struct NCR5380_hostdata* hostdata, Scsi_Cmnd *cmd)
1353{ 1353{
1354# ifdef NCR5380_STAT_LIMIT 1354# ifdef NCR5380_STAT_LIMIT
1355 if (cmd->request_bufflen > NCR5380_STAT_LIMIT) 1355 if (scsi_bufflen(cmd) > NCR5380_STAT_LIMIT)
1356# endif 1356# endif
1357 switch (cmd->cmnd[0]) { 1357 switch (cmd->cmnd[0]) {
1358 case WRITE: 1358 case WRITE:
1359 case WRITE_6: 1359 case WRITE_6:
1360 case WRITE_10: 1360 case WRITE_10:
1361 hostdata->time_write[cmd->device->id] += (jiffies - hostdata->timebase); 1361 hostdata->time_write[cmd->device->id] += (jiffies - hostdata->timebase);
1362 /*hostdata->bytes_write[cmd->device->id] += cmd->request_bufflen;*/ 1362 /*hostdata->bytes_write[cmd->device->id] += scsi_bufflen(cmd);*/
1363 hostdata->pendingw--; 1363 hostdata->pendingw--;
1364 break; 1364 break;
1365 case READ: 1365 case READ:
1366 case READ_6: 1366 case READ_6:
1367 case READ_10: 1367 case READ_10:
1368 hostdata->time_read[cmd->device->id] += (jiffies - hostdata->timebase); 1368 hostdata->time_read[cmd->device->id] += (jiffies - hostdata->timebase);
1369 /*hostdata->bytes_read[cmd->device->id] += cmd->request_bufflen;*/ 1369 /*hostdata->bytes_read[cmd->device->id] += scsi_bufflen(cmd);*/
1370 hostdata->pendingr--; 1370 hostdata->pendingr--;
1371 break; 1371 break;
1372 } 1372 }
@@ -1868,7 +1868,7 @@ static int do_abort(struct Scsi_Host *host)
1868 * the target sees, so we just handshake. 1868 * the target sees, so we just handshake.
1869 */ 1869 */
1870 1870
1871 while (!(tmp = NCR5380_read(STATUS_REG)) & SR_REQ) 1871 while (!((tmp = NCR5380_read(STATUS_REG)) & SR_REQ))
1872 ; 1872 ;
1873 1873
1874 NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(tmp)); 1874 NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(tmp));