Files
nixpkgs/pkgs/os-specific/linux/yt6801/kernel_6_16_fix.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
1.4 KiB
Diff
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
--- a/src/fuxi-gmac-phy.c 2025-08-03 00:00:00.000000000 +0000
+++ b/src/fuxi-gmac-phy.c 2025-08-03 00:00:00.000000000 +0000
@@ -322,8 +322,10 @@
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 = container_of(t, struct fxgmac_pdata, 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;
#endif
@@ -350,13 +352,17 @@
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_setup(&pdata->expansion.phy_poll_tm, fxgmac_phy_link_poll, 0);
+#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);
#endif
pdata->expansion.phy_poll_tm.expires = jiffies + HZ / 2;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,16,0))
pdata->expansion.phy_poll_tm.function = (void *)(fxgmac_phy_link_poll);
+#endif
#if (LINUX_VERSION_CODE < KERNEL_VERSION(4,15,0))
pdata->expansion.phy_poll_tm.data = (unsigned long)pdata;
#endif