Module Name:    src
Committed By:   riz
Date:           Mon May 28 04:18:12 UTC 2012

Modified Files:
        src/sys/dev/iscsi: iscsi_main.c

Log Message:
Expose some of the module framework when _MODULE is not defined, so
iscsi becomes a "built in" module in that case.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/iscsi/iscsi_main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/iscsi/iscsi_main.c
diff -u src/sys/dev/iscsi/iscsi_main.c:1.2 src/sys/dev/iscsi/iscsi_main.c:1.3
--- src/sys/dev/iscsi/iscsi_main.c:1.2	Mon May 28 03:43:18 2012
+++ src/sys/dev/iscsi/iscsi_main.c	Mon May 28 04:18:12 2012
@@ -483,7 +483,6 @@ iscsi_done(ccb_t *ccb)
 }
 
 /* Kernel Module support */
-#ifdef _MODULE
 
 #include <sys/module.h>
 
@@ -493,6 +492,7 @@ static const struct cfiattrdata ibescsi_
 };
 static const struct cfiattrdata *const iscsi_attrs[] = { &ibescsi_info, NULL };
 
+#ifdef _MODULE
 CFDRIVER_DECL(iscsi, DV_DULL, iscsi_attrs);
 
 static struct cfdata iscsi_cfdata[] = {
@@ -507,15 +507,19 @@ static struct cfdata iscsi_cfdata[] = {
 	},
 	{ NULL, NULL, 0, 0, NULL, 0, NULL }
 };
+#endif
 
 static int
 iscsi_modcmd(modcmd_t cmd, void *arg)
 {
+#ifdef _MODULE
 	devmajor_t cmajor = NODEVMAJOR, bmajor = NODEVMAJOR;
 	int error;
+#endif
 
 	switch (cmd) {
 	case MODULE_CMD_INIT:
+#ifdef _MODULE
 		error = config_cfdriver_attach(&iscsi_cd);
 		if (error) {
 			return error;
@@ -556,11 +560,12 @@ iscsi_modcmd(modcmd_t cmd, void *arg)
 			config_cfdriver_detach(&iscsi_cd);
 			return ENXIO;
 		}
-
+#endif
 		return 0;
 		break;
 
 	case MODULE_CMD_FINI:
+#ifdef _MODULE
 		error = config_cfdata_detach(iscsi_cfdata);
 		if (error)
 			return error;
@@ -568,7 +573,7 @@ iscsi_modcmd(modcmd_t cmd, void *arg)
 		config_cfattach_detach(iscsi_cd.cd_name, &iscsi_ca);
 		config_cfdriver_detach(&iscsi_cd);
 		devsw_detach(NULL, &iscsi_cdevsw);
-
+#endif
 		return 0;
 		break;
 
@@ -581,4 +586,3 @@ iscsi_modcmd(modcmd_t cmd, void *arg)
 		break;
 	}
 }
-#endif /* _MODULE */

Reply via email to