mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt7603: implement support for SMPS
The hardware needs to be notified of peers using dynamic SMPS mode Fixes using dual-stream rates on some clients (e.g. Intel) Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -201,6 +201,18 @@ void mt7603_filter_tx(struct mt7603_dev *dev, int idx, bool abort)
|
||||
mt7603_wtbl_set_skip_tx(dev, idx, false);
|
||||
}
|
||||
|
||||
void mt7603_wtbl_set_smps(struct mt7603_dev *dev, struct mt7603_sta *sta,
|
||||
bool enabled)
|
||||
{
|
||||
u32 addr = mt7603_wtbl1_addr(sta->wcid.idx);
|
||||
|
||||
if (sta->smps == enabled)
|
||||
return;
|
||||
|
||||
mt76_rmw_field(dev, addr + 2 * 4, MT_WTBL1_W2_SMPS, enabled);
|
||||
sta->smps = enabled;
|
||||
}
|
||||
|
||||
void mt7603_wtbl_set_ps(struct mt7603_dev *dev, struct mt7603_sta *sta,
|
||||
bool enabled)
|
||||
{
|
||||
|
||||
@@ -359,6 +359,7 @@ mt7603_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
|
||||
|
||||
__skb_queue_head_init(&msta->psq);
|
||||
msta->ps = ~0;
|
||||
msta->smps = ~0;
|
||||
msta->wcid.sta = 1;
|
||||
msta->wcid.idx = idx;
|
||||
mt7603_wtbl_init(dev, idx, mvif->idx, sta->addr);
|
||||
@@ -643,6 +644,8 @@ mt7603_sta_rate_tbl_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
msta->n_rates = i;
|
||||
mt7603_wtbl_set_rates(dev, msta, NULL, msta->rates);
|
||||
msta->rate_probe = false;
|
||||
mt7603_wtbl_set_smps(dev, msta,
|
||||
sta->smps_mode == IEEE80211_SMPS_DYNAMIC);
|
||||
spin_unlock_bh(&dev->mt76.lock);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ struct mt7603_sta {
|
||||
u8 n_rates;
|
||||
|
||||
u8 rate_probe;
|
||||
u8 smps;
|
||||
|
||||
u8 ps;
|
||||
};
|
||||
@@ -235,6 +236,8 @@ int mt7603_wtbl_set_key(struct mt7603_dev *dev, int wcid,
|
||||
struct ieee80211_key_conf *key);
|
||||
void mt7603_wtbl_set_ps(struct mt7603_dev *dev, struct mt7603_sta *sta,
|
||||
bool enabled);
|
||||
void mt7603_wtbl_set_smps(struct mt7603_dev *dev, struct mt7603_sta *sta,
|
||||
bool enabled);
|
||||
void mt7603_filter_tx(struct mt7603_dev *dev, int idx, bool abort);
|
||||
|
||||
int mt7603_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
|
||||
|
||||
Reference in New Issue
Block a user