Update for modular build

This commit is contained in:
pgoyette 2011-08-23 12:53:29 +00:00
parent f19d57b776
commit 75c5b19872
2 changed files with 66 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_axe.c,v 1.47 2010/11/03 22:28:31 dyoung Exp $ */
/* $NetBSD: if_axe.c,v 1.48 2011/08/23 12:53:29 pgoyette Exp $ */
/* $OpenBSD: if_axe.c,v 1.96 2010/01/09 05:33:08 jsg Exp $ */
/*
@ -89,12 +89,14 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.47 2010/11/03 22:28:31 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.48 2011/08/23 12:53:29 pgoyette Exp $");
#if defined(__NetBSD__)
#ifndef _MODULE
#include "opt_inet.h"
#include "rnd.h"
#endif
#endif
#include <sys/param.h>
@ -102,6 +104,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.47 2010/11/03 22:28:31 dyoung Exp $");
#include <sys/device.h>
#include <sys/kernel.h>
#include <sys/mbuf.h>
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/socket.h>
#include <sys/sockio.h>
@ -1455,3 +1458,32 @@ axe_stop(struct ifnet *ifp, int disable)
sc->axe_link = 0;
}
MODULE(MODULE_CLASS_DRIVER, if_axe, NULL);
#ifdef _MODULE
#include "ioconf.c"
#endif
static int
if_axe_modcmd(modcmd_t cmd, void *aux)
{
int error = 0;
switch (cmd) {
case MODULE_CMD_INIT:
#ifdef _MODULE
error = config_init_component(cfdriver_ioconf_if_axe,
cfattach_ioconf_if_axe, cfdata_ioconf_if_axe);
#endif
return error;
case MODULE_CMD_FINI:
#ifdef _MODULE
error = config_fini_component(cfdriver_ioconf_if_axe,
cfattach_ioconf_if_axe, cfdata_ioconf_if_axe);
#endif
return error;
default:
return ENOTTY;
}
}

View File

@ -1,5 +1,5 @@
/* $OpenBSD: if_rum.c,v 1.40 2006/09/18 16:20:20 damien Exp $ */
/* $NetBSD: if_rum.c,v 1.37 2011/08/23 12:33:50 pgoyette Exp $ */
/* $NetBSD: if_rum.c,v 1.38 2011/08/23 12:53:29 pgoyette Exp $ */
/*-
* Copyright (c) 2005-2007 Damien Bergamini <damien.bergamini@free.fr>
@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.37 2011/08/23 12:33:50 pgoyette Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.38 2011/08/23 12:53:29 pgoyette Exp $");
#include <sys/param.h>
@ -35,6 +35,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_rum.c,v 1.37 2011/08/23 12:33:50 pgoyette Exp $")
#include <sys/socket.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/conf.h>
#include <sys/device.h>
@ -2297,3 +2298,32 @@ rum_activate(device_t self, enum devact act)
return 0;
}
}
MODULE(MODULE_CLASS_DRIVER, if_rum, NULL);
#ifdef _MODULE
#include "ioconf.c"
#endif
static int
if_rum_modcmd(modcmd_t cmd, void *aux)
{
int error = 0;
switch (cmd) {
case MODULE_CMD_INIT:
#ifdef _MODULE
error = config_init_component(cfdriver_ioconf_if_rum,
cfattach_ioconf_if_rum, cfdata_ioconf_if_rum);
#endif
return error;
case MODULE_CMD_FINI:
#ifdef _MODULE
error = config_fini_component(cfdriver_ioconf_if_rum,
cfattach_ioconf_if_rum, cfdata_ioconf_if_rum);
#endif
return error;
default:
return ENOTTY;
}
}