diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-26 14:13:12 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-26 14:13:12 -0500 |
commit | 34f5d5ae35240a11846875d76eb935875ab0c366 (patch) | |
tree | 4090df8cd81e97d8b86deebf83420426316dfa6b | |
parent | 0455fcc821e87d362f2047922c59c0f378a122b5 (diff) |
ide: switch set_xfer_rate() to use REQ_TYPE_ATA_TASKFILE requests
Based on the earlier work by Tejun Heo.
Switch set_xfer_rate() to use REQ_TYPE_ATA_TASKFILE requests
and make ide_wait_cmd() static.
There should be no functionality changes caused by this patch.
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/ide-proc.c | 12 | ||||
-rw-r--r-- | drivers/ide/ide-taskfile.c | 3 | ||||
-rw-r--r-- | include/linux/ide.h | 8 |
3 files changed, 11 insertions, 12 deletions
diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c index a4007d30da52..aa663e7f46f2 100644 --- a/drivers/ide/ide-proc.c +++ b/drivers/ide/ide-proc.c | |||
@@ -346,14 +346,20 @@ static int ide_write_setting(ide_drive_t *drive, ide_settings_t *setting, int va | |||
346 | 346 | ||
347 | static int set_xfer_rate (ide_drive_t *drive, int arg) | 347 | static int set_xfer_rate (ide_drive_t *drive, int arg) |
348 | { | 348 | { |
349 | ide_task_t task; | ||
349 | int err; | 350 | int err; |
350 | 351 | ||
351 | if (arg < 0 || arg > 70) | 352 | if (arg < 0 || arg > 70) |
352 | return -EINVAL; | 353 | return -EINVAL; |
353 | 354 | ||
354 | err = ide_wait_cmd(drive, | 355 | memset(&task, 0, sizeof(task)); |
355 | WIN_SETFEATURES, (u8) arg, | 356 | task.tf.command = WIN_SETFEATURES; |
356 | SETFEATURES_XFER, 0, NULL); | 357 | task.tf.feature = SETFEATURES_XFER; |
358 | task.tf.nsect = (u8)arg; | ||
359 | task.tf_flags = IDE_TFLAG_OUT_FEATURE | IDE_TFLAG_OUT_NSECT | | ||
360 | IDE_TFLAG_IN_NSECT; | ||
361 | |||
362 | err = ide_no_data_taskfile(drive, &task); | ||
357 | 363 | ||
358 | if (!err && arg) { | 364 | if (!err && arg) { |
359 | ide_set_xfer_rate(drive, (u8) arg); | 365 | ide_set_xfer_rate(drive, (u8) arg); |
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 94046509f004..a1796cf5835c 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -750,7 +750,8 @@ abort: | |||
750 | } | 750 | } |
751 | #endif | 751 | #endif |
752 | 752 | ||
753 | int ide_wait_cmd (ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, u8 sectors, u8 *buf) | 753 | static int ide_wait_cmd(ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, |
754 | u8 sectors, u8 *buf) | ||
754 | { | 755 | { |
755 | struct request rq; | 756 | struct request rq; |
756 | u8 buffer[4]; | 757 | u8 buffer[4]; |
diff --git a/include/linux/ide.h b/include/linux/ide.h index c889a6e91c5c..27cb39de2ae2 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -870,14 +870,6 @@ extern int ide_do_drive_cmd(ide_drive_t *, struct request *, ide_action_t); | |||
870 | 870 | ||
871 | extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); | 871 | extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); |
872 | 872 | ||
873 | /* | ||
874 | * Issue ATA command and wait for completion. | ||
875 | * Use for implementing commands in kernel | ||
876 | * | ||
877 | * (ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, u8 sectors, u8 *buf) | ||
878 | */ | ||
879 | extern int ide_wait_cmd(ide_drive_t *, u8, u8, u8, u8, u8 *); | ||
880 | |||
881 | enum { | 873 | enum { |
882 | IDE_TFLAG_LBA48 = (1 << 0), | 874 | IDE_TFLAG_LBA48 = (1 << 0), |
883 | IDE_TFLAG_NO_SELECT_MASK = (1 << 1), | 875 | IDE_TFLAG_NO_SELECT_MASK = (1 << 1), |