aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-taskfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r--drivers/ide/ide-taskfile.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index c58edc86ed3e..3ecafab8f54e 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -35,34 +35,6 @@
35#include <asm/uaccess.h> 35#include <asm/uaccess.h>
36#include <asm/io.h> 36#include <asm/io.h>
37 37
38static void ata_bswap_data (void *buffer, int wcount)
39{
40 u16 *p = buffer;
41
42 while (wcount--) {
43 *p = *p << 8 | *p >> 8; p++;
44 *p = *p << 8 | *p >> 8; p++;
45 }
46}
47
48static void taskfile_input_data(ide_drive_t *drive, void *buffer, u32 wcount)
49{
50 HWIF(drive)->ata_input_data(drive, buffer, wcount);
51 if (drive->bswap)
52 ata_bswap_data(buffer, wcount);
53}
54
55static void taskfile_output_data(ide_drive_t *drive, void *buffer, u32 wcount)
56{
57 if (drive->bswap) {
58 ata_bswap_data(buffer, wcount);
59 HWIF(drive)->ata_output_data(drive, buffer, wcount);
60 ata_bswap_data(buffer, wcount);
61 } else {
62 HWIF(drive)->ata_output_data(drive, buffer, wcount);
63 }
64}
65
66void ide_tf_load(ide_drive_t *drive, ide_task_t *task) 38void ide_tf_load(ide_drive_t *drive, ide_task_t *task)
67{ 39{
68 ide_hwif_t *hwif = drive->hwif; 40 ide_hwif_t *hwif = drive->hwif;
@@ -352,9 +324,9 @@ static void ide_pio_sector(ide_drive_t *drive, unsigned int write)
352 324
353 /* do the actual data transfer */ 325 /* do the actual data transfer */
354 if (write) 326 if (write)
355 taskfile_output_data(drive, buf, SECTOR_WORDS); 327 hwif->ata_output_data(drive, buf, SECTOR_WORDS);
356 else 328 else
357 taskfile_input_data(drive, buf, SECTOR_WORDS); 329 hwif->ata_input_data(drive, buf, SECTOR_WORDS);
358 330
359 kunmap_atomic(buf, KM_BIO_SRC_IRQ); 331 kunmap_atomic(buf, KM_BIO_SRC_IRQ);
360#ifdef CONFIG_HIGHMEM 332#ifdef CONFIG_HIGHMEM