wifi: mt76: mt7925: extend mt7925_mcu_bss_he_tlv for per-link BSS
authorSean Wang <sean.wang@mediatek.com>
Thu, 13 Jun 2024 03:02:05 +0000 (20:02 -0700)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jul 2024 21:01:50 +0000 (23:01 +0200)
Extend mt7925_mcu_bss_he_tlv with per-link BSS configuration.

The patch we created is a prerequisite to enable the MLO function in the
driver. It is purely a refactoring patch so the functionality should
remain unchanged.

Co-developed-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/20240613030241.5771-12-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c

index 10e38637eb83680364d65c3dbd05a95834f3622a..5332144030087b48e0c3014f5a885c7da3d165fc 100644 (file)
@@ -2238,7 +2238,7 @@ mt7925_mcu_bss_qos_tlv(struct sk_buff *skb, struct ieee80211_vif *vif)
 }
 
 static void
-mt7925_mcu_bss_he_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
+mt7925_mcu_bss_he_tlv(struct sk_buff *skb, struct ieee80211_bss_conf *link_conf,
                      struct mt792x_phy *phy)
 {
 #define DEFAULT_HE_PE_DURATION         4
@@ -2247,16 +2247,16 @@ mt7925_mcu_bss_he_tlv(struct sk_buff *skb, struct ieee80211_vif *vif,
        struct bss_info_uni_he *he;
        struct tlv *tlv;
 
-       cap = mt76_connac_get_he_phy_cap(phy->mt76, vif);
+       cap = mt76_connac_get_he_phy_cap(phy->mt76, link_conf->vif);
 
        tlv = mt76_connac_mcu_add_tlv(skb, UNI_BSS_INFO_HE_BASIC, sizeof(*he));
 
        he = (struct bss_info_uni_he *)tlv;
-       he->he_pe_duration = vif->bss_conf.htc_trig_based_pkt_ext;
+       he->he_pe_duration = link_conf->htc_trig_based_pkt_ext;
        if (!he->he_pe_duration)
                he->he_pe_duration = DEFAULT_HE_PE_DURATION;
 
-       he->he_rts_thres = cpu_to_le16(vif->bss_conf.frame_time_rts_th);
+       he->he_rts_thres = cpu_to_le16(link_conf->frame_time_rts_th);
        if (!he->he_rts_thres)
                he->he_rts_thres = cpu_to_le16(DEFAULT_HE_DURATION_RTS_THRES);
 
@@ -2341,7 +2341,7 @@ int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,
        mt7925_mcu_bss_ifs_tlv(skb, link_conf);
 
        if (link_conf->he_support) {
-               mt7925_mcu_bss_he_tlv(skb, link_conf->vif, phy);
+               mt7925_mcu_bss_he_tlv(skb, link_conf, phy);
                mt7925_mcu_bss_color_tlv(skb, link_conf, enable);
        }