linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NCR53C9x ESP: C99 designated initializers
@ 2002-11-03 10:46 Geert Uytterhoeven
  2002-11-03 13:13 ` Christoph Hellwig
  0 siblings, 1 reply; 17+ messages in thread
From: Geert Uytterhoeven @ 2002-11-03 10:46 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Kernel Development, Geert Uytterhoeven

NCR53C9x ESP: C99 designated initializers

--- linux-2.5.45/drivers/scsi/blz1230.h	Fri Nov  1 12:49:23 2002
+++ linux-m68k-2.5.45/drivers/scsi/blz1230.h	Sun Nov  3 10:58:48 2002
@@ -57,19 +57,21 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			 int hostno, int inout);
 
-#define SCSI_BLZ1230      { proc_name:		"esp-blz1230", \
-			    proc_info:		esp_proc_info, \
-			    name:		"Blizzard1230 SCSI IV", \
-			    detect:		blz1230_esp_detect, \
-			    release:		blz1230_esp_release, \
-			    command:		esp_command, \
-			    queuecommand:	esp_queue, \
-			    eh_abort_handler:		esp_abort, \
-			    eh_bus_reset_handler:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
+#define SCSI_BLZ1230	{						\
+		.proc_name		= "esp-blz1230",		\
+		.proc_info		= esp_proc_info,		\
+		.name			= "Blizzard1230 SCSI IV",	\
+		.detect			= blz1230_esp_detect,		\
+		.release		= blz1230_esp_release,		\
+		.command		= esp_command,			\
+		.queuecommand		= esp_queue,			\
+		.eh_abort_handler	= esp_abort,			\
+		.eh_bus_reset_handler	= esp_reset,			\
+		.can_queue		= 7,				\
+		.this_id		= 7,				\
+		.sg_tablesize		= SG_ALL,			\
+		.cmd_per_lun		= 1,				\
+		.use_clustering		= ENABLE_CLUSTERING		\
+}
 
 #endif /* BLZ1230_H */
--- linux-2.5.45/drivers/scsi/blz2060.h	Fri Nov  1 12:49:23 2002
+++ linux-m68k-2.5.45/drivers/scsi/blz2060.h	Sun Nov  3 10:59:03 2002
@@ -53,18 +53,20 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			 int hostno, int inout);
 
-#define SCSI_BLZ2060      { proc_name:		"esp-blz2060", \
-			    proc_info:		esp_proc_info, \
-			    name:		"Blizzard2060 SCSI", \
-			    detect:		blz2060_esp_detect, \
-			    release:		blz2060_esp_release, \
-			    queuecommand:	esp_queue, \
-			    eh_abort_handler:		esp_abort, \
-			    eh_bus_reset_handler:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
+#define SCSI_BLZ2060	{					\
+		.proc_name		= "esp-blz2060",	\
+		.proc_info		= esp_proc_info,	\
+		.name			= "Blizzard2060 SCSI",	\
+		.detect			= blz2060_esp_detect,	\
+		.release		= blz2060_esp_release,	\
+		.queuecommand		= esp_queue,		\
+		.eh_abort_handler	= esp_abort,		\
+		.eh_bus_reset_handler	= esp_reset,		\
+		.can_queue		= 7,			\
+		.this_id		= 7,			\
+		.sg_tablesize		= SG_ALL,		\
+		.cmd_per_lun		= 1,			\
+		.use_clustering		= ENABLE_CLUSTERING	\
+}
 
 #endif /* BLZ2060_H */
--- linux-2.5.45/drivers/scsi/cyberstorm.h	Fri Nov  1 12:49:23 2002
+++ linux-m68k-2.5.45/drivers/scsi/cyberstorm.h	Sun Nov  3 10:59:23 2002
@@ -56,18 +56,20 @@
 			 int hostno, int inout);
 
 
-#define SCSI_CYBERSTORM   { proc_name:		"esp-cyberstorm", \
-			    proc_info:		esp_proc_info, \
-			    name:		"CyberStorm SCSI", \
-			    detect:		cyber_esp_detect, \
-			    release:		cyber_esp_release, \
-			    queuecommand:	esp_queue, \
-			    eh_abort_handler:		esp_abort, \
-			    eh_bus_reset_handler:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
+#define SCSI_CYBERSTORM	{					\
+		.proc_name		= "esp-cyberstorm",	\
+		.proc_info		= esp_proc_info,	\
+		.name			= "CyberStorm SCSI",	\
+		.detect			= cyber_esp_detect,	\
+		.release		= cyber_esp_release,	\
+		.queuecommand		= esp_queue,		\
+		.eh_abort_handler	= esp_abort,		\
+		.eh_bus_reset_handler	= esp_reset,		\
+		.can_queue		= 7,			\
+		.this_id		= 7,			\
+		.sg_tablesize		= SG_ALL,		\
+		.cmd_per_lun		= 1,			\
+		.use_clustering		= ENABLE_CLUSTERING	\
+}
 
 #endif /* CYBER_ESP_H */
--- linux-2.5.45/drivers/scsi/cyberstormII.h	Fri Nov  1 12:49:23 2002
+++ linux-m68k-2.5.45/drivers/scsi/cyberstormII.h	Sun Nov  3 10:59:38 2002
@@ -43,18 +43,20 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			 int hostno, int inout);
 
-#define SCSI_CYBERSTORMII { proc_name:		"esp-cyberstormII", \
-			    proc_info:		esp_proc_info, \
-			    name:		"CyberStorm Mk II SCSI", \
-			    detect:		cyberII_esp_detect, \
-			    release:		cyberII_esp_release, \
-			    queuecommand:	esp_queue, \
-			    eh_abort_handler:		esp_abort, \
-			    eh_bus_reset_handler:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
+#define SCSI_CYBERSTORMII	{					\
+		.proc_name		= "esp-cyberstormII",		\
+		.proc_info		= esp_proc_info,		\
+		.name			= "CyberStorm Mk II SCSI",	\
+		.detect			= cyberII_esp_detect,		\
+		.release		= cyberII_esp_release,		\
+		.queuecommand		= esp_queue,			\
+		.eh_abort_handler	= esp_abort,			\
+		.eh_bus_reset_handler	= esp_reset,			\
+		.can_queue		= 7,				\
+		.this_id		= 7,				\
+		.sg_tablesize		= SG_ALL,			\
+		.cmd_per_lun		= 1,				\
+		.use_clustering		= ENABLE_CLUSTERING		\
+}
 
 #endif /* CYBERII_ESP_H */
--- linux-2.5.45/drivers/scsi/dec_esp.h	Fri Nov  1 12:49:24 2002
+++ linux-m68k-2.5.45/drivers/scsi/dec_esp.h	Sun Nov  3 11:00:01 2002
@@ -26,20 +26,21 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			 int hostno, int inout);
 
-#define SCSI_DEC_ESP {                                         \
-		proc_name:      "esp",				\
-		proc_info:      &esp_proc_info,			\
-		name:           "NCR53C94",			\
-		detect:         dec_esp_detect,			\
-		info:           esp_info,			\
-		command:        esp_command,			\
-		queuecommand:   esp_queue,			\
-		eh_abort_handler:          esp_abort,			\
-		eh_bus_reset_handler:          esp_reset,			\
-		can_queue:      7,				\
-		this_id:        7,				\
-		sg_tablesize:   SG_ALL,				\
-		cmd_per_lun:    1,				\
-		use_clustering: DISABLE_CLUSTERING, }
+#define SCSI_DEC_ESP	{					\
+		.proc_name		= "esp",		\
+		.proc_info		= &esp_proc_info,	\
+		.name			= "NCR53C94",		\
+		.detect			= dec_esp_detect,	\
+		.info			= esp_info,		\
+		.command		= esp_command,		\
+		.queuecommand		= esp_queue,		\
+		.eh_abort_handler	= esp_abort,		\
+		.eh_bus_reset_handler	= esp_reset,		\
+		.can_queue		= 7,			\
+		.this_id		= 7,			\
+		.sg_tablesize		= SG_ALL,		\
+		.cmd_per_lun		= 1,			\
+		.use_clustering		= DISABLE_CLUSTERING,	\
+}
 
 #endif /* DEC_ESP_H */
--- linux-2.5.45/drivers/scsi/fastlane.h	Fri Nov  1 12:49:24 2002
+++ linux-m68k-2.5.45/drivers/scsi/fastlane.h	Sun Nov  3 11:00:15 2002
@@ -48,18 +48,20 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			 int hostno, int inout);
 
-#define SCSI_FASTLANE     { proc_name:		"esp-fastlane", \
-			    proc_info:		esp_proc_info, \
-			    name:		"Fastlane SCSI", \
-			    detect:		fastlane_esp_detect, \
-			    release:		fastlane_esp_release, \
-			    queuecommand:	esp_queue, \
-			    eh_abort_handler:		esp_abort, \
-			    eh_bus_reset_handler:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
+#define SCSI_FASTLANE	{					\
+		.proc_name		= "esp-fastlane",	\
+		.proc_info		= esp_proc_info,	\
+		.name			= "Fastlane SCSI",	\
+		.detect			= fastlane_esp_detect,	\
+		.release		= fastlane_esp_release,	\
+		.queuecommand		= esp_queue,		\
+		.eh_abort_handler	= esp_abort,		\
+		.eh_bus_reset_handler	= esp_reset,		\
+		.can_queue		= 7,			\
+		.this_id		= 7,			\
+		.sg_tablesize		= SG_ALL,		\
+		.cmd_per_lun		= 1,			\
+		.use_clustering		= ENABLE_CLUSTERING	\
+}
 
 #endif /* FASTLANE_H */
--- linux-2.5.45/drivers/scsi/jazz_esp.h	Fri Nov  1 12:49:24 2002
+++ linux-m68k-2.5.45/drivers/scsi/jazz_esp.h	Sun Nov  3 11:00:41 2002
@@ -20,20 +20,21 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			 int hostno, int inout);
 
-#define SCSI_JAZZ_ESP {                                         \
-		proc_name:      "esp",				\
-		proc_info:      &esp_proc_info,			\
-		name:           "ESP 100/100a/200",		\
-		detect:         jazz_esp_detect,		\
-		info:           esp_info,			\
-		command:        esp_command,			\
-		queuecommand:   esp_queue,			\
-		eh_abort_handler:          esp_abort,			\
-		eh_bus_reset_handler:          esp_reset,			\
-		can_queue:      7,				\
-		this_id:        7,				\
-		sg_tablesize:   SG_ALL,				\
-		cmd_per_lun:    1,				\
-		use_clustering: DISABLE_CLUSTERING, }
+#define SCSI_JAZZ_ESP	{					\
+		.proc_name		= "esp",		\
+		.proc_info		= &esp_proc_info,	\
+		.name			= "ESP 100/100a/200",	\
+		.detect			= jazz_esp_detect,	\
+		.info			= esp_info,		\
+		.command		= esp_command,		\
+		.queuecommand		= esp_queue,		\
+		.eh_abort_handler	= esp_abort,		\
+		.eh_bus_reset_handler	= esp_reset,		\
+		.can_queue		= 7,			\
+		.this_id		= 7,			\
+		.sg_tablesize		= SG_ALL,		\
+		.cmd_per_lun		= 1,			\
+		.use_clustering		= DISABLE_CLUSTERING,	\
+}
 
 #endif /* JAZZ_ESP_H */
--- linux-2.5.45/drivers/scsi/mac_esp.h	Fri Nov  1 12:49:24 2002
+++ linux-m68k-2.5.45/drivers/scsi/mac_esp.h	Sun Nov  3 11:00:57 2002
@@ -21,20 +21,22 @@
 extern int esp_reset(Scsi_Cmnd *);
 
 
-#define SCSI_MAC_ESP      { proc_name:		"esp", \
-			    name:		"Mac 53C9x SCSI", \
-			    detect:		mac_esp_detect, \
-			    release:		NULL, \
-			    info:		esp_info, \
-			    /* command:		esp_command, */ \
-			    queuecommand:	esp_queue, \
-			    eh_abort_handler:		esp_abort, \
-			    eh_bus_reset_handler:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	DISABLE_CLUSTERING }
+#define SCSI_MAC_ESP	{					\
+		.proc_name		= "esp",		\
+		.name			= "Mac 53C9x SCSI",	\
+		.detect			= mac_esp_detect,	\
+		.release		= NULL,			\
+		.info			= esp_info,		\
+		/* .command		= esp_command, */	\
+		.queuecommand		= esp_queue,		\
+		.eh_abort_handler	= esp_abort,		\
+		.eh_bus_reset_handler	= esp_reset,		\
+		.can_queue		= 7,			\
+		.this_id		= 7,			\
+		.sg_tablesize		= SG_ALL,		\
+		.cmd_per_lun		= 1,			\
+		.use_clustering		= DISABLE_CLUSTERING	\
+}
 
 #endif /* MAC_ESP_H */
 
--- linux-2.5.45/drivers/scsi/mca_53c9x.h	Fri Nov  1 12:49:24 2002
+++ linux-m68k-2.5.45/drivers/scsi/mca_53c9x.h	Sun Nov  3 11:01:09 2002
@@ -31,18 +31,20 @@
 			 int hostno, int inout);
 
 
-#define MCA_53C9X         { proc_name:		"esp", \
-			    name:		"NCR 53c9x SCSI", \
-			    detect:		mca_esp_detect, \
-			    release:		mca_esp_release, \
-			    queuecommand:	esp_queue, \
-			    eh_abort_handler:		esp_abort, \
-			    eh_bus_reset_handler:		esp_reset, \
-			    can_queue:          7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-                            unchecked_isa_dma:  1, \
-			    use_clustering:	DISABLE_CLUSTERING }
+#define MCA_53C9X	{					\
+		.proc_name		= "esp",		\
+		.name			= "NCR 53c9x SCSI",	\
+		.detect			= mca_esp_detect,	\
+		.release		= mca_esp_release,	\
+		.queuecommand		= esp_queue,		\
+		.eh_abort_handler	= esp_abort,		\
+		.eh_bus_reset_handler	= esp_reset,		\
+		.can_queue		= 7,			\
+		.sg_tablesize		= SG_ALL,		\
+		.cmd_per_lun		= 1,			\
+		.unchecked_isa_dma	= 1,			\
+		.use_clustering		= DISABLE_CLUSTERING	\
+}
 
 /* Ports the ncr's 53c94 can be put at; indexed by pos register value */
 
--- linux-2.5.45/drivers/scsi/oktagon_esp.h	Fri Nov  1 12:49:24 2002
+++ linux-m68k-2.5.45/drivers/scsi/oktagon_esp.h	Sun Nov  3 11:01:23 2002
@@ -39,19 +39,20 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			int hostno, int inout);
 
-#define SCSI_OKTAGON_ESP {                       \
-   proc_name:           "esp-oktagon",           \
-   proc_info:           &esp_proc_info,          \
-   name:                "BSC Oktagon SCSI",      \
-   detect:              oktagon_esp_detect,      \
-   release:             oktagon_esp_release,     \
-   queuecommand:        esp_queue,               \
-   eh_abort_handler:               esp_abort,               \
-   eh_bus_reset_handler:               esp_reset,               \
-   can_queue:           7,                       \
-   this_id:             7,                       \
-   sg_tablesize:        SG_ALL,                  \
-   cmd_per_lun:         1,                       \
-   use_clustering:      ENABLE_CLUSTERING }
+#define SCSI_OKTAGON_ESP	{				\
+		.proc_name		= "esp-oktagon",	\
+		.proc_info		= &esp_proc_info,	\
+		.name			= "BSC Oktagon SCSI",	\
+		.detect			= oktagon_esp_detect,	\
+		.release		= oktagon_esp_release,	\
+		.queuecommand		= esp_queue,		\
+		.eh_abort_handler	= esp_abort,		\
+		.eh_bus_reset_handler	= esp_reset,		\
+		.can_queue		= 7,			\
+		.this_id		= 7,			\
+		.sg_tablesize		= SG_ALL,		\
+		.cmd_per_lun		= 1,			\
+		.use_clustering		= ENABLE_CLUSTERING	\
+}
 
 #endif /* OKTAGON_ESP_H */
--- linux-2.5.45/drivers/scsi/sun3x_esp.h	Fri Nov  1 12:49:24 2002
+++ linux-m68k-2.5.45/drivers/scsi/sun3x_esp.h	Sun Nov  3 11:01:46 2002
@@ -20,20 +20,21 @@
 
 #define DMA_PORTS_P        (dregs->cond_reg & DMA_INT_ENAB)
 
-#define SCSI_SUN3X_ESP {                                        \
-		proc_name:      "esp",  			\
-		proc_info:      &esp_proc_info,			\
-		name:           "Sun ESP 100/100a/200",		\
-		detect:         sun3x_esp_detect,		\
-		info:           esp_info,			\
-		command:        esp_command,			\
-		queuecommand:   esp_queue,			\
-		eh_abort_handler:          esp_abort,			\
-		eh_bus_reset_handler:          esp_reset,			\
-		can_queue:      7,				\
-		this_id:        7,				\
-		sg_tablesize:   SG_ALL,				\
-		cmd_per_lun:    1,				\
-		use_clustering: DISABLE_CLUSTERING, }
+#define SCSI_SUN3X_ESP	{						\
+		.proc_name		= "esp",			\
+		.proc_info		= &esp_proc_info,		\
+		.name			= "Sun ESP 100/100a/200",	\
+		.detect			= sun3x_esp_detect,		\
+		.info			= esp_info,			\
+		.command		= esp_command,			\
+		.queuecommand		= esp_queue,			\
+		.eh_abort_handler	= esp_abort,			\
+		.eh_bus_reset_handler	= esp_reset,			\
+		.can_queue		= 7,				\
+		.this_id		= 7,				\
+		.sg_tablesize		= SG_ALL,			\
+		.cmd_per_lun		= 1,				\
+		.use_clustering		= DISABLE_CLUSTERING,		\
+}
 
 #endif /* !(_SUN3X_ESP_H) */

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-03 10:46 [PATCH] NCR53C9x ESP: C99 designated initializers Geert Uytterhoeven
@ 2002-11-03 13:13 ` Christoph Hellwig
  2002-11-03 14:28   ` Geert Uytterhoeven
  0 siblings, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2002-11-03 13:13 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linus Torvalds, Linux Kernel Development

On Sun, Nov 03, 2002 at 11:46:48AM +0100, Geert Uytterhoeven wrote:
> NCR53C9x ESP: C99 designated initializers

Please move the host template to the C file instead of the header
if you touch it.  Having them in the header and the methods exported
was needed in 2.2, but that's long ago..


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-03 13:13 ` Christoph Hellwig
@ 2002-11-03 14:28   ` Geert Uytterhoeven
  2002-11-03 14:33     ` Christoph Hellwig
  0 siblings, 1 reply; 17+ messages in thread
