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-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).