diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:51 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:51 -0400 |
commit | cab7f8eda40d3e3e16b137c67cdddc2cf893c5d7 (patch) | |
tree | 369335f0bc359357653fb2271c67940840eedced /drivers/ide/pci/tc86c001.c | |
parent | ab86f91e8739e0b1587a16e4792ab5e4bb11f1b5 (diff) |
ide: remove ->dma_{status,command} fields from ide_hwif_t
* Use ->dma_base + offset instead of ->dma_{status,command}
and remove no longer needed ->dma_{status,command}.
While at it:
* Use ATA_DMA_* defines.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/tc86c001.c')
-rw-r--r-- | drivers/ide/pci/tc86c001.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/ide/pci/tc86c001.c b/drivers/ide/pci/tc86c001.c index 9b4b27a4c711..a81d47c55ce1 100644 --- a/drivers/ide/pci/tc86c001.c +++ b/drivers/ide/pci/tc86c001.c | |||
@@ -63,7 +63,7 @@ static int tc86c001_timer_expiry(ide_drive_t *drive) | |||
63 | ide_hwif_t *hwif = HWIF(drive); | 63 | ide_hwif_t *hwif = HWIF(drive); |
64 | ide_expiry_t *expiry = ide_get_hwifdata(hwif); | 64 | ide_expiry_t *expiry = ide_get_hwifdata(hwif); |
65 | ide_hwgroup_t *hwgroup = HWGROUP(drive); | 65 | ide_hwgroup_t *hwgroup = HWGROUP(drive); |
66 | u8 dma_stat = inb(hwif->dma_status); | 66 | u8 dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS); |
67 | 67 | ||
68 | /* Restore a higher level driver's expiry handler first. */ | 68 | /* Restore a higher level driver's expiry handler first. */ |
69 | hwgroup->expiry = expiry; | 69 | hwgroup->expiry = expiry; |
@@ -71,21 +71,24 @@ static int tc86c001_timer_expiry(ide_drive_t *drive) | |||
71 | if ((dma_stat & 5) == 1) { /* DMA active and no interrupt */ | 71 | if ((dma_stat & 5) == 1) { /* DMA active and no interrupt */ |
72 | unsigned long sc_base = hwif->config_data; | 72 | unsigned long sc_base = hwif->config_data; |
73 | unsigned long twcr_port = sc_base + (drive->dn ? 0x06 : 0x04); | 73 | unsigned long twcr_port = sc_base + (drive->dn ? 0x06 : 0x04); |
74 | u8 dma_cmd = inb(hwif->dma_command); | 74 | u8 dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD); |
75 | 75 | ||
76 | printk(KERN_WARNING "%s: DMA interrupt possibly stuck, " | 76 | printk(KERN_WARNING "%s: DMA interrupt possibly stuck, " |
77 | "attempting recovery...\n", drive->name); | 77 | "attempting recovery...\n", drive->name); |
78 | 78 | ||
79 | /* Stop DMA */ | 79 | /* Stop DMA */ |
80 | outb(dma_cmd & ~0x01, hwif->dma_command); | 80 | outb(dma_cmd & ~0x01, hwif->dma_base + ATA_DMA_CMD); |
81 | 81 | ||
82 | /* Setup the dummy DMA transfer */ | 82 | /* Setup the dummy DMA transfer */ |
83 | outw(0, sc_base + 0x0a); /* Sector Count */ | 83 | outw(0, sc_base + 0x0a); /* Sector Count */ |
84 | outw(0, twcr_port); /* Transfer Word Count 1 or 2 */ | 84 | outw(0, twcr_port); /* Transfer Word Count 1 or 2 */ |
85 | 85 | ||
86 | /* Start the dummy DMA transfer */ | 86 | /* Start the dummy DMA transfer */ |
87 | outb(0x00, hwif->dma_command); /* clear R_OR_WCTR for write */ | 87 | |
88 | outb(0x01, hwif->dma_command); /* set START_STOPBM */ | 88 | /* clear R_OR_WCTR for write */ |
89 | outb(0x00, hwif->dma_base + ATA_DMA_CMD); | ||
90 | /* set START_STOPBM */ | ||
91 | outb(0x01, hwif->dma_base + ATA_DMA_CMD); | ||
89 | 92 | ||
90 | /* | 93 | /* |
91 | * If an interrupt was pending, it should come thru shortly. | 94 | * If an interrupt was pending, it should come thru shortly. |