]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ncr5380: Cleanup host info() methods
authorFinn Thain <fthain@telegraphics.com.au>
Wed, 12 Nov 2014 05:11:58 +0000 (16:11 +1100)
committerChristoph Hellwig <hch@lst.de>
Thu, 20 Nov 2014 08:11:08 +0000 (09:11 +0100)
If the host->info() method is not set, then host->name is used by default.
For atari_scsi, that is exactly the same text. So remove the redundant
info() method. Keep sun3_scsi.c in line with atari_scsi.

Some NCR5380 drivers return an empty string from the info() method
(arm/cumana_1.c arm/oak.c mac_scsi.c) while other drivers use the default
(dmx3191d dtc.c g_NCR5380.c pas16.c t128.c).

Implement a common info() method to replace a lot of duplicated code which
the various drivers use to announce the same information.

This replaces most of the (deprecated) show_info() output and all of the
NCR5380_print_info() output. This also eliminates a bunch of code in
g_NCR5380 which just duplicates functionality in the core driver.

Signed-off-by: Finn Thain <fthain@telegraphics.com.au>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
21 files changed:
drivers/scsi/NCR5380.c
drivers/scsi/NCR5380.h
drivers/scsi/arm/cumana_1.c
drivers/scsi/arm/oak.c
drivers/scsi/atari_NCR5380.c
drivers/scsi/atari_scsi.c
drivers/scsi/atari_scsi.h
drivers/scsi/dmx3191d.c
drivers/scsi/dtc.c
drivers/scsi/dtc.h
drivers/scsi/g_NCR5380.c
drivers/scsi/g_NCR5380.h
drivers/scsi/mac_scsi.c
drivers/scsi/mac_scsi.h
drivers/scsi/pas16.c
drivers/scsi/pas16.h
drivers/scsi/sun3_NCR5380.c
drivers/scsi/sun3_scsi.c
drivers/scsi/sun3_scsi.h
drivers/scsi/t128.c
drivers/scsi/t128.h

index 2bb4df0e555125639a43fb7953deef33bb3ee1f1..f1792bb80e70a39b3f34473dd0140e6f5cc35748 100644 (file)
@@ -610,47 +610,70 @@ static int __init __maybe_unused NCR5380_probe_irq(struct Scsi_Host *instance,
 }
 
 /**
- *     NCR58380_print_options  -       show options
- *     @instance: unused for now
+ *     NCR58380_info - report driver and host information
+ *     @instance: relevant scsi host instance
  *
- *     Called by probe code indicating the NCR5380 driver options that 
- *     were selected. At some point this will switch to runtime options
- *     read from the adapter in question
+ *     For use as the host template info() handler.
  *
  *     Locks: none
  */
 
-static void __init __maybe_unused
-NCR5380_print_options(struct Scsi_Host *instance)
+static const char *NCR5380_info(struct Scsi_Host *instance)
 {
-       printk(" generic options"
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
+
+       return hostdata->info;
+}
+
+static void prepare_info(struct Scsi_Host *instance)
+{
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
+
+       snprintf(hostdata->info, sizeof(hostdata->info),
+                "%s, io_port 0x%lx, n_io_port %d, "
+                "base 0x%lx, irq %d, "
+                "can_queue %d, cmd_per_lun %d, "
+                "sg_tablesize %d, this_id %d, "
+                "flags { %s%s%s}, "
+#if defined(USLEEP_POLL) && defined(USLEEP_WAITLONG)
+                "USLEEP_POLL %d, USLEEP_WAITLONG %d, "
+#endif
+                "options { %s} ",
+                instance->hostt->name, instance->io_port, instance->n_io_port,
+                instance->base, instance->irq,
+                instance->can_queue, instance->cmd_per_lun,
+                instance->sg_tablesize, instance->this_id,
+                hostdata->flags & FLAG_NCR53C400     ? "NCR53C400 "     : "",
+                hostdata->flags & FLAG_DTC3181E      ? "DTC3181E "      : "",
+                hostdata->flags & FLAG_NO_PSEUDO_DMA ? "NO_PSEUDO_DMA " : "",
+#if defined(USLEEP_POLL) && defined(USLEEP_WAITLONG)
+                USLEEP_POLL, USLEEP_WAITLONG,
+#endif
 #ifdef AUTOPROBE_IRQ
-              " AUTOPROBE_IRQ"
+                "AUTOPROBE_IRQ "
 #endif
 #ifdef DIFFERENTIAL
-              " DIFFERENTIAL"
+                "DIFFERENTIAL "
 #endif
 #ifdef REAL_DMA
-              " REAL DMA"
+                "REAL_DMA "
 #endif
 #ifdef REAL_DMA_POLL
-              " REAL DMA POLL"
+                "REAL_DMA_POLL "
 #endif
 #ifdef PARITY
-              " PARITY"
+                "PARITY "
 #endif
 #ifdef PSEUDO_DMA
-              " PSEUDO DMA"
+                "PSEUDO_DMA "
 #endif
 #ifdef UNSAFE
-              UNSAFE "
+                "UNSAFE "
 #endif
-           );
-       printk(" USLEEP_POLL=%d USLEEP_SLEEP=%d", USLEEP_POLL, USLEEP_SLEEP);
-       printk(" generic release=%d", NCR5380_PUBLIC_RELEASE);
-       if (((struct NCR5380_hostdata *) instance->hostdata)->flags & FLAG_NCR53C400) {
-               printk(" ncr53c400 release=%d", NCR53C400_PUBLIC_RELEASE);
-       }
+#ifdef NCR53C400
+                "NCR53C400 "
+#endif
+                "");
 }
 
 /**
@@ -728,13 +751,6 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m,
        SPRINTF("PAS16 release=%d", PAS16_PUBLIC_RELEASE);
 #endif
 
-       SPRINTF("\nBase Addr: 0x%05lX    ", (long) instance->base);
-       SPRINTF("io_port: %04x      ", (int) instance->io_port);
-       if (instance->irq == NO_IRQ)
-               SPRINTF("IRQ: None.\n");
-       else
-               SPRINTF("IRQ: %d.\n", instance->irq);
-
 #ifdef DTC_PUBLIC_RELEASE
        SPRINTF("Highwater I/O busy_spin_counts -- write: %d  read: %d\n", dtc_wmaxi, dtc_maxi);
 #endif
@@ -842,6 +858,8 @@ static int NCR5380_init(struct Scsi_Host *instance, int flags)
        hostdata->host = instance;
        hostdata->time_expires = 0;
 
+       prepare_info(instance);
+
        NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
        NCR5380_write(MODE_REG, MR_BASE);
        NCR5380_write(TARGET_COMMAND_REG, 0);
index d811775ffd9d71aca8c362a12c5526696cde80c4..dc37da49656bf06b121548d399b093ae13986479 100644 (file)
@@ -273,6 +273,7 @@ struct NCR5380_hostdata {
        volatile Scsi_Cmnd *selecting;
        struct delayed_work coroutine;          /* our co-routine */
        struct scsi_eh_save ses;
+       char info[256];
 };
 
 #ifdef __KERNEL__
@@ -307,7 +308,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance);
 static irqreturn_t NCR5380_intr(int irq, void *dev_id);
 #endif
 static void NCR5380_main(struct work_struct *work);
-static void __maybe_unused NCR5380_print_options(struct Scsi_Host *instance);
+static const char *NCR5380_info(struct Scsi_Host *instance);
 static void NCR5380_reselect(struct Scsi_Host *instance);
 static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd);
 #if defined(PSEUDO_DMA) || defined(REAL_DMA) || defined(REAL_DMA_POLL)
index 8266039b60eea2c0a7bfdd7c2f85c7a60242ec26..d3b96af3aa5c229c2785fd252a3b2682aaa1cc2d 100644 (file)
@@ -29,6 +29,7 @@
 #define NCR5380_write(reg, value)      cumanascsi_write(_instance, reg, value)
 #define NCR5380_intr                   cumanascsi_intr
 #define NCR5380_queue_command          cumanascsi_queue_command
+#define NCR5380_info                   cumanascsi_info
 
 #define NCR5380_implementation_fields  \
        unsigned ctrl;                  \
@@ -41,11 +42,6 @@ void cumanascsi_setup(char *str, int *ints)
 {
 }
 
-const char *cumanascsi_info(struct Scsi_Host *spnt)
-{
-       return "";
-}
-
 #define CTRL   0x16fc
 #define STAT   0x2004
 #define L(v)   (((v)<<16)|((v) & 0x0000ffff))
@@ -266,14 +262,6 @@ static int cumanascsi1_probe(struct expansion_card *ec,
                goto out_unmap;
        }
 
-       printk("scsi%d: at port 0x%08lx irq %d",
-               host->host_no, host->io_port, host->irq);
-       printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d",
-               host->can_queue, host->cmd_per_lun, CUMANASCSI_PUBLIC_RELEASE);
-       printk("\nscsi%d:", host->host_no);
-       NCR5380_print_options(host);
-       printk("\n");
-
        ret = scsi_add_host(host, &ec->dev);
        if (ret)
                goto out_free_irq;
index 13d5995531fca416be70535829db82431a59967d..a5ef3f79a2fdeaa67ac6e2089a4f5d30adce278a 100644 (file)
@@ -29,6 +29,7 @@
 #define NCR5380_read(reg)              readb(_base + ((reg) << 2))
 #define NCR5380_write(reg, value)      writeb(value, _base + ((reg) << 2))
 #define NCR5380_queue_command          oakscsi_queue_command
+#define NCR5380_info                   oakscsi_info
 #define NCR5380_show_info              oakscsi_show_info
 #define NCR5380_write_info             oakscsi_write_info
 
 #undef START_DMA_INITIATOR_RECEIVE_REG
 #define START_DMA_INITIATOR_RECEIVE_REG        (128 + 7)
 
-const char * oakscsi_info (struct Scsi_Host *spnt)
-{
-       return "";
-}
-
 #define STAT   ((128 + 16) << 2)
 #define DATA   ((128 + 8) << 2)
 
@@ -153,14 +149,6 @@ static int oakscsi_probe(struct expansion_card *ec, const struct ecard_id *id)
 
        NCR5380_init(host, 0);
 
-       printk("scsi%d: at port 0x%08lx irqs disabled",
-               host->host_no, host->io_port);
-       printk(" options CAN_QUEUE=%d  CMD_PER_LUN=%d release=%d",
-               host->can_queue, host->cmd_per_lun, OAKSCSI_PUBLIC_RELEASE);
-       printk("\nscsi%d:", host->host_no);
-       NCR5380_print_options(host);
-       printk("\n");
-
        ret = scsi_add_host(host, &ec->dev);
        if (ret)
                goto out_unmap;
index 6177830ef0d928d8b329f7445350d15cfa77d196..4d903b86addaebb932d5e1421d71f07a3d423de9 100644 (file)
  * be able to coexist with appropriate changes to the high level
  * SCSI code.
  *
- * A NCR5380_PUBLIC_REVISION macro is provided, with the release
- * number (updated for each public release) printed by the
- * NCR5380_print_options command, which should be called from the
- * wrapper detect function, so that I know what release of the driver
- * users are using.
- *
  * Issues specific to the NCR5380 :
  *
  * When used in a PIO or pseudo-dma mode, the NCR5380 is a braindead
  * NCR5380_queue_command
  * NCR5380_reset
  * NCR5380_abort
- * NCR5380_proc_info
  *
  * to be the global entry points into the specific driver, ie
  * #define NCR5380_queue_command t128_queue_command.
  * The generic driver is initialized by calling NCR5380_init(instance),
  * after setting the appropriate host specific fields and ID.  If the
  * driver wishes to autoprobe for an IRQ line, the NCR5380_probe_irq(instance,
- * possible) function may be used.  Before the specific driver initialization
- * code finishes, NCR5380_print_options should be called.
+ * possible) function may be used.
  */
 
 static struct Scsi_Host *first_instance = NULL;
@@ -670,30 +662,49 @@ static inline void NCR5380_all_init(void)
        }
 }
 
-
-/*
- * Function : void NCR58380_print_options (struct Scsi_Host *instance)
+/**
+ * NCR58380_info - report driver and host information
+ * @instance: relevant scsi host instance
  *
- * Purpose : called by probe code indicating the NCR5380 driver
- *          options that were selected.
+ * For use as the host template info() handler.
  *
- * Inputs : instance, pointer to this instance.  Unused.
+ * Locks: none
  */
 
-static void __init NCR5380_print_options(struct Scsi_Host *instance)
+static const char *NCR5380_info(struct Scsi_Host *instance)
 {
-       printk(" generic options"
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
+
+       return hostdata->info;
+}
+
+static void prepare_info(struct Scsi_Host *instance)
+{
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
+
+       snprintf(hostdata->info, sizeof(hostdata->info),
+                "%s, io_port 0x%lx, n_io_port %d, "
+                "base 0x%lx, irq %d, "
+                "can_queue %d, cmd_per_lun %d, "
+                "sg_tablesize %d, this_id %d, "
+                "options { %s} ",
+                instance->hostt->name, instance->io_port, instance->n_io_port,
+                instance->base, instance->irq,
+                instance->can_queue, instance->cmd_per_lun,
+                instance->sg_tablesize, instance->this_id,
+#ifdef DIFFERENTIAL
+                "DIFFERENTIAL "
+#endif
 #ifdef REAL_DMA
-              " REAL DMA"
+                "REAL_DMA "
 #endif
 #ifdef PARITY
-              " PARITY"
+                "PARITY "
 #endif
 #ifdef SUPPORT_TAGS
-              " SCSI-2 TAGGED QUEUING"
+                "SUPPORT_TAGS "
 #endif
-              );
-       printk(" generic release=%d", NCR5380_PUBLIC_RELEASE);
+                "");
 }
 
 /*
@@ -839,6 +850,8 @@ static int __init NCR5380_init(struct Scsi_Host *instance, int flags)
                first_instance = instance;
        }
 
+       prepare_info(instance);
+
        NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
        NCR5380_write(MODE_REG, MR_BASE);
        NCR5380_write(TARGET_COMMAND_REG, 0);
index 9f4d58ca3647a1c93111afbc779f862ddd74afa8..1022a391c82a522e45886f12872fb6c4a3a1cb93 100644 (file)
@@ -699,21 +699,6 @@ static int __init atari_scsi_detect(struct scsi_host_template *host)
 #endif
        }
 
-       printk(KERN_INFO "scsi%d: options CAN_QUEUE=%d CMD_PER_LUN=%d SCAT-GAT=%d "
-#ifdef SUPPORT_TAGS
-                       "TAGGED-QUEUING=%s "
-#endif
-                       "HOSTID=%d",
-                       instance->host_no, instance->hostt->can_queue,
-                       instance->hostt->cmd_per_lun,
-                       instance->hostt->sg_tablesize,
-#ifdef SUPPORT_TAGS
-                       setup_use_tagged_queuing ? "yes" : "no",
-#endif
-                       instance->hostt->this_id );
-       NCR5380_print_options(instance);
-       printk("\n");
-
        called = 1;
        return 1;
 }
@@ -815,15 +800,6 @@ static void __init atari_scsi_reset_boot(void)
 }
 #endif
 
-
-static const char *atari_scsi_info(struct Scsi_Host *host)
-{
-       /* atari_scsi_detect() is verbose enough... */
-       static const char string[] = "Atari native SCSI";
-       return string;
-}
-
-
 #if defined(REAL_DMA)
 
 static unsigned long atari_scsi_dma_setup(struct Scsi_Host *instance,
index 58cc32f79b86c8f70fc9918c3e5ef574d32f4af6..24e854590dc45687b041d39b57cb09fd74b2b24d 100644 (file)
@@ -47,6 +47,7 @@
 #define NCR5380_queue_command atari_scsi_queue_command
 #define NCR5380_abort atari_scsi_abort
 #define NCR5380_show_info atari_scsi_show_info
+#define NCR5380_info atari_scsi_info
 #define NCR5380_dma_read_setup(inst,d,c) atari_scsi_dma_setup (inst, d, c, 0)
 #define NCR5380_dma_write_setup(inst,d,c) atari_scsi_dma_setup (inst, d, c, 1)
 #define NCR5380_dma_residual(inst) atari_scsi_dma_residual( inst )
index 6e1960a88270e84fa065a50f76bfde5fc97b1c67..feaba705a369d4b3a62f05f47b820309156be4dc 100644 (file)
@@ -57,6 +57,7 @@
 static struct scsi_host_template dmx3191d_driver_template = {
        .proc_name              = DMX3191D_DRIVER_NAME,
        .name                   = "Domex DMX3191D",
+       .info                   = NCR5380_info,
        .queuecommand           = NCR5380_queue_command,
        .eh_abort_handler       = NCR5380_abort,
        .eh_bus_reset_handler   = NCR5380_bus_reset,
index 2971c7f0e89885023210ddccb3e28cd9c039a792..2dacf2833b64d12f61786bd78b40b4ff5185d098 100644 (file)
@@ -281,15 +281,6 @@ found:
                printk("scsi%d : irq = %d\n", instance->host_no, instance->irq);
 #endif
 
-               printk(KERN_INFO "scsi%d : at 0x%05X", instance->host_no, (int) instance->base);
-               if (instance->irq == NO_IRQ)
-                       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, DTC_PUBLIC_RELEASE);
-               NCR5380_print_options(instance);
-               printk("\n");
-
                ++current_override;
                ++count;
        }
