[SCSI] lpfc 8.3.25: Adapter Interface fixes and changes
[linux-2.6.git] / drivers / scsi / NCR5380.c
index c1fb332..165e4dd 100644 (file)
@@ -30,7 +30,7 @@
  * $Log: NCR5380.c,v $
 
  * Revision 1.10 1998/9/2      Alan Cox
- *                             (alan@redhat.com)
+ *                             (alan@lxorguk.ukuu.org.uk)
  * Fixed up the timer lockups reported so far. Things still suck. Looking 
  * forward to 2.3 and per device request queues. Then it'll be possible to
  * SMP thread this beast and improve life no end.
@@ -932,12 +932,11 @@ static int __devinit NCR5380_init(struct Scsi_Host *instance, int flags)
  *     @instance: adapter to remove
  */
 
-static void __devexit NCR5380_exit(struct Scsi_Host *instance)
+static void NCR5380_exit(struct Scsi_Host *instance)
 {
        struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
 
-       cancel_delayed_work(&hostdata->coroutine);
-       flush_scheduled_work();
+       cancel_delayed_work_sync(&hostdata->coroutine);
 }
 
 /**
@@ -952,7 +951,7 @@ static void __devexit NCR5380_exit(struct Scsi_Host *instance)
  *     Locks: host lock taken by caller
  */
 
-static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 
+static int NCR5380_queue_command_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
 {
        struct Scsi_Host *instance = cmd->device->host;
        struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
@@ -1021,6 +1020,7 @@ static int NCR5380_queue_command(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
        return 0;
 }
 
+static DEF_SCSI_QCMD(NCR5380_queue_command)
 
 /**
  *     NCR5380_main    -       NCR state machines
@@ -1198,12 +1198,12 @@ static irqreturn_t NCR5380_intr(int dummy, void *dev_id)
                                 */
 
                                if ((NCR5380_read(MODE_REG) & MR_DMA) && ((basr & BASR_END_DMA_TRANSFER) || !(basr & BASR_PHASE_MATCH))) {
-                                       int transfered;
+                                       int transferred;
 
                                        if (!hostdata->connected)
                                                panic("scsi%d : received end of DMA interrupt with no connected cmd\n", instance->hostno);
 
-                                       transfered = (hostdata->dmalen - NCR5380_dma_residual(instance));
+                                       transferred = (hostdata->dmalen - NCR5380_dma_residual(instance));
                                        hostdata->connected->SCp.this_residual -= transferred;
                                        hostdata->connected->SCp.ptr += transferred;
                                        hostdata->dmalen = 0;
@@ -1563,7 +1563,7 @@ failed:
  *      bytes to transfer, **data - pointer to data pointer.
  * 
  * Returns : -1 when different phase is entered without transferring
- *      maximum number of bytes, 0 if all bytes or transfered or exit
+ *      maximum number of bytes, 0 if all bytes or transferred or exit
  *      is in same phase.
  *
  *      Also, *phase, *count, *data are modified in place.
@@ -1800,7 +1800,7 @@ static int do_abort(struct Scsi_Host *host) {
  *      bytes to transfer, **data - pointer to data pointer.
  * 
  * Returns : -1 when different phase is entered without transferring
- *      maximum number of bytes, 0 if all bytes or transfered or exit
+ *      maximum number of bytes, 0 if all bytes or transferred or exit
  *      is in same phase.
  *
  *      Also, *phase, *count, *data are modified in place.
@@ -1857,7 +1857,9 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase
 #endif
        /* KLL May need eop and parity in 53c400 */
        if (hostdata->flags & FLAG_NCR53C400)
-               NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE | MR_ENABLE_PAR_CHECK | MR_ENABLE_PAR_INTR | MR_ENABLE_EOP_INTR | MR_DMA_MODE | MR_MONITOR_BSY);
+               NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE |
+                               MR_ENABLE_PAR_CHECK | MR_ENABLE_PAR_INTR |
+                               MR_ENABLE_EOP_INTR | MR_MONITOR_BSY);
        else
                NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE);
 #endif                         /* def REAL_DMA */