Lines Matching refs:vap

125 	 * Set flags to be propagated to all vap's;
142 ieee80211_node_vattach(struct ieee80211vap *vap)
145 vap->iv_max_aid = IEEE80211_AID_DEF;
148 vap->iv_inact_init = IEEE80211_INACT_INIT;
149 vap->iv_inact_auth = IEEE80211_INACT_AUTH;
150 vap->iv_inact_run = IEEE80211_INACT_RUN;
151 vap->iv_inact_probe = IEEE80211_INACT_PROBE;
153 IEEE80211_DPRINTF(vap, IEEE80211_MSG_INACT,
155 vap->iv_inact_init, vap->iv_inact_auth,
156 vap->iv_inact_run, vap->iv_inact_probe);
160 ieee80211_node_latevattach(struct ieee80211vap *vap)
162 if (vap->iv_opmode == IEEE80211_M_HOSTAP) {
164 if (vap->iv_max_aid < IEEE80211_AID_MIN) {
165 vap->iv_max_aid = IEEE80211_AID_MIN;
166 if_printf(vap->iv_ifp,
168 vap->iv_max_aid);
170 vap->iv_aid_bitmap = (uint32_t *) IEEE80211_MALLOC(
171 howmany(vap->iv_max_aid, 32) * sizeof(uint32_t),
174 if (vap->iv_aid_bitmap == NULL) {
177 __func__, vap->iv_max_aid);
178 vap->iv_max_aid = 0;
182 ieee80211_reset_bss(vap);
184 vap->iv_auth = ieee80211_authenticator_get(vap->iv_bss->ni_authmode);
188 ieee80211_node_vdetach(struct ieee80211vap *vap)
190 struct ieee80211com *ic = vap->iv_ic;
192 ieee80211_node_table_reset(&ic->ic_sta, vap);
193 if (vap->iv_bss != NULL) {
194 ieee80211_free_node(vap->iv_bss);
195 vap->iv_bss = NULL;
197 if (vap->iv_aid_bitmap != NULL) {
198 IEEE80211_FREE(vap->iv_aid_bitmap, M_80211_NODE);
199 vap->iv_aid_bitmap = NULL;
210 struct ieee80211vap *vap = ni->ni_vap;
213 ni->ni_inact_reload = vap->iv_inact_run;
216 IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni,
223 struct ieee80211vap *vap = ni->ni_vap;
226 ni->ni_inact_reload = vap->iv_inact_auth;
230 IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni,
241 struct ieee80211vap *vap = ni->ni_vap;
265 ni->ni_txparms = &vap->iv_txparms[mode];
278 struct ieee80211vap *vap = ni->ni_vap;
297 (vap->iv_flags_ht & IEEE80211_FHT_PUREN) == 0)
300 (vap->iv_flags_ht & IEEE80211_FHT_PUREN) == 0)
303 (vap->iv_flags & IEEE80211_F_PUREG) == 0)
306 ni->ni_txparms = &vap->iv_txparms[mode];
322 ieee80211_create_ibss(struct ieee80211vap* vap, struct ieee80211_channel *chan)
324 struct ieee80211com *ic = vap->iv_ic;
327 IEEE80211_DPRINTF(vap, IEEE80211_MSG_SCAN,
329 ieee80211_opmode_name[vap->iv_opmode],
333 ni = ieee80211_alloc_node(&ic->ic_sta, vap, vap->iv_myaddr);
338 IEEE80211_ADDR_COPY(ni->ni_bssid, vap->iv_myaddr);
339 ni->ni_esslen = vap->iv_des_ssid[0].len;
340 memcpy(ni->ni_essid, vap->iv_des_ssid[0].ssid, ni->ni_esslen);
341 if (vap->iv_bss != NULL)
342 copy_bss(ni, vap->iv_bss);
344 if (vap->iv_flags & IEEE80211_F_PRIVACY)
350 if (vap->iv_opmode == IEEE80211_M_IBSS) {
351 vap->iv_flags |= IEEE80211_F_SIBSS;
353 if (vap->iv_flags & IEEE80211_F_DESBSSID)
354 IEEE80211_ADDR_COPY(ni->ni_bssid, vap->iv_des_bssid);
360 } else if (vap->iv_opmode == IEEE80211_M_AHDEMO) {
361 if (vap->iv_flags & IEEE80211_F_DESBSSID)
362 IEEE80211_ADDR_COPY(ni->ni_bssid, vap->iv_des_bssid);
365 if ((vap->iv_caps & IEEE80211_C_TDMA) == 0)
369 } else if (vap->iv_opmode == IEEE80211_M_MBSS) {
370 ni->ni_meshidlen = vap->iv_mesh->ms_idlen;
371 memcpy(ni->ni_meshid, vap->iv_mesh->ms_id, ni->ni_meshidlen);
395 if (vap->iv_flags & IEEE80211_F_PUREG) {
422 ieee80211_reset_bss(struct ieee80211vap *vap)
424 struct ieee80211com *ic = vap->iv_ic;
427 ieee80211_node_table_reset(&ic->ic_sta, vap);
431 ni = ieee80211_alloc_node(&ic->ic_sta, vap, vap->iv_myaddr);
433 obss = vap->iv_bss;
434 vap->iv_bss = ieee80211_ref_node(ni);
440 IEEE80211_ADDR_COPY(ni->ni_bssid, vap->iv_myaddr);
461 check_bss(struct ieee80211vap *vap, struct ieee80211_node *ni)
468 if (vap->iv_opmode == IEEE80211_M_IBSS) {
475 if (vap->iv_flags & IEEE80211_F_PRIVACY) {
487 if (vap->iv_des_nssid != 0 &&
488 !match_ssid(ni, vap->iv_des_nssid, vap->iv_des_ssid))
490 if ((vap->iv_flags & IEEE80211_F_DESBSSID) &&
491 !IEEE80211_ADDR_EQ(vap->iv_des_bssid, ni->ni_bssid))
501 check_bss_debug(struct ieee80211vap *vap, struct ieee80211_node *ni)
510 if (vap->iv_opmode == IEEE80211_M_IBSS) {
517 if (vap->iv_flags & IEEE80211_F_PRIVACY) {
529 if (vap->iv_des_nssid != 0 &&
530 !match_ssid(ni, vap->iv_des_nssid, vap->iv_des_ssid))
532 if ((vap->iv_flags & IEEE80211_F_DESBSSID) &&
533 !IEEE80211_ADDR_EQ(vap->iv_des_bssid, ni->ni_bssid))
559 struct ieee80211vap *vap = ni->ni_vap;
561 if (ni == vap->iv_bss ||
562 IEEE80211_ADDR_EQ(ni->ni_bssid, vap->iv_bss->ni_bssid)) {
567 if (!check_bss(vap, ni)) {
569 IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC,
572 if (ieee80211_msg_assoc(vap))
573 check_bss_debug(vap, ni);
575 vap->iv_stats.is_ibss_capmismatch++;
596 struct ieee80211vap *vap = ni->ni_vap;
602 if (vap->iv_des_nssid == 0 && scan->ssid == NULL)
608 if (!! (vap->iv_des_nssid == 0) != !! (scan->ssid == NULL))
620 for (i = 0; i < vap->iv_des_nssid; i++) {
623 if (vap->iv_des_ssid[i].len != scan->ssid[1])
627 if (memcmp(vap->iv_des_ssid[i].ssid, scan->ssid + 2,
628 vap->iv_des_ssid[i].len) == 0)
654 struct ieee80211vap *vap = ni->ni_vap;
661 IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC,
673 * This assumes ni_chan have been setup for each vap.
678 struct ieee80211vap *vap;
683 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
684 if (vap->iv_state < IEEE80211_S_RUN)
686 switch (vap->iv_opmode) {
693 flags |= ieee80211_htchanflags(vap->iv_bss->ni_chan);
704 * any vap's are using HT20/HT40. This is used to sync the state
705 * of ic_curchan after a channel width change on a running vap.
726 * promoted if other vap's are operating with HT20/HT40.
735 * set of running vap's. This assumes we are called
736 * after ni_chan is setup for each vap.
773 struct ieee80211vap *vap = selbs->ni_vap;
781 obss = vap->iv_bss;
787 vap->iv_state == IEEE80211_S_RUN &&
789 vap->iv_bss = selbs; /* NB: caller assumed to bump refcnt */
807 ieee80211_fix_rate(vap->iv_bss, &vap->iv_bss->ni_rates,
817 ieee80211_wme_initparams(vap);
819 if (vap->iv_opmode == IEEE80211_M_STA) {
822 ieee80211_new_state(vap, IEEE80211_S_ASSOC, 1);
830 ieee80211_new_state(vap, IEEE80211_S_AUTH,
834 ieee80211_new_state(vap, IEEE80211_S_RUN, -1);
839 ieee80211_sta_join(struct ieee80211vap *vap, struct ieee80211_channel *chan,
842 struct ieee80211com *ic = vap->iv_ic;
845 ni = ieee80211_alloc_node(&ic->ic_sta, vap, se->se_macaddr);
868 if (vap->iv_opmode == IEEE80211_M_STA) {
893 vap->iv_dtim_period = se->se_dtimperiod;
894 vap->iv_dtim_count = 0;
912 vap->iv_flags_ht & IEEE80211_FHT_HT) {
958 node_alloc(struct ieee80211vap *vap, const uint8_t macaddr[IEEE80211_ADDR_LEN])
1065 struct ieee80211vap *vap = ni->ni_vap;
1071 if (vap->iv_opmode != IEEE80211_M_STA)
1072 vap->iv_ps_sta--;
1074 IEEE80211_NOTE(vap, IEEE80211_MSG_POWER, ni,
1075 "power save mode off, %u sta's in ps mode", vap->iv_ps_sta);
1090 if (vap->iv_opmode == IEEE80211_M_MBSS)
1111 if (ieee80211_node_psq_drain(ni) != 0 && vap->iv_set_tim != NULL)
1112 vap->iv_set_tim(ni, 0);
1157 struct ieee80211vap *vap = ni->ni_vap;
1163 ni->ni_psq.psq_len == 0 && vap->iv_set_tim != NULL)
1164 vap->iv_set_tim(ni, 0);
1220 struct ieee80211vap *vap, const uint8_t macaddr[IEEE80211_ADDR_LEN])
1226 ni = ic->ic_node_alloc(vap, macaddr);
1228 vap->iv_stats.is_rx_nodealloc++;
1232 IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE,
1242 ni->ni_txparms = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)];
1243 ieee80211_crypto_resetkey(vap, &ni->ni_ucastkey, IEEE80211_KEYIX_NONE);
1250 if (vap->iv_opmode == IEEE80211_M_MBSS)
1251 ieee80211_mesh_node_init(vap, ni);
1257 ni->ni_vap = vap;
1261 IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni,
1274 ieee80211_tmp_node(struct ieee80211vap *vap,
1277 struct ieee80211com *ic = vap->iv_ic;
1280 ni = ic->ic_node_alloc(vap, macaddr);
1282 struct ieee80211_node *bss = vap->iv_bss;
1284 IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE,
1289 ni->ni_vap = vap;
1296 ieee80211_crypto_resetkey(vap, &ni->ni_ucastkey,
1305 vap->iv_stats.is_rx_nodealloc++;
1311 ieee80211_dup_bss(struct ieee80211vap *vap,
1314 struct ieee80211com *ic = vap->iv_ic;
1317 ni = ieee80211_alloc_node(&ic->ic_sta, vap, macaddr);
1319 struct ieee80211_node *bss = vap->iv_bss;
1331 * Create a bss node for a legacy WDS vap. The far end does
1338 ieee80211_node_create_wds(struct ieee80211vap *vap,
1341 struct ieee80211com *ic = vap->iv_ic;
1345 ni = ieee80211_alloc_node(&ic->ic_sta, vap, bssid);
1347 ni->ni_wdsvap = vap;
1352 copy_bss(ni, vap->iv_bss);
1355 ni->ni_esslen = vap->iv_des_ssid[0].len;
1356 memcpy(ni->ni_essid, vap->iv_des_ssid[0].ssid, ni->ni_esslen);
1363 if (vap->iv_flags & IEEE80211_F_WME)
1366 if (vap->iv_flags & IEEE80211_F_FF)
1370 (vap->iv_flags_ht & IEEE80211_FHT_HT)) {
1373 * the vap; setup HT operation. On return
1443 const struct ieee80211vap *vap,
1447 const struct ieee80211vap *vap,
1458 if (ni->ni_vap == vap &&
1477 const struct ieee80211vap *vap,
1481 const struct ieee80211vap *vap,
1488 ni = ieee80211_find_vap_node_locked(nt, vap, macaddr);
1500 ieee80211_fakeup_adhoc_node(struct ieee80211vap *vap,
1505 IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE | IEEE80211_MSG_ASSOC,
1507 ni = ieee80211_dup_bss(vap, macaddr);
1509 struct ieee80211com *ic = vap->iv_ic;
1512 ni->ni_rates = vap->iv_bss->ni_rates;
1515 if (vap->iv_opmode == IEEE80211_M_AHDEMO) {
1523 if (vap->iv_flags & IEEE80211_F_WME)
1526 if (vap->iv_flags & IEEE80211_F_FF)
1616 ieee80211_add_neighbor(struct ieee80211vap *vap,
1622 IEEE80211_DPRINTF(vap, IEEE80211_MSG_ASSOC,
1624 ni = ieee80211_dup_bss(vap, wh->i_addr2);/* XXX alloc_node? */
1626 struct ieee80211com *ic = vap->iv_ic;
1653 return NULL; /* spam bcast probe req to all vap's */
1730 ni = NULL; /* spam bcast probe req to all vap's */
1747 ieee80211_find_txnode_debug(struct ieee80211vap *vap,
1751 ieee80211_find_txnode(struct ieee80211vap *vap,
1755 struct ieee80211_node_table *nt = &vap->iv_ic->ic_sta;
1766 if (vap->iv_opmode == IEEE80211_M_STA ||
1767 vap->iv_opmode == IEEE80211_M_WDS ||
1769 ni = ieee80211_ref_node(vap->iv_bss);
1775 if (vap->iv_opmode == IEEE80211_M_IBSS ||
1776 vap->iv_opmode == IEEE80211_M_AHDEMO) {
1783 ni = ieee80211_fakeup_adhoc_node(vap, macaddr);
1787 IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_OUTPUT, macaddr,
1789 vap->iv_stats.is_tx_nonode++;
1801 * NB: careful about referencing the vap as it may be
1807 IEEE80211_DPRINTF(vap, IEEE80211_MSG_NODE,
1813 struct ieee80211vap *vap = ni->ni_vap;
1814 if (vap->iv_aid_bitmap != NULL)
1815 IEEE80211_AID_CLR(vap, ni->ni_associd);
2007 struct ieee80211vap *vap = ni->ni_vap;
2009 if (vap->iv_auth->ia_node_leave != NULL)
2010 vap->iv_auth->ia_node_leave(ni);
2011 if (vap->iv_aid_bitmap != NULL)
2012 IEEE80211_AID_CLR(vap, ni->ni_associd);
2019 * Make a separate pass to clear references to this vap
2021 * because ni_vap will point to the ap vap but we still
2022 * need to clear ni_wdsvap when the WDS vap is destroyed
2055 struct ieee80211vap *vap = ni->ni_vap;
2064 if (vap->iv_state != IEEE80211_S_RUN)
2072 if ((vap->iv_opmode == IEEE80211_M_HOSTAP ||
2073 vap->iv_opmode == IEEE80211_M_STA) &&
2088 IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni,
2099 if (ni == vap->iv_bss)
2102 (vap->iv_opmode == IEEE80211_M_IBSS ||
2103 vap->iv_opmode == IEEE80211_M_AHDEMO)) {
2120 if ((vap->iv_flags_ext & IEEE80211_FEXT_INACT) &&
2122 ni->ni_inact <= vap->iv_inact_probe) &&
2124 IEEE80211_NOTE(vap,
2143 if ((vap->iv_flags_ext & IEEE80211_FEXT_INACT) &&
2145 IEEE80211_NOTE(vap,
2166 vap->iv_stats.is_node_timeout++;
2189 struct ieee80211vap *vap;
2200 vap = ni->ni_vap;
2208 if (vap->iv_state != IEEE80211_S_RUN)
2210 /* XXX can vap be NULL? */
2211 if ((vap->iv_opmode == IEEE80211_M_HOSTAP ||
2212 vap->iv_opmode == IEEE80211_M_STA) &&
2338 struct ieee80211vap *vap;
2344 vap = TAILQ_FIRST(&nt->nt_ic->ic_vaps);
2345 if (vap != NULL)
2346 max_aid = vap->iv_max_aid;
2416 struct ieee80211vap *vap;
2420 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next)
2421 if (vap->iv_opmode == IEEE80211_M_HOSTAP)
2422 ieee80211_beacon_notify(vap, IEEE80211_BEACON_ERP);
2455 /* XXX vap's w/ conflicting needs won't work */
2505 struct ieee80211vap *vap = ni->ni_vap;
2511 KASSERT(vap->iv_aid_bitmap != NULL, ("no aid bitmap"));
2516 for (aid = 1; aid < vap->iv_max_aid; aid++) {
2517 if (!IEEE80211_AID_ISSET(vap, aid))
2520 if (aid >= vap->iv_max_aid) {
2528 IEEE80211_AID_SET(vap, ni->ni_associd);
2529 vap->iv_sta_assoc++;
2543 IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC | IEEE80211_MSG_DEBUG, ni,
2556 IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_FF) ?
2558 IEEE80211_ATH_CAP(vap, ni, IEEE80211_NODE_TURBOP) ?
2569 if (vap->iv_auth->ia_node_join != NULL)
2570 vap->iv_auth->ia_node_join(ni);
2668 IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC, ni,
2685 struct ieee80211vap *vap = ni->ni_vap;
2688 IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC | IEEE80211_MSG_DEBUG, ni,
2691 KASSERT(vap->iv_opmode != IEEE80211_M_STA,
2692 ("unexpected operating mode %u", vap->iv_opmode));
2706 if (vap->iv_auth->ia_node_leave != NULL)
2707 vap->iv_auth->ia_node_leave(ni);
2710 IEEE80211_AID_CLR(vap, ni->ni_associd);
2711 vap->iv_sta_assoc--;
2743 struct ieee80211vap *vap;
2752 struct ieee80211vap *vap = ni->ni_vap;
2755 if (info->vap != vap)
2760 rssi = vap->iv_ic->ic_node_getrssi(ni);
2771 struct ieee80211vap *vap = ni->ni_vap;
2774 if (info->vap != vap)
2780 rssi = vap->iv_ic->ic_node_getrssi(ni);
2792 struct ieee80211vap *vap = ni->ni_vap;
2795 if (info->vap != vap)
2800 rssi = vap->iv_ic->ic_node_getrssi(ni);
2809 ieee80211_getrssi(struct ieee80211vap *vap)
2812 struct ieee80211com *ic = vap->iv_ic;
2817 info.vap = vap;
2818 switch (vap->iv_opmode) {
2834 if (vap->iv_bss != NULL)
2835 info.rssi_total = ic->ic_node_getrssi(vap->iv_bss);
2844 ieee80211_getsignal(struct ieee80211vap *vap, int8_t *rssi, int8_t *noise)
2847 if (vap->iv_bss == NULL) /* NB: shouldn't happen */
2849 vap->iv_ic->ic_node_getsignal(vap->iv_bss, rssi, noise);
2851 if (vap->iv_opmode != IEEE80211_M_STA)
2852 *rssi = ieee80211_getrssi(vap);