add "ir" and "cir" modules

This commit is contained in:
jmcneill 2010-12-28 14:45:30 +00:00
parent bca088ab45
commit b678bc7497
5 changed files with 84 additions and 4 deletions

View File

@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: cir.c,v 1.26 2009/12/06 22:40:56 dyoung Exp $");
#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 @@ cirpoll(dev_t dev, int events, struct lwp *l)
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;
}
}

View File

@ -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 @@ ir_print(void *aux, const char *pnp)
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;
}
}

13
sys/modules/cir/Makefile Normal file
View File

@ -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>

View File

@ -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?

12
sys/modules/ir/Makefile Normal file
View File

@ -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>