aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/dfs_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/dfs_debug.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/dfs_debug.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath/ath9k/dfs_debug.c b/drivers/net/wireless/ath/ath9k/dfs_debug.c
index 3c6e4138a95d..90b8342d1ed4 100644
--- a/drivers/net/wireless/ath/ath9k/dfs_debug.c
+++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c
@@ -20,16 +20,16 @@
20 20
21#include "ath9k.h" 21#include "ath9k.h"
22#include "dfs_debug.h" 22#include "dfs_debug.h"
23#include "../dfs_pattern_detector.h"
23 24
24 25static struct ath_dfs_pool_stats dfs_pool_stats = { 0 };
25struct ath_dfs_pool_stats global_dfs_pool_stats = { 0 };
26 26
27#define ATH9K_DFS_STAT(s, p) \ 27#define ATH9K_DFS_STAT(s, p) \
28 len += snprintf(buf + len, size - len, "%28s : %10u\n", s, \ 28 len += scnprintf(buf + len, size - len, "%28s : %10u\n", s, \
29 sc->debug.stats.dfs_stats.p); 29 sc->debug.stats.dfs_stats.p);
30#define ATH9K_DFS_POOL_STAT(s, p) \ 30#define ATH9K_DFS_POOL_STAT(s, p) \
31 len += snprintf(buf + len, size - len, "%28s : %10u\n", s, \ 31 len += scnprintf(buf + len, size - len, "%28s : %10u\n", s, \
32 global_dfs_pool_stats.p); 32 dfs_pool_stats.p);
33 33
34static ssize_t read_file_dfs(struct file *file, char __user *user_buf, 34static ssize_t read_file_dfs(struct file *file, char __user *user_buf,
35 size_t count, loff_t *ppos) 35 size_t count, loff_t *ppos)
@@ -44,12 +44,15 @@ static ssize_t read_file_dfs(struct file *file, char __user *user_buf,
44 if (buf == NULL) 44 if (buf == NULL)
45 return -ENOMEM; 45 return -ENOMEM;
46 46
47 len += snprintf(buf + len, size - len, "DFS support for " 47 if (sc->dfs_detector)
48 "macVersion = 0x%x, macRev = 0x%x: %s\n", 48 dfs_pool_stats = sc->dfs_detector->get_stats(sc->dfs_detector);
49 hw_ver->macVersion, hw_ver->macRev, 49
50 (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_DFS) ? 50 len += scnprintf(buf + len, size - len, "DFS support for "
51 "macVersion = 0x%x, macRev = 0x%x: %s\n",
52 hw_ver->macVersion, hw_ver->macRev,
53 (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_DFS) ?
51 "enabled" : "disabled"); 54 "enabled" : "disabled");
52 len += snprintf(buf + len, size - len, "Pulse detector statistics:\n"); 55 len += scnprintf(buf + len, size - len, "Pulse detector statistics:\n");
53 ATH9K_DFS_STAT("pulse events reported ", pulses_total); 56 ATH9K_DFS_STAT("pulse events reported ", pulses_total);
54 ATH9K_DFS_STAT("invalid pulse events ", pulses_no_dfs); 57 ATH9K_DFS_STAT("invalid pulse events ", pulses_no_dfs);
55 ATH9K_DFS_STAT("DFS pulses detected ", pulses_detected); 58 ATH9K_DFS_STAT("DFS pulses detected ", pulses_detected);
@@ -59,11 +62,12 @@ static ssize_t read_file_dfs(struct file *file, char __user *user_buf,
59 ATH9K_DFS_STAT("Primary channel pulses ", pri_phy_errors); 62 ATH9K_DFS_STAT("Primary channel pulses ", pri_phy_errors);
60 ATH9K_DFS_STAT("Secondary channel pulses", ext_phy_errors); 63 ATH9K_DFS_STAT("Secondary channel pulses", ext_phy_errors);
61 ATH9K_DFS_STAT("Dual channel pulses ", dc_phy_errors); 64 ATH9K_DFS_STAT("Dual channel pulses ", dc_phy_errors);
62 len += snprintf(buf + len, size - len, "Radar detector statistics " 65 len += scnprintf(buf + len, size - len, "Radar detector statistics "
63 "(current DFS region: %d)\n", sc->dfs_detector->region); 66 "(current DFS region: %d)\n",
67 sc->dfs_detector->region);
64 ATH9K_DFS_STAT("Pulse events processed ", pulses_processed); 68 ATH9K_DFS_STAT("Pulse events processed ", pulses_processed);
65 ATH9K_DFS_STAT("Radars detected ", radar_detected); 69 ATH9K_DFS_STAT("Radars detected ", radar_detected);
66 len += snprintf(buf + len, size - len, "Global Pool statistics:\n"); 70 len += scnprintf(buf + len, size - len, "Global Pool statistics:\n");
67 ATH9K_DFS_POOL_STAT("Pool references ", pool_reference); 71 ATH9K_DFS_POOL_STAT("Pool references ", pool_reference);
68 ATH9K_DFS_POOL_STAT("Pulses allocated ", pulse_allocated); 72 ATH9K_DFS_POOL_STAT("Pulses allocated ", pulse_allocated);
69 ATH9K_DFS_POOL_STAT("Pulses alloc error ", pulse_alloc_error); 73 ATH9K_DFS_POOL_STAT("Pulses alloc error ", pulse_alloc_error);