Changeset View
Changeset View
Standalone View
Standalone View
head/sys/net80211/ieee80211_proto.c
Show First 20 Lines • Show All 235 Lines • ▼ Show 20 Lines | |||||
static void beacon_miss(void *, int); | static void beacon_miss(void *, int); | ||||
static void beacon_swmiss(void *, int); | static void beacon_swmiss(void *, int); | ||||
static void parent_updown(void *, int); | static void parent_updown(void *, int); | ||||
static void update_mcast(void *, int); | static void update_mcast(void *, int); | ||||
static void update_promisc(void *, int); | static void update_promisc(void *, int); | ||||
static void update_channel(void *, int); | static void update_channel(void *, int); | ||||
static void update_chw(void *, int); | static void update_chw(void *, int); | ||||
static void update_wme(void *, int); | static void vap_update_wme(void *, int); | ||||
static void restart_vaps(void *, int); | static void restart_vaps(void *, int); | ||||
static void ieee80211_newstate_cb(void *, int); | static void ieee80211_newstate_cb(void *, int); | ||||
static int | static int | ||||
null_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, | null_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, | ||||
const struct ieee80211_bpf_params *params) | const struct ieee80211_bpf_params *params) | ||||
{ | { | ||||
Show All 22 Lines | ieee80211_proto_attach(struct ieee80211com *ic) | ||||
ic->ic_protmode = IEEE80211_PROT_CTSONLY; | ic->ic_protmode = IEEE80211_PROT_CTSONLY; | ||||
TASK_INIT(&ic->ic_parent_task, 0, parent_updown, ic); | TASK_INIT(&ic->ic_parent_task, 0, parent_updown, ic); | ||||
TASK_INIT(&ic->ic_mcast_task, 0, update_mcast, ic); | TASK_INIT(&ic->ic_mcast_task, 0, update_mcast, ic); | ||||
TASK_INIT(&ic->ic_promisc_task, 0, update_promisc, ic); | TASK_INIT(&ic->ic_promisc_task, 0, update_promisc, ic); | ||||
TASK_INIT(&ic->ic_chan_task, 0, update_channel, ic); | TASK_INIT(&ic->ic_chan_task, 0, update_channel, ic); | ||||
TASK_INIT(&ic->ic_bmiss_task, 0, beacon_miss, ic); | TASK_INIT(&ic->ic_bmiss_task, 0, beacon_miss, ic); | ||||
TASK_INIT(&ic->ic_chw_task, 0, update_chw, ic); | TASK_INIT(&ic->ic_chw_task, 0, update_chw, ic); | ||||
TASK_INIT(&ic->ic_wme_task, 0, update_wme, ic); | |||||
TASK_INIT(&ic->ic_restart_task, 0, restart_vaps, ic); | TASK_INIT(&ic->ic_restart_task, 0, restart_vaps, ic); | ||||
ic->ic_wme.wme_hipri_switch_hysteresis = | ic->ic_wme.wme_hipri_switch_hysteresis = | ||||
AGGRESSIVE_MODE_SWITCH_HYSTERESIS; | AGGRESSIVE_MODE_SWITCH_HYSTERESIS; | ||||
/* initialize management frame handlers */ | /* initialize management frame handlers */ | ||||
ic->ic_send_mgmt = ieee80211_send_mgmt; | ic->ic_send_mgmt = ieee80211_send_mgmt; | ||||
ic->ic_raw_xmit = null_raw_xmit; | ic->ic_raw_xmit = null_raw_xmit; | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | ieee80211_proto_vattach(struct ieee80211vap *vap) | ||||
vap->iv_rtsthreshold = IEEE80211_RTS_DEFAULT; | vap->iv_rtsthreshold = IEEE80211_RTS_DEFAULT; | ||||
vap->iv_fragthreshold = IEEE80211_FRAG_DEFAULT; | vap->iv_fragthreshold = IEEE80211_FRAG_DEFAULT; | ||||
vap->iv_bmiss_max = IEEE80211_BMISS_MAX; | vap->iv_bmiss_max = IEEE80211_BMISS_MAX; | ||||
callout_init_mtx(&vap->iv_swbmiss, IEEE80211_LOCK_OBJ(ic), 0); | callout_init_mtx(&vap->iv_swbmiss, IEEE80211_LOCK_OBJ(ic), 0); | ||||
callout_init(&vap->iv_mgtsend, 1); | callout_init(&vap->iv_mgtsend, 1); | ||||
TASK_INIT(&vap->iv_nstate_task, 0, ieee80211_newstate_cb, vap); | TASK_INIT(&vap->iv_nstate_task, 0, ieee80211_newstate_cb, vap); | ||||
TASK_INIT(&vap->iv_swbmiss_task, 0, beacon_swmiss, vap); | TASK_INIT(&vap->iv_swbmiss_task, 0, beacon_swmiss, vap); | ||||
TASK_INIT(&vap->iv_wme_task, 0, vap_update_wme, vap); | |||||
/* | /* | ||||
* Install default tx rate handling: no fixed rate, lowest | * Install default tx rate handling: no fixed rate, lowest | ||||
* supported rate for mgmt and multicast frames. Default | * supported rate for mgmt and multicast frames. Default | ||||
* max retry count. These settings can be changed by the | * max retry count. These settings can be changed by the | ||||
* driver and/or user applications. | * driver and/or user applications. | ||||
*/ | */ | ||||
for (i = IEEE80211_MODE_11A; i < IEEE80211_MODE_MAX; i++) { | for (i = IEEE80211_MODE_11A; i < IEEE80211_MODE_MAX; i++) { | ||||
const struct ieee80211_rateset *rs = &ic->ic_sup_rates[i]; | const struct ieee80211_rateset *rs = &ic->ic_sup_rates[i]; | ||||
▲ Show 20 Lines • Show All 931 Lines • ▼ Show 20 Lines | if (vap->iv_opmode == IEEE80211_M_HOSTAP | ||||
* set number so associated stations load the new values. | * set number so associated stations load the new values. | ||||
*/ | */ | ||||
wme->wme_bssChanParams.cap_info = | wme->wme_bssChanParams.cap_info = | ||||
(wme->wme_bssChanParams.cap_info+1) & WME_QOSINFO_COUNT; | (wme->wme_bssChanParams.cap_info+1) & WME_QOSINFO_COUNT; | ||||
ieee80211_beacon_notify(vap, IEEE80211_BEACON_WME); | ieee80211_beacon_notify(vap, IEEE80211_BEACON_WME); | ||||
} | } | ||||
/* schedule the deferred WME update */ | /* schedule the deferred WME update */ | ||||
ieee80211_runtask(ic, &ic->ic_wme_task); | ieee80211_runtask(ic, &vap->iv_wme_task); | ||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, | IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, | ||||
"%s: WME params updated, cap_info 0x%x\n", __func__, | "%s: WME params updated, cap_info 0x%x\n", __func__, | ||||
vap->iv_opmode == IEEE80211_M_STA ? | vap->iv_opmode == IEEE80211_M_STA ? | ||||
wme->wme_wmeChanParams.cap_info : | wme->wme_wmeChanParams.cap_info : | ||||
wme->wme_bssChanParams.cap_info); | wme->wme_bssChanParams.cap_info); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | update_chw(void *arg, int npending) | ||||
struct ieee80211com *ic = arg; | struct ieee80211com *ic = arg; | ||||
/* | /* | ||||
* XXX should we defer the channel width _config_ update until now? | * XXX should we defer the channel width _config_ update until now? | ||||
*/ | */ | ||||
ic->ic_update_chw(ic); | ic->ic_update_chw(ic); | ||||
} | } | ||||
/* | |||||
* Deferred WME update. | |||||
* | |||||
* In preparation for per-VAP WME configuration, call the VAP | |||||
* method if the VAP requires it. Otherwise, just call the | |||||
* older global method. There isn't a per-VAP WME configuration | |||||
* just yet so for now just use the global configuration. | |||||
*/ | |||||
static void | static void | ||||
update_wme(void *arg, int npending) | vap_update_wme(void *arg, int npending) | ||||
{ | { | ||||
struct ieee80211com *ic = arg; | struct ieee80211vap *vap = arg; | ||||
struct ieee80211com *ic = vap->iv_ic; | |||||
/* | if (vap->iv_wme_update != NULL) | ||||
* XXX should we defer the WME configuration update until now? | vap->iv_wme_update(vap, | ||||
*/ | ic->ic_wme.wme_chanParams.cap_wmeParams); | ||||
else | |||||
ic->ic_wme.wme_update(ic); | ic->ic_wme.wme_update(ic); | ||||
} | } | ||||
static void | static void | ||||
restart_vaps(void *arg, int npending) | restart_vaps(void *arg, int npending) | ||||
{ | { | ||||
struct ieee80211com *ic = arg; | struct ieee80211com *ic = arg; | ||||
ieee80211_suspend_all(ic); | ieee80211_suspend_all(ic); | ||||
Show All 10 Lines | |||||
{ | { | ||||
taskqueue_block(ic->ic_tq); | taskqueue_block(ic->ic_tq); | ||||
ieee80211_draintask(ic, &ic->ic_parent_task); | ieee80211_draintask(ic, &ic->ic_parent_task); | ||||
ieee80211_draintask(ic, &ic->ic_mcast_task); | ieee80211_draintask(ic, &ic->ic_mcast_task); | ||||
ieee80211_draintask(ic, &ic->ic_promisc_task); | ieee80211_draintask(ic, &ic->ic_promisc_task); | ||||
ieee80211_draintask(ic, &ic->ic_chan_task); | ieee80211_draintask(ic, &ic->ic_chan_task); | ||||
ieee80211_draintask(ic, &ic->ic_bmiss_task); | ieee80211_draintask(ic, &ic->ic_bmiss_task); | ||||
ieee80211_draintask(ic, &ic->ic_chw_task); | ieee80211_draintask(ic, &ic->ic_chw_task); | ||||
ieee80211_draintask(ic, &ic->ic_wme_task); | |||||
taskqueue_unblock(ic->ic_tq); | taskqueue_unblock(ic->ic_tq); | ||||
} | } | ||||
/* | /* | ||||
* Check to see whether the current channel needs reset. | * Check to see whether the current channel needs reset. | ||||
* | * | ||||
* Some devices don't handle being given an invalid channel | * Some devices don't handle being given an invalid channel | ||||
* in their operating mode very well (eg wpi(4) will throw a | * in their operating mode very well (eg wpi(4) will throw a | ||||
▲ Show 20 Lines • Show All 834 Lines • Show Last 20 Lines |