Commit f3630c4f authored by Johannes Berg's avatar Johannes Berg

wifi: mac80211: add RCU _check() link access variants

We might sometimes need to use RCU and locking in the same code
path, so add the two variants link_conf_dereference_check() and
link_sta_dereference_check().
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 3903963e
...@@ -1915,6 +1915,10 @@ static inline bool lockdep_vif_mutex_held(struct ieee80211_vif *vif) ...@@ -1915,6 +1915,10 @@ static inline bool lockdep_vif_mutex_held(struct ieee80211_vif *vif)
rcu_dereference_protected((vif)->link_conf[link_id], \ rcu_dereference_protected((vif)->link_conf[link_id], \
lockdep_vif_mutex_held(vif)) lockdep_vif_mutex_held(vif))
#define link_conf_dereference_check(vif, link_id) \
rcu_dereference_check((vif)->link_conf[link_id], \
lockdep_vif_mutex_held(vif))
/** /**
* enum ieee80211_key_flags - key flags * enum ieee80211_key_flags - key flags
* *
...@@ -2311,6 +2315,10 @@ static inline bool lockdep_sta_mutex_held(struct ieee80211_sta *pubsta) ...@@ -2311,6 +2315,10 @@ static inline bool lockdep_sta_mutex_held(struct ieee80211_sta *pubsta)
rcu_dereference_protected((sta)->link[link_id], \ rcu_dereference_protected((sta)->link[link_id], \
lockdep_sta_mutex_held(sta)) lockdep_sta_mutex_held(sta))
#define link_sta_dereference_check(sta, link_id) \
rcu_dereference_check((sta)->link[link_id], \
lockdep_sta_mutex_held(sta))
#define for_each_sta_active_link(vif, sta, link_sta, link_id) \ #define for_each_sta_active_link(vif, sta, link_sta, link_id) \
for (link_id = 0; link_id < ARRAY_SIZE((sta)->link); link_id++) \ for (link_id = 0; link_id < ARRAY_SIZE((sta)->link); link_id++) \
if ((!(vif)->active_links || \ if ((!(vif)->active_links || \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment