Commit c50d105a authored by Felix Fietkau's avatar Felix Fietkau

mt76: move mt76_check_agg_ssn to driver tx_prepare calls

mt7615 and newer drivers do not need this, since they use sequence number offload
Moving this code also reduces the number of callsites to make it easier to review
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 577dbc6c
...@@ -905,6 +905,7 @@ void mt76_txq_remove(struct mt76_dev *dev, struct ieee80211_txq *txq); ...@@ -905,6 +905,7 @@ void mt76_txq_remove(struct mt76_dev *dev, struct ieee80211_txq *txq);
void mt76_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq); void mt76_wake_tx_queue(struct ieee80211_hw *hw, struct ieee80211_txq *txq);
void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta, void mt76_stop_tx_queues(struct mt76_dev *dev, struct ieee80211_sta *sta,
bool send_bar); bool send_bar);
void mt76_tx_check_agg_ssn(struct ieee80211_sta *sta, struct sk_buff *skb);
void mt76_txq_schedule(struct mt76_phy *phy, enum mt76_txq_id qid); void mt76_txq_schedule(struct mt76_phy *phy, enum mt76_txq_id qid);
void mt76_txq_schedule_all(struct mt76_phy *phy); void mt76_txq_schedule_all(struct mt76_phy *phy);
void mt76_tx_tasklet(unsigned long data); void mt76_tx_tasklet(unsigned long data);
......
...@@ -1036,6 +1036,8 @@ int mt7603_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr, ...@@ -1036,6 +1036,8 @@ int mt7603_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
IEEE80211_TX_CTL_CLEAR_PS_FILT)) || IEEE80211_TX_CTL_CLEAR_PS_FILT)) ||
(info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE)) (info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE))
mt7603_wtbl_set_ps(dev, msta, false); mt7603_wtbl_set_ps(dev, msta, false);
mt76_tx_check_agg_ssn(sta, tx_info->skb);
} }
pid = mt76_tx_status_skb_add(mdev, wcid, tx_info->skb); pid = mt76_tx_status_skb_add(mdev, wcid, tx_info->skb);
......
...@@ -349,6 +349,8 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi, ...@@ -349,6 +349,8 @@ void mt76x02_mac_write_txwi(struct mt76x02_dev *dev, struct mt76x02_txwi *txwi,
memset(txwi, 0, sizeof(*txwi)); memset(txwi, 0, sizeof(*txwi));
mt76_tx_check_agg_ssn(sta, skb);
if (!info->control.hw_key && wcid && wcid->hw_key_idx != 0xff && if (!info->control.hw_key && wcid && wcid->hw_key_idx != 0xff &&
ieee80211_has_protected(hdr->frame_control)) { ieee80211_has_protected(hdr->frame_control)) {
wcid = NULL; wcid = NULL;
......
...@@ -83,17 +83,27 @@ mt76_txq_get_qid(struct ieee80211_txq *txq) ...@@ -83,17 +83,27 @@ mt76_txq_get_qid(struct ieee80211_txq *txq)
return txq->ac; return txq->ac;
} }
static void void
mt76_check_agg_ssn(struct mt76_txq *mtxq, struct sk_buff *skb) mt76_tx_check_agg_ssn(struct ieee80211_sta *sta, struct sk_buff *skb)
{ {
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
struct ieee80211_txq *txq;
struct mt76_txq *mtxq;
u8 tid;
if (!ieee80211_is_data_qos(hdr->frame_control) || if (!sta || !ieee80211_is_data_qos(hdr->frame_control) ||
!ieee80211_is_data_present(hdr->frame_control)) !ieee80211_is_data_present(hdr->frame_control))
return; return;
tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
txq = sta->txq[tid];
mtxq = (struct mt76_txq *)txq->drv_priv;
if (!mtxq->aggr)
return;
mtxq->agg_ssn = le16_to_cpu(hdr->seq_ctrl) + 0x10; mtxq->agg_ssn = le16_to_cpu(hdr->seq_ctrl) + 0x10;
} }
EXPORT_SYMBOL_GPL(mt76_tx_check_agg_ssn);
void void
mt76_tx_status_lock(struct mt76_dev *dev, struct sk_buff_head *list) mt76_tx_status_lock(struct mt76_dev *dev, struct sk_buff_head *list)
...@@ -288,19 +298,6 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta, ...@@ -288,19 +298,6 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta,
ieee80211_get_tx_rates(info->control.vif, sta, skb, ieee80211_get_tx_rates(info->control.vif, sta, skb,
info->control.rates, 1); info->control.rates, 1);
if (sta && ieee80211_is_data_qos(hdr->frame_control)) {
struct ieee80211_txq *txq;
struct mt76_txq *mtxq;
u8 tid;
tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
txq = sta->txq[tid];
mtxq = (struct mt76_txq *)txq->drv_priv;
if (mtxq->aggr)
mt76_check_agg_ssn(mtxq, skb);
}
if (ext_phy) if (ext_phy)
info->hw_queue |= MT_TX_HW_QUEUE_EXT_PHY; info->hw_queue |= MT_TX_HW_QUEUE_EXT_PHY;
...@@ -390,9 +387,6 @@ mt76_release_buffered_frames(struct ieee80211_hw *hw, struct ieee80211_sta *sta, ...@@ -390,9 +387,6 @@ mt76_release_buffered_frames(struct ieee80211_hw *hw, struct ieee80211_sta *sta,
if (!skb) if (!skb)
break; break;
if (mtxq->aggr)
mt76_check_agg_ssn(mtxq, skb);
nframes--; nframes--;
if (last_skb) if (last_skb)
mt76_queue_ps_skb(dev, sta, last_skb, false); mt76_queue_ps_skb(dev, sta, last_skb, false);
...@@ -446,9 +440,6 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_sw_queue *sq, ...@@ -446,9 +440,6 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_sw_queue *sq,
ampdu = IEEE80211_SKB_CB(skb)->flags & IEEE80211_TX_CTL_AMPDU; ampdu = IEEE80211_SKB_CB(skb)->flags & IEEE80211_TX_CTL_AMPDU;
limit = ampdu ? 16 : 3; limit = ampdu ? 16 : 3;
if (ampdu)
mt76_check_agg_ssn(mtxq, skb);
idx = dev->queue_ops->tx_queue_skb(dev, qid, skb, wcid, txq->sta); idx = dev->queue_ops->tx_queue_skb(dev, qid, skb, wcid, txq->sta);
if (idx < 0) if (idx < 0)
...@@ -479,9 +470,6 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_sw_queue *sq, ...@@ -479,9 +470,6 @@ mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_sw_queue *sq,
info->control.rates[0] = tx_rate; info->control.rates[0] = tx_rate;
if (cur_ampdu)
mt76_check_agg_ssn(mtxq, skb);
idx = dev->queue_ops->tx_queue_skb(dev, qid, skb, wcid, idx = dev->queue_ops->tx_queue_skb(dev, qid, skb, wcid,
txq->sta); txq->sta);
if (idx < 0) if (idx < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment