diff options
author | jhb <jhb@FreeBSD.org> | 2006-06-13 21:36:23 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-06-13 21:36:23 +0000 |
commit | 9af5dd68e4cafc61cd39c93a9cbb404beec42308 (patch) | |
tree | 6bdda3a80fe25172e30b3b25fc2a0ae45191cc84 /sys/net80211 | |
parent | 00130e4f0c49136fca94a71afa4a22642743681e (diff) | |
download | FreeBSD-src-9af5dd68e4cafc61cd39c93a9cbb404beec42308.zip FreeBSD-src-9af5dd68e4cafc61cd39c93a9cbb404beec42308.tar.gz |
Use kern_kldload() and kern_kldunload() to load and unload modules when
we intend for the user to be able to unload them later via kldunload(2)
instead of calling linker_load_module() and then directly adjusting the
ref count on the linker file structure. This makes the resulting
consumer code simpler and cleaner and better hides the linker internals
making it possible to sanely lock the linker.
Diffstat (limited to 'sys/net80211')
-rw-r--r-- | sys/net80211/ieee80211_freebsd.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c index 4fa0207..912f2d0 100644 --- a/sys/net80211/ieee80211_freebsd.c +++ b/sys/net80211/ieee80211_freebsd.c @@ -310,14 +310,9 @@ ieee80211_notify_michael_failure(struct ieee80211com *ic, void ieee80211_load_module(const char *modname) { -#ifdef notyet - struct thread *td = curthread; - if (suser(td) == 0 && securelevel_gt(td->td_ucred, 0) == 0) { - mtx_lock(&Giant); - (void) linker_load_module(modname, NULL, NULL, NULL, NULL); - mtx_unlock(&Giant); - } +#ifdef notyet + (void)kern_kldload(curthread, modname, NULL); #else printf("%s: load the %s module by hand for now.\n", __func__, modname); #endif |