diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-26 14:13:10 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-26 14:13:10 -0500 |
commit | 657cc1a8f6cd6a9e2974cba3af9fccd8c25e06ad (patch) | |
tree | 4f1542ec2738993193ac4c02cba78aa4ed981f80 /drivers/ide/ide-disk.c | |
parent | 3687221f28058c40e2c57a286decd0caeac67382 (diff) |
ide: set IDE_TFLAG_IN_* flags before queuing/executing command
* Add IDE_TFLAG_{HOB,TF,DEVICE} defines.
* Set IDE_TFLAG_IN_* flags in {do_rw,ide_no_data,ide_raw}_taskfile() users.
* Remove no longer needed ->tf_flags setup from ide_end_drive_cmd().
There should be no functionality changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-disk.c')
-rw-r--r-- | drivers/ide/ide-disk.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 041be43a62cb..027bf4397592 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c | |||
@@ -201,7 +201,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, | |||
201 | 201 | ||
202 | memset(&task, 0, sizeof(task)); | 202 | memset(&task, 0, sizeof(task)); |
203 | task.tf_flags = IDE_TFLAG_NO_SELECT_MASK; /* FIXME? */ | 203 | task.tf_flags = IDE_TFLAG_NO_SELECT_MASK; /* FIXME? */ |
204 | task.tf_flags |= (IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE); | 204 | task.tf_flags |= (IDE_TFLAG_TF | IDE_TFLAG_DEVICE); |
205 | 205 | ||
206 | if (drive->select.b.lba) { | 206 | if (drive->select.b.lba) { |
207 | if (lba48) { | 207 | if (lba48) { |
@@ -220,7 +220,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq, | |||
220 | tf->lbam = (u8)(block >> 8); | 220 | tf->lbam = (u8)(block >> 8); |
221 | tf->lbah = (u8)(block >> 16); | 221 | tf->lbah = (u8)(block >> 16); |
222 | 222 | ||
223 | task.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB); | 223 | task.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_HOB); |
224 | } else { | 224 | } else { |
225 | tf->nsect = nsectors & 0xff; | 225 | tf->nsect = nsectors & 0xff; |
226 | tf->lbal = block; | 226 | tf->lbal = block; |
@@ -314,9 +314,9 @@ static u64 idedisk_read_native_max_address(ide_drive_t *drive, int lba48) | |||
314 | else | 314 | else |
315 | tf->command = WIN_READ_NATIVE_MAX; | 315 | tf->command = WIN_READ_NATIVE_MAX; |
316 | tf->device = ATA_LBA; | 316 | tf->device = ATA_LBA; |
317 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | 317 | args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; |
318 | if (lba48) | 318 | if (lba48) |
319 | args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB); | 319 | args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_HOB); |
320 | /* submit command request */ | 320 | /* submit command request */ |
321 | ide_no_data_taskfile(drive, &args); | 321 | ide_no_data_taskfile(drive, &args); |
322 | 322 | ||
@@ -353,9 +353,9 @@ static u64 idedisk_set_max_address(ide_drive_t *drive, u64 addr_req, int lba48) | |||
353 | tf->command = WIN_SET_MAX; | 353 | tf->command = WIN_SET_MAX; |
354 | } | 354 | } |
355 | tf->device |= ATA_LBA; | 355 | tf->device |= ATA_LBA; |
356 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | 356 | args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; |
357 | if (lba48) | 357 | if (lba48) |
358 | args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB); | 358 | args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_HOB); |
359 | /* submit command request */ | 359 | /* submit command request */ |
360 | ide_no_data_taskfile(drive, &args); | 360 | ide_no_data_taskfile(drive, &args); |
361 | /* if OK, compute maximum address value */ | 361 | /* if OK, compute maximum address value */ |
@@ -495,7 +495,7 @@ static int smart_enable(ide_drive_t *drive) | |||
495 | tf->lbam = SMART_LCYL_PASS; | 495 | tf->lbam = SMART_LCYL_PASS; |
496 | tf->lbah = SMART_HCYL_PASS; | 496 | tf->lbah = SMART_HCYL_PASS; |
497 | tf->command = WIN_SMART; | 497 | tf->command = WIN_SMART; |
498 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | 498 | args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; |
499 | return ide_no_data_taskfile(drive, &args); | 499 | return ide_no_data_taskfile(drive, &args); |
500 | } | 500 | } |
501 | 501 | ||
@@ -510,7 +510,7 @@ static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 sub_cmd) | |||
510 | tf->lbam = SMART_LCYL_PASS; | 510 | tf->lbam = SMART_LCYL_PASS; |
511 | tf->lbah = SMART_HCYL_PASS; | 511 | tf->lbah = SMART_HCYL_PASS; |
512 | tf->command = WIN_SMART; | 512 | tf->command = WIN_SMART; |
513 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | 513 | args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; |
514 | args.data_phase = TASKFILE_IN; | 514 | args.data_phase = TASKFILE_IN; |
515 | (void) smart_enable(drive); | 515 | (void) smart_enable(drive); |
516 | return ide_raw_taskfile(drive, &args, buf, 1); | 516 | return ide_raw_taskfile(drive, &args, buf, 1); |
@@ -689,7 +689,7 @@ static int write_cache(ide_drive_t *drive, int arg) | |||
689 | args.tf.feature = arg ? | 689 | args.tf.feature = arg ? |
690 | SETFEATURES_EN_WCACHE : SETFEATURES_DIS_WCACHE; | 690 | SETFEATURES_EN_WCACHE : SETFEATURES_DIS_WCACHE; |
691 | args.tf.command = WIN_SETFEATURES; | 691 | args.tf.command = WIN_SETFEATURES; |
692 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | 692 | args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; |
693 | err = ide_no_data_taskfile(drive, &args); | 693 | err = ide_no_data_taskfile(drive, &args); |
694 | if (err == 0) | 694 | if (err == 0) |
695 | drive->wcache = arg; | 695 | drive->wcache = arg; |
@@ -709,7 +709,7 @@ static int do_idedisk_flushcache (ide_drive_t *drive) | |||
709 | args.tf.command = WIN_FLUSH_CACHE_EXT; | 709 | args.tf.command = WIN_FLUSH_CACHE_EXT; |
710 | else | 710 | else |
711 | args.tf.command = WIN_FLUSH_CACHE; | 711 | args.tf.command = WIN_FLUSH_CACHE; |
712 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | 712 | args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; |
713 | return ide_no_data_taskfile(drive, &args); | 713 | return ide_no_data_taskfile(drive, &args); |
714 | } | 714 | } |
715 | 715 | ||
@@ -724,7 +724,7 @@ static int set_acoustic (ide_drive_t *drive, int arg) | |||
724 | args.tf.feature = arg ? SETFEATURES_EN_AAM : SETFEATURES_DIS_AAM; | 724 | args.tf.feature = arg ? SETFEATURES_EN_AAM : SETFEATURES_DIS_AAM; |
725 | args.tf.nsect = arg; | 725 | args.tf.nsect = arg; |
726 | args.tf.command = WIN_SETFEATURES; | 726 | args.tf.command = WIN_SETFEATURES; |
727 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | 727 | args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; |
728 | ide_no_data_taskfile(drive, &args); | 728 | ide_no_data_taskfile(drive, &args); |
729 | drive->acoustic = arg; | 729 | drive->acoustic = arg; |
730 | return 0; | 730 | return 0; |
@@ -975,7 +975,7 @@ static int idedisk_set_doorlock(ide_drive_t *drive, int on) | |||
975 | 975 | ||
976 | memset(&task, 0, sizeof(task)); | 976 | memset(&task, 0, sizeof(task)); |
977 | task.tf.command = on ? WIN_DOORLOCK : WIN_DOORUNLOCK; | 977 | task.tf.command = on ? WIN_DOORLOCK : WIN_DOORUNLOCK; |
978 | task.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | 978 | task.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE; |
979 | 979 | ||
980 | return ide_no_data_taskfile(drive, &task); | 980 | return ide_no_data_taskfile(drive, &task); |
981 | } | 981 | } |