| From b5cc571132a848d5daa3bec3ee07274205a98df0 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 2013/2015] 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 137c5204..37e6a627 100644 |
| --- a/mac80211.c |
| +++ b/mac80211.c |
| @@ -1710,16 +1710,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 0a7f4f14..05144b2c 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 faeae26d..431d60d3 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 |
| |