[PATCH 2/6] kernel: refresh IFF_NO_IP_ALIGN ifdef for kernel >= 6.1

Tomasz Maciej Nowak tmn505 at terefe.re
Thu Apr 27 07:34:45 PDT 2023


From: Christian Marangi <ansuelsmth at gmail.com>

Kernel 6.1 expanded the priv_flags to long bitmap so update and restore
it to priv_flags.

Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 target/linux/ath25/files/drivers/net/phy/mvswitch.c | 8 ++++++--
 target/linux/generic/files/drivers/net/phy/ar8216.c | 8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/target/linux/ath25/files/drivers/net/phy/mvswitch.c b/target/linux/ath25/files/drivers/net/phy/mvswitch.c
index e3550d55baf8..1f5a94798647 100644
--- a/target/linux/ath25/files/drivers/net/phy/mvswitch.c
+++ b/target/linux/ath25/files/drivers/net/phy/mvswitch.c
@@ -312,7 +312,9 @@ mvswitch_config_init(struct phy_device *pdev)
 	priv->orig_features = dev->features;
 
 #ifdef HEADER_MODE
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
+	dev->priv_flags |= IFF_NO_IP_ALIGN;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
 	dev->extra_priv_flags |= IFF_NO_IP_ALIGN;
 #else
 	dev->priv_flags |= IFF_NO_IP_ALIGN;
@@ -376,7 +378,9 @@ mvswitch_detach(struct phy_device *pdev)
 	dev->eth_mangle_rx = NULL;
 	dev->eth_mangle_tx = NULL;
 	dev->features = priv->orig_features;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
+	dev->priv_flags &= ~IFF_NO_IP_ALIGN;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
 	dev->extra_priv_flags &= ~IFF_NO_IP_ALIGN;
 #else
 	dev->priv_flags &= ~IFF_NO_IP_ALIGN;
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index bf98fd599ecb..54a964094f60 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -2467,7 +2467,9 @@ ar8xxx_phy_config_init(struct phy_device *phydev)
 	/* VID fixup only needed on ar8216 */
 	if (chip_is_ar8216(priv)) {
 		dev->phy_ptr = priv;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
+		dev->priv_flags |= IFF_NO_IP_ALIGN;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
 		dev->extra_priv_flags |= IFF_NO_IP_ALIGN;
 #else
 		dev->priv_flags |= IFF_NO_IP_ALIGN;
@@ -2706,7 +2708,9 @@ ar8xxx_phy_detach(struct phy_device *phydev)
 
 #ifdef CONFIG_ETHERNET_PACKET_MANGLE
 	dev->phy_ptr = NULL;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
+	dev->priv_flags &= ~IFF_NO_IP_ALIGN;
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
 	dev->extra_priv_flags &= ~IFF_NO_IP_ALIGN;
 #else
 	dev->priv_flags &= ~IFF_NO_IP_ALIGN;
-- 
2.40.1




More information about the openwrt-devel mailing list