Lines Matching refs:vap

317 null_update_beacon(struct ieee80211vap *vap, int item)
322 ieee80211_proto_vattach(struct ieee80211vap *vap)
324 struct ieee80211com *ic = vap->iv_ic;
325 struct ifnet *ifp = vap->iv_ifp;
334 vap->iv_rtsthreshold = IEEE80211_RTS_DEFAULT;
335 vap->iv_fragthreshold = IEEE80211_FRAG_DEFAULT;
336 vap->iv_bmiss_max = IEEE80211_BMISS_MAX;
337 callout_init_mtx(&vap->iv_swbmiss, IEEE80211_LOCK_OBJ(ic), 0);
338 callout_init(&vap->iv_mgtsend, 1);
339 TASK_INIT(&vap->iv_nstate_task, 0, ieee80211_newstate_cb, vap);
340 TASK_INIT(&vap->iv_swbmiss_task, 0, beacon_swmiss, vap);
353 vap->iv_txparms[i].ucastrate = IEEE80211_FIXED_RATE_NONE;
370 vap->iv_txparms[i].mgmtrate = 0 | IEEE80211_RATE_MCS;
371 vap->iv_txparms[i].mcastrate = 0 | IEEE80211_RATE_MCS;
373 vap->iv_txparms[i].mgmtrate =
375 vap->iv_txparms[i].mcastrate =
379 vap->iv_txparms[i].mgmtrate = rs->rs_rates[0] & IEEE80211_RATE_VAL;
380 vap->iv_txparms[i].mcastrate = rs->rs_rates[0] & IEEE80211_RATE_VAL;
381 vap->iv_txparms[i].maxretry = IEEE80211_TXMAX_DEFAULT;
383 vap->iv_roaming = IEEE80211_ROAMING_AUTO;
385 vap->iv_update_beacon = null_update_beacon;
386 vap->iv_deliver_data = ieee80211_deliver_data;
389 ic->ic_vattach[vap->iv_opmode](vap);
393 ieee80211_proto_vdetach(struct ieee80211vap *vap)
402 if (vap->iv_opdetach != NULL)
403 vap->iv_opdetach(vap);
409 if (vap->iv_auth->ia_detach != NULL)
410 vap->iv_auth->ia_detach(vap);
414 if (vap->iv_acl != NULL)
415 vap->iv_acl->iac_detach(vap);
417 FREEAPPIE(vap->iv_appie_beacon);
418 FREEAPPIE(vap->iv_appie_probereq);
419 FREEAPPIE(vap->iv_appie_proberesp);
420 FREEAPPIE(vap->iv_appie_assocreq);
421 FREEAPPIE(vap->iv_appie_assocresp);
422 FREEAPPIE(vap->iv_appie_wpa);
633 struct ieee80211vap *vap = ni->ni_vap;
642 ucastrate = vap->iv_txparms[ieee80211_chan2mode(ni->ni_chan)].ucastrate;
741 IEEE80211_NOTE(vap, IEEE80211_MSG_XRATE | IEEE80211_MSG_11N, ni,
1009 setwmeparams(struct ieee80211vap *vap, const char *type, int ac,
1015 IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME,
1023 ieee80211_wme_initparams_locked(struct ieee80211vap *vap)
1025 struct ieee80211com *ic = vap->iv_ic;
1039 * vap doesn't confuse later code which only parses the beacon
1078 setwmeparams(vap, "chan", i, wmep, pPhyParam);
1080 setwmeparams(vap, "chan", i, wmep, pBssPhyParam);
1083 setwmeparams(vap, "bss ", i, wmep, pBssPhyParam);
1086 if (vap->iv_bss != NULL) {
1094 (HIGH_PRI_SWITCH_THRESH * vap->iv_bss->ni_intval) / 100;
1096 ieee80211_wme_updateparams(vap);
1101 ieee80211_wme_initparams(struct ieee80211vap *vap)
1103 struct ieee80211com *ic = vap->iv_ic;
1106 ieee80211_wme_initparams_locked(vap);
1114 ieee80211_wme_updateparams_locked(struct ieee80211vap *vap)
1130 struct ieee80211com *ic = vap->iv_ic;
1179 if (vap->iv_opmode == IEEE80211_M_HOSTAP &&
1186 else if ((vap->iv_opmode == IEEE80211_M_STA &&
1187 (vap->iv_bss->ni_flags & IEEE80211_NODE_QOS) == 0))
1193 else if ((vap->iv_opmode == IEEE80211_M_IBSS) &&
1194 (vap->iv_flags & IEEE80211_F_WME))
1201 if ((vap->iv_flags & IEEE80211_F_WME) == 0)
1218 (vap->iv_flags & IEEE80211_F_BURST) ?
1220 IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME,
1234 if (vap->iv_opmode == IEEE80211_M_HOSTAP &&
1254 IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME,
1264 if (vap->iv_opmode == IEEE80211_M_HOSTAP
1265 || vap->iv_opmode == IEEE80211_M_IBSS) {
1272 ieee80211_beacon_notify(vap, IEEE80211_BEACON_WME);
1278 IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME,
1280 vap->iv_opmode == IEEE80211_M_STA ?
1286 ieee80211_wme_updateparams(struct ieee80211vap *vap)
1288 struct ieee80211com *ic = vap->iv_ic;
1292 ieee80211_wme_updateparams_locked(vap);
1392 ieee80211_start_check_reset_chan(struct ieee80211vap *vap)
1394 struct ieee80211com *ic = vap->iv_ic;
1396 if ((vap->iv_opmode == IEEE80211_M_IBSS &&
1398 (vap->iv_opmode == IEEE80211_M_HOSTAP &&
1408 ieee80211_start_reset_chan(struct ieee80211vap *vap)
1410 struct ieee80211com *ic = vap->iv_ic;
1416 * Start a vap running. If this is the first vap to be
1421 ieee80211_start_locked(struct ieee80211vap *vap)
1423 struct ifnet *ifp = vap->iv_ifp;
1424 struct ieee80211com *ic = vap->iv_ic;
1428 IEEE80211_DPRINTF(vap,
1443 * We are not running; if this we are the first vap
1449 if (ieee80211_start_check_reset_chan(vap))
1450 ieee80211_start_reset_chan(vap);
1452 IEEE80211_DPRINTF(vap,
1463 if (vap->iv_roaming != IEEE80211_ROAMING_MANUAL) {
1464 if (vap->iv_opmode == IEEE80211_M_STA) {
1474 if (vap->iv_state >= IEEE80211_S_RUN)
1475 ieee80211_new_state_locked(vap,
1479 ieee80211_new_state_locked(vap,
1485 * vap to be brought up, start a scan which may be
1489 vap->iv_flags_ext |= IEEE80211_FEXT_REINIT;
1490 if (vap->iv_opmode == IEEE80211_M_MONITOR ||
1491 vap->iv_opmode == IEEE80211_M_WDS)
1492 ieee80211_new_state_locked(vap,
1495 ieee80211_new_state_locked(vap,
1502 * Start a single vap.
1507 struct ieee80211vap *vap = arg;
1509 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG,
1512 IEEE80211_LOCK(vap->iv_ic);
1513 ieee80211_start_locked(vap);
1514 IEEE80211_UNLOCK(vap->iv_ic);
1518 * Start all runnable vap's on a device.
1523 struct ieee80211vap *vap;
1526 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
1527 struct ifnet *ifp = vap->iv_ifp;
1529 ieee80211_start_locked(vap);
1535 * Stop a vap. We force it down using the state machine
1537 * vap running on the underlying device then we close it
1539 * next vap is brought up.
1542 ieee80211_stop_locked(struct ieee80211vap *vap)
1544 struct ieee80211com *ic = vap->iv_ic;
1545 struct ifnet *ifp = vap->iv_ifp;
1549 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE | IEEE80211_MSG_DEBUG,
1552 ieee80211_new_state_locked(vap, IEEE80211_S_INIT, -1);
1556 IEEE80211_DPRINTF(vap,
1565 ieee80211_stop(struct ieee80211vap *vap)
1567 struct ieee80211com *ic = vap->iv_ic;
1570 ieee80211_stop_locked(vap);
1575 * Stop all vap's running on a device.
1580 struct ieee80211vap *vap;
1583 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
1584 struct ifnet *ifp = vap->iv_ifp;
1586 ieee80211_stop_locked(vap);
1594 * Stop all vap's running on a device and arrange
1600 struct ieee80211vap *vap;
1603 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
1604 struct ifnet *ifp = vap->iv_ifp;
1606 vap->iv_flags_ext |= IEEE80211_FEXT_RESUME;
1607 ieee80211_stop_locked(vap);
1616 * Start all vap's marked for resume.
1621 struct ieee80211vap *vap;
1624 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
1625 struct ifnet *ifp = vap->iv_ifp;
1627 (vap->iv_flags_ext & IEEE80211_FEXT_RESUME)) {
1628 vap->iv_flags_ext &= ~IEEE80211_FEXT_RESUME;
1629 ieee80211_start_locked(vap);
1636 * Restart all vap's running on a device.
1663 struct ieee80211vap *vap;
1666 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
1668 * We only pass events through for sta vap's in RUN+ state;
1672 if (vap->iv_opmode == IEEE80211_M_STA &&
1673 vap->iv_state >= IEEE80211_S_RUN &&
1674 vap->iv_bmiss != NULL)
1675 vap->iv_bmiss(vap);
1683 struct ieee80211vap *vap = arg;
1684 struct ieee80211com *ic = vap->iv_ic;
1687 if (vap->iv_state >= IEEE80211_S_RUN) {
1689 vap->iv_bmiss(vap);
1702 struct ieee80211vap *vap = arg;
1703 struct ieee80211com *ic = vap->iv_ic;
1707 KASSERT(vap->iv_state >= IEEE80211_S_RUN,
1708 ("wrong state %d", vap->iv_state));
1718 * case of multiple sta vap's we'd need to disable the
1719 * timers of all affected vap's.
1721 vap->iv_swbmiss_count = 0;
1722 } else if (vap->iv_swbmiss_count == 0) {
1723 if (vap->iv_bmiss != NULL)
1724 ieee80211_runtask(ic, &vap->iv_swbmiss_task);
1726 vap->iv_swbmiss_count = 0;
1727 callout_reset(&vap->iv_swbmiss, vap->iv_swbmiss_period,
1728 ieee80211_swbmiss, vap);
1733 * mark the operation pending, notify each vap through the
1735 * contents, and then switch vap's to CSA state to block outbound
1747 struct ieee80211vap *vap;
1755 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
1756 if (vap->iv_opmode == IEEE80211_M_HOSTAP ||
1757 vap->iv_opmode == IEEE80211_M_IBSS ||
1758 vap->iv_opmode == IEEE80211_M_MBSS)
1759 ieee80211_beacon_notify(vap, IEEE80211_BEACON_CSA);
1761 if (vap->iv_state == IEEE80211_S_RUN)
1762 ieee80211_new_state_locked(vap, IEEE80211_S_CSA, 0);
1775 struct ieee80211vap *vap;
1780 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
1781 if (vap->iv_state == IEEE80211_S_CSA)
1782 ieee80211_new_state_locked(vap, IEEE80211_S_RUN, 0);
1787 * We clear state and move all vap's in CSA state to RUN state
1799 struct ieee80211vap *vap;
1806 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
1807 if (vap->iv_state == IEEE80211_S_CSA)
1808 vap->iv_bss->ni_chan = ic->ic_curchan;
1815 * We clear state and move all vap's in CSA state to RUN state
1828 * We clear state and move all vap's in CAC state to RUN state.
1834 struct ieee80211vap *vap;
1838 * Complete CAC state change for lead vap first; then
1839 * clock all the other vap's waiting.
1845 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
1846 if (vap->iv_state == IEEE80211_S_CAC)
1847 ieee80211_new_state_locked(vap, IEEE80211_S_RUN, 0);
1852 * Force all vap's other than the specified vap to the INIT state
1854 * will be brought up when the scan completes and the scanning vap
1861 struct ieee80211vap *vap;
1866 * A vap list entry can not disappear since we are running on the
1867 * taskqueue and a vap destroy will queue and drain another state
1870 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
1871 if (vap == vap0)
1873 if (vap->iv_state != IEEE80211_S_INIT) {
1875 vap->iv_newstate(vap, IEEE80211_S_INIT, 0);
1877 vap->iv_flags_ext |= IEEE80211_FEXT_SCANWAIT;
1883 * Wakeup all vap's waiting for a scan to complete. This is the
1892 struct ieee80211vap *vap;
1897 * A vap list entry can not disappear since we are running on the
1898 * taskqueue and a vap destroy will queue and drain another state
1901 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
1902 if (vap == vap0)
1904 if (vap->iv_flags_ext & IEEE80211_FEXT_SCANWAIT) {
1905 vap->iv_flags_ext &= ~IEEE80211_FEXT_SCANWAIT;
1908 vap->iv_newstate(vap,
1909 vap->iv_opmode == IEEE80211_M_STA ?
1922 struct ieee80211vap *vap = xvap;
1923 struct ieee80211com *ic = vap->iv_ic;
1928 nstate = vap->iv_nstate;
1929 arg = vap->iv_nstate_arg;
1931 if (vap->iv_flags_ext & IEEE80211_FEXT_REINIT) {
1937 vap->iv_nstate = IEEE80211_S_INIT;
1938 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
1940 ieee80211_state_name[vap->iv_state],
1941 ieee80211_state_name[vap->iv_nstate], arg);
1942 vap->iv_newstate(vap, vap->iv_nstate, 0);
1944 vap->iv_flags_ext &= ~(IEEE80211_FEXT_REINIT |
1947 ieee80211_new_state_locked(vap, nstate, arg);
1951 ostate = vap->iv_state;
1955 * vap's to INIT state and mark them as waiting for the scan to
1962 markwaiting(vap);
1964 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
1968 rc = vap->iv_newstate(vap, nstate, arg);
1970 vap->iv_flags_ext &= ~IEEE80211_FEXT_STATEWAIT;
1976 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
1988 * OACTIVE may be set on the vap if the upper layer
1995 vap->iv_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
2002 wakeupwaiting(vap);
2006 * and flush any frames on send queues from this vap.
2010 ieee80211_scan_flush(vap);
2013 * XXX TODO: ic/vap queue flush
2026 * o only one vap can be selecting a channel so on transition to
2027 * SCAN state if another vap is already scanning then
2030 * o only one vap can be doing CAC of a channel so on transition to
2031 * CAC state if another vap is already scanning for radar then
2034 * o if another vap is already running when a request is made
2048 ieee80211_new_state_locked(struct ieee80211vap *vap,
2051 struct ieee80211com *ic = vap->iv_ic;
2058 if (vap->iv_flags_ext & IEEE80211_FEXT_STATEWAIT) {
2059 if (vap->iv_nstate == IEEE80211_S_INIT ||
2060 ((vap->iv_state == IEEE80211_S_INIT ||
2061 (vap->iv_flags_ext & IEEE80211_FEXT_REINIT)) &&
2062 vap->iv_nstate == IEEE80211_S_SCAN &&
2065 * XXX The vap is being stopped/started,
2069 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2072 ieee80211_state_name[vap->iv_state],
2074 ieee80211_state_name[vap->iv_nstate]);
2076 } else if (vap->iv_state != vap->iv_nstate) {
2079 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2081 ieee80211_state_name[vap->iv_state],
2082 ieee80211_state_name[vap->iv_nstate]);
2085 if_printf(vap->iv_ifp,
2087 __func__, ieee80211_state_name[vap->iv_state],
2088 ieee80211_state_name[vap->iv_nstate]);
2096 if (vp != vap) {
2105 ostate = vap->iv_state;
2106 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2123 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2127 vap->iv_flags_ext |= IEEE80211_FEXT_SCANWAIT;
2137 if (vap->iv_opmode == IEEE80211_M_STA)
2143 IEEE80211_DPRINTF(vap,
2155 if (vap->iv_opmode == IEEE80211_M_WDS &&
2156 (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) &&
2161 * follow the other vap to the channel they choose.
2163 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2167 vap->iv_flags_ext |= IEEE80211_FEXT_SCANWAIT;
2170 if (vap->iv_opmode == IEEE80211_M_HOSTAP &&
2172 (vap->iv_flags_ext & IEEE80211_FEXT_DFS) &&
2181 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE,
2189 ieee80211_cancel_scan(vap);
2193 vap->iv_flags_ext &= ~IEEE80211_FEXT_SCANWAIT;
2200 vap->iv_nstate = nstate;
2201 vap->iv_nstate_arg = arg;
2202 vap->iv_flags_ext |= IEEE80211_FEXT_STATEWAIT;
2203 ieee80211_runtask(ic, &vap->iv_nstate_task);
2208 ieee80211_new_state(struct ieee80211vap *vap,
2211 struct ieee80211com *ic = vap->iv_ic;
2215 rc = ieee80211_new_state_locked(vap, nstate, arg);