diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:46 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:46 -0400 |
commit | b788ee9c6561fd9219a503216284d61036a0dc0b (patch) | |
tree | d83198a6c1a38661e60ac7454d1d82889c0472b3 /drivers/ide/ide-tape.c | |
parent | 2298169418f43ba5e0919762a4bab95a1227872a (diff) |
ide: use do_rw_taskfile() for ATA_CMD_PACKET commands
* Pass command to ide_issue_pc() and update ->do_request methods
in ide-{cd,floppy,tape}.c accordingly.
* Convert ide_pktcmd_tf_load() to ide_init_packet_cmd() which
just initializes command structure and use do_rw_taskfile()
to load ATA_CMD_PACKET commands.
While at it:
* Rename ide{floppy,tape}_issue_pc() to ide_{floppy,tape}_issue_pc().
There should be no functional changes caused by this patch.
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-tape.c')
-rw-r--r-- | drivers/ide/ide-tape.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 853d047aa78f..64dfa7458f8d 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -580,7 +580,7 @@ static int ide_tape_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
580 | * | 580 | * |
581 | * The handling will be done in three stages: | 581 | * The handling will be done in three stages: |
582 | * | 582 | * |
583 | * 1. idetape_issue_pc will send the packet command to the drive, and will set | 583 | * 1. ide_tape_issue_pc will send the packet command to the drive, and will set |
584 | * the interrupt handler to ide_pc_intr. | 584 | * the interrupt handler to ide_pc_intr. |
585 | * | 585 | * |
586 | * 2. On each interrupt, ide_pc_intr will be called. This step will be | 586 | * 2. On each interrupt, ide_pc_intr will be called. This step will be |
@@ -608,8 +608,9 @@ static int ide_tape_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
608 | * request. | 608 | * request. |
609 | */ | 609 | */ |
610 | 610 | ||
611 | static ide_startstop_t idetape_issue_pc(ide_drive_t *drive, | 611 | static ide_startstop_t ide_tape_issue_pc(ide_drive_t *drive, |
612 | struct ide_atapi_pc *pc) | 612 | struct ide_cmd *cmd, |
613 | struct ide_atapi_pc *pc) | ||
613 | { | 614 | { |
614 | idetape_tape_t *tape = drive->driver_data; | 615 | idetape_tape_t *tape = drive->driver_data; |
615 | 616 | ||
@@ -654,7 +655,7 @@ static ide_startstop_t idetape_issue_pc(ide_drive_t *drive, | |||
654 | 655 | ||
655 | pc->retries++; | 656 | pc->retries++; |
656 | 657 | ||
657 | return ide_issue_pc(drive); | 658 | return ide_issue_pc(drive, cmd); |
658 | } | 659 | } |
659 | 660 | ||
660 | /* A mode sense command is used to "sense" tape parameters. */ | 661 | /* A mode sense command is used to "sense" tape parameters. */ |
@@ -749,6 +750,7 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive, | |||
749 | idetape_tape_t *tape = drive->driver_data; | 750 | idetape_tape_t *tape = drive->driver_data; |
750 | struct ide_atapi_pc *pc = NULL; | 751 | struct ide_atapi_pc *pc = NULL; |
751 | struct request *postponed_rq = tape->postponed_rq; | 752 | struct request *postponed_rq = tape->postponed_rq; |
753 | struct ide_cmd cmd; | ||
752 | u8 stat; | 754 | u8 stat; |
753 | 755 | ||
754 | debug_log(DBG_SENSE, "sector: %llu, nr_sectors: %lu," | 756 | debug_log(DBG_SENSE, "sector: %llu, nr_sectors: %lu," |
@@ -844,7 +846,14 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive, | |||
844 | BUG(); | 846 | BUG(); |
845 | 847 | ||
846 | out: | 848 | out: |
847 | return idetape_issue_pc(drive, pc); | 849 | memset(&cmd, 0, sizeof(cmd)); |
850 | |||
851 | if (rq_data_dir(rq)) | ||
852 | cmd.tf_flags |= IDE_TFLAG_WRITE; | ||
853 | |||
854 | cmd.rq = rq; | ||
855 | |||
856 | return ide_tape_issue_pc(drive, &cmd, pc); | ||
848 | } | 857 | } |
849 | 858 | ||
850 | /* | 859 | /* |