diff options
author | Jiri Benc <jbenc@suse.cz> | 2007-05-05 11:46:38 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-05-05 11:46:38 -0700 |
commit | e9f207f0ff90bf60b825800d7450e6f2ff2eab88 (patch) | |
tree | 22bd39116f2cae8d4ce6169eb91e4b9a7204770f /net/mac80211/ieee80211_ioctl.c | |
parent | f0706e828e96d0fa4e80c0d25aa98523f6d589a0 (diff) |
[MAC80211]: Add debugfs attributes.
Export various mac80211 internal variables through debugfs.
Signed-off-by: Jiri Benc <jbenc@suse.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mac80211/ieee80211_ioctl.c')
-rw-r--r-- | net/mac80211/ieee80211_ioctl.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c index 73909ec85f2a..352f03bd8a3a 100644 --- a/net/mac80211/ieee80211_ioctl.c +++ b/net/mac80211/ieee80211_ioctl.c @@ -25,6 +25,7 @@ #include "ieee80211_rate.h" #include "wpa.h" #include "aes_ccm.h" +#include "debugfs_key.h" static int ieee80211_regdom = 0x10; /* FCC */ module_param(ieee80211_regdom, int, 0444); @@ -180,8 +181,11 @@ static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr, } kfree(keyconf); - if (set_tx_key || sdata->default_key == key) + if (set_tx_key || sdata->default_key == key) { + ieee80211_debugfs_key_remove_default(sdata); sdata->default_key = NULL; + } + ieee80211_debugfs_key_remove(key); if (sta) sta->key = NULL; else @@ -221,13 +225,19 @@ static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr, } } - if (set_tx_key || sdata->default_key == old_key) + if (set_tx_key || sdata->default_key == old_key) { + ieee80211_debugfs_key_remove_default(sdata); sdata->default_key = NULL; + } + ieee80211_debugfs_key_remove(old_key); if (sta) sta->key = key; else sdata->keys[idx] = key; ieee80211_key_free(old_key); + ieee80211_debugfs_key_add(local, key); + if (sta) + ieee80211_debugfs_key_sta_link(key, sta); if (try_hwaccel && (alg == ALG_WEP || alg == ALG_TKIP || alg == ALG_CCMP)) @@ -236,6 +246,8 @@ static int ieee80211_set_encryption(struct net_device *dev, u8 *sta_addr, if (set_tx_key || (!sta && !sdata->default_key && key)) { sdata->default_key = key; + if (key) + ieee80211_debugfs_key_add_default(sdata); if (local->ops->set_key_idx && local->ops->set_key_idx(local_to_hw(local), idx)) @@ -1505,8 +1517,12 @@ static int ieee80211_ioctl_siwencode(struct net_device *dev, alg = ALG_NONE; else if (erq->length == 0) { /* No key data - just set the default TX key index */ - if (sdata->default_key != sdata->keys[idx]) + if (sdata->default_key != sdata->keys[idx]) { + ieee80211_debugfs_key_remove_default(sdata); sdata->default_key = sdata->keys[idx]; + if (sdata->default_key) + ieee80211_debugfs_key_add_default(sdata); + } return 0; } |