Use a once control to call initialize the 802.11 layer when
ieee80211_ifattach() is called. "wlan" no longer needs-flag, and remove the ieee80211_init() call from main().
This commit is contained in:
parent
4537c59ffb
commit
9c99eab147
@ -1,4 +1,4 @@
|
||||
# $NetBSD: files,v 1.740 2005/11/18 21:55:14 martin Exp $
|
||||
# $NetBSD: files,v 1.741 2005/11/25 17:33:56 thorpej Exp $
|
||||
|
||||
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
|
||||
|
||||
@ -1364,7 +1364,7 @@ file net80211/ieee80211_crypto_tkip.c wlan
|
||||
file net80211/ieee80211_crypto_wep.c wlan
|
||||
file net80211/ieee80211_input.c wlan
|
||||
file net80211/ieee80211_ioctl.c wlan
|
||||
file net80211/ieee80211_netbsd.c wlan needs-flag
|
||||
file net80211/ieee80211_netbsd.c wlan
|
||||
file net80211/ieee80211_node.c wlan
|
||||
file net80211/ieee80211_output.c wlan
|
||||
file net80211/ieee80211_proto.c wlan
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: init_main.c,v 1.254 2005/11/25 16:16:46 thorpej Exp $ */
|
||||
/* $NetBSD: init_main.c,v 1.255 2005/11/25 17:33:56 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1991, 1992, 1993
|
||||
@ -71,7 +71,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.254 2005/11/25 16:16:46 thorpej Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.255 2005/11/25 17:33:56 thorpej Exp $");
|
||||
|
||||
#include "fs_nfs.h"
|
||||
#include "opt_nfsserver.h"
|
||||
@ -88,7 +88,6 @@ __KERNEL_RCSID(0, "$NetBSD: init_main.c,v 1.254 2005/11/25 16:16:46 thorpej Exp
|
||||
#include "opt_verified_exec.h"
|
||||
|
||||
#include "rnd.h"
|
||||
#include "wlan.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/acct.h>
|
||||
@ -278,11 +277,6 @@ main(void)
|
||||
/* Initialize signal-related data structures. */
|
||||
signal_init();
|
||||
|
||||
#if NWLAN > 0
|
||||
/* Initialize the net80211 layer */
|
||||
ieee80211_init();
|
||||
#endif
|
||||
|
||||
/* Create process 0 (the swapper). */
|
||||
proc0_init();
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ieee80211.c,v 1.41 2005/11/18 16:40:08 skrll Exp $ */
|
||||
/* $NetBSD: ieee80211.c,v 1.42 2005/11/25 17:33:56 thorpej Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2001 Atsushi Onoe
|
||||
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
|
||||
@ -36,7 +36,7 @@
|
||||
__FBSDID("$FreeBSD: src/sys/net80211/ieee80211.c,v 1.22 2005/08/10 16:22:29 sam Exp $");
|
||||
#endif
|
||||
#ifdef __NetBSD__
|
||||
__KERNEL_RCSID(0, "$NetBSD: ieee80211.c,v 1.41 2005/11/18 16:40:08 skrll Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ieee80211.c,v 1.42 2005/11/25 17:33:56 thorpej Exp $");
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -152,6 +152,10 @@ ieee80211_ifattach(struct ieee80211com *ic)
|
||||
struct ieee80211_channel *c;
|
||||
int i;
|
||||
|
||||
#ifdef __NetBSD__
|
||||
ieee80211_init();
|
||||
#endif /* __NetBSD__ */
|
||||
|
||||
ether_ifattach(ifp, ic->ic_myaddr);
|
||||
#if NBPFILTER > 0
|
||||
bpfattach2(ifp, DLT_IEEE802_11,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ieee80211_netbsd.c,v 1.9 2005/11/20 09:39:04 dyoung Exp $ */
|
||||
/* $NetBSD: ieee80211_netbsd.c,v 1.10 2005/11/25 17:33:56 thorpej Exp $ */
|
||||
/*-
|
||||
* Copyright (c) 2003-2005 Sam Leffler, Errno Consulting
|
||||
* All rights reserved.
|
||||
@ -30,11 +30,11 @@
|
||||
#ifdef __FreeBSD__
|
||||
__FBSDID("$FreeBSD: src/sys/net80211/ieee80211_freebsd.c,v 1.8 2005/08/08 18:46:35 sam Exp $");
|
||||
#else
|
||||
__KERNEL_RCSID(0, "$NetBSD: ieee80211_netbsd.c,v 1.9 2005/11/20 09:39:04 dyoung Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: ieee80211_netbsd.c,v 1.10 2005/11/25 17:33:56 thorpej Exp $");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* IEEE 802.11 support (FreeBSD-specific code)
|
||||
* IEEE 802.11 support (NetBSD-specific code)
|
||||
*/
|
||||
#include <sys/param.h>
|
||||
#include <sys/kernel.h>
|
||||
@ -42,6 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: ieee80211_netbsd.c,v 1.9 2005/11/20 09:39:04 dyoung
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/once.h>
|
||||
|
||||
#include <machine/stdarg.h>
|
||||
|
||||
@ -75,8 +76,8 @@ typedef void (*ieee80211_setup_func)(void);
|
||||
|
||||
__link_set_decl(ieee80211_funcs, ieee80211_setup_func);
|
||||
|
||||
void
|
||||
ieee80211_init(void)
|
||||
static void
|
||||
ieee80211_init0(void)
|
||||
{
|
||||
ieee80211_setup_func * const *ieee80211_setup, f;
|
||||
|
||||
@ -86,6 +87,14 @@ ieee80211_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ieee80211_init(void)
|
||||
{
|
||||
static ONCE_DECL(ieee80211_init_once);
|
||||
|
||||
RUN_ONCE(&ieee80211_init_once, ieee80211_init0);
|
||||
}
|
||||
|
||||
static int
|
||||
ieee80211_sysctl_inact(SYSCTLFN_ARGS)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user