diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-28 17:44:36 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-28 17:44:36 -0400 |
commit | 92d3ab27e8fd23d1a9dc3b69d17b2afb83e5c6f5 (patch) | |
tree | e58076cb0102443dfe76401931a41931f97053cf /drivers/ide/ide-iops.c | |
parent | 284aa76b5339ce79d5ad2ac1c7cbf717082816a7 (diff) |
falconide/q40ide: add ->atapi_*put_bytes and ->ata_*put_data methods (take 2)
* Add ->atapi_{in,out}put_bytes and ->ata_{in,out}put_data methods to
falconide and q40ide host drivers (->ata_* methods are implemented on
top of ->atapi_* methods so they also do byte-swapping now).
* Cleanup atapi_{in,out}put_bytes().
v2:
* Add 'struct request *rq' argument to ->ata_{in,out}put_data methods
and don't byte-swap disk fs requests (we shouldn't un-swap fs requests
because fs itself is stored byte-swapped on the disk) - this is how
things were done before the patch (ideally device mapper should be
used instead but it would break existing setups and would have some
performance impact).
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Michael Schmitz <schmitz@debian.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Richard Zidlicky <rz@linux-m68k.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r-- | drivers/ide/ide-iops.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 5425d3038ec2..7ec7fa2aef96 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -192,7 +192,8 @@ static void ata_vlb_sync(ide_drive_t *drive, unsigned long port) | |||
192 | /* | 192 | /* |
193 | * This is used for most PIO data transfers *from* the IDE interface | 193 | * This is used for most PIO data transfers *from* the IDE interface |
194 | */ | 194 | */ |
195 | static void ata_input_data(ide_drive_t *drive, void *buffer, u32 wcount) | 195 | static void ata_input_data(ide_drive_t *drive, struct request *rq, |
196 | void *buffer, u32 wcount) | ||
196 | { | 197 | { |
197 | ide_hwif_t *hwif = drive->hwif; | 198 | ide_hwif_t *hwif = drive->hwif; |
198 | struct ide_io_ports *io_ports = &hwif->io_ports; | 199 | struct ide_io_ports *io_ports = &hwif->io_ports; |
@@ -215,7 +216,8 @@ static void ata_input_data(ide_drive_t *drive, void *buffer, u32 wcount) | |||
215 | /* | 216 | /* |
216 | * This is used for most PIO data transfers *to* the IDE interface | 217 | * This is used for most PIO data transfers *to* the IDE interface |
217 | */ | 218 | */ |
218 | static void ata_output_data(ide_drive_t *drive, void *buffer, u32 wcount) | 219 | static void ata_output_data(ide_drive_t *drive, struct request *rq, |
220 | void *buffer, u32 wcount) | ||
219 | { | 221 | { |
220 | ide_hwif_t *hwif = drive->hwif; | 222 | ide_hwif_t *hwif = drive->hwif; |
221 | struct ide_io_ports *io_ports = &hwif->io_ports; | 223 | struct ide_io_ports *io_ports = &hwif->io_ports; |
@@ -248,14 +250,7 @@ static void atapi_input_bytes(ide_drive_t *drive, void *buffer, u32 bytecount) | |||
248 | ide_hwif_t *hwif = HWIF(drive); | 250 | ide_hwif_t *hwif = HWIF(drive); |
249 | 251 | ||
250 | ++bytecount; | 252 | ++bytecount; |
251 | #if defined(CONFIG_ATARI) || defined(CONFIG_Q40) | 253 | hwif->ata_input_data(drive, NULL, buffer, bytecount / 4); |
252 | if (MACH_IS_ATARI || MACH_IS_Q40) { | ||
253 | /* Atari has a byte-swapped IDE interface */ | ||
254 | insw_swapw(hwif->io_ports.data_addr, buffer, bytecount / 2); | ||
255 | return; | ||
256 | } | ||
257 | #endif /* CONFIG_ATARI || CONFIG_Q40 */ | ||
258 | hwif->ata_input_data(drive, buffer, bytecount / 4); | ||
259 | if ((bytecount & 0x03) >= 2) | 254 | if ((bytecount & 0x03) >= 2) |
260 | hwif->INSW(hwif->io_ports.data_addr, | 255 | hwif->INSW(hwif->io_ports.data_addr, |
261 | (u8 *)buffer + (bytecount & ~0x03), 1); | 256 | (u8 *)buffer + (bytecount & ~0x03), 1); |
@@ -266,14 +261,7 @@ static void atapi_output_bytes(ide_drive_t *drive, void *buffer, u32 bytecount) | |||
266 | ide_hwif_t *hwif = HWIF(drive); | 261 | ide_hwif_t *hwif = HWIF(drive); |
267 | 262 | ||
268 | ++bytecount; | 263 | ++bytecount; |
269 | #if defined(CONFIG_ATARI) || defined(CONFIG_Q40) | 264 | hwif->ata_output_data(drive, NULL, buffer, bytecount / 4); |
270 | if (MACH_IS_ATARI || MACH_IS_Q40) { | ||
271 | /* Atari has a byte-swapped IDE interface */ | ||
272 | outsw_swapw(hwif->io_ports.data_addr, buffer, bytecount / 2); | ||
273 | return; | ||
274 | } | ||
275 | #endif /* CONFIG_ATARI || CONFIG_Q40 */ | ||
276 | hwif->ata_output_data(drive, buffer, bytecount / 4); | ||
277 | if ((bytecount & 0x03) >= 2) | 265 | if ((bytecount & 0x03) >= 2) |
278 | hwif->OUTSW(hwif->io_ports.data_addr, | 266 | hwif->OUTSW(hwif->io_ports.data_addr, |
279 | (u8 *)buffer + (bytecount & ~0x03), 1); | 267 | (u8 *)buffer + (bytecount & ~0x03), 1); |
@@ -668,7 +656,7 @@ int ide_driveid_update(ide_drive_t *drive) | |||
668 | local_irq_restore(flags); | 656 | local_irq_restore(flags); |
669 | return 0; | 657 | return 0; |
670 | } | 658 | } |
671 | hwif->ata_input_data(drive, id, SECTOR_WORDS); | 659 | hwif->ata_input_data(drive, NULL, id, SECTOR_WORDS); |
672 | (void)ide_read_status(drive); /* clear drive IRQ */ | 660 | (void)ide_read_status(drive); /* clear drive IRQ */ |
673 | local_irq_enable(); | 661 | local_irq_enable(); |
674 | local_irq_restore(flags); | 662 | local_irq_restore(flags); |