mt76: mt7915: rely on mt76_connac_mcu_sta_uapsd
authorLorenzo Bianconi <lorenzo@kernel.org>
Thu, 23 Dec 2021 12:07:38 +0000 (13:07 +0100)
committerFelix Fietkau <nbd@nbd.name>
Thu, 3 Feb 2022 12:57:57 +0000 (13:57 +0100)
Rely on mt76_connac_mcu_sta_uapsd routine in mt7915 and remove
duplicated code.

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

index b25f4ab44ad68a1ce53bc7500d34c8c8cbe0686c..bf2f1ff01e4a6f5517dca7673eda19bf78a33206 100644 (file)
@@ -418,9 +418,8 @@ void mt76_connac_mcu_sta_basic_tlv(struct sk_buff *skb,
 }
 EXPORT_SYMBOL_GPL(mt76_connac_mcu_sta_basic_tlv);
 
-static void
-mt76_connac_mcu_sta_uapsd(struct sk_buff *skb, struct ieee80211_vif *vif,
-                         struct ieee80211_sta *sta)
+void mt76_connac_mcu_sta_uapsd(struct sk_buff *skb, struct ieee80211_vif *vif,
+                              struct ieee80211_sta *sta)
 {
        struct sta_rec_uapsd *uapsd;
        struct tlv *tlv;
@@ -449,6 +448,7 @@ mt76_connac_mcu_sta_uapsd(struct sk_buff *skb, struct ieee80211_vif *vif,
        }
        uapsd->max_sp = sta->max_sp;
 }
+EXPORT_SYMBOL_GPL(mt76_connac_mcu_sta_uapsd);
 
 void mt76_connac_mcu_wtbl_hdr_trans_tlv(struct sk_buff *skb,
                                        struct ieee80211_vif *vif,
index f3c809a3ddb908979c1b84bd7e44a392e51d99d3..8d1be17886af5c517e180560f0e4b91ce2cf0c50 100644 (file)
@@ -1601,4 +1601,6 @@ int mt76_connac_mcu_bss_basic_tlv(struct sk_buff *skb,
                                  struct ieee80211_sta *sta,
                                  struct mt76_phy *phy, u8 wlan_idx,
                                  bool enable);
+void mt76_connac_mcu_sta_uapsd(struct sk_buff *skb, struct ieee80211_vif *vif,
+                              struct ieee80211_sta *sta);
 #endif /* __MT76_CONNAC_MCU_H */
index fc1602105dfcaac88dc35d8949ed6d3d399a055c..dcaff00b2a04979a8a1ee5b5b4ab6be9903c979e 100644 (file)
@@ -912,38 +912,6 @@ mt7915_mcu_sta_he_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
        he->pkt_ext = 2;
 }
 
-static void
-mt7915_mcu_sta_uapsd_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
-                    struct ieee80211_vif *vif)
-{
-       struct sta_rec_uapsd *uapsd;
-       struct tlv *tlv;
-
-       if (vif->type != NL80211_IFTYPE_AP || !sta->wme)
-               return;
-
-       tlv = mt76_connac_mcu_add_tlv(skb, STA_REC_APPS, sizeof(*uapsd));
-       uapsd = (struct sta_rec_uapsd *)tlv;
-
-       if (sta->uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VO) {
-               uapsd->dac_map |= BIT(3);
-               uapsd->tac_map |= BIT(3);
-       }
-       if (sta->uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_VI) {
-               uapsd->dac_map |= BIT(2);
-               uapsd->tac_map |= BIT(2);
-       }
-       if (sta->uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_BE) {
-               uapsd->dac_map |= BIT(1);
-               uapsd->tac_map |= BIT(1);
-       }
-       if (sta->uapsd_queues & IEEE80211_WMM_IE_STA_QOSINFO_AC_BK) {
-               uapsd->dac_map |= BIT(0);
-               uapsd->tac_map |= BIT(0);
-       }
-       uapsd->max_sp = sta->max_sp;
-}
-
 static void
 mt7915_mcu_sta_muru_tlv(struct sk_buff *skb, struct ieee80211_sta *sta,
                        struct ieee80211_vif *vif)
@@ -1829,7 +1797,7 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
                /* starec vht */
                mt7915_mcu_sta_vht_tlv(skb, sta);
                /* starec uapsd */
-               mt7915_mcu_sta_uapsd_tlv(skb, sta, vif);
+               mt76_connac_mcu_sta_uapsd(skb, vif, sta);
        }
 
        ret = mt7915_mcu_sta_wtbl_tlv(dev, skb, vif, sta);