summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_freebsd.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2012-10-16 13:37:54 +0000
committerglebius <glebius@FreeBSD.org>2012-10-16 13:37:54 +0000
commit05f24a6b77a43334f14f31cd33a4f3e34a418ea2 (patch)
tree0f54a9446bfe2083d3c0a3f744318b2be8a0db05 /sys/net80211/ieee80211_freebsd.c
parent745884b065065ffc8847d3ea463bf751ffcaf863 (diff)
downloadFreeBSD-src-05f24a6b77a43334f14f31cd33a4f3e34a418ea2.zip
FreeBSD-src-05f24a6b77a43334f14f31cd33a4f3e34a418ea2.tar.gz
Make the "struct if_clone" opaque to users of the cloning API. Users
now use function calls: if_clone_simple() if_clone_advanced() to initialize a cloner, instead of macros that initialize if_clone structure. Discussed with: brooks, bz, 1 year ago
Diffstat (limited to 'sys/net80211/ieee80211_freebsd.c')
-rw-r--r--sys/net80211/ieee80211_freebsd.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/net80211/ieee80211_freebsd.c b/sys/net80211/ieee80211_freebsd.c
index b733d2f..bf4acee 100644
--- a/sys/net80211/ieee80211_freebsd.c
+++ b/sys/net80211/ieee80211_freebsd.c
@@ -65,6 +65,10 @@ SYSCTL_INT(_net_wlan, OID_AUTO, debug, CTLFLAG_RW, &ieee80211_debug,
static MALLOC_DEFINE(M_80211_COM, "80211com", "802.11 com state");
+static const char wlanname[] = "wlan";
+
+static struct if_clone *wlan_cloner;
+
/*
* Allocate/free com structure in conjunction with ifnet;
* these routines are registered with if_register_com_alloc
@@ -129,7 +133,7 @@ wlan_clone_create(struct if_clone *ifc, int unit, caddr_t params)
if_printf(ifp, "TDMA not supported\n");
return EOPNOTSUPP;
}
- vap = ic->ic_vap_create(ic, ifc->ifc_name, unit,
+ vap = ic->ic_vap_create(ic, wlanname, unit,
cp.icp_opmode, cp.icp_flags, cp.icp_bssid,
cp.icp_flags & IEEE80211_CLONE_MACADDR ?
cp.icp_macaddr : (const uint8_t *)IF_LLADDR(ifp));
@@ -144,12 +148,11 @@ wlan_clone_destroy(struct ifnet *ifp)
ic->ic_vap_delete(vap);
}
-IFC_SIMPLE_DECLARE(wlan, 0);
void
ieee80211_vap_destroy(struct ieee80211vap *vap)
{
- if_clone_destroyif(&wlan_cloner, vap->iv_ifp);
+ if_clone_destroyif(wlan_cloner, vap->iv_ifp);
}
int
@@ -806,12 +809,13 @@ wlan_modevent(module_t mod, int type, void *unused)
EVENTHANDLER_DEREGISTER(bpf_track, wlan_bpfevent);
return ENOMEM;
}
- if_clone_attach(&wlan_cloner);
+ wlan_cloner = if_clone_simple(wlanname, wlan_clone_create,
+ wlan_clone_destroy, 0);
if_register_com_alloc(IFT_IEEE80211, wlan_alloc, wlan_free);
return 0;
case MOD_UNLOAD:
if_deregister_com_alloc(IFT_IEEE80211);
- if_clone_detach(&wlan_cloner);
+ if_clone_detach(wlan_cloner);
EVENTHANDLER_DEREGISTER(bpf_track, wlan_bpfevent);
EVENTHANDLER_DEREGISTER(iflladdr_event, wlan_ifllevent);
return 0;
@@ -820,7 +824,7 @@ wlan_modevent(module_t mod, int type, void *unused)
}
static moduledata_t wlan_mod = {
- "wlan",
+ wlanname,
wlan_modevent,
0
};
OpenPOWER on IntegriCloud