summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_xpt.c
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>2000-08-13 18:49:40 +0000
committern_hibma <n_hibma@FreeBSD.org>2000-08-13 18:49:40 +0000
commitcbb74c17bdde9e04efd4115114940217143abe93 (patch)
treef008fa927436b05de6cb7f877e62d71234d3d789 /sys/cam/cam_xpt.c
parenta6c3c8dbfbbbdbe8e9dc451f059eec365e4825a1 (diff)
downloadFreeBSD-src-cbb74c17bdde9e04efd4115114940217143abe93.zip
FreeBSD-src-cbb74c17bdde9e04efd4115114940217143abe93.tar.gz
CAM, the module: scbus, da, cd, and st wrapped in one module.
Make the umass driver depend on this module. Makes it possible to compile the kernel without SCSI support and load it when for example a USB floppy is conencted.
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r--sys/cam/cam_xpt.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index eade26c..b5fe1c4 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -629,8 +629,19 @@ u_int32_t cam_debug_delay;
#endif /* CAM_DEBUG_BUS || CAM_DEBUG_TARGET || CAM_DEBUG_LUN */
/* Our boot-time initialization hook */
+static int cam_module_event_handler(module_t, int /*modeventtype_t*/, void *);
+
+static moduledata_t cam_moduledata = {
+ "cam",
+ cam_module_event_handler,
+ NULL
+};
+
static void xpt_init(void *);
-SYSINIT(cam, SI_SUB_CONFIGURE, SI_ORDER_SECOND, xpt_init, NULL);
+
+DECLARE_MODULE(cam, cam_moduledata, SI_SUB_CONFIGURE, SI_ORDER_SECOND);
+MODULE_VERSION(cam, 1);
+
static cam_status xpt_compile_path(struct cam_path *new_path,
struct cam_periph *perph,
@@ -1266,6 +1277,18 @@ ptstartover:
return(error);
}
+static int
+cam_module_event_handler(module_t mod, int what, void *arg)
+{
+ if (what == MOD_LOAD) {
+ xpt_init(NULL);
+ } else if (what == MOD_UNLOAD) {
+ return EBUSY;
+ }
+
+ return 0;
+}
+
/* Functions accessed by the peripheral drivers */
static void
xpt_init(dummy)
OpenPOWER on IntegriCloud