fix: fix code for linux kernel v6.15

This commit is contained in:
Shen Mintao
2025-07-24 14:01:42 +08:00
parent 3800c225ac
commit 1c7d083372
4 changed files with 58 additions and 2 deletions
@@ -527,7 +527,11 @@ static void aicwf_sdio_bus_stop(struct device *dev)
aicwf_sdio_pwrctl_timer(sdiodev, 0); aicwf_sdio_pwrctl_timer(sdiodev, 0);
if(timer_pending(&sdiodev->rwnx_hw->p2p_alive_timer)){ if(timer_pending(&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);} ret = del_timer(&sdiodev->rwnx_hw->p2p_alive_timer);}
#endif
sdio_dbg("%s\n",__func__); sdio_dbg("%s\n",__func__);
if (sdiodev->pwrctl_tsk) { if (sdiodev->pwrctl_tsk) {
complete(&sdiodev->pwrctrl_trgg); complete(&sdiodev->pwrctrl_trgg);
@@ -1080,7 +1084,11 @@ void aicwf_sdio_pwrctl_timer(struct aic_sdio_dev *sdiodev, uint duration)
spin_lock_bh(&sdiodev->pwrctl_lock); spin_lock_bh(&sdiodev->pwrctl_lock);
if (!duration) { if (!duration) {
if (timer_pending(&sdiodev->timer)) if (timer_pending(&sdiodev->timer))
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
timer_delete_sync(&sdiodev->timer);
#else
del_timer_sync(&sdiodev->timer); del_timer_sync(&sdiodev->timer);
#endif
} else { } else {
sdiodev->active_duration = duration; sdiodev->active_duration = duration;
timeout = msecs_to_jiffies(sdiodev->active_duration); timeout = msecs_to_jiffies(sdiodev->active_duration);
@@ -106,7 +106,11 @@ void tcp_ack_deinit(struct rwnx_hw *priv)
drop_msg = NULL; drop_msg = NULL;
write_seqlock_bh(&ack_m->ack_info[i].seqlock); write_seqlock_bh(&ack_m->ack_info[i].seqlock);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
timer_delete(&ack_m->ack_info[i].timer);
#else
del_timer(&ack_m->ack_info[i].timer); del_timer(&ack_m->ack_info[i].timer);
#endif
drop_msg = ack_m->ack_info[i].msgbuf; drop_msg = ack_m->ack_info[i].msgbuf;
ack_m->ack_info[i].msgbuf = NULL; ack_m->ack_info[i].msgbuf = NULL;
write_sequnlock_bh(&ack_m->ack_info[i].seqlock); write_sequnlock_bh(&ack_m->ack_info[i].seqlock);
@@ -375,7 +379,11 @@ int tcp_ack_handle(struct msg_buf *new_msgbuf,
//printk("%lx \n",ack_info->msgbuf); //printk("%lx \n",ack_info->msgbuf);
drop_msg = ack_info->msgbuf; drop_msg = ack_info->msgbuf;
ack_info->msgbuf = NULL; ack_info->msgbuf = NULL;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
timer_delete(&ack_info->timer);
#else
del_timer(&ack_info->timer); del_timer(&ack_info->timer);
#endif
}else{ }else{
//printk("msgbuf is NULL \n"); //printk("msgbuf is NULL \n");
} }
@@ -409,7 +417,11 @@ int tcp_ack_handle(struct msg_buf *new_msgbuf,
atomic_read(&ack_m->max_drop_cnt)))) { atomic_read(&ack_m->max_drop_cnt)))) {
ack_info->drop_cnt = 0; ack_info->drop_cnt = 0;
ack_info->in_send_msg = new_msgbuf; ack_info->in_send_msg = new_msgbuf;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
timer_delete(&ack_info->timer);
#else
del_timer(&ack_info->timer); del_timer(&ack_info->timer);
#endif
} else { } else {
ret = 1; ret = 1;
ack_info->msgbuf = new_msgbuf; ack_info->msgbuf = new_msgbuf;
@@ -472,7 +484,11 @@ int tcp_ack_handle_new(struct msg_buf *new_msgbuf,
ack_info->drop_cnt = 0; ack_info->drop_cnt = 0;
//send_msg = new_msgbuf; //send_msg = new_msgbuf;
ack_info->in_send_msg = new_msgbuf; ack_info->in_send_msg = new_msgbuf;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
timer_delete(&ack_info->timer);
#else
del_timer(&ack_info->timer); del_timer(&ack_info->timer);
#endif
}else{ }else{
ret = 1; ret = 1;
ack_info->msgbuf = new_msgbuf; ack_info->msgbuf = new_msgbuf;
+17 -1
View File
@@ -2677,7 +2677,11 @@ static void rwnx_cfgp2p_stop_p2p_device(struct wiphy *wiphy, struct wireless_dev
if (rwnx_vif == rwnx_hw->p2p_dev_vif) { if (rwnx_vif == rwnx_hw->p2p_dev_vif) {
rwnx_hw->is_p2p_alive = 0; rwnx_hw->is_p2p_alive = 0;
if (timer_pending(&rwnx_hw->p2p_alive_timer)) { if (timer_pending(&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); del_timer_sync(&rwnx_hw->p2p_alive_timer);
#endif
} }
if (rwnx_vif->up) { if (rwnx_vif->up) {
rwnx_send_remove_if(rwnx_hw, rwnx_vif->vif_index, true); rwnx_send_remove_if(rwnx_hw, rwnx_vif->vif_index, true);
@@ -4084,7 +4088,11 @@ static int rwnx_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *dev)
rwnx_vif->ap.start = false; rwnx_vif->ap.start = false;
aicwf_nl_hook_deinit(rwnx_vif->ap.band, rwnx_vif->rwnx_hw->iface_idx); aicwf_nl_hook_deinit(rwnx_vif->ap.band, rwnx_vif->rwnx_hw->iface_idx);
if (timer_pending(&rwnx_vif->steer_timer)) if (timer_pending(&rwnx_vif->steer_timer))
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
timer_delete_sync(&rwnx_vif->steer_timer);
#else
del_timer_sync(&rwnx_vif->steer_timer); del_timer_sync(&rwnx_vif->steer_timer);
#endif
cancel_work_sync(&rwnx_vif->steer_work); cancel_work_sync(&rwnx_vif->steer_work);
flush_workqueue(rwnx_vif->rsp_wq); flush_workqueue(rwnx_vif->rsp_wq);
destroy_workqueue(rwnx_vif->rsp_wq); destroy_workqueue(rwnx_vif->rsp_wq);
@@ -9017,7 +9025,11 @@ void rwnx_cfg80211_deinit(struct rwnx_hw *rwnx_hw)
#ifdef CONFIG_DYNAMIC_PWR #ifdef CONFIG_DYNAMIC_PWR
if(timer_pending(&rwnx_hw->pwrloss_timer)){ if(timer_pending(&rwnx_hw->pwrloss_timer)){
del_timer_sync(&rwnx_hw->pwrloss_timer);} #if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
timer_delete_sync(&rwnx_hw->pwrloss_timer);
#else
del_timer_sync(&rwnx_hw->pwrloss_timer);
#endif
cancel_work_sync(&rwnx_hw->pwrloss_work); cancel_work_sync(&rwnx_hw->pwrloss_work);
#endif #endif
@@ -9031,7 +9043,11 @@ void rwnx_cfg80211_deinit(struct rwnx_hw *rwnx_hw)
list_for_each_entry(defrag_ctrl, &rwnx_hw->defrag_list, list) { list_for_each_entry(defrag_ctrl, &rwnx_hw->defrag_list, list) {
list_del_init(&defrag_ctrl->list); list_del_init(&defrag_ctrl->list);
if (timer_pending(&defrag_ctrl->defrag_timer)) if (timer_pending(&defrag_ctrl->defrag_timer))
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
timer_delete_sync(&defrag_ctrl->defrag_timer);
#else
del_timer_sync(&defrag_ctrl->defrag_timer); del_timer_sync(&defrag_ctrl->defrag_timer);
#endif
dev_kfree_skb(defrag_ctrl->skb); dev_kfree_skb(defrag_ctrl->skb);
kfree(defrag_ctrl); kfree(defrag_ctrl);
} }
+16
View File
@@ -1585,7 +1585,11 @@ int reord_flush_tid(struct aicwf_rx_priv *rx_priv, struct sk_buff *skb, u8 tid)
preorder_ctrl->enable = false; preorder_ctrl->enable = false;
spin_unlock_irqrestore(&preorder_ctrl->reord_list_lock, flags); spin_unlock_irqrestore(&preorder_ctrl->reord_list_lock, flags);
if (timer_pending(&preorder_ctrl->reord_timer)) if (timer_pending(&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); ret = del_timer_sync(&preorder_ctrl->reord_timer);
#endif
cancel_work_sync(&preorder_ctrl->reord_timer_work); cancel_work_sync(&preorder_ctrl->reord_timer_work);
return 0; return 0;
@@ -1611,7 +1615,11 @@ void reord_deinit_sta(struct aicwf_rx_priv* rx_priv, struct reord_ctrl_info *reo
if(preorder_ctrl->enable){ if(preorder_ctrl->enable){
preorder_ctrl->enable = false; preorder_ctrl->enable = false;
if (timer_pending(&preorder_ctrl->reord_timer)) { if (timer_pending(&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); ret = del_timer_sync(&preorder_ctrl->reord_timer);
#endif
} }
cancel_work_sync(&preorder_ctrl->reord_timer_work); cancel_work_sync(&preorder_ctrl->reord_timer_work);
} }
@@ -2021,7 +2029,11 @@ int reord_process_unit(struct recv_msdu *pframe, struct aicwf_rx_priv *rx_priv,
} }
} else { } else {
if(timer_pending(&preorder_ctrl->reord_timer)) { if(timer_pending(&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); ret = del_timer(&preorder_ctrl->reord_timer);
#endif
} }
} }
@@ -2547,7 +2559,11 @@ check_len_update:
skb_tmp = defrag_info->skb; skb_tmp = defrag_info->skb;
list_del_init(&defrag_info->list); list_del_init(&defrag_info->list);
if (timer_pending(&defrag_info->defrag_timer)) { if (timer_pending(&defrag_info->defrag_timer)) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
ret = timer_delete(&defrag_info->defrag_timer);
#else
ret = del_timer(&defrag_info->defrag_timer); ret = del_timer(&defrag_info->defrag_timer);
#endif
} }
kfree(defrag_info); kfree(defrag_info);
spin_unlock_bh(&rwnx_hw->defrag_lock); spin_unlock_bh(&rwnx_hw->defrag_lock);