diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-15 15:22:00 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-15 15:22:00 -0400 |
commit | 6bf1641ca1c7554f0da54aaf89788731b541bacc (patch) | |
tree | ce7c371971e68b650d87e67935e460c948f4cb20 /drivers/ide/ide-tape.c | |
parent | 28c7214bd8c2bbd4873b8f1e7f58d86d3731124f (diff) |
ide: add ide_issue_pc() helper
Add generic ide_issue_pc() helper to ide-atapi.c and then
convert ide-{floppy,tape,scsi} device drivers to use it.
There should be no functional changes caused by this patch.
Cc: 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 | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index cba18a675506..7907a1e41918 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -958,10 +958,7 @@ static ide_startstop_t idetape_transfer_pc(ide_drive_t *drive) | |||
958 | static ide_startstop_t idetape_issue_pc(ide_drive_t *drive, | 958 | static ide_startstop_t idetape_issue_pc(ide_drive_t *drive, |
959 | struct ide_atapi_pc *pc) | 959 | struct ide_atapi_pc *pc) |
960 | { | 960 | { |
961 | ide_hwif_t *hwif = drive->hwif; | ||
962 | idetape_tape_t *tape = drive->driver_data; | 961 | idetape_tape_t *tape = drive->driver_data; |
963 | int dma_ok = 0; | ||
964 | u16 bcount; | ||
965 | 962 | ||
966 | if (tape->pc->c[0] == REQUEST_SENSE && | 963 | if (tape->pc->c[0] == REQUEST_SENSE && |
967 | pc->c[0] == REQUEST_SENSE) { | 964 | pc->c[0] == REQUEST_SENSE) { |
@@ -1002,32 +999,9 @@ static ide_startstop_t idetape_issue_pc(ide_drive_t *drive, | |||
1002 | debug_log(DBG_SENSE, "Retry #%d, cmd = %02X\n", pc->retries, pc->c[0]); | 999 | debug_log(DBG_SENSE, "Retry #%d, cmd = %02X\n", pc->retries, pc->c[0]); |
1003 | 1000 | ||
1004 | pc->retries++; | 1001 | pc->retries++; |
1005 | /* We haven't transferred any data yet */ | ||
1006 | pc->xferred = 0; | ||
1007 | pc->cur_pos = pc->buf; | ||
1008 | /* Request to transfer the entire buffer at once */ | ||
1009 | bcount = pc->req_xfer; | ||
1010 | |||
1011 | if (pc->flags & PC_FLAG_DMA_ERROR) { | ||
1012 | pc->flags &= ~PC_FLAG_DMA_ERROR; | ||
1013 | ide_dma_off(drive); | ||
1014 | } | ||
1015 | if ((pc->flags & PC_FLAG_DMA_OK) && drive->using_dma) | ||
1016 | dma_ok = !hwif->dma_ops->dma_setup(drive); | ||
1017 | |||
1018 | if (!dma_ok) | ||
1019 | pc->flags &= ~PC_FLAG_DMA_OK; | ||
1020 | |||
1021 | ide_pktcmd_tf_load(drive, IDE_TFLAG_OUT_DEVICE, bcount, dma_ok); | ||
1022 | 1002 | ||
1023 | if (pc->flags & PC_FLAG_DRQ_INTERRUPT) { | 1003 | return ide_issue_pc(drive, pc, idetape_transfer_pc, |
1024 | ide_execute_command(drive, WIN_PACKETCMD, &idetape_transfer_pc, | 1004 | IDETAPE_WAIT_CMD, NULL); |
1025 | IDETAPE_WAIT_CMD, NULL); | ||
1026 | return ide_started; | ||
1027 | } else { | ||
1028 | ide_execute_pkt_cmd(drive); | ||
1029 | return idetape_transfer_pc(drive); | ||
1030 | } | ||
1031 | } | 1005 | } |
1032 | 1006 | ||
1033 | /* A mode sense command is used to "sense" tape parameters. */ | 1007 | /* A mode sense command is used to "sense" tape parameters. */ |