WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit d8be3f3

Browse files
khusikaamazingfate
authored andcommitted
fix api change of del_timer since v6.15
See: torvalds/linux@8fa7292 Signed-off-by: Khusika Dhamar Gusti <[email protected]>
1 parent 1c8148f commit d8be3f3

File tree

14 files changed

+182
-1
lines changed

14 files changed

+182
-1
lines changed

src/bcmsdstd_linux.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ sdstd_3_osclean_tuning(sdioh_info_t *sd)
197197
struct sdos_info *sdos = (struct sdos_info *)sd->sdos_info;
198198
if (atomic_read(&sdos->timer_enab) == TRUE) {
199199
/* disable timer if it was running */
200+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
201+
timer_delete_sync(&sdos->tuning_timer);
202+
#else
200203
del_timer_sync(&sdos->tuning_timer);
204+
#endif
201205
atomic_set(&sdos->timer_enab, FALSE);
202206
}
203207
tasklet_kill(&sdos->tuning_tasklet);
@@ -495,7 +499,11 @@ void sdstd_enable_disable_periodic_timer(sdioh_info_t *sd, uint val)
495499
}
496500
if (val == SD_DHD_DISABLE_PERIODIC_TUNING) {
497501
/* stop periodic timer */
502+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
503+
timer_delete_sync(&sdos->tuning_timer);
504+
#else
498505
del_timer_sync(&sdos->tuning_timer);
506+
#endif
499507
}
500508
}
501509
#endif /* debugging purpose */

