@@ -175,8 +175,44 @@ static ssize_t queues_read(struct file *file, char __user *user_buf,
return simple_read_from_buffer(user_buf, count, ppos, buf, res);
}
+static ssize_t sta_hash_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_hash[q];
+ while (sta) {
+ cnt++;
+ sta = sta->hnext;
+ }
+ 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);
/* statistics stuff */
@@ -245,6 +281,7 @@ void debugfs_hw_add(struct ieee80211_local *local)
DEBUGFS_ADD(total_ps_buffered);
DEBUGFS_ADD(wep_iv);
DEBUGFS_ADD(queues);
+ DEBUGFS_ADD(sta_hash);
#ifdef CONFIG_PM
DEBUGFS_ADD_MODE(reset, 0200);
#endif