wifi: mt76: move ampdu_state in mt76_wcid
authorLorenzo Bianconi <lorenzo@kernel.org>
Thu, 22 Jun 2023 16:50:28 +0000 (18:50 +0200)
committerFelix Fietkau <nbd@nbd.name>
Tue, 25 Jul 2023 19:59:43 +0000 (21:59 +0200)
ampdu_state field is used by most of the drivers, so move it in
mt76_wcid structure.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt76.h
drivers/net/wireless/mediatek/mt76/mt7915/mac.c
drivers/net/wireless/mediatek/mt76/mt7915/main.c
drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h
drivers/net/wireless/mediatek/mt76/mt7921/mac.c
drivers/net/wireless/mediatek/mt76/mt7921/main.c
drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h
drivers/net/wireless/mediatek/mt76/mt7996/mac.c
drivers/net/wireless/mediatek/mt76/mt7996/main.c
drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h

index 97e72cf3bc8efe2c16a87172b70e25d57e96b12f..8ec77682d8e90d80b9d86f81af46520b677bf73c 100644 (file)
@@ -316,6 +316,7 @@ struct mt76_wcid {
        int inactive_count;
 
        struct rate_info rate;
+       unsigned long ampdu_state;
 
        u16 idx;
        u8 hw_key_idx;
index 99383e4e113a0528b401339f5fde20eb1841a4ae..b58e8275feef345641072e386fd9aff7beb33c57 100644 (file)
@@ -863,7 +863,7 @@ mt7915_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
                return;
 
        msta = (struct mt7915_sta *)sta->drv_priv;
-       if (!test_and_set_bit(tid, &msta->ampdu_state))
+       if (!test_and_set_bit(tid, &msta->wcid.ampdu_state))
                ieee80211_start_tx_ba_session(sta, tid, 0);
 }
 
index f2f82eb6171344d4b5dc77cc4ef4d9f71c9df504..decb60aac9dd97011e856342b56291832059e36d 100644 (file)
@@ -836,16 +836,16 @@ mt7915_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
        case IEEE80211_AMPDU_TX_STOP_FLUSH:
        case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
                mtxq->aggr = false;
-               clear_bit(tid, &msta->ampdu_state);
+               clear_bit(tid, &msta->wcid.ampdu_state);
                ret = mt7915_mcu_add_tx_ba(dev, params, false);
                break;
        case IEEE80211_AMPDU_TX_START:
-               set_bit(tid, &msta->ampdu_state);
+               set_bit(tid, &msta->wcid.ampdu_state);
                ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
                break;
        case IEEE80211_AMPDU_TX_STOP_CONT:
                mtxq->aggr = false;
-               clear_bit(tid, &msta->ampdu_state);
+               clear_bit(tid, &msta->wcid.ampdu_state);
                ret = mt7915_mcu_add_tx_ba(dev, params, false);
                ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
                break;
index a76dcceb0ec1308a3862ead78445a26bd3b5893c..066934249a09efaaddb8cca7b66f039eadaafe2a 100644 (file)
@@ -144,7 +144,6 @@ struct mt7915_sta {
 
        unsigned long changed;
        unsigned long jiffies;
-       unsigned long ampdu_state;
        struct mt76_connac_sta_key_conf bip;
 
        struct {
index c00342e874050e2ef3c094ecfca198b96d2b6716..3e589748e1a3d3179b3e226888793497481c8d62 100644 (file)
@@ -531,7 +531,7 @@ static void mt7921_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
                return;
 
        msta = (struct mt7921_sta *)sta->drv_priv;
-       if (!test_and_set_bit(tid, &msta->ampdu_state))
+       if (!test_and_set_bit(tid, &msta->wcid.ampdu_state))
                ieee80211_start_tx_ba_session(sta, tid, 0);
 }
 
index 49053d05c164a4dbfc4ab2995f25e739f975f466..87067ac367ebd15a41aadafbc206c3031acbabf9 100644 (file)
@@ -954,16 +954,16 @@ mt7921_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
        case IEEE80211_AMPDU_TX_STOP_FLUSH:
        case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
                mtxq->aggr = false;
-               clear_bit(tid, &msta->ampdu_state);
+               clear_bit(tid, &msta->wcid.ampdu_state);
                mt7921_mcu_uni_tx_ba(dev, params, false);
                break;
        case IEEE80211_AMPDU_TX_START:
-               set_bit(tid, &msta->ampdu_state);
+               set_bit(tid, &msta->wcid.ampdu_state);
                ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
                break;
        case IEEE80211_AMPDU_TX_STOP_CONT:
                mtxq->aggr = false;
-               clear_bit(tid, &msta->ampdu_state);
+               clear_bit(tid, &msta->wcid.ampdu_state);
                mt7921_mcu_uni_tx_ba(dev, params, false);
                ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
                break;
index fe4de77a0c0758d60c5f6fd653b197cebb6b2a3b..2694ecb1fdcbdd9b2cf1767eef625febf83a5197 100644 (file)
@@ -156,7 +156,6 @@ struct mt7921_sta {
        struct ewma_avg_signal avg_ack_signal;
 
        unsigned long last_txs;
-       unsigned long ampdu_state;
 
        struct mt76_connac_sta_key_conf bip;
 };
index 2adc2599d64d2d2c62738de8d360b09eb1eaacb8..dfe70e0ff3297aa39c8a1b571ea0ee8e1850e0e8 100644 (file)
@@ -1204,7 +1204,7 @@ mt7996_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
                return;
 
        msta = (struct mt7996_sta *)sta->drv_priv;
-       if (!test_and_set_bit(tid, &msta->ampdu_state))
+       if (!test_and_set_bit(tid, &msta->wcid.ampdu_state))
                ieee80211_start_tx_ba_session(sta, tid, 0);
 }
 
index 69b47136b8d7e1cecc2ad90d511d8618e1e5a26e..54858cfc9342344b10d8d8651e771f1d47c513e6 100644 (file)
@@ -774,16 +774,16 @@ mt7996_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
        case IEEE80211_AMPDU_TX_STOP_FLUSH:
        case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
                mtxq->aggr = false;
-               clear_bit(tid, &msta->ampdu_state);
+               clear_bit(tid, &msta->wcid.ampdu_state);
                ret = mt7996_mcu_add_tx_ba(dev, params, false);
                break;
        case IEEE80211_AMPDU_TX_START:
-               set_bit(tid, &msta->ampdu_state);
+               set_bit(tid, &msta->wcid.ampdu_state);
                ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
                break;
        case IEEE80211_AMPDU_TX_STOP_CONT:
                mtxq->aggr = false;
-               clear_bit(tid, &msta->ampdu_state);
+               clear_bit(tid, &msta->wcid.ampdu_state);
                ret = mt7996_mcu_add_tx_ba(dev, params, false);
                ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
                break;
index e67d57a844267f6bf3eea3f3fb9f2c4e2f9d6be3..79cb71c16264aa9678bfa8cf51e695b8a7dff6c4 100644 (file)
@@ -111,7 +111,6 @@ struct mt7996_sta {
 
        unsigned long changed;
        unsigned long jiffies;
-       unsigned long ampdu_state;
 
        struct mt76_connac_sta_key_conf bip;