diff options
author | Lorenzo Bianconi <lorenzo@kernel.org> | 2023-09-21 12:23:48 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2023-09-30 20:17:18 +0200 |
commit | 5ab7d466c4ace74ac46808ff6468f9a34ca0b350 (patch) | |
tree | f82d5b14979d5bb095bad90e8be931cd24399bc6 /drivers/net/wireless/mediatek/mt76/mt792x_core.c | |
parent | 4d2cb56afaf7a96f04bab4c03506e4f5ad8f03db (diff) |
wifi: mt76: mt792x: move some common usb code in mt792x module
Move the following shared usb routines in mt792x module:
- mt792xu_stop
- mt792x_stop
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt792x_core.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt792x_core.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt792x_core.c b/drivers/net/wireless/mediatek/mt76/mt792x_core.c index 7c4a74fb1180..502be22dbe36 100644 --- a/drivers/net/wireless/mediatek/mt76/mt792x_core.c +++ b/drivers/net/wireless/mediatek/mt76/mt792x_core.c @@ -91,6 +91,28 @@ void mt792x_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, } EXPORT_SYMBOL_GPL(mt792x_tx); +void mt792x_stop(struct ieee80211_hw *hw) +{ + struct mt792x_dev *dev = mt792x_hw_dev(hw); + struct mt792x_phy *phy = mt792x_hw_phy(hw); + + cancel_delayed_work_sync(&phy->mt76->mac_work); + + cancel_delayed_work_sync(&dev->pm.ps_work); + cancel_work_sync(&dev->pm.wake_work); + cancel_work_sync(&dev->reset_work); + mt76_connac_free_pending_tx_skbs(&dev->pm, NULL); + + if (is_mt7921(&dev->mt76)) { + mt792x_mutex_acquire(dev); + mt76_connac_mcu_set_mac_enable(&dev->mt76, 0, false, false); + mt792x_mutex_release(dev); + } + + clear_bit(MT76_STATE_RUNNING, &phy->mt76->state); +} +EXPORT_SYMBOL_GPL(mt792x_stop); + void mt792x_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) { |