diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/dfs_debug.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/dfs_debug.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/dfs_debug.c b/drivers/net/wireless/ath/ath9k/dfs_debug.c index 90b8342d1ed4..8824610c21fb 100644 --- a/drivers/net/wireless/ath/ath9k/dfs_debug.c +++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c | |||
@@ -44,14 +44,20 @@ 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 | if (sc->dfs_detector) | ||
48 | dfs_pool_stats = sc->dfs_detector->get_stats(sc->dfs_detector); | ||
49 | |||
50 | len += scnprintf(buf + len, size - len, "DFS support for " | 47 | len += scnprintf(buf + len, size - len, "DFS support for " |
51 | "macVersion = 0x%x, macRev = 0x%x: %s\n", | 48 | "macVersion = 0x%x, macRev = 0x%x: %s\n", |
52 | hw_ver->macVersion, hw_ver->macRev, | 49 | hw_ver->macVersion, hw_ver->macRev, |
53 | (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_DFS) ? | 50 | (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_DFS) ? |
54 | "enabled" : "disabled"); | 51 | "enabled" : "disabled"); |
52 | |||
53 | if (!sc->dfs_detector) { | ||
54 | len += scnprintf(buf + len, size - len, | ||
55 | "DFS detector not enabled\n"); | ||
56 | goto exit; | ||
57 | } | ||
58 | |||
59 | dfs_pool_stats = sc->dfs_detector->get_stats(sc->dfs_detector); | ||
60 | |||
55 | len += scnprintf(buf + len, size - len, "Pulse detector statistics:\n"); | 61 | len += scnprintf(buf + len, size - len, "Pulse detector statistics:\n"); |
56 | ATH9K_DFS_STAT("pulse events reported ", pulses_total); | 62 | ATH9K_DFS_STAT("pulse events reported ", pulses_total); |
57 | ATH9K_DFS_STAT("invalid pulse events ", pulses_no_dfs); | 63 | ATH9K_DFS_STAT("invalid pulse events ", pulses_no_dfs); |
@@ -76,6 +82,7 @@ static ssize_t read_file_dfs(struct file *file, char __user *user_buf, | |||
76 | ATH9K_DFS_POOL_STAT("Seqs. alloc error ", pseq_alloc_error); | 82 | ATH9K_DFS_POOL_STAT("Seqs. alloc error ", pseq_alloc_error); |
77 | ATH9K_DFS_POOL_STAT("Seqs. in use ", pseq_used); | 83 | ATH9K_DFS_POOL_STAT("Seqs. in use ", pseq_used); |
78 | 84 | ||
85 | exit: | ||
79 | if (len > size) | 86 | if (len > size) |
80 | len = size; | 87 | len = size; |
81 | 88 | ||