Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net80211/ieee80211_freebsd.c
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
#include <net/if_types.h> | #include <net/if_types.h> | ||||
#include <net/ethernet.h> | #include <net/ethernet.h> | ||||
#include <net/route.h> | #include <net/route.h> | ||||
#include <net/vnet.h> | #include <net/vnet.h> | ||||
#include <net80211/ieee80211_var.h> | #include <net80211/ieee80211_var.h> | ||||
#include <net80211/ieee80211_input.h> | #include <net80211/ieee80211_input.h> | ||||
DEBUGNET_DEFINE(ieee80211); | |||||
SYSCTL_NODE(_net, OID_AUTO, wlan, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, | SYSCTL_NODE(_net, OID_AUTO, wlan, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, | ||||
"IEEE 80211 parameters"); | "IEEE 80211 parameters"); | ||||
#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 | ||||
Show All 35 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 DEBUGNET | |||||
if (ic->ic_debugnet_meth != NULL) | |||||
DEBUGNET_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 918 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
const char * | const char * | ||||
ieee80211_get_vap_ifname(struct ieee80211vap *vap) | ieee80211_get_vap_ifname(struct ieee80211vap *vap) | ||||
{ | { | ||||
if (vap->iv_ifp == NULL) | if (vap->iv_ifp == NULL) | ||||
return "(none)"; | return "(none)"; | ||||
return vap->iv_ifp->if_xname; | return vap->iv_ifp->if_xname; | ||||
} | } | ||||
#ifdef DEBUGNET | |||||
static void | |||||
ieee80211_debugnet_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_debugnet_meth->dn8_init(ic, nrxr, ncl, clsize); | |||||
IEEE80211_UNLOCK(ic); | |||||
} | |||||
static void | |||||
ieee80211_debugnet_event(struct ifnet *ifp, enum debugnet_ev ev) | |||||
{ | |||||
struct ieee80211vap *vap; | |||||
struct ieee80211com *ic; | |||||
vap = if_getsoftc(ifp); | |||||
ic = vap->iv_ic; | |||||
IEEE80211_LOCK(ic); | |||||
ic->ic_debugnet_meth->dn8_event(ic, ev); | |||||
IEEE80211_UNLOCK(ic); | |||||
} | |||||
static int | |||||
ieee80211_debugnet_transmit(struct ifnet *ifp, struct mbuf *m) | |||||
{ | |||||
return (ieee80211_vap_transmit(ifp, m)); | |||||
} | |||||
static int | |||||
ieee80211_debugnet_poll(struct ifnet *ifp, int count) | |||||
{ | |||||
struct ieee80211vap *vap; | |||||
struct ieee80211com *ic; | |||||
vap = if_getsoftc(ifp); | |||||
ic = vap->iv_ic; | |||||
return (ic->ic_debugnet_meth->dn8_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 |