41#include <sys/kernel.h>
42#include <sys/malloc.h>
44#include <sys/endian.h>
46#include <sys/socket.h>
49#include <net/if_var.h>
50#include <net/if_media.h>
51#include <net/ethernet.h>
63 { 104, 116, 216, 240 },
64 { 117, 130, 243, 270 },
65 { 130, 144, 270, 300 },
69 { 104, 116, 216, 240 },
70 { 156, 173, 324, 360 },
71 { 208, 231, 432, 480 },
72 { 234, 260, 486, 540 },
73 { 260, 289, 540, 600 },
76 { 117, 130, 243, 270 },
77 { 156, 173, 324, 360 },
78 { 234, 260, 486, 540 },
79 { 312, 347, 648, 720 },
80 { 351, 390, 729, 810 },
81 { 390, 433, 810, 900 },
83 { 104, 116, 216, 240 },
84 { 156, 173, 324, 360 },
85 { 208, 231, 432, 480 },
86 { 312, 347, 648, 720 },
87 { 416, 462, 864, 960 },
88 { 468, 520, 972, 1080 },
89 { 520, 578, 1080, 1200 },
92 { 104, 116, 216, 240 },
93 { 130, 144, 270, 300 },
94 { 117, 130, 243, 270 },
95 { 156, 173, 324, 360 },
96 { 195, 217, 405, 450 },
97 { 104, 116, 216, 240 },
98 { 130, 144, 270, 300 },
99 { 130, 144, 270, 300 },
100 { 156, 173, 324, 360 },
101 { 182, 202, 378, 420 },
102 { 182, 202, 378, 420 },
103 { 208, 231, 432, 480 },
104 { 156, 173, 324, 360 },
105 { 195, 217, 405, 450 },
106 { 195, 217, 405, 450 },
107 { 234, 260, 486, 540 },
108 { 273, 303, 567, 630 },
109 { 273, 303, 567, 630 },
110 { 312, 347, 648, 720 },
111 { 130, 144, 270, 300 },
112 { 156, 173, 324, 360 },
113 { 182, 202, 378, 420 },
114 { 156, 173, 324, 360 },
115 { 182, 202, 378, 420 },
116 { 208, 231, 432, 480 },
117 { 234, 260, 486, 540 },
118 { 208, 231, 432, 480 },
119 { 234, 260, 486, 540 },
120 { 260, 289, 540, 600 },
121 { 260, 289, 540, 600 },
122 { 286, 318, 594, 660 },
123 { 195, 217, 405, 450 },
124 { 234, 260, 486, 540 },
125 { 273, 303, 567, 630 },
126 { 234, 260, 486, 540 },
127 { 273, 303, 567, 630 },
128 { 312, 347, 648, 720 },
129 { 351, 390, 729, 810 },
130 { 312, 347, 648, 720 },
131 { 351, 390, 729, 810 },
132 { 390, 433, 810, 900 },
133 { 390, 433, 810, 900 },
134 { 429, 477, 891, 990 },
139 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
141 "AMPDU max reorder age (ms)");
145 0,
"BAR frame processing (ena/dis)");
149 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
151 "ADDBA request timeout (ms)");
154 CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT,
156 "ADDBA request backoff (ms)");
213 int dialogtoken,
int baparamset,
int batimeout);
216 int code,
int baparamset,
int batimeout);
227 int baparamset,
int batimeout,
int baseqctl);
328 if (IFM_SUBTYPE(mword) != IFM_IEEE80211_MCS)
382 ic_printf(ic,
"MCS %d-%d: %d%sMbps - %d%sMbps\n",
384 minrate/2, ((minrate & 0x1) != 0 ?
".5" :
""),
388 minrate/2, ((minrate & 0x1) != 0 ?
".5" :
""));
398 ic_printf(ic,
"%s MCS 20MHz\n", modestr);
401 ic_printf(ic,
"%s MCS 20MHz SGI\n", modestr);
405 ic_printf(ic,
"%s MCS 40MHz:\n", modestr);
410 ic_printf(ic,
"%s MCS 40MHz SGI:\n", modestr);
431#define ADDRATE(x) do { \
432 htrateset->rs_rates[htrateset->rs_nrates] = x; \
433 htrateset->rs_nrates++; \
446 for (i = 33; i <= 38; i++)
450 for (i = 39; i <= 52; i++)
454 for (i = 53; i <= 76; i++)
478 m_adj(m,
sizeof(
struct ether_header));
492 ni->
ni_macaddr,
"a-msdu",
"%s",
"decap failed");
496 if (m->m_pkthdr.len == framelen)
498 n = m_split(m, framelen, M_NOWAIT);
502 "%s",
"unable to split encapsulated frames");
514 m_adj(m, roundup2(framelen, 4) - framelen);
525 while (mbufq_len(&rap->
rxa_mq[i]) != 0) {
526 m = mbufq_dequeue(&rap->
rxa_mq[i]);
575 if (mbufq_len(&rap->
rxa_mq[off]) != 0) {
588 if ((rxs != NULL) && (rxs_final != NULL) &&
605 if ((mbufq_len(&rap->
rxa_mq[off]) == 0) || (toss_dup == 0)) {
606 if (mbufq_enqueue(&rap->
rxa_mq[off], m) != 0) {
610 "seqno %u tid %u BA win <%u:%u> off=%d, qlen=%d, maxqlen=%d",
614 mbufq_len(&rap->
rxa_mq[off]),
615 rap->
rxa_mq[off].mq_maxlen);
638 "seqno %u tid %u BA win <%u:%u>",
645 "seqno %d tid %u pktflags 0x%08x\n",
648 if (rxs_final != NULL) {
652 "final: pktflags 0x%08x\n",
672 for (i = 0; i < rap->
rxa_wnd; i++) {
678 (
"lost %u data, %u frames on ampdu rx q",
689 memset(rap, 0,
sizeof(*rap));
691 mbufq_init(&rap->
rxa_mq[i], 256);
699 int baparamset,
int batimeout,
int baseqctl)
763 "%s: tid=%d, start=%d, wnd=%d, flags=0x%08x",
820 while (mbufq_len(&rap->
rxa_mq[i]) != 0) {
821 m = mbufq_dequeue(&rap->
rxa_mq[i]);
846 for (j = i+1; j < rap->
rxa_wnd; j++) {
851 if (mbufq_len(&rap->
rxa_mq[j]) != 0) {
852 n = n - mbufq_len(&rap->
rxa_mq[j]);
854 KASSERT(n >= 0, (
"%s: n < 0 (%d)", __func__, n));
859 KASSERT(n == 0, (
"%s: lost %d frames, qframes %d off %d "
860 "BA win <%d:%d> winstart %d",
884 for (i = 1; i < rap->
rxa_wnd; i++) {
902 "%s: moved slot up %d slots to start at %d (%d frames)",
917 for (i = 0; i < rap->
rxa_wnd; i++) {
924 "%s: moved slot up %d slots to start at %d (%d frames)",
956 for (i = 0; i < rap->
rxa_wnd; i++) {
957 if ((r = mbufq_len(&rap->
rxa_mq[i])) != 0) {
967 "%s: moved slot up %d slots to start at %d (%d frames)",
1017 (
"!a-mpdu or already re-ordered, flags 0x%x", m->m_flags));
1048 rxseq = le16toh(*(uint16_t *)wh->
i_seq);
1055 "A-MPDU",
"fragment, rxseq 0x%x tid %u%s", rxseq, tid,
1071 rap->
rxa_flags &= ~IEEE80211_AGGR_WAITRX;
1083 KASSERT((mbufq_len(&rap->
rxa_mq[0]) == 0), (
"unexpected dup"));
1183 "move BA win <%u:%u> (%u frames) rxseq %u tid %u",
1208 "MPDU",
"BA win <%u:%u> (%u frames) rxseq %u tid %u%s",
1239 ni->
ni_macaddr,
"BAR",
"%s",
"processing disabled");
1254 ni->
ni_macaddr,
"BAR",
"no BA stream, tid %u", tid);
1270 "BAR moves BA win <%u:%u> (%u frames) rxseq %u tid %u",
1292 "BAR",
"BA win <%u:%u> (%u frames) rxseq %u tid %u%s",
1327 "%s: calling cleanup (%p)",
1370 ni->
ni_flags &= ~IEEE80211_NODE_HT_ALL;
1531 "HT bss occupancy change: %d sta, %d ht, "
1532 "%d ht40%s, HT protmode now 0x%x"
1537 ", non-HT sta present" :
""
1626#define OPMODE(x) _IEEE80211_SHIFTMASK(x, IEEE80211_HTINFO_OPMODE)
1631 (
"protmode 0x%x", protmode));
1663 "%s",
"time out non-HT STA present on channel");
1684 ni->
ni_flags &= ~IEEE80211_NODE_HTCOMPAT;
1770 "no HT40 channel (freq %u), falling back to HT20",
1786 "not HT; skipping VHT check (%u/0x%x)",
1804 "%s: VHT; chanwidth=0x%02x; vhtflags=0x%08x",
1810 "%s: VHT; trying lookup for %d/0x%08x",
1816 if (c != NULL && c != ni->
ni_chan) {
1819 "switch station to %s%d channel %u/0x%x",
1850 ni->
ni_flags &= ~IEEE80211_NODE_MIMO_RTS;
1854 ni->
ni_flags &= ~IEEE80211_NODE_MIMO_PS;
1855 ni->
ni_flags &= ~IEEE80211_NODE_MIMO_RTS;
1904 const uint8_t *htcapie,
const uint8_t *htinfoie)
1929 ni->
ni_flags &= ~IEEE80211_NODE_RIFS;
1936 uint32_t vhtflags = 0;
2017 const uint8_t *htcapie,
const uint8_t *htinfoie)
2021 int htflags, vhtflags;
2112 int i, maxequalmcs, maxunequalmcs;
2126 memset(rs, 0,
sizeof(*rs));
2137 "WARNING, HT rate set too large; only "
2142 if (i <= 31 && i > maxequalmcs)
2147 if (i > 32 && i > maxunequalmcs)
2173 "%s",
"WARNING, empty HT rate set");
2241 tap->
txa_flags &= ~IEEE80211_AGGR_XCHGPEND;
2262 tap->
txa_flags &= ~IEEE80211_AGGR_XCHGPEND;
2280 int dialogtoken,
int baparamset,
int batimeout)
2288 tap->
txa_wnd = (bufsiz == 0) ?
2303 if (tid < 0 || tid > 15)
2327 if (tid < 0 || tid > 15)
2351 int status,
int baparamset,
int batimeout)
2361 tap->
txa_wnd = (bufsiz == 0) ?
2374 tap->
txa_flags &= ~IEEE80211_AGGR_AMSDU;
2407 const uint8_t *frm,
const uint8_t *efrm)
2412 uint8_t dialogtoken;
2413 uint16_t baparamset, batimeout, baseqctl;
2417 dialogtoken = frm[2];
2418 baparamset = le16dec(frm+3);
2419 batimeout = le16dec(frm+5);
2420 baseqctl = le16dec(frm+7);
2425 "recv ADDBA request: dialogtoken %u baparamset 0x%x "
2426 "(tid %d bufsiz %d) batimeout %d baseqctl %d:%d amsdu %d",
2427 dialogtoken, baparamset,
2437 args[0] = dialogtoken;
2447 baparamset, batimeout, baseqctl);
2452 ni,
"reject ADDBA request: %s",
2454 "administratively disabled" :
2455 "not negotiated for station");
2484 const uint8_t *frm,
const uint8_t *efrm)
2489 uint8_t dialogtoken, policy;
2490 uint16_t baparamset, batimeout, code;
2492#ifdef IEEE80211_DEBUG
2496 dialogtoken = frm[2];
2497 code = le16dec(frm+3);
2498 baparamset = le16dec(frm+5);
2500#ifdef IEEE80211_DEBUG
2505 batimeout = le16dec(frm+7);
2512 "no pending ADDBA, tid %d dialogtoken %u "
2513 "code %d", tid, dialogtoken, code);
2521 "dialogtoken mismatch: waiting for %d, "
2522 "received %d, tid %d code %d",
2523 tap->
txa_token, dialogtoken, tid, code);
2532 "policy mismatch: expecting %s, "
2533 "received %s, tid %d code %d",
2545 "BA window too large: max %d, "
2546 "received %d, tid %d code %d",
2548 vap->
iv_stats.is_addba_badbawinsize++;
2554 "recv ADDBA response: dialogtoken %u code %d "
2555 "baparamset 0x%x (tid %d bufsiz %d amsdu %d) batimeout %d",
2556 dialogtoken, code, baparamset, tid,
2567 const uint8_t *frm,
const uint8_t *efrm)
2572 uint16_t baparamset;
2573#ifdef IEEE80211_DEBUG
2578 baparamset = le16dec(frm+2);
2579#ifdef IEEE80211_DEBUG
2580 code = le16dec(frm+4);
2586 "recv DELBA: baparamset 0x%x (tid %d initiator %d) "
2587 "code %d", baparamset, tid,
2603 const uint8_t *frm,
const uint8_t *efrm)
2610 "%s: HT txchwidth, width %d%s",
2611 __func__, chw, ni->
ni_chw != chw ?
"*" :
"");
2623 const uint8_t *frm,
const uint8_t *efrm)
2632 ni->
ni_flags &= ~IEEE80211_NODE_MIMO_PS;
2636 ni->
ni_flags &= ~IEEE80211_NODE_MIMO_RTS;
2639 "%s: HT MIMO PS (%s%s)", __func__,
2678 "enable AMPDU on tid %d (%s), avgpps %d pkts %d attempt %d",
2695 int tid, dialogtoken;
2696 static int tokens = 0;
2706 dialogtoken = (tokens+1) % 63;
2714 args[0] = dialogtoken;
2732 ni,
"%s: could not setup BA stream for TID %d AC %d",
2741 tokens = dialogtoken;
2763 tap->
txa_flags &= ~IEEE80211_AGGR_BARPEND;
2766 ni,
"%s: stop BA stream for TID %d (reason: %d (%s))",
2767 __func__, tap->
txa_tid, reason,
2779 ni,
"%s: BA stream for TID %d not running "
2780 "(reason: %d (%s))", __func__, tap->
txa_tid, reason,
2796 (
"bar/addba collision, flags 0x%x", tap->
txa_flags));
2799 ni,
"%s: tid %u flags 0x%x attempts %d", __func__,
2824 ni,
"%s: failed to TX, starting timer\n",
2867 ni,
"%s: tid %u flags 0x%x pending %d status %d",
2869 callout_pending(&tap->
txa_timer), status);
2895 ni,
"BAR moves BA win <%u:%u> (%u frames) txseq %u tid %u",
2903 tap->
txa_flags &= ~IEEE80211_AGGR_BARPEND;
2918#define senderr(_x, _v) do { vap->iv_stats._v++; ret = _x; goto bad; } while (0)
2923 uint16_t barctl, barseqctl;
2967 bar->
i_ctl = htole16(barctl);
2968 bar->
i_seq = htole16(barseqctl);
2985 ni,
"send BAR: tid %u ctl 0x%x start %u (attempt %d)",
2997 ni,
"send BAR: failed: (ret = %d)\n",
3000 tap->
txa_flags &= ~IEEE80211_AGGR_BARPEND;
3024 memset(¶ms, 0,
sizeof(params));
3034#define ADDSHORT(frm, v) do { \
3035 frm[0] = (v) & 0xff; \
3036 frm[1] = (v) >> 8; \
3047 int category,
int action,
void *arg0)
3051 uint16_t *args = arg0;
3056 "send ADDBA %s: dialogtoken %d status %d "
3057 "baparamset 0x%x (tid %d amsdu %d) batimeout 0x%x baseqctl 0x%x",
3059 "request" :
"response", args[0], args[1], args[2],
3065 "ieee80211_ref_node (%s:%u) %p<%s> refcnt %d\n", __func__, __LINE__,
3085 m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *);
3096 int category,
int action,
void *arg0)
3100 uint16_t *args = arg0;
3102 uint16_t baparamset;
3109 "send DELBA action: tid %d, initiator %d reason %d (%s)",
3113 "ieee80211_ref_node (%s:%u) %p<%s> refcnt %d\n", __func__, __LINE__,
3128 m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *);
3139 int category,
int action,
void *arg0)
3147 "send HT txchwidth: width %d",
3151 "ieee80211_ref_node (%s:%u) %p<%s> refcnt %d\n", __func__, __LINE__,
3167 m->m_pkthdr.len = m->m_len = frm - mtod(m, uint8_t *);
3188 (
"ic_rxstream %d out of range", ic->
ic_rxstream));
3190 (
"ic_txstream %d out of range", ic->
ic_txstream));
3199 for (i = 33; i <= 38; i++)
3203 for (i = 39; i <= 52; i++)
3207 for (i = 53; i <= 76; i++)
3229#define ADDSHORT(frm, v) do { \
3230 frm[0] = (v) & 0xff; \
3231 frm[1] = (v) >> 8; \
3236 uint16_t caps, extcaps;
3254 caps &= ~IEEE80211_HTCAP_CHWIDTH40;
3263 "%s: advertised rxmax=%d, density=%d, vap rxmax=%d, density=%d\n",
3292 caps &= ~IEEE80211_HTCAP_CHWIDTH40;
3298 caps &= ~IEEE80211_HTCAP_CHWIDTH40;
3307 caps &= ~IEEE80211_HTCAP_SHORTGI20;
3310 caps &= ~IEEE80211_HTCAP_SHORTGI40;
3314 caps &= ~IEEE80211_HTCAP_RXSTBC;
3318 caps &= ~IEEE80211_HTCAP_LDPC;
3375#define ADDSHORT(frm, v) do { \
3376 frm[0] = (v) & 0xff; \
3377 frm[1] = (v) >> 8; \
3381 uint16_t caps, extcaps;
3397 caps &= ~IEEE80211_HTCAP_CHWIDTH40;
3405 caps &= ~IEEE80211_HTCAP_SHORTGI20;
3408 caps &= ~IEEE80211_HTCAP_SHORTGI40;
3466 frm[2] = (
BCM_OUI >> 0) & 0xff;
3467 frm[3] = (
BCM_OUI >> 8) & 0xff;
3468 frm[4] = (
BCM_OUI >> 16) & 0xff;
3499#define PROTMODE (IEEE80211_HTINFO_OPMODE|IEEE80211_HTINFO_NONHT_PRESENT)
3606 frm[2] = (
BCM_OUI >> 0) & 0xff;
3607 frm[3] = (
BCM_OUI >> 8) & 0xff;
3608 frm[4] = (
BCM_OUI >> 16) & 0xff;
#define IEEE80211_CHAN_HT40
#define IEEE80211_CHAN_VHT160
#define IEEE80211_HTC_RX_AMSDU_AMPDU
#define IEEE80211_IS_CHAN_HT(_c)
#define IEEE80211_HTC_TXLDPC
#define IEEE80211_CHAN_VHT40D
#define IEEE80211_HTC_TX_AMSDU_AMPDU
#define IEEE80211_CHAN_HT
#define IEEE80211_CHAN_HT40D
#define IEEE80211_HTC_RXMCS32
#define IEEE80211_CHAN_VHT40U
#define IEEE80211_IS_CHAN_VHT80(_c)
#define IEEE80211_HTC_AMPDU
#define IEEE80211_CHAN_VHT20
#define IEEE80211_HTC_RIFS
#define IEEE80211_CHAN_VHT80P80
#define IEEE80211_CHAN_VHT80
#define IEEE80211_CHAN_ANYC
#define IEEE80211_IS_CHAN_HT40D(_c)
#define IEEE80211_HTC_SMPS
#define IEEE80211_HTC_AMSDU
#define IEEE80211_CHAN_VHT
#define IEEE80211_CHAN_HT40U
#define IEEE80211_IS_CHAN_HT40(_c)
#define IEEE80211_IS_CHAN_VHT(_c)
#define IEEE80211_HTC_TXMCS32
#define IEEE80211_HTC_TXUNEQUAL
#define IEEE80211_HTRATE_MAXSIZE
#define IEEE80211_HTC_RXUNEQUAL
#define IEEE80211_CHAN_HT20
#define IEEE80211_RATE_MCS
#define IEEE80211_IS_CHAN_HT20(_c)
#define IEEE80211_IS_CHAN_HT40U(_c)
int ic_printf(struct ieee80211com *ic, const char *fmt,...)
int ieee80211_chan2ieee(struct ieee80211com *ic, const struct ieee80211_channel *c)
int ieee80211_rate2media(struct ieee80211com *ic, int rate, enum ieee80211_phymode mode)
struct ieee80211_channel * ieee80211_find_channel(struct ieee80211com *ic, int freq, int flags)
const char * ieee80211_phymode_name[IEEE80211_MODE_MAX]
#define IEEE80211_VHT_CHANWIDTH_USE_HT
#define IEEE80211_FC0_SUBTYPE_ACTION
#define IEEE80211_ACTION_CAT_BA
#define IEEE80211_FC1_RETRY
#define IEEE80211_HTINFO_RIFSMODE_PERM
#define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK
#define IEEE80211_FC0_TYPE_CTL
#define IEEE80211_SEQ_SEQ_SHIFT
#define IEEE80211_VHT_CHANWIDTH_80P80MHZ
#define IEEE80211_HTCAP_SMPS_ENA
#define IEEE80211_VHT_CHANWIDTH_160MHZ
#define IEEE80211_BAPS_AMSDU
#define IEEE80211_ACTION_CAT_HT
#define IEEE80211_BAPS_POLICY_IMMEDIATE
#define IEEE80211_DELBAPS_INIT
#define IEEE80211_HTCAP_MAXAMSDU
#define IEEE80211_HTCAP_MAXRXAMPDU
#define IEEE80211_HTCAP_LDPC
#define IEEE80211_SEQ_INC(seq)
#define IEEE80211_HTINFO_OPMODE_MIXED
#define IEEE80211_HTCAP_CHWIDTH40
#define IEEE80211_ACTION_HT_MIMOPWRSAVE
#define IEEE80211_HTCAP_SHORTGI20
#define IEEE80211_HTCAP_SMPS_OFF
#define IEEE80211_BAR_NOACK
#define IEEE80211_RATE_VAL
#define IEEE80211_VHT_CHANWIDTH_80MHZ
#define IEEE80211_SEQ_FRAG_MASK
#define IEEE80211_HTCAP_MPDUDENSITY_NA
#define IEEE80211_FC0_SUBTYPE_BAR
#define IEEE80211_ACTION_BA_ADDBA_RESPONSE
#define IEEE80211_ACTION_HT_TXCHWIDTH
#define IEEE80211_RATE_BASIC
#define IEEE80211_HTINFO_RIFSMODE_PROH
#define IEEE80211_HTINFO_TXWIDTH_2040
#define IEEE80211_HTINFO_NONHT_PRESENT
#define IEEE80211_IS_MULTICAST(_a)
#define IEEE80211_A_HT_TXCHWIDTH_20
#define IEEE80211_SEQ_ADD(seq, incr)
#define IEEE80211_HTCAP_TXSTBC
#define IEEE80211_ACTION_BA_ADDBA_REQUEST
#define IEEE80211_BAPS_BUFSIZ
#define IEEE80211_DELBAPS_TID
#define IEEE80211_HTCAP_SMPS
#define TID_TO_WME_AC(_tid)
#define IEEE80211_A_HT_MIMOPWRSAVE_ENA
#define IEEE80211_HTINFO_2NDCHAN_NONE
#define IEEE80211_BAR_SEQ_START
#define IEEE80211_HTINFO_2NDCHAN_ABOVE
#define IEEE80211_FC0_VERSION_0
#define IEEE80211_BAPS_TID
#define IEEE80211_A_HT_MIMOPWRSAVE_MODE
#define IEEE80211_ACTION_BA_DELBA
#define IEEE80211_HTINFO_OPMODE_PURE
#define IEEE80211_HTINFO_2NDCHAN
#define IEEE80211_BAR_TID
#define IEEE80211_A_HT_TXCHWIDTH_2040
#define IEEE80211_HTCAP_RXSTBC
#define IEEE80211_HTCAP_MAXRXAMPDU_8K
#define IEEE80211_SEQ_BA_RANGE
#define IEEE80211_BASEQ_START
@ IEEE80211_REASON_TIMEOUT
@ IEEE80211_STATUS_UNSPECIFIED
@ IEEE80211_STATUS_SUCCESS
#define IEEE80211_FC0_QOSDATA
@ IEEE80211_ELEMID_VENDOR
@ IEEE80211_ELEMID_HTINFO
#define IEEE80211_HTCAP_SMPS_DYNAMIC
#define IEEE80211_HTCAP_MPDUDENSITY
#define IEEE80211_SEQ_SUB(a, b)
#define IEEE80211_HTINFO_OPMODE
#define IEEE80211_HTINFO_OPMODE_HT20PR
#define IEEE80211_BAPS_POLICY
#define IEEE80211_QOS_TID
#define IEEE80211_BAR_COMP
#define IEEE80211_SEQ_BA_BEFORE(a, b)
#define IEEE80211_BASEQ_FRAG
#define IEEE80211_HTINFO_BASIC_STBCMCS
#define IEEE80211_HTINFO_OPMODE_PROTOPT
#define IEEE80211_HTCAP_SHORTGI40
#define IEEE80211_HTINFO_2NDCHAN_BELOW
int ieee80211_send_action(struct ieee80211_node *ni, int cat, int act, void *sa)
int ieee80211_recv_action_register(int cat, int act, ieee80211_recv_action_func *f)
int ieee80211_recv_action(struct ieee80211_node *ni, const struct ieee80211_frame *wh, const uint8_t *frm, const uint8_t *efrm)
int ieee80211_send_action_register(int cat, int act, ieee80211_send_action_func *f)
int ieee80211_recv_action_func(struct ieee80211_node *, const struct ieee80211_frame *, const uint8_t *, const uint8_t *)
int ieee80211_send_action_func(struct ieee80211_node *, int, int, void *)
int ieee80211_sysctl_msecs_ticks(SYSCTL_HANDLER_ARGS)
struct mbuf * ieee80211_getmgtframe(uint8_t **frm, int headroom, int pktlen)
int ieee80211_add_callback(struct mbuf *m, void(*func)(struct ieee80211_node *, void *, int), void *arg)
const struct ieee80211_rx_stats * ieee80211_get_rx_params_ptr(struct mbuf *m)
#define ieee80211_time_after(a, b)
#define msecs_to_ticks(ms)
#define IEEE80211_TX_LOCK(_ic)
#define IEEE80211_UNLOCK(_ic)
#define M_WME_SETAC(m, ac)
#define ieee80211_node_refcnt(_ni)
#define IEEE80211_LOCK_ASSERT(_ic)
#define IEEE80211_TX_UNLOCK(_ic)
#define IEEE80211_LOCK(_ic)
static int ieee80211_addba_backoff
static __inline int htcap_update_mimo_ps(struct ieee80211_node *ni)
struct ieee80211_channel * ieee80211_ht_adjust_channel(struct ieee80211com *ic, struct ieee80211_channel *chan, int flags)
void ieee80211_parse_htcap(struct ieee80211_node *ni, const uint8_t *ie)
void ieee80211_recv_bar(struct ieee80211_node *ni, struct mbuf *m0)
static __inline void htcap_update_ldpc(struct ieee80211_node *ni)
static int ieee80211_addba_maxtries
void ieee80211_ht_updatehtcap(struct ieee80211_node *ni, const uint8_t *htcapie)
static void htinfo_parse(struct ieee80211_node *ni, const struct ieee80211_ie_htinfo *htinfo)
static void ampdu_tx_setup(struct ieee80211_tx_ampdu *tap)
static void null_addba_response_timeout(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
int ieee80211_ht_updateparams_final(struct ieee80211_node *ni, const uint8_t *htcapie, const uint8_t *htinfoie)
static void bar_stop_timer(struct ieee80211_tx_ampdu *tap)
void ieee80211_ht_announce(struct ieee80211com *ic)
static void bar_timeout(void *arg)
static uint8_t * ieee80211_add_htcap_body(uint8_t *frm, struct ieee80211_node *ni)
static void htinfo_update(struct ieee80211vap *vap)
void ieee80211_htprot_update(struct ieee80211vap *vap, int protmode)
void ieee80211_ht_update_beacon(struct ieee80211vap *vap, struct ieee80211_beacon_offsets *bo)
static int ieee80211_ampdu_enable(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
static void ieee80211_ht_init(void)
uint8_t * ieee80211_add_htinfo_vendor(uint8_t *frm, struct ieee80211_node *ni)
static void ampdu_tx_stop(struct ieee80211_tx_ampdu *tap)
SYSINIT(wlan_ht, SI_SUB_DRIVERS, SI_ORDER_FIRST, ieee80211_ht_init, NULL)
static void ampdu_rx_stop(struct ieee80211_node *, struct ieee80211_rx_ampdu *)
static void ieee80211_addba_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
static ieee80211_recv_action_func ht_recv_action_ba_addba_request
void ieee80211_ht_node_age(struct ieee80211_node *ni)
static struct ieee80211_channel * findhtchan(struct ieee80211com *ic, struct ieee80211_channel *c, int htflags)
static struct printranges ranges[]
void ieee80211_ht_detach(struct ieee80211com *ic)
SYSCTL_PROC(_net_wlan, OID_AUTO, ampdu_age, CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_NEEDGIANT, &ieee80211_ampdu_age, 0, ieee80211_sysctl_msecs_ticks, "I", "AMPDU max reorder age (ms)")
static void ht_rateprint(struct ieee80211com *ic, enum ieee80211_phymode mode, int ratetype)
static ieee80211_recv_action_func ht_recv_action_ba_delba
static int ieee80211_addba_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int code, int baparamset, int batimeout)
int ieee80211_ampdu_tx_request_ext(struct ieee80211_node *ni, int tid)
static void ampdu_rx_flush_upto(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap, ieee80211_seq winstart)
static void ampdu_rx_flush(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap)
static void addba_stop_timeout(struct ieee80211_tx_ampdu *tap)
static uint32_t ieee80211_vht_get_vhtflags(struct ieee80211_node *ni, uint32_t htflags)
int ieee80211_send_bar(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, ieee80211_seq seq)
void ieee80211_ht_node_cleanup(struct ieee80211_node *ni)
static void ampdu_rx_dispatch(struct ieee80211_rx_ampdu *rap, struct ieee80211_node *ni)
static void addba_timeout(void *arg)
void ieee80211_parse_htinfo(struct ieee80211_node *ni, const uint8_t *ie)
static ieee80211_send_action_func ht_send_action_ba_addba
void ieee80211_htinfo_notify(struct ieee80211vap *vap)
static int ieee80211_recv_bar_ena
static uint8_t * ieee80211_add_htinfo_body(uint8_t *frm, struct ieee80211_node *ni)
uint8_t * ieee80211_add_htcap_vendor(uint8_t *frm, struct ieee80211_node *ni)
static void bar_start_timer(struct ieee80211_tx_ampdu *tap)
static __inline void ampdu_dispatch(struct ieee80211_node *ni, struct mbuf *m)
void ieee80211_ht_node_init(struct ieee80211_node *ni)
void ieee80211_ampdu_stop(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int reason)
int ieee80211_ampdu_reorder(struct ieee80211_node *ni, struct mbuf *m, const struct ieee80211_rx_stats *rxs)
static void ht_announce(struct ieee80211com *ic, enum ieee80211_phymode mode)
uint8_t * ieee80211_add_htcap(uint8_t *frm, struct ieee80211_node *ni)
static int ieee80211_bar_maxtries
void ieee80211_ht_attach(struct ieee80211com *ic)
static int ieee80211_addba_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int dialogtoken, int baparamset, int batimeout)
void ieee80211_ht_vattach(struct ieee80211vap *vap)
void ieee80211_ht_timeout(struct ieee80211vap *vap)
static void ieee80211_bar_response(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap, int status)
int ieee80211_setup_htrates(struct ieee80211_node *ni, const uint8_t *ie, int flags)
static void ieee80211_set_mcsset(struct ieee80211com *ic, uint8_t *frm)
int ieee80211_ampdu_tx_request_active_ext(struct ieee80211_node *ni, int tid, int status)
static __inline void htcap_update_shortgi(struct ieee80211_node *ni)
void ieee80211_init_suphtrates(struct ieee80211com *ic)
static void ampdu_rx_purge(struct ieee80211_rx_ampdu *rap)
static void ampdu_rx_moveup(struct ieee80211_rx_ampdu *rap, struct ieee80211_node *ni, int i, int winstart)
static int ampdu_dispatch_slot(struct ieee80211_rx_ampdu *rap, struct ieee80211_node *ni, int i)
void ieee80211_setup_basic_htrates(struct ieee80211_node *ni, const uint8_t *ie)
void ieee80211_ht_node_join(struct ieee80211_node *ni)
uint8_t * ieee80211_add_htcap_ch(uint8_t *frm, struct ieee80211vap *vap, struct ieee80211_channel *c)
int ieee80211_ampdu_request(struct ieee80211_node *ni, struct ieee80211_tx_ampdu *tap)
void ieee80211_ht_updatehtcap_final(struct ieee80211_node *ni)
const struct ieee80211_mcs_rates ieee80211_htrates[IEEE80211_HTRATE_MAXSIZE]
struct mbuf * ieee80211_decap_amsdu(struct ieee80211_node *ni, struct mbuf *m)
void ieee80211_ht_updateparams(struct ieee80211_node *ni, const uint8_t *htcapie, const uint8_t *htinfoie)
static int ht_getrate(struct ieee80211com *ic, int index, enum ieee80211_phymode mode, int ratetype)
uint8_t * ieee80211_add_htinfo(uint8_t *frm, struct ieee80211_node *ni)
static int htinfo_update_chw(struct ieee80211_node *ni, int htflags, int vhtflags)
static int ht_action_output(struct ieee80211_node *ni, struct mbuf *m)
static ieee80211_recv_action_func ht_recv_action_ht_mimopwrsave
static void ieee80211_set_basic_htrates(uint8_t *frm, const struct ieee80211_htrateset *rs)
static int ampdu_rx_start(struct ieee80211_node *, struct ieee80211_rx_ampdu *, int baparamset, int batimeout, int baseqctl)
void ieee80211_ht_vdetach(struct ieee80211vap *vap)
static void bar_tx_complete(struct ieee80211_node *ni, void *arg, int status)
void ieee80211_ht_wds_init(struct ieee80211_node *ni)
SYSCTL_INT(_net_wlan, OID_AUTO, recv_bar, CTLFLAG_RW, &ieee80211_recv_bar_ena, 0, "BAR frame processing (ena/dis)")
static ieee80211_recv_action_func ht_recv_action_ba_addba_response
int ieee80211_ampdu_rx_start_ext(struct ieee80211_node *ni, int tid, int seq, int baw)
static int ieee80211_bar_timeout
static ieee80211_send_action_func ht_send_action_ht_txchwidth
static ieee80211_send_action_func ht_send_action_ba_delba
static int ieee80211_addba_timeout
static ieee80211_recv_action_func ht_recv_action_ht_txchwidth
void ieee80211_ht_node_leave(struct ieee80211_node *ni)
static uint8_t * ieee80211_add_htcap_body_ch(uint8_t *frm, struct ieee80211vap *vap, struct ieee80211_channel *c)
static void ampdu_rx_purge_slot(struct ieee80211_rx_ampdu *rap, int i)
static void ieee80211_ampdu_rx_init_rap(struct ieee80211_node *ni, struct ieee80211_rx_ampdu *rap)
static int ieee80211_ampdu_age
static int ampdu_rx_add_slot(struct ieee80211_rx_ampdu *rap, int off, int tid, ieee80211_seq rxseq, struct ieee80211_node *ni, struct mbuf *m, const struct ieee80211_rx_stats *rxs)
static void addba_start_timeout(struct ieee80211_tx_ampdu *tap)
void ieee80211_ampdu_rx_stop_ext(struct ieee80211_node *ni, int tid)
#define IEEE80211_AGGR_BAWMAX
#define IEEE80211_AGGR_XCHGPEND
#define IEEE80211_AGGR_SETUP
#define IEEE80211_AMPDU_RUNNING(tap)
#define IEEE80211_NONHT_PRESENT_AGE
#define IEEE80211_AGGR_RUNNING
#define IEEE80211_AGGR_BARPEND
static __inline void ieee80211_txampdu_init_pps(struct ieee80211_tx_ampdu *tap)
#define IEEE80211_AGGR_IMMEDIATE
#define IEEE80211_AGGR_WAITRX
#define IEEE80211_AGGR_AMSDU
#define IEEE80211_AGGR_NAK
void ieee80211_free_node(struct ieee80211_node *ni)
#define IEEE80211_NODE_HTCOMPAT
#define IEEE80211_NODE_AMSDU_TX
#define IEEE80211_NODE_LDPC
#define IEEE80211_NODE_MIMO_RTS
#define IEEE80211_NODE_SGI40
#define IEEE80211_NODE_AMSDU
#define IEEE80211_NODE_STAT(ni, stat)
#define IEEE80211_NODE_SGI20
#define IEEE80211_NODE_MIMO_PS
#define IEEE80211_NODE_RIFS
static __inline struct ieee80211_node * ieee80211_ref_node(struct ieee80211_node *ni)
#define IEEE80211_NODE_AMPDU_RX
#define IEEE80211_NODE_AMPDU
#define IEEE80211_NODE_HT
#define IEEE80211_NODE_VHT
#define IEEE80211_NODE_AMSDU_RX
int ieee80211_mgmt_output(struct ieee80211_node *ni, struct mbuf *m, int type, struct ieee80211_bpf_params *params)
int ieee80211_raw_output(struct ieee80211vap *vap, struct ieee80211_node *ni, struct mbuf *m, const struct ieee80211_bpf_params *params)
const char * ieee80211_wme_acnames[]
const char * ieee80211_reason_to_string(uint16_t reason)
void ieee80211_vap_update_ht_protmode(struct ieee80211vap *vap)
int ieee80211_fix_rate(struct ieee80211_node *ni, struct ieee80211_rateset *nrs, int flags)
#define ieee80211_input(ni, m, rssi, nf)
@ IEEE80211_BEACON_HTINFO
static __inline uint8_t * ieee80211_getqos(void *data)
static int maxrate(const struct ieee80211_scan_entry *se)
static const u_int chanflags[IEEE80211_MODE_MAX]
#define IEEE80211_ADDR_COPY(dst, src)
#define IEEE80211_FVHT_USEVHT80
#define IEEE80211_CONF_VHT(ic)
#define IEEE80211_FHT_AMPDU_TX
#define IEEE80211_MSG_XRATE
#define _IEEE80211_MASKSHIFT(_v, _f)
#define IEEE80211_FHT_AMSDU_TX
#define IEEE80211_FHT_USEHT40
#define IEEE80211_MSG_ANY
#define _IEEE80211_SHIFTMASK(_v, _f)
static __inline int ieee80211_htchanflags(const struct ieee80211_channel *c)
#define IEEE80211_FEXT_WDSLEGACY
#define IEEE80211_FVHT_USEVHT80P80
#define IEEE80211_MSG_11N
#define IEEE80211_FHT_AMSDU_RX
#define IEEE80211_FVHT_USEVHT160
#define IEEE80211_MSG_NODE
#define IEEE80211_FVHT_USEVHT40
#define IEEE80211_FHT_NONHT_PR
#define IEEE80211_MSG_DEBUG
#define IEEE80211_NOTE(_vap, _m, _ni, _fmt,...)
#define IEEE80211_FHT_SHORTGI40
#define IEEE80211_FHT_LDPC_RX
#define IEEE80211_FVHT_VHT
#define IEEE80211_FHT_LDPC_TX
#define IEEE80211_DISCARD_MAC(_vap, _m, _mac, _type, _fmt,...)
#define IEEE80211_FHT_HTCOMPAT
#define IEEE80211_FHT_STBC_TX
#define IEEE80211_DPRINTF(_vap, _m, _fmt,...)
#define IEEE80211_MSG_INPUT
#define IEEE80211_FHT_AMPDU_RX
static __inline void ieee80211_beacon_notify(struct ieee80211vap *vap, int what)
#define IEEE80211_MSG_ACTION
#define IEEE80211_MSG_ASSOC
#define IEEE80211_FHT_SHORTGI20
#define IEEE80211_FHT_RIFS
#define IEEE80211_FHT_STBC_RX
uint8_t i_ta[IEEE80211_ADDR_LEN]
uint8_t i_ra[IEEE80211_ADDR_LEN]
uint8_t rs_rates[IEEE80211_HTRATE_MAXSIZE]
uint8_t hi_basicmcsset[16]
struct ieee80211com * ni_ic
uint8_t ni_macaddr[IEEE80211_ADDR_LEN]
struct ieee80211_htrateset ni_htrates
struct ieee80211_rx_ampdu ni_rx_ampdu[WME_NUM_TID]
struct ieee80211vap * ni_vap
const struct ieee80211_txparam * ni_txparms
struct ieee80211_tx_ampdu ni_tx_ampdu[WME_NUM_TID]
ieee80211_seq ni_txseqs[IEEE80211_TID_SIZE]
struct ieee80211_channel * ni_chan
uint8_t i_addr1[IEEE80211_ADDR_LEN]
struct mbufq rxa_mq[IEEE80211_AGGR_BAWMAX]
uint32_t is_ampdu_rx_drop
uint32_t is_addba_norequest
uint32_t is_ampdu_bar_bad
uint32_t is_addba_badpolicy
uint32_t is_ampdu_rx_move
uint32_t is_ampdu_stop_failed
uint32_t is_amsdu_tooshort
uint32_t is_ampdu_bar_move
uint32_t is_ampdu_bar_tx_fail
uint32_t is_ampdu_rx_copy
uint32_t is_addba_badtoken
uint32_t is_ampdu_bar_oow
uint32_t is_ampdu_bar_tx_retry
uint32_t is_ampdu_rx_reorder
struct ieee80211_node * txa_ni
ieee80211_seq txa_seqpending
struct ieee80211_channel * ic_bsschan
enum ieee80211_protmode ic_htprotmode
int(* ic_addba_request)(struct ieee80211_node *, struct ieee80211_tx_ampdu *, int dialogtoken, int baparamset, int batimeout)
void(* ic_ampdu_rx_stop)(struct ieee80211_node *, struct ieee80211_rx_ampdu *)
int(* ic_ampdu_rx_start)(struct ieee80211_node *, struct ieee80211_rx_ampdu *, int baparamset, int batimeout, int baseqctl)
void(* ic_bar_response)(struct ieee80211_node *, struct ieee80211_tx_ampdu *, int status)
struct ieee80211_htrateset ic_sup_htrates
int(* ic_recv_action)(struct ieee80211_node *, const struct ieee80211_frame *, const uint8_t *frm, const uint8_t *efrm)
uint8_t ic_modecaps[IEEE80211_MODE_BYTES]
int(* ic_ampdu_enable)(struct ieee80211_node *, struct ieee80211_tx_ampdu *)
int(* ic_send_action)(struct ieee80211_node *, int category, int action, void *)
void(* ic_addba_stop)(struct ieee80211_node *, struct ieee80211_tx_ampdu *)
void(* ic_addba_response_timeout)(struct ieee80211_node *, struct ieee80211_tx_ampdu *)
int(* ic_addba_response)(struct ieee80211_node *, struct ieee80211_tx_ampdu *, int status, int baparamset, int batimeout)
struct ieee80211com * iv_ic
struct ieee80211_node * iv_bss
enum ieee80211_opmode iv_opmode
uint8_t iv_myaddr[IEEE80211_ADDR_LEN]
struct ieee80211_stats iv_stats
enum ieee80211_state iv_state
uint16_t iv_ht40_sta_assoc
u_int iv_ampdu_mintraffic[WME_NUM_AC]
enum ieee80211_protmode iv_htprotmode
void(* iv_deliver_data)(struct ieee80211vap *, struct ieee80211_node *, struct mbuf *)