diff options
author | Zefir Kurtisi <zefir.kurtisi@neratec.com> | 2012-04-20 19:20:34 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-04-23 23:37:41 +0400 |
commit | b96f20b3afff36f30baa1e1e121ccbf7518a988d (patch) | |
tree | c9d58d8719c06b42ef50efb53552c101f995c305 /drivers/net/wireless/ath/ath9k/dfs_pri_detector.c | |
parent | 2a5783b817c90ce6fb82a21e103335d1ecbac430 (diff) | |
download | linux-b96f20b3afff36f30baa1e1e121ccbf7518a988d.tar.xz |
ath9k: extend DFS detector stats in dfs_debugfs
Extend debugfs entry for dfs_stats with DFS detection events
and shared pool statistics.
Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/dfs_pri_detector.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/dfs_pri_detector.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c b/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c index ecb6334fd20f..91b8dceeadb1 100644 --- a/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c +++ b/drivers/net/wireless/ath/ath9k/dfs_pri_detector.c @@ -17,8 +17,10 @@ #include <linux/slab.h> #include <linux/spinlock.h> +#include "ath9k.h" #include "dfs_pattern_detector.h" #include "dfs_pri_detector.h" +#include "dfs_debug.h" /** * struct pri_sequence - sequence of pulses matching one PRI @@ -101,6 +103,7 @@ static void pool_register_ref(void) { spin_lock_bh(&pool_lock); singleton_pool_references++; + DFS_POOL_STAT_INC(pool_reference); spin_unlock_bh(&pool_lock); } @@ -108,6 +111,7 @@ static void pool_deregister_ref(void) { spin_lock_bh(&pool_lock); singleton_pool_references--; + DFS_POOL_STAT_DEC(pool_reference); if (singleton_pool_references == 0) { /* free singleton pools with no references left */ struct pri_sequence *ps, *ps0; @@ -115,10 +119,12 @@ static void pool_deregister_ref(void) list_for_each_entry_safe(p, p0, &pulse_pool, head) { list_del(&p->head); + DFS_POOL_STAT_DEC(pulse_allocated); kfree(p); } list_for_each_entry_safe(ps, ps0, &pseq_pool, head) { list_del(&ps->head); + DFS_POOL_STAT_DEC(pseq_allocated); kfree(ps); } } @@ -129,6 +135,7 @@ static void pool_put_pulse_elem(struct pulse_elem *pe) { spin_lock_bh(&pool_lock); list_add(&pe->head, &pulse_pool); + DFS_POOL_STAT_DEC(pulse_used); spin_unlock_bh(&pool_lock); } @@ -136,6 +143,7 @@ static void pool_put_pseq_elem(struct pri_sequence *pse) { spin_lock_bh(&pool_lock); list_add(&pse->head, &pseq_pool); + DFS_POOL_STAT_DEC(pseq_used); spin_unlock_bh(&pool_lock); } @@ -146,6 +154,7 @@ static struct pri_sequence *pool_get_pseq_elem(void) if (!list_empty(&pseq_pool)) { pse = list_first_entry(&pseq_pool, struct pri_sequence, head); list_del(&pse->head); + DFS_POOL_STAT_INC(pseq_used); } spin_unlock_bh(&pool_lock); return pse; @@ -158,6 +167,7 @@ static struct pulse_elem *pool_get_pulse_elem(void) if (!list_empty(&pulse_pool)) { pe = list_first_entry(&pulse_pool, struct pulse_elem, head); list_del(&pe->head); + DFS_POOL_STAT_INC(pulse_used); } spin_unlock_bh(&pool_lock); return pe; @@ -210,9 +220,11 @@ static bool pulse_queue_enqueue(struct pri_detector *pde, u64 ts) if (p == NULL) { p = kmalloc(sizeof(*p), GFP_KERNEL); if (p == NULL) { - pr_err("failed to allocate pulse_elem\n"); + DFS_POOL_STAT_INC(pulse_alloc_error); return false; } + DFS_POOL_STAT_INC(pulse_allocated); + DFS_POOL_STAT_INC(pulse_used); } INIT_LIST_HEAD(&p->head); p->ts = ts; @@ -288,8 +300,12 @@ static bool pseq_handler_create_sequences(struct pri_detector *pde, new_ps = pool_get_pseq_elem(); if (new_ps == NULL) { new_ps = kmalloc(sizeof(*new_ps), GFP_KERNEL); - if (new_ps == NULL) + if (new_ps == NULL) { + DFS_POOL_STAT_INC(pseq_alloc_error); return false; + } + DFS_POOL_STAT_INC(pseq_allocated); + DFS_POOL_STAT_INC(pseq_used); } memcpy(new_ps, &ps, sizeof(ps)); INIT_LIST_HEAD(&new_ps->head); |