From 2c971254217a0e589eb1b1fbed1d83a907f9945b Mon Sep 17 00:00:00 2001 From: vorasilp Date: Wed, 11 Jun 2025 11:40:32 +0700 Subject: [PATCH] add preprocessor directive for kernel >= 6.15 --- drivers/aic8800/aic8800_fdrv/aicwf_sdio.c | 13 +++++++++++-- drivers/aic8800/aic8800_fdrv/aicwf_tcp_ack.c | 18 +++++++++++++++--- drivers/aic8800/aic8800_fdrv/rwnx_main.c | 12 ++++++++++-- drivers/aic8800/aic8800_fdrv/rwnx_rx.c | 18 +++++++++++++++--- 4 files changed, 51 insertions(+), 10 deletions(-) diff --git a/drivers/aic8800/aic8800_fdrv/aicwf_sdio.c b/drivers/aic8800/aic8800_fdrv/aicwf_sdio.c index ffd31b5..c9f5a76 100644 --- a/drivers/aic8800/aic8800_fdrv/aicwf_sdio.c +++ b/drivers/aic8800/aic8800_fdrv/aicwf_sdio.c @@ -527,7 +527,12 @@ static void aicwf_sdio_bus_stop(struct device *dev) aicwf_sdio_pwrctl_timer(sdiodev, 0); if(timer_pending(&sdiodev->rwnx_hw->p2p_alive_timer)){ - ret = timer_delete(&sdiodev->rwnx_hw->p2p_alive_timer);} + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) + ret = timer_delete(&sdiodev->rwnx_hw->p2p_alive_timer); + #else + ret = del_timer(&sdiodev->rwnx_hw->p2p_alive_timer); + #endif + } sdio_dbg("%s\n",__func__); if (sdiodev->pwrctl_tsk) { complete(&sdiodev->pwrctrl_trgg); @@ -1080,7 +1085,11 @@ void aicwf_sdio_pwrctl_timer(struct aic_sdio_dev *sdiodev, uint duration) spin_lock_bh(&sdiodev->pwrctl_lock); if (!duration) { if (timer_pending(&sdiodev->timer)) - timer_delete_sync(&sdiodev->timer); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) + timer_delete_sync(&sdiodev->timer); + #else + del_timer_sync(&sdiodev->timer); + #endif } else { sdiodev->active_duration = duration; timeout = msecs_to_jiffies(sdiodev->active_duration); diff --git a/drivers/aic8800/aic8800_fdrv/aicwf_tcp_ack.c b/drivers/aic8800/aic8800_fdrv/aicwf_tcp_ack.c index 6722339..4c0c887 100644 --- a/drivers/aic8800/aic8800_fdrv/aicwf_tcp_ack.c +++ b/drivers/aic8800/aic8800_fdrv/aicwf_tcp_ack.c @@ -375,7 +375,11 @@ int tcp_ack_handle(struct msg_buf *new_msgbuf, //printk("%lx \n",ack_info->msgbuf); drop_msg = ack_info->msgbuf; ack_info->msgbuf = NULL; - timer_delete(&ack_info->timer); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) + timer_delete(&ack_info->timer); + #else + del_timer(&ack_info->timer); + #endif }else{ //printk("msgbuf is NULL \n"); } @@ -409,7 +413,11 @@ int tcp_ack_handle(struct msg_buf *new_msgbuf, atomic_read(&ack_m->max_drop_cnt)))) { ack_info->drop_cnt = 0; ack_info->in_send_msg = new_msgbuf; - timer_delete(&ack_info->timer); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) + timer_delete(&ack_info->timer); + #else + del_timer(&ack_info->timer); + #endif } else { ret = 1; ack_info->msgbuf = new_msgbuf; @@ -472,7 +480,11 @@ int tcp_ack_handle_new(struct msg_buf *new_msgbuf, ack_info->drop_cnt = 0; send_msg = new_msgbuf; ack_info->in_send_msg = send_msg; - timer_delete(&ack_info->timer); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) + timer_delete(&ack_info->timer); + #else + del_timer(&ack_info->timer); + #endif }else{ ret = 1; ack_info->msgbuf = new_msgbuf; diff --git a/drivers/aic8800/aic8800_fdrv/rwnx_main.c b/drivers/aic8800/aic8800_fdrv/rwnx_main.c index 3621003..0315980 100644 --- a/drivers/aic8800/aic8800_fdrv/rwnx_main.c +++ b/drivers/aic8800/aic8800_fdrv/rwnx_main.c @@ -2191,7 +2191,11 @@ static int rwnx_cfg80211_del_iface(struct wiphy *wiphy, struct wireless_dev *wde #if 0 if (rwnx_vif == rwnx_hw->p2p_dev_vif) { if (timer_pending(&rwnx_hw->p2p_alive_timer)) { - timer_delete_sync(&rwnx_hw->p2p_alive_timer); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) + timer_delete_sync(&rwnx_hw->p2p_alive_timer); + #else + del_timer_sync(&rwnx_hw->p2p_alive_timer); + #endif } } #endif @@ -2440,7 +2444,11 @@ static void rwnx_cfgp2p_stop_p2p_device(struct wiphy *wiphy, struct wireless_dev if (rwnx_vif == rwnx_hw->p2p_dev_vif) { rwnx_hw->is_p2p_alive = 0; if (timer_pending(&rwnx_hw->p2p_alive_timer)) { - timer_delete_sync(&rwnx_hw->p2p_alive_timer); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) + timer_delete_sync(&rwnx_hw->p2p_alive_timer); + #else + del_timer_sync(&rwnx_hw->p2p_alive_timer); + #endif } if (rwnx_vif->up) { rwnx_send_remove_if(rwnx_hw, rwnx_vif->vif_index, true); diff --git a/drivers/aic8800/aic8800_fdrv/rwnx_rx.c b/drivers/aic8800/aic8800_fdrv/rwnx_rx.c index 38089d1..13f4330 100644 --- a/drivers/aic8800/aic8800_fdrv/rwnx_rx.c +++ b/drivers/aic8800/aic8800_fdrv/rwnx_rx.c @@ -1428,7 +1428,11 @@ int reord_flush_tid(struct aicwf_rx_priv *rx_priv, struct sk_buff *skb, u8 tid) preorder_ctrl->enable = false; spin_unlock_irqrestore(&preorder_ctrl->reord_list_lock, flags); if (timer_pending(&preorder_ctrl->reord_timer)) - ret = timer_delete_sync(&preorder_ctrl->reord_timer); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) + ret = timer_delete_sync(&preorder_ctrl->reord_timer); + #else + ret = del_timer_sync(&preorder_ctrl->reord_timer); + #endif cancel_work_sync(&preorder_ctrl->reord_timer_work); return 0; @@ -1454,7 +1458,11 @@ void reord_deinit_sta(struct aicwf_rx_priv* rx_priv, struct reord_ctrl_info *reo if(preorder_ctrl->enable){ preorder_ctrl->enable = false; if (timer_pending(&preorder_ctrl->reord_timer)) { - ret = timer_delete_sync(&preorder_ctrl->reord_timer); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) + ret = timer_delete_sync(&preorder_ctrl->reord_timer); + #else + ret = del_timer_sync(&preorder_ctrl->reord_timer); + #endif } cancel_work_sync(&preorder_ctrl->reord_timer_work); } @@ -1833,7 +1841,11 @@ int reord_process_unit(struct aicwf_rx_priv *rx_priv, struct sk_buff *skb, u16 s } } else { if(timer_pending(&preorder_ctrl->reord_timer)) { - ret = timer_delete(&preorder_ctrl->reord_timer); + #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0) + ret = timer_delete(&preorder_ctrl->reord_timer); + #else + ret = del_timer(&preorder_ctrl->reord_timer); + #endif } }