Lines Matching refs:vap

84 wds_vdetach(struct ieee80211vap *vap)
86 if (vap->iv_bss != NULL) {
88 if (vap->iv_bss->ni_wdsvap == vap)
89 vap->iv_bss->ni_wdsvap = NULL;
94 wds_vattach(struct ieee80211vap *vap)
96 vap->iv_newstate = wds_newstate;
97 vap->iv_input = wds_input;
98 vap->iv_recv_mgmt = wds_recv_mgmt;
99 vap->iv_opdetach = wds_vdetach;
125 ieee80211_create_wds(struct ieee80211vap *vap, struct ieee80211_channel *chan)
127 struct ieee80211com *ic = vap->iv_ic;
131 IEEE80211_DPRINTF(vap, IEEE80211_MSG_WDS,
133 ether_sprintf(vap->iv_des_bssid), ieee80211_chan2ieee(ic, chan));
135 /* NB: vap create must specify the bssid for the link */
136 KASSERT(vap->iv_flags & IEEE80211_F_DESBSSID, ("no bssid"));
138 KASSERT(vap->iv_state == IEEE80211_S_RUN, ("!RUN state"));
140 if ((vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) == 0) {
143 * station specified by the desired bssid setup at vap
144 * create. Point ni_wdsvap at the WDS vap so 4-address
145 * frames received through the associated AP vap will
147 * they arrived on the WDS vap.
151 ni = ieee80211_find_node_locked(&ic->ic_sta, vap->iv_des_bssid);
157 * the vap to be destroyed.
159 IEEE80211_DPRINTF(vap, IEEE80211_MSG_WDS,
161 __func__, ether_sprintf(vap->iv_des_bssid));
165 * Node already setup with a WDS vap; we cannot
171 IEEE80211_DPRINTF(vap, IEEE80211_MSG_WDS,
173 __func__, ether_sprintf(vap->iv_des_bssid),
180 obss = vap->iv_bss;
181 vap->iv_bss = ni;
182 ni->ni_wdsvap = vap;
191 * Legacy WDS vap setup.
195 * create a new node and install it as the vap's
200 ni = ieee80211_node_create_wds(vap, vap->iv_des_bssid, chan);
202 obss = vap->iv_bss;
203 vap->iv_bss = ieee80211_ref_node(ni);
211 if (vap->iv_auth->ia_node_join != NULL)
212 vap->iv_auth->ia_node_join(ni);
230 * Propagate multicast frames of an ap vap to all DWDS links.
239 struct ieee80211vap *vap;
248 TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) {
250 if (vap->iv_opmode != IEEE80211_M_WDS ||
251 (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY))
254 ifp = vap->iv_ifp;
266 ni = ieee80211_find_txnode(vap, eh->ether_dhost);
275 IEEE80211_DISCARD_MAC(vap,
279 vap->iv_stats.is_tx_classify++;
292 mcopy = ieee80211_encap(vap, ni, mcopy);
316 * to plumb the necessary WDS vap for this station. Frames
317 * received prior to the vap set running will then be reprocessed
331 * XXX per/vap beacon interval?
341 * IEEE80211_M_WDS vap state machine handler.
344 wds_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
346 struct ieee80211com *ic = vap->iv_ic;
352 ostate = vap->iv_state;
353 IEEE80211_DPRINTF(vap, IEEE80211_MSG_STATE, "%s: %s -> %s\n", __func__,
355 vap->iv_state = nstate; /* state transition */
356 callout_stop(&vap->iv_mgtsend); /* XXX callout_drain */
358 ieee80211_cancel_scan(vap); /* background scan */
364 ieee80211_cancel_scan(vap);
371 ieee80211_reset_bss(vap);
377 ieee80211_check_scan_current(vap);
389 error = ieee80211_create_wds(vap, ic->ic_curchan);
412 struct ieee80211vap *vap = ni->ni_vap;
414 struct ifnet *ifp = vap->iv_ifp;
443 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
446 vap->iv_stats.is_rx_tooshort++;
462 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
465 vap->iv_stats.is_rx_badversion++;
473 /* NB: WDS vap's do not scan */
475 IEEE80211_DISCARD_MAC(vap,
478 vap->iv_stats.is_rx_tooshort++;
482 if (!IEEE80211_ADDR_EQ(wh->i_addr1, vap->iv_myaddr) &&
485 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
487 vap->iv_stats.is_rx_wrongbss++;
505 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
508 vap->iv_stats.is_rx_tooshort++;
512 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
514 vap->iv_stats.is_rx_wrongdir++;
520 if ((vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) == 0) {
521 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
523 vap->iv_stats.is_rx_wrongdir++;/*XXX*/
548 if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0) {
552 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
554 vap->iv_stats.is_rx_noprivacy++;
594 if (key != NULL && !ieee80211_crypto_demic(vap, key, m, 0)) {
595 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
597 vap->iv_stats.is_rx_demicfail++;
603 if (ieee80211_radiotap_active_vap(vap))
604 ieee80211_radiotap_rx(vap, m);
610 m = ieee80211_decap(vap, m, hdrspace);
617 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
619 vap->iv_stats.is_rx_decap++;
634 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT,
638 vap->iv_stats.is_rx_unauth++;
647 if ((vap->iv_flags & IEEE80211_F_DROPUNENC) &&
653 vap->iv_stats.is_rx_unencrypted++;
665 m = ieee80211_decap_fastframe(vap, ni, m);
670 ieee80211_deliver_data(vap, ni, m);
674 vap->iv_stats.is_rx_mgmt++;
677 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
679 vap->iv_stats.is_rx_wrongdir++;
683 IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_ANY,
686 vap->iv_stats.is_rx_tooshort++;
690 if (ieee80211_msg_debug(vap) || ieee80211_msg_dumppkts(vap)) {
697 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
699 vap->iv_stats.is_rx_mgtdiscard++; /* XXX */
702 vap->iv_recv_mgmt(ni, m, subtype, rxs, rssi, nf);
706 vap->iv_stats.is_rx_ctl++;
711 IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
720 if (need_tap && ieee80211_radiotap_active_vap(vap))
721 ieee80211_radiotap_rx(vap, m);
731 struct ieee80211vap *vap = ni->ni_vap;
742 if (ni == vap->iv_bss) {
743 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
745 vap->iv_stats.is_rx_mgtdiscard++;
746 } else if (!IEEE80211_ADDR_EQ(vap->iv_myaddr, wh->i_addr1)) {
748 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
750 vap->iv_stats.is_rx_mgtdiscard++;
751 } else if (vap->iv_state != IEEE80211_S_RUN) {
752 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
754 ieee80211_state_name[vap->iv_state]);
755 vap->iv_stats.is_rx_mgtdiscard++;
774 IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT,
776 vap->iv_stats.is_rx_mgtdiscard++;
780 IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,
782 vap->iv_stats.is_rx_badsubtype++;