Skip to content
Permalink
Browse files

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 <nbd@nbd.name>
  • Loading branch information
nbd168 committed Jan 20, 2019
1 parent 158529d commit fc31457cd99cb85c8cea9329eedc5edd80038f29
Showing with 18 additions and 0 deletions.
  1. +12 −0 mt7603/mac.c
  2. +3 −0 mt7603/main.c
  3. +3 −0 mt7603/mt7603.h
@@ -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,

0 comments on commit fc31457

Please sign in to comment.
You can’t perform that action at this time.