aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-atapi.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:36 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-10-13 15:39:36 -0400
commit97100fc816badbbc162644cfde7ad39ae9211fb4 (patch)
tree904faf5453c2dea32fa3fde5fda230118f3effda /drivers/ide/ide-atapi.c
parentbe3c096ebdbe3c828aacb5473751a22840753eff (diff)
ide: add device flags
Add 'unsigned long dev_flags' to ide_drive_t and convert bitfields to IDE_DFLAG_* flags. While at it: - IDE_DFLAG_ADDRESSING -> IDE_DFLAG_LBA48 - fixup some comments - remove needless g->flags zeroing from ide*_probe() There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-atapi.c')
-rw-r--r--drivers/ide/ide-atapi.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c
index 2521677e1f48..a1d8c3557a42 100644
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -261,7 +261,7 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
261 ide_expiry_t *expiry; 261 ide_expiry_t *expiry;
262 unsigned int timeout, temp; 262 unsigned int timeout, temp;
263 u16 bcount; 263 u16 bcount;
264 u8 stat, ireason, scsi = drive->scsi, dsc = 0; 264 u8 stat, ireason, scsi = !!(drive->dev_flags & IDE_DFLAG_SCSI), dsc = 0;
265 265
266 debug_log("Enter %s - interrupt handler\n", __func__); 266 debug_log("Enter %s - interrupt handler\n", __func__);
267 267
@@ -494,7 +494,8 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
494 } 494 }
495 495
496 ireason = ide_read_ireason(drive); 496 ireason = ide_read_ireason(drive);
497 if (drive->media == ide_tape && !drive->scsi) 497 if (drive->media == ide_tape &&
498 (drive->dev_flags & IDE_DFLAG_SCSI) == 0)
498 ireason = ide_wait_ireason(drive, ireason); 499 ireason = ide_wait_ireason(drive, ireason);
499 500
500 if ((ireason & ATAPI_COD) == 0 || (ireason & ATAPI_IO)) { 501 if ((ireason & ATAPI_COD) == 0 || (ireason & ATAPI_IO)) {
@@ -512,7 +513,7 @@ static ide_startstop_t ide_transfer_pc(ide_drive_t *drive)
512 timeout = drive->pc_delay; 513 timeout = drive->pc_delay;
513 expiry = &ide_delayed_transfer_pc; 514 expiry = &ide_delayed_transfer_pc;
514 } else { 515 } else {
515 if (drive->scsi) { 516 if (drive->dev_flags & IDE_DFLAG_SCSI) {
516 timeout = ide_scsi_get_timeout(pc); 517 timeout = ide_scsi_get_timeout(pc);
517 expiry = ide_scsi_expiry; 518 expiry = ide_scsi_expiry;
518 } else { 519 } else {
@@ -544,14 +545,14 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout,
544 struct ide_atapi_pc *pc = drive->pc; 545 struct ide_atapi_pc *pc = drive->pc;
545 ide_hwif_t *hwif = drive->hwif; 546 ide_hwif_t *hwif = drive->hwif;
546 u16 bcount; 547 u16 bcount;
547 u8 dma = 0; 548 u8 dma = 0, scsi = !!(drive->dev_flags & IDE_DFLAG_SCSI);
548 549
549 /* We haven't transferred any data yet */ 550 /* We haven't transferred any data yet */
550 pc->xferred = 0; 551 pc->xferred = 0;
551 pc->cur_pos = pc->buf; 552 pc->cur_pos = pc->buf;
552 553
553 /* Request to transfer the entire buffer at once */ 554 /* Request to transfer the entire buffer at once */
554 if (drive->media == ide_tape && !drive->scsi) 555 if (drive->media == ide_tape && scsi == 0)
555 bcount = pc->req_xfer; 556 bcount = pc->req_xfer;
556 else 557 else
557 bcount = min(pc->req_xfer, 63 * 1024); 558 bcount = min(pc->req_xfer, 63 * 1024);
@@ -561,19 +562,19 @@ ide_startstop_t ide_issue_pc(ide_drive_t *drive, unsigned int timeout,
561 ide_dma_off(drive); 562 ide_dma_off(drive);
562 } 563 }
563 564
564 if ((pc->flags & PC_FLAG_DMA_OK) && drive->using_dma) { 565 if ((pc->flags & PC_FLAG_DMA_OK) &&
565 if (drive->scsi) 566 (drive->dev_flags & IDE_DFLAG_USING_DMA)) {
567 if (scsi)
566 hwif->sg_mapped = 1; 568 hwif->sg_mapped = 1;
567 dma = !hwif->dma_ops->dma_setup(drive); 569 dma = !hwif->dma_ops->dma_setup(drive);
568 if (drive->scsi) 570 if (scsi)
569 hwif->sg_mapped = 0; 571 hwif->sg_mapped = 0;
570 } 572 }
571 573
572 if (!dma) 574 if (!dma)
573 pc->flags &= ~PC_FLAG_DMA_OK; 575 pc->flags &= ~PC_FLAG_DMA_OK;
574 576
575 ide_pktcmd_tf_load(drive, drive->scsi ? 0 : IDE_TFLAG_OUT_DEVICE, 577 ide_pktcmd_tf_load(drive, scsi ? 0 : IDE_TFLAG_OUT_DEVICE, bcount, dma);
576 bcount, dma);
577 578
578 /* Issue the packet command */ 579 /* Issue the packet command */
579 if (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT) { 580 if (drive->atapi_flags & IDE_AFLAG_DRQ_INTERRUPT) {