Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 125162
b: refs/heads/master
c: d77612a
h: refs/heads/master
v: v3
  • Loading branch information
Borislav Petkov authored and Bartlomiej Zolnierkiewicz committed Jan 2, 2009
1 parent 22b2bac commit 863c24f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: def860d061d0fcab7fbbe193c0b8b8f0b9b4c828
refs/heads/master: d77612ab0ad7515623b084b952dfefd547073ada
36 changes: 20 additions & 16 deletions trunk/drivers/ide/ide-atapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,39 +564,43 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)

ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout)
{
struct ide_atapi_pc *pc = drive->pc;
struct ide_atapi_pc *pc;
ide_hwif_t *hwif = drive->hwif;
ide_expiry_t *expiry = NULL;
u32 tf_flags;
u16 bcount;

/* We haven't transferred any data yet */
pc->xferred = 0;
pc->cur_pos = pc->buf;

if (dev_is_idecd(drive)) {
tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL;
bcount = ide_cd_get_xferlen(hwif->hwgroup->rq);
expiry = ide_cd_expiry;

if (drive->dma)
drive->dma = !hwif->dma_ops->dma_setup(drive);
} else {
pc = drive->pc;

/* We haven't transferred any data yet */
pc->xferred = 0;
pc->cur_pos = pc->buf;

tf_flags = IDE_TFLAG_OUT_DEVICE;
bcount = ((drive->media == ide_tape) ?
pc->req_xfer :
min(pc->req_xfer, 63 * 1024));
}

if (pc->flags & PC_FLAG_DMA_ERROR) {
pc->flags &= ~PC_FLAG_DMA_ERROR;
ide_dma_off(drive);
}
if (pc->flags & PC_FLAG_DMA_ERROR) {
pc->flags &= ~PC_FLAG_DMA_ERROR;
ide_dma_off(drive);
}

if (((pc->flags & PC_FLAG_DMA_OK) &&
(drive->dev_flags & IDE_DFLAG_USING_DMA)) ||
drive->dma)
drive->dma = !hwif->dma_ops->dma_setup(drive);
if ((pc->flags & PC_FLAG_DMA_OK) &&
(drive->dev_flags & IDE_DFLAG_USING_DMA))
drive->dma = !hwif->dma_ops->dma_setup(drive);

if (!drive->dma)
pc->flags &= ~PC_FLAG_DMA_OK;
if (!drive->dma)
pc->flags &= ~PC_FLAG_DMA_OK;
}

ide_pktcmd_tf_load(drive, tf_flags, bcount, drive->dma);

Expand Down

0 comments on commit 863c24f

Please sign in to comment.