developer | 70180b0 | 2023-11-14 17:01:47 +0800 | [diff] [blame] | 1 | From 02120d0ab9b6d2f864706c2a0d6583c7b8fc60e8 Mon Sep 17 00:00:00 2001 |
| 2 | From: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 3 | Date: Tue, 31 Oct 2023 16:28:52 +0800 |
| 4 | Subject: [PATCH] wifi: mt76: mt7915: add cheetah eeprom related fix |
| 5 | |
| 6 | Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com> |
| 7 | --- |
| 8 | mt7915/eeprom.h | 3 ++- |
| 9 | mt7915/main.c | 5 +++-- |
| 10 | 2 files changed, 5 insertions(+), 3 deletions(-) |
| 11 | |
| 12 | diff --git a/mt7915/eeprom.h b/mt7915/eeprom.h |
| 13 | index 9056d78..a1ab05a 100644 |
| 14 | --- a/mt7915/eeprom.h |
| 15 | +++ b/mt7915/eeprom.h |
| 16 | @@ -160,7 +160,8 @@ static inline bool |
| 17 | mt7915_tssi_enabled(struct mt7915_dev *dev, enum nl80211_band band) |
| 18 | { |
| 19 | u8 *eep = dev->mt76.eeprom.data; |
| 20 | - u8 val = eep[MT_EE_WIFI_CONF + 7]; |
| 21 | + u8 offs = is_mt7981(&dev->mt76) ? 8 : 7; |
| 22 | + u8 val = eep[MT_EE_WIFI_CONF + offs]; |
| 23 | |
| 24 | if (band == NL80211_BAND_2GHZ) |
| 25 | return val & MT_EE_WIFI_CONF7_TSSI0_2G; |
| 26 | diff --git a/mt7915/main.c b/mt7915/main.c |
| 27 | index 797a3b4..9ab93f4 100644 |
| 28 | --- a/mt7915/main.c |
| 29 | +++ b/mt7915/main.c |
| 30 | @@ -1110,8 +1110,9 @@ mt7915_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant) |
| 31 | |
| 32 | phy->mt76->antenna_mask = tx_ant; |
| 33 | |
| 34 | - /* handle a variant of mt7916 which has 3T3R but nss2 on 5 GHz band */ |
| 35 | - if (is_mt7916(&dev->mt76) && band && hweight8(tx_ant) == max_nss) |
| 36 | + /* handle a variant of mt7916/mt7981 which has 3T3R but nss2 on 5 GHz band */ |
| 37 | + if ((is_mt7916(&dev->mt76) || is_mt7981(&dev->mt76)) && |
| 38 | + band && hweight8(tx_ant) == max_nss) |
| 39 | phy->mt76->chainmask = (dev->chainmask >> chainshift) << chainshift; |
| 40 | else |
| 41 | phy->mt76->chainmask = tx_ant << (chainshift * band); |
| 42 | -- |
| 43 | 2.18.0 |
| 44 | |