diff options
author | adrian <adrian@FreeBSD.org> | 2012-10-26 16:56:55 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2012-10-26 16:56:55 +0000 |
commit | cc93b91b81aa385b660a4d4fa680acec2e2eb002 (patch) | |
tree | 89dc6c8f02833aca831c905e6e95a4501c8e18c8 /sys/net80211/ieee80211_freebsd.c | |
parent | b24573de07e5249b4c159feabcbfed257142a85d (diff) | |
download | FreeBSD-src-cc93b91b81aa385b660a4d4fa680acec2e2eb002.zip FreeBSD-src-cc93b91b81aa385b660a4d4fa680acec2e2eb002.tar.gz |
Fix up some initial issues with creation and deletion of hotplugged
net80211 devices and vaps.
* vnet sets vnet0 during kldload and device probe/attach, but not for
the hotplug event. Thus, plugging in a NIC causes things to panic.
So, add a CURVNET_SET(vnet0) for now during the attach phase, until
the hotplug code is taught to set CURVNET_SET(vnet0).
* there's also no implied detach vnet context - so teach the detach
path about ifp->if_vnet.
* When creating/deleting vaps, also set the vnet context appropriately.
These can be done at any time.
Now, the problems!
* ieee80211.c is supposed to be OS-portable code, with no OS-specific stuff
like vnet. That should be fixed.
* When the device hotplug code gets taught about CURVNET_SET(vnet0), the
device vnet set can go away; but the VAP vnet set still needs to be there.
* .. and there still is the question about potentially adding an implied
CURVNET_SET(ifp->if_vnet) on if_free(), since any/all devices may end up
being detached by a hotplug event in today's world. That's going to be
a topic of a subsequent commit.
Diffstat (limited to 'sys/net80211/ieee80211_freebsd.c')
-rw-r--r-- | sys/net80211/ieee80211_freebsd.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c index bf4acee..e307e9d 100644 --- a/sys/net80211/ieee80211_freebsd.c +++ b/sys/net80211/ieee80211_freebsd.c @@ -152,7 +152,9 @@ wlan_clone_destroy(struct ifnet *ifp) void ieee80211_vap_destroy(struct ieee80211vap *vap) { + CURVNET_SET(vap->iv_ifp->if_vnet); if_clone_destroyif(wlan_cloner, vap->iv_ifp); + CURVNET_RESTORE(); } int |