wifi: mt76: mt7925: extend mt7925_mcu_uni_bss_bcnft for per-link BSS
authorSean Wang <sean.wang@mediatek.com>
Thu, 13 Jun 2024 03:02:14 +0000 (20:02 -0700)
committerFelix Fietkau <nbd@nbd.name>
Tue, 9 Jul 2024 21:01:52 +0000 (23:01 +0200)
Extend mt7925_mcu_uni_bss_bcnft 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-21-sean.wang@kernel.org
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c

index a40ad1578212ee7e6145859bc8eacc4fd32802ae..8950df09a02561952539cacd623d598620c357e1 100644 (file)
@@ -1281,10 +1281,10 @@ int mt7925_mcu_uni_bss_ps(struct mt792x_dev *dev, struct ieee80211_vif *vif)
 }
 
 static int
-mt7925_mcu_uni_bss_bcnft(struct mt792x_dev *dev, struct ieee80211_vif *vif,
-                        bool enable)
+mt7925_mcu_uni_bss_bcnft(struct mt792x_dev *dev,
+                        struct ieee80211_bss_conf *link_conf, bool enable)
 {
-       struct mt792x_vif *mvif = (struct mt792x_vif *)vif->drv_priv;
+       struct mt792x_bss_conf *mconf = mt792x_link_conf_to_mconf(link_conf);
        struct {
                struct {
                        u8 bss_idx;
@@ -1301,17 +1301,17 @@ mt7925_mcu_uni_bss_bcnft(struct mt792x_dev *dev, struct ieee80211_vif *vif,
                } __packed bcnft;
        } __packed bcnft_req = {
                .hdr = {
-                       .bss_idx = mvif->bss_conf.mt76.idx,
+                       .bss_idx = mconf->mt76.idx,
                },
                .bcnft = {
                        .tag = cpu_to_le16(UNI_BSS_INFO_BCNFT),
                        .len = cpu_to_le16(sizeof(struct bcnft_tlv)),
-                       .bcn_interval = cpu_to_le16(vif->bss_conf.beacon_int),
-                       .dtim_period = vif->bss_conf.dtim_period,
+                       .bcn_interval = cpu_to_le16(link_conf->beacon_int),
+                       .dtim_period = link_conf->dtim_period,
                },
        };
 
-       if (vif->type != NL80211_IFTYPE_STATION)
+       if (link_conf->vif->type != NL80211_IFTYPE_STATION)
                return 0;
 
        return mt76_mcu_send_msg(&dev->mt76, MCU_UNI_CMD(BSS_INFO_UPDATE),
@@ -1685,7 +1685,7 @@ int mt7925_mcu_set_beacon_filter(struct mt792x_dev *dev,
        int err = 0;
 
        if (enable) {
-               err = mt7925_mcu_uni_bss_bcnft(dev, vif, true);
+               err = mt7925_mcu_uni_bss_bcnft(dev, &vif->bss_conf, true);
                if (err)
                        return err;