diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:07 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:07 -0500 |
commit | 74095a91ed02f6727b62d4416be00a041f2d7436 (patch) | |
tree | 033cc52877103739c5b55a2cfdd3bfaf6996d5d3 /drivers/ide/ide-io.c | |
parent | 9a3c49be5c5f7388eefb712be9a383904140532e (diff) |
ide: use do_rw_taskfile() in flagged_taskfile()
Based on the earlier work by Tejun Heo.
* Move setting IDE_TFLAG_LBA48 taskfile flag from do_rw_taskfile()
function to the callers.
* Add IDE_TFLAG_FLAGGED taskfile flag for flagged taskfiles coming
from ide_taskfile_ioctl(). Check it instead of ->tf_out_flags.all.
* Add IDE_TFLAG_OUT_DATA taskfile flag to indicate the need to load
IDE data register in ide_tf_load().
* Add IDE_TFLAG_OUT_* taskfile flags to indicate the need to load
particular IDE taskfile registers in ide_tf_load().
* Update do_rw_taskfile() and ide_tf_load() users to set respective
IDE_TFLAG_OUT_* taksfile flags.
* Add task_dma_ok() helper.
* Use IDE_TFLAG_FLAGGED taskfile flag to select HIHI mask in ide_tf_load().
* Use do_rw_taskfile() in flagged_taskfile().
* Remove no longer needed 'tf_out_flags' field from ide_task_t.
There should be no functionality changes caused by this patch.
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r-- | drivers/ide/ide-io.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index dc984c5b0d13..33458fe7f490 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -192,15 +192,11 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * | |||
192 | args->tf.command = WIN_FLUSH_CACHE_EXT; | 192 | args->tf.command = WIN_FLUSH_CACHE_EXT; |
193 | else | 193 | else |
194 | args->tf.command = WIN_FLUSH_CACHE; | 194 | args->tf.command = WIN_FLUSH_CACHE; |
195 | args->command_type = IDE_DRIVE_TASK_NO_DATA; | 195 | goto out_do_tf; |
196 | args->handler = &task_no_data_intr; | ||
197 | return do_rw_taskfile(drive, args); | ||
198 | 196 | ||
199 | case idedisk_pm_standby: /* Suspend step 2 (standby) */ | 197 | case idedisk_pm_standby: /* Suspend step 2 (standby) */ |
200 | args->tf.command = WIN_STANDBYNOW1; | 198 | args->tf.command = WIN_STANDBYNOW1; |
201 | args->command_type = IDE_DRIVE_TASK_NO_DATA; | 199 | goto out_do_tf; |
202 | args->handler = &task_no_data_intr; | ||
203 | return do_rw_taskfile(drive, args); | ||
204 | 200 | ||
205 | case idedisk_pm_restore_pio: /* Resume step 1 (restore PIO) */ | 201 | case idedisk_pm_restore_pio: /* Resume step 1 (restore PIO) */ |
206 | ide_set_max_pio(drive); | 202 | ide_set_max_pio(drive); |
@@ -215,9 +211,7 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * | |||
215 | 211 | ||
216 | case idedisk_pm_idle: /* Resume step 2 (idle) */ | 212 | case idedisk_pm_idle: /* Resume step 2 (idle) */ |
217 | args->tf.command = WIN_IDLEIMMEDIATE; | 213 | args->tf.command = WIN_IDLEIMMEDIATE; |
218 | args->command_type = IDE_DRIVE_TASK_NO_DATA; | 214 | goto out_do_tf; |
219 | args->handler = task_no_data_intr; | ||
220 | return do_rw_taskfile(drive, args); | ||
221 | 215 | ||
222 | case ide_pm_restore_dma: /* Resume step 3 (restore DMA) */ | 216 | case ide_pm_restore_dma: /* Resume step 3 (restore DMA) */ |
223 | /* | 217 | /* |
@@ -236,6 +230,14 @@ static ide_startstop_t ide_start_power_step(ide_drive_t *drive, struct request * | |||
236 | } | 230 | } |
237 | pm->pm_step = ide_pm_state_completed; | 231 | pm->pm_step = ide_pm_state_completed; |
238 | return ide_stopped; | 232 | return ide_stopped; |
233 | |||
234 | out_do_tf: | ||
235 | args->tf_flags = IDE_TFLAG_OUT_TF; | ||
236 | if (drive->addressing == 1) | ||
237 | args->tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB); | ||
238 | args->command_type = IDE_DRIVE_TASK_NO_DATA; | ||
239 | args->handler = task_no_data_intr; | ||
240 | return do_rw_taskfile(drive, args); | ||
239 | } | 241 | } |
240 | 242 | ||
241 | /** | 243 | /** |
@@ -730,6 +732,10 @@ static ide_startstop_t ide_disk_special(ide_drive_t *drive) | |||
730 | return ide_stopped; | 732 | return ide_stopped; |
731 | } | 733 | } |
732 | 734 | ||
735 | args.tf_flags = IDE_TFLAG_OUT_TF; | ||
736 | if (drive->addressing == 1) | ||
737 | args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB); | ||
738 | |||
733 | do_rw_taskfile(drive, &args); | 739 | do_rw_taskfile(drive, &args); |
734 | 740 | ||
735 | return ide_started; | 741 | return ide_started; |
@@ -883,8 +889,13 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, | |||
883 | break; | 889 | break; |
884 | } | 890 | } |
885 | 891 | ||
886 | if (args->tf_out_flags.all != 0) | 892 | if (args->tf_flags & IDE_TFLAG_FLAGGED) |
887 | return flagged_taskfile(drive, args); | 893 | return flagged_taskfile(drive, args); |
894 | |||
895 | args->tf_flags |= IDE_TFLAG_OUT_TF; | ||
896 | if (drive->addressing == 1) | ||
897 | args->tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB); | ||
898 | |||
888 | return do_rw_taskfile(drive, args); | 899 | return do_rw_taskfile(drive, args); |
889 | } else if (rq->cmd_type == REQ_TYPE_ATA_TASK) { | 900 | } else if (rq->cmd_type == REQ_TYPE_ATA_TASK) { |
890 | u8 *args = rq->buffer; | 901 | u8 *args = rq->buffer; |