mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7996: rework mt7996_ampdu_action to support MLO
Active/de-active TX/RX BA sessssion for each active links running mt7996_ampdu_action routine. Signed-off-by: Lorenzo Bianconi <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
70717b761a
commit
d01b9d300e
+56
-33
@@ -1257,12 +1257,13 @@ mt7996_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
enum ieee80211_ampdu_mlme_action action = params->action;
|
||||
struct mt7996_dev *dev = mt7996_hw_dev(hw);
|
||||
struct ieee80211_sta *sta = params->sta;
|
||||
struct ieee80211_txq *txq = sta->txq[params->tid];
|
||||
struct mt7996_sta *msta = (struct mt7996_sta *)sta->drv_priv;
|
||||
struct mt7996_sta_link *msta_link = &msta->deflink;
|
||||
struct ieee80211_txq *txq = sta->txq[params->tid];
|
||||
struct ieee80211_link_sta *link_sta;
|
||||
u16 tid = params->tid;
|
||||
u16 ssn = params->ssn;
|
||||
struct mt76_txq *mtxq;
|
||||
unsigned int link_id;
|
||||
int ret = 0;
|
||||
|
||||
if (!txq)
|
||||
@@ -1272,38 +1273,60 @@ mt7996_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
||||
|
||||
mutex_lock(&dev->mt76.mutex);
|
||||
|
||||
switch (action) {
|
||||
case IEEE80211_AMPDU_RX_START:
|
||||
mt76_rx_aggr_start(&dev->mt76, &msta_link->wcid, tid, ssn,
|
||||
params->buf_size);
|
||||
ret = mt7996_mcu_add_rx_ba(dev, params, true);
|
||||
break;
|
||||
case IEEE80211_AMPDU_RX_STOP:
|
||||
mt76_rx_aggr_stop(&dev->mt76, &msta_link->wcid, tid);
|
||||
ret = mt7996_mcu_add_rx_ba(dev, params, false);
|
||||
break;
|
||||
case IEEE80211_AMPDU_TX_OPERATIONAL:
|
||||
mtxq->aggr = true;
|
||||
mtxq->send_bar = false;
|
||||
ret = mt7996_mcu_add_tx_ba(dev, params, true);
|
||||
break;
|
||||
case IEEE80211_AMPDU_TX_STOP_FLUSH:
|
||||
case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
|
||||
mtxq->aggr = false;
|
||||
clear_bit(tid, &msta_link->wcid.ampdu_state);
|
||||
ret = mt7996_mcu_add_tx_ba(dev, params, false);
|
||||
break;
|
||||
case IEEE80211_AMPDU_TX_START:
|
||||
set_bit(tid, &msta_link->wcid.ampdu_state);
|
||||
ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
|
||||
break;
|
||||
case IEEE80211_AMPDU_TX_STOP_CONT:
|
||||
mtxq->aggr = false;
|
||||
clear_bit(tid, &msta_link->wcid.ampdu_state);
|
||||
ret = mt7996_mcu_add_tx_ba(dev, params, false);
|
||||
ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
|
||||
break;
|
||||
for_each_sta_active_link(vif, sta, link_sta, link_id) {
|
||||
struct mt7996_sta_link *msta_link;
|
||||
struct mt7996_vif_link *link;
|
||||
|
||||
msta_link = mt76_dereference(msta->link[link_id], &dev->mt76);
|
||||
if (!msta_link)
|
||||
continue;
|
||||
|
||||
link = mt7996_vif_link(dev, vif, link_id);
|
||||
if (!link)
|
||||
continue;
|
||||
|
||||
switch (action) {
|
||||
case IEEE80211_AMPDU_RX_START:
|
||||
mt76_rx_aggr_start(&dev->mt76, &msta_link->wcid, tid,
|
||||
ssn, params->buf_size);
|
||||
ret = mt7996_mcu_add_rx_ba(dev, params, link, true);
|
||||
break;
|
||||
case IEEE80211_AMPDU_RX_STOP:
|
||||
mt76_rx_aggr_stop(&dev->mt76, &msta_link->wcid, tid);
|
||||
ret = mt7996_mcu_add_rx_ba(dev, params, link, false);
|
||||
break;
|
||||
case IEEE80211_AMPDU_TX_OPERATIONAL:
|
||||
mtxq->aggr = true;
|
||||
mtxq->send_bar = false;
|
||||
ret = mt7996_mcu_add_tx_ba(dev, params, link,
|
||||
msta_link, true);
|
||||
break;
|
||||
case IEEE80211_AMPDU_TX_STOP_FLUSH:
|
||||
case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
|
||||
mtxq->aggr = false;
|
||||
clear_bit(tid, &msta_link->wcid.ampdu_state);
|
||||
ret = mt7996_mcu_add_tx_ba(dev, params, link,
|
||||
msta_link, false);
|
||||
break;
|
||||
case IEEE80211_AMPDU_TX_START:
|
||||
set_bit(tid, &msta_link->wcid.ampdu_state);
|
||||
ret = IEEE80211_AMPDU_TX_START_IMMEDIATE;
|
||||
break;
|
||||
case IEEE80211_AMPDU_TX_STOP_CONT:
|
||||
mtxq->aggr = false;
|
||||
clear_bit(tid, &msta_link->wcid.ampdu_state);
|
||||
ret = mt7996_mcu_add_tx_ba(dev, params, link,
|
||||
msta_link, false);
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret)
|
||||
break;
|
||||
}
|
||||
|
||||
if (action == IEEE80211_AMPDU_TX_STOP_CONT)
|
||||
ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
|
||||
|
||||
mutex_unlock(&dev->mt76.mutex);
|
||||
|
||||
return ret;
|
||||
|
||||
+5
-11
@@ -1160,26 +1160,20 @@ mt7996_mcu_sta_ba(struct mt7996_dev *dev, struct mt76_vif_link *mvif,
|
||||
/** starec & wtbl **/
|
||||
int mt7996_mcu_add_tx_ba(struct mt7996_dev *dev,
|
||||
struct ieee80211_ampdu_params *params,
|
||||
bool enable)
|
||||
struct mt7996_vif_link *link,
|
||||
struct mt7996_sta_link *msta_link, bool enable)
|
||||
{
|
||||
struct mt7996_sta *msta = (struct mt7996_sta *)params->sta->drv_priv;
|
||||
struct mt7996_sta_link *msta_link = &msta->deflink;
|
||||
struct mt7996_vif *mvif = msta->vif;
|
||||
|
||||
if (enable && !params->amsdu)
|
||||
msta_link->wcid.amsdu = false;
|
||||
|
||||
return mt7996_mcu_sta_ba(dev, &mvif->deflink.mt76, params, enable, true);
|
||||
return mt7996_mcu_sta_ba(dev, &link->mt76, params, enable, true);
|
||||
}
|
||||
|
||||
int mt7996_mcu_add_rx_ba(struct mt7996_dev *dev,
|
||||
struct ieee80211_ampdu_params *params,
|
||||
bool enable)
|
||||
struct mt7996_vif_link *link, bool enable)
|
||||
{
|
||||
struct mt7996_sta *msta = (struct mt7996_sta *)params->sta->drv_priv;
|
||||
struct mt7996_vif *mvif = msta->vif;
|
||||
|
||||
return mt7996_mcu_sta_ba(dev, &mvif->deflink.mt76, params, enable, false);
|
||||
return mt7996_mcu_sta_ba(dev, &link->mt76, params, enable, false);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+3
-2
@@ -584,10 +584,11 @@ int mt7996_mcu_teardown_mld_sta(struct mt7996_dev *dev,
|
||||
struct mt7996_sta_link *msta_link);
|
||||
int mt7996_mcu_add_tx_ba(struct mt7996_dev *dev,
|
||||
struct ieee80211_ampdu_params *params,
|
||||
bool add);
|
||||
struct mt7996_vif_link *link,
|
||||
struct mt7996_sta_link *msta_link, bool enable);
|
||||
int mt7996_mcu_add_rx_ba(struct mt7996_dev *dev,
|
||||
struct ieee80211_ampdu_params *params,
|
||||
bool add);
|
||||
struct mt7996_vif_link *link, bool enable);
|
||||
int mt7996_mcu_update_bss_color(struct mt7996_dev *dev,
|
||||
struct mt76_vif_link *mlink,
|
||||
struct cfg80211_he_bss_color *he_bss_color);
|
||||
|
||||
Reference in New Issue
Block a user