From: Geert Uytterhoeven @ 2002-11-03 14:28 UTC (permalink / raw)
  To: Christoph Hellwig, Linus Torvalds; +Cc: Linux Kernel Development

On Sun, 3 Nov 2002, Christoph Hellwig wrote:
> On Sun, Nov 03, 2002 at 11:46:48AM +0100, Geert Uytterhoeven wrote:
> > NCR53C9x ESP: C99 designated initializers
> 
> Please move the host template to the C file instead of the header
> if you touch it.  Having them in the header and the methods exported
> was needed in 2.2, but that's long ago..

At your service :-)
Except for the MIPS JAZZ driver, since SCSI_JAZZ_ESP is not actually used
anymore, probably due to bit rot.

Subject: [PATCH] NCR53C9x ESP: C99 designated initializers and host templates

NCR53C9x ESP:
  - C99 designated initializers
  - Move NCR53C9x ESP host templates from the header files to the source files.

--- linux-2.5.45/drivers/scsi/blz1230.c	Mon May 13 10:55:33 2002
+++ linux-m68k-2.5.45/drivers/scsi/blz1230.c	Sun Nov  3 15:15:59 2002
@@ -281,7 +281,23 @@
 
 #include "blz1230.h"
 
-static Scsi_Host_Template driver_template = SCSI_BLZ1230;
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp-blz1230",
+	.proc_info		= esp_proc_info,
+	.name			= "Blizzard1230 SCSI IV",
+	.detect			= blz1230_esp_detect,
+	.release		= blz1230_esp_release,
+	.command		= esp_command,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING
+};
+
 
 #include "scsi_module.c"
 
--- linux-2.5.45/drivers/scsi/blz1230.h	Sun Nov  3 15:21:52 2002
+++ linux-m68k-2.5.45/drivers/scsi/blz1230.h	Sun Nov  3 15:15:59 2002
@@ -57,19 +57,4 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			 int hostno, int inout);
 
-#define SCSI_BLZ1230      { proc_name:		"esp-blz1230", \
-			    proc_info:		esp_proc_info, \
-			    name:		"Blizzard1230 SCSI IV", \
-			    detect:		blz1230_esp_detect, \
-			    release:		blz1230_esp_release, \
-			    command:		esp_command, \
-			    queuecommand:	esp_queue, \
-			    eh_abort_handler:		esp_abort, \
-			    eh_bus_reset_handler:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
-
 #endif /* BLZ1230_H */
--- linux-2.5.45/drivers/scsi/blz2060.c	Mon May 13 10:55:33 2002
+++ linux-m68k-2.5.45/drivers/scsi/blz2060.c	Sun Nov  3 15:15:59 2002
@@ -238,7 +238,22 @@
 
 #include "blz2060.h"
 
-static Scsi_Host_Template driver_template = SCSI_BLZ2060;
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp-blz2060",
+	.proc_info		= esp_proc_info,
+	.name			= "Blizzard2060 SCSI",
+	.detect			= blz2060_esp_detect,
+	.release		= blz2060_esp_release,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING
+};
+
 
 #include "scsi_module.c"
 
--- linux-2.5.45/drivers/scsi/blz2060.h	Sun Nov  3 15:21:52 2002
+++ linux-m68k-2.5.45/drivers/scsi/blz2060.h	Sun Nov  3 15:15:59 2002
@@ -53,18 +53,4 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			 int hostno, int inout);
 
-#define SCSI_BLZ2060      { proc_name:		"esp-blz2060", \
-			    proc_info:		esp_proc_info, \
-			    name:		"Blizzard2060 SCSI", \
-			    detect:		blz2060_esp_detect, \
-			    release:		blz2060_esp_release, \
-			    queuecommand:	esp_queue, \
-			    eh_abort_handler:		esp_abort, \
-			    eh_bus_reset_handler:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
-
 #endif /* BLZ2060_H */
--- linux-2.5.45/drivers/scsi/cyberstorm.c	Mon May 13 10:55:33 2002
+++ linux-m68k-2.5.45/drivers/scsi/cyberstorm.c	Sun Nov  3 15:15:59 2002
@@ -304,7 +304,22 @@
 
 #include "cyberstorm.h"
 
-static Scsi_Host_Template driver_template = SCSI_CYBERSTORM;
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp-cyberstorm",
+	.proc_info		= esp_proc_info,
+	.name			= "CyberStorm SCSI",
+	.detect			= cyber_esp_detect,
+	.release		= cyber_esp_release,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING
+};
+
 
 #include "scsi_module.c"
 
--- linux-2.5.45/drivers/scsi/cyberstorm.h	Sun Nov  3 15:21:52 2002
+++ linux-m68k-2.5.45/drivers/scsi/cyberstorm.h	Sun Nov  3 15:15:59 2002
@@ -55,19 +55,4 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			 int hostno, int inout);
 
-
-#define SCSI_CYBERSTORM   { proc_name:		"esp-cyberstorm", \
-			    proc_info:		esp_proc_info, \
-			    name:		"CyberStorm SCSI", \
-			    detect:		cyber_esp_detect, \
-			    release:		cyber_esp_release, \
-			    queuecommand:	esp_queue, \
-			    eh_abort_handler:		esp_abort, \
-			    eh_bus_reset_handler:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
-
 #endif /* CYBER_ESP_H */
--- linux-2.5.45/drivers/scsi/cyberstormII.c	Mon May 13 10:55:33 2002
+++ linux-m68k-2.5.45/drivers/scsi/cyberstormII.c	Sun Nov  3 15:15:59 2002
@@ -254,7 +254,22 @@
 
 #include "cyberstormII.h"
 
-static Scsi_Host_Template driver_template = SCSI_CYBERSTORMII;
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp-cyberstormII",
+	.proc_info		= esp_proc_info,
+	.name			= "CyberStorm Mk II SCSI",
+	.detect			= cyberII_esp_detect,
+	.release		= cyberII_esp_release,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING
+};
+
 
 #include "scsi_module.c"
 
--- linux-2.5.45/drivers/scsi/cyberstormII.h	Sun Nov  3 15:21:52 2002
+++ linux-m68k-2.5.45/drivers/scsi/cyberstormII.h	Sun Nov  3 15:15:59 2002
@@ -43,18 +43,4 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			 int hostno, int inout);
 
-#define SCSI_CYBERSTORMII { proc_name:		"esp-cyberstormII", \
-			    proc_info:		esp_proc_info, \
-			    name:		"CyberStorm Mk II SCSI", \
-			    detect:		cyberII_esp_detect, \
-			    release:		cyberII_esp_release, \
-			    queuecommand:	esp_queue, \
-			    eh_abort_handler:		esp_abort, \
-			    eh_bus_reset_handler:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
-
 #endif /* CYBERII_ESP_H */
--- linux-2.5.45/drivers/scsi/dec_esp.c	Fri Feb  1 09:36:52 2002
+++ linux-m68k-2.5.45/drivers/scsi/dec_esp.c	Sun Nov  3 15:15:59 2002
@@ -103,7 +103,23 @@
 
 static void scsi_dma_int(int, void *, struct pt_regs *);
 
-static Scsi_Host_Template driver_template = SCSI_DEC_ESP;
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp",
+	.proc_info		= &esp_proc_info,
+	.name			= "NCR53C94",
+	.detect			= dec_esp_detect,
+	.info			= esp_info,
+	.command		= esp_command,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= DISABLE_CLUSTERING,
+};
+
 
 #include "scsi_module.c"
 
--- linux-2.5.45/drivers/scsi/dec_esp.h	Sun Nov  3 15:21:52 2002
+++ linux-m68k-2.5.45/drivers/scsi/dec_esp.h	Sun Nov  3 15:15:59 2002
@@ -26,20 +26,4 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			 int hostno, int inout);
 
-#define SCSI_DEC_ESP {                                         \
-		proc_name:      "esp",				\
-		proc_info:      &esp_proc_info,			\
-		name:           "NCR53C94",			\
-		detect:         dec_esp_detect,			\
-		info:           esp_info,			\
-		command:        esp_command,			\
-		queuecommand:   esp_queue,			\
-		eh_abort_handler:          esp_abort,			\
-		eh_bus_reset_handler:          esp_reset,			\
-		can_queue:      7,				\
-		this_id:        7,				\
-		sg_tablesize:   SG_ALL,				\
-		cmd_per_lun:    1,				\
-		use_clustering: DISABLE_CLUSTERING, }
-
 #endif /* DEC_ESP_H */
--- linux-2.5.45/drivers/scsi/fastlane.c	Mon May 13 10:55:33 2002
+++ linux-m68k-2.5.45/drivers/scsi/fastlane.c	Sun Nov  3 15:15:59 2002
@@ -358,7 +358,23 @@
 
 #include "fastlane.h"
 
-static Scsi_Host_Template driver_template = SCSI_FASTLANE;
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp-fastlane",
+	.proc_info		= esp_proc_info,
+	.name			= "Fastlane SCSI",
+	.detect			= fastlane_esp_detect,
+	.release		= fastlane_esp_release,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING
+};
+
+
 #include "scsi_module.c"
 
 int fastlane_esp_release(struct Scsi_Host *instance)
--- linux-2.5.45/drivers/scsi/fastlane.h	Sun Nov  3 15:21:52 2002
+++ linux-m68k-2.5.45/drivers/scsi/fastlane.h	Sun Nov  3 15:15:59 2002
@@ -48,18 +48,4 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			 int hostno, int inout);
 
-#define SCSI_FASTLANE     { proc_name:		"esp-fastlane", \
-			    proc_info:		esp_proc_info, \
-			    name:		"Fastlane SCSI", \
-			    detect:		fastlane_esp_detect, \
-			    release:		fastlane_esp_release, \
-			    queuecommand:	esp_queue, \
-			    eh_abort_handler:		esp_abort, \
-			    eh_bus_reset_handler:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
-
 #endif /* FASTLANE_H */
--- linux-2.5.45/drivers/scsi/jazz_esp.h	Sun Nov  3 15:21:52 2002
+++ linux-m68k-2.5.45/drivers/scsi/jazz_esp.h	Sun Nov  3 11:07:28 2002
@@ -20,20 +20,21 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			 int hostno, int inout);
 
