[openwrt/openwrt] mt76: fix compilation error with mt7915 and kernel >= 5.15.61

LEDE Commits lede-commits at lists.infradead.org
Sun Sep 25 07:08:45 PDT 2022


ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/6e9613844ca1ddea7e36abc44a513c89ef0598ff

commit 6e9613844ca1ddea7e36abc44a513c89ef0598ff
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Sun Sep 25 16:04:58 2022 +0200

    mt76: fix compilation error with mt7915 and kernel >= 5.15.61
    
    With kernel 5.15.61 the define IEEE80211_MAX_AMPDU_BUF got changed to
    IEEE80211_MAX_AMPDU_BUF_HE. Add patch to fix compilation error on next
    5.15 kernel versions.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 ...-fix-changed-IEEE80211_MAX_AMPDU_BUF-defi.patch | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/package/kernel/mt76/patches/0001-mt76-mt7915-fix-changed-IEEE80211_MAX_AMPDU_BUF-defi.patch b/package/kernel/mt76/patches/0001-mt76-mt7915-fix-changed-IEEE80211_MAX_AMPDU_BUF-defi.patch
new file mode 100644
index 0000000000..885c0aee04
--- /dev/null
+++ b/package/kernel/mt76/patches/0001-mt76-mt7915-fix-changed-IEEE80211_MAX_AMPDU_BUF-defi.patch
@@ -0,0 +1,38 @@
+From 2994307fe092a9627e12ad7cd9f32f4d36c201d8 Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth at gmail.com>
+Date: Sun, 25 Sep 2022 15:58:37 +0200
+Subject: [PATCH] mt76: mt7915: fix changed IEEE80211_MAX_AMPDU_BUF define in
+ new kernel
+
+New kernel use IEEE80211_MAX_AMPDU_BUF_HE instead of
+IEEE80211_MAX_AMPDU_BUF.
+This got backported to stable kernel 5.15.61 and cause compilation
+error.
+Add required ifdef to handle this changed define.
+
+Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
+---
+ mt7915/init.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/mt7915/init.c b/mt7915/init.c
+index 489f6e77..1813370a 100644
+--- a/mt7915/init.c
++++ b/mt7915/init.c
+@@ -327,8 +327,13 @@ mt7915_init_wiphy(struct ieee80211_hw *hw)
+ 	struct mt7915_dev *dev = phy->dev;
+ 
+ 	hw->queues = 4;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 61))
+ 	hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF;
+ 	hw->max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF;
++#else
++	hw->max_rx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE;
++	hw->max_tx_aggregation_subframes = IEEE80211_MAX_AMPDU_BUF_HE;
++#endif
+ 	hw->netdev_features = NETIF_F_RXCSUM;
+ 
+ 	hw->radiotap_timestamp.units_pos =
+-- 
+2.37.2
+




More information about the lede-commits mailing list