diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:56 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:56 -0400 |
commit | 374e042c3e767ac2e5a40b78529220e0b3de793c (patch) | |
tree | 433d258f6da9783f0cb34234af9c359353f531fe /drivers/ide/ide-dma.c | |
parent | d6276b5f5cc7508124de291f3ed59c6945c17ae7 (diff) |
ide: add struct ide_tp_ops (take 2)
* Add struct ide_tp_ops for transport methods.
* Add 'const struct ide_tp_ops *tp_ops' to struct ide_port_info
and ide_hwif_t.
* Set the default hwif->tp_ops in ide_init_port_data().
* Set host driver specific hwif->tp_ops in ide_init_port().
* Export ide_exec_command(), ide_read_status(), ide_read_altstatus(),
ide_read_sff_dma_status(), ide_set_irq(), ide_tf_{load,read}()
and ata_{in,out}put_data().
* Convert host drivers and core code to use struct ide_tp_ops.
* Remove no longer needed default_hwif_transport().
* Cleanup ide_hwif_t from methods that are now in struct ide_tp_ops.
While at it:
* Use struct ide_port_info in falconide.c and q40ide.c.
* Rename ata_{in,out}put_data() to ide_{in,out}put_data().
v2:
* Fix missing convertion in ns87415.c.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r-- | drivers/ide/ide-dma.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index e72112efab9a..be99d463dcc7 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -104,7 +104,7 @@ ide_startstop_t ide_dma_intr (ide_drive_t *drive) | |||
104 | u8 stat = 0, dma_stat = 0; | 104 | u8 stat = 0, dma_stat = 0; |
105 | 105 | ||
106 | dma_stat = hwif->dma_ops->dma_end(drive); | 106 | dma_stat = hwif->dma_ops->dma_end(drive); |
107 | stat = hwif->read_status(hwif); | 107 | stat = hwif->tp_ops->read_status(hwif); |
108 | 108 | ||
109 | if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) { | 109 | if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) { |
110 | if (!dma_stat) { | 110 | if (!dma_stat) { |
@@ -335,7 +335,7 @@ static int config_drive_for_dma (ide_drive_t *drive) | |||
335 | static int dma_timer_expiry (ide_drive_t *drive) | 335 | static int dma_timer_expiry (ide_drive_t *drive) |
336 | { | 336 | { |
337 | ide_hwif_t *hwif = HWIF(drive); | 337 | ide_hwif_t *hwif = HWIF(drive); |
338 | u8 dma_stat = hwif->read_sff_dma_status(hwif); | 338 | u8 dma_stat = hwif->tp_ops->read_sff_dma_status(hwif); |
339 | 339 | ||
340 | printk(KERN_WARNING "%s: dma_timer_expiry: dma status == 0x%02x\n", | 340 | printk(KERN_WARNING "%s: dma_timer_expiry: dma status == 0x%02x\n", |
341 | drive->name, dma_stat); | 341 | drive->name, dma_stat); |
@@ -370,7 +370,7 @@ void ide_dma_host_set(ide_drive_t *drive, int on) | |||
370 | { | 370 | { |
371 | ide_hwif_t *hwif = HWIF(drive); | 371 | ide_hwif_t *hwif = HWIF(drive); |
372 | u8 unit = (drive->select.b.unit & 0x01); | 372 | u8 unit = (drive->select.b.unit & 0x01); |
373 | u8 dma_stat = hwif->read_sff_dma_status(hwif); | 373 | u8 dma_stat = hwif->tp_ops->read_sff_dma_status(hwif); |
374 | 374 | ||
375 | if (on) | 375 | if (on) |
376 | dma_stat |= (1 << (5 + unit)); | 376 | dma_stat |= (1 << (5 + unit)); |
@@ -482,7 +482,7 @@ int ide_dma_setup(ide_drive_t *drive) | |||
482 | outb(reading, hwif->dma_base + ATA_DMA_CMD); | 482 | outb(reading, hwif->dma_base + ATA_DMA_CMD); |
483 | 483 | ||
484 | /* read DMA status for INTR & ERROR flags */ | 484 | /* read DMA status for INTR & ERROR flags */ |
485 | dma_stat = hwif->read_sff_dma_status(hwif); | 485 | dma_stat = hwif->tp_ops->read_sff_dma_status(hwif); |
486 | 486 | ||
487 | /* clear INTR & ERROR flags */ | 487 | /* clear INTR & ERROR flags */ |
488 | if (mmio) | 488 | if (mmio) |
@@ -551,7 +551,7 @@ int __ide_dma_end (ide_drive_t *drive) | |||
551 | } | 551 | } |
552 | 552 | ||
553 | /* get DMA status */ | 553 | /* get DMA status */ |
554 | dma_stat = hwif->read_sff_dma_status(hwif); | 554 | dma_stat = hwif->tp_ops->read_sff_dma_status(hwif); |
555 | 555 | ||
556 | if (mmio) | 556 | if (mmio) |
557 | /* clear the INTR & ERROR bits */ | 557 | /* clear the INTR & ERROR bits */ |
@@ -574,7 +574,7 @@ EXPORT_SYMBOL(__ide_dma_end); | |||
574 | int ide_dma_test_irq(ide_drive_t *drive) | 574 | int ide_dma_test_irq(ide_drive_t *drive) |
575 | { | 575 | { |
576 | ide_hwif_t *hwif = HWIF(drive); | 576 | ide_hwif_t *hwif = HWIF(drive); |
577 | u8 dma_stat = hwif->read_sff_dma_status(hwif); | 577 | u8 dma_stat = hwif->tp_ops->read_sff_dma_status(hwif); |
578 | 578 | ||
579 | /* return 1 if INTR asserted */ | 579 | /* return 1 if INTR asserted */ |
580 | if ((dma_stat & 4) == 4) | 580 | if ((dma_stat & 4) == 4) |