aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-taskfile.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-28 17:44:39 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-28 17:44:39 -0400
commit089c5c7e0089c3461545be936bcd236cbf16b79a (patch)
treec4708699e6997d2fb0d9f5734dfcd17a766985a2 /drivers/ide/ide-taskfile.c
parent1fc142589e58b20a67582974b8848595a2c7432e (diff)
ide: factor out debugging code from ide_tf_load()
Factor out debugging code from ide_tf_load() to ide_tf_dump() helper and update ide_tf_load() users accordingly. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r--drivers/ide/ide-taskfile.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 0321884f9d92..416ce54af7ad 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -33,26 +33,29 @@
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34#include <asm/io.h> 34#include <asm/io.h>
35 35
36void ide_tf_load(ide_drive_t *drive, ide_task_t *task) 36void ide_tf_dump(const char *s, struct ide_taskfile *tf)
37{ 37{
38 ide_hwif_t *hwif = drive->hwif;
39 struct ide_io_ports *io_ports = &hwif->io_ports;
40 struct ide_taskfile *tf = &task->tf;
41 u8 HIHI = (task->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF;
42
43 if (task->tf_flags & IDE_TFLAG_FLAGGED)
44 HIHI = 0xFF;
45
46#ifdef DEBUG 38#ifdef DEBUG
47 printk("%s: tf: feat 0x%02x nsect 0x%02x lbal 0x%02x " 39 printk("%s: tf: feat 0x%02x nsect 0x%02x lbal 0x%02x "
48 "lbam 0x%02x lbah 0x%02x dev 0x%02x cmd 0x%02x\n", 40 "lbam 0x%02x lbah 0x%02x dev 0x%02x cmd 0x%02x\n",
49 drive->name, tf->feature, tf->nsect, tf->lbal, 41 s, tf->feature, tf->nsect, tf->lbal,
50 tf->lbam, tf->lbah, tf->device, tf->command); 42 tf->lbam, tf->lbah, tf->device, tf->command);
51 printk("%s: hob: nsect 0x%02x lbal 0x%02x " 43 printk("%s: hob: nsect 0x%02x lbal 0x%02x "
52 "lbam 0x%02x lbah 0x%02x\n", 44 "lbam 0x%02x lbah 0x%02x\n",
53 drive->name, tf->hob_nsect, tf->hob_lbal, 45 s, tf->hob_nsect, tf->hob_lbal,
54 tf->hob_lbam, tf->hob_lbah); 46 tf->hob_lbam, tf->hob_lbah);
55#endif 47#endif
48}
49
50void ide_tf_load(ide_drive_t *drive, ide_task_t *task)
51{
52 ide_hwif_t *hwif = drive->hwif;
53 struct ide_io_ports *io_ports = &hwif->io_ports;
54 struct ide_taskfile *tf = &task->tf;
55 u8 HIHI = (task->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF;
56
57 if (task->tf_flags & IDE_TFLAG_FLAGGED)
58 HIHI = 0xFF;
56 59
57 ide_set_irq(drive, 1); 60 ide_set_irq(drive, 1);
58 61
@@ -149,8 +152,10 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
149 if (task->tf_flags & IDE_TFLAG_FLAGGED) 152 if (task->tf_flags & IDE_TFLAG_FLAGGED)
150 task->tf_flags |= IDE_TFLAG_FLAGGED_SET_IN_FLAGS; 153 task->tf_flags |= IDE_TFLAG_FLAGGED_SET_IN_FLAGS;
151 154
152 if ((task->tf_flags & IDE_TFLAG_DMA_PIO_FALLBACK) == 0) 155 if ((task->tf_flags & IDE_TFLAG_DMA_PIO_FALLBACK) == 0) {
156 ide_tf_dump(drive->name, tf);
153 ide_tf_load(drive, task); 157 ide_tf_load(drive, task);
158 }
154 159
155 switch (task->data_phase) { 160 switch (task->data_phase) {
156 case TASKFILE_MULTI_OUT: 161 case TASKFILE_MULTI_OUT: