developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 1 | From 61c13ad2aacdc077bc3729090702821d4777530a Mon Sep 17 00:00:00 2001 |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 2 | From: Shayne Chen <shayne.chen@mediatek.com> |
| 3 | Date: Wed, 15 Feb 2023 18:38:04 +0800 |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 4 | Subject: [PATCH 03/22] wifi: mt76: mt7996: move radio enable command to |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 5 | mt7996_start() |
| 6 | |
| 7 | The radio enable and disable commands are used for per-phy radio, so |
| 8 | move them into mt7996_start() and mt7996_stop(), respectively. |
| 9 | |
| 10 | Signed-off-by: Shayne Chen <shayne.chen@mediatek.com> |
| 11 | Change-Id: I610b170f5198e085eb86dbd371ee0745ac6ff50f |
| 12 | --- |
| 13 | mt7996/main.c | 11 ++++++----- |
| 14 | 1 file changed, 6 insertions(+), 5 deletions(-) |
| 15 | |
| 16 | diff --git a/mt7996/main.c b/mt7996/main.c |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 17 | index 136a0c28..28b63d44 100644 |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 18 | --- a/mt7996/main.c |
| 19 | +++ b/mt7996/main.c |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 20 | @@ -43,6 +43,10 @@ int mt7996_run(struct ieee80211_hw *hw) |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 21 | if (ret) |
| 22 | goto out; |
| 23 | |
| 24 | + ret = mt7996_mcu_set_radio_en(phy, true); |
| 25 | + if (ret) |
| 26 | + goto out; |
| 27 | + |
| 28 | ret = mt7996_mcu_set_chan_info(phy, UNI_CHANNEL_RX_PATH); |
| 29 | if (ret) |
| 30 | goto out; |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 31 | @@ -82,6 +86,8 @@ static void mt7996_stop(struct ieee80211_hw *hw) |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 32 | |
| 33 | mutex_lock(&dev->mt76.mutex); |
| 34 | |
| 35 | + mt7996_mcu_set_radio_en(phy, false); |
| 36 | + |
| 37 | clear_bit(MT76_STATE_RUNNING, &phy->mt76->state); |
| 38 | |
developer | 1bc2ce2 | 2023-03-25 00:47:41 +0800 | [diff] [blame] | 39 | mutex_unlock(&dev->mt76.mutex); |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 40 | @@ -190,10 +196,6 @@ static int mt7996_add_interface(struct ieee80211_hw *hw, |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 41 | if (ret) |
| 42 | goto out; |
| 43 | |
| 44 | - ret = mt7996_mcu_set_radio_en(phy, true); |
| 45 | - if (ret) |
| 46 | - goto out; |
| 47 | - |
| 48 | dev->mt76.vif_mask |= BIT_ULL(mvif->mt76.idx); |
| 49 | phy->omac_mask |= BIT_ULL(mvif->mt76.omac_idx); |
| 50 | |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 51 | @@ -253,7 +255,6 @@ static void mt7996_remove_interface(struct ieee80211_hw *hw, |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 52 | phy->monitor_vif = NULL; |
| 53 | |
| 54 | mt7996_mcu_add_dev_info(phy, vif, false); |
| 55 | - mt7996_mcu_set_radio_en(phy, false); |
| 56 | |
| 57 | rcu_assign_pointer(dev->mt76.wcid[idx], NULL); |
| 58 | |
| 59 | -- |
developer | de9ecce | 2023-05-22 11:17:16 +0800 | [diff] [blame] | 60 | 2.39.2 |
developer | 483388c | 2023-03-08 13:52:15 +0800 | [diff] [blame] | 61 | |