-#define SCSI_JAZZ_ESP {                                         \
-		proc_name:      "esp",				\
-		proc_info:      &esp_proc_info,			\
-		name:           "ESP 100/100a/200",		\
-		detect:         jazz_esp_detect,		\
-		info:           esp_info,			\
-		command:        esp_command,			\
-		queuecommand:   esp_queue,			\
-		eh_abort_handler:          esp_abort,			\
-		eh_bus_reset_handler:          esp_reset,			\
-		can_queue:      7,				\
-		this_id:        7,				\
-		sg_tablesize:   SG_ALL,				\
-		cmd_per_lun:    1,				\
-		use_clustering: DISABLE_CLUSTERING, }
+#define SCSI_JAZZ_ESP	{					\
+		.proc_name		= "esp",		\
+		.proc_info		= &esp_proc_info,	\
+		.name			= "ESP 100/100a/200",	\
+		.detect			= jazz_esp_detect,	\
+		.info			= esp_info,		\
+		.command		= esp_command,		\
+		.queuecommand		= esp_queue,		\
+		.eh_abort_handler	= esp_abort,		\
+		.eh_bus_reset_handler	= esp_reset,		\
+		.can_queue		= 7,			\
+		.this_id		= 7,			\
+		.sg_tablesize		= SG_ALL,		\
+		.cmd_per_lun		= 1,			\
+		.use_clustering		= DISABLE_CLUSTERING,	\
+}
 
 #endif /* JAZZ_ESP_H */
--- linux-2.5.45/drivers/scsi/mac_esp.c	Thu Jul 25 12:53:56 2002
+++ linux-m68k-2.5.45/drivers/scsi/mac_esp.c	Sun Nov  3 15:15:59 2002
@@ -710,7 +710,23 @@
 #endif
 }
 
-static Scsi_Host_Template driver_template = SCSI_MAC_ESP;
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp",
+	.name			= "Mac 53C9x SCSI",
+	.detect			= mac_esp_detect,
+	.release		= NULL,
+	.info			= esp_info,
+	/* .command		= esp_command, */
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= DISABLE_CLUSTERING
+};
+
 
 #include "scsi_module.c"
 
--- linux-2.5.45/drivers/scsi/mac_esp.h	Sun Nov  3 15:21:52 2002
+++ linux-m68k-2.5.45/drivers/scsi/mac_esp.h	Sun Nov  3 15:15:59 2002
@@ -20,21 +20,5 @@
 extern int esp_abort(Scsi_Cmnd *);
 extern int esp_reset(Scsi_Cmnd *);
 
-
-#define SCSI_MAC_ESP      { proc_name:		"esp", \
-			    name:		"Mac 53C9x SCSI", \
-			    detect:		mac_esp_detect, \
-			    release:		NULL, \
-			    info:		esp_info, \
-			    /* command:		esp_command, */ \
-			    queuecommand:	esp_queue, \
-			    eh_abort_handler:		esp_abort, \
-			    eh_bus_reset_handler:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	DISABLE_CLUSTERING }
-
 #endif /* MAC_ESP_H */
 
--- linux-2.5.45/drivers/scsi/mca_53c9x.c	Mon Feb 11 09:14:40 2002
+++ linux-m68k-2.5.45/drivers/scsi/mca_53c9x.c	Sun Nov  3 15:15:59 2002
@@ -419,7 +419,22 @@
 	outb(inb(PS2_SYS_CTR) & 0x3f, PS2_SYS_CTR);
 }
 
-static Scsi_Host_Template driver_template = MCA_53C9X;
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp",
+	.name			= "NCR 53c9x SCSI",
+	.detect			= mca_esp_detect,
+	.release		= mca_esp_release,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.unchecked_isa_dma	= 1,
+	.use_clustering		= DISABLE_CLUSTERING
+};
+
+
 #include "scsi_module.c"
 
 /*
--- linux-2.5.45/drivers/scsi/mca_53c9x.h	Sun Nov  3 15:21:52 2002
+++ linux-m68k-2.5.45/drivers/scsi/mca_53c9x.h	Sun Nov  3 15:15:59 2002
@@ -31,19 +31,6 @@
 			 int hostno, int inout);
 
 
-#define MCA_53C9X         { proc_name:		"esp", \
-			    name:		"NCR 53c9x SCSI", \
-			    detect:		mca_esp_detect, \
-			    release:		mca_esp_release, \
-			    queuecommand:	esp_queue, \
-			    eh_abort_handler:		esp_abort, \
-			    eh_bus_reset_handler:		esp_reset, \
-			    can_queue:          7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-                            unchecked_isa_dma:  1, \
-			    use_clustering:	DISABLE_CLUSTERING }
-
 /* Ports the ncr's 53c94 can be put at; indexed by pos register value */
 
 #define MCA_53C9X_IO_PORTS {                             \
--- linux-2.5.45/drivers/scsi/oktagon_esp.c	Mon Oct  7 22:04:40 2002
+++ linux-m68k-2.5.45/drivers/scsi/oktagon_esp.c	Sun Nov  3 15:15:59 2002
@@ -573,7 +573,22 @@
 
 #include "oktagon_esp.h"
 
-static Scsi_Host_Template driver_template = SCSI_OKTAGON_ESP;
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp-oktagon",
+	.proc_info		= &esp_proc_info,
+	.name			= "BSC Oktagon SCSI",
+	.detect			= oktagon_esp_detect,
+	.release		= oktagon_esp_release,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING
+};
+
 
 #include "scsi_module.c"
 
--- linux-2.5.45/drivers/scsi/oktagon_esp.h	Sun Nov  3 15:21:52 2002
+++ linux-m68k-2.5.45/drivers/scsi/oktagon_esp.h	Sun Nov  3 15:15:59 2002
@@ -39,19 +39,4 @@
 extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
 			int hostno, int inout);
 
-#define SCSI_OKTAGON_ESP {                       \
-   proc_name:           "esp-oktagon",           \
-   proc_info:           &esp_proc_info,          \
-   name:                "BSC Oktagon SCSI",      \
-   detect:              oktagon_esp_detect,      \
-   release:             oktagon_esp_release,     \
-   queuecommand:        esp_queue,               \
-   eh_abort_handler:               esp_abort,               \
-   eh_bus_reset_handler:               esp_reset,               \
-   can_queue:           7,                       \
-   this_id:             7,                       \
-   sg_tablesize:        SG_ALL,                  \
-   cmd_per_lun:         1,                       \
-   use_clustering:      ENABLE_CLUSTERING }
-
 #endif /* OKTAGON_ESP_H */
--- linux-2.5.45/drivers/scsi/sun3x_esp.c	Sun Nov  3 15:22:00 2002
+++ linux-m68k-2.5.45/drivers/scsi/sun3x_esp.c	Sun Nov  3 15:15:59 2002
@@ -374,7 +374,23 @@
     sp->SCp.ptr = (char *)((unsigned long)sp->SCp.buffer->dvma_address);
 }
 
-static Scsi_Host_Template driver_template = SCSI_SUN3X_ESP;
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp",
+	.proc_info		= &esp_proc_info,
+	.name			= "Sun ESP 100/100a/200",
+	.detect			= sun3x_esp_detect,
+	.info			= esp_info,
+	.command		= esp_command,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= DISABLE_CLUSTERING,
+};
+
 
 #include "scsi_module.c"
 
--- linux-2.5.45/drivers/scsi/sun3x_esp.h	Sun Nov  3 15:21:52 2002
+++ linux-m68k-2.5.45/drivers/scsi/sun3x_esp.h	Sun Nov  3 15:15:59 2002
@@ -20,20 +20,4 @@
 
 #define DMA_PORTS_P        (dregs->cond_reg & DMA_INT_ENAB)
 
-#define SCSI_SUN3X_ESP {                                        \
-		proc_name:      "esp",  			\
-		proc_info:      &esp_proc_info,			\
-		name:           "Sun ESP 100/100a/200",		\
-		detect:         sun3x_esp_detect,		\
-		info:           esp_info,			\
-		command:        esp_command,			\
-		queuecommand:   esp_queue,			\
-		eh_abort_handler:          esp_abort,			\
-		eh_bus_reset_handler:          esp_reset,			\
-		can_queue:      7,				\
-		this_id:        7,				\
-		sg_tablesize:   SG_ALL,				\
-		cmd_per_lun:    1,				\
-		use_clustering: DISABLE_CLUSTERING, }
-
 #endif /* !(_SUN3X_ESP_H) */

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-03 14:28   ` Geert Uytterhoeven
@ 2002-11-03 14:33     ` Christoph Hellwig
  2002-11-10 10:27       ` Geert Uytterhoeven
  0 siblings, 1 reply; 17+ messages in thread
From: Christoph Hellwig @ 2002-11-03 14:33 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Linus Torvalds, Linux Kernel Development

On Sun, Nov 03, 2002 at 03:28:55PM +0100, Geert Uytterhoeven wrote:
> On Sun, 3 Nov 2002, Christoph Hellwig wrote:
> > On Sun, Nov 03, 2002 at 11:46:48AM +0100, Geert Uytterhoeven wrote:
> > > NCR53C9x ESP: C99 designated initializers
> > 
> > Please move the host template to the C file instead of the header
> > if you touch it.  Having them in the header and the methods exported
> > was needed in 2.2, but that's long ago..
> 
> At your service :-)
> Except for the MIPS JAZZ driver, since SCSI_JAZZ_ESP is not actually used
> anymore, probably due to bit rot.

The patch looks fine, thanks.  Now if all scsi host driver maintainers
would do it this way.. :)


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-03 14:33     ` Christoph Hellwig
@ 2002-11-10 10:27       ` Geert Uytterhoeven
  2002-11-10 14:38         ` Alan Cox
  0 siblings, 1 reply; 17+ messages in thread
From: Geert Uytterhoeven @ 2002-11-10 10:27 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Linus Torvalds, Linux Kernel Development

On Sun, 3 Nov 2002, Christoph Hellwig wrote:
> On Sun, Nov 03, 2002 at 03:28:55PM +0100, Geert Uytterhoeven wrote:
> > On Sun, 3 Nov 2002, Christoph Hellwig wrote:
> > > On Sun, Nov 03, 2002 at 11:46:48AM +0100, Geert Uytterhoeven wrote:
> > > > NCR53C9x ESP: C99 designated initializers
> > > 
> > > Please move the host template to the C file instead of the header
> > > if you touch it.  Having them in the header and the methods exported
> > > was needed in 2.2, but that's long ago..
> > 
> > At your service :-)
> > Except for the MIPS JAZZ driver, since SCSI_JAZZ_ESP is not actually used
> > anymore, probably due to bit rot.
> 
> The patch looks fine, thanks.  Now if all scsi host driver maintainers
> would do it this way.. :)

Next iteration (this replaces all 3 previous patches, which Linus didn't apply
anyway):
  + Move common NCR53C9x ESP prototypes from the host adapter-specific header
    files to NCR53C9x.h
  + Move host adapter-specific definitions from the host adapter-specific
    header files to the host adapter-specific source files

Full changeset log:

NCR53C9x ESP updates:
  - Port 2.5.45 Sun/SPARC ESP SCSI driver changes to the NCR53C9x ESP SCSI
    drivers
  - C99 designated initializers
  - Move NCR53C9x ESP host templates from the host adapter-specific header
    files to the source files
  - Move common NCR53C9x ESP prototypes from the host adapter-specific header
    files to NCR53C9x.h
  - Move host adapter-specific definitions from the host adapter-specific
    header files to the host adapter-specific source files

This affects the following SCSI host adapters:
  - Amiga Blizzard 1230IV, 1260, and 2060
  - Amiga BSC Oktagon
  - Amiga Cyberstorm and Cyberstorm II
  - Amiga Phase 5 Fastlane
  - DECstation NCR53C94
  - JAZZ Fas216
  - Mac 53C9x
  - MCA 53C9x
  - Sun-3x ESP

--- linux-2.5.46/drivers/scsi/NCR53C9x.c	Tue Oct 22 19:04:27 2002
+++ linux-m68k-2.5.46/drivers/scsi/NCR53C9x.c	Sun Nov 10 10:02:30 2002
@@ -715,6 +715,9 @@
 	esp->targets_present = 0;
 	esp->resetting_bus = 0;
 	esp->snip = 0;
+
+	init_waitqueue_head(&esp->reset_queue);
+
 	esp->fas_premature_intr_workaround = 0;
 	for(i = 0; i < 32; i++)
 		esp->espcmdlog[i] = 0;
@@ -1395,7 +1398,7 @@
 		esp->msgout_len = 1;
 		esp->msgout_ctr = 0;
 		esp_cmd(esp, eregs, ESP_CMD_SATN);
-		return SCSI_ABORT_PENDING;
+		return SUCCESS;
 	}
 
 	/* If it is still in the issue queue then we can safely
@@ -1420,7 +1423,7 @@
 				this->done(this);
 				if(don)
 					esp->dma_ints_on(esp);
-				return SCSI_ABORT_SUCCESS;
+				return SUCCESS;
 			}
 		}
 	}
@@ -1433,19 +1436,19 @@
 	if(esp->current_SC) {
 		if(don)
 			esp->dma_ints_on(esp);
-		return SCSI_ABORT_BUSY;
+		return FAILED;
 	}
 
 	/* It's disconnected, we have to reconnect to re-establish
 	 * the nexus and tell the device to abort.  However, we really
-	 * cannot 'reconnect' per se, therefore we tell the upper layer
-	 * the safest thing we can.  This is, wait a bit, if nothing
-	 * happens, we are really hung so reset the bus.
+	 * cannot 'reconnect' per se.  Don't try to be fancy, just
+	 * indicate failure, which causes our caller to reset the whole
+	 * bus.
 	 */
 
 	if(don)
 		esp->dma_ints_on(esp);
-	return SCSI_ABORT_SNOOZE;
+	return FAILED;
 }
 
 /* We've sent ESP_CMD_RS to the ESP, the interrupt had just
@@ -1479,6 +1482,7 @@
 
 	/* SCSI bus reset is complete. */
 	esp->resetting_bus = 0;
+	wake_up(&esp->reset_queue);
 
 	/* Ok, now it is safe to get commands going once more. */
 	if(esp->issue_SC)
@@ -1500,12 +1504,14 @@
 /* Reset ESP chip, reset hanging bus, then kill active and
  * disconnected commands for targets without soft reset.
  */
