blob: 27dc9f66a434ebdf920aa7b9bc6ab04690d82c17 [file] [log] [blame]
developerc83f1ac2023-10-23 10:30:11 +08001From ae8181c30d187de764055ab15fd7f3efd8aa736c Mon Sep 17 00:00:00 2001
2From: Peter Chiu <chui-hao.chiu@mediatek.com>
3Date: Mon, 23 Oct 2023 10:25:25 +0800
4Subject: [PATCH 2014/2015] Revert "wifi: mt76: move struct
5 ieee80211_chanctx_conf up to struct mt76_vif"
6
7This reverts commit d1881b1b2bf6018d1cb1b91e4301a60021cacaa3.
8---
9 mt76.h | 1 -
10 mt7921/main.c | 12 ++++++------
11 mt792x.h | 1 +
12 mt792x_core.c | 4 ++--
13 4 files changed, 9 insertions(+), 9 deletions(-)
14
15diff --git a/mt76.h b/mt76.h
16index 05144b2c..3ff348f2 100644
17--- a/mt76.h
18+++ b/mt76.h
19@@ -798,7 +798,6 @@ struct mt76_vif {
20 u8 basic_rates_idx;
21 u8 mcast_rates_idx;
22 u8 beacon_rates_idx;
23- struct ieee80211_chanctx_conf *ctx;
24 };
25
26 struct mt76_phy {
27diff --git a/mt7921/main.c b/mt7921/main.c
28index 6a5c2cae..28c7e04b 100644
29--- a/mt7921/main.c
30+++ b/mt7921/main.c
31@@ -756,7 +756,7 @@ void mt7921_mac_sta_assoc(struct mt76_dev *mdev, struct ieee80211_vif *vif,
32
33 if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls)
34 mt76_connac_mcu_uni_add_bss(&dev->mphy, vif, &mvif->sta.wcid,
35- true, mvif->mt76.ctx);
36+ true, mvif->ctx);
37
38 ewma_avg_signal_init(&msta->avg_ack_signal);
39
40@@ -791,7 +791,7 @@ void mt7921_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
41 if (!sta->tdls)
42 mt76_connac_mcu_uni_add_bss(&dev->mphy, vif,
43 &mvif->sta.wcid, false,
44- mvif->mt76.ctx);
45+ mvif->ctx);
46 }
47
48 spin_lock_bh(&dev->mt76.sta_poll_lock);
49@@ -1208,7 +1208,7 @@ mt7921_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
50 mt792x_mutex_acquire(dev);
51
52 err = mt76_connac_mcu_uni_add_bss(phy->mt76, vif, &mvif->sta.wcid,
53- true, mvif->mt76.ctx);
54+ true, mvif->ctx);
55 if (err)
56 goto out;
57
58@@ -1240,7 +1240,7 @@ mt7921_stop_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
59 goto out;
60
61 mt76_connac_mcu_uni_add_bss(phy->mt76, vif, &mvif->sta.wcid, false,
62- mvif->mt76.ctx);
63+ mvif->ctx);
64
65 out:
66 mt792x_mutex_release(dev);
67@@ -1265,7 +1265,7 @@ static void mt7921_ctx_iter(void *priv, u8 *mac,
68 struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
69 struct ieee80211_chanctx_conf *ctx = priv;
70
71- if (ctx != mvif->mt76.ctx)
72+ if (ctx != mvif->ctx)
73 return;
74
75 if (vif->type == NL80211_IFTYPE_MONITOR)
76@@ -1298,7 +1298,7 @@ static void mt7921_mgd_prepare_tx(struct ieee80211_hw *hw,
77 jiffies_to_msecs(HZ);
78
79 mt792x_mutex_acquire(dev);
80- mt7921_set_roc(mvif->phy, mvif, mvif->mt76.ctx->def.chan, duration,
81+ mt7921_set_roc(mvif->phy, mvif, mvif->ctx->def.chan, duration,
82 MT7921_ROC_REQ_JOIN);
83 mt792x_mutex_release(dev);
84 }
85diff --git a/mt792x.h b/mt792x.h
86index 548e89fa..39cbd139 100644
87--- a/mt792x.h
88+++ b/mt792x.h
89@@ -93,6 +93,7 @@ struct mt792x_vif {
90 struct ewma_rssi rssi;
91
92 struct ieee80211_tx_queue_params queue_params[IEEE80211_NUM_ACS];
93+ struct ieee80211_chanctx_conf *ctx;
94 };
95
96 struct mt792x_phy {
97diff --git a/mt792x_core.c b/mt792x_core.c
98index 7c4a74fb..8c97ac00 100644
99--- a/mt792x_core.c
100+++ b/mt792x_core.c
101@@ -243,7 +243,7 @@ int mt792x_assign_vif_chanctx(struct ieee80211_hw *hw,
102 struct mt792x_dev *dev = mt792x_hw_dev(hw);
103
104 mutex_lock(&dev->mt76.mutex);
105- mvif->mt76.ctx = ctx;
106+ mvif->ctx = ctx;
107 mutex_unlock(&dev->mt76.mutex);
108
109 return 0;
110@@ -259,7 +259,7 @@ void mt792x_unassign_vif_chanctx(struct ieee80211_hw *hw,
111 struct mt792x_dev *dev = mt792x_hw_dev(hw);
112
113 mutex_lock(&dev->mt76.mutex);
114- mvif->mt76.ctx = NULL;
115+ mvif->ctx = NULL;
116 mutex_unlock(&dev->mt76.mutex);
117 }
118 EXPORT_SYMBOL_GPL(mt792x_unassign_vif_chanctx);
119--
1202.18.0
121