Lines Matching refs:vap

321 null_update_beacon(struct ieee80211vap *vap, int item)
326 ieee80211_proto_vattach(struct ieee80211vap *vap)
328 struct ieee80211com *ic = vap->iv_ic;
329 struct ifnet *ifp = vap->iv_ifp;
338 vap->iv_rtsthreshold = IEEE80211_RTS_DEFAULT;
339 vap->iv_fragthreshold = IEEE80211_FRAG_DEFAULT;
340 vap->iv_bmiss_max = IEEE80211_BMISS_MAX;
341 callout_init_mtx(&vap->iv_swbmiss, IEEE80211_LOCK_OBJ(ic), 0);
342 callout_init(&vap->iv_mgtsend, 1);
343 TASK_INIT(&vap->iv_nstate_task, 0, ieee80211_newstate_cb, vap);
344 TASK_INIT(&vap->iv_swbmiss_task, 0, beacon_swmiss, vap);
345 TASK_INIT(&vap->iv_wme_task, 0, vap_update_wme, vap);
346 TASK_INIT(&vap->iv_slot_task, 0, vap_update_slot, vap);
347 TASK_INIT(&vap->iv_erp_protmode_task, 0, vap_update_erp_protmode, vap);
348 TASK_INIT(&vap->iv_ht_protmode_task, 0, vap_update_ht_protmode, vap);
349 TASK_INIT(&vap->iv_preamble_task, 0, vap_update_preamble, vap);
363 vap->iv_txparms[i].ucastrate = IEEE80211_FIXED_RATE_NONE;
380 vap->iv_txparms[i].mgmtrate = 0 | IEEE80211_RATE_MCS;
381 vap->iv_txparms[i].mcastrate = 0 | IEEE80211_RATE_MCS;
383 vap->iv_txparms[i].mgmtrate =
385 vap->iv_txparms[i].mcastrate =
389 vap->iv_txparms[i].mgmtrate = rs->rs_rates[0] & IEEE80211_RATE_VAL;
390 vap->iv_txparms[i].mcastrate = rs->rs_rates[0] & IEEE80211_RATE_VAL;
391 vap->iv_txparms[i].maxretry = IEEE80211_TXMAX_DEFAULT;
393 vap->iv_roaming = IEEE80211_ROAMING_AUTO;
395 vap->iv_update_beacon = null_update_beacon;
396 vap->iv_deliver_data = ieee80211_deliver_data;
397 vap->iv_protmode = IEEE80211_PROT_CTSONLY;
400 ic->ic_vattach[vap->iv_opmode](vap);
404 ieee80211_proto_vdetach(struct ieee80211vap *vap)
413 if (vap->iv_opdetach != NULL)
414 vap->iv_opdetach(vap);
420 if (vap->iv_auth->ia_detach != NULL)
421 vap->iv_auth->ia_detach(vap);
425 if (vap->iv_acl != NULL)
426 vap->iv_acl->iac_detach(vap);
428 FREEAPPIE(vap->iv_appie_beacon);
429 FREEAPPIE(vap->iv_appie_probereq);
430 FREEAPPIE(vap->iv_appie_proberesp);
431 FREEAPPIE(vap->iv_appie_assocreq);
432 FREEAPPIE(vap->iv_appie_assocresp);
433 FREEAPPIE(vap->iv_appie_wpa);
644 struct ieee80211vap *vap = ni->ni_vap;
653 ucastrate = vap->iv_txparms[ieee80211_chan2mode(ni->ni_chan)].ucastrate;
752 IEEE80211_NOTE(vap, IEEE80211_MSG_XRATE | IEEE80211_MSG_11N, ni,
769 ieee80211_vap_reset_erp(struct ieee80211vap *vap)
771 struct ieee80211com *ic = vap->iv_ic;
773 vap->iv_nonerpsta = 0;
774 vap->iv_longslotsta = 0;
776 vap->iv_flags &= ~IEEE80211_F_USEPROT;
781 (vap->iv_caps & IEEE80211_C_SHPREAMBLE)) {
782 vap->iv_flags |= IEEE80211_F_SHPREAMBLE;
783 vap->iv_flags &= ~IEEE80211_F_USEBARKER;
785 vap->iv_flags &= ~IEEE80211_F_SHPREAMBLE;
786 vap->iv_flags |= IEEE80211_F_USEBARKER;
794 ieee80211_vap_set_shortslottime(vap,
798 vap->iv_opmode == IEEE80211_M_HOSTAP &&
849 struct ieee80211vap *vap = arg;
850 struct ieee80211com *ic = vap->iv_ic;
858 if (vap->iv_updateslot != NULL) {
859 vap->iv_updateslot(vap);
868 * short slot. If any vap has it disabled then
922 struct ieee80211vap *vap = arg;
923 struct ieee80211com *ic = vap->iv_ic;
934 * will look at the vap related flags.
959 IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG,
972 if (vap->iv_erp_protmode_update != NULL)
973 vap->iv_erp_protmode_update(vap);
988 struct ieee80211vap *vap = arg;
989 struct ieee80211com *ic = vap->iv_ic;
999 * will look at the vap related flags.
1014 IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG,
1029 IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG,
1041 if (vap->iv_erp_protmode_update != NULL)
1042 vap->iv_preamble_update(vap);
1054 struct ieee80211vap *vap = arg;
1056 struct ieee80211com *ic = vap->iv_ic;
1074 * variant and instead will look at the vap related variables.
1103 IEEE80211_DPRINTF(vap, IEEE80211_MSG_11N,
1104 "%s: vap %s: nonht_pr=%d, curhtprotmode=0x%02x\n",
1177 IEEE80211_DPRINTF(vap, IEEE80211_MSG_11N,
1184 if (vap->iv_erp_protmode_update != NULL)
1185 vap->iv_ht_protmode_update(vap);
1194 ieee80211_vap_set_shortslottime(struct ieee80211vap *vap, int onoff)
1196 struct ieee80211com *ic = vap->iv_ic;
1204 vap->iv_flags |= IEEE80211_F_SHSLOT;
1206 vap->iv_flags &= ~IEEE80211_F_SHSLOT;
1208 IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG,
1211 ieee80211_runtask(ic, &vap->iv_slot_task);
1218 * For now it simply copies the global flags into the per-vap
1224 ieee80211_vap_update_preamble(struct ieee80211vap *vap)
1226 struct ieee80211com *ic = vap->iv_ic;
1230 IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG,
1233 ieee80211_runtask(ic, &vap->iv_preamble_task);
1241 ieee80211_vap_update_erp_protmode(struct ieee80211vap *vap)
1243 struct ieee80211com *ic = vap->iv_ic;
1247 IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG,
1250 ieee80211_runtask(ic, &vap->iv_erp_protmode_task);
1258 ieee80211_vap_update_ht_protmode(struct ieee80211vap *vap)
1260 struct ieee80211com *ic = vap->iv_ic;
1264 IEEE80211_DPRINTF(vap, IEEE80211_MSG_DEBUG,
1267 ieee80211_runtask(ic, &vap->iv_ht_protmode_task);
1493 setwmeparams(struct ieee80211vap *vap, const char *type, int ac,
1499 IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME,
1507 ieee80211_wme_initparams_locked(struct ieee80211vap *vap)
1509 struct ieee80211com *ic = vap->iv_ic;
1523 * vap doesn't confuse later code which only parses the beacon
1565 setwmeparams(vap, "chan", i, wmep, pPhyParam);
1567 setwmeparams(vap, "chan", i, wmep, pBssPhyParam);
1570 setwmeparams(vap, "bss ", i, wmep, pBssPhyParam);
1573 if (vap->iv_bss != NULL) {
1581 (HIGH_PRI_SWITCH_THRESH * vap->iv_bss->ni_intval) / 100;
1583 ieee80211_wme_updateparams(vap);
1588 ieee80211_wme_initparams(struct ieee80211vap *vap)
1590 struct ieee80211com *ic = vap->iv_ic;
1593 ieee80211_wme_initparams_locked(vap);
1601 ieee80211_wme_updateparams_locked(struct ieee80211vap *vap)
1619 struct ieee80211com *ic = vap->iv_ic;
1668 if (vap->iv_opmode == IEEE80211_M_HOSTAP &&
1675 else if ((vap->iv_opmode == IEEE80211_M_STA &&
1676 (vap->iv_bss->ni_flags & IEEE80211_NODE_QOS) == 0))
1682 else if ((vap->iv_opmode == IEEE80211_M_IBSS) &&
1683 (vap->iv_flags & IEEE80211_F_WME))
1690 if ((vap->iv_flags & IEEE80211_F_WME) == 0)
1707 (vap->iv_flags & IEEE80211_F_BURST) ?
1709 IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME,
1722 if (vap->iv_opmode == IEEE80211_M_HOSTAP &&
1723 vap->iv_sta_assoc < 2 && (wme->wme_flags & WME_F_AGGRMODE) != 0) {
1744 IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME,
1750 ieee80211_runtask(ic, &vap->iv_wme_task);
1752 IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME,
1754 vap->iv_opmode == IEEE80211_M_STA ?
1760 ieee80211_wme_updateparams(struct ieee80211vap *vap)
1762 struct ieee80211com *ic = vap->iv_ic;
1766 ieee80211_wme_updateparams_locked(vap);
1778 ieee80211_wme_vap_getparams(struct ieee80211vap *vap, struct chanAccParams *wp)
1781 memcpy(wp, &vap->iv_ic->ic_wme.wme_chanParams, sizeof(*wp));
1807 ieee80211_wme_vap_ac_is_noack(struct ieee80211vap *vap, int ac)
1814 return (!! vap->iv_ic->ic_wme.wme_chanParams.cap_wmeParams[ac].wmep_noackPolicy);
1872 struct ieee80211vap *vap = arg;
1873 struct ieee80211com *ic = vap->iv_ic;
1877 if (vap->iv_wme_update != NULL)
1878 vap->iv_wme_update(vap,
1889 if (vap->iv_opmode == IEEE80211_M_HOSTAP
1890 || vap->iv_opmode == IEEE80211_M_IBSS) {
1897 ieee80211_beacon_notify(vap, IEEE80211_BEACON_WME);
1941 ieee80211_start_check_reset_chan(struct ieee80211vap *vap)
1943 struct ieee80211com *ic = vap->iv_ic;
1945 if ((vap->iv_opmode == IEEE80211_M_IBSS &&
1947 (vap->iv_opmode == IEEE80211_M_HOSTAP &&
1957 ieee80211_start_reset_chan(struct ieee80211vap *vap)
1959 struct ieee80211com *ic = vap->iv_ic;
1965 * Start a vap running. If this is the first vap to be
1970 ieee80211_start_locked(struct ieee80211vap *vap)
1972 struct ifnet *ifp = vap->iv_ifp;
1973 struct ieee80211com *ic = vap->iv_ic;
1977 IEEE80211_DPRINTF(vap,
1991 ieee80211_notify_ifnet_change(vap);
1994 * We are not running; if this we are the first vap
1999 if (ieee80211_start_check_reset_chan(vap))
2000 ieee80211_start_reset_chan(vap);
2002 IEEE80211_DPRINTF(vap,
2013 if (vap->iv_roaming != IEEE80211_ROAMING_MANUAL) {
2014 if (vap->iv_opmode == IEEE80211_M_STA) {
2024 if (vap->iv_state >= IEEE80211_S_RUN)
2025 ieee80211_new_state_locked(vap,
2029 ieee80211_new_state_locked(vap,
2035 * vap to be brought up, start a scan which may be
2039 vap->iv_flags_ext |= IEEE80211_FEXT_REINIT;
2040 if (vap->iv_opmode == IEEE80211_M_MONITOR ||
2041 vap->iv_opmode == IEEE80211_M_WDS)
2042 ieee80211_new_state_locked(vap,
2045 ieee80211_new_state_locked(vap,
2052 * Start a single vap.
2057 struct ieee80211vap *vap = arg;
2059 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG,
2062 IEEE80211_LOCK(vap->iv_ic);
2063 ieee80211_start_locked(vap);
2064 IEEE80211_UNLOCK(vap->iv_ic);
2068 * Start all runnable vap's on a device.
2073 struct ieee80211vap *vap;
2076 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
2077 struct ifnet *ifp = vap->iv_ifp;
2079 ieee80211_start_locked(vap);
2085 * Stop a vap. We force it down using the state machine
2087 * vap running on the underlying device then we close it
2089 * next vap is brought up.
2092 ieee80211_stop_locked(struct ieee80211vap *vap)
2094 struct ieee80211com *ic = vap->iv_ic;
2095 struct ifnet *ifp = vap->iv_ifp;
2099 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG,
2102 ieee80211_new_state_locked(vap, IEEE80211_S_INIT, -1);
2105 ieee80211_notify_ifnet_change(vap);
2107 IEEE80211_DPRINTF(vap,
2116 ieee80211_stop(struct ieee80211vap *vap)
2118 struct ieee80211com *ic = vap->iv_ic;
2121 ieee80211_stop_locked(vap);
2126 * Stop all vap's running on a device.
2131 struct ieee80211vap *vap;
2134 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
2135 struct ifnet *ifp = vap->iv_ifp;
2137 ieee80211_stop_locked(vap);
2145 * Stop all vap's running on a device and arrange
2151 struct ieee80211vap *vap;
2154 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
2155 struct ifnet *ifp = vap->iv_ifp;
2157 vap->iv_flags_ext |= IEEE80211_FEXT_RESUME;
2158 ieee80211_stop_locked(vap);
2167 * Start all vap's marked for resume.
2172 struct ieee80211vap *vap;
2175 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
2176 struct ifnet *ifp = vap->iv_ifp;
2178 (vap->iv_flags_ext & IEEE80211_FEXT_RESUME)) {
2179 vap->iv_flags_ext &= ~IEEE80211_FEXT_RESUME;
2180 ieee80211_start_locked(vap);
2187 * Restart all vap's running on a device.
2214 struct ieee80211vap *vap;
2217 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
2219 * We only pass events through for sta vap's in RUN+ state;
2223 if (vap->iv_opmode == IEEE80211_M_STA &&
2224 vap->iv_state >= IEEE80211_S_RUN &&
2225 vap->iv_bmiss != NULL)
2226 vap->iv_bmiss(vap);
2234 struct ieee80211vap *vap = arg;
2235 struct ieee80211com *ic = vap->iv_ic;
2238 if (vap->iv_state >= IEEE80211_S_RUN) {
2240 vap->iv_bmiss(vap);
2253 struct ieee80211vap *vap = arg;
2254 struct ieee80211com *ic = vap->iv_ic;
2258 KASSERT(vap->iv_state >= IEEE80211_S_RUN,
2259 ("wrong state %d", vap->iv_state));
2269 * case of multiple sta vap's we'd need to disable the
2270 * timers of all affected vap's.
2272 vap->iv_swbmiss_count = 0;
2273 } else if (vap->iv_swbmiss_count == 0) {
2274 if (vap->iv_bmiss != NULL)
2275 ieee80211_runtask(ic, &vap->iv_swbmiss_task);
2277 vap->iv_swbmiss_count = 0;
2278 callout_reset(&vap->iv_swbmiss, vap->iv_swbmiss_period,
2279 ieee80211_swbmiss, vap);
2284 * mark the operation pending, notify each vap through the
2286 * contents, and then switch vap's to CSA state to block outbound
2298 struct ieee80211vap *vap;
2306 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
2307 if (vap->iv_opmode == IEEE80211_M_HOSTAP ||
2308 vap->iv_opmode == IEEE80211_M_IBSS ||
2309 vap->iv_opmode == IEEE80211_M_MBSS)
2310 ieee80211_beacon_notify(vap, IEEE80211_BEACON_CSA);
2312 if (vap->iv_state == IEEE80211_S_RUN)
2313 ieee80211_new_state_locked(vap, IEEE80211_S_CSA, 0);
2326 struct ieee80211vap *vap;
2331 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
2332 if (vap->iv_state == IEEE80211_S_CSA)
2333 ieee80211_new_state_locked(vap, IEEE80211_S_RUN, 0);
2338 * We clear state and move all vap's in CSA state to RUN state
2350 struct ieee80211vap *vap;
2357 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
2358 if (vap->iv_state == IEEE80211_S_CSA)
2359 vap->iv_bss->ni_chan = ic->ic_curchan;
2366 * We clear state and move all vap's in CSA state to RUN state
2379 * We clear state and move all vap's in CAC state to RUN state.
2385 struct ieee80211vap *vap;
2389 * Complete CAC state change for lead vap first; then
2390 * clock all the other vap's waiting.
2396 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
2397 if (vap->iv_state == IEEE80211_S_CAC && vap != vap0)
2398 ieee80211_new_state_locked(vap, IEEE80211_S_RUN, 0);
2403 * Force all vap's other than the specified vap to the INIT state
2405 * will be brought up when the scan completes and the scanning vap
2412 struct ieee80211vap *vap;
2417 * A vap list entry can not disappear since we are running on the
2418 * taskqueue and a vap destroy will queue and drain another state
2421 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
2422 if (vap == vap0)
2424 if (vap->iv_state != IEEE80211_S_INIT) {
2426 vap->iv_newstate(vap, IEEE80211_S_INIT, 0);
2428 vap->iv_flags_ext |= IEEE80211_FEXT_SCANWAIT;
2434 * Wakeup all vap's waiting for a scan to complete. This is the
2443 struct ieee80211vap *vap;
2448 * A vap list entry can not disappear since we are running on the
2449 * taskqueue and a vap destroy will queue and drain another state
2452 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
2453 if (vap == vap0)
2455 if (vap->iv_flags_ext & IEEE80211_FEXT_SCANWAIT) {
2456 vap->iv_flags_ext &= ~IEEE80211_FEXT_SCANWAIT;
2459 vap->iv_newstate(vap,
2460 vap->iv_opmode == IEEE80211_M_STA ?
2473 struct ieee80211vap *vap = xvap;
2474 struct ieee80211com *ic = vap->iv_ic;
2479 nstate = vap->iv_nstate;
2480 arg = vap->iv_nstate_arg;
2482 if (vap->iv_flags_ext & IEEE80211_FEXT_REINIT) {
2488 vap->iv_nstate = IEEE80211_S_INIT;
2489 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2491 ieee80211_state_name[vap->iv_state],
2492 ieee80211_state_name[vap->iv_nstate], arg);
2493 vap->iv_newstate(vap, vap->iv_nstate, 0);
2495 vap->iv_flags_ext &= ~(IEEE80211_FEXT_REINIT |
2498 ieee80211_new_state_locked(vap, nstate, arg);
2502 ostate = vap->iv_state;
2506 * vap's to INIT state and mark them as waiting for the scan to
2513 markwaiting(vap);
2515 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2519 rc = vap->iv_newstate(vap, nstate, arg);
2521 vap->iv_flags_ext &= ~IEEE80211_FEXT_STATEWAIT;
2527 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2539 * OACTIVE may be set on the vap if the upper layer
2546 vap->iv_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
2553 wakeupwaiting(vap);
2557 * and flush any frames on send queues from this vap.
2561 ieee80211_scan_flush(vap);
2564 * XXX TODO: ic/vap queue flush
2577 * o only one vap can be selecting a channel so on transition to
2578 * SCAN state if another vap is already scanning then
2581 * o only one vap can be doing CAC of a channel so on transition to
2582 * CAC state if another vap is already scanning for radar then
2585 * o if another vap is already running when a request is made
2599 ieee80211_new_state_locked(struct ieee80211vap *vap,
2602 struct ieee80211com *ic = vap->iv_ic;
2609 if (vap->iv_flags_ext & IEEE80211_FEXT_STATEWAIT) {
2610 if (vap->iv_nstate == IEEE80211_S_INIT ||
2611 ((vap->iv_state == IEEE80211_S_INIT ||
2612 (vap->iv_flags_ext & IEEE80211_FEXT_REINIT)) &&
2613 vap->iv_nstate == IEEE80211_S_SCAN &&
2616 * XXX The vap is being stopped/started,
2620 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2623 ieee80211_state_name[vap->iv_state],
2625 ieee80211_state_name[vap->iv_nstate]);
2627 } else if (vap->iv_state != vap->iv_nstate) {
2630 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2632 ieee80211_state_name[vap->iv_state],
2633 ieee80211_state_name[vap->iv_nstate]);
2636 if_printf(vap->iv_ifp,
2638 __func__, ieee80211_state_name[vap->iv_state],
2639 ieee80211_state_name[vap->iv_nstate]);
2647 if (vp != vap) {
2656 ostate = vap->iv_state;
2657 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2674 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2678 vap->iv_flags_ext |= IEEE80211_FEXT_SCANWAIT;
2688 if (vap->iv_opmode == IEEE80211_M_STA)
2694 IEEE80211_DPRINTF(vap,
2706 if (vap->iv_opmode == IEEE80211_M_WDS &&
2707 (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) &&
2712 * follow the other vap to the channel they choose.
2714 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2718 vap->iv_flags_ext |= IEEE80211_FEXT_SCANWAIT;
2721 if (vap->iv_opmode == IEEE80211_M_HOSTAP &&
2723 (vap->iv_flags_ext & IEEE80211_FEXT_DFS) &&
2732 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2740 ieee80211_cancel_scan(vap);
2744 vap->iv_flags_ext &= ~IEEE80211_FEXT_SCANWAIT;
2751 vap->iv_nstate = nstate;
2752 vap->iv_nstate_arg = arg;
2753 vap->iv_flags_ext |= IEEE80211_FEXT_STATEWAIT;
2754 ieee80211_runtask(ic, &vap->iv_nstate_task);
2759 ieee80211_new_state(struct ieee80211vap *vap,
2762 struct ieee80211com *ic = vap->iv_ic;
2766 rc = ieee80211_new_state_locked(vap, nstate, arg);