Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netsmb take two on module support
details: https://anonhg.NetBSD.org/src/rev/305d12105e78
branches: trunk
changeset: 759719:305d12105e78
user: ahoka <ahoka%NetBSD.org@localhost>
date: Wed Dec 15 12:58:13 2010 +0000
description:
take two on module support
XXX this wont work as a builtin module
diffstat:
sys/netsmb/smb_dev.c | 44 ++++++++++++++++++++++++++++++++++++++++++--
sys/netsmb/smb_iod.c | 6 ++----
2 files changed, 44 insertions(+), 6 deletions(-)
diffs (94 lines):
diff -r 7a8764104c76 -r 305d12105e78 sys/netsmb/smb_dev.c
--- a/sys/netsmb/smb_dev.c Wed Dec 15 11:22:41 2010 +0000
+++ b/sys/netsmb/smb_dev.c Wed Dec 15 12:58:13 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smb_dev.c,v 1.35 2010/12/11 04:21:17 christos Exp $ */
+/* $NetBSD: smb_dev.c,v 1.36 2010/12/15 12:58:13 ahoka Exp $ */
/*
* Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smb_dev.c,v 1.35 2010/12/11 04:21:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_dev.c,v 1.36 2010/12/15 12:58:13 ahoka Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -462,6 +462,46 @@
}
DEV_MODULE (dev_netsmb, nsmb_dev_load, 0);
+#else
+
+#ifdef _MODULE
+
+#include <sys/module.h>
+
+MODULE(MODULE_CLASS_MISC, nsmb, NULL);
+
+static int
+nsmb_modcmd(modcmd_t cmd, void *arg)
+{
+ devmajor_t cmajor = NODEVMAJOR, bmajor = NODEVMAJOR;
+ int error = 0;
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ nsmbattach(1);
+ error =
+ devsw_attach("nsmb", NULL, &bmajor, &nsmb_cdevsw, &cmajor);
+ if (error)
+ return error;
+
+ break;
+ case MODULE_CMD_FINI:
+ smb_iod_done();
+ smb_sm_done();
+ smb_rqpool_fini();
+ error = devsw_detach(NULL, &nsmb_cdevsw);
+ free(smb_devtbl, M_NSMBDEV);
+ break;
+ default:
+ error = ENOTTY;
+ break;
+ }
+ return error;
+ return 0;
+
+}
+#endif /* _MODULE */
+
#endif /* !__NetBSD__ */
/*
diff -r 7a8764104c76 -r 305d12105e78 sys/netsmb/smb_iod.c
--- a/sys/netsmb/smb_iod.c Wed Dec 15 11:22:41 2010 +0000
+++ b/sys/netsmb/smb_iod.c Wed Dec 15 12:58:13 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smb_iod.c,v 1.37 2010/12/11 04:21:17 christos Exp $ */
+/* $NetBSD: smb_iod.c,v 1.38 2010/12/15 12:58:13 ahoka Exp $ */
/*
* Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smb_iod.c,v 1.37 2010/12/11 04:21:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_iod.c,v 1.38 2010/12/15 12:58:13 ahoka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -744,10 +744,8 @@
return 0;
}
-#ifndef __NetBSD__
int
smb_iod_done(void)
{
return 0;
}
-#endif
Home |
Main Index |
Thread Index |
Old Index