linuxPackages.yt6801: fix build for 6.16
This commit is contained in:
parent
7e71a61405
commit
85a69036a1
@ -28,8 +28,12 @@ stdenv.mkDerivation (finalAttrs: {
|
|||||||
|
|
||||||
nativeBuildInputs = kernel.moduleBuildDependencies ++ [ kmod ];
|
nativeBuildInputs = kernel.moduleBuildDependencies ++ [ kmod ];
|
||||||
|
|
||||||
patches = lib.optionals (lib.versionAtLeast kernel.version "6.15") [
|
patches =
|
||||||
|
lib.optionals (lib.versionAtLeast kernel.version "6.15") [
|
||||||
./kernel_6.15_fix.patch
|
./kernel_6.15_fix.patch
|
||||||
|
]
|
||||||
|
++ lib.optionals (lib.versionAtLeast kernel.version "6.16") [
|
||||||
|
./kernel_6_16_fix.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
|
|||||||
33
pkgs/os-specific/linux/yt6801/kernel_6_16_fix.patch
Normal file
33
pkgs/os-specific/linux/yt6801/kernel_6_16_fix.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
--- 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
|
||||||
Loading…
x
Reference in New Issue
Block a user