aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ide-scsi.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-15 15:22:00 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-15 15:22:00 -0400
commit6bf1641ca1c7554f0da54aaf89788731b541bacc (patch)
treece7c371971e68b650d87e67935e460c948f4cb20 /drivers/scsi/ide-scsi.c
parent28c7214bd8c2bbd4873b8f1e7f58d86d3731124f (diff)
ide: add ide_issue_pc() helper
Add generic ide_issue_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/ide-scsi.c')
-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 b7c5e8391575..32415466fbfe 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -502,38 +502,12 @@ static ide_startstop_t idescsi_issue_pc(ide_drive_t *drive,
502 struct ide_atapi_pc *pc) 502 struct ide_atapi_pc *pc)
503{ 503{
504 idescsi_scsi_t *scsi = drive_to_idescsi(drive); 504 idescsi_scsi_t *scsi = drive_to_idescsi(drive);
505 ide_hwif_t *hwif = drive->hwif;
506 u16 bcount;
507 u8 dma = 0;
508 505
509 /* Set the current packet command */ 506 /* Set the current packet command */
510 scsi->pc = pc; 507 scsi->pc = pc;
511 /* We haven't transferred any data yet */
512 pc->xferred = 0;
513 pc->cur_pos = pc->buf;
514 /* Request to transfer the entire buffer at once */
515 bcount = min(pc->req_xfer, 63 * 1024);
516
517 if ((pc->flags & PC_FLAG_DMA_OK) && drive->using_dma) {
518 hwif->sg_mapped = 1;
519 dma = !hwif->dma_ops->dma_setup(drive);
520 hwif->sg_mapped = 0;
521 }
522
523 if (!dma)
524 pc->flags &= ~PC_FLAG_DMA_OK;
525 508
526 ide_pktcmd_tf_load(drive, 0, bcount, dma); 509 return ide_issue_pc(drive, pc, idescsi_transfer_pc,
527 510 get_timeout(pc), idescsi_expiry);
528 if (pc->flags & PC_FLAG_DRQ_INTERRUPT) {
529 ide_execute_command(drive, WIN_PACKETCMD, &idescsi_transfer_pc,
530 get_timeout(pc), idescsi_expiry);
531 return ide_started;
532 } else {
533 /* Issue the packet command */
534 ide_execute_pkt_cmd(drive);
535 return idescsi_transfer_pc(drive);
536 }
537} 511}
538 512
539/* 513/*