-int esp_reset(Scsi_Cmnd *SCptr, unsigned int how)
+int esp_reset(Scsi_Cmnd *SCptr)
 {
 	struct NCR_ESP *esp = (struct NCR_ESP *) SCptr->host->hostdata;
 
 	(void) esp_do_resetbus(esp, esp->eregs);
-	return SCSI_RESET_PENDING;
+	wait_event(esp->reset_queue, (esp->resetting_bus == 0));
+
+	return SUCCESS;
 }
 
 /* Internal ESP done function. */
--- linux-2.5.46/drivers/scsi/NCR53C9x.h	Sat Oct 12 19:20:31 2002
+++ linux-m68k-2.5.46/drivers/scsi/NCR53C9x.h	Sun Nov 10 10:09:12 2002
@@ -407,6 +407,7 @@
    * cannot be assosciated with any specific command.
    */
   unchar resetting_bus;
+  wait_queue_head_t reset_queue;
 
   unchar do_pio_cmds;		/* Do command transfer with pio */
 
@@ -657,4 +658,11 @@
 extern void esp_release(void);
 extern void esp_initialize(struct NCR_ESP *);
 extern void esp_intr(int, void *, struct pt_regs *);
+extern const char *esp_info(struct Scsi_Host *);
+extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
+extern int esp_command(Scsi_Cmnd *);
+extern int esp_abort(Scsi_Cmnd *);
+extern int esp_reset(Scsi_Cmnd *);
+extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
+			 int hostno, int inout);
 #endif /* !(NCR53C9X_H) */
--- linux-2.5.46/drivers/scsi/blz1230.c	Mon May 13 10:55:33 2002
+++ linux-m68k-2.5.46/drivers/scsi/blz1230.c	Sun Nov 10 10:29:59 2002
@@ -29,7 +29,6 @@
 #include "scsi.h"
 #include "hosts.h"
 #include "NCR53C9x.h"
-#include "blz1230.h"
 
 #include <linux/zorro.h>
 #include <asm/irq.h>
@@ -40,6 +39,42 @@
 
 #define MKIV 1
 
+/* The controller registers can be found in the Z2 config area at these
+ * offsets:
+ */
+#define BLZ1230_ESP_ADDR 0x8000
+#define BLZ1230_DMA_ADDR 0x10000
+#define BLZ1230II_ESP_ADDR 0x10000
+#define BLZ1230II_DMA_ADDR 0x10021
+
+
+/* The Blizzard 1230 DMA interface
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ * Only two things can be programmed in the Blizzard DMA:
+ *  1) The data direction is controlled by the status of bit 31 (1 = write)
+ *  2) The source/dest address (word aligned, shifted one right) in bits 30-0
+ *
+ * Program DMA by first latching the highest byte of the address/direction
+ * (i.e. bits 31-24 of the long word constructed as described in steps 1+2
+ * above). Then write each byte of the address/direction (starting with the
+ * top byte, working down) to the DMA address register.
+ *
+ * Figure out interrupt status by reading the ESP status byte.
+ */
+struct blz1230_dma_registers {
+	volatile unsigned char dma_addr; 	/* DMA address      [0x0000] */
+	unsigned char dmapad2[0x7fff];
+	volatile unsigned char dma_latch; 	/* DMA latch        [0x8000] */
+};
+
+struct blz1230II_dma_registers {
+	volatile unsigned char dma_addr; 	/* DMA address      [0x0000] */
+	unsigned char dmapad2[0xf];
+	volatile unsigned char dma_latch; 	/* DMA latch        [0x0010] */
+};
+
+#define BLZ1230_DMA_WRITE 0x80000000
+
 static int  dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
 static int  dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
 static void dma_dump_state(struct NCR_ESP *esp);
@@ -279,12 +314,6 @@
 
 #define HOSTS_C
 
-#include "blz1230.h"
-
-static Scsi_Host_Template driver_template = SCSI_BLZ1230;
-
-#include "scsi_module.c"
-
 int blz1230_esp_release(struct Scsi_Host *instance)
 {
 #ifdef MODULE
@@ -296,5 +325,26 @@
 #endif
 	return 1;
 }
+
+
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp-blz1230",
+	.proc_info		= esp_proc_info,
+	.name			= "Blizzard1230 SCSI IV",
+	.detect			= blz1230_esp_detect,
+	.release		= blz1230_esp_release,
+	.command		= esp_command,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING
+};
+
+
+#include "scsi_module.c"
 
 MODULE_LICENSE("GPL");
--- linux-2.5.46/drivers/scsi/blz1230.h	Mon Jul 10 07:51:43 2000
+++ linux-m68k-2.5.46/drivers/scsi/blz1230.h	Thu Jan  1 01:00:00 1970
@@ -1,75 +0,0 @@
-/* blz1230.h: Defines and structures for the Blizzard 1230 SCSI IV driver.
- *
- * Copyright (C) 1996 Jesper Skov (jskov@cygnus.co.uk)
- *
- * This file is based on cyber_esp.h (hence the occasional reference to
- * CyberStorm).
- */
-
-#include "NCR53C9x.h"
-
-#ifndef BLZ1230_H
-#define BLZ1230_H
-
-/* The controller registers can be found in the Z2 config area at these
- * offsets:
- */
-#define BLZ1230_ESP_ADDR 0x8000
-#define BLZ1230_DMA_ADDR 0x10000
-#define BLZ1230II_ESP_ADDR 0x10000
-#define BLZ1230II_DMA_ADDR 0x10021
-
-
-/* The Blizzard 1230 DMA interface
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- * Only two things can be programmed in the Blizzard DMA:
- *  1) The data direction is controlled by the status of bit 31 (1 = write)
- *  2) The source/dest address (word aligned, shifted one right) in bits 30-0
- *
- * Program DMA by first latching the highest byte of the address/direction
- * (i.e. bits 31-24 of the long word constructed as described in steps 1+2
- * above). Then write each byte of the address/direction (starting with the
- * top byte, working down) to the DMA address register.
- *
- * Figure out interrupt status by reading the ESP status byte.
- */
-struct blz1230_dma_registers {
-	volatile unsigned char dma_addr; 	/* DMA address      [0x0000] */
-	unsigned char dmapad2[0x7fff];
-	volatile unsigned char dma_latch; 	/* DMA latch        [0x8000] */
-};
-
-struct blz1230II_dma_registers {
-	volatile unsigned char dma_addr; 	/* DMA address      [0x0000] */
-	unsigned char dmapad2[0xf];
-	volatile unsigned char dma_latch; 	/* DMA latch        [0x0010] */
-};
-
-#define BLZ1230_DMA_WRITE 0x80000000
-
-extern int blz1230_esp_detect(struct SHT *);
-extern int blz1230_esp_release(struct Scsi_Host *);
-extern const char *esp_info(struct Scsi_Host *);
-extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-extern int esp_command(Scsi_Cmnd *);
-extern int esp_abort(Scsi_Cmnd *);
-extern int esp_reset(Scsi_Cmnd *, unsigned int);
-extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
-			 int hostno, int inout);
-
-#define SCSI_BLZ1230      { proc_name:		"esp-blz1230", \
-			    proc_info:		esp_proc_info, \
-			    name:		"Blizzard1230 SCSI IV", \
-			    detect:		blz1230_esp_detect, \
-			    release:		blz1230_esp_release, \
-			    command:		esp_command, \
-			    queuecommand:	esp_queue, \
-			    abort:		esp_abort, \
-			    reset:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
-
-#endif /* BLZ1230_H */
--- linux-2.5.46/drivers/scsi/blz2060.c	Mon May 13 10:55:33 2002
+++ linux-m68k-2.5.46/drivers/scsi/blz2060.c	Sun Nov 10 10:30:15 2002
@@ -29,7 +29,6 @@
 #include "scsi.h"
 #include "hosts.h"
 #include "NCR53C9x.h"
-#include "blz2060.h"
 
 #include <linux/zorro.h>
 #include <asm/irq.h>
@@ -38,6 +37,38 @@
 
 #include <asm/pgtable.h>
 
+/* The controller registers can be found in the Z2 config area at these
+ * offsets:
+ */
+#define BLZ2060_ESP_ADDR 0x1ff00
+#define BLZ2060_DMA_ADDR 0x1ffe0
+
+
+/* The Blizzard 2060 DMA interface
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ * Only two things can be programmed in the Blizzard DMA:
+ *  1) The data direction is controlled by the status of bit 31 (1 = write)
+ *  2) The source/dest address (word aligned, shifted one right) in bits 30-0
+ *
+ * Figure out interrupt status by reading the ESP status byte.
+ */
+struct blz2060_dma_registers {
+	volatile unsigned char dma_led_ctrl;	/* DMA led control   [0x000] */
+	unsigned char dmapad1[0x0f];
+	volatile unsigned char dma_addr0; 	/* DMA address (MSB) [0x010] */
+	unsigned char dmapad2[0x03];
+	volatile unsigned char dma_addr1; 	/* DMA address       [0x014] */
+	unsigned char dmapad3[0x03];
+	volatile unsigned char dma_addr2; 	/* DMA address       [0x018] */
+	unsigned char dmapad4[0x03];
+	volatile unsigned char dma_addr3; 	/* DMA address (LSB) [0x01c] */
+};
+
+#define BLZ2060_DMA_WRITE 0x80000000
+
+/* DMA control bits */
+#define BLZ2060_DMA_LED    0x02		/* HD led control 1 = off */
+
 static int  dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
 static int  dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
 static void dma_dump_state(struct NCR_ESP *esp);
@@ -236,12 +267,6 @@
 
 #define HOSTS_C
 
-#include "blz2060.h"
-
-static Scsi_Host_Template driver_template = SCSI_BLZ2060;
-
-#include "scsi_module.c"
-
 int blz2060_esp_release(struct Scsi_Host *instance)
 {
 #ifdef MODULE
@@ -254,5 +279,25 @@
 #endif
 	return 1;
 }
+
+
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp-blz2060",
+	.proc_info		= esp_proc_info,
+	.name			= "Blizzard2060 SCSI",
+	.detect			= blz2060_esp_detect,
+	.release		= blz2060_esp_release,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING
+};
+
+
+#include "scsi_module.c"
 
 MODULE_LICENSE("GPL");
--- linux-2.5.46/drivers/scsi/blz2060.h	Mon Jul 10 07:51:43 2000
+++ linux-m68k-2.5.46/drivers/scsi/blz2060.h	Thu Jan  1 01:00:00 1970
@@ -1,70 +0,0 @@
-/* blz2060.h: Defines and structures for the Blizzard 2060 SCSI driver.
- *
- * Copyright (C) 1996 Jesper Skov (jskov@cygnus.co.uk)
- *
- * This file is based on cyber_esp.h (hence the occasional reference to
- * CyberStorm).
- */
-
-#include "NCR53C9x.h"
-
-#ifndef BLZ2060_H
-#define BLZ2060_H
-
-/* The controller registers can be found in the Z2 config area at these
- * offsets:
- */
-#define BLZ2060_ESP_ADDR 0x1ff00
-#define BLZ2060_DMA_ADDR 0x1ffe0
-
-
-/* The Blizzard 2060 DMA interface
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- * Only two things can be programmed in the Blizzard DMA:
- *  1) The data direction is controlled by the status of bit 31 (1 = write)
- *  2) The source/dest address (word aligned, shifted one right) in bits 30-0
- *
- * Figure out interrupt status by reading the ESP status byte.
- */
-struct blz2060_dma_registers {
-	volatile unsigned char dma_led_ctrl;	/* DMA led control   [0x000] */
-	unsigned char dmapad1[0x0f];
-	volatile unsigned char dma_addr0; 	/* DMA address (MSB) [0x010] */
-	unsigned char dmapad2[0x03];
-	volatile unsigned char dma_addr1; 	/* DMA address       [0x014] */
-	unsigned char dmapad3[0x03];
-	volatile unsigned char dma_addr2; 	/* DMA address       [0x018] */
-	unsigned char dmapad4[0x03];
-	volatile unsigned char dma_addr3; 	/* DMA address (LSB) [0x01c] */
-};
-
-#define BLZ2060_DMA_WRITE 0x80000000
-
-/* DMA control bits */
-#define BLZ2060_DMA_LED    0x02		/* HD led control 1 = off */
-
-extern int blz2060_esp_detect(struct SHT *);
-extern int blz2060_esp_release(struct Scsi_Host *);
-extern const char *esp_info(struct Scsi_Host *);
-extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-extern int esp_command(Scsi_Cmnd *);
-extern int esp_abort(Scsi_Cmnd *);
-extern int esp_reset(Scsi_Cmnd *, unsigned int);
-extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
-			 int hostno, int inout);
-
-#define SCSI_BLZ2060      { proc_name:		"esp-blz2060", \
-			    proc_info:		esp_proc_info, \
-			    name:		"Blizzard2060 SCSI", \
-			    detect:		blz2060_esp_detect, \
-			    release:		blz2060_esp_release, \
-			    queuecommand:	esp_queue, \
-			    abort:		esp_abort, \
-			    reset:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
-
-#endif /* BLZ2060_H */
--- linux-2.5.46/drivers/scsi/cyberstorm.c	Mon May 13 10:55:33 2002
+++ linux-m68k-2.5.46/drivers/scsi/cyberstorm.c	Sun Nov 10 10:30:45 2002
@@ -32,7 +32,6 @@
 #include "scsi.h"
 #include "hosts.h"
 #include "NCR53C9x.h"
-#include "cyberstorm.h"
 
 #include <linux/zorro.h>
 #include <asm/irq.h>
@@ -41,6 +40,43 @@
 
 #include <asm/pgtable.h>
 
+/* The controller registers can be found in the Z2 config area at these
+ * offsets:
+ */
+#define CYBER_ESP_ADDR 0xf400
+#define CYBER_DMA_ADDR 0xf800
+
+
+/* The CyberStorm DMA interface */
+struct cyber_dma_registers {
+	volatile unsigned char dma_addr0;	/* DMA address (MSB) [0x000] */
+	unsigned char dmapad1[1];
+	volatile unsigned char dma_addr1;	/* DMA address       [0x002] */
+	unsigned char dmapad2[1];
+	volatile unsigned char dma_addr2;	/* DMA address       [0x004] */
+	unsigned char dmapad3[1];
+	volatile unsigned char dma_addr3;	/* DMA address (LSB) [0x006] */
+	unsigned char dmapad4[0x3fb];
+	volatile unsigned char cond_reg;        /* DMA cond    (ro)  [0x402] */
+#define ctrl_reg  cond_reg			/* DMA control (wo)  [0x402] */
+};
+
+/* DMA control bits */
+#define CYBER_DMA_LED    0x80	/* HD led control 1 = on */
+#define CYBER_DMA_WRITE  0x40	/* DMA direction. 1 = write */
+#define CYBER_DMA_Z3     0x20	/* 16 (Z2) or 32 (CHIP/Z3) bit DMA transfer */
+
+/* DMA status bits */
+#define CYBER_DMA_HNDL_INTR 0x80	/* DMA IRQ pending? */
+
+/* The bits below appears to be Phase5 Debug bits only; they were not
+ * described by Phase5 so using them may seem a bit stupid...
+ */
+#define CYBER_HOST_ID 0x02	/* If set, host ID should be 7, otherwise
+				 * it should be 6.
+				 */
+#define CYBER_SLOW_CABLE 0x08	/* If *not* set, assume SLOW_CABLE */
+
 static int  dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
 static int  dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
 static void dma_dump_state(struct NCR_ESP *esp);
