diff --git a/mt7603/mac.c b/mt7603/mac.c index af400fd8..e0d7ddc6 100644 --- a/mt7603/mac.c +++ b/mt7603/mac.c @@ -160,8 +160,8 @@ void mt7603_wtbl_set_ps(struct mt7603_dev *dev, int idx, bool enabled) { u32 addr = mt7603_wtbl1_addr(idx); u32 reg = mt76_rr(dev, addr + 3 * 4); - u32 val = (reg & ~MT_WTBL1_W3_SKIP_TX) | - (enabled * MT_WTBL1_W3_SKIP_TX); + u32 val = (reg & ~MT_WTBL1_W3_POWER_SAVE) | + (enabled * MT_WTBL1_W3_POWER_SAVE); if (reg == val) return; @@ -171,6 +171,19 @@ void mt7603_wtbl_set_ps(struct mt7603_dev *dev, int idx, bool enabled) mt76_clear(dev, MT_WTBL1_OR, MT_WTBL1_OR_PSM_WRITE); } +void mt7603_wtbl_set_skip_tx(struct mt7603_dev *dev, int idx, bool enabled) +{ + u32 addr = mt7603_wtbl1_addr(idx); + u32 reg = mt76_rr(dev, addr + 3 * 4); + u32 val = (reg & ~MT_WTBL1_W3_SKIP_TX) | + (enabled * MT_WTBL1_W3_SKIP_TX); + + if (reg == val) + return; + + mt76_wr(dev, addr + 3 * 4, val); +} + void mt7603_wtbl_clear(struct mt7603_dev *dev, int idx) { int wtbl2_frame_size = MT_PSE_PAGE_SIZE / MT_WTBL2_SIZE; @@ -874,7 +887,7 @@ int mt7603_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, } else { if (info->flags & (IEEE80211_TX_CTL_NO_PS_BUFFER | IEEE80211_TX_CTL_CLEAR_PS_FILT)) - mt7603_wtbl_set_ps(dev, wcid->idx, false); + mt7603_wtbl_set_skip_tx(dev, wcid->idx, false); } pid = mt76_tx_status_skb_add(mdev, wcid, skb); diff --git a/mt7603/main.c b/mt7603/main.c index aeb2eddf..fa5f21f1 100644 --- a/mt7603/main.c +++ b/mt7603/main.c @@ -95,7 +95,7 @@ mt7603_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif) eth_broadcast_addr(bc_addr); mt7603_wtbl_init(dev, idx, mvif->idx, bc_addr); - mt7603_wtbl_set_ps(dev, idx, false); + mt7603_wtbl_set_skip_tx(dev, idx, false); rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid); mt7603_txq_init(dev, vif->txq); @@ -336,7 +336,7 @@ mt7603_sta_ps(struct mt76_dev *mdev, struct ieee80211_sta *sta, bool ps) int idx = msta->wcid.idx; mt76_stop_tx_queues(&dev->mt76, sta, false); - mt7603_wtbl_set_ps(dev, idx, ps); + mt7603_wtbl_set_skip_tx(dev, idx, ps); } static int diff --git a/mt7603/mt7603.h b/mt7603/mt7603.h index 1358ccf3..5af35566 100644 --- a/mt7603/mt7603.h +++ b/mt7603/mt7603.h @@ -208,7 +208,8 @@ void mt7603_wtbl_set_rates(struct mt7603_dev *dev, struct mt7603_sta *sta, struct ieee80211_tx_rate *rates); 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, int idx, bool val); +void mt7603_wtbl_set_ps(struct mt7603_dev *dev, int idx, bool enabled); +void mt7603_wtbl_set_skip_tx(struct mt7603_dev *dev, int idx, bool val); int mt7603_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, struct sk_buff *skb, struct mt76_queue *q,