Commit f8a80a4e authored by Sean Wang's avatar Sean Wang Committed by Felix Fietkau

wifi: mt76: mt7925: update mt7925_mcu_bss_mld_tlv for MLO

update mt7925_mcu_bss_mld_tlv for the MLO-enabled firmware,
the change remains compatible with the non-MLO mode and the
older firmware.
Co-developed-by: default avatarMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: default avatarMing Yen Hsieh <mingyen.hsieh@mediatek.com>
Co-developed-by: default avatarDeren Wu <deren.wu@mediatek.com>
Signed-off-by: default avatarDeren Wu <deren.wu@mediatek.com>
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Link: https://patch.msgid.link/2d89b93bcfd92e7c6987aaa0a3c4637e605ac154.1720248331.git.sean.wang@kernel.orgSigned-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 254f777a
...@@ -2393,24 +2393,29 @@ mt7925_mcu_bss_bmc_tlv(struct sk_buff *skb, struct mt792x_phy *phy, ...@@ -2393,24 +2393,29 @@ mt7925_mcu_bss_bmc_tlv(struct sk_buff *skb, struct mt792x_phy *phy,
static void static void
mt7925_mcu_bss_mld_tlv(struct sk_buff *skb, mt7925_mcu_bss_mld_tlv(struct sk_buff *skb,
struct ieee80211_bss_conf *link_conf, struct ieee80211_bss_conf *link_conf)
struct ieee80211_link_sta *link_sta)
{ {
struct mt792x_bss_conf *mconf = mt792x_link_conf_to_mconf(link_conf); struct mt792x_bss_conf *mconf = mt792x_link_conf_to_mconf(link_conf);
bool is_mld = ieee80211_vif_is_mld(link_conf->vif); struct mt792x_vif *mvif = (struct mt792x_vif *)link_conf->vif->drv_priv;
struct bss_mld_tlv *mld; struct bss_mld_tlv *mld;
struct tlv *tlv; struct tlv *tlv;
bool is_mld;
is_mld = ieee80211_vif_is_mld(link_conf->vif) ||
(hweight16(mvif->valid_links) > 1);
tlv = mt76_connac_mcu_add_tlv(skb, UNI_BSS_INFO_MLD, sizeof(*mld)); tlv = mt76_connac_mcu_add_tlv(skb, UNI_BSS_INFO_MLD, sizeof(*mld));
mld = (struct bss_mld_tlv *)tlv; mld = (struct bss_mld_tlv *)tlv;
mld->link_id = link_sta ? (is_mld ? link_conf->link_id : 0) : 0xff; mld->link_id = is_mld ? link_conf->link_id : 0xff;
mld->group_mld_id = is_mld ? mconf->mt76.idx : 0xff; /* apply the index of the primary link */
mld->group_mld_id = is_mld ? mvif->bss_conf.mt76.idx : 0xff;
mld->own_mld_id = mconf->mt76.idx + 32; mld->own_mld_id = mconf->mt76.idx + 32;
mld->remap_idx = 0xff; mld->remap_idx = 0xff;
mld->eml_enable = !!(link_conf->vif->cfg.eml_cap &
IEEE80211_EML_CAP_EMLSR_SUPP);
if (link_sta) memcpy(mld->mac_addr, link_conf->addr, ETH_ALEN);
memcpy(mld->mac_addr, link_sta->addr, ETH_ALEN);
} }
static void static void
...@@ -2520,10 +2525,9 @@ int mt7925_mcu_add_bss_info(struct mt792x_phy *phy, ...@@ -2520,10 +2525,9 @@ int mt7925_mcu_add_bss_info(struct mt792x_phy *phy,
mt7925_mcu_bss_basic_tlv(skb, link_conf, link_sta, ctx, phy->mt76, mt7925_mcu_bss_basic_tlv(skb, link_conf, link_sta, ctx, phy->mt76,
mvif->sta.deflink.wcid.idx, enable); mvif->sta.deflink.wcid.idx, enable);
mt7925_mcu_bss_sec_tlv(skb, link_conf); mt7925_mcu_bss_sec_tlv(skb, link_conf);
mt7925_mcu_bss_bmc_tlv(skb, phy, ctx, link_conf); mt7925_mcu_bss_bmc_tlv(skb, phy, ctx, link_conf);
mt7925_mcu_bss_qos_tlv(skb, link_conf); mt7925_mcu_bss_qos_tlv(skb, link_conf);
mt7925_mcu_bss_mld_tlv(skb, link_conf, link_sta); mt7925_mcu_bss_mld_tlv(skb, link_conf);
mt7925_mcu_bss_ifs_tlv(skb, link_conf); mt7925_mcu_bss_ifs_tlv(skb, link_conf);
if (link_conf->he_support) { if (link_conf->he_support) {
......
...@@ -366,7 +366,10 @@ struct bss_mld_tlv { ...@@ -366,7 +366,10 @@ struct bss_mld_tlv {
u8 mac_addr[ETH_ALEN]; u8 mac_addr[ETH_ALEN];
u8 remap_idx; u8 remap_idx;
u8 link_id; u8 link_id;
u8 __rsv[2]; u8 eml_enable;
u8 max_link_num;
u8 hybrid_mode;
u8 __rsv[3];
} __packed; } __packed;
struct sta_rec_ba_uni { struct sta_rec_ba_uni {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment