fix 6.15+ kernel

thanks to @Eumeryx
This commit is contained in:
RikkaNekoo
2025-08-15 00:21:24 +08:00
parent 0812e407dc
commit 150b784fc2
4 changed files with 57 additions and 17 deletions
+49
View File
@@ -0,0 +1,49 @@
--- a/src/fuxi-gmac-net.c
+++ b/src/fuxi-gmac-net.c
@@ -772,7 +772,9 @@
static void fxgmac_tx_hang_timer_handler(unsigned long data)
#endif
{
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,16,0))
+ struct fxgmac_channel *channel = timer_container_of(channel, t, expansion.tx_hang_timer);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
struct fxgmac_channel *channel = from_timer(channel, t, expansion.tx_hang_timer);
#else
struct fxgmac_channel *channel = (struct fxgmac_channel *)data;
--- a/src/fuxi-gmac-phy.c 2025-04-28 13:51:16.000000000 +0800
+++ b/src/fuxi-gmac-phy.c 2025-08-14 23:18:43.972276438 +0800
@@ -322,7 +322,9 @@
static void fxgmac_phy_link_poll(unsigned long data)
#endif
{
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,16,0))
+ struct fxgmac_pdata *pdata = timer_container_of(pdata, t, expansion.phy_poll_tm);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
struct fxgmac_pdata *pdata = from_timer(pdata, t, expansion.phy_poll_tm);
#else
struct fxgmac_pdata *pdata = (struct fxgmac_pdata*)data;
@@ -350,7 +352,9 @@
int fxgmac_phy_timer_init(struct fxgmac_pdata *pdata)
{
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,16,0))
+ timer_init_key(&pdata->expansion.phy_poll_tm, NULL, 0, "fuxi_phy_link_update_timer", NULL);
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0))
init_timer_key(&pdata->expansion.phy_poll_tm, NULL, 0, "fuxi_phy_link_update_timer", NULL);
#else
init_timer_key(&pdata->expansion.phy_poll_tm, 0, "fuxi_phy_link_update_timer", NULL);
@@ -368,6 +372,10 @@
void fxgmac_phy_timer_destroy(struct fxgmac_pdata *pdata)
{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,15,0))
+ timer_shutdown_sync(&pdata->expansion.phy_poll_tm);
+#else
del_timer_sync(&pdata->expansion.phy_poll_tm);
+#endif
DPRINTK("fxgmac_phy_timer removed\n");
}