blob: 92b04dca903e9e59c824ccd19467d0db50aeb78c [file] [log] [blame]
From 8beef73782b0b068ed1d86dcfec92f16e8297d4e Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Mon, 23 Oct 2023 10:25:18 +0800
Subject: [PATCH 3/6] Revert "wifi: mt76: mt7921: fix the wrong rate pickup for
the chanctx driver"
This reverts commit 66d5694e1898c5584a83c60876bec16909ebe2b0.
---
mac80211.c | 9 ++-------
mt76.h | 3 +--
mt76_connac_mac.c | 7 ++-----
3 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/mac80211.c b/mac80211.c
index 6232534..e7c4dc4 100644
--- a/mac80211.c
+++ b/mac80211.c
@@ -1715,16 +1715,11 @@ mt76_init_queue(struct mt76_dev *dev, int qid, int idx, int n_desc,
}
EXPORT_SYMBOL_GPL(mt76_init_queue);
-u16 mt76_calculate_default_rate(struct mt76_phy *phy,
- struct ieee80211_vif *vif, int rateidx)
+u16 mt76_calculate_default_rate(struct mt76_phy *phy, int rateidx)
{
- struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
- struct cfg80211_chan_def *chandef = mvif->ctx ?
- &mvif->ctx->def :
- &phy->chandef;
int offset = 0;
- if (chandef->chan->band != NL80211_BAND_2GHZ)
+ if (phy->chandef.chan->band != NL80211_BAND_2GHZ)
offset = 4;
/* pick the lowest rate for hidden nodes */
diff --git a/mt76.h b/mt76.h
index 0a7f4f1..05144b2 100644
--- a/mt76.h
+++ b/mt76.h
@@ -1207,8 +1207,7 @@ bool mt76_check_bin_file_mode(struct mt76_dev *dev);
struct mt76_queue *
mt76_init_queue(struct mt76_dev *dev, int qid, int idx, int n_desc,
int ring_base, u32 flags);
-u16 mt76_calculate_default_rate(struct mt76_phy *phy,
- struct ieee80211_vif *vif, int rateidx);
+u16 mt76_calculate_default_rate(struct mt76_phy *phy, int rateidx);
static inline int mt76_init_tx_queue(struct mt76_phy *phy, int qid, int idx,
int n_desc, int ring_base, u32 flags)
{
diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
index 02d5232..f2b4ec9 100644
--- a/mt76_connac_mac.c
+++ b/mt76_connac_mac.c
@@ -293,10 +293,7 @@ u16 mt76_connac2_mac_tx_rate_val(struct mt76_phy *mphy,
struct ieee80211_vif *vif,
bool beacon, bool mcast)
{
- struct mt76_vif *mvif = (struct mt76_vif *)vif->drv_priv;
- struct cfg80211_chan_def *chandef = mvif->ctx ?
- &mvif->ctx->def : &mphy->chandef;
- u8 nss = 0, mode = 0, band = chandef->chan->band;
+ u8 nss = 0, mode = 0, band = mphy->chandef.chan->band;
int rateidx = 0, mcast_rate;
if (!vif)
@@ -329,7 +326,7 @@ u16 mt76_connac2_mac_tx_rate_val(struct mt76_phy *mphy,
rateidx = ffs(vif->bss_conf.basic_rates) - 1;
legacy:
- rateidx = mt76_calculate_default_rate(mphy, vif, rateidx);
+ rateidx = mt76_calculate_default_rate(mphy, rateidx);
mode = rateidx >> 8;
rateidx &= GENMASK(7, 0);
out:
--
2.18.0