diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-28 17:44:39 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-28 17:44:39 -0400 |
commit | 089c5c7e0089c3461545be936bcd236cbf16b79a (patch) | |
tree | c4708699e6997d2fb0d9f5734dfcd17a766985a2 | |
parent | 1fc142589e58b20a67582974b8848595a2c7432e (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>
-rw-r--r-- | drivers/ide/ide-io.c | 1 | ||||
-rw-r--r-- | drivers/ide/ide-taskfile.c | 29 | ||||
-rw-r--r-- | include/linux/ide.h | 2 |
3 files changed, 20 insertions, 12 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index c32ca769b963..a6f2186773fa 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -1680,6 +1680,7 @@ void ide_pktcmd_tf_load(ide_drive_t *drive, u32 tf_flags, u16 bcount, u8 dma) | |||
1680 | task.tf.lbam = bcount & 0xff; | 1680 | task.tf.lbam = bcount & 0xff; |
1681 | task.tf.lbah = (bcount >> 8) & 0xff; | 1681 | task.tf.lbah = (bcount >> 8) & 0xff; |
1682 | 1682 | ||
1683 | ide_tf_dump(drive->name, &task.tf); | ||
1683 | ide_tf_load(drive, &task); | 1684 | ide_tf_load(drive, &task); |
1684 | } | 1685 | } |
1685 | 1686 | ||
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 | ||
36 | void ide_tf_load(ide_drive_t *drive, ide_task_t *task) | 36 | void 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 | |||
50 | void 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: |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 3927996d2f82..d7d8bb69db4b 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -960,6 +960,8 @@ typedef struct ide_task_s { | |||
960 | void *special; /* valid_t generally */ | 960 | void *special; /* valid_t generally */ |
961 | } ide_task_t; | 961 | } ide_task_t; |
962 | 962 | ||
963 | void ide_tf_dump(const char *, struct ide_taskfile *); | ||
964 | |||
963 | void ide_tf_load(ide_drive_t *, ide_task_t *); | 965 | void ide_tf_load(ide_drive_t *, ide_task_t *); |
964 | void ide_tf_read(ide_drive_t *, ide_task_t *); | 966 | void ide_tf_read(ide_drive_t *, ide_task_t *); |
965 | 967 | ||