aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ide-scsi.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:12 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:12 -0500
commit790d1239898d4f893112280decd344d90f43ee96 (patch)
treea8ed2d8fedc4d62b28249d84db4c2904f738cbb3 /drivers/scsi/ide-scsi.c
parente5f9f5a89a01abc2b9c09747452aeb9218d6bffd (diff)
ide: remove ata_nsector_t, ata_data_t and atapi_bcount_t
Remove ata_nsector_t, ata_data_t (unused) and atapi_bcount_t. While at it: * replace 'HWIF(drive)' by 'hwif' Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/scsi/ide-scsi.c')
-rw-r--r--drivers/scsi/ide-scsi.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index c009f235134..77e8a81228f 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -395,11 +395,12 @@ static int idescsi_expiry(ide_drive_t *drive)
395static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) 395static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
396{ 396{
397 idescsi_scsi_t *scsi = drive_to_idescsi(drive); 397 idescsi_scsi_t *scsi = drive_to_idescsi(drive);
398 idescsi_pc_t *pc=scsi->pc; 398 ide_hwif_t *hwif = drive->hwif;
399 idescsi_pc_t *pc = scsi->pc;
399 struct request *rq = pc->rq; 400 struct request *rq = pc->rq;
400 atapi_bcount_t bcount;
401 atapi_ireason_t ireason; 401 atapi_ireason_t ireason;
402 unsigned int temp; 402 unsigned int temp;
403 u16 bcount;
403 u8 stat; 404 u8 stat;
404 405
405#if IDESCSI_DEBUG_LOG 406#if IDESCSI_DEBUG_LOG
@@ -436,8 +437,8 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
436 idescsi_end_request (drive, 1, 0); 437 idescsi_end_request (drive, 1, 0);
437 return ide_stopped; 438 return ide_stopped;
438 } 439 }
439 bcount.b.low = HWIF(drive)->INB(IDE_BCOUNTL_REG); 440 bcount = (hwif->INB(IDE_BCOUNTH_REG) << 8) |
440 bcount.b.high = HWIF(drive)->INB(IDE_BCOUNTH_REG); 441 hwif->INB(IDE_BCOUNTL_REG);
441 ireason.all = HWIF(drive)->INB(IDE_IREASON_REG); 442 ireason.all = HWIF(drive)->INB(IDE_IREASON_REG);
442 443
443 if (ireason.b.cod) { 444 if (ireason.b.cod) {
@@ -445,7 +446,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
445 return ide_do_reset (drive); 446 return ide_do_reset (drive);
446 } 447 }
447 if (ireason.b.io) { 448 if (ireason.b.io) {
448 temp = pc->actually_transferred + bcount.all; 449 temp = pc->actually_transferred + bcount;
449 if (temp > pc->request_transfer) { 450 if (temp > pc->request_transfer) {
450 if (temp > pc->buffer_size) { 451 if (temp > pc->buffer_size) {
451 printk(KERN_ERR "ide-scsi: The scsi wants to " 452 printk(KERN_ERR "ide-scsi: The scsi wants to "
@@ -458,11 +459,13 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
458 idescsi_input_buffers(drive, pc, temp); 459 idescsi_input_buffers(drive, pc, temp);
459 else 460 else
460 drive->hwif->atapi_input_bytes(drive, pc->current_position, temp); 461 drive->hwif->atapi_input_bytes(drive, pc->current_position, temp);
461 printk(KERN_ERR "ide-scsi: transferred %d of %d bytes\n", temp, bcount.all); 462 printk(KERN_ERR "ide-scsi: transferred"
463 " %d of %d bytes\n",
464 temp, bcount);
462 } 465 }
463 pc->actually_transferred += temp; 466 pc->actually_transferred += temp;
464 pc->current_position += temp; 467 pc->current_position += temp;
465 idescsi_discard_data(drive, bcount.all - temp); 468 idescsi_discard_data(drive, bcount - temp);
466 ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry); 469 ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry);
467 return ide_started; 470 return ide_started;
468 } 471 }
@@ -474,19 +477,21 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
474 if (ireason.b.io) { 477 if (ireason.b.io) {
475 clear_bit(PC_WRITING, &pc->flags); 478 clear_bit(PC_WRITING, &pc->flags);
476 if (pc->sg) 479 if (pc->sg)
477 idescsi_input_buffers(drive, pc, bcount.all); 480 idescsi_input_buffers(drive, pc, bcount);
478 else 481 else
479 HWIF(drive)->atapi_input_bytes(drive, pc->current_position, bcount.all); 482 hwif->atapi_input_bytes(drive, pc->current_position,
483 bcount);
480 } else { 484 } else {
481 set_bit(PC_WRITING, &pc->flags); 485 set_bit(PC_WRITING, &pc->flags);
482 if (pc->sg) 486 if (pc->sg)
483 idescsi_output_buffers (drive, pc, bcount.all); 487 idescsi_output_buffers(drive, pc, bcount);
484 else 488 else
485 HWIF(drive)->atapi_output_bytes(drive, pc->current_position, bcount.all); 489 hwif->atapi_output_bytes(drive, pc->current_position,
490 bcount);
486 } 491 }
487 /* Update the current position */ 492 /* Update the current position */
488 pc->actually_transferred += bcount.all; 493 pc->actually_transferred += bcount;
489 pc->current_position += bcount.all; 494 pc->current_position += bcount;
490 495
491 /* And set the interrupt handler again */ 496 /* And set the interrupt handler again */
492 ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry); 497 ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry);
@@ -570,13 +575,14 @@ static ide_startstop_t idescsi_issue_pc (ide_drive_t *drive, idescsi_pc_t *pc)
570{ 575{
571 idescsi_scsi_t *scsi = drive_to_idescsi(drive); 576 idescsi_scsi_t *scsi = drive_to_idescsi(drive);
572 ide_hwif_t *hwif = drive->hwif; 577 ide_hwif_t *hwif = drive->hwif;
573 atapi_bcount_t bcount; 578 u16 bcount;
574 u8 dma = 0; 579 u8 dma = 0;
575 580
576 scsi->pc=pc; /* Set the current packet command */ 581 scsi->pc=pc; /* Set the current packet command */
577 pc->actually_transferred=0; /* We haven't transferred any data yet */ 582 pc->actually_transferred=0; /* We haven't transferred any data yet */
578 pc->current_position=pc->buffer; 583 pc->current_position=pc->buffer;
579 bcount.all = min(pc->request_transfer, 63 * 1024); /* Request to transfer the entire buffer at once */ 584 /* Request to transfer the entire buffer at once */
585 bcount = min(pc->request_transfer, 63 * 1024);
580 586
581 if (drive->using_dma && !idescsi_map_sg(drive, pc)) { 587 if (drive->using_dma && !idescsi_map_sg(drive, pc)) {
582 hwif->sg_mapped = 1; 588 hwif->sg_mapped = 1;
@@ -589,8 +595,8 @@ static ide_startstop_t idescsi_issue_pc (ide_drive_t *drive, idescsi_pc_t *pc)
589 HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG); 595 HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG);
590 596
591 hwif->OUTB(dma, IDE_FEATURE_REG); 597 hwif->OUTB(dma, IDE_FEATURE_REG);
592 HWIF(drive)->OUTB(bcount.b.high, IDE_BCOUNTH_REG); 598 hwif->OUTB((bcount >> 8) & 0xff, IDE_BCOUNTH_REG);
593 HWIF(drive)->OUTB(bcount.b.low, IDE_BCOUNTL_REG); 599 hwif->OUTB(bcount & 0xff, IDE_BCOUNTL_REG);
594 600
595 if (dma) 601 if (dma)
596 set_bit(PC_DMA_OK, &pc->flags); 602 set_bit(PC_DMA_OK, &pc->flags);