SCSI / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
[cascardo/linux.git] / drivers / scsi / t128.c
index e5acd9e..87828ac 100644 (file)
@@ -1,4 +1,3 @@
-#define AUTOSENSE
 #define PSEUDO_DMA
 
 /*
@@ -12,8 +11,6 @@
  *     drew@colorado.edu
  *      +1 (303) 440-4894
  *
- * DISTRIBUTION RELEASE 3.
- *
  * For more information, please consult 
  *
  * Trantor Systems, Ltd.
  * 5415 Randall Place
  * Fremont, CA 94538
  * 1+ (415) 770-1400, FAX 1+ (415) 770-9910
- * 
- * and 
- *
- * NCR 5380 Family
- * SCSI Protocol Controller
- * Databook
- *
- * NCR Microelectronics
- * 1635 Aeroplaza Drive
- * Colorado Springs, CO 80916
- * 1+ (719) 578-3400
- * 1+ (800) 334-5454
  */
 
 /*
- * Options : 
- * AUTOSENSE - if defined, REQUEST SENSE will be performed automatically
- *      for commands that return with a CHECK CONDITION status. 
- *
- * PSEUDO_DMA - enables PSEUDO-DMA hardware, should give a 3-4X performance
- * increase compared to polled I/O.
- *
- * PARITY - enable parity checking.  Not supported.
- *
- * UNSAFE - leave interrupts enabled during pseudo-DMA transfers.  You
- *          only really want to use this if you're having a problem with
- *          dropped characters during high speed communications, and even
- *          then, you're going to be better off twiddling with transfersize.
- *
  * The card is detected and initialized in one of several ways : 
  * 1.  Autoprobe (default) - since the board is memory mapped, 
  *     a BIOS signature is scanned for to locate the registers.
 #include <linux/module.h>
 #include <linux/delay.h>
 
-#include "scsi.h"
 #include <scsi/scsi_host.h>
 #include "t128.h"
 #define AUTOPROBE_IRQ
@@ -193,17 +163,14 @@ __setup("t128=", t128_setup);
  *
  */
 
-int __init t128_detect(struct scsi_host_template * tpnt){
+static int __init t128_detect(struct scsi_host_template *tpnt)
+{
     static int current_override = 0, current_base = 0;
     struct Scsi_Host *instance;
     unsigned long base;
     void __iomem *p;
     int sig, count;
 
-    tpnt->proc_name = "t128";
-    tpnt->show_info = t128_show_info;
-    tpnt->write_info = t128_write_info;
-
     for (count = 0; current_override < NO_OVERRIDES; ++current_override) {
        base = 0;
        p = NULL;
@@ -258,15 +225,19 @@ found:
        else 
            instance->irq = NCR5380_probe_irq(instance, T128_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, t128_intr, 0, "t128",
                            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);
        }
@@ -275,16 +246,6 @@ found:
        printk("scsi%d : irq = %d\n", instance->host_no, instance->irq);
 #endif
 
-       printk("scsi%d : at 0x%08lx", instance->host_no, instance->base);
-       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, T128_PUBLIC_RELEASE);
-       NCR5380_print_options(instance);
-       printk("\n");
-
        ++current_override;
        ++count;
     }
@@ -295,7 +256,7 @@ static int t128_release(struct Scsi_Host *shost)
 {
        NCR5380_local_declare();
        NCR5380_setup(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)
@@ -325,8 +286,8 @@ static int t128_release(struct Scsi_Host *shost)
  * and matching the H_C_S coordinates to what DOS uses.
  */
 
-int t128_biosparam(struct scsi_device *sdev, struct block_device *bdev,
-               sector_t capacity, int * ip)
+static int t128_biosparam(struct scsi_device *sdev, struct block_device *bdev,
+                          sector_t capacity, int *ip)
 {
   ip[0] = 64;
   ip[1] = 32;
@@ -434,6 +395,10 @@ static struct scsi_host_template driver_template = {
        .name           = "Trantor T128/T128F/T228",
        .detect         = t128_detect,
        .release        = t128_release,
+       .proc_name      = "t128",
+       .show_info      = t128_show_info,
+       .write_info     = t128_write_info,
+       .info           = t128_info,
        .queuecommand   = t128_queue_command,
        .eh_abort_handler = t128_abort,
        .eh_bus_reset_handler    = t128_bus_reset,