src/dhd_ip.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,11 @@ int dhd_tcpack_suppress_set(dhd_pub_t *dhdp, uint8 mode)
459459
tcpack_info_t *tcpack_info_tbl =
460460
&tcpack_sup_module->tcpack_info_tbl[i];
461461
#ifndef TCPACK_SUPPRESS_HOLD_HRT
462+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
463+
timer_delete(&tcpack_info_tbl->timer);
464+
#else
462465
del_timer(&tcpack_info_tbl->timer);
466+
#endif
463467
#else
464468
hrtimer_cancel(&tcpack_info_tbl->timer.timer);
465469
#endif /* TCPACK_SUPPRESS_HOLD_HRT */
@@ -558,7 +562,11 @@ dhd_tcpack_info_tbl_clean(dhd_pub_t *dhdp)
558562
if (dhdp->tcpack_sup_mode == TCPACK_SUP_HOLD) {
559563
for (i = 0; i < TCPACK_INFO_MAXNUM; i++) {
560564
#ifndef TCPACK_SUPPRESS_HOLD_HRT
565+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
566+
timer_delete_sync(&tcpack_sup_mod->tcpack_info_tbl[i].timer);
567+
#else
561568
del_timer_sync(&tcpack_sup_mod->tcpack_info_tbl[i].timer);
569+
#endif
562570
#else
563571
hrtimer_cancel(&tcpack_sup_mod->tcpack_info_tbl[i].timer.timer);
564572
#endif /* TCPACK_SUPPRESS_HOLD_HRT */
@@ -1343,7 +1351,11 @@ dhd_tcpack_hold(dhd_pub_t *dhdp, void *pkt, int ifidx)
13431351

13441352
if (!hold) {
13451353
#ifndef TCPACK_SUPPRESS_HOLD_HRT
1354+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
1355+
timer_delete_sync(&tcpack_info_tbl[i].timer);
1356+
#else
13461357
del_timer_sync(&tcpack_info_tbl[i].timer);
1358+
#endif
13471359
#else
13481360
hrtimer_cancel(&tcpack_sup_mod->tcpack_info_tbl[i].timer.timer);
13491361
#endif /* TCPACK_SUPPRESS_HOLD_HRT */

src/dhd_linux.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10166,7 +10166,11 @@ dhd_bus_start(dhd_pub_t *dhdp)
1016610166
DHD_GENERAL_LOCK(&dhd->pub, flags);
1016710167
dhd->wd_timer_valid = FALSE;
1016810168
DHD_GENERAL_UNLOCK(&dhd->pub, flags);
10169+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
10170+
timer_delete_sync(&dhd->timer);
10171+
#else
1016910172
del_timer_sync(&dhd->timer);
10173+
#endif
1017010174

1017110175
#endif /* !BCMPCIE_OOB_HOST_WAKE */
1017210176
DHD_STOP_RPM_TIMER(&dhd->pub);
@@ -10225,7 +10229,11 @@ dhd_bus_start(dhd_pub_t *dhdp)
1022510229
DHD_GENERAL_LOCK(&dhd->pub, flags);
1022610230
dhd->wd_timer_valid = FALSE;
1022710231
DHD_GENERAL_UNLOCK(&dhd->pub, flags);
10232+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
10233+
timer_delete_sync(&dhd->timer);
10234+
#else
1022810235
del_timer_sync(&dhd->timer);
10236+
#endif
1022910237
DHD_ERROR(("%s failed bus is not ready\n", __FUNCTION__));
1023010238
DHD_STOP_RPM_TIMER(&dhd->pub);
1023110239
#ifdef BCMSDIO
@@ -10248,7 +10256,11 @@ dhd_bus_start(dhd_pub_t *dhdp)
1024810256
DHD_GENERAL_LOCK(&dhd->pub, flags);
1024910257
dhd->wd_timer_valid = FALSE;
1025010258
DHD_GENERAL_UNLOCK(&dhd->pub, flags);
10259+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
10260+
timer_delete_sync(&dhd->timer);
10261+
#else
1025110262
del_timer_sync(&dhd->timer);
10263+
#endif
1025210264
DHD_ERROR(("%s failed to sync with dongle\n", __FUNCTION__));
1025310265
DHD_OS_WD_WAKE_UNLOCK(&dhd->pub);
1025410266
return ret;
@@ -14341,7 +14353,11 @@ void dhd_detach(dhd_pub_t *dhdp)
1434114353
dhd->wd_timer_valid = FALSE;
1434214354
DHD_GENERAL_UNLOCK(&dhd->pub, flags);
1434314355
if (timer_valid)
14356+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
14357+
timer_delete_sync(&dhd->timer);
14358+
#else
1434414359
del_timer_sync(&dhd->timer);
14360+
#endif
1434514361
DHD_STOP_RPM_TIMER(&dhd->pub);
1434614362

1434714363
#ifdef BCMDBUS
@@ -15352,7 +15368,11 @@ dhd_os_wd_timer(void *bus, uint wdtick)
1535215368
if (!wdtick && dhd->wd_timer_valid == TRUE) {
1535315369
dhd->wd_timer_valid = FALSE;
1535415370
DHD_GENERAL_UNLOCK(pub, flags);
15371+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
15372+
timer_delete_sync(&dhd->timer);
15373+
#else
1535515374
del_timer_sync(&dhd->timer);
15375+
#endif
1535615376
#ifdef BCMSDIO
1535715377
DHD_OS_WD_WAKE_UNLOCK(pub);
1535815378
#endif /* BCMSDIO */

src/dhd_linux_pktdump.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,11 @@ dhd_dump_mod_pkt_timer(dhd_pub_t *dhdp, uint16 rsn)
576576

577577
pktcnts = (pkt_cnts_log_t *)(dhdp->pktcnts);
578578
if (timer_pending(&pktcnts->pktcnt_timer)) {
579+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
580+
timer_delete_sync(&pktcnts->pktcnt_timer);
581+
#else
579582
del_timer_sync(&pktcnts->pktcnt_timer);
583+
#endif
580584
}
581585

582586
bzero(&pktcnts->arp_cnt, sizeof(pkt_cnt_t));
@@ -623,7 +627,11 @@ dhd_dump_pkt_deinit(dhd_pub_t *dhdp)
623627

624628
pktcnts = (pkt_cnts_log_t *)(dhdp->pktcnts);
625629
pktcnts->enabled = FALSE;
630+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
631+
timer_delete_sync(&pktcnts->pktcnt_timer);
632+
#else
626633
del_timer_sync(&pktcnts->pktcnt_timer);
634+
#endif
627635
MFREE(dhdp->osh, dhdp->pktcnts, sizeof(pkt_cnts_log_t));
628636
dhdp->pktcnts = NULL;
629637
}
@@ -640,7 +648,11 @@ dhd_dump_pkt_clear(dhd_pub_t *dhdp)
640648

641649
pktcnts = (pkt_cnts_log_t *)(dhdp->pktcnts);
642650
pktcnts->enabled = FALSE;
651+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
652+
timer_delete_sync(&pktcnts->pktcnt_timer);
653+
#else
643654
del_timer_sync(&pktcnts->pktcnt_timer);
655+
#endif
644656
pktcnts->reason = 0;
645657
bzero(&pktcnts->arp_cnt, sizeof(pkt_cnt_t));
646658
bzero(&pktcnts->dns_cnt, sizeof(pkt_cnt_t));

src/include/linuxver.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,10 +407,17 @@ extern void timer_cb_compat(struct timer_list *tl);
407407
#define timer_set_private(timer_compat, priv) (timer_compat)->arg = priv
408408
#define timer_expires(timer_compat) (timer_compat)->timer.expires
409409

410+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
411+
#define timer_delete(t) timer_delete(&((t)->timer))
412+
#ifndef timer_delete_sync
413+
#define timer_delete_sync(t) timer_delete_sync(&((t)->timer))
414+
#endif
415+
#else
410416
#define del_timer(t) del_timer(&((t)->timer))
411417
#ifndef del_timer_sync
412418
#define del_timer_sync(t) del_timer_sync(&((t)->timer))
413419
#endif
420+
#endif
414421
#define timer_pending(t) timer_pending(&((t)->timer))
415422
#define add_timer(t) add_timer(&((t)->timer))
416423
#define mod_timer(t, j) mod_timer(&((t)->timer), j)
@@ -487,8 +494,13 @@ static inline void tasklet_init(struct tasklet_struct *tasklet,
487494

488495
#define tasklet_kill(tasklet) { do {} while (0); }
489496

497+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
498+
/* 6.15.x introduced timer_delete_sync() */
499+
#define timer_delete_sync(timer) timer_delete(timer)
500+
#else
490501
/* 2.4.x introduced del_timer_sync() */
491502
#define del_timer_sync(timer) del_timer(timer)
503+
#endif
492504

493505
#else
494506

src/include/wlioctl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24856,7 +24856,11 @@ typedef struct wl_mlo_emlsr_ctrl_v1 {
2485624856
typedef struct wl_mlo_mld_ap_op {
2485724857
uint8 op_code; /* WL_MLO_CMD_MLD_AP_OP_ADD/DEL */
2485824858
uint8 link_id;
24859+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
24860+
uint16 timer_delete; /* delete timer in units of TBTT */
24861+
#else
2485924862
uint16 del_timer; /* delete timer in units of TBTT */
24863+
#endif
2486024864
} wl_mlo_mld_ap_op_t;
2486124865

2486224866
/* Current version for wlc_clm_power_limits_req_t structure and flags */

src/linux_osl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,11 @@ osl_timer_del(osl_t *osh, osl_timer_t *t)
20002000
if (t->set) {
20012001
t->set = FALSE;
20022002
if (t->timer) {
2003+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
2004+
timer_delete(t->timer);
2005+
#else
20032006
del_timer(t->timer);
2007+
#endif
20042008
MFREE(NULL, t->timer, sizeof(timer_list_compat_t));
20052009
}
20062010
#ifdef BCMDBG

src/wl_cfg80211.c

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16667,7 +16667,11 @@ wl_stop_wait_next_action_frame(struct bcm_cfg80211 *cfg, struct net_device *ndev
1666716667
s32 err = 0;
1666816668

1666916669
if (wl_get_drv_status_all(cfg, FINDING_COMMON_CHANNEL)) {
16670+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
16671+
timer_delete_sync(&cfg->p2p->listen_timer);
16672+
#else
1667016673
del_timer_sync(&cfg->p2p->listen_timer);
16674+
#endif
1667116675
if (cfg->afx_hdl != NULL) {
1667216676
if (cfg->afx_hdl->dev != NULL) {
1667316677
wl_clr_drv_status(cfg, SCANNING, cfg->afx_hdl->dev);
@@ -17697,7 +17701,11 @@ static void wl_del_roam_timeout(struct bcm_cfg80211 *cfg)
1769717701

1769817702
/* restore prec_map to ALLPRIO */
1769917703
dhdp->dequeue_prec_map = ALLPRIO;
17704+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
17705+
timer_delete_sync(&cfg->roam_timeout);
17706+
#else
1770017707
del_timer_sync(&cfg->roam_timeout);
17708+
#endif
1770117709
#if defined(BCMDONGLEHOST) && defined(OEM_ANDROID)
1770217710
DHD_ENABLE_RUNTIME_PM(dhdp);
1770317711
#endif /* BCMDONGLEHOST && OEM_ANDROID */
@@ -18362,10 +18370,17 @@ static void wl_deinit_priv(struct bcm_cfg80211 *cfg)
1836218370
#ifdef WL_SCHED_SCAN
1836318371
cancel_delayed_work_sync(&cfg->sched_scan_stop_work);
1836418372
#endif /* WL_SCHED_SCAN */
18373+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
18374+
timer_delete_sync(&cfg->scan_timeout);
18375+
#ifdef DHD_LOSSLESS_ROAMING
18376+
timer_delete_sync(&cfg->roam_timeout);
18377+
#endif
18378+
#else
1836518379
del_timer_sync(&cfg->scan_timeout);
1836618380
#ifdef DHD_LOSSLESS_ROAMING
1836718381
del_timer_sync(&cfg->roam_timeout);
1836818382
#endif
18383+
#endif
1836918384
#ifdef WL_CELLULAR_CHAN_AVOID
1837018385
wl_cellavoid_deinit(cfg);
1837118386
#endif /* WL_CELLULAR_CHAN_AVOID */
@@ -18695,11 +18710,17 @@ void wl_cfg80211_detach(struct bcm_cfg80211 *cfg)
1869518710
#ifdef WL_WPS_SYNC
1869618711
wl_deinit_wps_reauth_sm(cfg);
1869718712
#endif /* WL_WPS_SYNC */
18698-
18713+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
18714+
timer_delete_sync(&cfg->scan_timeout);
18715+
#ifdef DHD_LOSSLESS_ROAMING
18716+
timer_delete_sync(&cfg->roam_timeout);
18717+
#endif /* DHD_LOSSLESS_ROAMING */
18718+
#else
1869918719
del_timer_sync(&cfg->scan_timeout);
1870018720
#ifdef DHD_LOSSLESS_ROAMING
1870118721
del_timer_sync(&cfg->roam_timeout);
1870218722
#endif /* DHD_LOSSLESS_ROAMING */
18723+
#endif
1870318724

1870418725
#ifdef WL_STATIC_IF
1870518726
wl_cfg80211_unregister_static_if(cfg);
@@ -20757,7 +20778,11 @@ static s32 __wl_cfg80211_up(struct bcm_cfg80211 *cfg)
2075720778
#endif /* WL_RAV_MSCS_NEG_IN_ASSOC */
2075820779

2075920780
#ifdef DHD_LOSSLESS_ROAMING
20781+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
20782+
timer_delete_sync(&cfg->roam_timeout);
20783+
#else
2076020784
del_timer_sync(&cfg->roam_timeout);
20785+
#endif
2076120786
#endif /* DHD_LOSSLESS_ROAMING */
2076220787

2076320788
err = dhd_monitor_init(cfg->pub);
@@ -21014,7 +21039,11 @@ static s32 __wl_cfg80211_down(struct bcm_cfg80211 *cfg)
2101421039
/* Force clear of scan_suppress */
2101521040
if (cfg->scan_suppressed)
2101621041
wl_cfg80211_scan_suppress(ndev, 0);
21042+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
21043+
timer_delete_sync(&cfg->scan_supp_timer);
21044+
#else
2101721045
del_timer_sync(&cfg->scan_supp_timer);
21046+
#endif
2101821047
cancel_work_sync(&cfg->wlan_work);
2101921048
#endif /* DHCP_SCAN_SUPPRESS */
2102021049

@@ -21164,14 +21193,22 @@ static s32 __wl_cfg80211_down(struct bcm_cfg80211 *cfg)
2116421193
wl_link_down(cfg);
2116521194
if (cfg->p2p_supported) {
2116621195
if (timer_pending(&cfg->p2p->listen_timer))
21196+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
21197+
timer_delete_sync(&cfg->p2p->listen_timer);
21198+
#else
2116721199
del_timer_sync(&cfg->p2p->listen_timer);
21200+
#endif
2116821201
wl_cfgp2p_down(cfg);
2116921202
} else {
2117021203
// avoid memory leak
2117121204
wl_cfgp2p_deinit_priv(cfg);
2117221205
}
2117321206

21207+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
21208+
timer_delete_sync(&cfg->scan_timeout);
21209+
#else
2117421210
del_timer_sync(&cfg->scan_timeout);
21211+
#endif
2117521212

2117621213
wl_cfg80211_clear_mgmt_vndr_ies(cfg);
2117721214

@@ -24642,7 +24679,11 @@ static void wl_deinit_wps_reauth_sm(struct bcm_cfg80211 *cfg)
2464224679
for (i = 0; i < WPS_MAX_SESSIONS; i++) {
2464324680
cfg->wps_session[i].in_use = false;
2464424681
cfg->wps_session[i].state = WPS_STATE_IDLE;
24682+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
24683+
timer_delete_sync(&cfg->wps_session[i].timer);
24684+
#else
2464524685
del_timer_sync(&cfg->wps_session[i].timer);
24686+
#endif
2464624687
}
2464724688

2464824689
}
@@ -24734,7 +24775,11 @@ wl_wps_session_del(struct net_device *ndev)
2473424775
WL_CFG_WPS_SYNC_UNLOCK(&cfg->wps_sync, flags);
2473524776

2473624777
/* Ensure this API is called from sleepable context. */
24778+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
24779+
timer_delete_sync(&cfg->wps_session[inst].timer);
24780+
#else
2473724781
del_timer_sync(&cfg->wps_session[inst].timer);
24782+
#endif
2473824783

2473924784
WL_INFORM_MEM(("[%s][WPS] session deleted\n", ndev->name));
2474024785
}

src/wl_cfg_btcoex.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,11 @@ static void wl_cfg80211_bt_handler(struct work_struct *work)
338338

339339
if (btcx_inf->timer_on) {
340340
btcx_inf->timer_on = 0;
341+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
342+
timer_delete_sync(&btcx_inf->timer);
343+
#else
341344
del_timer_sync(&btcx_inf->timer);
345+
#endif
342346
}
343347

344348
switch (btcx_inf->bt_state) {
@@ -444,7 +448,11 @@ void wl_cfg80211_btcoex_kill_handler(void)
444448

445449
if (btcoex_info_loc->timer_on) {
446450
btcoex_info_loc->timer_on = 0;
451+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
452+
timer_delete_sync(&btcoex_info_loc->timer);
453+
#else
447454
del_timer_sync(&btcoex_info_loc->timer);
455+
#endif
448456
}
449457
cancel_work_sync(&btcoex_info_loc->work);
450458
wl_cfg80211_btcoex_init_handler_status();
@@ -601,7 +609,11 @@ int wl_cfg80211_set_btcoex_dhcp(struct net_device *dev, dhd_pub_t *dhd, char *co
601609
WL_TRACE(("disable BT DHCP Timer\n"));
602610
if (btco_inf->timer_on) {
603611
btco_inf->timer_on = 0;
612+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
613+
timer_delete_sync(&btco_inf->timer);
614+
#else
604615
del_timer_sync(&btco_inf->timer);
616+
#endif
605617

606618
if (btco_inf->bt_state != BT_DHCP_IDLE) {
607619
/* ANDREY: case when framework signals DHCP end before STM timeout */

0 commit comments

Comments
 (0)