aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-atapi.c
diff options
context:
space:
mode:
authorBorislav Petkov <petkovbb@googlemail.com>2009-01-02 10:12:52 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-01-02 10:12:52 -0500
commited48554fad7091b9613b967462f082bf1a9cb035 (patch)
treede4c62e933d3ecd3446cd561bc240afe2a353c37 /drivers/ide/ide-atapi.c
parent991cb26a6ad287c3bc6555c41e830590a23910c4 (diff)
ide-atapi: combine drive-specific assignments
There should be no functionality change resulting from this patch. Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-atapi.c')
-rw-r--r--drivers/ide/ide-atapi.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 33a15343e8bb..b6e0aac68938 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -551,18 +551,24 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout,
551 struct ide_atapi_pc *pc = drive->pc; 551 struct ide_atapi_pc *pc = drive->pc;
552 ide_hwif_t *hwif = drive->hwif; 552 ide_hwif_t *hwif = drive->hwif;
553 u32 tf_flags; 553 u32 tf_flags;
554 u16 bcount; 554 u16 bcount = 0;
555 u8 scsi = !!(drive->dev_flags & IDE_DFLAG_SCSI); 555 u8 scsi = !!(drive->dev_flags & IDE_DFLAG_SCSI);
556 556
557 /* We haven't transferred any data yet */ 557 /* We haven't transferred any data yet */
558 pc->xferred = 0; 558 pc->xferred = 0;
559 pc->cur_pos = pc->buf; 559 pc->cur_pos = pc->buf;
560 560
561 /* Request to transfer the entire buffer at once */ 561 if (dev_is_idecd(drive)) {
562 if (drive->media == ide_tape && scsi == 0) 562 tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL;
563 bcount = pc->req_xfer; 563 } else if (scsi) {
564 else 564 tf_flags = 0;
565 bcount = min(pc->req_xfer, 63 * 1024); 565 bcount = min(pc->req_xfer, 63 * 1024);
566 } else {
567 tf_flags = IDE_TFLAG_OUT_DEVICE;
568 bcount = ((drive->media == ide_tape) ?
569 pc->req_xfer :
570 min(pc->req_xfer, 63 * 1024));
571 }
566 572
567 if (pc->flags & PC_FLAG_DMA_ERROR) { 573 if (pc->flags & PC_FLAG_DMA_ERROR) {
568 pc->flags &= ~PC_FLAG_DMA_ERROR; 574 pc->flags &= ~PC_FLAG_DMA_ERROR;
@@ -581,13 +587,6 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout,
581 if (!drive->dma) 587 if (!drive->dma)
582 pc->flags &= ~PC_FLAG_DMA_OK; 588 pc->flags &= ~PC_FLAG_DMA_OK;
583 589
584 if (scsi)
585 tf_flags = 0;
586 else if (dev_is_idecd(drive))
587 tf_flags = IDE_TFLAG_OUT_NSECT | IDE_TFLAG_OUT_LBAL;
588 else
589 tf_flags = IDE_TFLAG_OUT_DEVICE;
590
591 ide_pktcmd_tf_load(drive, tf_flags, bcount, drive->dma); 590 ide_pktcmd_tf_load(drive, tf_flags, bcount, drive->dma);
592 591
593 /* Issue the packet command */ 592 /* Issue the packet command */