diff options
Diffstat (limited to 'net/mac80211/debugfs_key.c')
-rw-r--r-- | net/mac80211/debugfs_key.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c index c881524c8725..459f0767fae5 100644 --- a/net/mac80211/debugfs_key.c +++ b/net/mac80211/debugfs_key.c | |||
@@ -184,23 +184,35 @@ KEY_OPS(key); | |||
184 | key->debugfs.name = debugfs_create_file(#name, 0400,\ | 184 | key->debugfs.name = debugfs_create_file(#name, 0400,\ |
185 | key->debugfs.dir, key, &key_##name##_ops); | 185 | key->debugfs.dir, key, &key_##name##_ops); |
186 | 186 | ||
187 | void ieee80211_debugfs_key_add(struct ieee80211_local *local, | 187 | void ieee80211_debugfs_key_add(struct ieee80211_key *key) |
188 | struct ieee80211_key *key) | 188 | { |
189 | { | ||
190 | static int keycount; | 189 | static int keycount; |
191 | char buf[20]; | 190 | char buf[50]; |
191 | DECLARE_MAC_BUF(mac); | ||
192 | struct sta_info *sta; | ||
192 | 193 | ||
193 | if (!local->debugfs.keys) | 194 | if (!key->local->debugfs.keys) |
194 | return; | 195 | return; |
195 | 196 | ||
196 | sprintf(buf, "%d", keycount); | 197 | sprintf(buf, "%d", keycount); |
197 | keycount++; | 198 | keycount++; |
198 | key->debugfs.dir = debugfs_create_dir(buf, | 199 | key->debugfs.dir = debugfs_create_dir(buf, |
199 | local->debugfs.keys); | 200 | key->local->debugfs.keys); |
200 | 201 | ||
201 | if (!key->debugfs.dir) | 202 | if (!key->debugfs.dir) |
202 | return; | 203 | return; |
203 | 204 | ||
205 | rcu_read_lock(); | ||
206 | sta = rcu_dereference(key->sta); | ||
207 | if (sta) | ||
208 | sprintf(buf, "../../stations/%s", print_mac(mac, sta->addr)); | ||
209 | rcu_read_unlock(); | ||
210 | |||
211 | /* using sta as a boolean is fine outside RCU lock */ | ||
212 | if (sta) | ||
213 | key->debugfs.stalink = | ||
214 | debugfs_create_symlink("station", key->debugfs.dir, buf); | ||
215 | |||
204 | DEBUGFS_ADD(keylen); | 216 | DEBUGFS_ADD(keylen); |
205 | DEBUGFS_ADD(flags); | 217 | DEBUGFS_ADD(flags); |
206 | DEBUGFS_ADD(keyidx); | 218 | DEBUGFS_ADD(keyidx); |
@@ -258,19 +270,6 @@ void ieee80211_debugfs_key_remove_default(struct ieee80211_sub_if_data *sdata) | |||
258 | debugfs_remove(sdata->debugfs.default_key); | 270 | debugfs_remove(sdata->debugfs.default_key); |
259 | sdata->debugfs.default_key = NULL; | 271 | sdata->debugfs.default_key = NULL; |
260 | } | 272 | } |
261 | void ieee80211_debugfs_key_sta_link(struct ieee80211_key *key, | ||
262 | struct sta_info *sta) | ||
263 | { | ||
264 | char buf[50]; | ||
265 | DECLARE_MAC_BUF(mac); | ||
266 | |||
267 | if (!key->debugfs.dir) | ||
268 | return; | ||
269 | |||
270 | sprintf(buf, "../../stations/%s", print_mac(mac, sta->addr)); | ||
271 | key->debugfs.stalink = | ||
272 | debugfs_create_symlink("station", key->debugfs.dir, buf); | ||
273 | } | ||
274 | 273 | ||
275 | void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key, | 274 | void ieee80211_debugfs_key_sta_del(struct ieee80211_key *key, |
276 | struct sta_info *sta) | 275 | struct sta_info *sta) |