Skip to content

Commit 0258f2a

Browse files
horseface1110dingsen-Greenhorn
authored andcommitted
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).
1 parent 34fe3b5 commit 0258f2a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

vwifi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,8 +1677,13 @@ static int vwifi_start_ap(struct wiphy *wiphy,
16771677

16781678
/* Initialize hrtimer of beacon */
16791679
pr_info("vwifi: init beacon_timer.\n");
1680+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
1681+
hrtimer_setup(&vif->beacon_timer, vwifi_beacon, CLOCK_MONOTONIC,
1682+
HRTIMER_MODE_ABS_SOFT);
1683+
#else
16801684
hrtimer_init(&vif->beacon_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_SOFT);
16811685
vif->beacon_timer.function = vwifi_beacon;
1686+
#endif
16821687

16831688
if (!hrtimer_is_queued(&vif->beacon_timer)) {
16841689
u64 tsf, until_tbtt;

0 commit comments

Comments
 (0)