@@ -302,12 +338,6 @@
 
 #define HOSTS_C
 
-#include "cyberstorm.h"
-
-static Scsi_Host_Template driver_template = SCSI_CYBERSTORM;
-
-#include "scsi_module.c"
-
 int cyber_esp_release(struct Scsi_Host *instance)
 {
 #ifdef MODULE
@@ -320,5 +350,25 @@
 #endif
 	return 1;
 }
+
+
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp-cyberstorm",
+	.proc_info		= esp_proc_info,
+	.name			= "CyberStorm SCSI",
+	.detect			= cyber_esp_detect,
+	.release		= cyber_esp_release,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING
+};
+
+
+#include "scsi_module.c"
 
 MODULE_LICENSE("GPL");
--- linux-2.5.46/drivers/scsi/cyberstorm.h	Mon Jul 10 07:51:43 2000
+++ linux-m68k-2.5.46/drivers/scsi/cyberstorm.h	Thu Jan  1 01:00:00 1970
@@ -1,73 +0,0 @@
-/* cyberstorm.h: Defines and structures for the CyberStorm SCSI driver.
- *
- * Copyright (C) 1996 Jesper Skov (jskov@cygnus.co.uk)
- */
-
-#include "NCR53C9x.h"
-
-#ifndef CYBER_ESP_H
-#define CYBER_ESP_H
-
-/* The controller registers can be found in the Z2 config area at these
- * offsets:
- */
-#define CYBER_ESP_ADDR 0xf400
-#define CYBER_DMA_ADDR 0xf800
-
-
-/* The CyberStorm DMA interface */
-struct cyber_dma_registers {
-	volatile unsigned char dma_addr0;	/* DMA address (MSB) [0x000] */
-	unsigned char dmapad1[1];
-	volatile unsigned char dma_addr1;	/* DMA address       [0x002] */
-	unsigned char dmapad2[1];
-	volatile unsigned char dma_addr2;	/* DMA address       [0x004] */
-	unsigned char dmapad3[1];
-	volatile unsigned char dma_addr3;	/* DMA address (LSB) [0x006] */
-	unsigned char dmapad4[0x3fb];
-	volatile unsigned char cond_reg;        /* DMA cond    (ro)  [0x402] */
-#define ctrl_reg  cond_reg			/* DMA control (wo)  [0x402] */
-};
-
-/* DMA control bits */
-#define CYBER_DMA_LED    0x80	/* HD led control 1 = on */
-#define CYBER_DMA_WRITE  0x40	/* DMA direction. 1 = write */
-#define CYBER_DMA_Z3     0x20	/* 16 (Z2) or 32 (CHIP/Z3) bit DMA transfer */
-
-/* DMA status bits */
-#define CYBER_DMA_HNDL_INTR 0x80	/* DMA IRQ pending? */
-
-/* The bits below appears to be Phase5 Debug bits only; they were not
- * described by Phase5 so using them may seem a bit stupid...
- */
-#define CYBER_HOST_ID 0x02	/* If set, host ID should be 7, otherwise
-				 * it should be 6.
-				 */
-#define CYBER_SLOW_CABLE 0x08	/* If *not* set, assume SLOW_CABLE */
-
-extern int cyber_esp_detect(struct SHT *);
-extern int cyber_esp_release(struct Scsi_Host *);
-extern const char *esp_info(struct Scsi_Host *);
-extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-extern int esp_command(Scsi_Cmnd *);
-extern int esp_abort(Scsi_Cmnd *);
-extern int esp_reset(Scsi_Cmnd *, unsigned int);
-extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
-			 int hostno, int inout);
-
-
-#define SCSI_CYBERSTORM   { proc_name:		"esp-cyberstorm", \
-			    proc_info:		esp_proc_info, \
-			    name:		"CyberStorm SCSI", \
-			    detect:		cyber_esp_detect, \
-			    release:		cyber_esp_release, \
-			    queuecommand:	esp_queue, \
-			    abort:		esp_abort, \
-			    reset:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
-
-#endif /* CYBER_ESP_H */
--- linux-2.5.46/drivers/scsi/cyberstormII.c	Mon May 13 10:55:33 2002
+++ linux-m68k-2.5.46/drivers/scsi/cyberstormII.c	Sun Nov 10 10:31:12 2002
@@ -28,7 +28,6 @@
 #include "scsi.h"
 #include "hosts.h"
 #include "NCR53C9x.h"
-#include "cyberstormII.h"
 
 #include <linux/zorro.h>
 #include <asm/irq.h>
@@ -37,6 +36,30 @@
 
 #include <asm/pgtable.h>
 
+/* The controller registers can be found in the Z2 config area at these
+ * offsets:
+ */
+#define CYBERII_ESP_ADDR 0x1ff03
+#define CYBERII_DMA_ADDR 0x1ff43
+
+
+/* The CyberStorm II DMA interface */
+struct cyberII_dma_registers {
+	volatile unsigned char cond_reg;        /* DMA cond    (ro)  [0x000] */
+#define ctrl_reg  cond_reg			/* DMA control (wo)  [0x000] */
+	unsigned char dmapad4[0x3f];
+	volatile unsigned char dma_addr0;	/* DMA address (MSB) [0x040] */
+	unsigned char dmapad1[3];
+	volatile unsigned char dma_addr1;	/* DMA address       [0x044] */
+	unsigned char dmapad2[3];
+	volatile unsigned char dma_addr2;	/* DMA address       [0x048] */
+	unsigned char dmapad3[3];
+	volatile unsigned char dma_addr3;	/* DMA address (LSB) [0x04c] */
+};
+
+/* DMA control bits */
+#define CYBERII_DMA_LED    0x02	/* HD led control 1 = on */
+
 static int  dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
 static int  dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
 static void dma_dump_state(struct NCR_ESP *esp);
@@ -252,13 +275,6 @@
 
 #define HOSTS_C
 
-#include "cyberstormII.h"
-
-static Scsi_Host_Template driver_template = SCSI_CYBERSTORMII;
-
-#include "scsi_module.c"
-
-
 int cyberII_esp_release(struct Scsi_Host *instance)
 {
 #ifdef MODULE
@@ -271,5 +287,25 @@
 #endif
 	return 1;
 }
+
+
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp-cyberstormII",
+	.proc_info		= esp_proc_info,
+	.name			= "CyberStorm Mk II SCSI",
+	.detect			= cyberII_esp_detect,
+	.release		= cyberII_esp_release,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING
+};
+
+
+#include "scsi_module.c"
 
 MODULE_LICENSE("GPL");
--- linux-2.5.46/drivers/scsi/cyberstormII.h	Mon Jul 10 07:51:43 2000
+++ linux-m68k-2.5.46/drivers/scsi/cyberstormII.h	Thu Jan  1 01:00:00 1970
@@ -1,60 +0,0 @@
-/* cyberstormII.h: Defines and structures for the CyberStorm SCSI Mk II driver.
- *
- * Copyright (C) 1996 Jesper Skov (jskov@cygnus.co.uk)
- */
-
-#include "NCR53C9x.h"
-
-#ifndef CYBERII_ESP_H
-#define CYBERII_ESP_H
-
-/* The controller registers can be found in the Z2 config area at these
- * offsets:
- */
-#define CYBERII_ESP_ADDR 0x1ff03
-#define CYBERII_DMA_ADDR 0x1ff43
-
-
-/* The CyberStorm II DMA interface */
-struct cyberII_dma_registers {
-	volatile unsigned char cond_reg;        /* DMA cond    (ro)  [0x000] */
-#define ctrl_reg  cond_reg			/* DMA control (wo)  [0x000] */
-	unsigned char dmapad4[0x3f];
-	volatile unsigned char dma_addr0;	/* DMA address (MSB) [0x040] */
-	unsigned char dmapad1[3];
-	volatile unsigned char dma_addr1;	/* DMA address       [0x044] */
-	unsigned char dmapad2[3];
-	volatile unsigned char dma_addr2;	/* DMA address       [0x048] */
-	unsigned char dmapad3[3];
-	volatile unsigned char dma_addr3;	/* DMA address (LSB) [0x04c] */
-};
-
-/* DMA control bits */
-#define CYBERII_DMA_LED    0x02	/* HD led control 1 = on */
-
-
-extern int cyberII_esp_detect(struct SHT *);
-extern int cyberII_esp_release(struct Scsi_Host *);
-extern const char *esp_info(struct Scsi_Host *);
-extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-extern int esp_command(Scsi_Cmnd *);
-extern int esp_abort(Scsi_Cmnd *);
-extern int esp_reset(Scsi_Cmnd *, unsigned int);
-extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
-			 int hostno, int inout);
-
-#define SCSI_CYBERSTORMII { proc_name:		"esp-cyberstormII", \
-			    proc_info:		esp_proc_info, \
-			    name:		"CyberStorm Mk II SCSI", \
-			    detect:		cyberII_esp_detect, \
-			    release:		cyberII_esp_release, \
-			    queuecommand:	esp_queue, \
-			    abort:		esp_abort, \
-			    reset:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
-
-#endif /* CYBERII_ESP_H */
--- linux-2.5.46/drivers/scsi/dec_esp.c	Fri Feb  1 09:36:52 2002
+++ linux-m68k-2.5.46/drivers/scsi/dec_esp.c	Sun Nov 10 10:31:40 2002
@@ -31,7 +31,6 @@
 #include "scsi.h"
 #include "hosts.h"
 #include "NCR53C9x.h"
-#include "dec_esp.h"
 
 #include <asm/irq.h>
 #include <asm/jazz.h>
@@ -46,6 +45,11 @@
 #include <asm/dec/ioasic_ints.h>
 #include <asm/dec/machtype.h>
 
+#define DEC_SCSI_SREG 0
+#define DEC_SCSI_DMAREG 0x40000
+#define DEC_SCSI_SRAM 0x80000
+#define DEC_SCSI_DIAG 0xC0000
+
 /*
  * Once upon a time the pmaz code used to be working but
  * it hasn't been maintained for quite some time.
@@ -103,7 +107,25 @@
 
 static void scsi_dma_int(int, void *, struct pt_regs *);
 
-static Scsi_Host_Template driver_template = SCSI_DEC_ESP;
+int dec_esp_detect(Scsi_Host_Template * tpnt);
+
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp",
+	.proc_info		= &esp_proc_info,
+	.name			= "NCR53C94",
+	.detect			= dec_esp_detect,
+	.info			= esp_info,
+	.command		= esp_command,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= DISABLE_CLUSTERING,
+};
+
 
 #include "scsi_module.c"
 
--- linux-2.5.46/drivers/scsi/dec_esp.h	Mon Jul 10 07:51:45 2000
+++ linux-m68k-2.5.46/drivers/scsi/dec_esp.h	Thu Jan  1 01:00:00 1970
@@ -1,45 +0,0 @@
-/* dec_esp.h: Defines and structures for the JAZZ SCSI driver.
- *
- * DECstation changes Copyright (C) 1998 Harald Koerfgen
- * and David Airlie
- *
- * based on jazz_esp.h:
- * Copyright (C) 1997 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
- */
-
-#ifndef DEC_ESP_H
-#define DEC_ESP_H
-
-#include "NCR53C9x.h"
-
-#define DEC_SCSI_SREG 0
-#define DEC_SCSI_DMAREG 0x40000
-#define DEC_SCSI_SRAM 0x80000
-#define DEC_SCSI_DIAG 0xC0000
-
-extern int dec_esp_detect(struct SHT *);
-extern const char *esp_info(struct Scsi_Host *);
-extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-extern int esp_command(Scsi_Cmnd *);
-extern int esp_abort(Scsi_Cmnd *);
-extern int esp_reset(Scsi_Cmnd *, unsigned int);
-extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
-			 int hostno, int inout);
-
-#define SCSI_DEC_ESP {                                         \
-		proc_name:      "esp",				\
-		proc_info:      &esp_proc_info,			\
-		name:           "NCR53C94",			\
-		detect:         dec_esp_detect,			\
-		info:           esp_info,			\
-		command:        esp_command,			\
-		queuecommand:   esp_queue,			\
-		abort:          esp_abort,			\
-		reset:          esp_reset,			\
-		can_queue:      7,				\
-		this_id:        7,				\
-		sg_tablesize:   SG_ALL,				\
-		cmd_per_lun:    1,				\
-		use_clustering: DISABLE_CLUSTERING, }
-
-#endif /* DEC_ESP_H */
--- linux-2.5.46/drivers/scsi/fastlane.c	Mon May 13 10:55:33 2002
+++ linux-m68k-2.5.46/drivers/scsi/fastlane.c	Sun Nov 10 10:32:18 2002
@@ -37,7 +37,6 @@
 #include "scsi.h"
 #include "hosts.h"
 #include "NCR53C9x.h"
-#include "fastlane.h"
 
 #include <linux/zorro.h>
 #include <asm/irq.h>
@@ -53,6 +52,36 @@
 #define NODMAIRQ
 #endif
 
+/* The controller registers can be found in the Z2 config area at these
+ * offsets:
+ */
+#define FASTLANE_ESP_ADDR 0x1000001
+#define FASTLANE_DMA_ADDR 0x1000041
+
+
+/* The Fastlane DMA interface */
+struct fastlane_dma_registers {
+	volatile unsigned char cond_reg;	/* DMA status  (ro) [0x0000] */
+#define ctrl_reg  cond_reg			/* DMA control (wo) [0x0000] */
+	unsigned char dmapad1[0x3f];
+	volatile unsigned char clear_strobe;    /* DMA clear   (wo) [0x0040] */
+};
+
+
+/* DMA status bits */
+#define FASTLANE_DMA_MINT  0x80
+#define FASTLANE_DMA_IACT  0x40
+#define FASTLANE_DMA_CREQ  0x20
+
+/* DMA control bits */
+#define FASTLANE_DMA_FCODE 0xa0
+#define FASTLANE_DMA_MASK  0xf3
+#define FASTLANE_DMA_LED   0x10	/* HD led control 1 = on */
+#define FASTLANE_DMA_WRITE 0x08 /* 1 = write */
+#define FASTLANE_DMA_ENABLE 0x04 /* Enable DMA */
+#define FASTLANE_DMA_EDI   0x02	/* Enable DMA IRQ ? */
+#define FASTLANE_DMA_ESI   0x01	/* Enable SCSI IRQ */
+
 static int  dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
 static int  dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
 static inline void dma_clear(struct NCR_ESP *esp);
