blob: ac3766ecb286b061d3c18d154b1ce12ba3f5d9f2 [file] [log] [blame]
developerda18a742023-04-06 13:44:00 +08001From 5ade85e2bad5f7b8736dae47a77fb76591b5c645 Mon Sep 17 00:00:00 2001
developerbb6ddff2023-03-08 17:22:32 +08002From: Shayne Chen <shayne.chen@mediatek.com>
3Date: Wed, 15 Feb 2023 18:38:04 +0800
developerf552fec2023-03-27 11:22:06 +08004Subject: [PATCH 08/29] wifi: mt76: mt7996: move radio enable command to
developerbb6ddff2023-03-08 17:22:32 +08005 mt7996_start()
6
7The radio enable and disable commands are used for per-phy radio, so
8move them into mt7996_start() and mt7996_stop(), respectively.
9
10Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
11Change-Id: I610b170f5198e085eb86dbd371ee0745ac6ff50f
12---
13 mt7996/main.c | 11 ++++++-----
14 1 file changed, 6 insertions(+), 5 deletions(-)
15
16diff --git a/mt7996/main.c b/mt7996/main.c
developerda18a742023-04-06 13:44:00 +080017index ab28ebe..44d23e1 100644
developerbb6ddff2023-03-08 17:22:32 +080018--- a/mt7996/main.c
19+++ b/mt7996/main.c
20@@ -46,6 +46,10 @@ static int mt7996_start(struct ieee80211_hw *hw)
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;
developerf552fec2023-03-27 11:22:06 +080031@@ -73,6 +77,8 @@ static void mt7996_stop(struct ieee80211_hw *hw)
developerbb6ddff2023-03-08 17:22:32 +080032
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
developerf552fec2023-03-27 11:22:06 +080039 mutex_unlock(&dev->mt76.mutex);
40@@ -181,10 +187,6 @@ static int mt7996_add_interface(struct ieee80211_hw *hw,
developerbb6ddff2023-03-08 17:22:32 +080041 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
developerf552fec2023-03-27 11:22:06 +080051@@ -240,7 +242,6 @@ static void mt7996_remove_interface(struct ieee80211_hw *hw,
developerbb6ddff2023-03-08 17:22:32 +080052 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--
developerda18a742023-04-06 13:44:00 +0800602.18.0
developerbb6ddff2023-03-08 17:22:32 +080061