diff options
Diffstat (limited to 'sys/cam/cam_xpt.c')
-rw-r--r-- | sys/cam/cam_xpt.c | 25 |
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) |