kernel: refresh IFF_NO_IP_ALIGN ifdef for kernel >= 6.1
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 19 Oct 2022 21:48:42 +0000 (23:48 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Mon, 22 May 2023 20:28:17 +0000 (22:28 +0200)
Kernel 6.1 expanded the priv_flags to long bitmap so update and restore
it to priv_flags.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
target/linux/ath25/files/drivers/net/phy/mvswitch.c
target/linux/generic/files/drivers/net/phy/ar8216.c

index 29f2f9f0e8245f3f8422a302112d6ebdb2dd5e64..285d306ef09d081ea638a71582b341fdd065cdb1 100644 (file)
@@ -312,7 +312,11 @@ mvswitch_config_init(struct phy_device *pdev)
        priv->orig_features = dev->features;
 
 #ifdef HEADER_MODE
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
+       dev->priv_flags |= IFF_NO_IP_ALIGN;
+#else
        dev->extra_priv_flags |= IFF_NO_IP_ALIGN;
+#endif
        dev->features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_TX;
 #else
        dev->features |= NETIF_F_HW_VLAN_CTAG_RX;
@@ -372,7 +376,11 @@ 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(6,1,0)
+       dev->priv_flags &= ~IFF_NO_IP_ALIGN;
+#else
        dev->extra_priv_flags &= ~IFF_NO_IP_ALIGN;
+#endif
 }
 
 static void
index 5e248f856ef0d787c86d7339e3fac619dbf770df..876754597a9cd7cf918d23cc3caaeedc1a365f6d 100644 (file)
@@ -2459,7 +2459,11 @@ 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(6,1,0)
+               dev->priv_flags |= IFF_NO_IP_ALIGN;
+#else LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
                dev->extra_priv_flags |= IFF_NO_IP_ALIGN;
+#endif
                dev->eth_mangle_rx = ar8216_mangle_rx;
                dev->eth_mangle_tx = ar8216_mangle_tx;
        }
@@ -2694,7 +2698,11 @@ ar8xxx_phy_detach(struct phy_device *phydev)
 
 #ifdef CONFIG_ETHERNET_PACKET_MANGLE
        dev->phy_ptr = NULL;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0)
+       dev->priv_flags &= ~IFF_NO_IP_ALIGN;
+#else LINUX_VERSION_CODE >= KERNEL_VERSION(5,15,0)
        dev->extra_priv_flags &= ~IFF_NO_IP_ALIGN;
+#endif
        dev->eth_mangle_rx = NULL;
        dev->eth_mangle_tx = NULL;
 #endif