linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saravana <saravanad@posedge.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: RFC[1/4] mac80211: add statistic to debugfs
Date: Mon, 26 Nov 2012 10:45:46 +0530	[thread overview]
Message-ID: <50B2FB02.3090504@posedge.com> (raw)

Provide additional statistic support to the debugfs.

Number of rx packets dropped due to mic failure:
Currently the debugfs has support for number of rx packets dropped. But 
it doesn't classify the reason for the drop. This statistic will count 
the number of rx packet dropped due to mic failure.

Signed-off-by: Saravana <saravanad@posedge.com>
---
The diff file is generated from wireless-testing git tree.
  net/mac80211/debugfs_sta.c |    1 +
  net/mac80211/sta_info.h    |    2 ++
  net/mac80211/wpa.c         |    1 +
  3 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 89281d2..3bdaedb 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -377,6 +377,7 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
  	DEBUGFS_ADD_COUNTER(rx_duplicates, num_duplicates);
  	DEBUGFS_ADD_COUNTER(rx_fragments, rx_fragments);
  	DEBUGFS_ADD_COUNTER(rx_dropped, rx_dropped);
+	DEBUGFS_ADD_COUNTER(rx_dropped_mic_failure,rx_dropped_mic_failure);
  	DEBUGFS_ADD_COUNTER(tx_fragments, tx_fragments);
  	DEBUGFS_ADD_COUNTER(tx_filtered, tx_filtered_count);
  	DEBUGFS_ADD_COUNTER(tx_retry_failed, tx_retry_failed);
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 776f3d0..5ee25b2 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -247,6 +247,7 @@ struct sta_ampdu_mlme {
   * @num_duplicates: number of duplicate frames received from this STA
   * @rx_fragments: number of received MPDUs
   * @rx_dropped: number of dropped MPDUs from this STA
+ * @rx_dropped_mic_failure: number of dropped MPDUs due to mic failure 
from this STA
   * @last_signal: signal of last received frame from this STA
   * @avg_signal: moving average of signal of received frames from this STA
   * @last_seq_ctrl: last received seq/frag number from this STA (per RX 
queue)
@@ -326,6 +327,7 @@ struct sta_info {
  	unsigned long num_duplicates;
  	unsigned long rx_fragments;
  	unsigned long rx_dropped;
+	unsigned long rx_dropped_mic_failure;
  	int last_signal;
  	struct ewma avg_signal;
  	/* Plus 1 for non-QoS frames */
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
old mode 100644
new mode 100755
index 8bd2f5c..960403e
--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
@@ -166,6 +166,7 @@ mic_fail:
  	 * a driver that supports HW encryption. Send up the key idx only if
  	 * the key is set.
  	 */
+	rx->sta->rx_dropped_mic_failure++;
  	mac80211_ev_michael_mic_failure(rx->sdata,
  					rx->key ? rx->key->conf.keyidx : -1,
  					(void *) skb->data, NULL, GFP_ATOMIC);

                 reply	other threads:[~2012-11-26  5:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50B2FB02.3090504@posedge.com \
    --to=saravanad@posedge.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).