aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-floppy.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-15 15:21:58 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-15 15:21:58 -0400
commit594c16d8dd54cd7b1c5ef1ec3ac0f6bf34301dad (patch)
tree4891a8ab4e998ba00db51e4672da64fd83663002 /drivers/ide/ide-floppy.c
parentf83cbc77b0d5521b4f0f591ede4870316944481a (diff)
ide: add ide_transfer_pc() helper
* Add ide-atapi.c file for generic ATAPI support together with CONFIG_IDE_ATAPI config option. * Add generic ide_transfer_pc() helper to ide-atapi.c and then convert ide-{floppy,tape,scsi} device drivers to use it. There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-floppy.c')
-rw-r--r--drivers/ide/ide-floppy.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index a7c138dc324c..e7a1025c03c4 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -532,25 +532,11 @@ static int idefloppy_transfer_pc2(ide_drive_t *drive)
532 532
533static ide_startstop_t idefloppy_transfer_pc1(ide_drive_t *drive) 533static ide_startstop_t idefloppy_transfer_pc1(ide_drive_t *drive)
534{ 534{
535 ide_hwif_t *hwif = drive->hwif;
536 idefloppy_floppy_t *floppy = drive->driver_data; 535 idefloppy_floppy_t *floppy = drive->driver_data;
537 struct ide_atapi_pc *pc = floppy->pc; 536 struct ide_atapi_pc *pc = floppy->pc;
538 ide_expiry_t *expiry; 537 ide_expiry_t *expiry;
539 unsigned int timeout; 538 unsigned int timeout;
540 ide_startstop_t startstop;
541 u8 ireason;
542 539
543 if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) {
544 printk(KERN_ERR "%s: Strange, packet command initiated yet "
545 "DRQ isn't asserted\n", drive->name);
546 return startstop;
547 }
548 ireason = hwif->INB(hwif->io_ports.nsect_addr);
549 if ((ireason & CD) == 0 || (ireason & IO)) {
550 printk(KERN_ERR "%s: (IO,CoD) != (0,1) while issuing "
551 "a packet command\n", drive->name);
552 return ide_do_reset(drive);
553 }
554 /* 540 /*
555 * The following delay solves a problem with ATAPI Zip 100 drives 541 * The following delay solves a problem with ATAPI Zip 100 drives
556 * where the Busy flag was apparently being deasserted before the 542 * where the Busy flag was apparently being deasserted before the
@@ -567,19 +553,7 @@ static ide_startstop_t idefloppy_transfer_pc1(ide_drive_t *drive)
567 expiry = NULL; 553 expiry = NULL;
568 } 554 }
569 555
570 ide_set_handler(drive, &idefloppy_pc_intr, timeout, expiry); 556 return ide_transfer_pc(drive, pc, idefloppy_pc_intr, timeout, expiry);
571
572 /* Begin DMA, if necessary */
573 if (pc->flags & PC_FLAG_DMA_OK) {
574 pc->flags |= PC_FLAG_DMA_IN_PROGRESS;
575 hwif->dma_ops->dma_start(drive);
576 }
577
578 if ((pc->flags & PC_FLAG_ZIP_DRIVE) == 0)
579 /* Send the actual packet */
580 hwif->output_data(drive, NULL, floppy->pc->c, 12);
581
582 return ide_started;
583} 557}
584 558
585static void ide_floppy_report_error(idefloppy_floppy_t *floppy, 559static void ide_floppy_report_error(idefloppy_floppy_t *floppy,