developer | bb6ddff | 2023-03-08 17:22:32 +0800 | [diff] [blame^] | 1 | From 322307272a4c4ccb627d6596220b0ab5bd4aed45 Mon Sep 17 00:00:00 2001 |
| 2 | From: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 3 | Date: Mon, 13 Feb 2023 09:46:40 +0800 |
| 4 | Subject: [PATCH 16/19] wifi: mt76: mt7996: init mpdu density |
| 5 | |
| 6 | Init mpdu density based on the hardware capability to |
| 7 | prevent hardware drop. |
| 8 | |
| 9 | Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com> |
| 10 | --- |
| 11 | mt7996/init.c | 9 +++++++-- |
| 12 | 1 file changed, 7 insertions(+), 2 deletions(-) |
| 13 | |
| 14 | diff --git a/mt7996/init.c b/mt7996/init.c |
| 15 | index ced38ac8..479b2cee 100644 |
| 16 | --- a/mt7996/init.c |
| 17 | +++ b/mt7996/init.c |
| 18 | @@ -374,10 +374,13 @@ mt7996_init_wiphy(struct ieee80211_hw *hw) |
| 19 | |
| 20 | hw->max_tx_fragments = 4; |
| 21 | |
| 22 | - if (phy->mt76->cap.has_2ghz) |
| 23 | + if (phy->mt76->cap.has_2ghz) { |
| 24 | phy->mt76->sband_2g.sband.ht_cap.cap |= |
| 25 | IEEE80211_HT_CAP_LDPC_CODING | |
| 26 | IEEE80211_HT_CAP_MAX_AMSDU; |
| 27 | + phy->mt76->sband_2g.sband.ht_cap.ampdu_density = |
| 28 | + IEEE80211_HT_MPDU_DENSITY_2; |
| 29 | + } |
| 30 | |
| 31 | if (phy->mt76->cap.has_5ghz) { |
| 32 | phy->mt76->sband_5g.sband.ht_cap.cap |= |
| 33 | @@ -389,6 +392,8 @@ mt7996_init_wiphy(struct ieee80211_hw *hw) |
| 34 | IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK | |
| 35 | IEEE80211_VHT_CAP_SHORT_GI_160 | |
| 36 | IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ; |
| 37 | + phy->mt76->sband_5g.sband.ht_cap.ampdu_density = |
| 38 | + IEEE80211_HT_MPDU_DENSITY_1; |
| 39 | } |
| 40 | |
| 41 | mt76_set_stream_caps(phy->mt76, true); |
| 42 | @@ -873,7 +878,7 @@ mt7996_init_he_caps(struct mt7996_phy *phy, enum nl80211_band band, |
| 43 | u16 cap = IEEE80211_HE_6GHZ_CAP_TX_ANTPAT_CONS | |
| 44 | IEEE80211_HE_6GHZ_CAP_RX_ANTPAT_CONS; |
| 45 | |
| 46 | - cap |= u16_encode_bits(IEEE80211_HT_MPDU_DENSITY_2, |
| 47 | + cap |= u16_encode_bits(IEEE80211_HT_MPDU_DENSITY_0_5, |
| 48 | IEEE80211_HE_6GHZ_CAP_MIN_MPDU_START) | |
| 49 | u16_encode_bits(IEEE80211_VHT_MAX_AMPDU_1024K, |
| 50 | IEEE80211_HE_6GHZ_CAP_MAX_AMPDU_LEN_EXP) | |
| 51 | -- |
| 52 | 2.39.2 |
| 53 | |