diff options
Diffstat (limited to 'drivers/scsi/NCR5380.c')
-rw-r--r-- | drivers/scsi/NCR5380.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index 2597209183d0..eeddbd19eba5 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c | |||
@@ -295,16 +295,16 @@ static __inline__ void initialize_SCp(Scsi_Cmnd * cmd) | |||
295 | * various queues are valid. | 295 | * various queues are valid. |
296 | */ | 296 | */ |
297 | 297 | ||
298 | if (cmd->use_sg) { | 298 | if (scsi_bufflen(cmd)) { |
299 | cmd->SCp.buffer = (struct scatterlist *) cmd->request_buffer; | 299 | cmd->SCp.buffer = scsi_sglist(cmd); |
300 | cmd->SCp.buffers_residual = cmd->use_sg - 1; | 300 | cmd->SCp.buffers_residual = scsi_sg_count(cmd) - 1; |
301 | cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); | 301 | cmd->SCp.ptr = sg_virt(cmd->SCp.buffer); |
302 | cmd->SCp.this_residual = cmd->SCp.buffer->length; | 302 | cmd->SCp.this_residual = cmd->SCp.buffer->length; |
303 | } else { | 303 | } else { |
304 | cmd->SCp.buffer = NULL; | 304 | cmd->SCp.buffer = NULL; |
305 | cmd->SCp.buffers_residual = 0; | 305 | cmd->SCp.buffers_residual = 0; |
306 | cmd->SCp.ptr = (char *) cmd->request_buffer; | 306 | cmd->SCp.ptr = NULL; |
307 | cmd->SCp.this_residual = cmd->request_bufflen; | 307 | cmd->SCp.this_residual = 0; |
308 | } | 308 | } |
309 | } | 309 | } |
310 | 310 | ||
@@ -932,7 +932,7 @@ static int __devinit NCR5380_init(struct Scsi_Host *instance, int flags) | |||
932 | * @instance: adapter to remove | 932 | * @instance: adapter to remove |
933 | */ | 933 | */ |
934 | 934 | ||
935 | static void __devexit NCR5380_exit(struct Scsi_Host *instance) | 935 | static void NCR5380_exit(struct Scsi_Host *instance) |
936 | { | 936 | { |
937 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; | 937 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; |
938 | 938 | ||
@@ -975,14 +975,14 @@ static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) | |||
975 | case WRITE_6: | 975 | case WRITE_6: |
976 | case WRITE_10: | 976 | case WRITE_10: |
977 | hostdata->time_write[cmd->device->id] -= (jiffies - hostdata->timebase); | 977 | hostdata->time_write[cmd->device->id] -= (jiffies - hostdata->timebase); |
978 | hostdata->bytes_write[cmd->device->id] += cmd->request_bufflen; | 978 | hostdata->bytes_write[cmd->device->id] += scsi_bufflen(cmd); |
979 | hostdata->pendingw++; | 979 | hostdata->pendingw++; |
980 | break; | 980 | break; |
981 | case READ: | 981 | case READ: |
982 | case READ_6: | 982 | case READ_6: |
983 | case READ_10: | 983 | case READ_10: |
984 | hostdata->time_read[cmd->device->id] -= (jiffies - hostdata->timebase); | 984 | hostdata->time_read[cmd->device->id] -= (jiffies - hostdata->timebase); |
985 | hostdata->bytes_read[cmd->device->id] += cmd->request_bufflen; | 985 | hostdata->bytes_read[cmd->device->id] += scsi_bufflen(cmd); |
986 | hostdata->pendingr++; | 986 | hostdata->pendingr++; |
987 | break; | 987 | break; |
988 | } | 988 | } |
@@ -1157,16 +1157,17 @@ static void NCR5380_main(struct work_struct *work) | |||
1157 | * Locks: takes the needed instance locks | 1157 | * Locks: takes the needed instance locks |
1158 | */ | 1158 | */ |
1159 | 1159 | ||
1160 | static irqreturn_t NCR5380_intr(int irq, void *dev_id) | 1160 | static irqreturn_t NCR5380_intr(int dummy, void *dev_id) |
1161 | { | 1161 | { |
1162 | NCR5380_local_declare(); | 1162 | NCR5380_local_declare(); |
1163 | struct Scsi_Host *instance = (struct Scsi_Host *)dev_id; | 1163 | struct Scsi_Host *instance = dev_id; |
1164 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; | 1164 | struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; |
1165 | int done; | 1165 | int done; |
1166 | unsigned char basr; | 1166 | unsigned char basr; |
1167 | unsigned long flags; | 1167 | unsigned long flags; |
1168 | 1168 | ||
1169 | dprintk(NDEBUG_INTR, ("scsi : NCR5380 irq %d triggered\n", irq)); | 1169 | dprintk(NDEBUG_INTR, ("scsi : NCR5380 irq %d triggered\n", |
1170 | instance->irq)); | ||
1170 | 1171 | ||
1171 | do { | 1172 | do { |
1172 | done = 1; | 1173 | done = 1; |