ath10k: add debugfs file to control radar events blocking
authorMarek Puzyniak <marek.puzyniak@tieto.com>
Wed, 20 Nov 2013 08:00:28 +0000 (10:00 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Wed, 20 Nov 2013 08:34:59 +0000 (10:34 +0200)
Sometimes for DFS testing is required to stay on current channel even after
radar detected. This patch allows to enable/disable radar detected event to be
passed to mac80211.

By default radar detected event in not blocked.

To block it:
echo 1 > /sys/kernel/debug/ieee80211/phyX/ath10k/dfs_block_radar_events

To unblock again:
echo 0 > /sys/kernel/debug/ieee80211/phyX/ath10k/dfs_block_radar_events

Inform about blocking radar detected event even when logs are disabled
for throughput/performance reasons.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/core.h
drivers/net/wireless/ath/ath10k/debug.c
drivers/net/wireless/ath/ath10k/wmi.c

index 0b88d55..7721e3b 100644 (file)
@@ -409,6 +409,7 @@ struct ath10k {
        bool monitor_present;
        unsigned int filter_flags;
        unsigned long dev_flags;
+       u32 dfs_block_radar_events;
 
        struct wmi_pdev_set_wmm_params_arg wmm_params;
        struct completion install_key_done;
index 13705d4..6bdfad3 100644 (file)
@@ -752,6 +752,10 @@ int ath10k_debug_create(struct ath10k *ar)
                                    ar->debug.debugfs_phy, ar,
                                    &fops_simulate_radar);
 
+               debugfs_create_bool("dfs_block_radar_events", S_IWUSR,
+                                   ar->debug.debugfs_phy,
+                                   &ar->dfs_block_radar_events);
+
                debugfs_create_file("dfs_stats", S_IRUSR,
                                    ar->debug.debugfs_phy, ar,
                                    &fops_dfs_stats);
index aea81d9..c654137 100644 (file)
@@ -1453,6 +1453,14 @@ static void ath10k_dfs_radar_report(struct ath10k *ar,
 
        ath10k_dbg(ATH10K_DBG_REGULATORY, "dfs radar detected\n");
        ATH10K_DFS_STAT_INC(ar, radar_detected);
+
+       /* Control radar events reporting in debugfs file
+          dfs_block_radar_events */
+       if (ar->dfs_block_radar_events) {
+               ath10k_info("DFS Radar detected, but ignored as requested\n");
+               return;
+       }
+
        ieee80211_radar_detected(ar->hw);
 }