ide: add PC_FLAG_DRQ_INTERRUPT pc flag

Add PC_FLAG_DRQ_INTERRUPT pc flag, set it in ide*_do_request()
and check for it (instead of checking for IDE*_FLAG_DRQ_INTERRUPT)
in ide*_issue_pc().  This is a preparation for adding generic
ide_issue_pc() helper.

There should be no functional changes caused by this patch.

Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 4cc19689
...@@ -619,7 +619,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive, ...@@ -619,7 +619,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive,
ide_pktcmd_tf_load(drive, IDE_TFLAG_OUT_DEVICE, bcount, dma); ide_pktcmd_tf_load(drive, IDE_TFLAG_OUT_DEVICE, bcount, dma);
if (floppy->flags & IDEFLOPPY_FLAG_DRQ_INTERRUPT) { if (pc->flags & PC_FLAG_DRQ_INTERRUPT) {
/* Issue the packet command */ /* Issue the packet command */
ide_execute_command(drive, WIN_PACKETCMD, ide_execute_command(drive, WIN_PACKETCMD,
&idefloppy_transfer_pc1, &idefloppy_transfer_pc1,
...@@ -800,6 +800,9 @@ static ide_startstop_t idefloppy_do_request(ide_drive_t *drive, ...@@ -800,6 +800,9 @@ static ide_startstop_t idefloppy_do_request(ide_drive_t *drive,
return ide_stopped; return ide_stopped;
} }
if (floppy->flags & IDEFLOPPY_FLAG_DRQ_INTERRUPT)
pc->flags |= PC_FLAG_DRQ_INTERRUPT;
if (floppy->flags & IDEFLOPPY_FLAG_ZIP_DRIVE) if (floppy->flags & IDEFLOPPY_FLAG_ZIP_DRIVE)
pc->flags |= PC_FLAG_ZIP_DRIVE; pc->flags |= PC_FLAG_ZIP_DRIVE;
......
...@@ -1020,7 +1020,7 @@ static ide_startstop_t idetape_issue_pc(ide_drive_t *drive, ...@@ -1020,7 +1020,7 @@ static ide_startstop_t idetape_issue_pc(ide_drive_t *drive,
ide_pktcmd_tf_load(drive, IDE_TFLAG_OUT_DEVICE, bcount, dma_ok); ide_pktcmd_tf_load(drive, IDE_TFLAG_OUT_DEVICE, bcount, dma_ok);
if (test_bit(IDETAPE_FLAG_DRQ_INTERRUPT, &tape->flags)) { if (pc->flags & PC_FLAG_DRQ_INTERRUPT) {
ide_execute_command(drive, WIN_PACKETCMD, &idetape_transfer_pc, ide_execute_command(drive, WIN_PACKETCMD, &idetape_transfer_pc,
IDETAPE_WAIT_CMD, NULL); IDETAPE_WAIT_CMD, NULL);
return ide_started; return ide_started;
...@@ -1143,8 +1143,10 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive, ...@@ -1143,8 +1143,10 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
} }
/* Retry a failed packet command */ /* Retry a failed packet command */
if (tape->failed_pc && tape->pc->c[0] == REQUEST_SENSE) if (tape->failed_pc && tape->pc->c[0] == REQUEST_SENSE) {
return idetape_issue_pc(drive, tape->failed_pc); pc = tape->failed_pc;
goto out;
}
if (postponed_rq != NULL) if (postponed_rq != NULL)
if (rq != postponed_rq) { if (rq != postponed_rq) {
...@@ -1216,6 +1218,9 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive, ...@@ -1216,6 +1218,9 @@ static ide_startstop_t idetape_do_request(ide_drive_t *drive,
} }
BUG(); BUG();
out: out:
if (test_bit(IDETAPE_FLAG_DRQ_INTERRUPT, &tape->flags))
pc->flags |= PC_FLAG_DRQ_INTERRUPT;
return idetape_issue_pc(drive, pc); return idetape_issue_pc(drive, pc);
} }
......
...@@ -525,7 +525,7 @@ static ide_startstop_t idescsi_issue_pc(ide_drive_t *drive, ...@@ -525,7 +525,7 @@ static ide_startstop_t idescsi_issue_pc(ide_drive_t *drive,
ide_pktcmd_tf_load(drive, 0, bcount, dma); ide_pktcmd_tf_load(drive, 0, bcount, dma);
if (test_bit(IDESCSI_DRQ_INTERRUPT, &scsi->flags)) { if (pc->flags & PC_FLAG_DRQ_INTERRUPT) {
ide_execute_command(drive, WIN_PACKETCMD, &idescsi_transfer_pc, ide_execute_command(drive, WIN_PACKETCMD, &idescsi_transfer_pc,
get_timeout(pc), idescsi_expiry); get_timeout(pc), idescsi_expiry);
return ide_started; return ide_started;
...@@ -548,6 +548,10 @@ static ide_startstop_t idescsi_do_request (ide_drive_t *drive, struct request *r ...@@ -548,6 +548,10 @@ static ide_startstop_t idescsi_do_request (ide_drive_t *drive, struct request *r
if (blk_sense_request(rq) || blk_special_request(rq)) { if (blk_sense_request(rq) || blk_special_request(rq)) {
struct ide_atapi_pc *pc = (struct ide_atapi_pc *)rq->special; struct ide_atapi_pc *pc = (struct ide_atapi_pc *)rq->special;
idescsi_scsi_t *scsi = drive_to_idescsi(drive);
if (test_bit(IDESCSI_DRQ_INTERRUPT, &scsi->flags))
pc->flags |= PC_FLAG_DRQ_INTERRUPT;
if (drive->using_dma && !idescsi_map_sg(drive, pc)) if (drive->using_dma && !idescsi_map_sg(drive, pc))
pc->flags |= PC_FLAG_DMA_OK; pc->flags |= PC_FLAG_DMA_OK;
......
...@@ -608,6 +608,7 @@ enum { ...@@ -608,6 +608,7 @@ enum {
/* command timed out */ /* command timed out */
PC_FLAG_TIMEDOUT = (1 << 7), PC_FLAG_TIMEDOUT = (1 << 7),
PC_FLAG_ZIP_DRIVE = (1 << 8), PC_FLAG_ZIP_DRIVE = (1 << 8),
PC_FLAG_DRQ_INTERRUPT = (1 << 9),
}; };
struct ide_atapi_pc { struct ide_atapi_pc {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment