[80] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

More seagate cleanups

daemon@ATHENA.MIT.EDU (Paul Gortmaker)
Tue Feb 21 21:51:49 1995

From: Paul Gortmaker <paul@rasty.anu.edu.au>
To: linux-scsi@vger.rutgers.edu
Date: Tue, 21 Feb 1995 16:09:31 +1000 (EST)
Cc: linux-activists@niksula.hut.fi (linux)

	Shoulda lumped these into the /proc/interrupts fix. Oh well.

The driver gratuitously printed "scsi%d" when booting, even though
the upper layers now do this. (so you get it twice) Also, somebody 
added printing the driver options in seagate_info() which blows the 
const char buffer up to a needless 256 bytes. I moved these options 
out of seagate_info() so that they are still printed at boot after
a sucessful detection, but are not stored in the string, cutting it 
back to 64 bytes (worst case at the moment is 45 bytes, so there is 
still extra space for safety)

Old output at boot:

FDC 0 is a 8272A
scsi0 : scsi0 : TMC-8XX/TMC-950 at irq 5 address 000de000 options : ARBITRATE SL
OW_HANDSHAKE FAST32

scsi : 1 host.

Note the  dual "scsi0" and the extra "\n" that creeped in as well. 
Now the new output:

FDC 0 is a 8272A
TMC-8XX/TMC-950 options: ARBITRATE SLOW_HANDSHAKE FAST32
scsi0 : TMC-8XX/TMC-950 at irq 5, address 0xDE000
scsi : 1 host.

Much nicer. Note the patch just looks big because diff isn't terribly
intelligent when you move chunks of code around.

Paul.


--- linux/drivers/scsi/seagate.c.orig	Tue Feb 21 14:50:05 1995
+++ linux/drivers/scsi/seagate.c	Tue Feb 21 15:47:31 1995
@@ -283,7 +283,7 @@
  *	First, we try for the manual override.
  */
 #ifdef DEBUG 
-	printk("Autodetecting seagate ST0x\n");
+	printk("Autodetecting ST0x / TMC-8xx\n");
 #endif
 	
 	if (hostno != -1)
@@ -357,39 +357,40 @@
 		borken_init();
 #endif
 		
-		return 1;
-		}
-	else
-		{
-#ifdef DEBUG
-		printk("ST0x not detected.\n");
-#endif
-		return 0;
-		}
-	}
-	 
-const char *seagate_st0x_info(struct Scsi_Host * shpnt) {
-      static char buffer[256];
-        sprintf(buffer, "scsi%d : %s at irq %d address %p options :"
+		printk("%s options:"
 #ifdef ARBITRATE
-" ARBITRATE"
+		" ARBITRATE"
 #endif
 #ifdef SLOW_HANDSHAKE
-" SLOW_HANDSHAKE"
+		" SLOW_HANDSHAKE"
 #endif
 #ifdef FAST
 #ifdef FAST32
-" FAST32"
+		" FAST32"
 #else
-" FAST"
+		" FAST"
 #endif
 #endif
- 
 #ifdef LINKED
-" LINKED"
+		" LINKED"
 #endif
-              "\n", hostno, (controller_type == SEAGATE) ? ST0X_ID_STR : 
-              FD_ID_STR, irq, base_address);
+              "\n", tpnt->name);
+		return 1;
+		}
+	else
+		{
+#ifdef DEBUG
+		printk("ST0x / TMC-8xx not detected.\n");
+#endif
+		return 0;
+		}
+	}
+	 
+const char *seagate_st0x_info(struct Scsi_Host * shpnt) {
+      static char buffer[64];
+        sprintf(buffer, "%s at irq %d, address 0x%05X", 
+		(controller_type == SEAGATE) ? ST0X_ID_STR : FD_ID_STR,
+		irq, (unsigned int)base_address);
         return buffer;
 }
 

home help back first fref pref prev next nref lref last post