developer | 8928e84 | 2023-11-01 08:10:30 +0800 | [diff] [blame] | 1 | From 8beef73782b0b068ed1d86dcfec92f16e8297d4e Mon Sep 17 00:00:00 2001 |
developer | c83f1ac | 2023-10-23 10:30:11 +0800 | [diff] [blame] | 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Mon, 23 Oct 2023 10:25:18 +0800 |
developer | 8928e84 | 2023-11-01 08:10:30 +0800 | [diff] [blame] | 4 | Subject: [PATCH 3/6] Revert "wifi: mt76: mt7921: fix the wrong rate pickup for |
| 5 | the chanctx driver" |
developer | c83f1ac | 2023-10-23 10:30:11 +0800 | [diff] [blame] | 6 | |
| 7 | This 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 | |
| 14 | diff --git a/mac80211.c b/mac80211.c |
developer | 8928e84 | 2023-11-01 08:10:30 +0800 | [diff] [blame] | 15 | index 6232534..e7c4dc4 100644 |
developer | c83f1ac | 2023-10-23 10:30:11 +0800 | [diff] [blame] | 16 | --- a/mac80211.c |
| 17 | +++ b/mac80211.c |
developer | 8928e84 | 2023-11-01 08:10:30 +0800 | [diff] [blame] | 18 | @@ -1715,16 +1715,11 @@ mt76_init_queue(struct mt76_dev *dev, int qid, int idx, int n_desc, |
developer | c83f1ac | 2023-10-23 10:30:11 +0800 | [diff] [blame] | 19 | } |
| 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 */ |
| 37 | diff --git a/mt76.h b/mt76.h |
developer | 8928e84 | 2023-11-01 08:10:30 +0800 | [diff] [blame] | 38 | index 0a7f4f1..05144b2 100644 |
developer | c83f1ac | 2023-10-23 10:30:11 +0800 | [diff] [blame] | 39 | --- 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 | { |
| 51 | diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c |
developer | 8928e84 | 2023-11-01 08:10:30 +0800 | [diff] [blame] | 52 | index 02d5232..f2b4ec9 100644 |
developer | c83f1ac | 2023-10-23 10:30:11 +0800 | [diff] [blame] | 53 | --- 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 | -- |
| 77 | 2.18.0 |
| 78 | |