aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/debugfs_key.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-12-09 13:49:02 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-12-13 15:23:29 -0500
commitf7e0104c1a4e77cc4f23d5969b0677bdc4f62c63 (patch)
tree6d1622ec2f6152b611867df1b7a0269471655b53 /net/mac80211/debugfs_key.c
parentdbd2fd656f2060abfd3a16257f8b51ec60f6d2ed (diff)
mac80211: support separate default keys
Add support for split default keys (unicast and multicast) in mac80211. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/debugfs_key.c')
-rw-r--r--net/mac80211/debugfs_key.c37
1 files changed, 21 insertions, 16 deletions
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c
index 5822a6ce7671..f7ef3477c24a 100644
--- a/net/mac80211/debugfs_key.c
+++ b/net/mac80211/debugfs_key.c
@@ -274,7 +274,8 @@ void ieee80211_debugfs_key_remove(struct ieee80211_key *key)
274 debugfs_remove_recursive(key->debugfs.dir); 274 debugfs_remove_recursive(key->debugfs.dir);
275 key->debugfs.dir = NULL; 275 key->debugfs.dir = NULL;
276} 276}
277void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata) 277
278void ieee80211_debugfs_key_update_default(struct ieee80211_sub_if_data *sdata)
278{ 279{
279 char buf[50]; 280 char buf[50];
280 struct ieee80211_key *key; 281 struct ieee80211_key *key;
@@ -282,25 +283,29 @@ void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata)
282 if (!sdata->debugfs.dir) 283 if (!sdata->debugfs.dir)
283 return; 284 return;
284 285
285 /* this is running under the key lock */ 286 lockdep_assert_held(&sdata->local->key_mtx);
286 287
287 key = sdata->default_key; 288 if (sdata->default_unicast_key) {
288 if (key) { 289 key = sdata->default_unicast_key;
289 sprintf(buf, "../keys/%d", key->debugfs.cnt); 290 sprintf(buf, "../keys/%d", key->debugfs.cnt);
290 sdata->debugfs.default_key = 291 sdata->debugfs.default_unicast_key =
291 debugfs_create_symlink("default_key", 292 debugfs_create_symlink("default_unicast_key",
292 sdata->debugfs.dir, buf); 293 sdata->debugfs.dir, buf);
293 } else 294 } else {
294 ieee80211_debugfs_key_remove_default(sdata); 295 debugfs_remove(sdata->debugfs.default_unicast_key);
295} 296 sdata->debugfs.default_unicast_key = NULL;
296 297 }
297void ieee80211_debugfs_key_remove_default(struct ieee80211_sub_if_data *sdata)
298{
299 if (!sdata)
300 return;
301 298
302 debugfs_remove(sdata->debugfs.default_key); 299 if (sdata->default_multicast_key) {
303 sdata->debugfs.default_key = NULL; 300 key = sdata->default_multicast_key;
301 sprintf(buf, "../keys/%d", key->debugfs.cnt);
302 sdata->debugfs.default_multicast_key =
303 debugfs_create_symlink("default_multicast_key",
304 sdata->debugfs.dir, buf);
305 } else {
306 debugfs_remove(sdata->debugfs.default_multicast_key);
307 sdata->debugfs.default_multicast_key = NULL;
308 }
304} 309}
305 310
306void ieee80211_debugfs_key_add_mgmt_default(struct ieee80211_sub_if_data *sdata) 311void ieee80211_debugfs_key_add_mgmt_default(struct ieee80211_sub_if_data *sdata)