@@ -461,6 +452,7 @@ static struct scsi_host_template driver_template = {
        .proc_name                      = "dtc3x80",
        .show_info                      = dtc_show_info,
        .write_info                     = dtc_write_info,
+       .info                           = dtc_info,
        .queuecommand                   = dtc_queue_command,
        .eh_abort_handler               = dtc_abort,
        .eh_bus_reset_handler           = dtc_bus_reset,
index 46ad3403bda785068118f379c51c00bc61958ca1..48e2c399ace68963c56cea9ba3e7c63c6375003d 100644 (file)
@@ -65,6 +65,7 @@
 #define NCR5380_queue_command          dtc_queue_command
 #define NCR5380_abort                  dtc_abort
 #define NCR5380_bus_reset              dtc_bus_reset
+#define NCR5380_info                   dtc_info
 #define NCR5380_show_info              dtc_show_info 
 #define NCR5380_write_info             dtc_write_info 
 
index 9040023ed1c069647e17a76eb94edcd085321a7c..2b8155f1bf947d2c0c216e47ecc72d1a86a611b9 100644 (file)
@@ -446,34 +446,12 @@ static int __init generic_NCR5380_detect(struct scsi_host_template *tpnt)
                        printk(KERN_INFO "scsi%d : please jumper the board for a free IRQ.\n", instance->host_no);
                }
 
-               printk(KERN_INFO "scsi%d : at " STRVAL(NCR5380_map_name) " 0x%x", instance->host_no, (unsigned int) instance->NCR5380_instance_name);
-               if (instance->irq == NO_IRQ)
-                       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, GENERIC_NCR5380_PUBLIC_RELEASE);
-               NCR5380_print_options(instance);
-               printk("\n");
-
                ++current_override;
                ++count;
        }
        return count;
 }
 
