Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys support building as a module



details:   https://anonhg.NetBSD.org/src/rev/e8f6c6fa2ca5
branches:  trunk
changeset: 762350:e8f6c6fa2ca5
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Feb 20 03:55:18 2011 +0000

description:
support building as a module

diffstat:

 sys/dev/ic/ath.c                           |   6 ++++--
 sys/dev/ic/ath_netbsd.c                    |  19 +++++++++++++++++--
 sys/dev/ic/athrate-sample.c                |   6 ++++--
 sys/external/isc/atheros_hal/ic/ah_osdep.c |  21 +++++++++++++++++++--
 sys/external/isc/atheros_hal/ic/opt_ah.h   |   4 +++-
 5 files changed, 47 insertions(+), 9 deletions(-)

diffs (165 lines):

diff -r 724f1ec01dca -r e8f6c6fa2ca5 sys/dev/ic/ath.c
--- a/sys/dev/ic/ath.c  Sun Feb 20 02:26:40 2011 +0000
+++ b/sys/dev/ic/ath.c  Sun Feb 20 03:55:18 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ath.c,v 1.109 2010/04/05 07:19:33 joerg Exp $  */
+/*     $NetBSD: ath.c,v 1.110 2011/02/20 03:55:56 jmcneill Exp $       */
 
 /*-
  * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -41,7 +41,7 @@
 __FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.104 2005/09/16 10:09:23 ru Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.109 2010/04/05 07:19:33 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.110 2011/02/20 03:55:56 jmcneill Exp $");
 #endif
 
 /*
@@ -51,7 +51,9 @@
  * is greatly appreciated.
  */
 
+#ifdef _KERNEL_OPT
 #include "opt_inet.h"
+#endif
 
 #include <sys/param.h>
 #include <sys/reboot.h>
diff -r 724f1ec01dca -r e8f6c6fa2ca5 sys/dev/ic/ath_netbsd.c
--- a/sys/dev/ic/ath_netbsd.c   Sun Feb 20 02:26:40 2011 +0000
+++ b/sys/dev/ic/ath_netbsd.c   Sun Feb 20 03:55:18 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ath_netbsd.c,v 1.18 2011/01/21 17:46:19 dyoung Exp $ */
+/*     $NetBSD: ath_netbsd.c,v 1.19 2011/02/20 03:55:56 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2003, 2004 David Young
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ath_netbsd.c,v 1.18 2011/01/21 17:46:19 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ath_netbsd.c,v 1.19 2011/02/20 03:55:56 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -44,6 +44,7 @@
 #include <machine/stdarg.h>
 #include <sys/endian.h>
 #include <sys/device.h>
+#include <sys/module.h>
 
 #include <net/if.h>
 #include <net/if_dl.h>
@@ -521,3 +522,17 @@
 err:
        printf("%s: sysctl_createv failed, rc = %d\n", __func__, rc);
 }
+
+MODULE(MODULE_CLASS_MISC, ath, "ath_hal");
+
+static int
+ath_modcmd(modcmd_t cmd, void *opaque)
+{
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+       case MODULE_CMD_FINI:
+               return 0;
+       default:
+               return ENOTTY;
+       }
+}
diff -r 724f1ec01dca -r e8f6c6fa2ca5 sys/dev/ic/athrate-sample.c
--- a/sys/dev/ic/athrate-sample.c       Sun Feb 20 02:26:40 2011 +0000
+++ b/sys/dev/ic/athrate-sample.c       Sun Feb 20 03:55:18 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: athrate-sample.c,v 1.17 2008/12/11 05:45:29 alc Exp $ */
+/*     $NetBSD: athrate-sample.c,v 1.18 2011/02/20 03:55:56 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2005 John Bicket
@@ -41,14 +41,16 @@
 __FBSDID("$FreeBSD: src/sys/dev/ath/ath_rate/sample/sample.c,v 1.9 2005/07/22 16:50:17 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: athrate-sample.c,v 1.17 2008/12/11 05:45:29 alc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: athrate-sample.c,v 1.18 2011/02/20 03:55:56 jmcneill Exp $");
 #endif
 
 
 /*
  * John Bicket's SampleRate control algorithm.
  */
+#ifdef _KERNEL_OPT
 #include "opt_inet.h"
+#endif
 
 #include <sys/param.h>
 #include <sys/systm.h> 
diff -r 724f1ec01dca -r e8f6c6fa2ca5 sys/external/isc/atheros_hal/ic/ah_osdep.c
--- a/sys/external/isc/atheros_hal/ic/ah_osdep.c        Sun Feb 20 02:26:40 2011 +0000
+++ b/sys/external/isc/atheros_hal/ic/ah_osdep.c        Sun Feb 20 03:55:18 2011 +0000
@@ -26,13 +26,15 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGES.
  *
- * $Id: ah_osdep.c,v 1.3 2009/08/07 21:01:48 sborrill Exp $
+ * $Id: ah_osdep.c,v 1.4 2011/02/20 03:55:18 jmcneill Exp $
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ah_osdep.c,v 1.3 2009/08/07 21:01:48 sborrill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ah_osdep.c,v 1.4 2011/02/20 03:55:18 jmcneill Exp $");
 
+#ifdef _KERNEL_OPT
 #include "opt_athhal.h"
+#endif
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -41,6 +43,7 @@
 #include <sys/malloc.h>
 #include <sys/proc.h>
 #include <sys/kauth.h>
+#include <sys/module.h>
 
 #include <machine/stdarg.h>
 
@@ -437,3 +440,17 @@
 {
        return memcpy(dst, src, n);
 }
+
+MODULE(MODULE_CLASS_MISC, ath_hal, NULL);
+
+static int
+ath_hal_modcmd(modcmd_t cmd, void *opaque)
+{
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+       case MODULE_CMD_FINI:
+               return 0;
+       default:
+               return ENOTTY;
+       }
+}
diff -r 724f1ec01dca -r e8f6c6fa2ca5 sys/external/isc/atheros_hal/ic/opt_ah.h
--- a/sys/external/isc/atheros_hal/ic/opt_ah.h  Sun Feb 20 02:26:40 2011 +0000
+++ b/sys/external/isc/atheros_hal/ic/opt_ah.h  Sun Feb 20 03:55:18 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: opt_ah.h,v 1.1 2008/12/11 05:37:40 alc Exp $ */
+/* $NetBSD: opt_ah.h,v 1.2 2011/02/20 03:55:18 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -28,7 +28,9 @@
 #ifndef OPT_AH_H
 #define OPT_AH_H
 
+#ifdef _KERNEL_OPT
 #include "opt_athhal.h"
+#endif
 
 #ifdef ATHHAL_ASSERT
 #define AH_ASSERT              1



Home | Main Index | Thread Index | Old Index