From: Tejun Heo <tj@home-tj.org>
To: bzolnier@gmail.com, linux-ide@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.11-rc2 05/09] ide: map ide_task_ioctl() to ide_taskfile_ioctl()
Date: Sat, 5 Feb 2005 19:28:43 +0900 (KST) [thread overview]
Message-ID: <20050205102843.9F9A6132702@htj.dyndns.org> (raw)
In-Reply-To: <42049F20.7020706@home-tj.org>
05_ide_taskfile_task_ioctl.patch
ide_task_ioctl() modified to map to ide_taskfile_ioctl().
This is the last user of REQ_DRIVE_TASK.
Signed-off-by: Tejun Heo <tj@home-tj.org>
Index: linux-ide-series2-export/drivers/ide/ide-taskfile.c
===================================================================
--- linux-ide-series2-export.orig/drivers/ide/ide-taskfile.c 2005-02-05 19:27:08.533573794 +0900
+++ linux-ide-series2-export/drivers/ide/ide-taskfile.c 2005-02-05 19:27:08.985500385 +0900
@@ -735,32 +735,45 @@ abort:
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;
+ u8 args[7];
+ ide_task_t task;
+ task_ioreg_t *regs = task.tfRegister;
+ int ret;
if (copy_from_user(args, p, 7))
return -EFAULT;
- err = ide_wait_cmd_task(drive, argbuf);
- if (copy_to_user(p, argbuf, argsize))
- err = -EFAULT;
- return err;
+
+ memset(&task, 0, sizeof(task));
+
+ regs[IDE_COMMAND_OFFSET] = args[0];
+ regs[IDE_FEATURE_OFFSET] = args[1];
+ regs[IDE_NSECTOR_OFFSET] = args[2];
+ regs[IDE_SECTOR_OFFSET] = args[3];
+ regs[IDE_LCYL_OFFSET] = args[4];
+ regs[IDE_HCYL_OFFSET] = args[5];
+ regs[IDE_SELECT_OFFSET] = args[6];
+
+ task.command_type = IDE_DRIVE_TASK_NO_DATA;
+ task.data_phase = TASKFILE_NO_DATA;
+ task.handler = &task_no_data_intr;
+
+ ret = ide_diag_taskfile(drive, &task, 0, NULL);
+
+ args[0] = regs[IDE_COMMAND_OFFSET];
+ args[1] = regs[IDE_FEATURE_OFFSET];
+ args[2] = regs[IDE_NSECTOR_OFFSET];
+ args[3] = regs[IDE_SECTOR_OFFSET];
+ args[4] = regs[IDE_LCYL_OFFSET];
+ args[5] = regs[IDE_HCYL_OFFSET];
+ args[6] = regs[IDE_SELECT_OFFSET];
+
+ if (copy_to_user(p, args, 7))
+ ret = -EFAULT;
+
+ return ret;
}
/*
next prev parent reply other threads:[~2005-02-05 10:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-05 10:25 [PATCH REPOST 2.6.11-rc2] ide: driver updates (phase 2) Tejun Heo
2005-02-05 10:28 ` [PATCH 2.6.11-rc2 01/09] ide: kill unused pkt_task_t Tejun Heo
2005-02-05 10:28 ` [PATCH 2.6.11-rc2 02/09] ide: ide_init_drive_cmd() now defaults to REQ_DRIVE_TASKFILE Tejun Heo
2005-02-05 10:28 ` [PATCH 2.6.11-rc2 08/09] ide: map ide_cmd_ioctl() to ide_taskfile_ioctl() Tejun Heo
2005-02-05 10:28 ` Tejun Heo [this message]
2005-02-05 10:28 ` [PATCH 2.6.11-rc2 03/09] ide: ide_diag_taskfile() rq initialization fix Tejun Heo
2005-02-05 10:28 ` [PATCH 2.6.11-rc2 09/09] ide: remove REQ_DRIVE_CMD handling Tejun Heo
2005-02-05 10:43 ` Christoph Hellwig
2005-02-05 10:28 ` [PATCH 2.6.11-rc2 04/09] ide: convert REQ_DRIVE_TASK to REQ_DRIVE_TASKFILE Tejun Heo
2005-02-06 19:08 ` Bartlomiej Zolnierkiewicz
2005-02-05 10:28 ` [PATCH 2.6.11-rc2 07/09] ide: convert REQ_DRIVE_CMD " Tejun Heo
2005-02-05 10:28 ` [PATCH 2.6.11-rc2 06/09] ide: remove REQ_DRIVE_TASK handling Tejun Heo
2005-02-05 10:43 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2005-02-05 2:15 [PATCH 2.6.11-rc2] ide: driver updates (phase 2) Tejun Heo
[not found] ` <20050205021556.CFCE41326F9@htj.dyndns.org>
2005-02-06 18:38 ` [PATCH 2.6.11-rc2 05/09] ide: map ide_task_ioctl() to ide_taskfile_ioctl() Bartlomiej Zolnierkiewicz
2005-02-07 5:04 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050205102843.9F9A6132702@htj.dyndns.org \
--to=tj@home-tj.org \
--cc=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®