From 9d619f4c0924f93814ff990751a4b2d3ddd03f4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rin=20Cat=20=28=E9=88=B4=E7=8C=AB=29?= Date: Tue, 10 Jun 2025 10:04:35 -0400 Subject: [PATCH] Linux 6.15 compat: rename timers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rin Cat (鈴猫) --- hal/phydm/phydm_interface.c | 12 ++++++++++++ include/osdep_service_linux.h | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/hal/phydm/phydm_interface.c b/hal/phydm/phydm_interface.c index 7a0c428..e72fffa 100644 --- a/hal/phydm/phydm_interface.c +++ b/hal/phydm/phydm_interface.c @@ -725,11 +725,23 @@ void odm_initialize_timer(struct dm_struct *dm, struct phydm_timer_list *timer, void odm_cancel_timer(struct dm_struct *dm, struct phydm_timer_list *timer) { #if (DM_ODM_SUPPORT_TYPE & ODM_AP) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + timer_delete(timer); +#else del_timer(timer); +#endif #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + timer_delete(timer); +#else del_timer(timer); +#endif #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + timer_delete(&timer->timer); +#else del_timer(&timer->timer); +#endif #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) _cancel_timer_ex(timer); #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) diff --git a/include/osdep_service_linux.h b/include/osdep_service_linux.h index fca4cf6..ed1e19b 100644 --- a/include/osdep_service_linux.h +++ b/include/osdep_service_linux.h @@ -387,12 +387,20 @@ __inline static void _set_timer(_timer *ptimer, u32 delay_time) __inline static void _cancel_timer(_timer *ptimer, u8 *bcancelled) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + *bcancelled = timer_delete_sync(&ptimer->timer) == 1 ? 1 : 0; +#else *bcancelled = del_timer_sync(&ptimer->timer) == 1 ? 1 : 0; +#endif } __inline static void _cancel_timer_async(_timer *ptimer) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)) + timer_delete(&ptimer->timer); +#else del_timer(&ptimer->timer); +#endif } static inline void _init_workitem(_workitem *pwork, void *pfunc, void *cntx)