From 19d84827540b8102a70b046f21204d782fdd60e7 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Tue, 18 Jun 2024 15:08:48 -0400 Subject: [PATCH] ath11k_nss: Revert backport RX timestamp flags This patch is to revert patch introduced in '0134270319b4fa130f35eb012a736ec1d94b3f16' ("mac80211: backport RX timestamp flags patch") As it breaks compilation with NSS patch `Remove-unused-RX_FLAGS-from-mac80211_rx_flag`. The `unused rx flags` is needed since it fixes iwinfo rx/tx rate flags. This commit might be reverted until compatibility is worked out. For now, it's not needed on NSS builds, so revert it with a patch. Signed-off-by: Sean Khan --- package/kernel/mac80211/Makefile | 2 +- ...i-mac80211-rework-RX-timestamp-flags.patch | 139 ++++++++++++++++++ 2 files changed, 140 insertions(+), 1 deletion(-) create mode 100644 package/kernel/mac80211/patches/nss/subsys/000-Revert-100-v6.8-wifi-mac80211-rework-RX-timestamp-flags.patch diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 7e4f57b2ccb5d8..3505442c22addc 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 PKG_VERSION:=6.6.15 -PKG_RELEASE:=5 +PKG_RELEASE:=6 PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING diff --git a/package/kernel/mac80211/patches/nss/subsys/000-Revert-100-v6.8-wifi-mac80211-rework-RX-timestamp-flags.patch b/package/kernel/mac80211/patches/nss/subsys/000-Revert-100-v6.8-wifi-mac80211-rework-RX-timestamp-flags.patch new file mode 100644 index 00000000000000..d402ac95683710 --- /dev/null +++ b/package/kernel/mac80211/patches/nss/subsys/000-Revert-100-v6.8-wifi-mac80211-rework-RX-timestamp-flags.patch @@ -0,0 +1,139 @@ +--- b/drivers/net/wireless/ath/ath10k/htt_rx.c ++++ a/drivers/net/wireless/ath/ath10k/htt_rx.c +@@ -1294,7 +1294,7 @@ + status->encoding = RX_ENC_LEGACY; + status->bw = RATE_INFO_BW_20; + ++ status->flag &= ~RX_FLAG_MACTIME_END; +- status->flag &= ~RX_FLAG_MACTIME; + status->flag |= RX_FLAG_NO_SIGNAL_VAL; + + status->flag &= ~(RX_FLAG_AMPDU_IS_LAST); +--- b/include/net/mac80211.h ++++ a/include/net/mac80211.h +@@ -1352,9 +1352,6 @@ + * the frame. + * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on + * the frame. +- * @RX_FLAG_MACTIME: The timestamp passed in the RX status (@mactime +- * field) is valid if this field is non-zero, and the position +- * where the timestamp was sampled depends on the value. + * @RX_FLAG_MACTIME_START: The timestamp passed in the RX status (@mactime + * field) is valid and contains the time the first symbol of the MPDU + * was received. This is useful in monitor mode and for proper IBSS +@@ -1434,12 +1431,12 @@ + enum mac80211_rx_flags { + RX_FLAG_MMIC_ERROR = BIT(0), + RX_FLAG_DECRYPTED = BIT(1), ++ RX_FLAG_MACTIME_PLCP_START = BIT(2), +- RX_FLAG_ONLY_MONITOR = BIT(2), + RX_FLAG_MMIC_STRIPPED = BIT(3), + RX_FLAG_IV_STRIPPED = BIT(4), + RX_FLAG_FAILED_FCS_CRC = BIT(5), + RX_FLAG_FAILED_PLCP_CRC = BIT(6), ++ RX_FLAG_MACTIME_START = BIT(7), +- /* one free bit at 7 */ + RX_FLAG_NO_SIGNAL_VAL = BIT(8), + RX_FLAG_AMPDU_DETAILS = BIT(9), + RX_FLAG_PN_VALIDATED = BIT(10), +@@ -1448,10 +1445,8 @@ + RX_FLAG_AMPDU_IS_LAST = BIT(13), + RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(14), + RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(15), ++ RX_FLAG_MACTIME_END = BIT(16), ++ RX_FLAG_ONLY_MONITOR = BIT(17), +- RX_FLAG_MACTIME = BIT(16) | BIT(17), +- RX_FLAG_MACTIME_PLCP_START = 1 << 16, +- RX_FLAG_MACTIME_START = 2 << 16, +- RX_FLAG_MACTIME_END = 3 << 16, + RX_FLAG_SKIP_MONITOR = BIT(18), + RX_FLAG_AMSDU_MORE = BIT(19), + RX_FLAG_RADIOTAP_TLV_AT_END = BIT(20), +--- b/net/mac80211/ieee80211_i.h ++++ a/net/mac80211/ieee80211_i.h +@@ -1807,7 +1807,10 @@ + static inline bool + ieee80211_have_rx_timestamp(struct ieee80211_rx_status *status) + { ++ WARN_ON_ONCE(status->flag & RX_FLAG_MACTIME_START && ++ status->flag & RX_FLAG_MACTIME_END); ++ return !!(status->flag & (RX_FLAG_MACTIME_START | RX_FLAG_MACTIME_END | ++ RX_FLAG_MACTIME_PLCP_START)); +- return status->flag & RX_FLAG_MACTIME; + } + + void ieee80211_vif_inc_num_mcast(struct ieee80211_sub_if_data *sdata); +--- b/net/mac80211/util.c ++++ a/net/mac80211/util.c +@@ -4174,7 +4174,6 @@ + unsigned int mpdu_offset) + { + u64 ts = status->mactime; +- bool mactime_plcp_start; + struct rate_info ri; + u16 rate; + u8 n_ltf; +@@ -4182,9 +4181,6 @@ + if (WARN_ON(!ieee80211_have_rx_timestamp(status))) + return 0; + +- mactime_plcp_start = (status->flag & RX_FLAG_MACTIME) == +- RX_FLAG_MACTIME_PLCP_START; +- + memset(&ri, 0, sizeof(ri)); + + ri.bw = status->bw; +@@ -4199,7 +4195,7 @@ + if (status->enc_flags & RX_ENC_FLAG_SHORT_GI) + ri.flags |= RATE_INFO_FLAGS_SHORT_GI; + /* TODO/FIXME: is this right? handle other PPDUs */ ++ if (status->flag & RX_FLAG_MACTIME_PLCP_START) { +- if (mactime_plcp_start) { + mpdu_offset += 2; + ts += 36; + } +@@ -4216,7 +4212,7 @@ + * See P802.11ax_D6.0, section 27.3.4 for + * VHT PPDU format. + */ ++ if (status->flag & RX_FLAG_MACTIME_PLCP_START) { +- if (mactime_plcp_start) { + mpdu_offset += 2; + ts += 36; + +@@ -4240,7 +4236,7 @@ + * See P802.11REVmd_D3.0, section 19.3.2 for + * HT PPDU format. + */ ++ if (status->flag & RX_FLAG_MACTIME_PLCP_START) { +- if (mactime_plcp_start) { + mpdu_offset += 2; + if (status->enc_flags & RX_ENC_FLAG_HT_GF) + ts += 24; +@@ -4268,7 +4264,7 @@ + * See P802.11REVmd_D3.0, section 21.3.2 for + * VHT PPDU format. + */ ++ if (status->flag & RX_FLAG_MACTIME_PLCP_START) { +- if (mactime_plcp_start) { + mpdu_offset += 2; + ts += 36; + +@@ -4302,7 +4298,7 @@ + bitrate = sband->bitrates[status->rate_idx].bitrate; + ri.legacy = DIV_ROUND_UP(bitrate, (1 << shift)); + ++ if (status->flag & RX_FLAG_MACTIME_PLCP_START) { +- if (mactime_plcp_start) { + if (status->band == NL80211_BAND_5GHZ) { + ts += 20 << shift; + mpdu_offset += 2; +@@ -4324,7 +4320,7 @@ + return 0; + + /* rewind from end of MPDU */ ++ if (status->flag & RX_FLAG_MACTIME_END) +- if ((status->flag & RX_FLAG_MACTIME) == RX_FLAG_MACTIME_END) + ts -= mpdu_len * 8 * 10 / rate; + + ts += mpdu_offset * 8 * 10 / rate;