Lines Matching full:ni

70 static	int hostap_input(struct ieee80211_node *ni, struct mbuf *m,
108 sta_disassoc(void *arg, struct ieee80211_node *ni)
111 if (ni->ni_associd != 0) {
112 IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_DISASSOC,
114 ieee80211_node_leave(ni);
119 sta_csa(void *arg, struct ieee80211_node *ni)
121 struct ieee80211vap *vap = ni->ni_vap;
123 if (ni->ni_associd != 0)
124 if (ni->ni_inact > vap->iv_inact_init) {
125 ni->ni_inact = vap->iv_inact_init;
126 IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni,
127 "%s: inact %u", __func__, ni->ni_inact);
132 sta_drop(void *arg, struct ieee80211_node *ni)
135 if (ni->ni_associd != 0)
136 ieee80211_node_leave(ni);
308 struct ieee80211_node *ni = vap->iv_bss;
311 ether_sprintf(ni->ni_bssid));
312 ieee80211_print_essid(ni->ni_essid,
313 ni->ni_esslen);
317 IEEE80211_RATE2MBS(ni->ni_txrate));
357 struct ieee80211_node *ni, struct mbuf *m)
372 IEEE80211_NODE_STAT(ni, rx_data);
373 IEEE80211_NODE_STAT_ADD(ni, rx_bytes, m->m_pkthdr.len);
376 IEEE80211_NODE_STAT(ni, rx_mcast);
378 IEEE80211_NODE_STAT(ni, rx_ucast);
435 if (ni->ni_vlan != 0) {
437 m->m_pkthdr.ether_vtag = ni->ni_vlan;
475 hostap_input(struct ieee80211_node *ni, struct mbuf *m,
478 struct ieee80211vap *vap = ni->ni_vap;
479 struct ieee80211com *ic = ni->ni_ic;
515 KASSERT(ni != NULL, ("null node"));
516 ni->ni_inact = ni->ni_inact_reload;
522 ni->ni_macaddr, NULL,
537 ni->ni_macaddr, NULL, "wrong version, fc %02x:%02x",
554 IEEE80211_MSG_ANY, ni->ni_macaddr,
576 IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi);
577 ni->ni_noise = nf;
583 if (! ieee80211_check_rxseq(ni, wh, bssid, rxs))
594 ni->ni_macaddr, NULL,
617 if (ni == vap->iv_bss) {
620 ieee80211_send_error(ni, wh->i_addr2,
626 if (ni->ni_associd == 0) {
629 IEEE80211_SEND_MGMT(ni,
641 (ni->ni_flags & IEEE80211_NODE_PWR_MGT)))
642 vap->iv_node_ps(ni,
649 if (dir == IEEE80211_FC1_DIR_DSTODS && ni->ni_wdsvap == NULL) {
650 if (!ieee80211_node_is_authorized(ni)) {
657 IEEE80211_NODE_STAT(ni, rx_unauth);
660 ieee80211_dwds_discover(ni, m);
671 ieee80211_ampdu_reorder(ni, m, rxs) != 0) {
693 IEEE80211_NODE_STAT(ni, rx_noprivacy);
696 if (ieee80211_crypto_decap(ni, m, hdrspace, &key) == 0) {
698 IEEE80211_NODE_STAT(ni, rx_wepfail);
721 m = ieee80211_defrag(ni, m, hdrspace, has_decrypted);
734 ni->ni_macaddr, "data", "%s", "demic error");
736 IEEE80211_NODE_STAT(ni, rx_demicfail);
754 ni->ni_macaddr, "data", "%s", "decap error");
756 IEEE80211_NODE_STAT(ni, rx_decap);
763 if (!ieee80211_node_is_authorized(ni)) {
775 ni->ni_macaddr, "data", "unauthorized or "
780 IEEE80211_NODE_STAT(ni, rx_unauth);
797 IEEE80211_NODE_STAT(ni, rx_unencrypted);
803 m = ieee80211_decap_amsdu(ni, m);
808 m = ieee80211_decap_fastframe(vap, ni, m);
813 if (dir == IEEE80211_FC1_DIR_DSTODS && ni->ni_wdsvap != NULL)
814 ieee80211_deliver_data(ni->ni_wdsvap, ni, m);
816 hostap_deliver_data(vap, ni, m);
821 IEEE80211_NODE_STAT(ni, rx_mgmt);
830 ni->ni_macaddr, "mgt", "too short: len %u",
873 if (ieee80211_crypto_decap(ni, m, hdrspace, &key) == 0) {
889 vap->iv_recv_mgmt(ni, m, subtype, rxs, rssi, nf);
894 IEEE80211_NODE_STAT(ni, rx_ctrl);
895 vap->iv_recv_ctl(ni, m, subtype);
915 hostap_auth_open(struct ieee80211_node *ni, struct ieee80211_frame *wh,
918 struct ieee80211vap *vap = ni->ni_vap;
922 if (ni->ni_authmode == IEEE80211_AUTH_SHARED) {
924 ni->ni_macaddr, "open auth",
925 "bad sta auth mode %u", ni->ni_authmode);
932 if (ni->ni_challenge != NULL) {
933 IEEE80211_FREE(ni->ni_challenge, M_80211_NODE);
934 ni->ni_challenge = NULL;
937 ieee80211_send_error(ni, wh->i_addr2,
947 if (ni == vap->iv_bss) {
948 ni = ieee80211_dup_bss(vap, wh->i_addr2);
949 if (ni == NULL)
951 } else if ((ni->ni_flags & IEEE80211_NODE_AREF) == 0)
952 (void) ieee80211_ref_node(ni);
958 ni->ni_flags |= IEEE80211_NODE_AREF;
963 ni->ni_flags |= IEEE80211_NODE_ASSOCID;
975 IEEE80211_MSG_AUTH | IEEE80211_MSG_ACL, ni->ni_macaddr,
977 ieee80211_notify_node_auth(ni);
979 IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_AUTH, seq + 1);
981 IEEE80211_MSG_DEBUG | IEEE80211_MSG_AUTH, ni->ni_macaddr,
987 if (ni->ni_authmode != IEEE80211_AUTH_8021X)
988 ieee80211_node_authorize(ni);
993 hostap_auth_shared(struct ieee80211_node *ni, struct ieee80211_frame *wh,
997 struct ieee80211vap *vap = ni->ni_vap;
1013 ni->ni_macaddr, "shared key auth",
1023 if (ni->ni_authmode != IEEE80211_AUTH_AUTO &&
1024 ni->ni_authmode != IEEE80211_AUTH_SHARED) {
1026 ni->ni_macaddr, "shared key auth",
1027 "bad sta auth mode %u", ni->ni_authmode);
1037 ni->ni_macaddr, "shared key auth",
1053 ni->ni_macaddr, "shared key auth",
1061 ni->ni_macaddr, "shared key auth",
1077 if (ni == vap->iv_bss) {
1078 ni = ieee80211_dup_bss(vap, wh->i_addr2);
1079 if (ni == NULL) {
1087 if ((ni->ni_flags & IEEE80211_NODE_AREF) == 0)
1088 (void) ieee80211_ref_node(ni);
1098 ni->ni_flags |= IEEE80211_NODE_AREF;
1103 ni->ni_flags |= IEEE80211_NODE_ASSOCID;
1104 IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi);
1105 ni->ni_noise = nf;
1106 if (!ieee80211_alloc_challenge(ni)) {
1110 net80211_get_random_bytes(ni->ni_challenge,
1113 ni, "shared key %sauth request", allocbs ? "" : "re");
1125 ni->ni_macaddr,
1127 ieee80211_notify_node_auth(ni);
1133 if (ni == vap->iv_bss) {
1135 ni->ni_macaddr, "shared key response",
1140 if (ni->ni_challenge == NULL) {
1142 ni->ni_macaddr, "shared key response",
1148 if (memcmp(ni->ni_challenge, &challenge[2],
1151 ni->ni_macaddr, "shared key response",
1158 ni, "%s", "station authenticated (shared key)");
1159 ieee80211_node_authorize(ni);
1163 ni->ni_macaddr, "shared key auth",
1169 IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_AUTH, seq + 1);
1176 ieee80211_send_error(ni, wh->i_addr2,
1557 wpa_assocreq(struct ieee80211_node *ni, struct ieee80211_rsnparms *rsnparms,
1561 struct ieee80211vap *vap = ni->ni_vap;
1565 ni->ni_flags &= ~(IEEE80211_NODE_WPS|IEEE80211_NODE_TSN);
1573 ni->ni_flags |= IEEE80211_NODE_WPS;
1582 ni->ni_flags |= IEEE80211_NODE_TSN;
1625 IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC | IEEE80211_MSG_WPA, ni,
1634 ieee80211_node_deauth(ni, reason);
1653 ieee80211_deliver_l2uf(struct ieee80211_node *ni)
1655 struct ieee80211vap *vap = ni->ni_vap;
1663 IEEE80211_NOTE(vap, IEEE80211_MSG_ASSOC, ni,
1673 IEEE80211_ADDR_COPY(eh->ether_shost, ni->ni_macaddr);
1684 hostap_deliver_data(vap, ni, m);
1688 ratesetmismatch(struct ieee80211_node *ni, const struct ieee80211_frame *wh,
1691 IEEE80211_NOTE_MAC(ni->ni_vap, IEEE80211_MSG_ANY, wh->i_addr2,
1694 IEEE80211_SEND_MGMT(ni, resp, IEEE80211_STATUS_BASIC_RATE);
1695 ieee80211_node_leave(ni);
1699 capinfomismatch(struct ieee80211_node *ni, const struct ieee80211_frame *wh,
1702 struct ieee80211vap *vap = ni->ni_vap;
1707 IEEE80211_SEND_MGMT(ni, resp, IEEE80211_STATUS_CAPINFO);
1708 ieee80211_node_leave(ni);
1713 htcapmismatch(struct ieee80211_node *ni, const struct ieee80211_frame *wh,
1716 IEEE80211_NOTE_MAC(ni->ni_vap, IEEE80211_MSG_ANY, wh->i_addr2,
1719 IEEE80211_SEND_MGMT(ni, resp, IEEE80211_STATUS_MISSING_HT_CAPS);
1720 ieee80211_node_leave(ni);
1724 authalgreject(struct ieee80211_node *ni, const struct ieee80211_frame *wh,
1727 struct ieee80211vap *vap = ni->ni_vap;
1732 ieee80211_send_error(ni, wh->i_addr2, IEEE80211_FC0_SUBTYPE_AUTH,
1763 hostap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0,
1766 struct ieee80211vap *vap = ni->ni_vap;
1767 struct ieee80211com *ic = ni->ni_ic;
1795 if (ieee80211_parse_beacon(ni, m0, ic->ic_curchan, &scan) &~ IEEE80211_BPARSE_OFFCHAN)
1802 IEEE80211_NODE_STAT(ni, rx_beacons);
1804 IEEE80211_NODE_STAT(ni, rx_proberesp);
1980 ieee80211_send_error(ni, wh->i_addr2,
1990 ieee80211_send_error(ni, wh->i_addr2,
1996 hostap_auth_shared(ni, wh, frm + 6, efrm, rssi, nf,
1999 hostap_auth_open(ni, wh, rssi, nf, seq, status);
2001 authalgreject(ni, wh, algo,
2014 authalgreject(ni, wh, algo,
2043 if (ni == vap->iv_bss) {
2047 ieee80211_send_error(ni, wh->i_addr2,
2142 !wpa_assocreq(ni, &rsnparms, wh, wpa, rsn, capinfo))
2145 if (ni->ni_challenge != NULL) {
2146 IEEE80211_FREE(ni->ni_challenge, M_80211_NODE);
2147 ni->ni_challenge = NULL;
2151 capinfomismatch(ni, wh, reassoc, resp,
2158 if (ni->ni_associd != 0 &&
2160 ((ni->ni_capinfo ^ capinfo) & IEEE80211_CAPINFO_SHORT_SLOTTIME)) {
2161 capinfomismatch(ni, wh, reassoc, resp,
2165 rate = ieee80211_setup_rates(ni, rates, xrates,
2169 ratesetmismatch(ni, wh, reassoc, resp, "legacy", rate);
2180 ratesetmismatch(ni, wh, reassoc, resp, "11g", rate);
2188 ni->ni_chan = vap->iv_bss->ni_chan;
2191 if (IEEE80211_IS_CHAN_VHT(ni->ni_chan) &&
2196 ieee80211_vht_node_init(ni);
2197 ieee80211_vht_update_cap(ni, vhtcap, vhtinfo);
2198 } else if (ni->ni_flags & IEEE80211_NODE_VHT)
2199 ieee80211_vht_node_cleanup(ni);
2202 if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && htcap != NULL) {
2203 rate = ieee80211_setup_htrates(ni, htcap,
2207 ratesetmismatch(ni, wh, reassoc, resp,
2212 ieee80211_ht_node_init(ni);
2213 ieee80211_ht_updatehtcap(ni, htcap);
2214 } else if (ni->ni_flags & IEEE80211_NODE_HT)
2215 ieee80211_ht_node_cleanup(ni);
2218 if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && htcap != NULL) {
2219 ieee80211_ht_updatehtcap_final(ni);
2224 ieee80211_ff_node_cleanup(ni);
2232 if ((ni->ni_flags & IEEE80211_NODE_HT) &&
2237 IEEE80211_MSG_ASSOC | IEEE80211_MSG_11N, ni,
2241 ieee80211_ht_node_cleanup(ni);
2244 ieee80211_ff_node_cleanup(ni);
2252 (ni->ni_flags & IEEE80211_NODE_HT) == 0) {
2253 htcapmismatch(ni, wh, reassoc, resp);
2257 IEEE80211_RSSI_LPF(ni->ni_avgrssi, rssi);
2258 ni->ni_noise = nf;
2259 ni->ni_intval = lintval;
2260 ni->ni_capinfo = capinfo;
2261 ni->ni_fhdwell = vap->iv_bss->ni_fhdwell;
2262 ni->ni_fhindex = vap->iv_bss->ni_fhindex;
2267 if (ieee80211_ies_init(&ni->ni_ies, sfrm, efrm - sfrm)) {
2268 #define setie(_ie, _off) ieee80211_ies_setie(ni->ni_ies, _ie, _off)
2280 ni->ni_flags |= IEEE80211_NODE_QOS;
2281 if (ieee80211_parse_wmeie(wme, wh, ni) > 0) {
2282 if (ni->ni_uapsd != 0)
2283 ni->ni_flags |=
2286 ni->ni_flags &=
2290 ni->ni_flags &=
2299 ieee80211_parse_ath(ni, ni->ni_ies.ath_ie);
2302 ni->ni_ath_flags = 0;
2305 ni->ni_flags &= ~IEEE80211_NODE_QOS;
2306 ni->ni_flags &= ~IEEE80211_NODE_UAPSD;
2307 ni->ni_ath_flags = 0;
2309 ieee80211_node_join(ni, resp);
2310 ieee80211_deliver_l2uf(ni);
2336 IEEE80211_NODE_STAT(ni, rx_deauth);
2339 IEEE80211_NODE_STAT(ni, rx_disassoc);
2341 IEEE80211_NOTE(vap, IEEE80211_MSG_AUTH, ni,
2345 if (ni != vap->iv_bss)
2346 ieee80211_node_leave(ni);
2352 if (ni == vap->iv_bss) {
2367 if (ieee80211_parse_action(ni, m0) == 0)
2368 (void)ic->ic_recv_action(ni, wh, frm, efrm);
2390 hostap_recv_ctl(struct ieee80211_node *ni, struct mbuf *m, int subtype)
2394 ni->ni_vap->iv_recv_pspoll(ni, m);
2397 ieee80211_recv_bar(ni, m);
2406 ieee80211_recv_pspoll(struct ieee80211_node *ni, struct mbuf *m0)
2408 struct ieee80211vap *vap = ni->ni_vap;
2416 if (ni->ni_associd == 0) {
2422 IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_DEAUTH,
2428 if (aid != ni->ni_associd) {
2433 ni->ni_associd, aid);
2447 m = ieee80211_node_psq_dequeue(ni, &qlen);
2451 ieee80211_send_nulldata(ieee80211_ref_node(ni));
2454 vap->iv_set_tim(ni, 0); /* just in case */
2463 IEEE80211_NOTE(vap, IEEE80211_MSG_POWER, ni,
2467 IEEE80211_NOTE(vap, IEEE80211_MSG_POWER, ni,
2470 vap->iv_set_tim(ni, 0);