@@ -356,11 +385,6 @@
 
 #define HOSTS_C
 
-#include "fastlane.h"
-
-static Scsi_Host_Template driver_template = SCSI_FASTLANE;
-#include "scsi_module.c"
-
 int fastlane_esp_release(struct Scsi_Host *instance)
 {
 #ifdef MODULE
@@ -372,5 +396,24 @@
 #endif
 	return 1;
 }
+
+
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp-fastlane",
+	.proc_info		= esp_proc_info,
+	.name			= "Fastlane SCSI",
+	.detect			= fastlane_esp_detect,
+	.release		= fastlane_esp_release,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING
+};
+
+#include "scsi_module.c"
 
 MODULE_LICENSE("GPL");
--- linux-2.5.46/drivers/scsi/fastlane.h	Mon Jul 10 07:51:43 2000
+++ linux-m68k-2.5.46/drivers/scsi/fastlane.h	Thu Jan  1 01:00:00 1970
@@ -1,65 +0,0 @@
-/* fastlane.h: Defines and structures for the Fastlane SCSI driver.
- *
- * Copyright (C) 1996 Jesper Skov (jskov@cygnus.co.uk)
- */
-
-#include "NCR53C9x.h"
-
-#ifndef FASTLANE_H
-#define FASTLANE_H
-
-/* The controller registers can be found in the Z2 config area at these
- * offsets:
- */
-#define FASTLANE_ESP_ADDR 0x1000001
-#define FASTLANE_DMA_ADDR 0x1000041
-
-
-/* The Fastlane DMA interface */
-struct fastlane_dma_registers {
-	volatile unsigned char cond_reg;	/* DMA status  (ro) [0x0000] */
-#define ctrl_reg  cond_reg			/* DMA control (wo) [0x0000] */
-	unsigned char dmapad1[0x3f];
-	volatile unsigned char clear_strobe;    /* DMA clear   (wo) [0x0040] */
-};
-
-
-/* DMA status bits */
-#define FASTLANE_DMA_MINT  0x80
-#define FASTLANE_DMA_IACT  0x40
-#define FASTLANE_DMA_CREQ  0x20
-
-/* DMA control bits */
-#define FASTLANE_DMA_FCODE 0xa0
-#define FASTLANE_DMA_MASK  0xf3
-#define FASTLANE_DMA_LED   0x10	/* HD led control 1 = on */
-#define FASTLANE_DMA_WRITE 0x08 /* 1 = write */
-#define FASTLANE_DMA_ENABLE 0x04 /* Enable DMA */
-#define FASTLANE_DMA_EDI   0x02	/* Enable DMA IRQ ? */
-#define FASTLANE_DMA_ESI   0x01	/* Enable SCSI IRQ */
-
-extern int fastlane_esp_detect(struct SHT *);
-extern int fastlane_esp_release(struct Scsi_Host *);
-extern const char *esp_info(struct Scsi_Host *);
-extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-extern int esp_command(Scsi_Cmnd *);
-extern int esp_abort(Scsi_Cmnd *);
-extern int esp_reset(Scsi_Cmnd *, unsigned int);
-extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
-			 int hostno, int inout);
-
-#define SCSI_FASTLANE     { proc_name:		"esp-fastlane", \
-			    proc_info:		esp_proc_info, \
-			    name:		"Fastlane SCSI", \
-			    detect:		fastlane_esp_detect, \
-			    release:		fastlane_esp_release, \
-			    queuecommand:	esp_queue, \
-			    abort:		esp_abort, \
-			    reset:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	ENABLE_CLUSTERING }
-
-#endif /* FASTLANE_H */
--- linux-2.5.46/drivers/scsi/jazz_esp.c	Fri Jun 21 09:34:44 2002
+++ linux-m68k-2.5.46/drivers/scsi/jazz_esp.c	Sun Nov 10 10:35:21 2002
@@ -18,7 +18,6 @@
 #include "scsi.h"
 #include "hosts.h"
 #include "NCR53C9x.h"
-#include "jazz_esp.h"
 
 #include <asm/irq.h>
 #include <asm/jazz.h>
@@ -273,3 +272,21 @@
     *(unsigned char *)JAZZ_HDC_LED = 1;
 #endif    
 }
+
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp",
+	.proc_info		= &esp_proc_info,
+	.name			= "ESP 100/100a/200",
+	.detect			= jazz_esp_detect,
+	.info			= esp_info,
+	.command		= esp_command,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= DISABLE_CLUSTERING,
+};
+
--- linux-2.5.46/drivers/scsi/jazz_esp.h	Mon Jul 10 07:51:45 2000
+++ linux-m68k-2.5.46/drivers/scsi/jazz_esp.h	Thu Jan  1 01:00:00 1970
@@ -1,39 +0,0 @@
-/* jazz_esp.h: Defines and structures for the JAZZ SCSI driver.
- *
- * Copyright (C) 1997 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
- */
-
-#ifndef JAZZ_ESP_H
-#define JAZZ_ESP_H
-
-#define EREGS_PAD(n)
-
-#include "NCR53C9x.h"
-
-
-extern int jazz_esp_detect(struct SHT *);
-extern const char *esp_info(struct Scsi_Host *);
-extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-extern int esp_command(Scsi_Cmnd *);
-extern int esp_abort(Scsi_Cmnd *);
-extern int esp_reset(Scsi_Cmnd *, unsigned int);
-extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
-			 int hostno, int inout);
-
-#define SCSI_JAZZ_ESP {                                         \
-		proc_name:      "esp",				\
-		proc_info:      &esp_proc_info,			\
-		name:           "ESP 100/100a/200",		\
-		detect:         jazz_esp_detect,		\
-		info:           esp_info,			\
-		command:        esp_command,			\
-		queuecommand:   esp_queue,			\
-		abort:          esp_abort,			\
-		reset:          esp_reset,			\
-		can_queue:      7,				\
-		this_id:        7,				\
-		sg_tablesize:   SG_ALL,				\
-		cmd_per_lun:    1,				\
-		use_clustering: DISABLE_CLUSTERING, }
-
-#endif /* JAZZ_ESP_H */
--- linux-2.5.46/drivers/scsi/mac_esp.c	Thu Jul 25 12:53:56 2002
+++ linux-m68k-2.5.46/drivers/scsi/mac_esp.c	Sun Nov 10 10:35:52 2002
@@ -27,7 +27,6 @@
 #include "scsi.h"
 #include "hosts.h"
 #include "NCR53C9x.h"
-#include "mac_esp.h"
 
 #include <asm/io.h>
 
@@ -41,6 +40,8 @@
 
 #include <asm/macintosh.h>
 
+/* #define DEBUG_MAC_ESP */
+
 #define mac_turnon_irq(x)	mac_enable_irq(x)
 #define mac_turnoff_irq(x)	mac_disable_irq(x)
 
@@ -710,7 +711,23 @@
 #endif
 }
 
-static Scsi_Host_Template driver_template = SCSI_MAC_ESP;
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp",
+	.name			= "Mac 53C9x SCSI",
+	.detect			= mac_esp_detect,
+	.release		= NULL,
+	.info			= esp_info,
+	/* .command		= esp_command, */
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= DISABLE_CLUSTERING
+};
+
 
 #include "scsi_module.c"
 
--- linux-2.5.46/drivers/scsi/mac_esp.h	Sun Dec  9 15:15:30 2001
+++ linux-m68k-2.5.46/drivers/scsi/mac_esp.h	Thu Jan  1 01:00:00 1970
@@ -1,40 +0,0 @@
-
-/*
-mac_esp.h
-
-copyright 1997 David Weis, weisd3458@uni.edu
-*/
-
-
-#include "NCR53C9x.h"
-
-#ifndef MAC_ESP_H
-#define MAC_ESP_H
-
-/* #define DEBUG_MAC_ESP */
-
-extern int mac_esp_detect(struct SHT *);
-extern const char *esp_info(struct Scsi_Host *);
-extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-extern int esp_command(Scsi_Cmnd *);
-extern int esp_abort(Scsi_Cmnd *);
-extern int esp_reset(Scsi_Cmnd *, unsigned int);
-
-
-#define SCSI_MAC_ESP      { proc_name:		"esp", \
-			    name:		"Mac 53C9x SCSI", \
-			    detect:		mac_esp_detect, \
-			    release:		NULL, \
-			    info:		esp_info, \
-			    /* command:		esp_command, */ \
-			    queuecommand:	esp_queue, \
-			    abort:		esp_abort, \
-			    reset:		esp_reset, \
-			    can_queue:          7, \
-			    this_id:		7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-			    use_clustering:	DISABLE_CLUSTERING }
-
-#endif /* MAC_ESP_H */
-
--- linux-2.5.46/drivers/scsi/mca_53c9x.c	Mon Feb 11 09:14:40 2002
+++ linux-m68k-2.5.46/drivers/scsi/mca_53c9x.c	Sun Nov 10 10:36:46 2002
@@ -42,7 +42,6 @@
 #include "scsi.h"
 #include "hosts.h"
 #include "NCR53C9x.h"
-#include "mca_53c9x.h"
 
 #include <asm/dma.h>
 #include <linux/mca.h>
@@ -51,6 +50,31 @@
 
 #include <asm/pgtable.h>
 
+/*
+ * From ibmmca.c (IBM scsi controller card driver) -- used for turning PS2 disk
+ *  activity LED on and off
+ */
+
+#define PS2_SYS_CTR	0x92
+
+/* Ports the ncr's 53c94 can be put at; indexed by pos register value */
+
+#define MCA_53C9X_IO_PORTS {                             \
+                         0x0000, 0x0240, 0x0340, 0x0400, \
+	                 0x0420, 0x3240, 0x8240, 0xA240, \
+	                }
+			
+/*
+ * Supposedly there were some cards put together with the 'c9x and 86c01.  If
+ *   they have different ID's from the ones on the 3500 series machines, 
+ *   you can add them here and hopefully things will work out.
+ */
+			
+#define MCA_53C9X_IDS {          \
+                         0x7F4C, \
+			 0x0000, \
+                        }
+
 static int  dma_bytes_sent(struct NCR_ESP *, int);
 static int  dma_can_transfer(struct NCR_ESP *, Scsi_Cmnd *);
 static void dma_dump_state(struct NCR_ESP *);
@@ -419,7 +441,22 @@
 	outb(inb(PS2_SYS_CTR) & 0x3f, PS2_SYS_CTR);
 }
 
-static Scsi_Host_Template driver_template = MCA_53C9X;
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp",
+	.name			= "NCR 53c9x SCSI",
+	.detect			= mca_esp_detect,
+	.release		= mca_esp_release,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.unchecked_isa_dma	= 1,
+	.use_clustering		= DISABLE_CLUSTERING
+};
+
+
 #include "scsi_module.c"
 
 /*
--- linux-2.5.46/drivers/scsi/mca_53c9x.h	Mon Jul 10 07:51:45 2000
+++ linux-m68k-2.5.46/drivers/scsi/mca_53c9x.h	Thu Jan  1 01:00:00 1970
@@ -1,66 +0,0 @@
-/* mca_53c94.h: Defines and structures for the SCSI adapter found on NCR 35xx
- *  (and maybe some other) Microchannel machines.
- *
- * Code taken mostly from Cyberstorm SCSI drivers
- *   Copyright (C) 1996 Jesper Skov (jskov@cygnus.co.uk)
- *
- * Hacked to work with the NCR MCA stuff by Tymm Twillman (tymm@computer.org)
- *   1998
- */
-
-#include "NCR53C9x.h"
-
-#ifndef MCA_53C9X_H
-#define MCA_53C9X_H
-
-/*
- * From ibmmca.c (IBM scsi controller card driver) -- used for turning PS2 disk
- *  activity LED on and off
- */
-
-#define PS2_SYS_CTR	0x92
-
-extern int mca_esp_detect(struct SHT *);
-extern int mca_esp_release(struct Scsi_Host *);
-extern const char *esp_info(struct Scsi_Host *);
-extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-extern int esp_command(Scsi_Cmnd *);
-extern int esp_abort(Scsi_Cmnd *);
-extern int esp_reset(Scsi_Cmnd *, unsigned int);
-extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
-			 int hostno, int inout);
-
-
-#define MCA_53C9X         { proc_name:		"esp", \
-			    name:		"NCR 53c9x SCSI", \
-			    detect:		mca_esp_detect, \
-			    release:		mca_esp_release, \
-			    queuecommand:	esp_queue, \
-			    abort:		esp_abort, \
-			    reset:		esp_reset, \
-			    can_queue:          7, \
-			    sg_tablesize:	SG_ALL, \
-			    cmd_per_lun:	1, \
-                            unchecked_isa_dma:  1, \
-			    use_clustering:	DISABLE_CLUSTERING }
-
-/* Ports the ncr's 53c94 can be put at; indexed by pos register value */
-
-#define MCA_53C9X_IO_PORTS {                             \
-                         0x0000, 0x0240, 0x0340, 0x0400, \
-	                 0x0420, 0x3240, 0x8240, 0xA240, \
-	                }
-			
-/*
- * Supposedly there were some cards put together with the 'c9x and 86c01.  If
- *   they have different ID's from the ones on the 3500 series machines, 
- *   you can add them here and hopefully things will work out.
- */
-			
-#define MCA_53C9X_IDS {          \
-                         0x7F4C, \
-			 0x0000, \
-                        }
-
-#endif /* MCA_53C9X_H */
-
--- linux-2.5.46/drivers/scsi/oktagon_esp.c	Mon Oct  7 22:04:40 2002
+++ linux-m68k-2.5.46/drivers/scsi/oktagon_esp.c	Sun Nov 10 10:37:56 2002
@@ -32,7 +32,6 @@
 #include "scsi.h"
 #include "hosts.h"
 #include "NCR53C9x.h"
-#include "oktagon_esp.h"
 
 #include <linux/zorro.h>
 #include <asm/irq.h>
