diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-12-09 13:49:02 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-12-13 15:23:29 -0500 |
commit | f7e0104c1a4e77cc4f23d5969b0677bdc4f62c63 (patch) | |
tree | 6d1622ec2f6152b611867df1b7a0269471655b53 /net/mac80211/debugfs_key.c | |
parent | dbd2fd656f2060abfd3a16257f8b51ec60f6d2ed (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.c | 37 |
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 | } |
277 | void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata) | 277 | |
278 | void 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 | } | |
297 | void 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 | ||
306 | void ieee80211_debugfs_key_add_mgmt_default(struct ieee80211_sub_if_data *sdata) | 311 | void ieee80211_debugfs_key_add_mgmt_default(struct ieee80211_sub_if_data *sdata) |