--- /dev/null
+--- a/net/wireless/core.c
++++ b/net/wireless/core.c
+@@ -165,11 +165,19 @@ int cfg80211_switch_netns(struct cfg8021
+ list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
+ if (!wdev->netdev)
+ continue;
++#if LINUX_VERSION_IS_LESS(6,12,0)
+ wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL;
++#else
++ wdev->netdev->netns_local = false;
++#endif
+ err = dev_change_net_namespace(wdev->netdev, net, "wlan%d");
+ if (err)
+ break;
++#if LINUX_VERSION_IS_LESS(6,12,0)
+ wdev->netdev->features |= NETIF_F_NETNS_LOCAL;
++#else
++ wdev->netdev->netns_local = true;
++#endif
+ }
+
+ if (err) {
+@@ -181,11 +189,19 @@ int cfg80211_switch_netns(struct cfg8021
+ list) {
+ if (!wdev->netdev)
+ continue;
++#if LINUX_VERSION_IS_LESS(6,12,0)
+ wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL;
++#else
++ wdev->netdev->netns_local = false;
++#endif
+ err = dev_change_net_namespace(wdev->netdev, net,
+ "wlan%d");
+ WARN_ON(err);
++#if LINUX_VERSION_IS_LESS(6,12,0)
+ wdev->netdev->features |= NETIF_F_NETNS_LOCAL;
++#else
++ wdev->netdev->netns_local = true;
++#endif
+ }
+
+ return err;
+@@ -1473,7 +1489,11 @@ static int cfg80211_netdev_notifier_call
+ SET_NETDEV_DEVTYPE(dev, &wiphy_type);
+ wdev->netdev = dev;
+ /* can only change netns with wiphy */
++#if LINUX_VERSION_IS_LESS(6,12,0)
+ dev->features |= NETIF_F_NETNS_LOCAL;
++#else
++ dev->netns_local = true;
++#endif
+
+ cfg80211_init_wdev(wdev);
+ break;
+--- a/backport-include/asm/unaligned.h
++++ b/backport-include/asm/unaligned.h
+@@ -1,6 +1,10 @@
+ #ifndef __BACKPORT_ASM_GENERIC_UNALIGNED_H
+ #define __BACKPORT_ASM_GENERIC_UNALIGNED_H
++#if LINUX_VERSION_IS_LESS(6,12,0)
+ #include_next <asm/unaligned.h>
++#else
++#include_next <linux/unaligned.h>
++#endif
+
+ #if LINUX_VERSION_IS_LESS(5,7,0)
+ static inline u32 __get_unaligned_be24(const u8 *p)
+--- a/net/mac80211/rc80211_minstrel_ht_debugfs.c
++++ b/net/mac80211/rc80211_minstrel_ht_debugfs.c
+@@ -187,7 +187,11 @@ static const struct file_operations mins
+ .open = minstrel_ht_stats_open,
+ .read = minstrel_stats_read,
+ .release = minstrel_stats_release,
++#if LINUX_VERSION_IS_LESS(6,12,0)
+ .llseek = no_llseek,
++#else
++ .llseek = noop_llseek,
++#endif
+ };
+
+ static char *
+@@ -323,7 +327,11 @@ static const struct file_operations mins
+ .open = minstrel_ht_stats_csv_open,
+ .read = minstrel_stats_read,
+ .release = minstrel_stats_release,
++#if LINUX_VERSION_IS_LESS(6,12,0)
+ .llseek = no_llseek,
++#else
++ .llseek = noop_llseek,
++#endif
+ };
+
+ void
--- /dev/null
+--- a/backport-include/linux/acpi_amd_wbrf.h
++++ b/backport-include/linux/acpi_amd_wbrf.h
+@@ -7,7 +7,7 @@
+ #ifndef _ACPI_AMD_WBRF_H
+ #define _ACPI_AMD_WBRF_H
+
+-#if LINUX_VERSION_IS_GEQ(6,8,0)
++#if LINUX_VERSION_IN_RANGE(6,8,0, 6,12,0)
+ #include_next <linux/acpi_amd_wbrf.h>
+ #else
+ #include <linux/device.h>
--- /dev/null
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+@@ -3768,7 +3768,11 @@ static int iwl_mvm_d3_test_release(struc
+ }
+
+ const struct file_operations iwl_dbgfs_d3_test_ops = {
++#if LINUX_VERSION_IS_LESS(6,12,0)
+ .llseek = no_llseek,
++#else
++ .llseek = noop_llseek,
++#endif
+ .open = iwl_mvm_d3_test_open,
+ .read = iwl_mvm_d3_test_read,
+ .release = iwl_mvm_d3_test_release,
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+@@ -1184,7 +1184,11 @@ static ssize_t bus_reset_write(struct fi
+
+ static const struct file_operations bus_reset_fops = {
+ .open = simple_open,
++#if LINUX_VERSION_IS_LESS(6,12,0)
+ .llseek = no_llseek,
++#else
++ .llseek = noop_llseek,
++#endif
+ .write = bus_reset_write,
+ };
+
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -305,6 +305,24 @@ static void rt2800_rf_write(struct rt2x0
+@@ -305,6 +305,28 @@ static void rt2800_rf_write(struct rt2x0
mutex_unlock(&rt2x00dev->csr_mutex);
}
++#if LINUX_VERSION_IS_LESS(6,12,0)
+void rt6352_enable_pa_pin(struct rt2x00_dev *rt2x00dev, int enable)
++#else
++static void rt6352_enable_pa_pin(struct rt2x00_dev *rt2x00dev, int enable)
++#endif
+{
+ if (!rt2x00dev->pinctrl)
+ return;
static const unsigned int rt2800_eeprom_map[EEPROM_WORD_COUNT] = {
[EEPROM_CHIP_ID] = 0x0000,
[EEPROM_VERSION] = 0x0001,
-@@ -10404,8 +10422,10 @@ static void rt2800_calibration_rt6352(st
+@@ -10404,8 +10426,10 @@ static void rt2800_calibration_rt6352(st
u32 reg;
if (rt2x00_has_cap_external_pa(rt2x00dev) ||
rt2800_r_calibration(rt2x00dev);
rt2800_rf_self_txdc_cal(rt2x00dev);
-@@ -10423,6 +10443,8 @@ static void rt2800_calibration_rt6352(st
+@@ -10423,6 +10447,8 @@ static void rt2800_calibration_rt6352(st
!rt2x00_has_cap_external_lna_bg(rt2x00dev))
return;
*/
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -3836,14 +3836,16 @@ static void rt2800_config_channel_rf7620
+@@ -3840,14 +3840,16 @@ static void rt2800_config_channel_rf7620
rt2x00_set_field8(&rfcsr, RFCSR19_K, rf->rf4);
rt2800_rfcsr_write(rt2x00dev, 19, rfcsr);
rfcsr = rt2800_rfcsr_read(rt2x00dev, 1);
rt2x00_set_field8(&rfcsr, RFCSR1_TX2_EN_MT7620,
-@@ -3877,18 +3879,23 @@ static void rt2800_config_channel_rf7620
+@@ -3881,18 +3883,23 @@ static void rt2800_config_channel_rf7620
rt2800_rfcsr_write_dccal(rt2x00dev, 59, 0x20);
}
if (!test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) {
if (conf_is_ht40(conf)) {
-@@ -4002,25 +4009,29 @@ static void rt2800_config_alc_rt6352(str
+@@ -4006,25 +4013,29 @@ static void rt2800_config_alc_rt6352(str
if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY)))
rt2x00_warn(rt2x00dev, "RF busy while configuring ALC\n");
rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, mac_sys_ctrl);
rt2800_vco_calibration(rt2x00dev);
-@@ -4513,7 +4524,8 @@ static void rt2800_config_channel(struct
+@@ -4517,7 +4528,8 @@ static void rt2800_config_channel(struct
if (rt2x00_rt(rt2x00dev, RT6352)) {
/* BBP for GLRT BW */
bbp = conf_is_ht40(conf) ?
0x15 : 0x1a;
rt2800_bbp_glrt_write(rt2x00dev, 141, bbp);
-@@ -6017,18 +6029,33 @@ static int rt2800_init_registers(struct
+@@ -6021,18 +6033,33 @@ static int rt2800_init_registers(struct
} else if (rt2x00_rt(rt2x00dev, RT5350)) {
rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
} else if (rt2x00_rt(rt2x00dev, RT6352)) {
reg = rt2800_register_read(rt2x00dev, TX_ALC_CFG_1);
rt2x00_set_field32(®, TX_ALC_CFG_1_ROS_BUSY_EN, 0);
rt2800_register_write(rt2x00dev, TX_ALC_CFG_1, reg);
-@@ -7141,14 +7168,16 @@ static void rt2800_init_bbp_6352(struct
+@@ -7145,14 +7172,16 @@ static void rt2800_init_bbp_6352(struct
rt2800_bbp_write(rt2x00dev, 188, 0x00);
rt2800_bbp_write(rt2x00dev, 189, 0x00);
/* BBP for G band GLRT function (BBP_128 ~ BBP_221) */
rt2800_bbp_glrt_write(rt2x00dev, 0, 0x00);
-@@ -10378,6 +10407,9 @@ static void rt2800_restore_rf_bbp_rt6352
+@@ -10382,6 +10411,9 @@ static void rt2800_restore_rf_bbp_rt6352
rt2800_register_write(rt2x00dev, RF_BYPASS3, 0x0);
}
if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16);
rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x23);
-@@ -10455,6 +10487,9 @@ static void rt2800_calibration_rt6352(st
+@@ -10459,6 +10491,9 @@ static void rt2800_calibration_rt6352(st
rt2800_register_write(rt2x00dev, RF_BYPASS3, reg);
}
if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66);
rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20);
-@@ -10545,31 +10580,36 @@ static void rt2800_init_rfcsr_6352(struc
+@@ -10549,31 +10584,36 @@ static void rt2800_init_rfcsr_6352(struc
rt2800_rfcsr_write(rt2x00dev, 42, 0x5B);
rt2800_rfcsr_write(rt2x00dev, 43, 0x00);
/* Initialize RF channel register to default value */
rt2800_rfcsr_write_chanreg(rt2x00dev, 0, 0x03);
-@@ -10635,63 +10675,71 @@ static void rt2800_init_rfcsr_6352(struc
+@@ -10639,63 +10679,71 @@ static void rt2800_init_rfcsr_6352(struc
rt2800_rfcsr_write_bank(rt2x00dev, 6, 45, 0xC5);
/* Initialize RF DC calibration register to default value */
rt2800_rfcsr_write_dccal(rt2x00dev, 0, 0x47);
-@@ -10754,12 +10802,17 @@ static void rt2800_init_rfcsr_6352(struc
+@@ -10758,12 +10806,17 @@ static void rt2800_init_rfcsr_6352(struc
rt2800_rfcsr_write_dccal(rt2x00dev, 62, 0x00);
rt2800_rfcsr_write_dccal(rt2x00dev, 63, 0x00);
--- /dev/null
+--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c
++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c
+@@ -19,6 +19,9 @@
+
+ #include "rt2x00.h"
+ #include "rt2x00soc.h"
++#if LINUX_VERSION_IS_GEQ(6,12,0)
++#include "rt2800lib.h"
++#endif
+
+ static void rt2800lib_eeprom_swap(struct rt2x00_dev *rt2x00dev)
+ {
--- /dev/null
+--- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c
+@@ -124,7 +124,11 @@ exit_free_device:
+ }
+ EXPORT_SYMBOL_GPL(rt2x00soc_probe);
+
++#if LINUX_VERSION_IS_LESS(6,12,0)
+ int rt2x00soc_remove(struct platform_device *pdev)
++#else
++void rt2x00soc_remove(struct platform_device *pdev)
++#endif
+ {
+ struct ieee80211_hw *hw = platform_get_drvdata(pdev);
+ struct rt2x00_dev *rt2x00dev = hw->priv;
+@@ -135,8 +139,10 @@ int rt2x00soc_remove(struct platform_dev
+ rt2x00lib_remove_dev(rt2x00dev);
+ rt2x00soc_free_reg(rt2x00dev);
+ ieee80211_free_hw(hw);
++#if LINUX_VERSION_IS_LESS(6,12,0)
+
+ return 0;
++#endif
+ }
+ EXPORT_SYMBOL_GPL(rt2x00soc_remove);
+
+--- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.h
++++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.h
+@@ -17,7 +17,11 @@
+ * SoC driver handlers.
+ */
+ int rt2x00soc_probe(struct platform_device *pdev, const struct rt2x00_ops *ops);
++#if LINUX_VERSION_IS_LESS(6,12,0)
+ int rt2x00soc_remove(struct platform_device *pdev);
++#else
++void rt2x00soc_remove(struct platform_device *pdev);
++#endif
+ #ifdef CONFIG_PM
+ int rt2x00soc_suspend(struct platform_device *pdev, pm_message_t state);
+ int rt2x00soc_resume(struct platform_device *pdev);