aboutsummaryrefslogtreecommitdiff
path: root/net/mac80211/debugfs_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/mac80211/debugfs_key.c')
-rw-r--r--net/mac80211/debugfs_key.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c
index c881524c872..879e7210458 100644
--- a/net/mac80211/debugfs_key.c
+++ b/net/mac80211/debugfs_key.c
@@ -10,7 +10,7 @@
#include <linux/kobject.h>
#include "ieee80211_i.h"
-#include "ieee80211_key.h"
+#include "key.h"
#include "debugfs.h"
#include "debugfs_key.h"
@@ -184,23 +184,36 @@ KEY_OPS(key);
key->debugfs.name = debugfs_create_file(#name, 0400,\
key->debugfs.dir, key, &key_##name##_ops);
-void ieee80211_debugfs_key_add(struct ieee80211_local *local,
- struct ieee80211_key *key)
-{
+void ieee80211_debugfs_key_add(struct ieee80211_key *key)
+ {
static int keycount;
- char buf[20];
+ char buf[50];
+ DECLARE_MAC_BUF(mac);
+ struct sta_info *sta;
- if (!local->debugfs.keys)
+ if (!key->local->debugfs.keys)
return;
sprintf(buf, "%d", keycount);
+ key->debugfs.cnt = keycount;
keycount++;
key->debugfs.dir = debugfs_create_dir(buf,
- local->debugfs.keys);
+ key->local->debugfs.keys);
if (!key->debugfs.dir)
return;
+ rcu_read_lock();
+ sta = rcu_dereference(key->sta);
+ if (sta)
+ sprintf(buf, "../../stations/%s", print_mac(mac, sta->addr));
+ rcu_read_unlock();
+
+ /* using sta as a boolean is fine outside RCU lock */
+ if (sta)
+ key->debugfs.stalink =
+ debugfs_create_symlink("station", key->debugfs.dir, buf);
+
DEBUGFS_ADD(keylen);
DEBUGFS_ADD(flags);
DEBUGFS_ADD(keyidx);
@@ -246,7 +259,7 @@ void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata)
if (!sdata->debugfsdir)
return;
- sprintf(buf, "../keys/%d", sdata->default_key->conf.keyidx);
+ sprintf(buf, "../keys/%d", sdata->default_key->debugfs.cnt);
sdata->debugfs.default_key =
debugfs_create_symlink("default_key", sdata->debugfsdir, buf);
}
@@ -258,19 +271,6 @@ void ieee80211_debugfs_key_remove_default(struct ieee80211_sub_if_data *sdata)
debugfs_remove(sdata->debugfs.default_key);
sdata->debugfs.default_key = NULL;
}
-void ieee80211_debugfs_key_sta_link(struct ieee80211_key *key,
- struct sta_info *sta)
-{
- char buf[50];
- DECLARE_MAC_BUF(mac);
-
- if (!key->debugfs.dir)
- return;
-
- sprintf(buf, "../../stations/%s", print_mac(mac, sta->addr));
- key->debugfs.stalink =
- debugfs_create_symlink("station", key->debugfs.dir, buf);
-}
void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key,
struct sta_info *sta)