mac80211: remove outdated patches

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>
This commit is contained in:
Shiji Yang 2024-09-27 09:51:22 +08:00 committed by Felix Fietkau
parent f03163adc5
commit a4c95f1444
11 changed files with 12 additions and 158 deletions

View 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);
}

View 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);

View File

@ -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);

View 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 @@

View File

@ -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

View File

@ -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];

View File

@ -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.

View 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);

View 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,

View 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];

View File

@ -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 */