aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-taskfile.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2009-04-08 08:13:02 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-04-08 08:13:02 -0400
commit745483f10c6cefb303007c6873e2bfce54efa8ed (patch)
tree9dc9dca95f017edf279bf3e2d5ec3d07481e75da /drivers/ide/ide-taskfile.c
parent60f85019c6c8c1aebf3485a313e0da094bc95d07 (diff)
ide: simplify 'struct ide_taskfile'
Make 'struct ide_taskfile' cover only 8 register values and thus put two such fields ('tf' and 'hob') into 'struct ide_cmd', dropping unnecessary 'tf_array' field from it. This required changing the prototype of ide_get_lba_addr() and ide_tf_dump(). Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> [bart: fix setting of ATA_LBA bit for LBA48 commands in __ide_do_rw_disk()] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r--drivers/ide/ide-taskfile.c31
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index dc84f8bde52a..3160be494aa0 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -23,17 +23,16 @@
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
24#include <asm/io.h> 24#include <asm/io.h>
25 25
26void ide_tf_dump(const char *s, struct ide_taskfile *tf) 26void ide_tf_dump(const char *s, struct ide_cmd *cmd)
27{ 27{
28#ifdef DEBUG 28#ifdef DEBUG
29 printk("%s: tf: feat 0x%02x nsect 0x%02x lbal 0x%02x " 29 printk("%s: tf: feat 0x%02x nsect 0x%02x lbal 0x%02x "
30 "lbam 0x%02x lbah 0x%02x dev 0x%02x cmd 0x%02x\n", 30 "lbam 0x%02x lbah 0x%02x dev 0x%02x cmd 0x%02x\n",
31 s, tf->feature, tf->nsect, tf->lbal, 31 s, cmd->tf.feature, cmd->tf.nsect,
32 tf->lbam, tf->lbah, tf->device, tf->command); 32 cmd->tf.lbal, cmd->tf.lbam, cmd->tf.lbah,
33 printk("%s: hob: nsect 0x%02x lbal 0x%02x " 33 cmd->tf.device, cmd->tf.command);
34 "lbam 0x%02x lbah 0x%02x\n", 34 printk("%s: hob: nsect 0x%02x lbal 0x%02x lbam 0x%02x lbah 0x%02x\n",
35 s, tf->hob_nsect, tf->hob_lbal, 35 s, cmd->hob.nsect, cmd->hob.lbal, cmd->hob.lbam, cmd->hob.lbah);
36 tf->hob_lbam, tf->hob_lbah);
37#endif 36#endif
38} 37}
39 38
@@ -80,12 +79,12 @@ ide_startstop_t do_rw_taskfile(ide_drive_t *drive, struct ide_cmd *orig_cmd)
80 memcpy(cmd, orig_cmd, sizeof(*cmd)); 79 memcpy(cmd, orig_cmd, sizeof(*cmd));
81 80
82 if ((cmd->tf_flags & IDE_TFLAG_DMA_PIO_FALLBACK) == 0) { 81 if ((cmd->tf_flags & IDE_TFLAG_DMA_PIO_FALLBACK) == 0) {
83 ide_tf_dump(drive->name, tf); 82 ide_tf_dump(drive->name, cmd);
84 tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS); 83 tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
85 SELECT_MASK(drive, 0); 84 SELECT_MASK(drive, 0);
86 85
87 if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) { 86 if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) {
88 u8 data[2] = { tf->data, tf->hob_data }; 87 u8 data[2] = { cmd->tf.data, cmd->hob.data };
89 88
90 tp_ops->output_data(drive, cmd, data, 2); 89 tp_ops->output_data(drive, cmd, data, 2);
91 } 90 }
@@ -490,10 +489,8 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
490 489
491 memset(&cmd, 0, sizeof(cmd)); 490 memset(&cmd, 0, sizeof(cmd));
492 491
493 memcpy(&cmd.tf_array[0], req_task->hob_ports, 492 memcpy(&cmd.hob, req_task->hob_ports, HDIO_DRIVE_HOB_HDR_SIZE - 2);
494 HDIO_DRIVE_HOB_HDR_SIZE - 2); 493 memcpy(&cmd.tf, req_task->io_ports, HDIO_DRIVE_TASK_HDR_SIZE);
495 memcpy(&cmd.tf_array[6], req_task->io_ports,
496 HDIO_DRIVE_TASK_HDR_SIZE);
497 494
498 cmd.valid.out.tf = IDE_VALID_DEVICE; 495 cmd.valid.out.tf = IDE_VALID_DEVICE;
499 cmd.valid.in.tf = IDE_VALID_DEVICE | IDE_VALID_IN_TF; 496 cmd.valid.in.tf = IDE_VALID_DEVICE | IDE_VALID_IN_TF;
@@ -598,7 +595,7 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
598 if (req_task->req_cmd == IDE_DRIVE_TASK_NO_DATA) 595 if (req_task->req_cmd == IDE_DRIVE_TASK_NO_DATA)
599 nsect = 0; 596 nsect = 0;
600 else if (!nsect) { 597 else if (!nsect) {
601 nsect = (cmd.tf.hob_nsect << 8) | cmd.tf.nsect; 598 nsect = (cmd.hob.nsect << 8) | cmd.tf.nsect;
602 599
603 if (!nsect) { 600 if (!nsect) {
604 printk(KERN_ERR "%s: in/out command without data\n", 601 printk(KERN_ERR "%s: in/out command without data\n",
@@ -610,10 +607,8 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
610 607
611 err = ide_raw_taskfile(drive, &cmd, data_buf, nsect); 608 err = ide_raw_taskfile(drive, &cmd, data_buf, nsect);
612 609
613 memcpy(req_task->hob_ports, &cmd.tf_array[0], 610 memcpy(req_task->hob_ports, &cmd.hob, HDIO_DRIVE_HOB_HDR_SIZE - 2);
614 HDIO_DRIVE_HOB_HDR_SIZE - 2); 611 memcpy(req_task->io_ports, &cmd.tf, HDIO_DRIVE_TASK_HDR_SIZE);
615 memcpy(req_task->io_ports, &cmd.tf_array[6],
616 HDIO_DRIVE_TASK_HDR_SIZE);
617 612
618 if ((cmd.ftf_flags & IDE_FTFLAG_SET_IN_FLAGS) && 613 if ((cmd.ftf_flags & IDE_FTFLAG_SET_IN_FLAGS) &&
619 req_task->in_flags.all == 0) { 614 req_task->in_flags.all == 0) {