[PATCH ath-next 6/6] wifi: ath12k: add debugfs control for EMLSR support advertisement

From: Hangtian Zhu

Date: Wed Nov 25 2026 - 21:08:06 EST


Add eml_capa_present under the per-radio ath12k debugfs directory for
MLO-capable hardware groups to toggle the advertised
IEEE80211_EML_CAP_EMLSR_SUPP bit.

Use this control before station association or AP startup to validate
host-side EML capability advertisement and exercise combinations with the
maximum simultaneous-link advertisement without firmware changes.

Read the current value directly from the station iftype's advertised EML
capabilities. Reject enabling EMLSR if any local radio lacks firmware
support.

Update only the IEEE80211_EML_CAP_EMLSR_SUPP bit in the station and AP
entries, preserving other capability fields and leaving the generic entry
unchanged.

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/debugfs.c | 78 +++++++++++++++++++++++
1 file changed, 78 insertions(+)

diff --git a/drivers/net/wireless/ath/ath12k/debugfs.c b/drivers/net/wireless/ath/ath12k/debugfs.c
index 657bdd4c7744..9852769cbbd3 100644
--- a/drivers/net/wireless/ath/ath12k/debugfs.c
+++ b/drivers/net/wireless/ath/ath12k/debugfs.c
@@ -1670,6 +1670,81 @@ static const struct file_operations fops_mlo_max_simultaneous_links = {
.llseek = default_llseek,
};

+static void ath12k_debugfs_set_emlsr_support(struct ath12k_hw *ah, bool enable)
+{
+ int i;
+
+ lockdep_assert_wiphy(ah->hw->wiphy);
+
+ for (i = 0; i < ARRAY_SIZE(ah->iftypes_ext_capa); i++) {
+ enum nl80211_iftype iftype = ah->iftypes_ext_capa[i].iftype;
+
+ if (iftype != NL80211_IFTYPE_STATION && iftype != NL80211_IFTYPE_AP)
+ continue;
+
+ ah->iftypes_ext_capa[i].eml_capabilities =
+ u16_replace_bits(ah->iftypes_ext_capa[i].eml_capabilities,
+ enable, IEEE80211_EML_CAP_EMLSR_SUPP);
+ }
+}
+
+static ssize_t ath12k_write_emlsr_support(struct file *file,
+ const char __user *ubuf,
+ size_t count, loff_t *ppos)
+{
+ struct ath12k_hw *ah = file->private_data;
+ struct ath12k *ar;
+ int ret;
+ u8 val;
+ int i;
+
+ ret = kstrtou8_from_user(ubuf, count, 0, &val);
+ if (ret)
+ return ret;
+
+ if (val > 1)
+ return -EINVAL;
+
+ guard(wiphy)(ah->hw->wiphy);
+ if (val) {
+ for_each_ar(ah, ar, i) {
+ if (!(ar->pdev->cap.eml_cap & IEEE80211_EML_CAP_EMLSR_SUPP))
+ return -EOPNOTSUPP;
+ }
+ }
+ ath12k_debugfs_set_emlsr_support(ah, val);
+
+ return count;
+}
+
+static ssize_t ath12k_read_emlsr_support(struct file *file, char __user *ubuf,
+ size_t count, loff_t *ppos)
+{
+ const struct wiphy_iftype_ext_capab *iftype_ext_capa;
+ struct ath12k_hw *ah = file->private_data;
+ u8 emlsr_support;
+ char buf[8];
+ int len;
+
+ scoped_guard(wiphy, ah->hw->wiphy) {
+ iftype_ext_capa = cfg80211_get_iftype_ext_capa(ah->hw->wiphy,
+ NL80211_IFTYPE_STATION);
+ emlsr_support = u16_get_bits(iftype_ext_capa->eml_capabilities,
+ IEEE80211_EML_CAP_EMLSR_SUPP);
+ }
+ len = scnprintf(buf, sizeof(buf), "%u\n", emlsr_support);
+
+ return simple_read_from_buffer(ubuf, count, ppos, buf, len);
+}
+
+static const struct file_operations fops_emlsr_support = {
+ .read = ath12k_read_emlsr_support,
+ .write = ath12k_write_emlsr_support,
+ .open = simple_open,
+ .owner = THIS_MODULE,
+ .llseek = default_llseek,
+};
+
void ath12k_debugfs_register(struct ath12k *ar)
{
struct ath12k_base *ab = ar->ab;
@@ -1737,6 +1812,9 @@ void ath12k_debugfs_register(struct ath12k *ar)
debugfs_create_file("mlo_max_simultaneous_links", 0644,
ar->debug.debugfs_pdev, ah,
&fops_mlo_max_simultaneous_links);
+ debugfs_create_file("eml_capa_present", 0644,
+ ar->debug.debugfs_pdev, ah,
+ &fops_emlsr_support);
}

void ath12k_debugfs_unregister(struct ath12k *ar)
--
2.25.1