diff options
Diffstat (limited to 'drivers/ide/ide-io.c')
| -rw-r--r-- | drivers/ide/ide-io.c | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 18ac1bd0811f..48c38b68bd36 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
| @@ -637,32 +637,26 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive) | |||
| 637 | return ide_stopped; | 637 | return ide_stopped; |
| 638 | } | 638 | } |
| 639 | 639 | ||
| 640 | static void ide_init_specify_cmd(ide_drive_t *drive, ide_task_t *task) | 640 | static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf) |
| 641 | { | 641 | { |
| 642 | task->tf.nsect = drive->sect; | 642 | tf->nsect = drive->sect; |
| 643 | task->tf.lbal = drive->sect; | 643 | tf->lbal = drive->sect; |
| 644 | task->tf.lbam = drive->cyl; | 644 | tf->lbam = drive->cyl; |
| 645 | task->tf.lbah = drive->cyl >> 8; | 645 | tf->lbah = drive->cyl >> 8; |
| 646 | task->tf.device = ((drive->head - 1) | drive->select.all) & ~ATA_LBA; | 646 | tf->device = ((drive->head - 1) | drive->select.all) & ~ATA_LBA; |
| 647 | task->tf.command = WIN_SPECIFY; | 647 | tf->command = WIN_SPECIFY; |
| 648 | |||
| 649 | task->handler = &set_geometry_intr; | ||
| 650 | } | 648 | } |
| 651 | 649 | ||
| 652 | static void ide_init_restore_cmd(ide_drive_t *drive, ide_task_t *task) | 650 | static void ide_tf_set_restore_cmd(ide_drive_t *drive, struct ide_taskfile *tf) |
| 653 | { | 651 | { |
| 654 | task->tf.nsect = drive->sect; | 652 | tf->nsect = drive->sect; |
| 655 | task->tf.command = WIN_RESTORE; | 653 | tf->command = WIN_RESTORE; |
| 656 | |||
| 657 | task->handler = &recal_intr; | ||
| 658 | } | 654 | } |
| 659 | 655 | ||
| 660 | static void ide_init_setmult_cmd(ide_drive_t *drive, ide_task_t *task) | 656 | static void ide_tf_set_setmult_cmd(ide_drive_t *drive, struct ide_taskfile *tf) |
| 661 | { | 657 | { |
| 662 | task->tf.nsect = drive->mult_req; | 658 | tf->nsect = drive->mult_req; |
| 663 | task->tf.command = WIN_SETMULT; | 659 | tf->command = WIN_SETMULT; |
| 664 | |||
| 665 | task->handler = &set_multmode_intr; | ||
| 666 | } | 660 | } |
| 667 | 661 | ||
| 668 | static ide_startstop_t ide_disk_special(ide_drive_t *drive) | 662 | static ide_startstop_t ide_disk_special(ide_drive_t *drive) |
| @@ -675,15 +669,15 @@ static ide_startstop_t ide_disk_special(ide_drive_t *drive) | |||
| 675 | 669 | ||
| 676 | if (s->b.set_geometry) { | 670 | if (s->b.set_geometry) { |
| 677 | s->b.set_geometry = 0; | 671 | s->b.set_geometry = 0; |
| 678 | ide_init_specify_cmd(drive, &args); | 672 | ide_tf_set_specify_cmd(drive, &args.tf); |
| 679 | } else if (s->b.recalibrate) { | 673 | } else if (s->b.recalibrate) { |
| 680 | s->b.recalibrate = 0; | 674 | s->b.recalibrate = 0; |
| 681 | ide_init_restore_cmd(drive, &args); | 675 | ide_tf_set_restore_cmd(drive, &args.tf); |
| 682 | } else if (s->b.set_multmode) { | 676 | } else if (s->b.set_multmode) { |
| 683 | s->b.set_multmode = 0; | 677 | s->b.set_multmode = 0; |
| 684 | if (drive->mult_req > drive->id->max_multsect) | 678 | if (drive->mult_req > drive->id->max_multsect) |
| 685 | drive->mult_req = drive->id->max_multsect; | 679 | drive->mult_req = drive->id->max_multsect; |
| 686 | ide_init_setmult_cmd(drive, &args); | 680 | ide_tf_set_setmult_cmd(drive, &args.tf); |
| 687 | } else if (s->all) { | 681 | } else if (s->all) { |
| 688 | int special = s->all; | 682 | int special = s->all; |
| 689 | s->all = 0; | 683 | s->all = 0; |
| @@ -691,7 +685,8 @@ static ide_startstop_t ide_disk_special(ide_drive_t *drive) | |||
| 691 | return ide_stopped; | 685 | return ide_stopped; |
| 692 | } | 686 | } |
| 693 | 687 | ||
| 694 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE; | 688 | args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE | |
| 689 | IDE_TFLAG_CUSTOM_HANDLER; | ||
| 695 | 690 | ||
| 696 | do_rw_taskfile(drive, &args); | 691 | do_rw_taskfile(drive, &args); |
| 697 | 692 | ||
