mac80211: remove outdated patches
authorShiji Yang <yangshiji66@qq.com>
Fri, 27 Sep 2024 01:51:22 +0000 (09:51 +0800)
committerFelix Fietkau <nbd@nbd.name>
Fri, 27 Sep 2024 06:19:19 +0000 (08:19 +0200)
The only supported kernel in the main branch now is version 6.6. It's
time to clean up these useless codes and patches.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch
package/kernel/mac80211/patches/ath9k/549-ath9k_enable_gpio_buttons.patch
package/kernel/mac80211/patches/build/110-backport_namepace_const.patch [deleted file]
package/kernel/mac80211/patches/build/120-headers_version_fix.patch
package/kernel/mac80211/patches/build/130-iommu_backport.patch [deleted file]
package/kernel/mac80211/patches/build/210-backport_genl_split_ops.patch [deleted file]
package/kernel/mac80211/patches/build/220-list-don-t-backport-list_count_nodes.patch [deleted file]
package/kernel/mac80211/patches/subsys/301-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch
package/kernel/mac80211/patches/subsys/330-mac80211-add-AQL-support-for-broadcast-packets.patch
package/kernel/mac80211/patches/subsys/780-avoid-crashing-missing-band.patch
package/kernel/mac80211/patches/subsys/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch [deleted file]

index bb0127b011c6f167bfd9724c2616f4390d56ed5a..9fb549cc19be26d6f55dd5b7d8c542e7e00ff143 100644 (file)
@@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #ifdef CPTCFG_ATH9K_DEBUGFS
 --- a/drivers/net/wireless/ath/ath9k/gpio.c
 +++ b/drivers/net/wireless/ath/ath9k/gpio.c
-@@ -16,13 +16,139 @@
+@@ -16,13 +16,135 @@
  
  #include "ath9k.h"
  #include <linux/ath9k_platform.h>
@@ -127,11 +127,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 +      snprintf(gc->label, sizeof(gc->label), "ath9k-%s",
 +               wiphy_name(sc->hw->wiphy));
 +#ifdef CONFIG_OF
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)
 +      gc->gchip.parent = sc->dev;
-+#else
-+      gc->gchip.dev = sc->dev;
-+#endif
 +#endif
 +      gc->gchip.label = gc->label;
 +      gc->gchip.base = -1;    /* determine base automatically */