-/**
- *     generic_NCR5380_info    -       reporting string
- *     @host: NCR5380 to report on
- *
- *     Report driver information for the NCR5380
- */
-       
-static const char *generic_NCR5380_info(struct Scsi_Host *host)
-{
-       static const char string[] = "Generic NCR5380/53C400 Driver";
-       return string;
-}
-
 /**
  *     generic_NCR5380_release_resources       -       free resources
  *     @instance: host adapter to clean up 
@@ -720,120 +698,9 @@ static inline int NCR5380_pwrite(struct Scsi_Host *instance, unsigned char *src,
  
 #include "NCR5380.c"
 
-#define PRINTP(x) seq_printf(m, x)
-#define ANDP ,
-
-static void sprint_opcode(struct seq_file *m, int opcode)
-{
-       PRINTP("0x%02x " ANDP opcode);
-}
-
-static void sprint_command(struct seq_file *m, unsigned char *command)
-{
-       int i, s;
-       sprint_opcode(m, command[0]);
-       for (i = 1, s = COMMAND_SIZE(command[0]); i < s; ++i)
-               PRINTP("%02x " ANDP command[i]);
-       PRINTP("\n");
-}
-
-/**
- *     sprintf_Scsi_Cmnd       -       print a scsi command
- *     @m: seq_fil to print into
- *     @cmd: SCSI command block
- *     
- *     Print out the target and command data in hex
- */
-
-static void sprint_Scsi_Cmnd(struct seq_file *m, Scsi_Cmnd * cmd)
-{
-       PRINTP("host number %d destination target %d, lun %llu\n" ANDP cmd->device->host->host_no ANDP cmd->device->id ANDP cmd->device->lun);
-       PRINTP("        command = ");
-       sprint_command(m, cmd->cmnd);
-}
-
-/**
- *     generic_NCR5380_proc_info       -       /proc for NCR5380 driver
- *     @buffer: buffer to print into
- *     @start: start position
- *     @offset: offset into buffer
- *     @len: length
- *     @hostno: instance to affect
- *     @inout: read/write
- *
- *     Provide the procfs information for the 5380 controller. We fill
- *     this with useful debugging information including the commands
- *     being executed, disconnected command queue and the statistical
- *     data
- *
- *     Locks: global cli/lock for queue walk
- */
-static int generic_NCR5380_show_info(struct seq_file *m, struct Scsi_Host *scsi_ptr)
-{
-       NCR5380_local_declare();
-       unsigned long flags;
-       unsigned char status;
-       int i;
-       Scsi_Cmnd *ptr;
-       struct NCR5380_hostdata *hostdata;
-
-       NCR5380_setup(scsi_ptr);
-       hostdata = (struct NCR5380_hostdata *) scsi_ptr->hostdata;
-
-       spin_lock_irqsave(scsi_ptr->host_lock, flags);
-       PRINTP("SCSI host number %d : %s\n" ANDP scsi_ptr->host_no ANDP scsi_ptr->hostt->name);
-       PRINTP("Generic NCR5380 driver version %d\n" ANDP GENERIC_NCR5380_PUBLIC_RELEASE);
-       PRINTP("NCR5380 core version %d\n" ANDP NCR5380_PUBLIC_RELEASE);
-#ifdef NCR53C400
-       PRINTP("NCR53C400 extension version %d\n" ANDP NCR53C400_PUBLIC_RELEASE);
-       PRINTP("NCR53C400 card%s detected\n" ANDP(((struct NCR5380_hostdata *) scsi_ptr->hostdata)->flags & FLAG_NCR53C400) ? "" : " not");
-# if NCR53C400_PSEUDO_DMA
-       PRINTP("NCR53C400 pseudo DMA used\n");
-# endif
-#else
-       PRINTP("NO NCR53C400 driver extensions\n");
-#endif
-       PRINTP("Using %s mapping at %s 0x%lx, " ANDP STRVAL(NCR5380_map_config) ANDP STRVAL(NCR5380_map_name) ANDP scsi_ptr->NCR5380_instance_name);
-       if (scsi_ptr->irq == NO_IRQ)
-               PRINTP("no interrupt\n");
-       else
-               PRINTP("on interrupt %d\n" ANDP scsi_ptr->irq);
-
-       status = NCR5380_read(STATUS_REG);
-       if (!(status & SR_REQ))
-               PRINTP("REQ not asserted, phase unknown.\n");
-       else {
-               for (i = 0; (phases[i].value != PHASE_UNKNOWN) && (phases[i].value != (status & PHASE_MASK)); ++i);
-               PRINTP("Phase %s\n" ANDP phases[i].name);
-       }
-
-       if (!hostdata->connected) {
-               PRINTP("No currently connected command\n");
-       } else {
-               sprint_Scsi_Cmnd(m, (Scsi_Cmnd *) hostdata->connected);
-       }
-
-       PRINTP("issue_queue\n");
-
-       for (ptr = (Scsi_Cmnd *) hostdata->issue_queue; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
-               sprint_Scsi_Cmnd(m, ptr);
-
-       PRINTP("disconnected_queue\n");
-
-       for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble)
-               sprint_Scsi_Cmnd(m, ptr);
-
-       spin_unlock_irqrestore(scsi_ptr->host_lock, flags);
-       return 0;
-}
-
-#undef PRINTP
-#undef ANDP
-
 static struct scsi_host_template driver_template = {
        .show_info              = generic_NCR5380_show_info,
-       .name                   = "Generic NCR5380/NCR53C400 Scsi Driver",
+       .name                   = "Generic NCR5380/NCR53C400 SCSI",
        .detect                 = generic_NCR5380_detect,
        .release                = generic_NCR5380_release_resources,
        .info                   = generic_NCR5380_info,
index e15b95c37860e955debbe6d60811b3ec18f3353b..b1c7ae1204d81f5ec60237483772bad18680a55b 100644 (file)
 #define NCR5380_bus_reset generic_NCR5380_bus_reset
 #define NCR5380_pread generic_NCR5380_pread
 #define NCR5380_pwrite generic_NCR5380_pwrite
+#define NCR5380_info generic_NCR5380_info
+#define NCR5380_show_info generic_NCR5380_show_info
 
 #define BOARD_NCR5380  0
 #define BOARD_NCR53C400        1
index 5d8d75c619cdb6963d51edc5bd0607883e152495..a27216d534ed487ff416a455bd02b35f7ed79029 100644 (file)
@@ -236,16 +236,6 @@ int __init macscsi_detect(struct scsi_host_template * tpnt)
            instance->irq = NO_IRQ;
        }
 
