]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/ide-scsi.c
ide: add device flags
[linux-2.6-omap-h63xx.git] / drivers / scsi / ide-scsi.c
index ff2b199098381851bec165641971bf292de9cea8..67e9ed95f669077f5ca99f94b15c57526e417bd2 100644 (file)
@@ -270,21 +270,6 @@ static int idescsi_end_request (ide_drive_t *drive, int uptodate, int nrsecs)
        return 0;
 }
 
-/*
- *     Our interrupt handler.
- */
-static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
-{
-       return ide_pc_intr(drive, idescsi_pc_intr, NULL, ide_io_buffers);
-}
-
-static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive)
-{
-       return ide_transfer_pc(drive, idescsi_pc_intr,
-                              ide_scsi_get_timeout(drive->pc),
-                              ide_scsi_expiry);
-}
-
 static inline int idescsi_set_direction(struct ide_atapi_pc *pc)
 {
        switch (pc->c[0]) {
@@ -330,8 +315,7 @@ static ide_startstop_t idescsi_issue_pc(ide_drive_t *drive,
        /* Set the current packet command */
        drive->pc = pc;
 
-       return ide_issue_pc(drive, idescsi_transfer_pc,
-                           ide_scsi_get_timeout(pc), ide_scsi_expiry);
+       return ide_issue_pc(drive, ide_scsi_get_timeout(pc), ide_scsi_expiry);
 }
 
 /*
@@ -347,7 +331,8 @@ static ide_startstop_t idescsi_do_request (ide_drive_t *drive, struct request *r
        if (blk_sense_request(rq) || blk_special_request(rq)) {
                struct ide_atapi_pc *pc = (struct ide_atapi_pc *)rq->special;
 
-               if (drive->using_dma && !idescsi_map_sg(drive, pc))
+               if ((drive->dev_flags & IDE_DFLAG_USING_DMA) &&
+                   idescsi_map_sg(drive, pc) == 0)
                        pc->flags |= PC_FLAG_DMA_OK;
 
                return idescsi_issue_pc(drive, pc);
@@ -407,7 +392,9 @@ static void idescsi_setup (ide_drive_t *drive, idescsi_scsi_t *scsi)
        set_bit(IDESCSI_LOG_CMD, &scsi->log);
 #endif /* IDESCSI_DEBUG_LOG */
 
-       drive->pc_callback = ide_scsi_callback;
+       drive->pc_callback       = ide_scsi_callback;
+       drive->pc_update_buffers = NULL;
+       drive->pc_io_buffers     = ide_io_buffers;
 
        ide_proc_register_driver(drive, scsi->driver);
 }
@@ -429,7 +416,7 @@ static void ide_scsi_remove(ide_drive_t *drive)
 
        ide_scsi_put(scsi);
 
-       drive->scsi = 0;
+       drive->dev_flags &= ~IDE_DFLAG_SCSI;
 }
 
 static int ide_scsi_probe(ide_drive_t *);
@@ -781,7 +768,7 @@ static int ide_scsi_probe(ide_drive_t *drive)
            !(host = scsi_host_alloc(&idescsi_template,sizeof(idescsi_scsi_t))))
                return -ENODEV;
 
-       drive->scsi = 1;
+       drive->dev_flags |= IDE_DFLAG_SCSI;
 
        g = alloc_disk(1 << PARTN_BITS);
        if (!g)
@@ -822,7 +809,7 @@ static int ide_scsi_probe(ide_drive_t *drive)
 
        put_disk(g);
 out_host_put:
-       drive->scsi = 0;
+       drive->dev_flags &= ~IDE_DFLAG_SCSI;
        scsi_host_put(host);
        return err;
 }