aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
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/scsi
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/scsi')
-rw-r--r--drivers/scsi/ide-scsi.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index c9fdf60c9dc..d41348f2245 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -453,36 +453,10 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
453 453
454static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive) 454static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive)
455{ 455{
456 ide_hwif_t *hwif = drive->hwif;
457 idescsi_scsi_t *scsi = drive_to_idescsi(drive); 456 idescsi_scsi_t *scsi = drive_to_idescsi(drive);
458 struct ide_atapi_pc *pc = scsi->pc;
459 ide_startstop_t startstop;
460 u8 ireason;
461
462 if (ide_wait_stat(&startstop,drive,DRQ_STAT,BUSY_STAT,WAIT_READY)) {
463 printk(KERN_ERR "%s: Strange, packet command initiated yet "
464 "DRQ isn't asserted\n", drive->name);
465 return startstop;
466 }
467 ireason = hwif->INB(hwif->io_ports.nsect_addr);
468 if ((ireason & CD) == 0 || (ireason & IO)) {
469 printk(KERN_ERR "%s: (IO,CoD) != (0,1) while issuing "
470 "a packet command\n", drive->name);
471 return ide_do_reset (drive);
472 }
473 457
474 /* Set the interrupt routine */ 458 return ide_transfer_pc(drive, scsi->pc, idescsi_pc_intr,
475 ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry); 459 get_timeout(scsi->pc), idescsi_expiry);
476
477 if (pc->flags & PC_FLAG_DMA_OK) {
478 pc->flags |= PC_FLAG_DMA_IN_PROGRESS;
479 hwif->dma_ops->dma_start(drive);
480 }
481
482 /* Send the actual packet */
483 hwif->output_data(drive, NULL, scsi->pc->c, 12);
484
485 return ide_started;
486} 460}
487 461
488static inline int idescsi_set_direction(struct ide_atapi_pc *pc) 462static inline int idescsi_set_direction(struct ide_atapi_pc *pc)