ipr: add support for async scanning to speed up boot
[cascardo/linux.git] / drivers / scsi / pas16.c
index 3e40479..e81eadd 100644 (file)
  *   If you have problems with your card not being recognized, use
  *   the LILO command line override.  Try to get it recognized without
  *   interrupts.  Ie, for a board at the default 0x388 base port,
- *   boot: linux pas16=0x388,255
+ *   boot: linux pas16=0x388,0
  *
- *   SCSI_IRQ_NONE (255) should be specified for no interrupt,
+ *   NO_IRQ (0) should be specified for no interrupt,
  *   IRQ_AUTO (254) to autoprobe for an IRQ line if overridden
  *   on the command line.
- *
- *   (IRQ_AUTO == 254, SCSI_IRQ_NONE == 255 in NCR5380.h)
  */
  
 #include <linux/module.h>
 #include <linux/stat.h>
 #include <linux/init.h>
 
-#include "scsi.h"
 #include <scsi/scsi_host.h>
 #include "pas16.h"
 #define AUTOPROBE_IRQ
 #include "NCR5380.h"
 
 
-static int pas_maxi = 0;
-static int pas_wmaxi = 0;
 static unsigned short pas16_addr = 0;
 static int pas16_irq = 0;
  
@@ -416,15 +411,19 @@ static int __init pas16_detect(struct scsi_host_template *tpnt)
        else 
            instance->irq = NCR5380_probe_irq(instance, PAS16_IRQS);
 
-       if (instance->irq != SCSI_IRQ_NONE) 
+       /* Compatibility with documented NCR5380 kernel parameters */
+       if (instance->irq == 255)
+               instance->irq = NO_IRQ;
+
+       if (instance->irq != NO_IRQ)
            if (request_irq(instance->irq, pas16_intr, 0,
                            "pas16", instance)) {
                printk("scsi%d : IRQ%d not free, interrupts disabled\n", 
                    instance->host_no, instance->irq);
-               instance->irq = SCSI_IRQ_NONE;
+               instance->irq = NO_IRQ;
            } 
 
-       if (instance->irq == SCSI_IRQ_NONE) {
+       if (instance->irq == NO_IRQ) {
            printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no);
            printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no);
            /* Disable 5380 interrupts, leave drive params the same */
@@ -436,17 +435,6 @@ static int __init pas16_detect(struct scsi_host_template *tpnt)
        printk("scsi%d : irq = %d\n", instance->host_no, instance->irq);
 #endif
 
-       printk("scsi%d : at 0x%04x", instance->host_no, (int) 
-           instance->io_port);
-       if (instance->irq == SCSI_IRQ_NONE)
-           printk (" interrupts disabled");
-       else 
-           printk (" irq %d", instance->irq);
-       printk(" options CAN_QUEUE=%d  CMD_PER_LUN=%d release=%d",
-           CAN_QUEUE, CMD_PER_LUN, PAS16_PUBLIC_RELEASE);
-       NCR5380_print_options(instance);
-       printk("\n");
-
        ++current_override;
        ++count;
     }
@@ -511,6 +499,7 @@ static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst,
        P_DATA_REG_OFFSET);
     register int i = len;
     int ii = 0;
+    struct NCR5380_hostdata *hostdata = shost_priv(instance);
 
     while ( !(inb(instance->io_port + P_STATUS_REG_OFFSET) & P_ST_RDY) )
         ++ii;
@@ -523,8 +512,8 @@ static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst,
            instance->host_no);
        return -1;
     }
-   if (ii > pas_maxi)
-      pas_maxi = ii;
+    if (ii > hostdata->spin_max_r)
+        hostdata->spin_max_r = ii;
     return 0;
 }
 
@@ -547,6 +536,7 @@ static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src
     register unsigned short reg = (instance->io_port + P_DATA_REG_OFFSET);
     register int i = len;
     int ii = 0;
+    struct NCR5380_hostdata *hostdata = shost_priv(instance);
 
     while ( !((inb(instance->io_port + P_STATUS_REG_OFFSET)) & P_ST_RDY) )
         ++ii;
@@ -559,8 +549,8 @@ static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src
            instance->host_no);
        return -1;
     }
-    if (ii > pas_maxi)
-        pas_wmaxi = ii;
+    if (ii > hostdata->spin_max_w)
+        hostdata->spin_max_w = ii;
     return 0;
 }
 
@@ -568,7 +558,7 @@ static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src
 
 static int pas16_release(struct Scsi_Host *shost)
 {
-       if (shost->irq)
+       if (shost->irq != NO_IRQ)
                free_irq(shost->irq, shost);
        NCR5380_exit(shost);
        if (shost->io_port && shost->n_io_port)
@@ -584,6 +574,7 @@ static struct scsi_host_template driver_template = {
        .proc_name      = "pas16",
        .show_info      = pas16_show_info,
        .write_info     = pas16_write_info,
+       .info           = pas16_info,
        .queuecommand   = pas16_queue_command,
        .eh_abort_handler = pas16_abort,
        .eh_bus_reset_handler = pas16_bus_reset,