patch-2.4.2 linux/drivers/acorn/scsi/ecoscsi.c

Next file: linux/drivers/acorn/scsi/ecoscsi.h
Previous file: linux/drivers/acorn/scsi/cumana_2.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.1/linux/drivers/acorn/scsi/ecoscsi.c linux/drivers/acorn/scsi/ecoscsi.c
@@ -53,10 +53,11 @@
 
 #include "../../scsi/scsi.h"
 #include "../../scsi/hosts.h"
-#include "ecoscsi.h"
 #include "../../scsi/NCR5380.h"
 #include "../../scsi/constants.h"
 
+#define ECOSCSI_PUBLIC_RELEASE 1
+
 static char ecoscsi_read(struct Scsi_Host *instance, int reg)
 {
   int iobase = instance->io_port;
@@ -231,11 +232,63 @@
 #endif
 #undef STAT
 
+#ifndef HOSTS_C
+#define NCR5380_implementation_fields \
+    int port, ctrl
+
+#define NCR5380_local_declare() \
+        struct Scsi_Host *_instance
+
+#define NCR5380_setup(instance) \
+        _instance = instance
+
+#define NCR5380_read(reg) ecoscsi_read(_instance, reg)
+#define NCR5380_write(reg, value) ecoscsi_write(_instance, reg, value)
+
+#define do_NCR5380_intr do_ecoscsi_intr
+#define NCR5380_queue_command ecoscsi_queue_command
+#define NCR5380_abort ecoscsi_abort
+#define NCR5380_reset ecoscsi_reset
+#define NCR5380_proc_info ecoscsi_proc_info
+
+int NCR5380_proc_info(char *buffer, char **start, off_t offset,
+		      int length, int hostno, int inout);
+
+#define BOARD_NORMAL	0
+#define BOARD_NCR53C400	1
+
 #include "../../scsi/NCR5380.c"
 
-#ifdef MODULE
+static Scsi_Host_Template ecoscsi_template =  {
+	module:		THIS_MODULE,
+	name:		"Serial Port EcoSCSI NCR5380",
+	detect:		ecoscsi_detect,
+	release:	ecoscsi_release,
+	info:		ecoscsi_info,
+	queuecommand:	ecoscsi_queue_command,
+	abort:		ecoscsi_abort,
+	reset:		ecoscsi_reset,
+	can_queue:	16,
+	this_id:	7,
+	sg_tablesize:	SG_ALL,
+	cmd_per_lun:	2,
+	use_clustering:	DISABLE_CLUSTERING
+};
+
+static int __init ecoscsi_init(void)
+{
+	scsi_register_module(MODULE_SCSI_HA, &ecoscsi_template);
+	if (ecoscsi_template.present)
+		return 0;
+
+	scsi_unregister_module(MODULE_SCSI_HA, &ecoscsi_template);
+	return -ENODEV;
+}
 
-Scsi_Host_Template driver_template = ECOSCSI_NCR5380;
+static void __exit ecoscsi_exit(void)
+{
+	scsi_unregister_module(MODULE_SCSI_HA, &ecoscsi_template);
+}
 
-#include "../../scsi/scsi_module.c"
-#endif
+module_init(ecoscsi_init);
+module_exit(ecoscsi_exit);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)