aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ns87415.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ns87415.c')
-rw-r--r--drivers/ide/ns87415.c34
1 files changed, 8 insertions, 26 deletions
diff --git a/drivers/ide/ns87415.c b/drivers/ide/ns87415.c
index 71a39fb3856f..95327a2c2422 100644
--- a/drivers/ide/ns87415.c
+++ b/drivers/ide/ns87415.c
@@ -61,41 +61,23 @@ static u8 superio_dma_sff_read_status(ide_hwif_t *hwif)
61 return superio_ide_inb(hwif->dma_base + ATA_DMA_STATUS); 61 return superio_ide_inb(hwif->dma_base + ATA_DMA_STATUS);
62} 62}
63 63
64static void superio_tf_read(ide_drive_t *drive, struct ide_cmd *cmd) 64static void superio_tf_read(ide_drive_t *drive, struct ide_taskfile *tf,
65 u8 valid)
65{ 66{
66 struct ide_io_ports *io_ports = &drive->hwif->io_ports; 67 struct ide_io_ports *io_ports = &drive->hwif->io_ports;
67 struct ide_taskfile *tf = &cmd->tf;
68 68
69 /* be sure we're looking at the low order bits */ 69 if (valid & IDE_VALID_ERROR)
70 outb(ATA_DEVCTL_OBS, io_ports->ctl_addr);
71
72 if (cmd->tf_flags & IDE_TFLAG_IN_ERROR)
73 tf->error = inb(io_ports->feature_addr); 70 tf->error = inb(io_ports->feature_addr);
74 if (cmd->tf_flags & IDE_TFLAG_IN_NSECT) 71 if (valid & IDE_VALID_NSECT)
75 tf->nsect = inb(io_ports->nsect_addr); 72 tf->nsect = inb(io_ports->nsect_addr);
76 if (cmd->tf_flags & IDE_TFLAG_IN_LBAL) 73 if (valid & IDE_VALID_LBAL)
77 tf->lbal = inb(io_ports->lbal_addr); 74 tf->lbal = inb(io_ports->lbal_addr);
78 if (cmd->tf_flags & IDE_TFLAG_IN_LBAM) 75 if (valid & IDE_VALID_LBAM)
79 tf->lbam = inb(io_ports->lbam_addr); 76 tf->lbam = inb(io_ports->lbam_addr);
80 if (cmd->tf_flags & IDE_TFLAG_IN_LBAH) 77 if (valid & IDE_VALID_LBAH)
81 tf->lbah = inb(io_ports->lbah_addr); 78 tf->lbah = inb(io_ports->lbah_addr);
82 if (cmd->tf_flags & IDE_TFLAG_IN_DEVICE) 79 if (valid & IDE_VALID_DEVICE)
83 tf->device = superio_ide_inb(io_ports->device_addr); 80 tf->device = superio_ide_inb(io_ports->device_addr);
84
85 if (cmd->tf_flags & IDE_TFLAG_LBA48) {
86 outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr);
87
88 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_ERROR)
89 tf->hob_error = inb(io_ports->feature_addr);
90 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_NSECT)
91 tf->hob_nsect = inb(io_ports->nsect_addr);
92 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAL)
93 tf->hob_lbal = inb(io_ports->lbal_addr);
94 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAM)
95 tf->hob_lbam = inb(io_ports->lbam_addr);
96 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAH)
97 tf->hob_lbah = inb(io_ports->lbah_addr);
98 }
99} 81}
100 82
101static void ns87415_dev_select(ide_drive_t *drive); 83static void ns87415_dev_select(ide_drive_t *drive);