linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch ide-dev 8/9] make ide_task_ioctl() use REQ_DRIVE_TASKFILE
@ 2005-02-24 14:48 Bartlomiej Zolnierkiewicz
  2005-02-27  7:36 ` Tejun Heo
  0 siblings, 1 reply; 14+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2005-02-24 14:48 UTC (permalink / raw)
  To: linux-ide, linux-kernel; +Cc: Tejun Heo


ide_task_ioctl() rewritten to use taskfile transport.
This is the last user of REQ_DRIVE_TASK.

bart: ported to recent IDE changes by me

Signed-off-by: Tejun Heo <htejun@gmail.com>

diff -Nru a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
--- a/drivers/ide/ide-taskfile.c	2005-02-24 15:30:02 +01:00
+++ b/drivers/ide/ide-taskfile.c	2005-02-24 15:30:02 +01:00
@@ -777,30 +777,42 @@
 	return err;
 }

-static int ide_wait_cmd_task(ide_drive_t *drive, u8 *buf)
-{
-	struct request rq;
-
-	ide_init_drive_cmd(&rq);
-	rq.flags = REQ_DRIVE_TASK;
-	rq.buffer = buf;
-	return ide_do_drive_cmd(drive, &rq, ide_wait);
-}
-
-/*
- * FIXME : this needs to map into at taskfile. <andre@linux-ide.org>
- */
-int ide_task_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
+int ide_task_ioctl(ide_drive_t *drive, unsigned int cmd, unsigned long arg)
 {
 	void __user *p = (void __user *)arg;
-	int err = 0;
-	u8 args[7], *argbuf = args;
-	int argsize = 7;
+	int err;
+	u8 args[7];
+	ide_task_t task;
+	struct ata_taskfile *tf = &task.tf;

 	if (copy_from_user(args, p, 7))
 		return -EFAULT;
-	err = ide_wait_cmd_task(drive, argbuf);
-	if (copy_to_user(p, argbuf, argsize))
+
+	memset(&task, 0, sizeof(task));
+
+	tf->command	= args[0];
+	tf->feature	= args[1];
+	tf->nsect	= args[2];
+	tf->lbal	= args[3];
+	tf->lbam	= args[4];
+	tf->lbah	= args[5];
+	tf->device	= args[6];
+
+	task.command_type = IDE_DRIVE_TASK_NO_DATA;
+	task.data_phase = TASKFILE_NO_DATA;
+	task.handler = &task_no_data_intr;
+
+	err = ide_diag_taskfile(drive, &task, 0, NULL);
+
+	args[0] = tf->command;
+	args[1] = tf->feature;
+	args[2] = tf->nsect;
+	args[3] = tf->lbal;
+	args[4] = tf->lbam;
+	args[5] = tf->lbah;
+	args[6] = tf->device;
+
+	if (copy_to_user(p, args, 7))
 		err = -EFAULT;
 	return err;
 }

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-03-02 19:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-24 14:48 [patch ide-dev 8/9] make ide_task_ioctl() use REQ_DRIVE_TASKFILE Bartlomiej Zolnierkiewicz
2005-02-27  7:36 ` Tejun Heo
2005-02-27 16:31   ` Bartlomiej Zolnierkiewicz
2005-02-28 15:24     ` Tejun Heo
2005-02-28 16:14       ` Bartlomiej Zolnierkiewicz
2005-03-01  4:21         ` Tejun Heo
2005-03-01  5:29           ` Tejun Heo
2005-03-01  8:42           ` Bartlomiej Zolnierkiewicz
2005-03-01  9:29             ` Tejun Heo
2005-03-01  9:59               ` Bartlomiej Zolnierkiewicz
2005-03-02  6:08                 ` Jeff Garzik
2005-03-02 10:09                   ` Bartlomiej Zolnierkiewicz
2005-03-02 19:04                     ` Jeff Garzik
2005-03-02 14:20                   ` Mark Lord

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).