@@ -46,6 +45,13 @@
 
 #include <linux/unistd.h>
 
+/* The controller registers can be found in the Z2 config area at these
+ * offsets:
+ */
+#define OKTAGON_ESP_ADDR 0x03000
+#define OKTAGON_DMA_ADDR 0x01000
+
+
 static int  dma_bytes_sent(struct NCR_ESP *esp, int fifo_count);
 static int  dma_can_transfer(struct NCR_ESP *esp, Scsi_Cmnd *sp);
 static void dma_dump_state(struct NCR_ESP *esp);
@@ -571,12 +577,6 @@
 
 #define HOSTS_C
 
-#include "oktagon_esp.h"
-
-static Scsi_Host_Template driver_template = SCSI_OKTAGON_ESP;
-
-#include "scsi_module.c"
-
 int oktagon_esp_release(struct Scsi_Host *instance)
 {
 #ifdef MODULE
@@ -588,5 +588,25 @@
 #endif
 	return 1;
 }
+
+
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp-oktagon",
+	.proc_info		= &esp_proc_info,
+	.name			= "BSC Oktagon SCSI",
+	.detect			= oktagon_esp_detect,
+	.release		= oktagon_esp_release,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= ENABLE_CLUSTERING
+};
+
+
+#include "scsi_module.c"
 
 MODULE_LICENSE("GPL");
--- linux-2.5.46/drivers/scsi/oktagon_esp.h	Mon Jul 10 07:51:43 2000
+++ linux-m68k-2.5.46/drivers/scsi/oktagon_esp.h	Thu Jan  1 01:00:00 1970
@@ -1,57 +0,0 @@
-/* oktagon_esp.h: Defines and structures for the CyberStorm SCSI Mk II driver.
- *
- * Copyright (C) 1996 Jesper Skov (jskov@cs.auc.dk)
- */
-
-#include "NCR53C9x.h"
-
-#ifndef OKTAGON_ESP_H
-#define OKTAGON_ESP_H
-
-/* The controller registers can be found in the Z2 config area at these
- * offsets:
- */
-#define OKTAGON_ESP_ADDR 0x03000
-#define OKTAGON_DMA_ADDR 0x01000
-
-
-/* The CyberStorm II DMA interface */
-struct oktagon_dma_registers {
-	volatile unsigned char cond_reg;        /* DMA cond    (ro)  [0x000] */
-#define ctrl_reg  cond_reg			/* DMA control (wo)  [0x000] */
-	unsigned char dmapad4[0x3f];
-	volatile unsigned char dma_addr0;	/* DMA address (MSB) [0x040] */
-	unsigned char dmapad1[3];
-	volatile unsigned char dma_addr1;	/* DMA address       [0x044] */
-	unsigned char dmapad2[3];
-	volatile unsigned char dma_addr2;	/* DMA address       [0x048] */
-	unsigned char dmapad3[3];
-	volatile unsigned char dma_addr3;	/* DMA address (LSB) [0x04c] */
-};
-
-extern int oktagon_esp_detect(struct SHT *);
-extern int oktagon_esp_release(struct Scsi_Host *);
-extern const char *esp_info(struct Scsi_Host *);
-extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-extern int esp_command(Scsi_Cmnd *);
-extern int esp_abort(Scsi_Cmnd *);
-extern int esp_reset(Scsi_Cmnd *, unsigned int);
-extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
-			int hostno, int inout);
-
-#define SCSI_OKTAGON_ESP {                       \
-   proc_name:           "esp-oktagon",           \
-   proc_info:           &esp_proc_info,          \
-   name:                "BSC Oktagon SCSI",      \
-   detect:              oktagon_esp_detect,      \
-   release:             oktagon_esp_release,     \
-   queuecommand:        esp_queue,               \
-   abort:               esp_abort,               \
-   reset:               esp_reset,               \
-   can_queue:           7,                       \
-   this_id:             7,                       \
-   sg_tablesize:        SG_ALL,                  \
-   cmd_per_lun:         1,                       \
-   use_clustering:      ENABLE_CLUSTERING }
-
-#endif /* OKTAGON_ESP_H */
--- linux-2.5.46/drivers/scsi/sun3x_esp.c	Tue Nov  5 10:10:06 2002
+++ linux-m68k-2.5.46/drivers/scsi/sun3x_esp.c	Sun Nov 10 10:41:19 2002
@@ -18,7 +18,6 @@
 #include "hosts.h"
 #include "NCR53C9x.h"
 
-#include "sun3x_esp.h"
 #include <asm/sun3x.h>
 #include <asm/dvma.h>
 #include <asm/irq.h>
@@ -374,7 +373,23 @@
     sp->SCp.ptr = (char *)((unsigned long)sp->SCp.buffer->dvma_address);
 }
 
-static Scsi_Host_Template driver_template = SCSI_SUN3X_ESP;
+static Scsi_Host_Template driver_template = {
+	.proc_name		= "esp",
+	.proc_info		= &esp_proc_info,
+	.name			= "Sun ESP 100/100a/200",
+	.detect			= sun3x_esp_detect,
+	.info			= esp_info,
+	.command		= esp_command,
+	.queuecommand		= esp_queue,
+	.eh_abort_handler	= esp_abort,
+	.eh_bus_reset_handler	= esp_reset,
+	.can_queue		= 7,
+	.this_id		= 7,
+	.sg_tablesize		= SG_ALL,
+	.cmd_per_lun		= 1,
+	.use_clustering		= DISABLE_CLUSTERING,
+};
+
 
 #include "scsi_module.c"
 
--- linux-2.5.46/drivers/scsi/sun3x_esp.h	Fri Nov 12 01:57:30 1999
+++ linux-m68k-2.5.46/drivers/scsi/sun3x_esp.h	Thu Jan  1 01:00:00 1970
@@ -1,39 +0,0 @@
-/* sun3x_esp.h: Defines and structures for the Sun3x ESP
- *
- * (C) 1995 Thomas Bogendoerfer (tsbogend@alpha.franken.de)
- */
-
-#ifndef _SUN3X_ESP_H
-#define _SUN3X_ESP_H
-
-/* For dvma controller register definitions. */
-#include <asm/dvma.h>
-
-extern int sun3x_esp_detect(struct SHT *);
-extern const char *esp_info(struct Scsi_Host *);
-extern int esp_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
-extern int esp_command(Scsi_Cmnd *);
-extern int esp_abort(Scsi_Cmnd *);
-extern int esp_reset(Scsi_Cmnd *, unsigned int);
-extern int esp_proc_info(char *buffer, char **start, off_t offset, int length,
-			 int hostno, int inout);
-
-#define DMA_PORTS_P        (dregs->cond_reg & DMA_INT_ENAB)
-
-#define SCSI_SUN3X_ESP {                                        \
-		proc_name:      "esp",  			\
-		proc_info:      &esp_proc_info,			\
-		name:           "Sun ESP 100/100a/200",		\
-		detect:         sun3x_esp_detect,		\
-		info:           esp_info,			\
-		command:        esp_command,			\
-		queuecommand:   esp_queue,			\
-		abort:          esp_abort,			\
-		reset:          esp_reset,			\
-		can_queue:      7,				\
-		this_id:        7,				\
-		sg_tablesize:   SG_ALL,				\
-		cmd_per_lun:    1,				\
-		use_clustering: DISABLE_CLUSTERING, }
-
-#endif /* !(_SUN3X_ESP_H) */

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-10 10:27       ` Geert Uytterhoeven
@ 2002-11-10 14:38         ` Alan Cox
  2002-11-11  9:31           ` Geert Uytterhoeven
  0 siblings, 1 reply; 17+ messages in thread
From: Alan Cox @ 2002-11-10 14:38 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Christoph Hellwig, Linus Torvalds, Linux Kernel Development

On Sun, 2002-11-10 at 10:27, Geert Uytterhoeven wrote:
ut soft reset.
>   */
> -int esp_reset(Scsi_Cmnd *SCptr, unsigned int how)
> +int esp_reset(Scsi_Cmnd *SCptr)
>  {
>  	struct NCR_ESP *esp = (struct NCR_ESP *) SCptr->host->hostdata;
>  
>  	(void) esp_do_resetbus(esp, esp->eregs);
> -	return SCSI_RESET_PENDING;
> +	wait_event(esp->reset_queue, (esp->resetting_bus == 0));
> +
> +	return SUCCESS;
>  }

Reset is called with the lock held surely. How can the wait_event be
right ? 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-10 14:38         ` Alan Cox
@ 2002-11-11  9:31           ` Geert Uytterhoeven
  2002-11-11  9:43             ` David S. Miller
  0 siblings, 1 reply; 17+ messages in thread
From: Geert Uytterhoeven @ 2002-11-11  9:31 UTC (permalink / raw)
  To: Alan Cox, David S. Miller
  Cc: Christoph Hellwig, Linus Torvalds, Linux Kernel Development

On 10 Nov 2002, Alan Cox wrote:
> On Sun, 2002-11-10 at 10:27, Geert Uytterhoeven wrote:
> ut soft reset.
> >   */
> > -int esp_reset(Scsi_Cmnd *SCptr, unsigned int how)
> > +int esp_reset(Scsi_Cmnd *SCptr)
> >  {
> >  	struct NCR_ESP *esp = (struct NCR_ESP *) SCptr->host->hostdata;
> >  
> >  	(void) esp_do_resetbus(esp, esp->eregs);
> > -	return SCSI_RESET_PENDING;
> > +	wait_event(esp->reset_queue, (esp->resetting_bus == 0));
> > +
> > +	return SUCCESS;
> >  }
> 
> Reset is called with the lock held surely. How can the wait_event be
> right ? 

I don't know. I just ported the Sun/SPARC ESP SCSI driver changes in 2.5.45 to
the NCR53C9x ESP SCSI drivers. If you're right, the same bug is present in
esp.c.

Dave?

BTW, what about merging esp.c and NCR53C9x.c?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-11  9:31           ` Geert Uytterhoeven
@ 2002-11-11  9:43             ` David S. Miller
  2002-11-11 13:05               ` Alan Cox
  0 siblings, 1 reply; 17+ messages in thread
From: David S. Miller @ 2002-11-11  9:43 UTC (permalink / raw)
  To: geert; +Cc: alan, hch, torvalds, linux-kernel, dledford

   From: Geert Uytterhoeven <geert@linux-m68k.org>
   Date: Mon, 11 Nov 2002 10:31:23 +0100 (MET)

[ Doug, you should just care about my eh_reset callback comments ]

   On 10 Nov 2002, Alan Cox wrote:
   > Reset is called with the lock held surely. How can the wait_event be
   > right ? 
   
   I don't know. I just ported the Sun/SPARC ESP SCSI driver changes in 2.5.45 to
   the NCR53C9x ESP SCSI drivers. If you're right, the same bug is present in
   esp.c.
   
   Dave?
   
That's a little inconvenient.

I have to wait for an interrupt from the chip to know the RESET
started by the eh_reset_bus_handler code is done, and I'm certainly
not going to spin there for 5 seconds or however long it decides to
take. :-)

Either eh_reset_bus_handler needs to be allowed to sleep, or it needs
to be changed so that an "RESET in progress, please wait" status can
be returned.

Doug?

   BTW, what about merging esp.c and NCR53C9x.c?
   
I don't have the time to abstract away all of the various DMA portion
of the ESP chip handling to allow that.  There are 12 different
combinations of ESP + DMA controller combinations on Sparc, so if you
do the changes you'll need to test that :-)

Franks a lot,
David S. Miller
davem@redhat.com

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-11  9:43             ` David S. Miller
@ 2002-11-11 13:05               ` Alan Cox
  2002-11-11 17:24                 ` Linus Torvalds
  2002-11-11 20:35                 ` Doug Ledford
  0 siblings, 2 replies; 17+ messages in thread
From: Alan Cox @ 2002-11-11 13:05 UTC (permalink / raw)
  To: David S. Miller
  Cc: geert, hch, Linus Torvalds, Linux Kernel Mailing List, dledford

On Mon, 2002-11-11 at 09:43, David S. Miller wrote:
> That's a little inconvenient.
> 
> I have to wait for an interrupt from the chip to know the RESET
> started by the eh_reset_bus_handler code is done, and I'm certainly
> not going to spin there for 5 seconds or however long it decides to
> take. :-)

Lots of drivers do

> Either eh_reset_bus_handler needs to be allowed to sleep, or it needs
> to be changed so that an "RESET in progress, please wait" status can
> be returned.

The stupid thing is we take the lock then call the eh function then drop
it. You can drop the lock, wait and retake it. I need to fix a couple of
other drivers to do a proper wait and in much the same way.



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-11 13:05               ` Alan Cox
@ 2002-11-11 17:24                 ` Linus Torvalds
  2002-11-11 17:43                   ` Arjan van de Ven
                                     ` (2 more replies)
  2002-11-11 20:35                 ` Doug Ledford
  1 sibling, 3 replies; 17+ messages in thread
From: Linus Torvalds @ 2002-11-11 17:24 UTC (permalink / raw)
  To: Alan Cox
  Cc: David S. Miller, geert, Christoph Hellwig,
	Linux Kernel Mailing List, dledford, Jens Axboe


On 11 Nov 2002, Alan Cox wrote:
> 
> The stupid thing is we take the lock then call the eh function then drop
> it. You can drop the lock, wait and retake it. I need to fix a couple of
> other drivers to do a proper wait and in much the same way.

Hmm.. I wonder if the thing should disable the queue (plug it) and release 
the lock before calling reset. I assume we don't want any new requests at 
this point anyway, and having the low-level drivers know about stopping 
the queue etc sounds like a bad idea..

Of course, I suspect that it is potentially a bad idea to have the reset
functionality at the SCSI level _at_all_. As usual, the higher layers
don't really know what is going on, and the lower levels on smarter cards
are likely to be doing the right thing on their own, no?

(Yes, we should improve the infrastructure for having per-command timeouts 
etc, but the reset/abort callbacks have always been strange)

		Linus


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-11 17:24                 ` Linus Torvalds
@ 2002-11-11 17:43                   ` Arjan van de Ven
  2002-11-11 20:31                   ` Doug Ledford
  2002-11-11 22:48                   ` Alan Cox
  2 siblings, 0 replies; 17+ messages in thread
From: Arjan van de Ven @ 2002-11-11 17:43 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Alan Cox, David S. Miller, geert, Christoph Hellwig,
	Linux Kernel Mailing List, dledford, Jens Axboe

