Source-Changes-HG archive

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

[src/trunk]: src/sys add "ir" and "cir" modules



details:   https://anonhg.NetBSD.org/src/rev/d527e14cf172
branches:  trunk
changeset: 760143:d527e14cf172
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Dec 28 14:45:30 2010 +0000

description:
add "ir" and "cir" modules

diffstat:

 sys/dev/ir/cir.c           |  34 ++++++++++++++++++++++++++++++++--
 sys/dev/ir/ir.c            |  19 +++++++++++++++++--
 sys/modules/cir/Makefile   |  13 +++++++++++++
 sys/modules/cir/cir.ioconf |  10 ++++++++++
 sys/modules/ir/Makefile    |  12 ++++++++++++
 5 files changed, 84 insertions(+), 4 deletions(-)

diffs (148 lines):

diff -r 191f6001ea24 -r d527e14cf172 sys/dev/ir/cir.c
--- a/sys/dev/ir/cir.c  Tue Dec 28 13:36:09 2010 +0000
+++ b/sys/dev/ir/cir.c  Tue Dec 28 14:45:30 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cir.c,v 1.26 2009/12/06 22:40:56 dyoung Exp $  */
+/*     $NetBSD: cir.c,v 1.27 2010/12/28 14:45:30 jmcneill Exp $        */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cir.c,v 1.26 2009/12/06 22:40:56 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cir.c,v 1.27 2010/12/28 14:45:30 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -41,6 +41,7 @@
 #include <sys/poll.h>
 #include <sys/select.h>
 #include <sys/vnode.h>
+#include <sys/module.h>
 
 #include <dev/ir/ir.h>
 #include <dev/ir/cirio.h>
@@ -257,3 +258,32 @@
        splx(s);
        return (revents);
 }
+
+MODULE(MODULE_CLASS_DRIVER, cir, "ir");
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+cir_modcmd(modcmd_t cmd, void *opaque)
+{
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+#ifdef _MODULE
+               return config_init_component(cfdriver_ioconf_cir,
+                   cfattach_ioconf_cir, cfdata_ioconf_cir);
+#else
+               return 0;
+#endif
+       case MODULE_CMD_FINI:
+#ifdef _MODULE
+               return config_fini_component(cfdriver_ioconf_cir,
+                   cfattach_ioconf_cir, cfdata_ioconf_cir);
+#else
+               return 0;
+#endif
+       default:
+               return ENOTTY;
+       }
+}
diff -r 191f6001ea24 -r d527e14cf172 sys/dev/ir/ir.c
--- a/sys/dev/ir/ir.c   Tue Dec 28 13:36:09 2010 +0000
+++ b/sys/dev/ir/ir.c   Tue Dec 28 14:45:30 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ir.c,v 1.5 2008/04/28 20:23:51 martin Exp $    */
+/*     $NetBSD: ir.c,v 1.6 2010/12/28 14:45:30 jmcneill Exp $  */
 
 /*
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,12 +30,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ir.c,v 1.5 2008/04/28 20:23:51 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ir.c,v 1.6 2010/12/28 14:45:30 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/device.h>
+#include <sys/module.h>
 
 #include <dev/ir/ir.h>
 
@@ -59,3 +60,17 @@
 
        return (UNCONF);
 }
+
+MODULE(MODULE_CLASS_DRIVER, ir, NULL);
+
+static int
+ir_modcmd(modcmd_t cmd, void *opaque)
+{
+       switch (cmd) {
+       case MODULE_CMD_INIT:
+       case MODULE_CMD_FINI:
+               return 0;
+       default:
+               return ENOTTY;
+       }
+}
diff -r 191f6001ea24 -r d527e14cf172 sys/modules/cir/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/cir/Makefile  Tue Dec 28 14:45:30 2010 +0000
@@ -0,0 +1,13 @@
+#      $NetBSD: Makefile,v 1.1 2010/12/28 14:45:30 jmcneill Exp $
+
+.include "../Makefile.inc"
+
+.PATH: ${S}/dev/ir
+
+KMOD=  cir
+IOCONF=        cir.ioconf
+SRCS=  cir.c
+
+WARNS= 4
+
+.include <bsd.kmodule.mk>
diff -r 191f6001ea24 -r d527e14cf172 sys/modules/cir/cir.ioconf
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/cir/cir.ioconf        Tue Dec 28 14:45:30 2010 +0000
@@ -0,0 +1,10 @@
+#      $NetBSD: cir.ioconf,v 1.1 2010/12/28 14:45:30 jmcneill Exp $
+
+ioconf cir
+
+include "conf/files"
+include "dev/ir/files.ir"
+
+pseudo-root irbus*
+
+cir* at irbus?
diff -r 191f6001ea24 -r d527e14cf172 sys/modules/ir/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/modules/ir/Makefile   Tue Dec 28 14:45:30 2010 +0000
@@ -0,0 +1,12 @@
+#      $NetBSD: Makefile,v 1.1 2010/12/28 14:45:30 jmcneill Exp $
+
+.include "../Makefile.inc"
+
+.PATH: ${S}/dev/ir
+
+KMOD=  ir
+SRCS=  ir.c
+
+WARNS= 4
+
+.include <bsd.kmodule.mk>



Home | Main Index | Thread Index | Old Index