diff -Nru r8125-9.007.01/debian/changelog r8125-9.007.01/debian/changelog --- r8125-9.007.01/debian/changelog 2022-02-20 05:39:40.000000000 +0000 +++ r8125-9.007.01/debian/changelog 2023-01-18 08:04:11.000000000 +0000 @@ -1,3 +1,10 @@ +r8125 (9.007.01-3ubuntu1) jammy; urgency=medium + + * Support linux >= 5.18 (LP: #1981993): + - debian/patches/0001-support-linux-5.19.patch + + -- Andrea Righi Wed, 18 Jan 2023 08:04:11 +0000 + r8125 (9.007.01-3) unstable; urgency=medium * Let's put this to generate binary package, second try. diff -Nru r8125-9.007.01/debian/control r8125-9.007.01/debian/control --- r8125-9.007.01/debian/control 2022-02-20 05:39:40.000000000 +0000 +++ r8125-9.007.01/debian/control 2023-01-18 08:04:11.000000000 +0000 @@ -1,7 +1,8 @@ Source: r8125 Section: non-free/kernel Priority: optional -Maintainer: Hideki Yamane +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Hideki Yamane Build-Depends: debhelper-compat (= 13), dh-sequence-dkms, diff -Nru r8125-9.007.01/debian/patches/0001-support-linux-5.19.patch r8125-9.007.01/debian/patches/0001-support-linux-5.19.patch --- r8125-9.007.01/debian/patches/0001-support-linux-5.19.patch 1970-01-01 00:00:00.000000000 +0000 +++ r8125-9.007.01/debian/patches/0001-support-linux-5.19.patch 2023-01-18 08:04:11.000000000 +0000 @@ -0,0 +1,77 @@ +From: Andrea Righi +Subject: support kernels >= 5.18 + +Index: r8125-9.007.01/src/r8125_n.c +=================================================================== +--- r8125-9.007.01.orig/src/r8125_n.c ++++ r8125-9.007.01/src/r8125_n.c +@@ -93,6 +93,25 @@ + #define FIRMWARE_8125A_3 "rtl_nic/rtl8125a-3.fw" + #define FIRMWARE_8125B_2 "rtl_nic/rtl8125b-2.fw" + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) ++static inline int pci_set_dma_mask(struct pci_dev *dev, u64 mask) ++{ ++ return dma_set_mask(&dev->dev, mask); ++} ++ ++static inline int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask) ++{ ++ return dma_set_coherent_mask(&dev->dev, mask); ++} ++ ++static inline void netif_set_gso_max_size(struct net_device *dev, ++ unsigned int size) ++{ ++ /* dev->gso_max_size is read locklessly from sk_setup_caps() */ ++ WRITE_ONCE(dev->gso_max_size, size); ++} ++#endif ++ + /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). + The RTL chips use a 64 element hash table based on the Ethernet CRC. */ + static const int multicast_filter_limit = 32; +@@ -1746,7 +1765,11 @@ static void rtl8125_proc_module_init(voi + static int rtl8125_proc_open(struct inode *inode, struct file *file) + { + struct net_device *dev = proc_get_parent_data(inode); +- int (*show)(struct seq_file *, void *) = PDE_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 //LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0) + + return single_open(file, show, dev); + } +@@ -10720,6 +10743,16 @@ rtl8125_release_board(struct pci_dev *pd + free_netdev(dev); + } + ++static void ++rtl8125_hw_address_set(struct net_device *dev, u8 mac_addr[MAC_ADDR_LEN]) ++{ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0) ++ eth_hw_addr_set(dev, mac_addr); ++#else ++ memcpy(dev->dev_addr, mac_addr, MAC_ADDR_LEN); ++#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0) ++} ++ + static int + rtl8125_get_mac_address(struct net_device *dev) + { +@@ -10750,12 +10783,9 @@ rtl8125_get_mac_address(struct net_devic + tp->random_mac = 1; + } + ++ rtl8125_hw_address_set(dev, mac_addr); + rtl8125_rar_set(tp, mac_addr); + +- 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 */ +- } + #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13) + memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); + #endif diff -Nru r8125-9.007.01/debian/patches/series r8125-9.007.01/debian/patches/series --- r8125-9.007.01/debian/patches/series 1970-01-01 00:00:00.000000000 +0000 +++ r8125-9.007.01/debian/patches/series 2023-01-18 08:04:11.000000000 +0000 @@ -0,0 +1 @@ +0001-support-linux-5.19.patch