mt7915_mcu_sta_ht_tlv() sends the SM power save bits of the HT capabilities of the association, which mac80211 does not update when the peer changes its mode by an Action frame. A later STA_REC update, for example after a firmware reset, thus restores the old mode, from which the MT7915 chip takes the stream limit of the peer. Send the current mode of the peer, as STA_REC_RA and the MMPS update already do. For the peer of a station or mesh interface, mac80211 keeps the mode disabled, since only a non-AP STA indicates it. Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets") Signed-off-by: Felix Fietkau --- .../net/wireless/mediatek/mt76/mt7915/mcu.c | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index 5da3bfaa5c53..6a19f52d9932 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -1031,6 +1031,21 @@ mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb, HE_MAC(CAP3_RX_CTRL_FRAME_TO_MULTIBSS, elem->mac_cap_info[3]); } +static enum mcu_mmps_mode +mt7915_mcu_get_mmps_mode(enum ieee80211_smps_mode smps) +{ + switch (smps) { + case IEEE80211_SMPS_OFF: + return MCU_MMPS_DISABLE; + case IEEE80211_SMPS_STATIC: + return MCU_MMPS_STATIC; + case IEEE80211_SMPS_DYNAMIC: + return MCU_MMPS_DYNAMIC; + default: + return MCU_MMPS_DISABLE; + } +} + static void mt7915_mcu_sta_ht_tlv(struct sk_buff *skb, struct ieee80211_vif *vif, struct ieee80211_sta *sta) @@ -1045,6 +1060,9 @@ mt7915_mcu_sta_ht_tlv(struct sk_buff *skb, struct ieee80211_vif *vif, if (!mvif->cap.ht_ldpc) cap &= ~IEEE80211_HT_CAP_LDPC_CODING; + u16p_replace_bits(&cap, + mt7915_mcu_get_mmps_mode(sta->deflink.smps_mode), + IEEE80211_HT_CAP_SM_PS); tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_HT, sizeof(*ht)); @@ -1429,21 +1447,6 @@ mt7915_mcu_sta_bfee_tlv(struct mt7915_dev *dev, struct sk_buff *skb, bfee->fb_identity_matrix = (nrow == 1 && tx_ant == 2); } -static enum mcu_mmps_mode -mt7915_mcu_get_mmps_mode(enum ieee80211_smps_mode smps) -{ - switch (smps) { - case IEEE80211_SMPS_OFF: - return MCU_MMPS_DISABLE; - case IEEE80211_SMPS_STATIC: - return MCU_MMPS_STATIC; - case IEEE80211_SMPS_DYNAMIC: - return MCU_MMPS_DYNAMIC; - default: - return MCU_MMPS_DISABLE; - } -} - int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev, struct ieee80211_vif *vif, struct ieee80211_sta *sta, -- 2.47.3