From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: linux-ide@vger.kernel.org
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 7/9] ide: move ide_do_park_unpark() to ide-park.c
Date: Thu, 15 Jan 2009 21:01:22 +0100 [thread overview]
Message-ID: <20090115200122.17294.13465.sendpatchset@localhost.localdomain> (raw)
In-Reply-To: <20090115200032.17294.84745.sendpatchset@localhost.localdomain>
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: move ide_do_park_unpark() to ide-park.c
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
drivers/ide/ide-io.c | 24 ------------------------
drivers/ide/ide-park.c | 25 +++++++++++++++++++++++++
include/linux/ide.h | 2 ++
3 files changed, 27 insertions(+), 24 deletions(-)
Index: b/drivers/ide/ide-io.c
===================================================================
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -524,30 +524,6 @@ static ide_startstop_t ide_do_devset(ide
return ide_stopped;
}
-static ide_startstop_t ide_do_park_unpark(ide_drive_t *drive, struct request *rq)
-{
- ide_task_t task;
- struct ide_taskfile *tf = &task.tf;
-
- memset(&task, 0, sizeof(task));
- if (rq->cmd[0] == REQ_PARK_HEADS) {
- drive->sleep = *(unsigned long *)rq->special;
- drive->dev_flags |= IDE_DFLAG_SLEEPING;
- tf->command = ATA_CMD_IDLEIMMEDIATE;
- tf->feature = 0x44;
- tf->lbal = 0x4c;
- tf->lbam = 0x4e;
- tf->lbah = 0x55;
- task.tf_flags |= IDE_TFLAG_CUSTOM_HANDLER;
- } else /* cmd == REQ_UNPARK_HEADS */
- tf->command = ATA_CMD_CHK_POWER;
-
- task.tf_flags |= IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
- task.rq = rq;
- drive->hwif->data_phase = task.data_phase = TASKFILE_NO_DATA;
- return do_rw_taskfile(drive, &task);
-}
-
static ide_startstop_t ide_special_rq(ide_drive_t *drive, struct request *rq)
{
u8 cmd = rq->cmd[0];
Index: b/drivers/ide/ide-park.c
===================================================================
--- a/drivers/ide/ide-park.c
+++ b/drivers/ide/ide-park.c
@@ -1,5 +1,6 @@
#include <linux/kernel.h>
#include <linux/ide.h>
+#include <linux/hdreg.h>
#include <linux/jiffies.h>
#include <linux/blkdev.h>
@@ -60,6 +61,30 @@ out:
return;
}
+ide_startstop_t ide_do_park_unpark(ide_drive_t *drive, struct request *rq)
+{
+ ide_task_t task;
+ struct ide_taskfile *tf = &task.tf;
+
+ memset(&task, 0, sizeof(task));
+ if (rq->cmd[0] == REQ_PARK_HEADS) {
+ drive->sleep = *(unsigned long *)rq->special;
+ drive->dev_flags |= IDE_DFLAG_SLEEPING;
+ tf->command = ATA_CMD_IDLEIMMEDIATE;
+ tf->feature = 0x44;
+ tf->lbal = 0x4c;
+ tf->lbam = 0x4e;
+ tf->lbah = 0x55;
+ task.tf_flags |= IDE_TFLAG_CUSTOM_HANDLER;
+ } else /* cmd == REQ_UNPARK_HEADS */
+ tf->command = ATA_CMD_CHK_POWER;
+
+ task.tf_flags |= IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
+ task.rq = rq;
+ drive->hwif->data_phase = task.data_phase = TASKFILE_NO_DATA;
+ return do_rw_taskfile(drive, &task);
+}
+
ssize_t ide_park_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1167,6 +1167,8 @@ int ide_busy_sleep(ide_hwif_t *, unsigne
int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
+ide_startstop_t ide_do_park_unpark(ide_drive_t *, struct request *);
+
extern ide_startstop_t ide_do_reset (ide_drive_t *);
extern int ide_devset_execute(ide_drive_t *drive,
next prev parent reply other threads:[~2009-01-15 20:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-15 20:00 [PATCH 0/9] ide: core code housekeeping Bartlomiej Zolnierkiewicz
2009-01-15 20:00 ` [PATCH 1/9] ide: remove stale comments from drive_is_ready() Bartlomiej Zolnierkiewicz
2009-01-15 20:00 ` [PATCH 2/9] ide: unexport ide_devset_execute() Bartlomiej Zolnierkiewicz
2009-01-15 20:00 ` [PATCH 3/9] ide: move drive_is_ready() to ide-io.c Bartlomiej Zolnierkiewicz
2009-01-17 20:22 ` Sergei Shtylyov
2009-01-15 20:01 ` [PATCH 4/9] ide: move ide_dma_timeout_retry() to ide-dma.c Bartlomiej Zolnierkiewicz
2009-01-17 20:20 ` Sergei Shtylyov
2009-01-15 20:01 ` [PATCH 5/9] ide: remove ide_do_drive_cmd() Bartlomiej Zolnierkiewicz
2009-01-17 20:13 ` Sergei Shtylyov
2009-01-15 20:01 ` [PATCH 6/9] ide: factor out processing of special commands from ide_special_rq() Bartlomiej Zolnierkiewicz
2009-01-15 20:01 ` Bartlomiej Zolnierkiewicz [this message]
2009-01-17 20:14 ` [PATCH 7/9] ide: move ide_do_park_unpark() to ide-park.c Sergei Shtylyov
2009-01-15 20:01 ` [PATCH 8/9] ide: move device settings code to ide-devsets.c Bartlomiej Zolnierkiewicz
2009-01-15 20:01 ` [PATCH 9/9] ide: move xfer mode tuning code to ide-xfer-mode.c Bartlomiej Zolnierkiewicz
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=20090115200122.17294.13465.sendpatchset@localhost.localdomain \
--to=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;
as well as URLs for NNTP newsgroup(s).