blob: 92b04dca903e9e59c824ccd19467d0db50aeb78c [file] [log] [blame]
developer8928e842023-11-01 08:10:30 +08001From 8beef73782b0b068ed1d86dcfec92f16e8297d4e Mon Sep 17 00:00:00 2001
developerc83f1ac2023-10-23 10:30:11 +08002From: Peter Chiu <chui-hao.chiu@mediatek.com>
3Date: Mon, 23 Oct 2023 10:25:18 +0800
developer8928e842023-11-01 08:10:30 +08004Subject: [PATCH 3/6] Revert "wifi: mt76: mt7921: fix the wrong rate pickup for
5 the chanctx driver"
developerc83f1ac2023-10-23 10:30:11 +08006
7This reverts commit 66d5694e1898c5584a83c60876bec16909ebe2b0.
8---
9 mac80211.c | 9 ++-------
10 mt76.h | 3 +--
11 mt76_connac_mac.c | 7 ++-----
12 3 files changed, 5 insertions(+), 14 deletions(-)
13
14diff --git a/mac80211.c b/mac80211.c
developer8928e842023-11-01 08:10:30 +080015index 6232534..e7c4dc4 100644
developerc83f1ac2023-10-23 10:30:11 +080016--- a/mac80211.c
17+++ b/mac80211.c
developer8928e842023-11-01 08:10:30 +080018@@ -1715,16 +1715,11 @@ mt76_init_queue(struct mt76_dev *dev, int qid, int idx, int n_desc,
developerc83f1ac2023-10-23 10:30:11 +080019 }
20 EXPORT_SYMBOL_GPL(mt76_init_queue);
21
22-u16 mt76_calculate_default_rate(struct mt76_phy *phy,
23- struct ieee80211_vif *vif, int rateidx)
24+u16 mt76_calculate_default_rate(struct mt76_phy *phy, int rateidx)
25 {
26- struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
27- struct cfg80211_chan_def *chandef = mvif->ctx ?
28- &mvif->ctx->def :
29- &phy->chandef;
30 int offset = 0;
31
32- if (chandef->chan->band != NL80211_BAND_2GHZ)
33+ if (phy->chandef.chan->band != NL80211_BAND_2GHZ)
34 offset = 4;
35
36 /* pick the lowest rate for hidden nodes */
37diff --git a/mt76.h b/mt76.h
developer8928e842023-11-01 08:10:30 +080038index 0a7f4f1..05144b2 100644
developerc83f1ac2023-10-23 10:30:11 +080039--- a/mt76.h
40+++ b/mt76.h
41@@ -1207,8 +1207,7 @@ bool mt76_check_bin_file_mode(struct mt76_dev *dev);
42 struct mt76_queue *
43 mt76_init_queue(struct mt76_dev *dev, int qid, int idx, int n_desc,
44 int ring_base, u32 flags);
45-u16 mt76_calculate_default_rate(struct mt76_phy *phy,
46- struct ieee80211_vif *vif, int rateidx);
47+u16 mt76_calculate_default_rate(struct mt76_phy *phy, int rateidx);
48 static inline int mt76_init_tx_queue(struct mt76_phy *phy, int qid, int idx,
49 int n_desc, int ring_base, u32 flags)
50 {
51diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
developer8928e842023-11-01 08:10:30 +080052index 02d5232..f2b4ec9 100644
developerc83f1ac2023-10-23 10:30:11 +080053--- a/mt76_connac_mac.c
54+++ b/mt76_connac_mac.c
55@@ -293,10 +293,7 @@ u16 mt76_connac2_mac_tx_rate_val(struct mt76_phy *mphy,
56 struct ieee80211_vif *vif,
57 bool beacon, bool mcast)
58 {
59- struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
60- struct cfg80211_chan_def *chandef = mvif->ctx ?
61- &mvif->ctx->def : &mphy->chandef;
62- u8 nss = 0, mode = 0, band = chandef->chan->band;
63+ u8 nss = 0, mode = 0, band = mphy->chandef.chan->band;
64 int rateidx = 0, mcast_rate;
65
66 if (!vif)
67@@ -329,7 +326,7 @@ u16 mt76_connac2_mac_tx_rate_val(struct mt76_phy *mphy,
68 rateidx = ffs(vif->bss_conf.basic_rates) - 1;
69
70 legacy:
71- rateidx = mt76_calculate_default_rate(mphy, vif, rateidx);
72+ rateidx = mt76_calculate_default_rate(mphy, rateidx);
73 mode = rateidx >> 8;
74 rateidx &= GENMASK(7, 0);
75 out:
76--
772.18.0
78