Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions mt7615/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ static void mt7615_stop(struct ieee80211_hw *hw, bool suspend)
struct mt7615_phy *phy = mt7615_hw_phy(hw);

cancel_delayed_work_sync(&phy->mt76->mac_work);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
timer_delete_sync(&phy->roc_timer);
#else
del_timer_sync(&phy->roc_timer);
#endif
cancel_work_sync(&phy->roc_work);

cancel_delayed_work_sync(&dev->pm.ps_work);
Expand Down Expand Up @@ -1046,7 +1050,11 @@ void mt7615_roc_work(struct work_struct *work)

void mt7615_roc_timer(struct timer_list *timer)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
struct mt7615_phy *phy = timer_container_of(phy, timer, roc_timer);
#else
struct mt7615_phy *phy = from_timer(phy, timer, roc_timer);
#endif

ieee80211_queue_work(phy->mt76->hw, &phy->roc_work);
}
Expand Down Expand Up @@ -1197,7 +1205,11 @@ static int mt7615_cancel_remain_on_channel(struct ieee80211_hw *hw,
if (!test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state))
return 0;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
timer_delete_sync(&phy->roc_timer);
#else
del_timer_sync(&phy->roc_timer);
#endif
cancel_work_sync(&phy->roc_work);

mt7615_mutex_acquire(phy->dev);
Expand Down
8 changes: 8 additions & 0 deletions mt7615/pci_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,20 @@ void mt7615_mac_reset_work(struct work_struct *work)
set_bit(MT76_MCU_RESET, &dev->mphy.state);
wake_up(&dev->mt76.mcu.wait);
cancel_delayed_work_sync(&dev->mphy.mac_work);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
timer_delete_sync(&dev->phy.roc_timer);
#else
del_timer_sync(&dev->phy.roc_timer);
#endif
cancel_work_sync(&dev->phy.roc_work);
if (phy2) {
set_bit(MT76_RESET, &phy2->mt76->state);
cancel_delayed_work_sync(&phy2->mt76->mac_work);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
timer_delete_sync(&phy2->roc_timer);
#else
del_timer_sync(&phy2->roc_timer);
#endif
cancel_work_sync(&phy2->roc_work);
}

Expand Down
4 changes: 4 additions & 0 deletions mt7615/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ static void mt7663u_stop(struct ieee80211_hw *hw, bool suspend)
struct mt7615_dev *dev = hw->priv;

clear_bit(MT76_STATE_RUNNING, &dev->mphy.state);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
timer_delete_sync(&phy->roc_timer);
#else
del_timer_sync(&phy->roc_timer);
#endif
cancel_work_sync(&phy->roc_work);
cancel_delayed_work_sync(&phy->scan_work);
cancel_delayed_work_sync(&phy->mt76->mac_work);
Expand Down
5 changes: 5 additions & 0 deletions mt76x02_usb_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,13 @@ void mt76x02u_init_beacon_config(struct mt76x02_dev *dev)
};
dev->beacon_ops = &beacon_ops;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
hrtimer_setup(&dev->pre_tbtt_timer, mt76x02u_pre_tbtt_interrupt,
CLOCK_MONOTONIC, HRTIMER_MODE_REL);
#else
hrtimer_init(&dev->pre_tbtt_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
dev->pre_tbtt_timer.function = mt76x02u_pre_tbtt_interrupt;
#endif
INIT_WORK(&dev->pre_tbtt_work, mt76x02u_pre_tbtt_work);

mt76x02_init_beacon_config(dev);
Expand Down
12 changes: 12 additions & 0 deletions mt7921/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,11 @@ void mt7921_roc_abort_sync(struct mt792x_dev *dev)
{
struct mt792x_phy *phy = &dev->phy;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
timer_delete_sync(&phy->roc_timer);
#else
del_timer_sync(&phy->roc_timer);
#endif
cancel_work_sync(&phy->roc_work);
if (test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state))
ieee80211_iterate_interfaces(mt76_hw(dev),
Expand Down Expand Up @@ -402,7 +406,11 @@ static int mt7921_abort_roc(struct mt792x_phy *phy, struct mt792x_vif *vif)
{
int err = 0;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
timer_delete_sync(&phy->roc_timer);
#else
del_timer_sync(&phy->roc_timer);
#endif
cancel_work_sync(&phy->roc_work);

mt792x_mutex_acquire(phy->dev);
Expand Down Expand Up @@ -1494,7 +1502,11 @@ static void mt7921_abort_channel_switch(struct ieee80211_hw *hw,
{
struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
timer_delete_sync(&mvif->csa_timer);
#else
del_timer_sync(&mvif->csa_timer);
#endif
cancel_work_sync(&mvif->csa_work);
}

Expand Down
8 changes: 8 additions & 0 deletions mt7925/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,11 @@ void mt7925_roc_abort_sync(struct mt792x_dev *dev)
{
struct mt792x_phy *phy = &dev->phy;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
timer_delete_sync(&phy->roc_timer);
#else
del_timer_sync(&phy->roc_timer);
#endif
cancel_work_sync(&phy->roc_work);
if (test_and_clear_bit(MT76_STATE_ROC, &phy->mt76->state))
ieee80211_iterate_interfaces(mt76_hw(dev),
Expand Down Expand Up @@ -489,7 +493,11 @@ static int mt7925_abort_roc(struct mt792x_phy *phy,
{
int err = 0;

#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
timer_delete_sync(&phy->roc_timer);
#else
del_timer_sync(&phy->roc_timer);
#endif
cancel_work_sync(&phy->roc_work);

mt792x_mutex_acquire(phy->dev);
Expand Down
13 changes: 12 additions & 1 deletion mt792x_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,23 @@ EXPORT_SYMBOL_GPL(mt792x_tx_worker);

void mt792x_roc_timer(struct timer_list *timer)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
struct mt792x_phy *phy = timer_container_of(phy, timer, roc_timer);
#else
struct mt792x_phy *phy = from_timer(phy, timer, roc_timer);
#endif

ieee80211_queue_work(phy->mt76->hw, &phy->roc_work);
}
EXPORT_SYMBOL_GPL(mt792x_roc_timer);

void mt792x_csa_timer(struct timer_list *timer)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 16, 0)
struct mt792x_vif *mvif = timer_container_of(mvif, timer, csa_timer);
#else
struct mt792x_vif *mvif = from_timer(mvif, timer, csa_timer);

#endif
ieee80211_queue_work(mvif->phy->mt76->hw, &mvif->csa_work);
}
EXPORT_SYMBOL_GPL(mt792x_csa_timer);
Expand Down Expand Up @@ -362,7 +369,11 @@ void mt792x_unassign_vif_chanctx(struct ieee80211_hw *hw,
mutex_unlock(&dev->mt76.mutex);

if (vif->bss_conf.csa_active) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
timer_delete_sync(&mvif->csa_timer);
#else
del_timer_sync(&mvif->csa_timer);
#endif
cancel_work_sync(&mvif->csa_work);
}
}
Expand Down