aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-07-05 10:35:39 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-07-06 15:05:41 -0400
commit830af02f24fbc087999b757b8eca51829c67fa6f (patch)
tree9a029493580c0d822badfa9f2218ef0c72ae6f33 /net
parent68dd49ef907f92127aabb30b3368b80eb0ffb459 (diff)
mac80211: allow driver to iterate keys
When in suspend/wowlan, devices might implement crypto offload differently (more features), and might require reprogramming keys for the WoWLAN (as it is the case for Intel devices that use another uCode image). Thus allow the driver to iterate all keys in this context. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/key.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 0af958c7434..fcab5fe726a 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -551,6 +551,39 @@ void ieee80211_enable_keys(struct ieee80211_sub_if_data *sdata)
551 mutex_unlock(&sdata->local->key_mtx); 551 mutex_unlock(&sdata->local->key_mtx);
552} 552}
553 553
554void ieee80211_iter_keys(struct ieee80211_hw *hw,
555 struct ieee80211_vif *vif,
556 void (*iter)(struct ieee80211_hw *hw,
557 struct ieee80211_vif *vif,
558 struct ieee80211_sta *sta,
559 struct ieee80211_key_conf *key,
560 void *data),
561 void *iter_data)
562{
563 struct ieee80211_local *local = hw_to_local(hw);
564 struct ieee80211_key *key;
565 struct ieee80211_sub_if_data *sdata;
566
567 ASSERT_RTNL();
568
569 mutex_lock(&local->key_mtx);
570 if (vif) {
571 sdata = vif_to_sdata(vif);
572 list_for_each_entry(key, &sdata->key_list, list)
573 iter(hw, &sdata->vif,
574 key->sta ? &key->sta->sta : NULL,
575 &key->conf, iter_data);
576 } else {
577 list_for_each_entry(sdata, &local->interfaces, list)
578 list_for_each_entry(key, &sdata->key_list, list)
579 iter(hw, &sdata->vif,
580 key->sta ? &key->sta->sta : NULL,
581 &key->conf, iter_data);
582 }
583 mutex_unlock(&local->key_mtx);
584}
585EXPORT_SYMBOL(ieee80211_iter_keys);
586
554void ieee80211_disable_keys(struct ieee80211_sub_if_data *sdata) 587void ieee80211_disable_keys(struct ieee80211_sub_if_data *sdata)
555{ 588{
556 struct ieee80211_key *key; 589 struct ieee80211_key *key;