diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-05-13 08:15:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-05-16 14:10:41 -0400 |
commit | 40b275b69ee660274b77fb612b0db31fd282fc3f (patch) | |
tree | 29a4f82a44a12edcf9db5de6a3c6df9615a5799e /net/mac80211/agg-tx.c | |
parent | ec034b208dc8aa5dc73ec46c3f27e34c5efbf113 (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/agg-tx.c')
-rw-r--r-- | net/mac80211/agg-tx.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c index f614ee602089..cd5125f77cc5 100644 --- a/net/mac80211/agg-tx.c +++ b/net/mac80211/agg-tx.c | |||
@@ -157,16 +157,19 @@ int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid, | |||
157 | bool tx) | 157 | bool tx) |
158 | { | 158 | { |
159 | struct ieee80211_local *local = sta->local; | 159 | struct ieee80211_local *local = sta->local; |
160 | struct tid_ampdu_tx *tid_tx = sta->ampdu_mlme.tid_tx[tid]; | 160 | struct tid_ampdu_tx *tid_tx; |
161 | int ret; | 161 | int ret; |
162 | 162 | ||
163 | lockdep_assert_held(&sta->ampdu_mlme.mtx); | 163 | lockdep_assert_held(&sta->ampdu_mlme.mtx); |
164 | 164 | ||
165 | if (!tid_tx) | ||
166 | return -ENOENT; | ||
167 | |||
168 | spin_lock_bh(&sta->lock); | 165 | spin_lock_bh(&sta->lock); |
169 | 166 | ||
167 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); | ||
168 | if (!tid_tx) { | ||
169 | spin_unlock_bh(&sta->lock); | ||
170 | return -ENOENT; | ||
171 | } | ||
172 | |||
170 | if (test_bit(HT_AGG_STATE_WANT_START, &tid_tx->state)) { | 173 | if (test_bit(HT_AGG_STATE_WANT_START, &tid_tx->state)) { |
171 | /* not even started yet! */ | 174 | /* not even started yet! */ |
172 | ieee80211_assign_tid_tx(sta, tid, NULL); | 175 | ieee80211_assign_tid_tx(sta, tid, NULL); |
@@ -291,13 +294,13 @@ ieee80211_wake_queue_agg(struct ieee80211_local *local, int tid) | |||
291 | 294 | ||
292 | void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid) | 295 | void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid) |
293 | { | 296 | { |
294 | struct tid_ampdu_tx *tid_tx = sta->ampdu_mlme.tid_tx[tid]; | 297 | struct tid_ampdu_tx *tid_tx; |
295 | struct ieee80211_local *local = sta->local; | 298 | struct ieee80211_local *local = sta->local; |
296 | struct ieee80211_sub_if_data *sdata = sta->sdata; | 299 | struct ieee80211_sub_if_data *sdata = sta->sdata; |
297 | u16 start_seq_num; | 300 | u16 start_seq_num; |
298 | int ret; | 301 | int ret; |
299 | 302 | ||
300 | lockdep_assert_held(&sta->ampdu_mlme.mtx); | 303 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); |
301 | 304 | ||
302 | /* | 305 | /* |
303 | * While we're asking the driver about the aggregation, | 306 | * While we're asking the driver about the aggregation, |
@@ -404,7 +407,7 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid, | |||
404 | goto err_unlock_sta; | 407 | goto err_unlock_sta; |
405 | } | 408 | } |
406 | 409 | ||
407 | tid_tx = sta->ampdu_mlme.tid_tx[tid]; | 410 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); |
408 | /* check if the TID is not in aggregation flow already */ | 411 | /* check if the TID is not in aggregation flow already */ |
409 | if (tid_tx || sta->ampdu_mlme.tid_start_tx[tid]) { | 412 | if (tid_tx || sta->ampdu_mlme.tid_start_tx[tid]) { |
410 | #ifdef CONFIG_MAC80211_HT_DEBUG | 413 | #ifdef CONFIG_MAC80211_HT_DEBUG |
@@ -491,16 +494,19 @@ ieee80211_agg_splice_finish(struct ieee80211_local *local, u16 tid) | |||
491 | static void ieee80211_agg_tx_operational(struct ieee80211_local *local, | 494 | static void ieee80211_agg_tx_operational(struct ieee80211_local *local, |
492 | struct sta_info *sta, u16 tid) | 495 | struct sta_info *sta, u16 tid) |
493 | { | 496 | { |
497 | struct tid_ampdu_tx *tid_tx; | ||
498 | |||
494 | lockdep_assert_held(&sta->ampdu_mlme.mtx); | 499 | lockdep_assert_held(&sta->ampdu_mlme.mtx); |
495 | 500 | ||
501 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); | ||
502 | |||
496 | #ifdef CONFIG_MAC80211_HT_DEBUG | 503 | #ifdef CONFIG_MAC80211_HT_DEBUG |
497 | printk(KERN_DEBUG "Aggregation is on for tid %d\n", tid); | 504 | printk(KERN_DEBUG "Aggregation is on for tid %d\n", tid); |
498 | #endif | 505 | #endif |
499 | 506 | ||
500 | drv_ampdu_action(local, sta->sdata, | 507 | drv_ampdu_action(local, sta->sdata, |
501 | IEEE80211_AMPDU_TX_OPERATIONAL, | 508 | IEEE80211_AMPDU_TX_OPERATIONAL, |
502 | &sta->sta, tid, NULL, | 509 | &sta->sta, tid, NULL, tid_tx->buf_size); |
503 | sta->ampdu_mlme.tid_tx[tid]->buf_size); | ||
504 | 510 | ||
505 | /* | 511 | /* |
506 | * synchronize with TX path, while splicing the TX path | 512 | * synchronize with TX path, while splicing the TX path |
@@ -508,13 +514,13 @@ static void ieee80211_agg_tx_operational(struct ieee80211_local *local, | |||
508 | */ | 514 | */ |
509 | spin_lock_bh(&sta->lock); | 515 | spin_lock_bh(&sta->lock); |
510 | 516 | ||
511 | ieee80211_agg_splice_packets(local, sta->ampdu_mlme.tid_tx[tid], tid); | 517 | ieee80211_agg_splice_packets(local, tid_tx, tid); |
512 | /* | 518 | /* |
513 | * Now mark as operational. This will be visible | 519 | * Now mark as operational. This will be visible |
514 | * in the TX path, and lets it go lock-free in | 520 | * in the TX path, and lets it go lock-free in |
515 | * the common case. | 521 | * the common case. |
516 | */ | 522 | */ |
517 | set_bit(HT_AGG_STATE_OPERATIONAL, &sta->ampdu_mlme.tid_tx[tid]->state); | 523 | set_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state); |
518 | ieee80211_agg_splice_finish(local, tid); | 524 | ieee80211_agg_splice_finish(local, tid); |
519 | 525 | ||
520 | spin_unlock_bh(&sta->lock); | 526 | spin_unlock_bh(&sta->lock); |
@@ -548,7 +554,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid) | |||
548 | } | 554 | } |
549 | 555 | ||
550 | mutex_lock(&sta->ampdu_mlme.mtx); | 556 | mutex_lock(&sta->ampdu_mlme.mtx); |
551 | tid_tx = sta->ampdu_mlme.tid_tx[tid]; | 557 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); |
552 | 558 | ||
553 | if (WARN_ON(!tid_tx)) { | 559 | if (WARN_ON(!tid_tx)) { |
554 | #ifdef CONFIG_MAC80211_HT_DEBUG | 560 | #ifdef CONFIG_MAC80211_HT_DEBUG |
@@ -626,7 +632,7 @@ int ieee80211_stop_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid) | |||
626 | return -EINVAL; | 632 | return -EINVAL; |
627 | 633 | ||
628 | spin_lock_bh(&sta->lock); | 634 | spin_lock_bh(&sta->lock); |
629 | tid_tx = sta->ampdu_mlme.tid_tx[tid]; | 635 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); |
630 | 636 | ||
631 | if (!tid_tx) { | 637 | if (!tid_tx) { |
632 | ret = -ENOENT; | 638 | ret = -ENOENT; |
@@ -682,7 +688,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid) | |||
682 | 688 | ||
683 | mutex_lock(&sta->ampdu_mlme.mtx); | 689 | mutex_lock(&sta->ampdu_mlme.mtx); |
684 | spin_lock_bh(&sta->lock); | 690 | spin_lock_bh(&sta->lock); |
685 | tid_tx = sta->ampdu_mlme.tid_tx[tid]; | 691 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); |
686 | 692 | ||
687 | if (!tid_tx || !test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { | 693 | if (!tid_tx || !test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { |
688 | #ifdef CONFIG_MAC80211_HT_DEBUG | 694 | #ifdef CONFIG_MAC80211_HT_DEBUG |
@@ -763,7 +769,7 @@ void ieee80211_process_addba_resp(struct ieee80211_local *local, | |||
763 | 769 | ||
764 | mutex_lock(&sta->ampdu_mlme.mtx); | 770 | mutex_lock(&sta->ampdu_mlme.mtx); |
765 | 771 | ||
766 | tid_tx = sta->ampdu_mlme.tid_tx[tid]; | 772 | tid_tx = rcu_dereference_protected_tid_tx(sta, tid); |
767 | if (!tid_tx) | 773 | if (!tid_tx) |
768 | goto out; | 774 | goto out; |
769 | 775 | ||