-    printk(KERN_INFO "scsi%d: generic 5380 at port %lX irq", instance->host_no, instance->io_port);
-    if (instance->irq == NO_IRQ)
-       printk (KERN_INFO "s disabled");
-    else
-       printk (KERN_INFO " %d", instance->irq);
-    printk(KERN_INFO " options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d",
-          instance->can_queue, instance->cmd_per_lun, MACSCSI_PUBLIC_RELEASE);
-    printk(KERN_INFO "\nscsi%d:", instance->host_no);
-    NCR5380_print_options(instance);
-    printk("\n");
     called = 1;
     return 1;
 }
@@ -297,10 +287,6 @@ static void mac_scsi_reset_boot(struct Scsi_Host *instance)
 }
 #endif
 
-const char * macscsi_info (struct Scsi_Host *spnt) {
-       return "";
-}
-
 /* 
    Pseudo-DMA: (Ove Edlund)
    The code attempts to catch bus errors that occur if one for example
index 0b123fe9c24828d2d11a3ea663a10f2c49cccc92..66b34dbdc0d06ede3b88a2ad578227440c9705ee 100644 (file)
@@ -53,6 +53,7 @@
 #define NCR5380_queue_command macscsi_queue_command
 #define NCR5380_abort macscsi_abort
 #define NCR5380_bus_reset macscsi_bus_reset
+#define NCR5380_info macscsi_info
 #define NCR5380_show_info macscsi_show_info
 #define NCR5380_write_info macscsi_write_info
 
index 3782091f82cba2e4885087e686e19b4da3adb193..51766895e90e3b622959cd9ec4e71c92857b98d4 100644 (file)
@@ -438,17 +438,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 == NO_IRQ)
-           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;
     }
@@ -586,6 +575,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,
index 489acb5bf299f6525d654692bb473384fbf1dec8..bf589850e8ca3ce280227df1522709bc87d5a86b 100644 (file)
 #define NCR5380_queue_command pas16_queue_command
 #define NCR5380_abort pas16_abort
 #define NCR5380_bus_reset pas16_bus_reset
+#define NCR5380_info pas16_info
 #define NCR5380_show_info pas16_show_info
 #define NCR5380_write_info pas16_write_info
 
index b00d97557cff8efaec1fe5d055ec5661b6e31cb3..97cd0071c9aa8fe27806a6c9e6f937ab61b764fa 100644 (file)
  * be able to coexist with appropriate changes to the high level
  * SCSI code.  
  *
- * A NCR5380_PUBLIC_REVISION macro is provided, with the release
- * number (updated for each public release) printed by the 
- * NCR5380_print_options command, which should be called from the 
- * wrapper detect function, so that I know what release of the driver
- * users are using.
- *
  * Issues specific to the NCR5380 : 
  *
  * When used in a PIO or pseudo-dma mode, the NCR5380 is a braindead 
  * NCR5380_queue_command
  * NCR5380_reset
  * NCR5380_abort
- * NCR5380_proc_info
  *
  * to be the global entry points into the specific driver, ie 
  * #define NCR5380_queue_command t128_queue_command.
  * The generic driver is initialized by calling NCR5380_init(instance),
  * after setting the appropriate host specific fields and ID.  If the 
  * driver wishes to autoprobe for an IRQ line, the NCR5380_probe_irq(instance,
- * possible) function may be used.  Before the specific driver initialization
- * code finishes, NCR5380_print_options should be called.
+ * possible) function may be used.
  */
 
 static struct Scsi_Host *first_instance = NULL;
@@ -616,30 +608,49 @@ static inline void NCR5380_all_init (void)
     }
 }
 
-/*
- * Function : void NCR58380_print_options (struct Scsi_Host *instance)
+/**
+ * NCR58380_info - report driver and host information
+ * @instance: relevant scsi host instance
  *
- * Purpose : called by probe code indicating the NCR5380 driver
- *          options that were selected.
+ * For use as the host template info() handler.
  *
- * Inputs : instance, pointer to this instance.  Unused.
+ * Locks: none
  */
 
