[PATCH] wifi: mt76: mt7925: introduce MLO capability control
Khan, Sabeeh
sabeeh-khan at ti.com
Wed Feb 19 12:21:29 PST 2025
Hi Mingyen,
On 2/17/2025 2:17 AM, Mingyen Hsieh wrote:
> From: Ming Yen Hsieh <mingyen.hsieh at mediatek.com>
>
> This patch introduces MLO capability control for the MT792x Wi-Fi driver.
> It removes the unused `MT792x_CHIP_CAP_MLO_EVT_EN` flag and introduces new
> capability flags `MT792x_CHIP_CAP_MLO_EN` and `MT792x_CHIP_CAP_MLO_EML_EN`
> to enable MLO and EML features based on firmware capabilities.
>
> Signed-off-by: Ming Yen Hsieh <mingyen.hsieh at mediatek.com>
> ---
> drivers/net/wireless/mediatek/mt76/mt7925/main.c | 2 +-
> drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 10 ++++++++--
> drivers/net/wireless/mediatek/mt76/mt792x.h | 3 ++-
> 3 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
> index 98daf80ac131..ad47a4b153da 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
> @@ -251,7 +251,7 @@ int mt7925_init_mlo_caps(struct mt792x_phy *phy)
> },
> };
>
> - if (!(phy->chip_cap & MT792x_CHIP_CAP_MLO_EVT_EN))
> + if (!(phy->chip_cap & MT792x_CHIP_CAP_MLO_EN))
> return 0;
>
> ext_capab[0].eml_capabilities = phy->eml_cap;
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
> index 15815ad84713..5f40c3c1ffa1 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
> @@ -2559,6 +2559,7 @@ mt7925_mcu_bss_mld_tlv(struct sk_buff *skb,
> struct ieee80211_vif *vif = link_conf->vif;
> struct mt792x_bss_conf *mconf = mt792x_link_conf_to_mconf(link_conf);
> struct mt792x_vif *mvif = (struct mt792x_vif *)link_conf->vif->drv_priv;
> + struct mt792x_phy *phy = mvif->phy;
> struct bss_mld_tlv *mld;
> struct tlv *tlv;
> bool is_mld;
> @@ -2574,8 +2575,13 @@ mt7925_mcu_bss_mld_tlv(struct sk_buff *skb,
> mld->group_mld_id = is_mld ? mvif->bss_conf.mt76.idx : 0xff;
> mld->own_mld_id = mconf->mt76.idx + 32;
> mld->remap_idx = 0xff;
> - mld->eml_enable = !!(link_conf->vif->cfg.eml_cap &
> - IEEE80211_EML_CAP_EMLSR_SUPP);
> +
> + if (phy->chip_cap & MT792x_CHIP_CAP_MLO_EML_EN) {
> + mld->eml_enable = !!(link_conf->vif->cfg.eml_cap &
> + IEEE80211_EML_CAP_EMLSR_SUPP);
> + } else {
> + mld->eml_enable = 0;
> + }
>
> memcpy(mld->mac_addr, vif->addr, ETH_ALEN);
> }
> diff --git a/drivers/net/wireless/mediatek/mt76/mt792x.h b/drivers/net/wireless/mediatek/mt76/mt792x.h
> index 32ed01a96bf7..454c6f523cc2 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt792x.h
> +++ b/drivers/net/wireless/mediatek/mt76/mt792x.h
> @@ -27,8 +27,9 @@
>
> #define MT792x_CHIP_CAP_CLC_EVT_EN BIT(0)
> #define MT792x_CHIP_CAP_RSSI_NOTIFY_EVT_EN BIT(1)
> -#define MT792x_CHIP_CAP_MLO_EVT_EN BIT(2)
> #define MT792x_CHIP_CAP_WF_RF_PIN_CTRL_EVT_EN BIT(3)
> +#define MT792x_CHIP_CAP_MLO_EN BIT(8)
> +#define MT792x_CHIP_CAP_MLO_EML_EN BIT(9)
>
> /* NOTE: used to map mt76_rates. idx may change if firmware expands table */
> #define MT792x_BASIC_RATES_TBL 11
Reviewed-by: Sabeeh Khan <sabeeh-khan at ti.com>
More information about the Linux-mediatek
mailing list