From 6b293c411d22b2bbcc5231be47905f51e1898039 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 11 Apr 2021 16:58:50 +0200 Subject: [PATCH] mt76: mt7615: always add rx header translation tlv when adding stations Ensures that header translation is disabled for interfaces that do not support it. Fixes: bb1262e7199b ("mt76: mt7615: add support for rx decapsulation offload") Signed-off-by: Felix Fietkau --- mt7615/mcu.c | 4 +++- mt76_connac_mcu.c | 6 +----- mt76_connac_mcu.h | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/mt7615/mcu.c b/mt7615/mcu.c index 8c0a21e24..cb325b0ef 100644 --- a/mt7615/mcu.c +++ b/mt7615/mcu.c @@ -1008,6 +1008,8 @@ mt7615_mcu_wtbl_sta_add(struct mt7615_phy *phy, struct ieee80211_vif *vif, if (sta) mt76_connac_mcu_wtbl_ht_tlv(&dev->mt76, wskb, sta, NULL, wtbl_hdr); + mt76_connac_mcu_wtbl_hdr_trans_tlv(wskb, &msta->wcid, NULL, + wtbl_hdr); } cmd = enable ? MCU_EXT_CMD_WTBL_UPDATE : MCU_EXT_CMD_STA_REC_UPDATE; @@ -1136,7 +1138,7 @@ int mt7615_mcu_sta_update_hdr_trans(struct mt7615_dev *dev, if (IS_ERR(wtbl_hdr)) return PTR_ERR(wtbl_hdr); - mt76_connac_mcu_wtbl_hdr_trans_tlv(skb, vif, sta, NULL, wtbl_hdr); + mt76_connac_mcu_wtbl_hdr_trans_tlv(skb, &msta->wcid, NULL, wtbl_hdr); return mt76_mcu_skb_send_msg(&dev->mt76, skb, MCU_EXT_CMD_WTBL_UPDATE, true); diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c index 4892728ad..443ec0a8b 100644 --- a/mt76_connac_mcu.c +++ b/mt76_connac_mcu.c @@ -393,11 +393,9 @@ mt76_connac_mcu_sta_uapsd(struct sk_buff *skb, struct ieee80211_vif *vif, } void mt76_connac_mcu_wtbl_hdr_trans_tlv(struct sk_buff *skb, - struct ieee80211_vif *vif, - struct ieee80211_sta *sta, + struct mt76_wcid *wcid, void *sta_wtbl, void *wtbl_tlv) { - struct mt76_wcid *wcid; struct wtbl_hdr_trans *htr; struct tlv *tlv; @@ -405,8 +403,6 @@ void mt76_connac_mcu_wtbl_hdr_trans_tlv(struct sk_buff *skb, sizeof(*htr), wtbl_tlv, sta_wtbl); htr = (struct wtbl_hdr_trans *)tlv; - - wcid = (struct mt76_wcid *)sta->drv_priv; htr->no_rx_trans = !test_bit(MT_WCID_FLAG_HDR_TRANS, &wcid->flags); } EXPORT_SYMBOL_GPL(mt76_connac_mcu_wtbl_hdr_trans_tlv); diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h index 6f9b78073..587097450 100644 --- a/mt76_connac_mcu.h +++ b/mt76_connac_mcu.h @@ -937,8 +937,7 @@ void mt76_connac_mcu_wtbl_generic_tlv(struct mt76_dev *dev, struct sk_buff *skb, struct ieee80211_sta *sta, void *sta_wtbl, void *wtbl_tlv); void mt76_connac_mcu_wtbl_hdr_trans_tlv(struct sk_buff *skb, - struct ieee80211_vif *vif, - struct ieee80211_sta *sta, + struct mt76_wcid *wcid, void *sta_wtbl, void *wtbl_tlv); void mt76_connac_mcu_sta_tlv(struct mt76_phy *mphy, struct sk_buff *skb, struct ieee80211_sta *sta,