@@ -987,6 +987,26 @@ void ieee80211_reenable_keys(struct ieee80211_sub_if_data *sdata)
987
987
}
988
988
}
989
989
990
+ static void
991
+ ieee80211_key_iter (struct ieee80211_hw * hw ,
992
+ struct ieee80211_vif * vif ,
993
+ struct ieee80211_key * key ,
994
+ void (* iter )(struct ieee80211_hw * hw ,
995
+ struct ieee80211_vif * vif ,
996
+ struct ieee80211_sta * sta ,
997
+ struct ieee80211_key_conf * key ,
998
+ void * data ),
999
+ void * iter_data )
1000
+ {
1001
+ /* skip keys of station in removal process */
1002
+ if (key -> sta && key -> sta -> removed )
1003
+ return ;
1004
+ if (!(key -> flags & KEY_FLAG_UPLOADED_TO_HARDWARE ))
1005
+ return ;
1006
+ iter (hw , vif , key -> sta ? & key -> sta -> sta : NULL ,
1007
+ & key -> conf , iter_data );
1008
+ }
1009
+
990
1010
void ieee80211_iter_keys (struct ieee80211_hw * hw ,
991
1011
struct ieee80211_vif * vif ,
992
1012
void (* iter )(struct ieee80211_hw * hw ,
@@ -1005,16 +1025,13 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw,
1005
1025
if (vif ) {
1006
1026
sdata = vif_to_sdata (vif );
1007
1027
list_for_each_entry_safe (key , tmp , & sdata -> key_list , list )
1008
- iter (hw , & sdata -> vif ,
1009
- key -> sta ? & key -> sta -> sta : NULL ,
1010
- & key -> conf , iter_data );
1028
+ ieee80211_key_iter (hw , vif , key , iter , iter_data );
1011
1029
} else {
1012
1030
list_for_each_entry (sdata , & local -> interfaces , list )
1013
1031
list_for_each_entry_safe (key , tmp ,
1014
1032
& sdata -> key_list , list )
1015
- iter (hw , & sdata -> vif ,
1016
- key -> sta ? & key -> sta -> sta : NULL ,
1017
- & key -> conf , iter_data );
1033
+ ieee80211_key_iter (hw , & sdata -> vif , key ,
1034
+ iter , iter_data );
1018
1035
}
1019
1036
}
1020
1037
EXPORT_SYMBOL (ieee80211_iter_keys );
@@ -1031,17 +1048,8 @@ _ieee80211_iter_keys_rcu(struct ieee80211_hw *hw,
1031
1048
{
1032
1049
struct ieee80211_key * key ;
1033
1050
1034
- list_for_each_entry_rcu (key , & sdata -> key_list , list ) {
1035
- /* skip keys of station in removal process */
1036
- if (key -> sta && key -> sta -> removed )
1037
- continue ;
1038
- if (!(key -> flags & KEY_FLAG_UPLOADED_TO_HARDWARE ))
1039
- continue ;
1040
-
1041
- iter (hw , & sdata -> vif ,
1042
- key -> sta ? & key -> sta -> sta : NULL ,
1043
- & key -> conf , iter_data );
1044
- }
1051
+ list_for_each_entry_rcu (key , & sdata -> key_list , list )
1052
+ ieee80211_key_iter (hw , & sdata -> vif , key , iter , iter_data );
1045
1053
}
1046
1054
1047
1055
void ieee80211_iter_keys_rcu (struct ieee80211_hw * hw ,
0 commit comments