mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
mt76: mt7915: rely on mt76_connac_mcu_wtbl_ba_tlv
Rely on mt76_connac_mcu_wtbl_ba_tlv routine in mt7915 and remove duplicated code. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
bda40f4e1d
commit
4728939c1d
+1
-1
@@ -1015,7 +1015,7 @@ void mt76_connac_mcu_wtbl_ba_tlv(struct mt76_dev *dev, struct sk_buff *skb,
|
||||
ba->rst_ba_sb = 1;
|
||||
}
|
||||
|
||||
if (is_mt7921(dev)) {
|
||||
if (is_mt7921(dev) || is_mt7915(dev)) {
|
||||
ba->ba_winsize = enable ? cpu_to_le16(params->buf_size) : 0;
|
||||
return;
|
||||
}
|
||||
|
||||
+2
-33
@@ -742,37 +742,6 @@ out:
|
||||
}
|
||||
|
||||
/** starec & wtbl **/
|
||||
static void
|
||||
mt7915_mcu_wtbl_ba_tlv(struct sk_buff *skb,
|
||||
struct ieee80211_ampdu_params *params,
|
||||
bool enable, bool tx, void *sta_wtbl,
|
||||
void *wtbl_tlv)
|
||||
{
|
||||
struct wtbl_ba *ba;
|
||||
struct tlv *tlv;
|
||||
|
||||
tlv = mt76_connac_mcu_add_nested_tlv(skb, WTBL_BA, sizeof(*ba),
|
||||
wtbl_tlv, sta_wtbl);
|
||||
|
||||
ba = (struct wtbl_ba *)tlv;
|
||||
ba->tid = params->tid;
|
||||
|
||||
if (tx) {
|
||||
ba->ba_type = MT_BA_TYPE_ORIGINATOR;
|
||||
ba->sn = enable ? cpu_to_le16(params->ssn) : 0;
|
||||
ba->ba_en = enable;
|
||||
} else {
|
||||
memcpy(ba->peer_addr, params->sta->addr, ETH_ALEN);
|
||||
ba->ba_type = MT_BA_TYPE_RECIPIENT;
|
||||
ba->rst_ba_tid = params->tid;
|
||||
ba->rst_ba_sel = RST_BA_MAC_TID_MATCH;
|
||||
ba->rst_ba_sb = 1;
|
||||
}
|
||||
|
||||
if (enable)
|
||||
ba->ba_winsize = cpu_to_le16(params->buf_size);
|
||||
}
|
||||
|
||||
static int
|
||||
mt7915_mcu_sta_ba(struct mt7915_dev *dev,
|
||||
struct ieee80211_ampdu_params *params,
|
||||
@@ -800,8 +769,8 @@ mt7915_mcu_sta_ba(struct mt7915_dev *dev,
|
||||
if (IS_ERR(wtbl_hdr))
|
||||
return PTR_ERR(wtbl_hdr);
|
||||
|
||||
mt7915_mcu_wtbl_ba_tlv(skb, params, enable, tx, sta_wtbl, wtbl_hdr);
|
||||
|
||||
mt76_connac_mcu_wtbl_ba_tlv(&dev->mt76, skb, params, enable, tx,
|
||||
sta_wtbl, wtbl_hdr);
|
||||
ret = mt76_mcu_skb_send_msg(&dev->mt76, skb,
|
||||
MCU_EXT_CMD(STA_REC_UPDATE), true);
|
||||
if (ret)
|
||||
|
||||
Reference in New Issue
Block a user