From: greearb@candelatech.com
To: linux-wireless@vger.kernel.org
Cc: Ben Greear <greearb@candelatech.com>
Subject: [RFC 2/2] mac80211: Add vhash to debugfs.
Date: Wed, 3 Apr 2013 09:48:18 -0700 [thread overview]
Message-ID: <1365007698-25295-2-git-send-email-greearb@candelatech.com> (raw)
In-Reply-To: <1365007698-25295-1-git-send-email-greearb@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 2bbe377... b89b885... M net/mac80211/debugfs.c
net/mac80211/debugfs.c | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 2bbe377..b89b885 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -210,9 +210,45 @@ static ssize_t sta_hash_read(struct file *file, char __user *user_buf,
return q;
}
+static ssize_t sta_lhash_read(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ieee80211_local *local = file->private_data;
+ int mxln = STA_HASH_SIZE * 10;
+ char *buf = kzalloc(mxln, GFP_KERNEL);
+ int q, res = 0;
+ struct sta_info *sta;
+
+ if (!buf)
+ return 0;
+
+ mutex_lock(&local->sta_mtx);
+ for (q = 0; q < STA_HASH_SIZE; q++) {
+ int cnt = 0;
+ sta = local->sta_vhash[q];
+ while (sta) {
+ cnt++;
+ sta = sta->vnext;
+ }
+ if (cnt) {
+ res += sprintf(buf + res, "%i: %i\n", q, cnt);
+ if (res >= (STA_HASH_SIZE * 10)) {
+ res = STA_HASH_SIZE * 10;
+ break;
+ }
+ }
+ }
+ mutex_unlock(&local->sta_mtx);
+
+ q = simple_read_from_buffer(user_buf, count, ppos, buf, res);
+ kfree(buf);
+ return q;
+}
+
DEBUGFS_READONLY_FILE_OPS(hwflags);
DEBUGFS_READONLY_FILE_OPS(queues);
DEBUGFS_READONLY_FILE_OPS(sta_hash);
+DEBUGFS_READONLY_FILE_OPS(sta_lhash);
/* statistics stuff */
@@ -282,6 +318,7 @@ void debugfs_hw_add(struct ieee80211_local *local)
DEBUGFS_ADD(wep_iv);
DEBUGFS_ADD(queues);
DEBUGFS_ADD(sta_hash);
+ DEBUGFS_ADD(sta_lhash);
#ifdef CONFIG_PM
DEBUGFS_ADD_MODE(reset, 0200);
#endif
--
1.7.3.4
next prev parent reply other threads:[~2013-04-03 16:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-03 16:48 [RFC 1/2] mac80211: Add vif hash for multi-station RX performance greearb
2013-04-03 16:48 ` greearb [this message]
2013-04-09 9:57 ` Johannes Berg
2013-04-09 17:54 ` Ben Greear
2013-04-11 9:19 ` Johannes Berg
2013-04-11 16:11 ` Ben Greear
2013-04-23 19:42 ` Ben Greear
2013-04-23 22:06 ` Ben Greear
2013-04-24 11:01 ` Johannes Berg
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=1365007698-25295-2-git-send-email-greearb@candelatech.com \
--to=greearb@candelatech.com \
--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).