]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/ide-scsi.c
Merge branch 'for-linus' of git://oss.sgi.com:8090/xfs/xfs-2.6
[linux-2.6-omap-h63xx.git] / drivers / scsi / ide-scsi.c
index 02e91893064d89d6a80a25ef78daee53b1b9f0a8..68e5c632c5d55ca7b909643c3cf2f2a1adff3889 100644 (file)
@@ -1,7 +1,6 @@
 /*
- * linux/drivers/scsi/ide-scsi.c       Version 0.9             Jul   4, 1999
- *
- * Copyright (C) 1996 - 1999 Gadi Oxman <gadio@netvision.net.il>
+ * Copyright (C) 1996-1999  Gadi Oxman <gadio@netvision.net.il>
+ * Copyright (C) 2004-2005  Bartlomiej Zolnierkiewicz
  */
 
 /*
@@ -288,7 +287,7 @@ static int idescsi_end_request(ide_drive_t *, int, int);
 static ide_startstop_t
 idescsi_atapi_error(ide_drive_t *drive, struct request *rq, u8 stat, u8 err)
 {
-       if (HWIF(drive)->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT))
+       if (ide_read_status(drive) & (BUSY_STAT | DRQ_STAT))
                /* force an abort */
                HWIF(drive)->OUTB(WIN_IDLEIMMEDIATE,IDE_COMMAND_REG);
 
@@ -424,7 +423,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
        }
 
        /* Clear the interrupt */
-       stat = drive->hwif->INB(IDE_STATUS_REG);
+       stat = ide_read_status(drive);
 
        if ((stat & DRQ_STAT) == 0) {
                /* No more interrupts */
@@ -589,19 +588,14 @@ static ide_startstop_t idescsi_issue_pc (ide_drive_t *drive, idescsi_pc_t *pc)
                hwif->sg_mapped = 0;
        }
 
-       SELECT_DRIVE(drive);
-
        ide_pktcmd_tf_load(drive, IDE_TFLAG_NO_SELECT_MASK, bcount, dma);
 
        if (dma)
                set_bit(PC_DMA_OK, &pc->flags);
 
        if (test_bit(IDESCSI_DRQ_INTERRUPT, &scsi->flags)) {
-               BUG_ON(HWGROUP(drive)->handler != NULL);
-               ide_set_handler(drive, &idescsi_transfer_pc,
-                               get_timeout(pc), idescsi_expiry);
-               /* Issue the packet command */
-               HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG);
+               ide_execute_command(drive, WIN_PACKETCMD, &idescsi_transfer_pc,
+                                   get_timeout(pc), idescsi_expiry);
                return ide_started;
        } else {
                /* Issue the packet command */
@@ -919,8 +913,8 @@ static int idescsi_eh_reset (struct scsi_cmnd *cmd)
        }
 
        /* kill current request */
-       blkdev_dequeue_request(req);
-       end_that_request_last(req, 0);
+       if (__blk_end_request(req, -EIO, 0))
+               BUG();
        if (blk_sense_request(req))
                kfree(scsi->pc->buffer);
        kfree(scsi->pc);
@@ -929,8 +923,8 @@ static int idescsi_eh_reset (struct scsi_cmnd *cmd)
 
        /* now nuke the drive queue */
        while ((req = elv_next_request(drive->queue))) {
-               blkdev_dequeue_request(req);
-               end_that_request_last(req, 0);
+               if (__blk_end_request(req, -EIO, 0))
+                       BUG();
        }
 
        HWGROUP(drive)->rq = NULL;