Commit b16aabc9 authored by Borislav Petkov's avatar Borislav Petkov Committed by Bartlomiej Zolnierkiewicz

ide-atapi: start dma in a drive-specific way

There should be no functionality change resulting from this patch.
Signed-off-by: default avatarBorislav Petkov <petkovbb@gmail.com>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 06cc2778
...@@ -489,7 +489,7 @@ static int ide_delayed_transfer_pc(ide_drive_t *drive) ...@@ -489,7 +489,7 @@ static int ide_delayed_transfer_pc(ide_drive_t *drive)
static ide_startstop_t ide_transfer_pc(ide_drive_t *drive) static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
{ {
struct ide_atapi_pc *pc = drive->pc; struct ide_atapi_pc *uninitialized_var(pc);
ide_hwif_t *hwif = drive->hwif; ide_hwif_t *hwif = drive->hwif;
struct request *rq = hwif->hwgroup->rq; struct request *rq = hwif->hwgroup->rq;
ide_expiry_t *expiry; ide_expiry_t *expiry;
...@@ -518,6 +518,8 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive) ...@@ -518,6 +518,8 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
timeout = rq->timeout; timeout = rq->timeout;
expiry = ide_cd_expiry; expiry = ide_cd_expiry;
} else { } else {
pc = drive->pc;
cmd_len = ATAPI_MIN_CDB_BYTES; cmd_len = ATAPI_MIN_CDB_BYTES;
/* /*
...@@ -550,10 +552,15 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive) ...@@ -550,10 +552,15 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
ide_set_handler(drive, ide_pc_intr, timeout, expiry); ide_set_handler(drive, ide_pc_intr, timeout, expiry);
/* Begin DMA, if necessary */ /* Begin DMA, if necessary */
if (dev_is_idecd(drive)) {
if (drive->dma)
hwif->dma_ops->dma_start(drive);
} else {
if (pc->flags & PC_FLAG_DMA_OK) { if (pc->flags & PC_FLAG_DMA_OK) {
pc->flags |= PC_FLAG_DMA_IN_PROGRESS; pc->flags |= PC_FLAG_DMA_IN_PROGRESS;
hwif->dma_ops->dma_start(drive); hwif->dma_ops->dma_start(drive);
} }
}
/* Send the actual packet */ /* Send the actual packet */
if ((drive->atapi_flags & IDE_AFLAG_ZIP_DRIVE) == 0) if ((drive->atapi_flags & IDE_AFLAG_ZIP_DRIVE) == 0)
......
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