[-- Attachment #1: Type: text/plain, Size: 1176 bytes --]

On Mon, 2002-11-11 at 18:24, Linus Torvalds wrote:
> 
> On 11 Nov 2002, Alan Cox wrote:
> > 
> > The stupid thing is we take the lock then call the eh function then drop
> > it. You can drop the lock, wait and retake it. I need to fix a couple of
> > other drivers to do a proper wait and in much the same way.
> 
> Hmm.. I wonder if the thing should disable the queue (plug it) and release 
> the lock before calling reset. I assume we don't want any new requests at 
> this point anyway, and having the low-level drivers know about stopping 
> the queue etc sounds like a bad idea..

something similar is needed in the scsi layer for other reasons too; I
can imagine something that behaves similar as the network layer's 
netif_stop_queue() and allows drivers to inform the upper layer to stop
trying to submit requests to the lower level driver. Fiber channel
drivers can do this for example on LIP down (and enable again on LIP
up). LIP is not the only reason this is useful; overall I estimate that
over half of the code in the (out of tree) qlogic 2x00 driver can be
removed if this functionality was available.

Greetings,
   Arjan van de Ven


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-11 17:24                 ` Linus Torvalds
  2002-11-11 17:43                   ` Arjan van de Ven
@ 2002-11-11 20:31                   ` Doug Ledford
  2002-11-11 22:48                   ` Alan Cox
  2 siblings, 0 replies; 17+ messages in thread
From: Doug Ledford @ 2002-11-11 20:31 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Alan Cox, David S. Miller, geert, Christoph Hellwig,
	Linux Kernel Mailing List, Jens Axboe

On Mon, Nov 11, 2002 at 09:24:32AM -0800, Linus Torvalds wrote:
> 
> On 11 Nov 2002, Alan Cox wrote:
> > 
> > The stupid thing is we take the lock then call the eh function then drop
> > it. You can drop the lock, wait and retake it. I need to fix a couple of
> > other drivers to do a proper wait and in much the same way.
> 
> Hmm.. I wonder if the thing should disable the queue (plug it)

It does this already

> and release 
> the lock before calling reset.

We call into the driver with the lock held for the sake of consistency.  
When you get right down to it, you can write a driver who has no more 
concept of SMP locking than spin_lock_irq(host->host_lock); in the isr 
routine.  They need to know to drop the lock before calling scsi_sleep() 
in the eh routines, or they can drop the lock and sleep on some wait queue 
as well if they wish.  But, in general, in depth locking knowledge is not 
required.  Since I've ported the old aic7xxx driver to the new scheme, it 
is for certain an improvement over the old method in terms of ease of 
programming a driver to the API.

> I assume we don't want any new requests at 
> this point anyway, and having the low-level drivers know about stopping 
> the queue etc sounds like a bad idea..

Right, both already handled.

> Of course, I suspect that it is potentially a bad idea to have the reset
> functionality at the SCSI level _at_all_.

It saves a lot of code duplication.  There's basically only two existing 
reset strategies around.  A) I'm a stupid card with a SCSI bus and all 
SCSI busses and plain SCSI devices hang pretty much the same way, so the 
mid layer can write a reasonable strategy routine and just have the low 
level driver fill in the implementation hooks (abort hook, bus reset hook, 
full host reset hook, etc) and B) I'm an intelligent firmware and you just 
let me do my thing, in which case the mid layer can't really do anything 
and the low level drivers only need to leave the hooks undefined because 
if the firmware looses the command we're bust already.

> As usual, the higher layers
> don't really know what is going on, and the lower levels on smarter cards
> are likely to be doing the right thing on their own, no?

Lower levels on smart cards assume that if the card ever looses a command 
then you just want a watchdog to reset the machine anyway.

> (Yes, we should improve the infrastructure for having per-command timeouts 
> etc, but the reset/abort callbacks have always been strange)
> 
> 		Linus

-- 
  Doug Ledford <dledford@redhat.com>     919-754-3700 x44233
         Red Hat, Inc. 
         1801 Varsity Dr.
         Raleigh, NC 27606
  

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-11 13:05               ` Alan Cox
  2002-11-11 17:24                 ` Linus Torvalds
@ 2002-11-11 20:35                 ` Doug Ledford
  2002-11-11 21:01                   ` Linus Torvalds
  1 sibling, 1 reply; 17+ messages in thread
From: Doug Ledford @ 2002-11-11 20:35 UTC (permalink / raw)
  To: Alan Cox
  Cc: David S. Miller, geert, hch, Linus Torvalds, Linux Kernel Mailing List

On Mon, Nov 11, 2002 at 01:05:25PM +0000, Alan Cox wrote:
> Lots of drivers do

Yes, this part sucks.  There needs to be an easy library function that
takes a scsi command pointer, sets up a wait queue, adds the wait queue
struct pointer to the scsi command, sleeps with a timeout, wakes up when
command completes via scsi_done() or timeout fires, returns value based
upon how wake up happened.  Right now we don't have that, we only have a
little helper function, scsi_sleep(), for sleeping for a fixed length of 
time.

-- 
  Doug Ledford <dledford@redhat.com>     919-754-3700 x44233
         Red Hat, Inc. 
         1801 Varsity Dr.
         Raleigh, NC 27606
  

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-11 20:35                 ` Doug Ledford
@ 2002-11-11 21:01                   ` Linus Torvalds
  2002-11-11 21:24                     ` Doug Ledford
  0 siblings, 1 reply; 17+ messages in thread
From: Linus Torvalds @ 2002-11-11 21:01 UTC (permalink / raw)
  To: Doug Ledford
  Cc: Alan Cox, David S. Miller, geert, hch, Linux Kernel Mailing List


On Mon, 11 Nov 2002, Doug Ledford wrote:
> 
> Yes, this part sucks.  There needs to be an easy library function that
> takes a scsi command pointer, sets up a wait queue, adds the wait queue
> struct pointer to the scsi command, sleeps with a timeout, wakes up when
> command completes via scsi_done() or timeout fires, returns value based
> upon how wake up happened. 

I think you got it wrong.

The timer should be started when the command is started, not when it is 
queued.

Just adding the command to the request queue and doing a wait-queue'd
"schedule_timeout()" is bad, because a previous (and unrelated command) 
may be taking a long time, and may be delaying the new command which works 
perfectly fine and returns immediately.

Example: somebody does a "close tray and read". Where it should be 
perfectly possible to give the read command a short timeout, even if the 
close tray takes a few seconds. 

And btw, this has nothing to do with SCSI per se, so adding the thing to
the scsi command struct is bad, evil, and the reason for why the SCSI
mid-layers will eventually have to go away (ie they do exactly this kind
of thing, and _encourage_ people to do them).

We've got almost all of the infrastructure to do this on a request level 
now, including the timeout value (but nothing that sets the timeouts for 
regular IO).

We don't have the starting of the timer thing there, and that's at least
partly because I really think the timer should be started and set up by
the driver itself - and that's because only the driver can know if it can
actually remove the request and how to do it.

If the request ends up being pending and holding up other requests
(because the driver doesn't know how to physically abort it), we MUST NOT
return it as being "aborted due to timeout", because higher layers cannot
de-allocate the request anyway (imagine the thing later on waking up and
scribbling on memory that has now been free'd because the command "timed
out").

But yes, we want the infrastructure for doing this easily some day. As it 
is, that's 2.7.x material by now.

			Linus


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-11 21:01                   ` Linus Torvalds
@ 2002-11-11 21:24                     ` Doug Ledford
  0 siblings, 0 replies; 17+ messages in thread
From: Doug Ledford @ 2002-11-11 21:24 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Alan Cox, David S. Miller, geert, hch, Linux Kernel Mailing List

On Mon, Nov 11, 2002 at 01:01:00PM -0800, Linus Torvalds wrote:
> 
> On Mon, 11 Nov 2002, Doug Ledford wrote:
> > 
> > Yes, this part sucks.  There needs to be an easy library function that
> > takes a scsi command pointer, sets up a wait queue, adds the wait queue
> > struct pointer to the scsi command, sleeps with a timeout, wakes up when
> > command completes via scsi_done() or timeout fires, returns value based
> > upon how wake up happened. 
> 
> I think you got it wrong.
> 
> The timer should be started when the command is started, not when it is 
> queued.

It is.  I don't have it wrong :-P

> Just adding the command to the request queue and doing a wait-queue'd
> "schedule_timeout()" is bad,

And I would *never* suggest such a thing.

> because a previous (and unrelated command) 
> may be taking a long time, and may be delaying the new command which works 
> perfectly fine and returns immediately.

Keep in mind that this is in eh context (from the original post).  I'm not 
talking about the queue path or normal case, only error recovery.  For 
example, in an abort handler, your driver can abort commands that haven't 
made it to the drive yet immediately and return success.  If the command 
has already made it to the drive but hasn't been completed yet, then you 
need to tell the drive to abort the command, not just do it.  So, 
currently, what I have to do in aic7xxx_abort() is actually requeue the 
command to my card (this is OK, the card firmware does the right thing in 
regards to finding an already active command on the incoming queue) but 
this time with the abort message in the command message buffer.  The card 
starts device selection, the device responds, we send the IDENTIFY and 
(possibly) TAG messages, followed by either ABORT or ABORT_TAG, device 
then drops the bus to signify receipt of ABORT message.  Fairly clean 
process.  The process can fail.  If there is another command that is stuck 
and holding the whole bus hostage, then our card won't be able to initiate 
selection to the device.  So, the only thing we can do is take a wait and 
see attitude about whether or not the card can actually start the command 
to the device and tell it to abort.  In my driver now, I just drop the 
lock and call scsi_sleep(HZ/4); (only need a very short timeout, if the 
bus isn't hung then this completes fast, if it is hung, waiting doesn't 
help), then check to see if my interrupt handler has completed the 
command.  Other drivers should wait significantly longer depending on 
hardware.  So, for me, the difference between scsi_sleep(HZ/4); or 
something like scsi_sleep_until_done_with_timeout(cmd, HZ/4); is no big 
deal, but I could see it making a lot of sense for other drivers (iSCSI, 
other emulated drivers with fabrics, etc. come to mind).  So, this becomes 
a hook for "wake me up when this command makes it through to the normal 
completion code".

[ snipped rest of Linus' comments since I think they are pretty orthogonal 
to the point I was making in the first place ]


-- 
  Doug Ledford <dledford@redhat.com>     919-754-3700 x44233
         Red Hat, Inc. 
         1801 Varsity Dr.
         Raleigh, NC 27606
  

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
  2002-11-11 17:24                 ` Linus Torvalds
  2002-11-11 17:43                   ` Arjan van de Ven
  2002-11-11 20:31                   ` Doug Ledford
@ 2002-11-11 22:48                   ` Alan Cox
  2 siblings, 0 replies; 17+ messages in thread
From: Alan Cox @ 2002-11-11 22:48 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: David S. Miller, geert, Christoph Hellwig,
	Linux Kernel Mailing List, dledford, Jens Axboe

On Mon, 2002-11-11 at 17:24, Linus Torvalds wrote:
> 
> On 11 Nov 2002, Alan Cox wrote:
> > 
> > The stupid thing is we take the lock then call the eh function then drop
> > it. You can drop the lock, wait and retake it. I need to fix a couple of
> > other drivers to do a proper wait and in much the same way.
> 
> Hmm.. I wonder if the thing should disable the queue (plug it) and release 
> the lock before calling reset. I assume we don't want any new requests at 
> this point anyway, and having the low-level drivers know about stopping 
> the queue etc sounds like a bad idea..

Thats already being dealt with. The eh handler is a seperate thread
called after things are reasonably sane so that it can attempt recovery
and do so in a sleeping context if need be. The eh ones are actually
very except for the fact they take the lock before calling


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH] NCR53C9x ESP: C99 designated initializers
@ 2002-11-11 18:30 J.E.J. Bottomley
  0 siblings, 0 replies; 17+ messages in thread
From: J.E.J. Bottomley @ 2002-11-11 18:30 UTC (permalink / raw)
  To: Linus Torvalds, Arjan van de Ven, Alan Cox; +Cc: linux-kernel

On 11 Nov 2002, Alan Cox wrote:
> 
> The stupid thing is we take the lock then call the eh function then drop
> it. You can drop the lock, wait and retake it. I need to fix a couple of
> other drivers to do a proper wait and in much the same way.

I agree.  You can simply drop the lock with no adverse consequences.

torvalds@transmeta.com wrote:
> Hmm.. I wonder if the thing should disable the queue (plug it) and
> release  the lock before calling reset. I assume we don't want any new
> requests at  this point anyway, and having the low-level drivers know
> about stopping  the queue etc sounds like a bad idea..

The queue doesn't need plugging, because only the error handler is a consumer 
of this function (which stops the queue as it begins and  restarts the queue 
on exit).  As Alan said, the lock stuff is a bit daft since the whole reason 
the new eh came into being was to do this from a kernel thread so you could 
sleep...

arjanv@redhat.com said:
> something similar is needed in the scsi layer for other reasons too; I
> can imagine something that behaves similar as the network layer's
> netif_stop_queue() and allows drivers to inform the upper layer to
> stop trying to submit requests to the lower level driver. Fiber
> channel drivers can do this for example on LIP down (and enable again
> on LIP up). LIP is not the only reason this is useful; overall I
> estimate that over half of the code in the (out of tree) qlogic 2x00
> driver can be removed if this functionality was available.

The API exists (scsi_block_requests, scsi_unblock_requests).  It was 
previously never really used because calling block_requests with no commands 
outstanding hung the driver.  However, this problem has been fixed.

The one thing this API doesn't do is stop timers on the outstanding commands, 
but that could be done too, probably by a flag passed in.

James



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2002-11-11 22:16 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-03 10:46 [PATCH] NCR53C9x ESP: C99 designated initializers Geert Uytterhoeven
2002-11-03 13:13 ` Christoph Hellwig
2002-11-03 14:28   ` Geert Uytterhoeven
2002-11-03 14:33     ` Christoph Hellwig
2002-11-10 10:27       ` Geert Uytterhoeven
2002-11-10 14:38         ` Alan Cox
2002-11-11  9:31           ` Geert Uytterhoeven
2002-11-11  9:43             ` David S. Miller
2002-11-11 13:05               ` Alan Cox
2002-11-11 17:24                 ` Linus Torvalds
2002-11-11 17:43                   ` Arjan van de Ven
2002-11-11 20:31                   ` Doug Ledford
2002-11-11 22:48                   ` Alan Cox
2002-11-11 20:35                 ` Doug Ledford
2002-11-11 21:01                   ` Linus Torvalds
2002-11-11 21:24                     ` Doug Ledford
2002-11-11 18:30 J.E.J. Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).