aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-taskfile.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:10 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:10 -0500
commit807e35d695690011faa1ce3ad67dfc23c1e39bdc (patch)
tree4b9b8328ea27896ea6050a90949d79f6e158d573 /drivers/ide/ide-taskfile.c
parent54688aa372cbc83c4361bfb9236f9bfe02168e19 (diff)
ide: use ide_tf_load() in execute_drive_cmd()
* Add IDE_TFLAG_OUT_DEVICE taskfile flag to indicate the need of writing the Device register and handle it in ide_tf_load(). Update ide_tf_load() and {do_rw,flagged}_taskfile() users accordingly. * Use struct ide_taskfile and ide_tf_load() in execute_drive_cmd(). * Make the debugging code dump all taskfile registers for both REQ_ATA_TYPE_{CMD,TASK} requests and move it to ide_tf_load() so it also covers REQ_ATA_TYPE_TASKFILE requests. There should be no functionality changes caused by this patch (unless DEBUG is defined). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r--drivers/ide/ide-taskfile.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index a7668b459fe1..8a5a10fdcfcb 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -72,6 +72,13 @@ void ide_tf_load(ide_drive_t *drive, ide_task_t *task)
72 if (task->tf_flags & IDE_TFLAG_FLAGGED) 72 if (task->tf_flags & IDE_TFLAG_FLAGGED)
73 HIHI = 0xFF; 73 HIHI = 0xFF;
74 74
75#ifdef DEBUG
76 printk("%s: tf: feat 0x%02x nsect 0x%02x lbal 0x%02x "
77 "lbam 0x%02x lbah 0x%02x dev 0x%02x cmd 0x%02x\n",
78 drive->name, tf->feature, tf->nsect, tf->lbal,
79 tf->lbam, tf->lbah, tf->device, tf->command);
80#endif
81
75 if (IDE_CONTROL_REG) 82 if (IDE_CONTROL_REG)
76 hwif->OUTB(drive->ctl, IDE_CONTROL_REG); /* clear nIEN */ 83 hwif->OUTB(drive->ctl, IDE_CONTROL_REG); /* clear nIEN */
77 84
@@ -103,7 +110,8 @@ void ide_tf_load(ide_drive_t *drive, ide_task_t *task)
103 if (task->tf_flags & IDE_TFLAG_OUT_LBAH) 110 if (task->tf_flags & IDE_TFLAG_OUT_LBAH)
104 hwif->OUTB(tf->lbah, IDE_HCYL_REG); 111 hwif->OUTB(tf->lbah, IDE_HCYL_REG);
105 112
106 hwif->OUTB((tf->device & HIHI) | drive->select.all, IDE_SELECT_REG); 113 if (task->tf_flags & IDE_TFLAG_OUT_DEVICE)
114 hwif->OUTB((tf->device & HIHI) | drive->select.all, IDE_SELECT_REG);
107} 115}
108 116
109EXPORT_SYMBOL_GPL(ide_tf_load); 117EXPORT_SYMBOL_GPL(ide_tf_load);