path: root/sys/net80211/ieee80211_ht.h
diff options
authorAdrian Chadd <adrian@FreeBSD.org>2020-06-05 07:38:10 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2020-06-05 07:38:10 +0000
commitebb9b256724793e0c2be54265daf5d45a0d48c88 (patch)
tree0d1ab2259bb6edf045ce069302e9b1b4d2f1ae31 /sys/net80211/ieee80211_ht.h
parentd20ff6e6805a5ad5b244b4e96e10ea824971a045 (diff)
[net80211] Add initial A-MSDU in A-MPDU negotation support.
This is hopefully a big no-op unless you're running some extra patches to flip on A-MSDU options in a driver. 802.11n supports sending A-MSDU in A-MPDU. That lets you do things like pack small frames into an A-MSDU and stuff /those/ into an A-MPDU. It allows for much more efficient airtime because you're not wasting time sending small frames - which is still a problem when doing A-MPDU as there's still per-frame overhead and minimum A-MPDU density requirements. It, however, is optional for 802.11n. A lot of stuff doesn't advertise it (but does it, just wait!); and I know that ath10k does it and my ath(4) driver work supports it. Now, 802.11ac makes A-MSDU in A-MPDU something that can happen more frequently, because even though you can send very large A-MPDUs (like 1 megabyte and larger) you still have the small frame problem. So, 802.11ac NICs like ath10k and iwm will support A-MSDU in A-MPDU out of the box if it's enabled - and you can negotiate it. So, let's lay down the ground work to enable A-MSDU in A-MPDU. This will allow hardware like iwn(4) and ath(4) which supports software A-MSDU but hardware A-MPDU to be more efficient. Drivers that support A-MSDU in A-MPDU will set TX/RX htcap flags. Note this is separate from the software A-MSDU encap path; /that/ dictates whether net80211 is doing A-MSDU encapsulation or not. These HTC flags control negotiation, NOT encapsulation. Once this negotiation and driver bits are done, hardware like rtwn(4), run(4), and others will be able to use A-MSDU even without A-MPDU working; right now FF and A-MSDU aren't even attempted if you're an 11n node. It's a small hold-over from the initial A-MPDU work and I know how to fix it, but to flip it on properly I need to be able to negotiate or ignore A-MSDU in A-MPDU. Oh and the fun part - some 11ac APs I've tested will quite happily decap A-MSDU in A-MPDU even though they don't negotiate it when doing 802.11n. So hey, I know it works - I just want to properly handle things. :-) Tested: * AR9380, STA/AP mode
Notes: svn path=/head/; revision=361825
Diffstat (limited to 'sys/net80211/ieee80211_ht.h')
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211_ht.h b/sys/net80211/ieee80211_ht.h
index 4e02cd3270ee..73cd22c1b9f1 100644
--- a/sys/net80211/ieee80211_ht.h
+++ b/sys/net80211/ieee80211_ht.h
@@ -47,6 +47,7 @@ struct ieee80211_tx_ampdu {
#define IEEE80211_AGGR_NAK 0x0010 /* peer NAK'd ADDBA request */
#define IEEE80211_AGGR_BARPEND 0x0020 /* BAR response pending */
#define IEEE80211_AGGR_WAITRX 0x0040 /* Wait for first RX frame to define BAW */
+#define IEEE80211_AGGR_AMSDU 0x0080 /* A-MSDU in A-MPDU TX allowed */
uint8_t txa_tid;
uint8_t txa_token; /* dialog token */
int txa_lastsample; /* ticks @ last traffic sample */
@@ -68,6 +69,14 @@ struct ieee80211_tx_ampdu {
#define IEEE80211_AMPDU_RUNNING(tap) \
(((tap)->txa_flags & IEEE80211_AGGR_RUNNING) != 0)
+ * Return non-zero if AMPDU tx for the TID is running and we can do
+ * A-MSDU in A-MPDU
+ */
+#define IEEE80211_AMPDU_RUNNING_AMSDU(tap) \
+ ((((tap)->txa_flags & (IEEE80211_AGGR_RUNNING | IEEE80211_AGGR_AMSDU)) \
/* return non-zero if AMPDU tx for the TID was NACKed */
#define IEEE80211_AMPDU_NACKED(tap)\
(!! ((tap)->txa_flags & IEEE80211_AGGR_NAK))