[PATCH ath-next 1/6] wifi: ath12k: encode MLD max simultaneous links as N-1

From: Hangtian Zhu

Date: Wed Nov 25 2026 - 21:07:42 EST


Firmware reports Max Number Of Simultaneous Links in raw form, but MLD
Capabilities and Operations advertises this value as N-1 per
IEEE Std 802.11be-2024 Table 9-417n.

Normalize this in ath12k_wmi_tlv_mac_phy_caps_ext_parse() before
storing pdev->cap.mld_cap, so all users consume spec-encoded values.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3

Signed-off-by: Hangtian Zhu <hangtian.zhu@xxxxxxxxxxxxxxxx>
---
drivers/net/wireless/ath/ath12k/wmi.c | 27 ++++++++++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c
index f41138a7c68e..d1af43ede2ae 100644
--- a/drivers/net/wireless/ath/ath12k/wmi.c
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
@@ -5293,11 +5293,33 @@ static void ath12k_wmi_eht_caps_parse(struct ath12k_pdev *pdev, u32 band,
cap_band->eht_cap_info_internal = le32_to_cpu(cap_info_internal);
}

+static u32 ath12k_wmi_get_spec_encoded_mld_cap(struct ath12k_base *ab, u32 mld_cap)
+{
+ struct ath12k_hw_group *ag = ath12k_ab_to_ag(ab);
+ u8 max_simul_links;
+
+ /*
+ * Firmware reports Max Number Of Simultaneous Links as raw N while
+ * IEEE 802.11be MLD Capabilities and Operations encodes it as N-1.
+ */
+ max_simul_links = u32_get_bits(mld_cap, IEEE80211_MLD_CAP_OP_MAX_SIMUL_LINKS);
+ if (max_simul_links)
+ max_simul_links--;
+ else if (ag && ag->mlo_capable)
+ ath12k_warn(ab,
+ "firmware reported invalid max simul links value 0 in mld_cap 0x%x\n",
+ mld_cap);
+
+ return u32_replace_bits(mld_cap, max_simul_links,
+ IEEE80211_MLD_CAP_OP_MAX_SIMUL_LINKS);
+}
+
static int
ath12k_wmi_tlv_mac_phy_caps_ext_parse(struct ath12k_base *ab,
const struct ath12k_wmi_caps_ext_params *caps,
struct ath12k_pdev *pdev)
{
+ u32 mld_cap;
u32 bands;
int i;

@@ -5343,8 +5365,11 @@ ath12k_wmi_tlv_mac_phy_caps_ext_parse(struct ath12k_base *ab,
caps->eht_cap_info_internal);
}

+ mld_cap = le32_to_cpu(caps->mld_capability);
+ mld_cap = ath12k_wmi_get_spec_encoded_mld_cap(ab, mld_cap);
+
pdev->cap.eml_cap = le32_to_cpu(caps->eml_capability);
- pdev->cap.mld_cap = le32_to_cpu(caps->mld_capability);
+ pdev->cap.mld_cap = mld_cap;

return 0;
}
--
2.25.1