wifi: iwlwifi: mld: add debugfs to control MLO scan
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 12 Mar 2025 22:22:38 +0000 (00:22 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 18 Mar 2025 09:27:33 +0000 (10:27 +0100)
Add a debugfs entry to start/stop an MLO scan. This is required for
testing.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Benjamin Berg <benjamin.berg@intel.com>
Link: https://patch.msgid.link/20250313002008.1a1c2d285336.I5163ceb97ac797e3cf00badf79b9aa9355d7327d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/debugfs.c

index 14330da..453ce2b 100644 (file)
@@ -14,6 +14,7 @@
 #include "notif.h"
 #include "ap.h"
 #include "iwl-utils.h"
+#include "scan.h"
 #ifdef CONFIG_THERMAL
 #include "thermal.h"
 #endif
@@ -901,6 +902,33 @@ iwl_dbgfs_vif_twt_operation_write(struct iwl_mld *mld, char *buf, size_t count,
 
 VIF_DEBUGFS_WRITE_FILE_OPS(twt_operation, 256);
 
+static ssize_t iwl_dbgfs_vif_int_mlo_scan_write(struct iwl_mld *mld, char *buf,
+                                               size_t count, void *data)
+{
+       struct ieee80211_vif *vif = data;
+       u32 action;
+       int ret;
+
+       if (!vif->cfg.assoc || !ieee80211_vif_is_mld(vif))
+               return -EINVAL;
+
+       if (kstrtou32(buf, 0, &action))
+               return -EINVAL;
+
+       if (action == 0) {
+               ret = iwl_mld_scan_stop(mld, IWL_MLD_SCAN_INT_MLO, false);
+       } else if (action == 1) {
+               iwl_mld_int_mlo_scan(mld, vif);
+               ret = 0;
+       } else {
+               ret = -EINVAL;
+       }
+
+       return ret ?: count;
+}
+
+VIF_DEBUGFS_WRITE_FILE_OPS(int_mlo_scan, 32);
+
 void iwl_mld_add_vif_debugfs(struct ieee80211_hw *hw,
                             struct ieee80211_vif *vif)
 {
@@ -939,8 +967,8 @@ void iwl_mld_add_vif_debugfs(struct ieee80211_hw *hw,
        VIF_DEBUGFS_ADD_FILE(low_latency, mld_vif_dbgfs, 0600);
        VIF_DEBUGFS_ADD_FILE(twt_setup, mld_vif_dbgfs, 0200);
        VIF_DEBUGFS_ADD_FILE(twt_operation, mld_vif_dbgfs, 0200);
+       VIF_DEBUGFS_ADD_FILE(int_mlo_scan, mld_vif_dbgfs, 0200);
 }
-
 #define LINK_DEBUGFS_WRITE_FILE_OPS(name, bufsz)                       \
        WIPHY_DEBUGFS_WRITE_FILE_OPS(link_##name, bufsz, bss_conf)