Lines Matching full:ni

204 static int ieee80211_ampdu_enable(struct ieee80211_node *ni,
206 static int ieee80211_addba_request(struct ieee80211_node *ni,
209 static int ieee80211_addba_response(struct ieee80211_node *ni,
212 static void ieee80211_addba_stop(struct ieee80211_node *ni,
214 static void null_addba_response_timeout(struct ieee80211_node *ni,
217 static void ieee80211_bar_response(struct ieee80211_node *ni,
466 ieee80211_decap_amsdu(struct ieee80211_node *ni, struct mbuf *m) in ieee80211_decap_amsdu() argument
468 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_decap_amsdu()
487 ni->ni_macaddr, "a-msdu", "%s", "decap failed"); in ieee80211_decap_amsdu()
496 ni->ni_macaddr, "a-msdu", in ieee80211_decap_amsdu()
502 vap->iv_deliver_data(vap, ni, m); in ieee80211_decap_amsdu()
540 struct ieee80211_node *ni, in ampdu_rx_add_slot() argument
545 struct ieee80211vap *vap = ni->ni_vap; in ampdu_rx_add_slot()
603 ni->ni_macaddr, in ampdu_rx_add_slot()
624 IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); in ampdu_rx_add_slot()
626 IEEE80211_NODE_STAT(ni, rx_amsdu_more); in ampdu_rx_add_slot()
632 ni->ni_macaddr, "a-mpdu duplicate", in ampdu_rx_add_slot()
639 ni->ni_macaddr, "a-mpdu duplicate", in ampdu_rx_add_slot()
646 ni->ni_macaddr, "a-mpdu duplicate", in ampdu_rx_add_slot()
651 IEEE80211_NODE_STAT(ni, rx_dup); in ampdu_rx_add_slot()
678 ieee80211_ampdu_rx_init_rap(struct ieee80211_node *ni, in ieee80211_ampdu_rx_init_rap() argument
693 ampdu_rx_start(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap, in ampdu_rx_start() argument
696 struct ieee80211vap *vap = ni->ni_vap; in ampdu_rx_start()
706 ieee80211_ampdu_rx_init_rap(ni, rap); in ampdu_rx_start()
726 ieee80211_ampdu_rx_start_ext(struct ieee80211_node *ni, int tid, int seq, int baw) in ieee80211_ampdu_rx_start_ext() argument
732 rap = &ni->ni_rx_ampdu[tid]; in ieee80211_ampdu_rx_start_ext()
742 ieee80211_ampdu_rx_init_rap(ni, rap); in ieee80211_ampdu_rx_start_ext()
757 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, ni, in ieee80211_ampdu_rx_start_ext()
772 ieee80211_ampdu_rx_stop_ext(struct ieee80211_node *ni, int tid) in ieee80211_ampdu_rx_stop_ext() argument
777 rap = &ni->ni_rx_ampdu[tid]; in ieee80211_ampdu_rx_stop_ext()
778 ampdu_rx_stop(ni, rap); in ieee80211_ampdu_rx_stop_ext()
785 ampdu_rx_stop(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) in ampdu_rx_stop() argument
801 ampdu_dispatch(struct ieee80211_node *ni, struct mbuf *m) in ampdu_dispatch() argument
805 (void) ieee80211_input(ni, m, 0, 0); in ampdu_dispatch()
809 ampdu_dispatch_slot(struct ieee80211_rx_ampdu *rap, struct ieee80211_node *ni, in ampdu_dispatch_slot() argument
824 ampdu_dispatch(ni, m); in ampdu_dispatch_slot()
830 ampdu_rx_moveup(struct ieee80211_rx_ampdu *rap, struct ieee80211_node *ni, in ampdu_rx_moveup() argument
833 struct ieee80211vap *vap = ni->ni_vap; in ampdu_rx_moveup()
872 ampdu_rx_dispatch(struct ieee80211_rx_ampdu *rap, struct ieee80211_node *ni) in ampdu_rx_dispatch() argument
874 struct ieee80211vap *vap = ni->ni_vap; in ampdu_rx_dispatch()
880 r = ampdu_dispatch_slot(rap, ni, i); in ampdu_rx_dispatch()
887 ampdu_rx_moveup(rap, ni, i, -1); in ampdu_rx_dispatch()
896 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, ni, in ampdu_rx_dispatch()
908 ampdu_rx_flush(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap) in ampdu_rx_flush() argument
913 r = ampdu_dispatch_slot(rap, ni, i); in ampdu_rx_flush()
916 ni->ni_vap->iv_stats.is_ampdu_rx_oor += r; in ampdu_rx_flush()
918 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, ni, in ampdu_rx_flush()
936 ampdu_rx_flush_upto(struct ieee80211_node *ni, in ampdu_rx_flush_upto() argument
939 struct ieee80211vap *vap = ni->ni_vap; in ampdu_rx_flush_upto()
953 (void) ampdu_dispatch_slot(rap, ni, i); in ampdu_rx_flush_upto()
961 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, ni, in ampdu_rx_flush_upto()
973 ampdu_rx_moveup(rap, ni, i, winstart); in ampdu_rx_flush_upto()
997 ieee80211_ampdu_reorder(struct ieee80211_node *ni, struct mbuf *m, in ieee80211_ampdu_reorder() argument
1002 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_ampdu_reorder()
1013 KASSERT(ni->ni_flags & IEEE80211_NODE_HT, ("not an HT sta")); in ieee80211_ampdu_reorder()
1036 rap = &ni->ni_rx_ampdu[tid]; in ieee80211_ampdu_reorder()
1049 IEEE80211_MSG_INPUT | IEEE80211_MSG_11N, ni->ni_macaddr, in ieee80211_ampdu_reorder()
1053 IEEE80211_NODE_STAT(ni, rx_drop); in ieee80211_ampdu_reorder()
1079 ampdu_dispatch(ni, m); in ieee80211_ampdu_reorder()
1080 ampdu_rx_dispatch(rap, ni); in ieee80211_ampdu_reorder()
1090 IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); in ieee80211_ampdu_reorder()
1092 IEEE80211_NODE_STAT(ni, rx_amsdu_more); in ieee80211_ampdu_reorder()
1138 ampdu_rx_flush(ni, rap); in ieee80211_ampdu_reorder()
1148 IEEE80211_NODE_STAT(ni, in ieee80211_ampdu_reorder()
1151 IEEE80211_NODE_STAT(ni, in ieee80211_ampdu_reorder()
1168 ampdu_rx_add_slot(rap, off, tid, rxseq, ni, m, rxs); in ieee80211_ampdu_reorder()
1177 IEEE80211_NOTE(vap, IEEE80211_MSG_11N, ni, in ieee80211_ampdu_reorder()
1193 ampdu_rx_flush_upto(ni, rap, in ieee80211_ampdu_reorder()
1202 IEEE80211_MSG_INPUT | IEEE80211_MSG_11N, ni->ni_macaddr, in ieee80211_ampdu_reorder()
1209 IEEE80211_NODE_STAT(ni, rx_drop); in ieee80211_ampdu_reorder()
1223 ieee80211_recv_bar(struct ieee80211_node *ni, struct mbuf *m0) in ieee80211_recv_bar() argument
1225 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_recv_bar()
1234 ni->ni_macaddr, "BAR", "%s", "processing disabled"); in ieee80211_recv_bar()
1242 rap = &ni->ni_rx_ampdu[tid]; in ieee80211_recv_bar()
1249 ni->ni_macaddr, "BAR", "no BA stream, tid %u", tid); in ieee80211_recv_bar()
1264 IEEE80211_NOTE(vap, IEEE80211_MSG_11N, ni, in ieee80211_recv_bar()
1271 ampdu_rx_flush_upto(ni, rap, rxseq); in ieee80211_recv_bar()
1286 IEEE80211_MSG_INPUT | IEEE80211_MSG_11N, ni->ni_macaddr, in ieee80211_recv_bar()
1293 IEEE80211_NODE_STAT(ni, rx_drop); in ieee80211_recv_bar()
1303 ieee80211_ht_node_init(struct ieee80211_node *ni) in ieee80211_ht_node_init() argument
1308 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, in ieee80211_ht_node_init()
1309 ni, in ieee80211_ht_node_init()
1312 ni); in ieee80211_ht_node_init()
1314 if (ni->ni_flags & IEEE80211_NODE_HT) { in ieee80211_ht_node_init()
1320 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, in ieee80211_ht_node_init()
1321 ni, in ieee80211_ht_node_init()
1323 __func__, ni); in ieee80211_ht_node_init()
1324 ieee80211_ht_node_cleanup(ni); in ieee80211_ht_node_init()
1327 tap = &ni->ni_tx_ampdu[tid]; in ieee80211_ht_node_init()
1329 tap->txa_ni = ni; in ieee80211_ht_node_init()
1332 ieee80211_ampdu_rx_init_rap(ni, &ni->ni_rx_ampdu[tid]); in ieee80211_ht_node_init()
1334 ni->ni_flags |= IEEE80211_NODE_HT | IEEE80211_NODE_AMPDU | in ieee80211_ht_node_init()
1343 ieee80211_ht_node_cleanup(struct ieee80211_node *ni) in ieee80211_ht_node_cleanup() argument
1345 struct ieee80211com *ic = ni->ni_ic; in ieee80211_ht_node_cleanup()
1348 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, in ieee80211_ht_node_cleanup()
1349 ni, in ieee80211_ht_node_cleanup()
1351 __func__, ni); in ieee80211_ht_node_cleanup()
1353 KASSERT(ni->ni_flags & IEEE80211_NODE_HT, ("not an HT node")); in ieee80211_ht_node_cleanup()
1357 struct ieee80211_tx_ampdu *tap = &ni->ni_tx_ampdu[i]; in ieee80211_ht_node_cleanup()
1362 ic->ic_ampdu_rx_stop(ni, &ni->ni_rx_ampdu[i]); in ieee80211_ht_node_cleanup()
1364 ni->ni_htcap = 0; in ieee80211_ht_node_cleanup()
1365 ni->ni_flags &= ~IEEE80211_NODE_HT_ALL; in ieee80211_ht_node_cleanup()
1372 ieee80211_ht_node_age(struct ieee80211_node *ni) in ieee80211_ht_node_age() argument
1374 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_ht_node_age()
1377 KASSERT(ni->ni_flags & IEEE80211_NODE_HT, ("not an HT sta")); in ieee80211_ht_node_age()
1382 rap = &ni->ni_rx_ampdu[tid]; in ieee80211_ht_node_age()
1398 ampdu_rx_flush(ni, rap); in ieee80211_ht_node_age()
1453 ieee80211_ht_wds_init(struct ieee80211_node *ni) in ieee80211_ht_wds_init() argument
1455 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_ht_wds_init()
1468 ni->ni_chan = ieee80211_ht_adjust_channel(ni->ni_ic, in ieee80211_ht_wds_init()
1469 ni->ni_chan, ieee80211_htchanflags(ni->ni_chan)); in ieee80211_ht_wds_init()
1471 ni->ni_htcap = 0; in ieee80211_ht_wds_init()
1473 ni->ni_htcap |= IEEE80211_HTCAP_SHORTGI20; in ieee80211_ht_wds_init()
1474 if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) { in ieee80211_ht_wds_init()
1475 ni->ni_htcap |= IEEE80211_HTCAP_CHWIDTH40; in ieee80211_ht_wds_init()
1476 ni->ni_chw = IEEE80211_STA_RX_BW_40; in ieee80211_ht_wds_init()
1477 if (IEEE80211_IS_CHAN_HT40U(ni->ni_chan)) in ieee80211_ht_wds_init()
1478 ni->ni_ht2ndchan = IEEE80211_HTINFO_2NDCHAN_ABOVE; in ieee80211_ht_wds_init()
1479 else if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan)) in ieee80211_ht_wds_init()
1480 ni->ni_ht2ndchan = IEEE80211_HTINFO_2NDCHAN_BELOW; in ieee80211_ht_wds_init()
1482 ni->ni_htcap |= IEEE80211_HTCAP_SHORTGI40; in ieee80211_ht_wds_init()
1484 ni->ni_chw = IEEE80211_STA_RX_BW_20; in ieee80211_ht_wds_init()
1485 ni->ni_ht2ndchan = IEEE80211_HTINFO_2NDCHAN_NONE; in ieee80211_ht_wds_init()
1487 ni->ni_htctlchan = ni->ni_chan->ic_ieee; in ieee80211_ht_wds_init()
1489 ni->ni_flags |= IEEE80211_NODE_RIFS; in ieee80211_ht_wds_init()
1492 ni->ni_htopmode = 0; /* XXX need protection state */ in ieee80211_ht_wds_init()
1493 ni->ni_htstbc = 0; /* XXX need info */ in ieee80211_ht_wds_init()
1496 tap = &ni->ni_tx_ampdu[tid]; in ieee80211_ht_wds_init()
1501 ni->ni_flags |= IEEE80211_NODE_HT | IEEE80211_NODE_AMPDU | in ieee80211_ht_wds_init()
1572 ieee80211_ht_node_join(struct ieee80211_node *ni) in ieee80211_ht_node_join() argument
1574 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_ht_node_join()
1578 if (ni->ni_flags & IEEE80211_NODE_HT) { in ieee80211_ht_node_join()
1580 if (ni->ni_chw == IEEE80211_STA_RX_BW_40) in ieee80211_ht_node_join()
1590 ieee80211_ht_node_leave(struct ieee80211_node *ni) in ieee80211_ht_node_leave() argument
1592 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_ht_node_leave()
1596 if (ni->ni_flags & IEEE80211_NODE_HT) { in ieee80211_ht_node_leave()
1598 if (ni->ni_chw == IEEE80211_STA_RX_BW_40) in ieee80211_ht_node_leave()
1668 ieee80211_parse_htcap(struct ieee80211_node *ni, const uint8_t *ie) in ieee80211_parse_htcap() argument
1676 ni->ni_flags |= IEEE80211_NODE_HTCOMPAT; in ieee80211_parse_htcap()
1679 ni->ni_flags &= ~IEEE80211_NODE_HTCOMPAT; in ieee80211_parse_htcap()
1681 ni->ni_htcap = le16dec(ie + in ieee80211_parse_htcap()
1683 ni->ni_htparam = ie[__offsetof(struct ieee80211_ie_htcap, hc_param)]; in ieee80211_parse_htcap()
1687 htinfo_parse(struct ieee80211_node *ni, in htinfo_parse() argument
1692 ni->ni_htctlchan = htinfo->hi_ctrlchannel; in htinfo_parse()
1693 ni->ni_ht2ndchan = _IEEE80211_SHIFTMASK(htinfo->hi_byte1, in htinfo_parse()
1696 ni->ni_htopmode = _IEEE80211_SHIFTMASK(w, IEEE80211_HTINFO_OPMODE); in htinfo_parse()
1698 ni->ni_htstbc = _IEEE80211_SHIFTMASK(w, IEEE80211_HTINFO_BASIC_STBCMCS); in htinfo_parse()
1707 ieee80211_parse_htinfo(struct ieee80211_node *ni, const uint8_t *ie) in ieee80211_parse_htinfo() argument
1711 htinfo_parse(ni, (const struct ieee80211_ie_htinfo *) ie); in ieee80211_parse_htinfo()
1727 htinfo_update_chw(struct ieee80211_node *ni, int htflags, int vhtflags) in htinfo_update_chw() argument
1729 struct ieee80211com *ic = ni->ni_ic; in htinfo_update_chw()
1740 chanflags = (ni->ni_chan->ic_flags &~ in htinfo_update_chw()
1743 if (chanflags == ni->ni_chan->ic_flags) in htinfo_update_chw()
1752 chanflags = (ni->ni_chan->ic_flags &~ in htinfo_update_chw()
1755 c = ieee80211_find_channel(ic, ni->ni_chan->ic_freq, chanflags); in htinfo_update_chw()
1761 c = findhtchan(ic, ni->ni_chan, IEEE80211_CHAN_HT20); in htinfo_update_chw()
1763 IEEE80211_NOTE(ni->ni_vap, in htinfo_update_chw()
1764 IEEE80211_MSG_ASSOC | IEEE80211_MSG_11N, ni, in htinfo_update_chw()
1766 ni->ni_chan->ic_freq); in htinfo_update_chw()
1773 c = ni->ni_chan; in htinfo_update_chw()
1779 IEEE80211_NOTE(ni->ni_vap, in htinfo_update_chw()
1780 IEEE80211_MSG_ASSOC | IEEE80211_MSG_11N, ni, in htinfo_update_chw()
1792 if (IEEE80211_CONF_VHT(ic) && ni->ni_vhtcap != 0 && vhtflags != 0) { in htinfo_update_chw()
1796 IEEE80211_NOTE(ni->ni_vap, in htinfo_update_chw()
1798 ni, in htinfo_update_chw()
1800 __func__, ni->ni_vht_chanwidth, vhtflags); in htinfo_update_chw()
1802 IEEE80211_NOTE(ni->ni_vap, in htinfo_update_chw()
1804 ni, in htinfo_update_chw()
1811 if (c != NULL && c != ni->ni_chan) { in htinfo_update_chw()
1812 IEEE80211_NOTE(ni->ni_vap, in htinfo_update_chw()
1813 IEEE80211_MSG_ASSOC | IEEE80211_MSG_11N, ni, in htinfo_update_chw()
1819 ni->ni_chan = c; in htinfo_update_chw()
1826 ni->ni_chw = IEEE80211_IS_CHAN_HT40(ni->ni_chan) ? in htinfo_update_chw()
1835 htcap_update_mimo_ps(struct ieee80211_node *ni) in htcap_update_mimo_ps() argument
1837 uint16_t oflags = ni->ni_flags; in htcap_update_mimo_ps()
1839 switch (ni->ni_htcap & IEEE80211_HTCAP_SMPS) { in htcap_update_mimo_ps()
1841 ni->ni_flags |= IEEE80211_NODE_MIMO_PS; in htcap_update_mimo_ps()
1842 ni->ni_flags |= IEEE80211_NODE_MIMO_RTS; in htcap_update_mimo_ps()
1845 ni->ni_flags |= IEEE80211_NODE_MIMO_PS; in htcap_update_mimo_ps()
1846 ni->ni_flags &= ~IEEE80211_NODE_MIMO_RTS; in htcap_update_mimo_ps()
1850 ni->ni_flags &= ~IEEE80211_NODE_MIMO_PS; in htcap_update_mimo_ps()
1851 ni->ni_flags &= ~IEEE80211_NODE_MIMO_RTS; in htcap_update_mimo_ps()
1854 return (oflags ^ ni->ni_flags); in htcap_update_mimo_ps()
1862 htcap_update_shortgi(struct ieee80211_node *ni) in htcap_update_shortgi() argument
1864 struct ieee80211vap *vap = ni->ni_vap; in htcap_update_shortgi()
1866 ni->ni_flags &= ~(IEEE80211_NODE_SGI20|IEEE80211_NODE_SGI40); in htcap_update_shortgi()
1867 if ((ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) && in htcap_update_shortgi()
1869 ni->ni_flags |= IEEE80211_NODE_SGI20; in htcap_update_shortgi()
1870 if ((ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) && in htcap_update_shortgi()
1872 ni->ni_flags |= IEEE80211_NODE_SGI40; in htcap_update_shortgi()
1880 htcap_update_ldpc(struct ieee80211_node *ni) in htcap_update_ldpc() argument
1882 struct ieee80211vap *vap = ni->ni_vap; in htcap_update_ldpc()
1884 if ((ni->ni_htcap & IEEE80211_HTCAP_LDPC) && in htcap_update_ldpc()
1886 ni->ni_flags |= IEEE80211_NODE_LDPC; in htcap_update_ldpc()
1899 ieee80211_ht_updateparams(struct ieee80211_node *ni, in ieee80211_ht_updateparams() argument
1902 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_ht_updateparams()
1905 ieee80211_parse_htcap(ni, htcapie); in ieee80211_ht_updateparams()
1907 htcap_update_mimo_ps(ni); in ieee80211_ht_updateparams()
1908 htcap_update_shortgi(ni); in ieee80211_ht_updateparams()
1909 htcap_update_ldpc(ni); in ieee80211_ht_updateparams()
1914 htinfo_parse(ni, htinfo); in ieee80211_ht_updateparams()
1923 ni->ni_flags |= IEEE80211_NODE_RIFS; in ieee80211_ht_updateparams()
1925 ni->ni_flags &= ~IEEE80211_NODE_RIFS; in ieee80211_ht_updateparams()
1929 ieee80211_vht_get_vhtflags(struct ieee80211_node *ni, uint32_t htflags) in ieee80211_vht_get_vhtflags() argument
1931 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_vht_get_vhtflags()
1935 if (ni->ni_flags & IEEE80211_NODE_VHT && vap->iv_vht_flags & IEEE80211_FVHT_VHT) { in ieee80211_vht_get_vhtflags()
1936 if ((ni->ni_vht_chanwidth == IEEE80211_VHT_CHANWIDTH_160MHZ) && in ieee80211_vht_get_vhtflags()
1948 } else if ((ni->ni_vht_chanwidth == IEEE80211_VHT_CHANWIDTH_80P80MHZ) && in ieee80211_vht_get_vhtflags()
1960 } else if ((ni->ni_vht_chanwidth == IEEE80211_VHT_CHANWIDTH_80MHZ) && in ieee80211_vht_get_vhtflags()
1969 } else if (ni->ni_vht_chanwidth == IEEE80211_VHT_CHANWIDTH_USE_HT) { in ieee80211_vht_get_vhtflags()
2012 ieee80211_ht_updateparams_final(struct ieee80211_node *ni, in ieee80211_ht_updateparams_final() argument
2015 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_ht_updateparams_final()
2028 if (ni->ni_ht2ndchan == IEEE80211_HTINFO_2NDCHAN_ABOVE) in ieee80211_ht_updateparams_final()
2030 else if (ni->ni_ht2ndchan == IEEE80211_HTINFO_2NDCHAN_BELOW) in ieee80211_ht_updateparams_final()
2039 vhtflags = ieee80211_vht_get_vhtflags(ni, htflags); in ieee80211_ht_updateparams_final()
2041 if (htinfo_update_chw(ni, htflags, vhtflags)) in ieee80211_ht_updateparams_final()
2054 ieee80211_ht_updatehtcap(struct ieee80211_node *ni, const uint8_t *htcapie) in ieee80211_ht_updatehtcap() argument
2056 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_ht_updatehtcap()
2058 ieee80211_parse_htcap(ni, htcapie); in ieee80211_ht_updatehtcap()
2060 htcap_update_mimo_ps(ni); in ieee80211_ht_updatehtcap()
2061 htcap_update_shortgi(ni); in ieee80211_ht_updatehtcap()
2062 htcap_update_ldpc(ni); in ieee80211_ht_updatehtcap()
2071 ieee80211_ht_updatehtcap_final(struct ieee80211_node *ni) in ieee80211_ht_updatehtcap_final() argument
2073 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_ht_updatehtcap_final()
2081 if ((ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40) && in ieee80211_ht_updatehtcap_final()
2093 vhtflags = ieee80211_vht_get_vhtflags(ni, htflags); in ieee80211_ht_updatehtcap_final()
2095 (void) htinfo_update_chw(ni, htflags, vhtflags); in ieee80211_ht_updatehtcap_final()
2102 ieee80211_setup_htrates(struct ieee80211_node *ni, const uint8_t *ie, int flags) in ieee80211_setup_htrates() argument
2104 struct ieee80211com *ic = ni->ni_ic; in ieee80211_setup_htrates()
2105 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_setup_htrates()
2121 rs = &ni->ni_htrates; in ieee80211_setup_htrates()
2132 IEEE80211_MSG_XRATE | IEEE80211_MSG_11N, ni, in ieee80211_setup_htrates()
2148 return ieee80211_fix_rate(ni, (struct ieee80211_rateset *) rs, flags); in ieee80211_setup_htrates()
2156 ieee80211_setup_basic_htrates(struct ieee80211_node *ni, const uint8_t *ie) in ieee80211_setup_basic_htrates() argument
2165 rs = &ni->ni_htrates; in ieee80211_setup_basic_htrates()
2167 IEEE80211_NOTE(ni->ni_vap, in ieee80211_setup_basic_htrates()
2168 IEEE80211_MSG_XRATE | IEEE80211_MSG_11N, ni, in ieee80211_setup_basic_htrates()
2192 struct ieee80211_node *ni = tap->txa_ni; in ampdu_tx_stop() local
2193 struct ieee80211com *ic = ni->ni_ic; in ampdu_tx_stop()
2208 ic->ic_addba_stop(ni, tap); in ampdu_tx_stop()
2233 struct ieee80211_node *ni = tap->txa_ni; in addba_timeout() local
2234 struct ieee80211com *ic = ni->ni_ic; in addba_timeout()
2239 ic->ic_addba_response_timeout(ni, tap); in addba_timeout()
2263 null_addba_response_timeout(struct ieee80211_node *ni, in null_addba_response_timeout() argument
2274 ieee80211_addba_request(struct ieee80211_node *ni, in ieee80211_addba_request() argument
2295 ieee80211_ampdu_tx_request_ext(struct ieee80211_node *ni, int tid) in ieee80211_ampdu_tx_request_ext() argument
2301 tap = &ni->ni_tx_ampdu[tid]; in ieee80211_ampdu_tx_request_ext()
2318 ieee80211_ampdu_tx_request_active_ext(struct ieee80211_node *ni, int tid, in ieee80211_ampdu_tx_request_active_ext() argument
2325 tap = &ni->ni_tx_ampdu[tid]; in ieee80211_ampdu_tx_request_active_ext()
2345 ieee80211_addba_response(struct ieee80211_node *ni, in ieee80211_addba_response() argument
2349 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_addba_response()
2366 (ni->ni_flags & IEEE80211_NODE_AMSDU_TX) && in ieee80211_addba_response()
2383 ieee80211_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap) in ieee80211_addba_stop() argument
2401 ht_recv_action_ba_addba_request(struct ieee80211_node *ni, in ht_recv_action_ba_addba_request() argument
2405 struct ieee80211com *ic = ni->ni_ic; in ht_recv_action_ba_addba_request()
2406 struct ieee80211vap *vap = ni->ni_vap; in ht_recv_action_ba_addba_request()
2420 IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, in ht_recv_action_ba_addba_request()
2430 rap = &ni->ni_rx_ampdu[tid]; in ht_recv_action_ba_addba_request()
2439 if ((ni->ni_flags & IEEE80211_NODE_AMPDU_RX) && in ht_recv_action_ba_addba_request()
2442 ic->ic_ampdu_rx_start(ni, rap, in ht_recv_action_ba_addba_request()
2448 ni, "reject ADDBA request: %s", in ht_recv_action_ba_addba_request()
2449 ni->ni_flags & IEEE80211_NODE_AMPDU_RX ? in ht_recv_action_ba_addba_request()
2466 (ni->ni_flags & IEEE80211_NODE_AMSDU_RX) && in ht_recv_action_ba_addba_request()
2472 ic->ic_send_action(ni, IEEE80211_ACTION_CAT_BA, in ht_recv_action_ba_addba_request()
2478 ht_recv_action_ba_addba_response(struct ieee80211_node *ni, in ht_recv_action_ba_addba_response() argument
2482 struct ieee80211com *ic = ni->ni_ic; in ht_recv_action_ba_addba_response()
2483 struct ieee80211vap *vap = ni->ni_vap; in ht_recv_action_ba_addba_response()
2503 tap = &ni->ni_tx_ampdu[tid]; in ht_recv_action_ba_addba_response()
2507 ni->ni_macaddr, "ADDBA response", in ht_recv_action_ba_addba_response()
2516 ni->ni_macaddr, "ADDBA response", in ht_recv_action_ba_addba_response()
2527 ni->ni_macaddr, "ADDBA response", in ht_recv_action_ba_addba_response()
2540 ni->ni_macaddr, "ADDBA response", in ht_recv_action_ba_addba_response()
2549 IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, in ht_recv_action_ba_addba_response()
2556 ic->ic_addba_response(ni, tap, code, baparamset, batimeout); in ht_recv_action_ba_addba_response()
2561 ht_recv_action_ba_delba(struct ieee80211_node *ni, in ht_recv_action_ba_delba() argument
2565 struct ieee80211com *ic = ni->ni_ic; in ht_recv_action_ba_delba()
2581 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, in ht_recv_action_ba_delba()
2587 tap = &ni->ni_tx_ampdu[tid]; in ht_recv_action_ba_delba()
2588 ic->ic_addba_stop(ni, tap); in ht_recv_action_ba_delba()
2590 rap = &ni->ni_rx_ampdu[tid]; in ht_recv_action_ba_delba()
2591 ic->ic_ampdu_rx_stop(ni, rap); in ht_recv_action_ba_delba()
2597 ht_recv_action_ht_txchwidth(struct ieee80211_node *ni, in ht_recv_action_ht_txchwidth() argument
2604 if ((ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40) == 0) in ht_recv_action_ht_txchwidth()
2610 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, in ht_recv_action_ht_txchwidth()
2612 __func__, chw, IEEE80211_NI_CHW_BITS, ni->ni_chw != chw ? "*" : ""); in ht_recv_action_ht_txchwidth()
2613 if (chw != ni->ni_chw) { in ht_recv_action_ht_txchwidth()
2615 ni->ni_chw = chw; in ht_recv_action_ht_txchwidth()
2622 ht_recv_action_ht_mimopwrsave(struct ieee80211_node *ni, in ht_recv_action_ht_mimopwrsave() argument
2631 ni->ni_flags |= IEEE80211_NODE_MIMO_PS; in ht_recv_action_ht_mimopwrsave()
2633 ni->ni_flags &= ~IEEE80211_NODE_MIMO_PS; in ht_recv_action_ht_mimopwrsave()
2635 ni->ni_flags |= IEEE80211_NODE_MIMO_RTS; in ht_recv_action_ht_mimopwrsave()
2637 ni->ni_flags &= ~IEEE80211_NODE_MIMO_RTS; in ht_recv_action_ht_mimopwrsave()
2639 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, in ht_recv_action_ht_mimopwrsave()
2641 (ni->ni_flags & IEEE80211_NODE_MIMO_PS) ? "on" : "off", in ht_recv_action_ht_mimopwrsave()
2642 (ni->ni_flags & IEEE80211_NODE_MIMO_RTS) ? "+rts" : "" in ht_recv_action_ht_mimopwrsave()
2660 ieee80211_ampdu_enable(struct ieee80211_node *ni, in ieee80211_ampdu_enable() argument
2663 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_ampdu_enable()
2678 IEEE80211_NOTE(vap, IEEE80211_MSG_11N, ni, in ieee80211_ampdu_enable()
2691 ieee80211_ampdu_request(struct ieee80211_node *ni, in ieee80211_ampdu_request() argument
2694 struct ieee80211com *ic = ni->ni_ic; in ieee80211_ampdu_request()
2713 tap->txa_start = ni->ni_txseqs[tid]; in ieee80211_ampdu_request()
2724 if ((ni->ni_flags & IEEE80211_NODE_AMSDU_TX) && in ieee80211_ampdu_request()
2725 (ni->ni_vap->iv_htcaps & IEEE80211_HTC_TX_AMSDU_AMPDU)) in ieee80211_ampdu_request()
2730 if (!ic->ic_addba_request(ni, tap, dialogtoken, args[2], args[3])) { in ieee80211_ampdu_request()
2732 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, in ieee80211_ampdu_request()
2733 ni, "%s: could not setup BA stream for TID %d AC %d", in ieee80211_ampdu_request()
2747 return ic->ic_send_action(ni, IEEE80211_ACTION_CAT_BA, in ieee80211_ampdu_request()
2756 ieee80211_ampdu_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, in ieee80211_ampdu_stop() argument
2759 struct ieee80211com *ic = ni->ni_ic; in ieee80211_ampdu_stop()
2760 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_ampdu_stop()
2767 ni, "%s: stop BA stream for TID %d (reason: %d (%s))", in ieee80211_ampdu_stop()
2772 ic->ic_addba_stop(ni, tap); in ieee80211_ampdu_stop()
2776 ic->ic_send_action(ni, IEEE80211_ACTION_CAT_BA, in ieee80211_ampdu_stop()
2780 ni, "%s: BA stream for TID %d not running " in ieee80211_ampdu_stop()
2794 struct ieee80211_node *ni = tap->txa_ni; in bar_timeout() local
2799 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, in bar_timeout()
2800 ni, "%s: tid %u flags 0x%x attempts %d", __func__, in bar_timeout()
2808 struct ieee80211com *ic = ni->ni_ic; in bar_timeout()
2810 ni->ni_vap->iv_stats.is_ampdu_bar_tx_fail++; in bar_timeout()
2819 ic->ic_bar_response(ni, tap, 1); in bar_timeout()
2820 ieee80211_ampdu_stop(ni, tap, IEEE80211_REASON_TIMEOUT); in bar_timeout()
2822 ni->ni_vap->iv_stats.is_ampdu_bar_tx_retry++; in bar_timeout()
2823 if (ieee80211_send_bar(ni, tap, tap->txa_seqpending) != 0) { in bar_timeout()
2824 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, in bar_timeout()
2825 ni, "%s: failed to TX, starting timer\n", in bar_timeout()
2863 bar_tx_complete(struct ieee80211_node *ni, void *arg, int status) in bar_tx_complete() argument
2867 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, in bar_tx_complete()
2868 ni, "%s: tid %u flags 0x%x pending %d status %d", in bar_tx_complete()
2872 ni->ni_vap->iv_stats.is_ampdu_bar_tx++; in bar_tx_complete()
2876 struct ieee80211com *ic = ni->ni_ic; in bar_tx_complete()
2880 ic->ic_bar_response(ni, tap, status); in bar_tx_complete()
2886 ieee80211_bar_response(struct ieee80211_node *ni, in ieee80211_bar_response() argument
2895 IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, in ieee80211_bar_response()
2896 ni, "BAR moves BA win <%u:%u> (%u frames) txseq %u tid %u", in ieee80211_bar_response()
2916 ieee80211_send_bar(struct ieee80211_node *ni, in ieee80211_send_bar() argument
2920 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_send_bar()
2921 struct ieee80211com *ic = ni->ni_ic; in ieee80211_send_bar()
2941 ieee80211_ref_node(ni); in ieee80211_send_bar()
2957 IEEE80211_ADDR_COPY(bar->i_ra, ni->ni_macaddr); in ieee80211_send_bar()
2974 IEEE80211_NODE_STAT(ni, tx_mgmt); /* XXX tx_ctl? */ in ieee80211_send_bar()
2986 ni, "send BAR: tid %u ctl 0x%x start %u (attempt %d)", in ieee80211_send_bar()
2994 ret = ieee80211_raw_output(vap, ni, m, NULL); in ieee80211_send_bar()
2998 ni, "send BAR: failed: (ret = %d)\n", in ieee80211_send_bar()
3015 ieee80211_free_node(ni); in ieee80211_send_bar()
3021 ht_action_output(struct ieee80211_node *ni, struct mbuf *m) in ht_action_output() argument
3027 params.ibp_rate0 = ni->ni_txparms->mgmtrate; in ht_action_output()
3029 params.ibp_try0 = ni->ni_txparms->maxretry; in ht_action_output()
3030 params.ibp_power = ni->ni_txpower; in ht_action_output()
3031 return ieee80211_mgmt_output(ni, m, IEEE80211_FC0_SUBTYPE_ACTION, in ht_action_output()
3047 ht_send_action_ba_addba(struct ieee80211_node *ni, in ht_send_action_ba_addba() argument
3050 struct ieee80211vap *vap = ni->ni_vap; in ht_send_action_ba_addba()
3051 struct ieee80211com *ic = ni->ni_ic; in ht_send_action_ba_addba()
3056 IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, in ht_send_action_ba_addba()
3067 ni, ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)+1); in ht_send_action_ba_addba()
3068 ieee80211_ref_node(ni); in ht_send_action_ba_addba()
3087 return ht_action_output(ni, m); in ht_send_action_ba_addba()
3090 ieee80211_free_node(ni); in ht_send_action_ba_addba()
3096 ht_send_action_ba_delba(struct ieee80211_node *ni, in ht_send_action_ba_delba() argument
3099 struct ieee80211vap *vap = ni->ni_vap; in ht_send_action_ba_delba()
3100 struct ieee80211com *ic = ni->ni_ic; in ht_send_action_ba_delba()
3109 IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, in ht_send_action_ba_delba()
3115 ni, ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)+1); in ht_send_action_ba_delba()
3116 ieee80211_ref_node(ni); in ht_send_action_ba_delba()
3130 return ht_action_output(ni, m); in ht_send_action_ba_delba()
3133 ieee80211_free_node(ni); in ht_send_action_ba_delba()
3139 ht_send_action_ht_txchwidth(struct ieee80211_node *ni, in ht_send_action_ht_txchwidth() argument
3142 struct ieee80211vap *vap = ni->ni_vap; in ht_send_action_ht_txchwidth()
3143 struct ieee80211com *ic = ni->ni_ic; in ht_send_action_ht_txchwidth()
3147 IEEE80211_NOTE(vap, IEEE80211_MSG_ACTION | IEEE80211_MSG_11N, ni, in ht_send_action_ht_txchwidth()
3149 IEEE80211_IS_CHAN_HT40(ni->ni_chan) ? 40 : 20); in ht_send_action_ht_txchwidth()
3153 ni, ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)+1); in ht_send_action_ht_txchwidth()
3154 ieee80211_ref_node(ni); in ht_send_action_ht_txchwidth()
3165 *frm++ = IEEE80211_IS_CHAN_HT40(ni->ni_chan) ? in ht_send_action_ht_txchwidth()
3169 return ht_action_output(ni, m); in ht_send_action_ht_txchwidth()
3172 ieee80211_free_node(ni); in ht_send_action_ht_txchwidth()
3228 ieee80211_add_htcap_body(uint8_t *frm, struct ieee80211_node *ni) in ieee80211_add_htcap_body() argument
3235 struct ieee80211com *ic = ni->ni_ic; in ieee80211_add_htcap_body()
3236 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_add_htcap_body()
3258 rxmax = _IEEE80211_MASKSHIFT(ni->ni_htparam, in ieee80211_add_htcap_body()
3260 density = _IEEE80211_MASKSHIFT(ni->ni_htparam, in ieee80211_add_htcap_body()
3290 if (ni->ni_chan != IEEE80211_CHAN_ANYC && in ieee80211_add_htcap_body()
3291 findhtchan(ic, ni->ni_chan, IEEE80211_CHAN_HT40U) == NULL && in ieee80211_add_htcap_body()
3292 findhtchan(ic, ni->ni_chan, IEEE80211_CHAN_HT40D) == NULL) in ieee80211_add_htcap_body()
3296 if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) in ieee80211_add_htcap_body()
3340 ieee80211_set_mcsset(ni->ni_ic, frm); in ieee80211_add_htcap_body()
3361 ieee80211_add_htcap(uint8_t *frm, struct ieee80211_node *ni) in ieee80211_add_htcap() argument
3365 return ieee80211_add_htcap_body(frm + 2, ni); in ieee80211_add_htcap()
3463 ieee80211_add_htcap_vendor(uint8_t *frm, struct ieee80211_node *ni) in ieee80211_add_htcap_vendor() argument
3471 return ieee80211_add_htcap_body(frm + 6, ni); in ieee80211_add_htcap_vendor()
3501 struct ieee80211_node *ni; in ieee80211_ht_update_beacon() local
3507 ni = ieee80211_ref_node(vap->iv_bss); in ieee80211_ht_update_beacon()
3508 bsschan = ni->ni_chan; in ieee80211_ht_update_beacon()
3534 ieee80211_free_node(ni); in ieee80211_ht_update_beacon()
3548 ieee80211_add_htinfo_body(uint8_t *frm, struct ieee80211_node *ni) in ieee80211_add_htinfo_body() argument
3550 struct ieee80211vap *vap = ni->ni_vap; in ieee80211_add_htinfo_body()
3551 struct ieee80211com *ic = ni->ni_ic; in ieee80211_add_htinfo_body()
3557 *frm++ = ieee80211_chan2ieee(ic, ni->ni_chan); in ieee80211_add_htinfo_body()
3563 if (IEEE80211_IS_CHAN_HT40U(ni->ni_chan)) in ieee80211_add_htinfo_body()
3565 else if (IEEE80211_IS_CHAN_HT40D(ni->ni_chan)) in ieee80211_add_htinfo_body()
3569 if (IEEE80211_IS_CHAN_HT40(ni->ni_chan)) in ieee80211_add_htinfo_body()
3581 ieee80211_set_basic_htrates(frm, &ni->ni_htrates); in ieee80211_add_htinfo_body()
3591 ieee80211_add_htinfo(uint8_t *frm, struct ieee80211_node *ni) in ieee80211_add_htinfo() argument
3595 return ieee80211_add_htinfo_body(frm + 2, ni); in ieee80211_add_htinfo()
3603 ieee80211_add_htinfo_vendor(uint8_t *frm, struct ieee80211_node *ni) in ieee80211_add_htinfo_vendor() argument
3611 return ieee80211_add_htinfo_body(frm + 6, ni); in ieee80211_add_htinfo_vendor()
3622 ieee80211_ht_get_node_ampdu_density(const struct ieee80211_node *ni) in ieee80211_ht_get_node_ampdu_density() argument
3627 vap = ni->ni_vap; in ieee80211_ht_get_node_ampdu_density()
3629 _IEEE80211_MASKSHIFT(ni->ni_htparam, IEEE80211_HTCAP_MPDUDENSITY); in ieee80211_ht_get_node_ampdu_density()
3643 ieee80211_ht_get_node_ampdu_limit(const struct ieee80211_node *ni) in ieee80211_ht_get_node_ampdu_limit() argument
3648 vap = ni->ni_vap; in ieee80211_ht_get_node_ampdu_limit()
3650 _IEEE80211_MASKSHIFT(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU); in ieee80211_ht_get_node_ampdu_limit()
3663 ieee80211_ht_check_tx_shortgi_20(const struct ieee80211_node *ni) in ieee80211_ht_check_tx_shortgi_20() argument
3668 if (! ieee80211_ht_check_tx_ht(ni)) in ieee80211_ht_check_tx_shortgi_20()
3671 vap = ni->ni_vap; in ieee80211_ht_check_tx_shortgi_20()
3672 ic = ni->ni_ic; in ieee80211_ht_check_tx_shortgi_20()
3675 (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) && in ieee80211_ht_check_tx_shortgi_20()
3687 ieee80211_ht_check_tx_shortgi_40(const struct ieee80211_node *ni) in ieee80211_ht_check_tx_shortgi_40() argument
3692 if (! ieee80211_ht_check_tx_ht40(ni)) in ieee80211_ht_check_tx_shortgi_40()
3695 vap = ni->ni_vap; in ieee80211_ht_check_tx_shortgi_40()
3696 ic = ni->ni_ic; in ieee80211_ht_check_tx_shortgi_40()
3699 (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI40) && in ieee80211_ht_check_tx_shortgi_40()
3710 ieee80211_ht_check_tx_ht(const struct ieee80211_node *ni) in ieee80211_ht_check_tx_ht() argument
3715 if (ni == NULL || ni->ni_chan == IEEE80211_CHAN_ANYC || in ieee80211_ht_check_tx_ht()
3716 ni->ni_vap == NULL || ni->ni_vap->iv_bss == NULL) in ieee80211_ht_check_tx_ht()
3719 vap = ni->ni_vap; in ieee80211_ht_check_tx_ht()
3725 if (IEEE80211_IS_CHAN_HT(ni->ni_chan) && in ieee80211_ht_check_tx_ht()
3726 ni->ni_htrates.rs_nrates == 0) in ieee80211_ht_check_tx_ht()
3728 return (IEEE80211_IS_CHAN_HT(ni->ni_chan)); in ieee80211_ht_check_tx_ht()
3738 ieee80211_ht_check_tx_ht40(const struct ieee80211_node *ni) in ieee80211_ht_check_tx_ht40() argument
3743 if (! ieee80211_ht_check_tx_ht(ni)) in ieee80211_ht_check_tx_ht40()
3746 vap = ni->ni_vap; in ieee80211_ht_check_tx_ht40()
3750 IEEE80211_IS_CHAN_HT40(ni->ni_chan) && in ieee80211_ht_check_tx_ht40()
3751 (ni->ni_chw == IEEE80211_STA_RX_BW_40)); in ieee80211_ht_check_tx_ht40()