mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: mt7915: fix SMPS operation fail
TGn fails sending SM power save mode action frame to the AP to switch from dynamic SMPS mode to static mode. Reported-by: Fang Zhao <[email protected]> Signed-off-by: Fang Zhao <[email protected]> Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
+38
-28
@@ -1752,33 +1752,6 @@ int mt7915_mcu_sta_update_hdr_trans(struct mt7915_dev *dev,
|
||||
true);
|
||||
}
|
||||
|
||||
int mt7915_mcu_add_smps(struct mt7915_dev *dev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta)
|
||||
{
|
||||
struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
|
||||
struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
|
||||
struct wtbl_req_hdr *wtbl_hdr;
|
||||
struct tlv *sta_wtbl;
|
||||
struct sk_buff *skb;
|
||||
|
||||
skb = mt7915_mcu_alloc_sta_req(dev, mvif, msta,
|
||||
MT7915_STA_UPDATE_MAX_SIZE);
|
||||
if (IS_ERR(skb))
|
||||
return PTR_ERR(skb);
|
||||
|
||||
sta_wtbl = mt7915_mcu_add_tlv(skb, STA_REC_WTBL, sizeof(struct tlv));
|
||||
|
||||
wtbl_hdr = mt7915_mcu_alloc_wtbl_req(dev, msta, WTBL_SET, sta_wtbl,
|
||||
&skb);
|
||||
if (IS_ERR(wtbl_hdr))
|
||||
return PTR_ERR(wtbl_hdr);
|
||||
|
||||
mt7915_mcu_wtbl_smps_tlv(skb, sta, sta_wtbl, wtbl_hdr);
|
||||
|
||||
return mt76_mcu_skb_send_msg(&dev->mt76, skb,
|
||||
MCU_EXT_CMD(STA_REC_UPDATE), true);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
mt7915_is_ebf_supported(struct mt7915_phy *phy, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta, bool bfee)
|
||||
@@ -2076,7 +2049,11 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev,
|
||||
case RATE_PARAM_FIXED_MCS:
|
||||
case RATE_PARAM_FIXED_GI:
|
||||
case RATE_PARAM_FIXED_HE_LTF:
|
||||
ra->phy = *phy;
|
||||
if (phy)
|
||||
ra->phy = *phy;
|
||||
break;
|
||||
case RATE_PARAM_MMPS_UPDATE:
|
||||
ra->mmps_mode = (sta->smps_mode == IEEE80211_SMPS_DYNAMIC);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -2087,6 +2064,39 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev,
|
||||
MCU_EXT_CMD(STA_REC_UPDATE), true);
|
||||
}
|
||||
|
||||
int mt7915_mcu_add_smps(struct mt7915_dev *dev, struct ieee80211_vif *vif,
|
||||
struct ieee80211_sta *sta)
|
||||
{
|
||||
struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
|
||||
struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
|
||||
struct wtbl_req_hdr *wtbl_hdr;
|
||||
struct tlv *sta_wtbl;
|
||||
struct sk_buff *skb;
|
||||
int ret;
|
||||
|
||||
skb = mt7915_mcu_alloc_sta_req(dev, mvif, msta,
|
||||
MT7915_STA_UPDATE_MAX_SIZE);
|
||||
if (IS_ERR(skb))
|
||||
return PTR_ERR(skb);
|
||||
|
||||
sta_wtbl = mt7915_mcu_add_tlv(skb, STA_REC_WTBL, sizeof(struct tlv));
|
||||
|
||||
wtbl_hdr = mt7915_mcu_alloc_wtbl_req(dev, msta, WTBL_SET, sta_wtbl,
|
||||
&skb);
|
||||
if (IS_ERR(wtbl_hdr))
|
||||
return PTR_ERR(wtbl_hdr);
|
||||
|
||||
mt7915_mcu_wtbl_smps_tlv(skb, sta, sta_wtbl, wtbl_hdr);
|
||||
|
||||
ret = mt76_mcu_skb_send_msg(&dev->mt76, skb,
|
||||
MCU_EXT_CMD(STA_REC_UPDATE), true);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return mt7915_mcu_set_fixed_rate_ctrl(dev, vif, sta, NULL,
|
||||
RATE_PARAM_MMPS_UPDATE);
|
||||
}
|
||||
|
||||
static int
|
||||
mt7915_mcu_add_rate_ctrl_fixed(struct mt7915_dev *dev,
|
||||
struct ieee80211_vif *vif,
|
||||
|
||||
@@ -960,6 +960,7 @@ struct sta_rec_ra_fixed {
|
||||
|
||||
enum {
|
||||
RATE_PARAM_FIXED = 3,
|
||||
RATE_PARAM_MMPS_UPDATE = 5,
|
||||
RATE_PARAM_FIXED_HE_LTF = 7,
|
||||
RATE_PARAM_FIXED_MCS,
|
||||
RATE_PARAM_FIXED_GI = 11,
|
||||
|
||||
Reference in New Issue
Block a user