aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/sta_info.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-05-13 08:15:49 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-05-16 14:10:41 -0400
commit40b275b69ee660274b77fb612b0db31fd282fc3f (patch)
tree29a4f82a44a12edcf9db5de6a3c6df9615a5799e /net/mac80211/sta_info.h
parentec034b208dc8aa5dc73ec46c3f27e34c5efbf113 (diff)
mac80211: sparse RCU annotations
This adds sparse RCU annotations to most of mac80211, only the mesh code remains to be done. Due the the previous patches, the annotations are pretty simple. The only thing that this actually changes is removing the RCU usage of key->sta in debugfs since this pointer isn't actually an RCU-managed pointer (it only has a single assignment done before the key even goes live). As that is otherwise harmless, I decided to make it part of this patch. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/sta_info.h')
-rw-r--r--net/mac80211/sta_info.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index 55c51855ceb7..d6b566076f05 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -164,11 +164,11 @@ struct tid_ampdu_rx {
164struct sta_ampdu_mlme { 164struct sta_ampdu_mlme {
165 struct mutex mtx; 165 struct mutex mtx;
166 /* rx */ 166 /* rx */
167 struct tid_ampdu_rx *tid_rx[STA_TID_NUM]; 167 struct tid_ampdu_rx __rcu *tid_rx[STA_TID_NUM];
168 unsigned long tid_rx_timer_expired[BITS_TO_LONGS(STA_TID_NUM)]; 168 unsigned long tid_rx_timer_expired[BITS_TO_LONGS(STA_TID_NUM)];
169 /* tx */ 169 /* tx */
170 struct work_struct work; 170 struct work_struct work;
171 struct tid_ampdu_tx *tid_tx[STA_TID_NUM]; 171 struct tid_ampdu_tx __rcu *tid_tx[STA_TID_NUM];
172 struct tid_ampdu_tx *tid_start_tx[STA_TID_NUM]; 172 struct tid_ampdu_tx *tid_start_tx[STA_TID_NUM];
173 u8 addba_req_num[STA_TID_NUM]; 173 u8 addba_req_num[STA_TID_NUM];
174 u8 dialog_token_allocator; 174 u8 dialog_token_allocator;
@@ -243,11 +243,11 @@ struct sta_ampdu_mlme {
243struct sta_info { 243struct sta_info {
244 /* General information, mostly static */ 244 /* General information, mostly static */
245 struct list_head list; 245 struct list_head list;
246 struct sta_info *hnext; 246 struct sta_info __rcu *hnext;
247 struct ieee80211_local *local; 247 struct ieee80211_local *local;
248 struct ieee80211_sub_if_data *sdata; 248 struct ieee80211_sub_if_data *sdata;
249 struct ieee80211_key *gtk[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS]; 249 struct ieee80211_key __rcu *gtk[NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS];
250 struct ieee80211_key *ptk; 250 struct ieee80211_key __rcu *ptk;
251 struct rate_control_ref *rate_ctrl; 251 struct rate_control_ref *rate_ctrl;
252 void *rate_ctrl_priv; 252 void *rate_ctrl_priv;
253 spinlock_t lock; 253 spinlock_t lock;
@@ -403,6 +403,13 @@ static inline u32 get_sta_flags(struct sta_info *sta)
403void ieee80211_assign_tid_tx(struct sta_info *sta, int tid, 403void ieee80211_assign_tid_tx(struct sta_info *sta, int tid,
404 struct tid_ampdu_tx *tid_tx); 404 struct tid_ampdu_tx *tid_tx);
405 405
406static inline struct tid_ampdu_tx *
407rcu_dereference_protected_tid_tx(struct sta_info *sta, int tid)
408{
409 return rcu_dereference_protected(sta->ampdu_mlme.tid_tx[tid],
410 lockdep_is_held(&sta->lock) ||
411 lockdep_is_held(&sta->ampdu_mlme.mtx));
412}
406 413
407#define STA_HASH_SIZE 256 414#define STA_HASH_SIZE 256
408#define STA_HASH(sta) (sta[5]) 415#define STA_HASH(sta) (sta[5])