mac80211: add kernel build with 6.11+ support

This commit is contained in:
coolsnowwolf 2024-11-21 12:27:34 +08:00
parent 28f226a038
commit be8fee09fb

View File

@ -0,0 +1,90 @@
--- a/backport-include/asm/unaligned.h
+++ b/backport-include/asm/unaligned.h
@@ -1,6 +1,11 @@
#ifndef __BACKPORT_ASM_GENERIC_UNALIGNED_H
#define __BACKPORT_ASM_GENERIC_UNALIGNED_H
+
+#if LINUX_VERSION_IS_LESS(6,11,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/wireless/core.c
+++ b/net/wireless/core.c
@@ -164,11 +164,19 @@
list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
if (!wdev->netdev)
continue;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
+ wdev->netdev->netns_local = false;
+#else
wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL;
+#endif
err = dev_change_net_namespace(wdev->netdev, net, "wlan%d");
if (err)
break;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
+ wdev->netdev->netns_local = true;
+#else
wdev->netdev->features |= NETIF_F_NETNS_LOCAL;
+#endif
}
if (err) {
@@ -180,11 +188,19 @@
list) {
if (!wdev->netdev)
continue;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
+ wdev->netdev->netns_local = false;
+#else
wdev->netdev->features &= ~NETIF_F_NETNS_LOCAL;
+#endif
err = dev_change_net_namespace(wdev->netdev, net,
"wlan%d");
WARN_ON(err);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
+ wdev->netdev->netns_local = true;
+#else
wdev->netdev->features |= NETIF_F_NETNS_LOCAL;
+#endif
}
return err;
@@ -1413,7 +1429,11 @@
SET_NETDEV_DEVTYPE(dev, &wiphy_type);
wdev->netdev = dev;
/* can only change netns with wiphy */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0)
+ dev->netns_local = true;
+#else
dev->features |= NETIF_F_NETNS_LOCAL;
+#endif
cfg80211_init_wdev(wdev);
break;
--- a/net/mac80211/rc80211_minstrel_ht_debugfs.c
+++ a/net/mac80211/rc80211_minstrel_ht_debugfs.c
@@ -187,7 +187,9 @@
.open = minstrel_ht_stats_open,
.read = minstrel_stats_read,
.release = minstrel_stats_release,
+#if LINUX_VERSION_IS_LESS(6,11,0)
.llseek = no_llseek,
+#endif
};
static char *
@@ -323,7 +325,9 @@
.open = minstrel_ht_stats_csv_open,
.read = minstrel_stats_read,
.release = minstrel_stats_release,
+#if LINUX_VERSION_IS_LESS(6,11,0)
.llseek = no_llseek,
+#endif
};
void