--- r8168-8.048.02/src/r8168_n.c~ 2022-04-02 22:25:30.000000000 +0200 +++ r8168-8.048.02/src/r8168_n.c 2022-04-02 22:28:28.896501079 +0200 @@ -1615,7 +1615,11 @@ static int rtl8168_proc_open(struct inode *inode, struct file *file) { struct net_device *dev = proc_get_parent_data(inode); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0) int (*show)(struct seq_file *, void *) = PDE_DATA(inode); +#else + int (*show)(struct seq_file *, void *) = pde_data(inode); +#endif return single_open(file, show, dev); } --- r8168-8.049.02/src/r8168_n.c.orig 2022-04-02 23:30:49.000000000 +0200 +++ r8168-8.049.02/src/r8168_n.c 2022-04-02 23:40:02.568626144 +0200 @@ -24065,6 +24065,9 @@ struct rtl8168_private *tp = netdev_priv(dev); int i; u8 mac_addr[MAC_ADDR_LEN]; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0) + u8 addr[ETH_ALEN] __aligned(4); +#endif for (i = 0; i < MAC_ADDR_LEN; i++) mac_addr[i] = RTL_R8(tp, MAC0 + i); @@ -24132,10 +24135,18 @@ rtl8168_rar_set(tp, mac_addr); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0) + for (i = 0; i < MAC_ADDR_LEN; i++) { + addr[i] = RTL_R8(tp, MAC0 + i); + tp->org_mac_addr[i] = dev->dev_addr[i]; /* keep the original MAC address */ + } + eth_hw_addr_set(dev, addr); +#else for (i = 0; i < MAC_ADDR_LEN; i++) { dev->dev_addr[i] = RTL_R8(tp, MAC0 + i); tp->org_mac_addr[i] = dev->dev_addr[i]; /* keep the original MAC address */ } +#endif #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); #endif