From 4a4d55e8349f873a00dab630ac533269c81db4d1 Mon Sep 17 00:00:00 2001 From: horseface Date: Fri, 30 May 2025 02:09:05 +0000 Subject: [PATCH] Support Linux 6.15 Update hrtimer initialization to use the new hrtimer_setup() interface introduced in Linux commit 908a1d7 (hrtimers: Introduce hrtimer_setup() to replace hrtimer_init()),which replaces hrtimer_init() with a type-safe and simplified API. The new interface requires a hrtimer_callback function pointer to be explicitly provided at initialization. This commit identifies and passes the appropriate callback from the existing code to maintain equivalent behavior. The legacy hrtimer_init() remains available but is discouraged in new code. Compatibility is preserved using version checks against KERNEL_VERSION(6, 15, 0). --- vwifi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vwifi.c b/vwifi.c index a4fd676..eebd149 100644 --- a/vwifi.c +++ b/vwifi.c @@ -1677,8 +1677,13 @@ static int vwifi_start_ap(struct wiphy *wiphy, /* Initialize hrtimer of beacon */ pr_info("vwifi: init beacon_timer.\n"); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) + hrtimer_setup(&vif->beacon_timer, vwifi_beacon, CLOCK_MONOTONIC, + HRTIMER_MODE_ABS_SOFT); +#else hrtimer_init(&vif->beacon_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_SOFT); vif->beacon_timer.function = vwifi_beacon; +#endif if (!hrtimer_is_queued(&vif->beacon_timer)) { u64 tsf, until_tbtt;