@@ -187,7 +183,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  static void ath_fill_led_pin(struct ath_softc *sc)
  {
        struct ath_hw *ah = sc->sc_ah;
-@@ -80,6 +206,12 @@ static int ath_add_led(struct ath_softc
+@@ -80,6 +202,12 @@ static int ath_add_led(struct ath_softc
        else
                ath9k_hw_set_gpio(sc->sc_ah, gpio->gpio, gpio->active_low);
  
@@ -200,7 +196,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        return 0;
  }
  
-@@ -136,17 +268,24 @@ void ath_deinit_leds(struct ath_softc *s
+@@ -136,17 +264,24 @@ void ath_deinit_leds(struct ath_softc *s
  
        while (!list_empty(&sc->leds)) {
                led = list_first_entry(&sc->leds, struct ath_led, list);
@@ -225,7 +221,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        char led_name[32];
        const char *trigger;
        int i;
-@@ -156,6 +295,15 @@ void ath_init_leds(struct ath_softc *sc)
+@@ -156,6 +291,15 @@ void ath_init_leds(struct ath_softc *sc)
        if (AR_SREV_9100(sc->sc_ah))
                return;
  
@@ -241,7 +237,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        ath_fill_led_pin(sc);
  
        if (pdata && pdata->leds && pdata->num_leds)
-@@ -180,6 +328,7 @@ void ath_init_leds(struct ath_softc *sc)
+@@ -180,6 +324,7 @@ void ath_init_leds(struct ath_softc *sc)
        ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger,
                           !sc->sc_ah->config.led_active_high);
  }
index f8aed716f5e0bdfae056cde5c0e229ee062d9a7d..d164d8903149625a0dcb382b6c0de899f41283aa 100644 (file)
@@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
  #ifdef CPTCFG_MAC80211_LEDS
  
-@@ -133,6 +135,67 @@ static void ath9k_unregister_gpio_chip(s
+@@ -129,6 +131,67 @@ static void ath9k_unregister_gpio_chip(s
        sc->gpiochip = NULL;
  }
  
@@ -97,7 +97,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #else /* CONFIG_GPIOLIB */
  
  static inline void ath9k_register_gpio_chip(struct ath_softc *sc)
-@@ -143,6 +206,14 @@ static inline void ath9k_unregister_gpio
+@@ -139,6 +202,14 @@ static inline void ath9k_unregister_gpio
  {
  }
  
@@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #endif /* CONFIG_GPIOLIB */
  
  /********************************/
-@@ -266,6 +337,7 @@ void ath_deinit_leds(struct ath_softc *s
+@@ -262,6 +333,7 @@ void ath_deinit_leds(struct ath_softc *s
  {
        struct ath_led *led;
  
@@ -120,7 +120,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        while (!list_empty(&sc->leds)) {
                led = list_first_entry(&sc->leds, struct ath_led, list);
  #ifdef CONFIG_GPIOLIB
-@@ -305,6 +377,7 @@ void ath_init_leds(struct ath_softc *sc)
+@@ -301,6 +373,7 @@ void ath_init_leds(struct ath_softc *sc)
        }
  
        ath_fill_led_pin(sc);
diff --git a/package/kernel/mac80211/patches/build/110-backport_namepace_const.patch b/package/kernel/mac80211/patches/build/110-backport_namepace_const.patch
deleted file mode 100644 (file)
index 6dca708..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
---- a/net/wireless/sysfs.c
-+++ b/net/wireless/sysfs.c
-@@ -154,7 +154,11 @@ static SIMPLE_DEV_PM_OPS(wiphy_pm_ops, w
- #define WIPHY_PM_OPS NULL
- #endif
-+#if LINUX_VERSION_IS_GEQ(6,2,0)
- static const void *wiphy_namespace(const struct device *d)
-+#else
-+static const void *wiphy_namespace(struct device *d)
-+#endif
- {
-       struct wiphy *wiphy = container_of(d, struct wiphy, dev);
index 21cf0b3134ddc5319b211f44d7c9c7d43d97636a..29f500a4d069b4994bacb108bcb7fc836f238097 100644 (file)
@@ -1,14 +1,3 @@
---- a/backport-include/linux/random.h
-+++ b/backport-include/linux/random.h
-@@ -15,7 +15,7 @@ static inline u16 get_random_u16(void)
- }
- #endif
--#if LINUX_VERSION_IS_LESS(6,2,0)
-+#if LINUX_VERSION_IS_LESS(6,1,4)
- static inline u32 __get_random_u32_below(u32 ceil)
- {
-       /*
 --- a/backport-include/net/dropreason.h
 +++ b/backport-include/net/dropreason.h
 @@ -3,10 +3,9 @@
diff --git a/package/kernel/mac80211/patches/build/130-iommu_backport.patch b/package/kernel/mac80211/patches/build/130-iommu_backport.patch
deleted file mode 100644 (file)
index 2d3ef88..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
---- /dev/null
-+++ b/backport-include/linux/iommu.h
-@@ -0,0 +1,23 @@
-+#ifndef __BACKPORT_LINUX_IOMMU_H
-+#define __BACKPORT_LINUX_IOMMU_H
-+
-+#include_next <linux/iommu.h>
-+#include <linux/version.h>
-+
-+#if LINUX_VERSION_IS_LESS(6,3,0)
-+
-+static inline int LINUX_BACKPORT(iommu_map)(struct iommu_domain *domain,
-+                                          unsigned long iova,
-+                                          phys_addr_t paddr, size_t size,
-+                                          int prot, gfp_t gfp)
-+{
-+      if (gfp == GFP_ATOMIC)
-+              return iommu_map_atomic(domain, iova, paddr, size, prot);
-+
-+      return iommu_map(domain, iova, paddr, size, prot);
-+}
-+#define iommu_map LINUX_BACKPORT(iommu_map)
-+
-+#endif /* < 6.3 */
-+
-+#endif
diff --git a/package/kernel/mac80211/patches/build/210-backport_genl_split_ops.patch b/package/kernel/mac80211/patches/build/210-backport_genl_split_ops.patch
deleted file mode 100644 (file)
index 0898f33..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
---- a/net/wireless/nl80211.c
-+++ b/net/wireless/nl80211.c
-@@ -16529,9 +16529,14 @@ static u32 nl80211_internal_flags[] = {
- #undef SELECTOR
- };
-+#if LINUX_VERSION_IS_LESS(6,2,0)
-+static int nl80211_pre_doit(const struct genl_ops *ops, struct sk_buff *skb,
-+                          struct genl_info *info)
-+#else
- static int nl80211_pre_doit(const struct genl_split_ops *ops,
-                           struct sk_buff *skb,
-                           struct genl_info *info)
-+#endif
- {
-       struct cfg80211_registered_device *rdev = NULL;
-       struct wireless_dev *wdev = NULL;
-@@ -16631,9 +16636,14 @@ out_unlock:
-       return err;
- }
-+#if LINUX_VERSION_IS_LESS(6,2,0)
-+static void nl80211_post_doit(const struct genl_ops *ops, struct sk_buff *skb,
-+                            struct genl_info *info)
-+#else
- static void nl80211_post_doit(const struct genl_split_ops *ops,
-                             struct sk_buff *skb,
-                             struct genl_info *info)
-+#endif
- {
-       u32 internal_flags = nl80211_internal_flags[ops->internal_flags];
diff --git a/package/kernel/mac80211/patches/build/220-list-don-t-backport-list_count_nodes.patch b/package/kernel/mac80211/patches/build/220-list-don-t-backport-list_count_nodes.patch
deleted file mode 100644 (file)
index 6d30002..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
-Date: Fri, 15 Dec 2023 10:17:21 +0100
-Subject: [PATCH] list: don't backport list_count_nodes()
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-It's redundant in OpenWrt as it backports it on its own. This fixes:
-backport-include/linux/list.h:11:22: error: redefinition of 'list_count_nodes'
-
-Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
----
- backport-include/linux/list.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/backport-include/linux/list.h
-+++ b/backport-include/linux/list.h
-@@ -3,7 +3,7 @@
- #include_next <linux/list.h>
- #include <linux/version.h>
--#if LINUX_VERSION_IS_LESS(6,3,0)
-+#if 0 /* OpenWrt backports list_count_nodes() on its own */
- /**
-  * list_count_nodes - count nodes in the list
-  * @head:     the head for your list.
index d576661bd200244c523a606888f00cba619961e1..edec97cce94022d41459ca4c4112650b236dc29d 100644 (file)
@@ -28,15 +28,11 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
 
 --- a/net/mac80211/sta_info.c
 +++ b/net/mac80211/sta_info.c
-@@ -565,6 +565,11 @@ __sta_info_alloc(struct ieee80211_sub_if
+@@ -565,6 +565,7 @@ __sta_info_alloc(struct ieee80211_sub_if
        spin_lock_init(&sta->ps_lock);
        INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames);
        wiphy_work_init(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
-+#if LINUX_VERSION_IS_LESS(6,2,0)
-+      sta->ampdu_mlme.dialog_token_allocator = prandom_u32_max(U8_MAX);
-+#else
 +      sta->ampdu_mlme.dialog_token_allocator = get_random_u32_below(U8_MAX);
-+#endif
  #ifdef CPTCFG_MAC80211_MESH
        if (ieee80211_vif_is_mesh(&sdata->vif)) {
                sta->mesh = kzalloc(sizeof(*sta->mesh), gfp);
index 82fe546509fb0c4259937be3ef13b74a2fdbd1a8..3b6cba48e7150a5f9d38d17304a013c97634cd66 100644 (file)
@@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                spin_lock_init(&local->active_txq_lock[i]);
 --- a/net/mac80211/sta_info.c
 +++ b/net/mac80211/sta_info.c
-@@ -2357,13 +2357,28 @@ EXPORT_SYMBOL(ieee80211_sta_recalc_aggre
+@@ -2353,13 +2353,28 @@ EXPORT_SYMBOL(ieee80211_sta_recalc_aggre
  
  void ieee80211_sta_update_pending_airtime(struct ieee80211_local *local,
                                          struct sta_info *sta, u8 ac,
index e64ca1753bdac7afeaaebc8c5569862fcd5299e5..ae400b78a1a2be9900e2f50a0959132bf271da3b 100644 (file)
@@ -18,7 +18,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
 
 --- a/net/mac80211/sta_info.c
 +++ b/net/mac80211/sta_info.c
-@@ -2459,6 +2459,13 @@ static void sta_stats_decode_rate(struct
+@@ -2455,6 +2455,13 @@ static void sta_stats_decode_rate(struct
  
                sband = local->hw.wiphy->bands[band];
  
diff --git a/package/kernel/mac80211/patches/subsys/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch b/package/kernel/mac80211/patches/subsys/782-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch
deleted file mode 100644 (file)
index 26af6a2..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
---- a/backport-include/linux/of_net.h
-+++ /dev/null
-@@ -1,26 +0,0 @@
--#ifndef _BP_OF_NET_H
--#define _BP_OF_NET_H
--#include_next <linux/of_net.h>
--#include <linux/version.h>
--#include <linux/etherdevice.h>
--
--/* The behavior of of_get_mac_address() changed in kernel 5.2, it now
-- * returns an error code and not NULL in case of an error.
-- */
--#if LINUX_VERSION_IS_LESS(5,13,0)
--static inline int backport_of_get_mac_address(struct device_node *np, u8 *mac_out)
--{
--      const void *mac = of_get_mac_address(np);
--
--      if (!mac)
--              return -ENODEV;
--      if (IS_ERR(mac))
--              return PTR_ERR(mac);
--      ether_addr_copy(mac_out, mac);
--      
--      return 0;
--}
--#define of_get_mac_address LINUX_BACKPORT(of_get_mac_address)
--#endif /* < 5.2 */
--
--#endif /* _BP_OF_NET_H */