Lines Matching defs:vap
82 wds_vdetach(struct ieee80211vap *vap)
84 if (vap->iv_bss != NULL) {
86 if (vap->iv_bss->ni_wdsvap == vap)
87 vap->iv_bss->ni_wdsvap = NULL;
92 wds_vattach(struct ieee80211vap *vap)
94 vap->iv_newstate = wds_newstate;
95 vap->iv_input = wds_input;
96 vap->iv_recv_mgmt = wds_recv_mgmt;
97 vap->iv_opdetach = wds_vdetach;
123 ieee80211_create_wds(struct ieee80211vap *vap, struct ieee80211_channel *chan)
125 struct ieee80211com *ic = vap->iv_ic;
129 IEEE80211_DPRINTF(vap, IEEE80211_MSG_WDS,
131 ether_sprintf(vap->iv_des_bssid), ieee80211_chan2ieee(ic, chan));
133 /* NB: vap create must specify the bssid for the link */
134 KASSERT(vap->iv_flags & IEEE80211_F_DESBSSID, ("no bssid"));
136 KASSERT(vap->iv_state == IEEE80211_S_RUN, ("!RUN state"));
138 if ((vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) == 0) {
141 * station specified by the desired bssid setup at vap
142 * create. Point ni_wdsvap at the WDS vap so 4-address
143 * frames received through the associated AP vap will
145 * they arrived on the WDS vap.
149 ni = ieee80211_find_node_locked(&ic->ic_sta, vap->iv_des_bssid);
155 * the vap to be destroyed.
157 IEEE80211_DPRINTF(vap, IEEE80211_MSG_WDS,
159 __func__, ether_sprintf(vap->iv_des_bssid));
163 * Node already setup with a WDS vap; we cannot
169 IEEE80211_DPRINTF(vap, IEEE80211_MSG_WDS,
171 __func__, ether_sprintf(vap->iv_des_bssid),
178 obss = vap->iv_update_bss(vap, ni);
179 ni->ni_wdsvap = vap;
188 * Legacy WDS vap setup.
192 * create a new node and install it as the vap's
197 ni = ieee80211_node_create_wds(vap, vap->iv_des_bssid, chan);
199 obss = vap->iv_update_bss(vap, ieee80211_ref_node(ni));
207 if (vap->iv_auth->ia_node_join != NULL)
208 vap->iv_auth->ia_node_join(ni);
226 * Propagate multicast frames of an ap vap to all DWDS links.
235 struct ieee80211vap *vap;
244 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
246 if (vap->iv_opmode != IEEE80211_M_WDS ||
247 (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY))
250 ifp = vap->iv_ifp;
262 ni = ieee80211_find_txnode(vap, eh->ether_dhost);
271 IEEE80211_DISCARD_MAC(vap,
275 vap->iv_stats.is_tx_classify++;
288 mcopy = ieee80211_encap(vap, ni, mcopy);
313 * to plumb the necessary WDS vap for this station. Frames
314 * received prior to the vap set running will then be reprocessed
328 * XXX per/vap beacon interval?
339 * IEEE80211_M_WDS vap state machine handler.
342 wds_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
344 struct ieee80211com *ic = vap->iv_ic;
350 ostate = vap->iv_state;
351 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s\n", __func__,
353 vap->iv_state = nstate; /* state transition */
354 callout_stop(&vap->iv_mgtsend); /* XXX callout_drain */
356 ieee80211_cancel_scan(vap); /* background scan */
362 ieee80211_cancel_scan(vap);
369 ieee80211_reset_bss(vap);
375 ieee80211_check_scan_current(vap);
387 error = ieee80211_create_wds(vap, ic->ic_curchan);
410 struct ieee80211vap *vap = ni->ni_vap;
412 struct ifnet *ifp = vap->iv_ifp;
451 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
454 vap->iv_stats.is_rx_tooshort++;
469 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
472 vap->iv_stats.is_rx_badversion++;
480 /* NB: WDS vap's do not scan */
482 IEEE80211_DISCARD_MAC(vap,
485 vap->iv_stats.is_rx_tooshort++;
489 if (!IEEE80211_ADDR_EQ(wh->i_addr1, vap->iv_myaddr) &&
492 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
494 vap->iv_stats.is_rx_wrongbss++;
512 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
515 vap->iv_stats.is_rx_tooshort++;
519 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
521 vap->iv_stats.is_rx_wrongdir++;
527 if ((vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) == 0) {
528 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
530 vap->iv_stats.is_rx_wrongdir++;/*XXX*/
555 if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0) {
559 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
561 vap->iv_stats.is_rx_noprivacy++;
601 if (!ieee80211_crypto_demic(vap, key, m, 0)) {
602 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
604 vap->iv_stats.is_rx_demicfail++;
610 if (ieee80211_radiotap_active_vap(vap))
611 ieee80211_radiotap_rx(vap, m);
617 m = ieee80211_decap(vap, m, hdrspace, qos);
624 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
626 vap->iv_stats.is_rx_decap++;
645 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
650 vap->iv_stats.is_rx_unauth++;
659 if ((vap->iv_flags & IEEE80211_F_DROPUNENC) &&
667 vap->iv_stats.is_rx_unencrypted++;
679 m = ieee80211_decap_fastframe(vap, ni, m);
684 ieee80211_deliver_data(vap, ni, m);
688 vap->iv_stats.is_rx_mgmt++;
691 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
693 vap->iv_stats.is_rx_wrongdir++;
697 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
700 vap->iv_stats.is_rx_tooshort++;
704 if (ieee80211_msg_debug(vap) || ieee80211_msg_dumppkts(vap)) {
711 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
713 vap->iv_stats.is_rx_mgtdiscard++; /* XXX */
716 vap->iv_recv_mgmt(ni, m, subtype, rxs, rssi, nf);
720 vap->iv_stats.is_rx_ctl++;
725 IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
734 if (need_tap && ieee80211_radiotap_active_vap(vap))
735 ieee80211_radiotap_rx(vap, m);
745 struct ieee80211vap *vap = ni->ni_vap;
756 if (ni == vap->iv_bss) {
757 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
759 vap->iv_stats.is_rx_mgtdiscard++;
760 } else if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, wh->i_addr1)) {
762 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
764 vap->iv_stats.is_rx_mgtdiscard++;
765 } else if (vap->iv_state != IEEE80211_S_RUN) {
766 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
768 ieee80211_state_name[vap->iv_state]);
769 vap->iv_stats.is_rx_mgtdiscard++;
788 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
790 vap->iv_stats.is_rx_mgtdiscard++;
794 IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
796 vap->iv_stats.is_rx_badsubtype++;