diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2009-04-08 08:13:02 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-04-08 08:13:02 -0400 |
commit | 745483f10c6cefb303007c6873e2bfce54efa8ed (patch) | |
tree | 9dc9dca95f017edf279bf3e2d5ec3d07481e75da /drivers | |
parent | 60f85019c6c8c1aebf3485a313e0da094bc95d07 (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')
-rw-r--r-- | drivers/ide/ide-acpi.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-disk.c | 30 | ||||
-rw-r--r-- | drivers/ide/ide-io-std.c | 24 | ||||
-rw-r--r-- | drivers/ide/ide-io.c | 6 | ||||
-rw-r--r-- | drivers/ide/ide-ioctls.c | 4 | ||||
-rw-r--r-- | drivers/ide/ide-lib.c | 15 | ||||
-rw-r--r-- | drivers/ide/ide-taskfile.c | 31 | ||||
-rw-r--r-- | drivers/ide/ns87415.c | 11 | ||||
-rw-r--r-- | drivers/ide/scc_pata.c | 24 |
9 files changed, 74 insertions, 73 deletions
diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c index f0db4d349c60..77f79d26b264 100644 --- a/drivers/ide/ide-acpi.c +++ b/drivers/ide/ide-acpi.c | |||
@@ -318,7 +318,7 @@ static int do_drive_set_taskfiles(ide_drive_t *drive, | |||
318 | 318 | ||
319 | /* convert GTF to taskfile */ | 319 | /* convert GTF to taskfile */ |
320 | memset(&cmd, 0, sizeof(cmd)); | 320 | memset(&cmd, 0, sizeof(cmd)); |
321 | memcpy(&cmd.tf_array[7], gtf, REGS_PER_GTF); | 321 | memcpy(&cmd.tf.feature, gtf, REGS_PER_GTF); |
322 | cmd.valid.out.tf = IDE_VALID_OUT_TF | IDE_VALID_DEVICE; | 322 | cmd.valid.out.tf = IDE_VALID_OUT_TF | IDE_VALID_DEVICE; |
323 | cmd.valid.in.tf = IDE_VALID_IN_TF | IDE_VALID_DEVICE; | 323 | cmd.valid.in.tf = IDE_VALID_IN_TF | IDE_VALID_DEVICE; |
324 | 324 | ||
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 235263e51dd9..a9fbe2c31210 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -105,17 +105,19 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, | |||
105 | pr_debug("%s: LBA=0x%012llx\n", drive->name, | 105 | pr_debug("%s: LBA=0x%012llx\n", drive->name, |
106 | (unsigned long long)block); | 106 | (unsigned long long)block); |
107 | 107 | ||
108 | tf->hob_nsect = (nsectors >> 8) & 0xff; | ||
109 | tf->hob_lbal = (u8)(block >> 24); | ||
110 | if (sizeof(block) != 4) { | ||
111 | tf->hob_lbam = (u8)((u64)block >> 32); | ||
112 | tf->hob_lbah = (u8)((u64)block >> 40); | ||
113 | } | ||
114 | |||
115 | tf->nsect = nsectors & 0xff; | 108 | tf->nsect = nsectors & 0xff; |
116 | tf->lbal = (u8) block; | 109 | tf->lbal = (u8) block; |
117 | tf->lbam = (u8)(block >> 8); | 110 | tf->lbam = (u8)(block >> 8); |
118 | tf->lbah = (u8)(block >> 16); | 111 | tf->lbah = (u8)(block >> 16); |
112 | tf->device = ATA_LBA; | ||
113 | |||
114 | tf = &cmd.hob; | ||
115 | tf->nsect = (nsectors >> 8) & 0xff; | ||
116 | tf->lbal = (u8)(block >> 24); | ||
117 | if (sizeof(block) != 4) { | ||
118 | tf->lbam = (u8)((u64)block >> 32); | ||
119 | tf->lbah = (u8)((u64)block >> 40); | ||
120 | } | ||
119 | 121 | ||
120 | cmd.valid.out.hob = IDE_VALID_OUT_HOB; | 122 | cmd.valid.out.hob = IDE_VALID_OUT_HOB; |
121 | cmd.valid.in.hob = IDE_VALID_IN_HOB; | 123 | cmd.valid.in.hob = IDE_VALID_IN_HOB; |
@@ -125,10 +127,8 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, | |||
125 | tf->lbal = block; | 127 | tf->lbal = block; |
126 | tf->lbam = block >>= 8; | 128 | tf->lbam = block >>= 8; |
127 | tf->lbah = block >>= 8; | 129 | tf->lbah = block >>= 8; |
128 | tf->device = (block >> 8) & 0xf; | 130 | tf->device = ((block >> 8) & 0xf) | ATA_LBA; |
129 | } | 131 | } |
130 | |||
131 | tf->device |= ATA_LBA; | ||
132 | } else { | 132 | } else { |
133 | unsigned int sect, head, cyl, track; | 133 | unsigned int sect, head, cyl, track; |
134 | 134 | ||
@@ -235,7 +235,7 @@ static u64 idedisk_read_native_max_address(ide_drive_t *drive, int lba48) | |||
235 | 235 | ||
236 | /* if OK, compute maximum address value */ | 236 | /* if OK, compute maximum address value */ |
237 | if (!(tf->status & ATA_ERR)) | 237 | if (!(tf->status & ATA_ERR)) |
238 | addr = ide_get_lba_addr(tf, lba48) + 1; | 238 | addr = ide_get_lba_addr(&cmd, lba48) + 1; |
239 | 239 | ||
240 | return addr; | 240 | return addr; |
241 | } | 241 | } |
@@ -257,9 +257,9 @@ static u64 idedisk_set_max_address(ide_drive_t *drive, u64 addr_req, int lba48) | |||
257 | tf->lbam = (addr_req >>= 8) & 0xff; | 257 | tf->lbam = (addr_req >>= 8) & 0xff; |
258 | tf->lbah = (addr_req >>= 8) & 0xff; | 258 | tf->lbah = (addr_req >>= 8) & 0xff; |
259 | if (lba48) { | 259 | if (lba48) { |
260 | tf->hob_lbal = (addr_req >>= 8) & 0xff; | 260 | cmd.hob.lbal = (addr_req >>= 8) & 0xff; |
261 | tf->hob_lbam = (addr_req >>= 8) & 0xff; | 261 | cmd.hob.lbam = (addr_req >>= 8) & 0xff; |
262 | tf->hob_lbah = (addr_req >>= 8) & 0xff; | 262 | cmd.hob.lbah = (addr_req >>= 8) & 0xff; |
263 | tf->command = ATA_CMD_SET_MAX_EXT; | 263 | tf->command = ATA_CMD_SET_MAX_EXT; |
264 | } else { | 264 | } else { |
265 | tf->device = (addr_req >>= 8) & 0x0f; | 265 | tf->device = (addr_req >>= 8) & 0x0f; |
@@ -279,7 +279,7 @@ static u64 idedisk_set_max_address(ide_drive_t *drive, u64 addr_req, int lba48) | |||
279 | 279 | ||
280 | /* if OK, compute maximum address value */ | 280 | /* if OK, compute maximum address value */ |
281 | if (!(tf->status & ATA_ERR)) | 281 | if (!(tf->status & ATA_ERR)) |
282 | addr_set = ide_get_lba_addr(tf, lba48) + 1; | 282 | addr_set = ide_get_lba_addr(&cmd, lba48) + 1; |
283 | 283 | ||
284 | return addr_set; | 284 | return addr_set; |
285 | } | 285 | } |
diff --git a/drivers/ide/ide-io-std.c b/drivers/ide/ide-io-std.c index 8b0b2e9ccf5b..45a424b60c85 100644 --- a/drivers/ide/ide-io-std.c +++ b/drivers/ide/ide-io-std.c | |||
@@ -89,7 +89,7 @@ void ide_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) | |||
89 | { | 89 | { |
90 | ide_hwif_t *hwif = drive->hwif; | 90 | ide_hwif_t *hwif = drive->hwif; |
91 | struct ide_io_ports *io_ports = &hwif->io_ports; | 91 | struct ide_io_ports *io_ports = &hwif->io_ports; |
92 | struct ide_taskfile *tf = &cmd->tf; | 92 | struct ide_taskfile *tf = &cmd->hob; |
93 | void (*tf_outb)(u8 addr, unsigned long port); | 93 | void (*tf_outb)(u8 addr, unsigned long port); |
94 | u8 valid = cmd->valid.out.hob; | 94 | u8 valid = cmd->valid.out.hob; |
95 | u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0; | 95 | u8 mmio = (hwif->host_flags & IDE_HFLAG_MMIO) ? 1 : 0; |
@@ -104,16 +104,17 @@ void ide_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) | |||
104 | HIHI = 0xFF; | 104 | HIHI = 0xFF; |
105 | 105 | ||
106 | if (valid & IDE_VALID_FEATURE) | 106 | if (valid & IDE_VALID_FEATURE) |
107 | tf_outb(tf->hob_feature, io_ports->feature_addr); | 107 | tf_outb(tf->feature, io_ports->feature_addr); |
108 | if (valid & IDE_VALID_NSECT) | 108 | if (valid & IDE_VALID_NSECT) |
109 | tf_outb(tf->hob_nsect, io_ports->nsect_addr); | 109 | tf_outb(tf->nsect, io_ports->nsect_addr); |
110 | if (valid & IDE_VALID_LBAL) | 110 | if (valid & IDE_VALID_LBAL) |
111 | tf_outb(tf->hob_lbal, io_ports->lbal_addr); | 111 | tf_outb(tf->lbal, io_ports->lbal_addr); |
112 | if (valid & IDE_VALID_LBAM) | 112 | if (valid & IDE_VALID_LBAM) |
113 | tf_outb(tf->hob_lbam, io_ports->lbam_addr); | 113 | tf_outb(tf->lbam, io_ports->lbam_addr); |
114 | if (valid & IDE_VALID_LBAH) | 114 | if (valid & IDE_VALID_LBAH) |
115 | tf_outb(tf->hob_lbah, io_ports->lbah_addr); | 115 | tf_outb(tf->lbah, io_ports->lbah_addr); |
116 | 116 | ||
117 | tf = &cmd->tf; | ||
117 | valid = cmd->valid.out.tf; | 118 | valid = cmd->valid.out.tf; |
118 | 119 | ||
119 | if (valid & IDE_VALID_FEATURE) | 120 | if (valid & IDE_VALID_FEATURE) |
@@ -170,18 +171,19 @@ void ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd) | |||
170 | if (cmd->tf_flags & IDE_TFLAG_LBA48) { | 171 | if (cmd->tf_flags & IDE_TFLAG_LBA48) { |
171 | tf_outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr); | 172 | tf_outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr); |
172 | 173 | ||
174 | tf = &cmd->hob; | ||
173 | valid = cmd->valid.in.hob; | 175 | valid = cmd->valid.in.hob; |
174 | 176 | ||
175 | if (valid & IDE_VALID_ERROR) | 177 | if (valid & IDE_VALID_ERROR) |
176 | tf->hob_error = tf_inb(io_ports->feature_addr); | 178 | tf->error = tf_inb(io_ports->feature_addr); |
177 | if (valid & IDE_VALID_NSECT) | 179 | if (valid & IDE_VALID_NSECT) |
178 | tf->hob_nsect = tf_inb(io_ports->nsect_addr); | 180 | tf->nsect = tf_inb(io_ports->nsect_addr); |
179 | if (valid & IDE_VALID_LBAL) | 181 | if (valid & IDE_VALID_LBAL) |
180 | tf->hob_lbal = tf_inb(io_ports->lbal_addr); | 182 | tf->lbal = tf_inb(io_ports->lbal_addr); |
181 | if (valid & IDE_VALID_LBAM) | 183 | if (valid & IDE_VALID_LBAM) |
182 | tf->hob_lbam = tf_inb(io_ports->lbam_addr); | 184 | tf->lbam = tf_inb(io_ports->lbam_addr); |
183 | if (valid & IDE_VALID_LBAH) | 185 | if (valid & IDE_VALID_LBAH) |
184 | tf->hob_lbah = tf_inb(io_ports->lbah_addr); | 186 | tf->lbah = tf_inb(io_ports->lbah_addr); |
185 | } | 187 | } |
186 | } | 188 | } |
187 | EXPORT_SYMBOL_GPL(ide_tf_read); | 189 | EXPORT_SYMBOL_GPL(ide_tf_read); |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 99bb0a9a67e8..e71c72be7622 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -86,8 +86,8 @@ void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err) | |||
86 | 86 | ||
87 | tp_ops->input_data(drive, cmd, data, 2); | 87 | tp_ops->input_data(drive, cmd, data, 2); |
88 | 88 | ||
89 | tf->data = data[0]; | 89 | cmd->tf.data = data[0]; |
90 | tf->hob_data = data[1]; | 90 | cmd->hob.data = data[1]; |
91 | } | 91 | } |
92 | 92 | ||
93 | tp_ops->tf_read(drive, cmd); | 93 | tp_ops->tf_read(drive, cmd); |
@@ -97,7 +97,7 @@ void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err) | |||
97 | if (tf->lbal != 0xc4) { | 97 | if (tf->lbal != 0xc4) { |
98 | printk(KERN_ERR "%s: head unload failed!\n", | 98 | printk(KERN_ERR "%s: head unload failed!\n", |
99 | drive->name); | 99 | drive->name); |
100 | ide_tf_dump(drive->name, tf); | 100 | ide_tf_dump(drive->name, cmd); |
101 | } else | 101 | } else |
102 | drive->dev_flags |= IDE_DFLAG_PARKED; | 102 | drive->dev_flags |= IDE_DFLAG_PARKED; |
103 | } | 103 | } |
diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c index b11df4b7998e..c1c25ebbaa1f 100644 --- a/drivers/ide/ide-ioctls.c +++ b/drivers/ide/ide-ioctls.c | |||
@@ -206,7 +206,7 @@ static int ide_task_ioctl(ide_drive_t *drive, unsigned long arg) | |||
206 | return -EFAULT; | 206 | return -EFAULT; |
207 | 207 | ||
208 | memset(&cmd, 0, sizeof(cmd)); | 208 | memset(&cmd, 0, sizeof(cmd)); |
209 | memcpy(&cmd.tf_array[7], &args[1], 6); | 209 | memcpy(&cmd.tf.feature, &args[1], 6); |
210 | cmd.tf.command = args[0]; | 210 | cmd.tf.command = args[0]; |
211 | cmd.valid.out.tf = IDE_VALID_OUT_TF | IDE_VALID_DEVICE; | 211 | cmd.valid.out.tf = IDE_VALID_OUT_TF | IDE_VALID_DEVICE; |
212 | cmd.valid.in.tf = IDE_VALID_IN_TF | IDE_VALID_DEVICE; | 212 | cmd.valid.in.tf = IDE_VALID_IN_TF | IDE_VALID_DEVICE; |
@@ -214,7 +214,7 @@ static int ide_task_ioctl(ide_drive_t *drive, unsigned long arg) | |||
214 | err = ide_no_data_taskfile(drive, &cmd); | 214 | err = ide_no_data_taskfile(drive, &cmd); |
215 | 215 | ||
216 | args[0] = cmd.tf.command; | 216 | args[0] = cmd.tf.command; |
217 | memcpy(&args[1], &cmd.tf_array[7], 6); | 217 | memcpy(&args[1], &cmd.tf.feature, 6); |
218 | 218 | ||
219 | if (copy_to_user(p, args, 7)) | 219 | if (copy_to_user(p, args, 7)) |
220 | err = -EFAULT; | 220 | err = -EFAULT; |
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c index c9ef77c5d62e..6857e6aaf20d 100644 --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c | |||
@@ -49,16 +49,17 @@ static void ide_dump_opcode(ide_drive_t *drive) | |||
49 | printk(KERN_CONT "0x%02x\n", cmd->tf.command); | 49 | printk(KERN_CONT "0x%02x\n", cmd->tf.command); |
50 | } | 50 | } |
51 | 51 | ||
52 | u64 ide_get_lba_addr(struct ide_taskfile *tf, int lba48) | 52 | u64 ide_get_lba_addr(struct ide_cmd *cmd, int lba48) |
53 | { | 53 | { |
54 | struct ide_taskfile *tf = &cmd->tf; | ||
54 | u32 high, low; | 55 | u32 high, low; |
55 | 56 | ||
56 | if (lba48) | ||
57 | high = (tf->hob_lbah << 16) | (tf->hob_lbam << 8) | | ||
58 | tf->hob_lbal; | ||
59 | else | ||
60 | high = tf->device & 0xf; | ||
61 | low = (tf->lbah << 16) | (tf->lbam << 8) | tf->lbal; | 57 | low = (tf->lbah << 16) | (tf->lbam << 8) | tf->lbal; |
58 | if (lba48) { | ||
59 | tf = &cmd->hob; | ||
60 | high = (tf->lbah << 16) | (tf->lbam << 8) | tf->lbal; | ||
61 | } else | ||
62 | high = tf->device & 0xf; | ||
62 | 63 | ||
63 | return ((u64)high << 24) | low; | 64 | return ((u64)high << 24) | low; |
64 | } | 65 | } |
@@ -82,7 +83,7 @@ static void ide_dump_sector(ide_drive_t *drive) | |||
82 | 83 | ||
83 | if (lba48 || (tf->device & ATA_LBA)) | 84 | if (lba48 || (tf->device & ATA_LBA)) |
84 | printk(KERN_CONT ", LBAsect=%llu", | 85 | printk(KERN_CONT ", LBAsect=%llu", |
85 | (unsigned long long)ide_get_lba_addr(tf, lba48)); | 86 | (unsigned long long)ide_get_lba_addr(&cmd, lba48)); |
86 | else | 87 | else |
87 | printk(KERN_CONT ", CHS=%d/%d/%d", (tf->lbah << 8) + tf->lbam, | 88 | printk(KERN_CONT ", CHS=%d/%d/%d", (tf->lbah << 8) + tf->lbam, |
88 | tf->device & 0xf, tf->lbal); | 89 | tf->device & 0xf, tf->lbal); |
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 | ||
26 | void ide_tf_dump(const char *s, struct ide_taskfile *tf) | 26 | void 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) { |
diff --git a/drivers/ide/ns87415.c b/drivers/ide/ns87415.c index 0208dd35c1a3..3ab5bb196d2f 100644 --- a/drivers/ide/ns87415.c +++ b/drivers/ide/ns87415.c | |||
@@ -86,18 +86,19 @@ static void superio_tf_read(ide_drive_t *drive, struct ide_cmd *cmd) | |||
86 | if (cmd->tf_flags & IDE_TFLAG_LBA48) { | 86 | if (cmd->tf_flags & IDE_TFLAG_LBA48) { |
87 | outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr); | 87 | outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr); |
88 | 88 | ||
89 | tf = &cmd->hob; | ||
89 | valid = cmd->valid.in.hob; | 90 | valid = cmd->valid.in.hob; |
90 | 91 | ||
91 | if (valid & IDE_VALID_ERROR) | 92 | if (valid & IDE_VALID_ERROR) |
92 | tf->hob_error = inb(io_ports->feature_addr); | 93 | tf->error = inb(io_ports->feature_addr); |
93 | if (valid & IDE_VALID_NSECT) | 94 | if (valid & IDE_VALID_NSECT) |
94 | tf->hob_nsect = inb(io_ports->nsect_addr); | 95 | tf->nsect = inb(io_ports->nsect_addr); |
95 | if (valid & IDE_VALID_LBAL) | 96 | if (valid & IDE_VALID_LBAL) |
96 | tf->hob_lbal = inb(io_ports->lbal_addr); | 97 | tf->lbal = inb(io_ports->lbal_addr); |
97 | if (valid & IDE_VALID_LBAM) | 98 | if (valid & IDE_VALID_LBAM) |
98 | tf->hob_lbam = inb(io_ports->lbam_addr); | 99 | tf->lbam = inb(io_ports->lbam_addr); |
99 | if (valid & IDE_VALID_LBAH) | 100 | if (valid & IDE_VALID_LBAH) |
100 | tf->hob_lbah = inb(io_ports->lbah_addr); | 101 | tf->lbah = inb(io_ports->lbah_addr); |
101 | } | 102 | } |
102 | } | 103 | } |
103 | 104 | ||
diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c index 38a715e293d4..1238d5561976 100644 --- a/drivers/ide/scc_pata.c +++ b/drivers/ide/scc_pata.c | |||
@@ -648,7 +648,7 @@ static int __devinit init_setup_scc(struct pci_dev *dev, | |||
648 | static void scc_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) | 648 | static void scc_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) |
649 | { | 649 | { |
650 | struct ide_io_ports *io_ports = &drive->hwif->io_ports; | 650 | struct ide_io_ports *io_ports = &drive->hwif->io_ports; |
651 | struct ide_taskfile *tf = &cmd->tf; | 651 | struct ide_taskfile *tf = &cmd->hob; |
652 | u8 valid = cmd->valid.out.hob; | 652 | u8 valid = cmd->valid.out.hob; |
653 | u8 HIHI = (cmd->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF; | 653 | u8 HIHI = (cmd->tf_flags & IDE_TFLAG_LBA48) ? 0xE0 : 0xEF; |
654 | 654 | ||
@@ -656,16 +656,17 @@ static void scc_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) | |||
656 | HIHI = 0xFF; | 656 | HIHI = 0xFF; |
657 | 657 | ||
658 | if (valid & IDE_VALID_FEATURE) | 658 | if (valid & IDE_VALID_FEATURE) |
659 | scc_ide_outb(tf->hob_feature, io_ports->feature_addr); | 659 | scc_ide_outb(tf->feature, io_ports->feature_addr); |
660 | if (valid & IDE_VALID_NSECT) | 660 | if (valid & IDE_VALID_NSECT) |
661 | scc_ide_outb(tf->hob_nsect, io_ports->nsect_addr); | 661 | scc_ide_outb(tf->nsect, io_ports->nsect_addr); |
662 | if (valid & IDE_VALID_LBAL) | 662 | if (valid & IDE_VALID_LBAL) |
663 | scc_ide_outb(tf->hob_lbal, io_ports->lbal_addr); | 663 | scc_ide_outb(tf->lbal, io_ports->lbal_addr); |
664 | if (valid & IDE_VALID_LBAM) | 664 | if (valid & IDE_VALID_LBAM) |
665 | scc_ide_outb(tf->hob_lbam, io_ports->lbam_addr); | 665 | scc_ide_outb(tf->lbam, io_ports->lbam_addr); |
666 | if (valid & IDE_VALID_LBAH) | 666 | if (valid & IDE_VALID_LBAH) |
667 | scc_ide_outb(tf->hob_lbah, io_ports->lbah_addr); | 667 | scc_ide_outb(tf->lbah, io_ports->lbah_addr); |
668 | 668 | ||
669 | tf = &cmd->tf; | ||
669 | valid = cmd->valid.out.tf; | 670 | valid = cmd->valid.out.tf; |
670 | 671 | ||
671 | if (valid & IDE_VALID_FEATURE) | 672 | if (valid & IDE_VALID_FEATURE) |
@@ -709,18 +710,19 @@ static void scc_tf_read(ide_drive_t *drive, struct ide_cmd *cmd) | |||
709 | if (cmd->tf_flags & IDE_TFLAG_LBA48) { | 710 | if (cmd->tf_flags & IDE_TFLAG_LBA48) { |
710 | scc_ide_outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr); | 711 | scc_ide_outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr); |
711 | 712 | ||
713 | tf = &cmd->hob; | ||
712 | valid = cmd->valid.in.hob; | 714 | valid = cmd->valid.in.hob; |
713 | 715 | ||
714 | if (valid & IDE_VALID_ERROR) | 716 | if (valid & IDE_VALID_ERROR) |
715 | tf->hob_error = scc_ide_inb(io_ports->feature_addr); | 717 | tf->error = scc_ide_inb(io_ports->feature_addr); |
716 | if (valid & IDE_VALID_NSECT) | 718 | if (valid & IDE_VALID_NSECT) |
717 | tf->hob_nsect = scc_ide_inb(io_ports->nsect_addr); | 719 | tf->nsect = scc_ide_inb(io_ports->nsect_addr); |
718 | if (valid & IDE_VALID_LBAL) | 720 | if (valid & IDE_VALID_LBAL) |
719 | tf->hob_lbal = scc_ide_inb(io_ports->lbal_addr); | 721 | tf->lbal = scc_ide_inb(io_ports->lbal_addr); |
720 | if (valid & IDE_VALID_LBAM) | 722 | if (valid & IDE_VALID_LBAM) |
721 | tf->hob_lbam = scc_ide_inb(io_ports->lbam_addr); | 723 | tf->lbam = scc_ide_inb(io_ports->lbam_addr); |
722 | if (valid & IDE_VALID_LBAH) | 724 | if (valid & IDE_VALID_LBAH) |
723 | tf->hob_lbah = scc_ide_inb(io_ports->lbah_addr); | 725 | tf->lbah = scc_ide_inb(io_ports->lbah_addr); |
724 | } | 726 | } |
725 | } | 727 | } |
726 | 728 | ||