-static void __init NCR5380_print_options (struct Scsi_Host *instance)
+static const char *NCR5380_info(struct Scsi_Host *instance)
 {
-    printk(" generic options"
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
+
+       return hostdata->info;
+}
+
+static void prepare_info(struct Scsi_Host *instance)
+{
+       struct NCR5380_hostdata *hostdata = shost_priv(instance);
+
+       snprintf(hostdata->info, sizeof(hostdata->info),
+                "%s, io_port 0x%lx, n_io_port %d, "
+                "base 0x%lx, irq %d, "
+                "can_queue %d, cmd_per_lun %d, "
+                "sg_tablesize %d, this_id %d, "
+                "options { %s} ",
+                instance->hostt->name, instance->io_port, instance->n_io_port,
+                instance->base, instance->irq,
+                instance->can_queue, instance->cmd_per_lun,
+                instance->sg_tablesize, instance->this_id,
+#ifdef DIFFERENTIAL
+                "DIFFERENTIAL "
+#endif
 #ifdef REAL_DMA
-    " REAL DMA"
+                "REAL_DMA "
 #endif
 #ifdef PARITY
-    " PARITY"
+                "PARITY "
 #endif
 #ifdef SUPPORT_TAGS
-    " SCSI-2 TAGGED QUEUING"
+                "SUPPORT_TAGS "
 #endif
-    );
-    printk(" generic release=%d", NCR5380_PUBLIC_RELEASE);
+                "");
 }
 
 /*
@@ -784,7 +795,9 @@ static int __init NCR5380_init(struct Scsi_Host *instance, int flags)
        the_template = instance->hostt;
        first_instance = instance;
     }
-       
+
+    prepare_info(instance);
+
     NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
     NCR5380_write(MODE_REG, MR_BASE);
     NCR5380_write(TARGET_COMMAND_REG, 0);
index 3e6386252953bdd698b08d7fc34c8a4777b1d395..9bae5f6122a792553462ac5748b95ac1a867aff2 100644 (file)
@@ -286,19 +286,6 @@ static int __init sun3scsi_detect(struct scsi_host_template *tpnt)
 #endif
        }
        
-       pr_info("scsi%d: %s at port %lX irq", instance->host_no,
-               tpnt->proc_name, instance->io_port);
-       if (instance->irq == NO_IRQ)
-               printk ("s disabled");
-       else
-               printk (" %d", instance->irq);
-       printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d",
-              instance->can_queue, instance->cmd_per_lun,
-              SUN3SCSI_PUBLIC_RELEASE);
-       printk("\nscsi%d:", instance->host_no);
-       NCR5380_print_options(instance);
-       printk("\n");
-
        dregs->csr = 0;
        udelay(SUN3_DMA_DELAY);
        dregs->csr = CSR_SCSI | CSR_FIFO | CSR_INTR;
@@ -380,11 +367,6 @@ static void sun3_scsi_reset_boot(struct Scsi_Host *instance)
 }
 #endif
 
-static const char *sun3scsi_info(struct Scsi_Host *spnt)
-{
-    return "";
-}
-
 // safe bits for the CSR
 #define CSR_GOOD 0x060f
 
index cb9d2a4884040a52dde8172e4264aa90c23f9da1..3b8a05ca3625f60edf7a1708a46e564d10738377 100644 (file)
@@ -74,6 +74,7 @@
 #define NCR5380_bus_reset sun3scsi_bus_reset
 #define NCR5380_abort sun3scsi_abort
 #define NCR5380_show_info sun3scsi_show_info
+#define NCR5380_info sun3scsi_info
 #define NCR5380_dma_xfer_len(i, cmd, phase) \
         sun3scsi_dma_xfer_len(cmd->SCp.this_residual,cmd,((phase) & SR_IO) ? 0 : 1)
 
index ad833689b3110608ec1052e6129a2fb816810e20..60aff4ed4cbf67ab1516d1b5b3650293a02ca16f 100644 (file)
@@ -249,16 +249,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 == NO_IRQ)
-           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;
     }
@@ -411,6 +401,7 @@ static struct scsi_host_template driver_template = {
        .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,
index 9f06c1851069880600c85b25b03325dee80c8d46..806dda75820a78d22f195558ac493534b880375b 100644 (file)
 #define NCR5380_queue_command t128_queue_command
 #define NCR5380_abort t128_abort
 #define NCR5380_bus_reset t128_bus_reset
+#define NCR5380_info t128_info
 #define NCR5380_show_info t128_show_info
 #define NCR5380_write_info t128_write_info