Changeset View
Changeset View
Standalone View
Standalone View
sys/net80211/ieee80211_freebsd.c
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
#ifdef IEEE80211_DEBUG | #ifdef IEEE80211_DEBUG | ||||
static int ieee80211_debug = 0; | static int ieee80211_debug = 0; | ||||
SYSCTL_INT(_net_wlan, OID_AUTO, debug, CTLFLAG_RW, &ieee80211_debug, | SYSCTL_INT(_net_wlan, OID_AUTO, debug, CTLFLAG_RW, &ieee80211_debug, | ||||
0, "debugging printfs"); | 0, "debugging printfs"); | ||||
#endif | #endif | ||||
static MALLOC_DEFINE(M_80211_COM, "80211com", "802.11 com state"); | static MALLOC_DEFINE(M_80211_COM, "80211com", "802.11 com state"); | ||||
NETDUMP_DEFINE(ieee80211); | |||||
static const char wlanname[] = "wlan"; | static const char wlanname[] = "wlan"; | ||||
static struct if_clone *wlan_cloner; | static struct if_clone *wlan_cloner; | ||||
static int | static int | ||||
wlan_clone_create(struct if_clone *ifc, int unit, caddr_t params) | wlan_clone_create(struct if_clone *ifc, int unit, caddr_t params) | ||||
{ | { | ||||
struct ieee80211_clone_params cp; | struct ieee80211_clone_params cp; | ||||
Show All 27 Lines | ) { | ||||
ic_printf(ic, "TDMA not supported\n"); | ic_printf(ic, "TDMA not supported\n"); | ||||
return EOPNOTSUPP; | return EOPNOTSUPP; | ||||
} | } | ||||
vap = ic->ic_vap_create(ic, wlanname, unit, | vap = ic->ic_vap_create(ic, wlanname, unit, | ||||
cp.icp_opmode, cp.icp_flags, cp.icp_bssid, | cp.icp_opmode, cp.icp_flags, cp.icp_bssid, | ||||
cp.icp_flags & IEEE80211_CLONE_MACADDR ? | cp.icp_flags & IEEE80211_CLONE_MACADDR ? | ||||
cp.icp_macaddr : ic->ic_macaddr); | cp.icp_macaddr : ic->ic_macaddr); | ||||
return (vap == NULL ? EIO : 0); | if (vap == NULL) | ||||
return (EIO); | |||||
#ifdef NETDUMP | |||||
if (ic->ic_netdump_meth != NULL) | |||||
NETDUMP_SET(vap->iv_ifp, ieee80211); | |||||
#endif | |||||
return (0); | |||||
} | } | ||||
static void | static void | ||||
wlan_clone_destroy(struct ifnet *ifp) | wlan_clone_destroy(struct ifnet *ifp) | ||||
{ | { | ||||
struct ieee80211vap *vap = ifp->if_softc; | struct ieee80211vap *vap = ifp->if_softc; | ||||
struct ieee80211com *ic = vap->iv_ic; | struct ieee80211com *ic = vap->iv_ic; | ||||
▲ Show 20 Lines • Show All 843 Lines • ▼ Show 20 Lines | wlan_iflladdr(void *arg __unused, struct ifnet *ifp) | ||||
/* NB: identify vap's by if_init */ | /* NB: identify vap's by if_init */ | ||||
if (ifp->if_init == ieee80211_init && | if (ifp->if_init == ieee80211_init && | ||||
(ifp->if_flags & IFF_UP) == 0) { | (ifp->if_flags & IFF_UP) == 0) { | ||||
struct ieee80211vap *vap = ifp->if_softc; | struct ieee80211vap *vap = ifp->if_softc; | ||||
IEEE80211_ADDR_COPY(vap->iv_myaddr, IF_LLADDR(ifp)); | IEEE80211_ADDR_COPY(vap->iv_myaddr, IF_LLADDR(ifp)); | ||||
} | } | ||||
} | } | ||||
#ifdef NETDUMP | |||||
static void | |||||
ieee80211_netdump_init(struct ifnet *ifp, int *nrxr, int *ncl, int *clsize) | |||||
{ | |||||
struct ieee80211vap *vap; | |||||
struct ieee80211com *ic; | |||||
vap = if_getsoftc(ifp); | |||||
ic = vap->iv_ic; | |||||
IEEE80211_LOCK(ic); | |||||
ic->ic_netdump_meth->nd8_init(ic, nrxr, ncl, clsize); | |||||
IEEE80211_UNLOCK(ic); | |||||
} | |||||
static void | |||||
ieee80211_netdump_event(struct ifnet *ifp, enum netdump_ev ev) | |||||
{ | |||||
struct ieee80211vap *vap; | |||||
struct ieee80211com *ic; | |||||
vap = if_getsoftc(ifp); | |||||
ic = vap->iv_ic; | |||||
IEEE80211_LOCK(ic); | |||||
ic->ic_netdump_meth->nd8_event(ic, ev); | |||||
IEEE80211_UNLOCK(ic); | |||||
} | |||||
static int | |||||
ieee80211_netdump_transmit(struct ifnet *ifp, struct mbuf *m) | |||||
{ | |||||
return (ieee80211_vap_transmit(ifp, m)); | |||||
} | |||||
static int | |||||
ieee80211_netdump_poll(struct ifnet *ifp, int count) | |||||
{ | |||||
struct ieee80211vap *vap; | |||||
struct ieee80211com *ic; | |||||
vap = if_getsoftc(ifp); | |||||
ic = vap->iv_ic; | |||||
return (ic->ic_netdump_meth->nd8_poll(ic, count)); | |||||
} | |||||
#endif | |||||
/* | /* | ||||
* Module glue. | * Module glue. | ||||
* | * | ||||
* NB: the module name is "wlan" for compatibility with NetBSD. | * NB: the module name is "wlan" for compatibility with NetBSD. | ||||
*/ | */ | ||||
static int | static int | ||||
wlan_modevent(module_t mod, int type, void *unused) | wlan_modevent(module_t mod, int type, void *unused) | ||||
Show All 33 Lines |