aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-ioctls.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-ioctls.c')
-rw-r--r--drivers/ide/ide-ioctls.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/ide/ide-ioctls.c b/drivers/ide/ide-ioctls.c
index 770142767437..c1c25ebbaa1f 100644
--- a/drivers/ide/ide-ioctls.c
+++ b/drivers/ide/ide-ioctls.c
@@ -141,11 +141,12 @@ static int ide_cmd_ioctl(ide_drive_t *drive, unsigned long arg)
141 tf->lbal = args[1]; 141 tf->lbal = args[1];
142 tf->lbam = 0x4f; 142 tf->lbam = 0x4f;
143 tf->lbah = 0xc2; 143 tf->lbah = 0xc2;
144 cmd.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_IN_NSECT; 144 cmd.valid.out.tf = IDE_VALID_OUT_TF;
145 cmd.valid.in.tf = IDE_VALID_NSECT;
145 } else { 146 } else {
146 tf->nsect = args[1]; 147 tf->nsect = args[1];
147 cmd.tf_flags = IDE_TFLAG_OUT_FEATURE | IDE_TFLAG_OUT_NSECT | 148 cmd.valid.out.tf = IDE_VALID_FEATURE | IDE_VALID_NSECT;
148 IDE_TFLAG_IN_NSECT; 149 cmd.valid.in.tf = IDE_VALID_NSECT;
149 } 150 }
150 tf->command = args[0]; 151 tf->command = args[0];
151 cmd.protocol = args[3] ? ATA_PROT_PIO : ATA_PROT_NODATA; 152 cmd.protocol = args[3] ? ATA_PROT_PIO : ATA_PROT_NODATA;
@@ -205,14 +206,15 @@ static int ide_task_ioctl(ide_drive_t *drive, unsigned long arg)
205 return -EFAULT; 206 return -EFAULT;
206 207
207 memset(&cmd, 0, sizeof(cmd)); 208 memset(&cmd, 0, sizeof(cmd));
208 memcpy(&cmd.tf_array[7], &args[1], 6); 209 memcpy(&cmd.tf.feature, &args[1], 6);
209 cmd.tf.command = args[0]; 210 cmd.tf.command = args[0];
210 cmd.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_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;
211 213
212 err = ide_no_data_taskfile(drive, &cmd); 214 err = ide_no_data_taskfile(drive, &cmd);
213 215
214 args[0] = cmd.tf.command; 216 args[0] = cmd.tf.command;
215 memcpy(&args[1], &cmd.tf_array[7], 6); 217 memcpy(&args[1], &cmd.tf.feature, 6);
216 218
217 if (copy_to_user(p, args, 7)) 219 if (copy_to_user(p, args, 7))
218 err = -EFAULT; 220 err = -EFAULT;