diff options
Diffstat (limited to 'drivers/scsi/sym53c416.c')
-rw-r--r-- | drivers/scsi/sym53c416.c | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/drivers/scsi/sym53c416.c b/drivers/scsi/sym53c416.c index 2ca950582bc3..92bfaeafe30d 100644 --- a/drivers/scsi/sym53c416.c +++ b/drivers/scsi/sym53c416.c | |||
@@ -332,8 +332,7 @@ static irqreturn_t sym53c416_intr_handle(int irq, void *dev_id) | |||
332 | int i; | 332 | int i; |
333 | unsigned long flags = 0; | 333 | unsigned long flags = 0; |
334 | unsigned char status_reg, pio_int_reg, int_reg; | 334 | unsigned char status_reg, pio_int_reg, int_reg; |
335 | struct scatterlist *sglist; | 335 | struct scatterlist *sg; |
336 | unsigned int sgcount; | ||
337 | unsigned int tot_trans = 0; | 336 | unsigned int tot_trans = 0; |
338 | 337 | ||
339 | /* We search the base address of the host adapter which caused the interrupt */ | 338 | /* We search the base address of the host adapter which caused the interrupt */ |
@@ -429,19 +428,15 @@ static irqreturn_t sym53c416_intr_handle(int irq, void *dev_id) | |||
429 | { | 428 | { |
430 | current_command->SCp.phase = data_out; | 429 | current_command->SCp.phase = data_out; |
431 | outb(FLUSH_FIFO, base + COMMAND_REG); | 430 | outb(FLUSH_FIFO, base + COMMAND_REG); |
432 | sym53c416_set_transfer_counter(base, current_command->request_bufflen); | 431 | sym53c416_set_transfer_counter(base, |
432 | scsi_bufflen(current_command)); | ||
433 | outb(TRANSFER_INFORMATION | PIO_MODE, base + COMMAND_REG); | 433 | outb(TRANSFER_INFORMATION | PIO_MODE, base + COMMAND_REG); |
434 | if(!current_command->use_sg) | 434 | |
435 | tot_trans = sym53c416_write(base, current_command->request_buffer, current_command->request_bufflen); | 435 | scsi_for_each_sg(current_command, |
436 | else | 436 | sg, scsi_sg_count(current_command), i) { |
437 | { | 437 | tot_trans += sym53c416_write(base, |
438 | sgcount = current_command->use_sg; | 438 | SG_ADDRESS(sg), |
439 | sglist = current_command->request_buffer; | 439 | sg->length); |
440 | while(sgcount--) | ||
441 | { | ||
442 | tot_trans += sym53c416_write(base, SG_ADDRESS(sglist), sglist->length); | ||
443 | sglist++; | ||
444 | } | ||
445 | } | 440 | } |
446 | if(tot_trans < current_command->underflow) | 441 | if(tot_trans < current_command->underflow) |
447 | printk(KERN_WARNING "sym53c416: Underflow, wrote %d bytes, request for %d bytes.\n", tot_trans, current_command->underflow); | 442 | printk(KERN_WARNING "sym53c416: Underflow, wrote %d bytes, request for %d bytes.\n", tot_trans, current_command->underflow); |
@@ -455,19 +450,16 @@ static irqreturn_t sym53c416_intr_handle(int irq, void *dev_id) | |||
455 | { | 450 | { |
456 | current_command->SCp.phase = data_in; | 451 | current_command->SCp.phase = data_in; |
457 | outb(FLUSH_FIFO, base + COMMAND_REG); | 452 | outb(FLUSH_FIFO, base + COMMAND_REG); |
458 | sym53c416_set_transfer_counter(base, current_command->request_bufflen); | 453 | sym53c416_set_transfer_counter(base, |
454 | scsi_bufflen(current_command)); | ||
455 | |||
459 | outb(TRANSFER_INFORMATION | PIO_MODE, base + COMMAND_REG); | 456 | outb(TRANSFER_INFORMATION | PIO_MODE, base + COMMAND_REG); |
460 | if(!current_command->use_sg) | 457 | |
461 | tot_trans = sym53c416_read(base, current_command->request_buffer, current_command->request_bufflen); | 458 | scsi_for_each_sg(current_command, |
462 | else | 459 | sg, scsi_sg_count(current_command), i) { |
463 | { | 460 | tot_trans += sym53c416_read(base, |
464 | sgcount = current_command->use_sg; | 461 | SG_ADDRESS(sg), |
465 | sglist = current_command->request_buffer; | 462 | sg->length); |
466 | while(sgcount--) | ||
467 | { | ||
468 | tot_trans += sym53c416_read(base, SG_ADDRESS(sglist), sglist->length); | ||
469 | sglist++; | ||
470 | } | ||
471 | } | 463 | } |
472 | if(tot_trans < current_command->underflow) | 464 | if(tot_trans < current_command->underflow) |
473 | printk(KERN_WARNING "sym53c416: Underflow, read %d bytes, request for %d bytes.\n", tot_trans, current_command->underflow); | 465 | printk(KERN_WARNING "sym53c416: Underflow, read %d bytes, request for %d bytes.\n", tot_trans, current_command->underflow); |