aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2025-04-14 18:27:28 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2025-09-02 11:04:28 +0000
commit0533923acf22d4f308590b651aacd17441f4a9b8 (patch)
tree64344e5f116b08f497e232d2c23da62284ac504f
parent405cfeef615f5493b49b6ab4619fa29dfe37fd7d (diff)
LinuxKPI: 802.11: use IEEE80211_FEXT_AMPDU_OFFLOAD
Set IEEE80211_FEXT_AMPDU_OFFLOAD if the driver/firmware does AMPDU[-TX] offload and net80211 should stay out of the way. Later use IEEE80211_CONF_AMPDU_OFFLOAD() (the IEEE80211_FEXT_AMPDU_OFFLOAD net80211 flag) rather than the LinuxKPI check to clear AMPDU-RX if we do not support crypto offload. This may seem odd at first as AMPDU-RX is mandatory but we would not be able to get anything working if we would let net80211 do a (*ic_ampdu_rx_start)() call. Some of this is neccessary until we have the code for all drivers (rtw8x use further interfaces) sorted. Sponsored by: The FreeBSD Foundation (originally) MFC after: 3 days Fixes: ac2c7271b7c26
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 87390145a296..4cf9053f053b 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -4059,13 +4059,9 @@ lkpi_ic_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ],
* Modern chipset/fw/drv will do A-MPDU in drv/fw and fail
* to do so if they cannot do the crypto too.
*/
- if (!lkpi_hwcrypto && ieee80211_hw_check(hw, AMPDU_AGGREGATION))
+ if (!lkpi_hwcrypto && IEEE80211_CONF_AMPDU_OFFLOAD(ic))
vap->iv_flags_ht &= ~IEEE80211_FHT_AMPDU_RX;
#endif
-#if defined(LKPI_80211_HT)
- /* 20250125-BZ Keep A-MPDU TX cleared until we sorted out AddBA for all drivers. */
- vap->iv_flags_ht &= ~IEEE80211_FHT_AMPDU_TX;
-#endif
if (hw->max_listen_interval == 0)
hw->max_listen_interval = 7 * (ic->ic_lintval / ic->ic_bintval);
@@ -6609,6 +6605,14 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw)
if (ieee80211_hw_check(hw, SUPPORTS_TX_FRAG))
ic->ic_flags_ext |= IEEE80211_FEXT_FRAG_OFFLOAD;
+ /* Does HW support full AMPDU[-TX] offload? */
+ if (ieee80211_hw_check(hw, AMPDU_AGGREGATION))
+ ic->ic_flags_ext |= IEEE80211_FEXT_AMPDU_OFFLOAD;
+#ifdef __notyet__
+ if (ieee80211_hw_check(hw, TX_AMSDU))
+ if (ieee80211_hw_check(hw, SUPPORTS_AMSDU_IN_AMPDU))
+#endif
+
/*
* The wiphy variables report bitmasks of avail antennas.
* (*get_antenna) get the current bitmask sets which can be