aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Hibma <n_hibma@FreeBSD.org>2000-08-13 18:49:40 +0000
committerNick Hibma <n_hibma@FreeBSD.org>2000-08-13 18:49:40 +0000
commit74bd1c1038d5de585f56f19b690107230cb4f229 (patch)
treeae95c524cff98d6f41926fcc67606798dca85cc9
parent9350bdc398e00c2d615b6bbf8c4a064a701c130b (diff)
Notes
-rw-r--r--sys/cam/cam_xpt.c25
-rw-r--r--sys/dev/usb/umass.c3
-rw-r--r--sys/modules/Makefile2
-rw-r--r--sys/modules/cam/Makefile33
4 files changed, 61 insertions, 2 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index eade26ce8be1..b5fe1c46bc76 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)
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c
index d798de7ea5c3..2f81aa1894df 100644
--- a/sys/dev/usb/umass.c
+++ b/sys/dev/usb/umass.c
@@ -536,6 +536,9 @@ Static void umass_dump_buffer (struct umass_softc *sc, u_int8_t *buffer,
int buflen, int printlen);
#endif
+#if defined(__FreeBSD__)
+MODULE_DEPEND(umass, cam, 1,1,1);
+#endif
/*
* USB device probe/attach/detach
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 6bbfbb620017..274778594b5a 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -7,7 +7,7 @@ _randomdev= randomdev
.endif
SUBDIR= 3dfx accf_data accf_http agp aha amr an aue \
- ccd cd9660 coda cue dc fdesc fxp if_disc if_ef \
+ cam ccd cd9660 coda cue dc fdesc fxp if_disc if_ef \
if_ppp if_sl if_tap if_tun ipfilter ipfw ispfw joy kernfs kue \
md mfs mii mlx msdos ncp netgraph nfs ntfs nullfs \
nwfs oldcard pccard pcic portal procfs ${_randomdev} \
diff --git a/sys/modules/cam/Makefile b/sys/modules/cam/Makefile
new file mode 100644
index 000000000000..2075d398a755
--- /dev/null
+++ b/sys/modules/cam/Makefile
@@ -0,0 +1,33 @@
+# $FreeBSD$
+
+MAINTAINER = n_hibma@freebsd.org
+S = ${.CURDIR}/../..
+
+.PATH: $S/cam $S/cam/scsi
+KMOD = cam
+
+# See sys/conf/options for the flags that go into the different opt_*.h files.
+SRCS = opt_cam.h
+SRCS += opt_scsi.h
+SRCS += opt_cd.h
+SRCS += opt_hw_wdog.h
+SRCS += opt_pt.h
+SRCS += opt_sa.h
+SRCS += opt_ses.h
+SRCS += device_if.h bus_if.h
+SRCS += cam.c cam_extend.c cam_periph.c cam_queue.c
+SRCS += cam_sim.c cam_xpt.c
+SRCS += scsi_all.c scsi_cd.c scsi_ch.c
+SRCS += scsi_da.c
+SRCS += scsi_pass.c
+SRCS += scsi_pt.c
+SRCS += scsi_sa.c
+SRCS += scsi_ses.c
+SRCS += scsi_targ_bh.c scsi_target.c
+
+NOMAN =
+
+opt_scsi.h:
+ echo '#define SCSI_DELAY 15000' > opt_scsi.h
+
+.include <bsd.kmod.mk>