summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi/mvm/mac80211.c
diff options
context:
space:
mode:
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>2014-06-05 16:40:36 +0300
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2014-07-07 21:41:19 +0300
commit664322fa43b7a52a9e8be9a3874c024412c24a50 (patch)
tree35a7da90749129b0b0d432e15f163b0e25bebb47 /drivers/net/wireless/iwlwifi/mvm/mac80211.c
parentfe887665a87b4c45be21253c4a6904ad1334be85 (diff)
iwlwifi: mvm: Protect mvm->csa_vif with RCU
Currently mvm->csa_vif is protected with mvm mutex. The RCU protection is required for "iwlwifi: mvm: Reflect GO channel switch in NoA" patch. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/mac80211.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/mac80211.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index 78a78c02dda5..984a1e75aad0 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -1607,6 +1607,10 @@ static void iwl_mvm_stop_ap_ibss(struct ieee80211_hw *hw,
mutex_lock(&mvm->mutex);
+ /* Handle AP stop while in CSA */
+ if (rcu_access_pointer(mvm->csa_vif) == vif)
+ RCU_INIT_POINTER(mvm->csa_vif, NULL);
+
mvmvif->ap_ibss_active = false;
mvm->ap_last_beacon_gp2 = 0;
@@ -2664,15 +2668,19 @@ static void iwl_mvm_channel_switch_beacon(struct ieee80211_hw *hw,
struct cfg80211_chan_def *chandef)
{
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
+ struct ieee80211_vif *csa_vif;
mutex_lock(&mvm->mutex);
- if (WARN(mvm->csa_vif && mvm->csa_vif->csa_active,
+
+ csa_vif = rcu_dereference_protected(mvm->csa_vif,
+ lockdep_is_held(&mvm->mutex));
+ if (WARN(csa_vif && csa_vif->csa_active,
"Another CSA is already in progress"))
goto out_unlock;
IWL_DEBUG_MAC80211(mvm, "CSA started to freq %d\n",
chandef->center_freq1);
- mvm->csa_vif = vif;
+ rcu_assign_pointer(mvm->csa_vif, vif);
out_unlock:
mutex_unlock(&mvm->mutex);