iwlwifi: mvm: do no sched scan while associated
authorDavid Spinadel <david.spinadel@intel.com>
Thu, 24 Apr 2014 10:15:29 +0000 (13:15 +0300)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 6 May 2014 18:56:37 +0000 (21:56 +0300)
Currently the FW doesn't support sched scan while associated,
Prevent it.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/mac80211.c
drivers/net/wireless/iwlwifi/mvm/mvm.h
drivers/net/wireless/iwlwifi/mvm/utils.c

index f0cebf12c7b8415a3c787d0cc77a9b2b1c2a15ef..593f723a74c4f77e98a0a5f04c8c8414bde9d1a1 100644 (file)
@@ -1807,6 +1807,11 @@ static int iwl_mvm_mac_sched_scan_start(struct ieee80211_hw *hw,
 
        mutex_lock(&mvm->mutex);
 
+       if (iwl_mvm_is_associated(mvm)) {
+               ret = -EBUSY;
+               goto out;
+       }
+
        switch (mvm->scan_status) {
        case IWL_MVM_SCAN_OS:
                IWL_DEBUG_SCAN(mvm, "Stopping previous scan for sched_scan\n");
index d564233a65da6157c1aaf16a099ddf94b3be933e..84c75a1b267e2f6c31c2aefb0c25de140a792125 100644 (file)
@@ -1003,6 +1003,9 @@ static inline bool iwl_mvm_vif_low_latency(struct iwl_mvm_vif *mvmvif)
        return mvmvif->low_latency;
 }
 
+/* Assoc status */
+bool iwl_mvm_is_associated(struct iwl_mvm *mvm);
+
 /* Thermal management and CT-kill */
 void iwl_mvm_tt_tx_backoff(struct iwl_mvm *mvm, u32 backoff);
 void iwl_mvm_tt_handler(struct iwl_mvm *mvm);
index d619851745a19ba6d3bf605555fcdbd5a09f8341..6fdbef9696d8f6e34b5fea258c40bd7b6b433f2b 100644 (file)
@@ -644,3 +644,22 @@ bool iwl_mvm_low_latency(struct iwl_mvm *mvm)
 
        return result;
 }
+
+static void iwl_mvm_assoc_iter(void *_data, u8 *mac, struct ieee80211_vif *vif)
+{
+       bool *assoc = _data;
+
+       if (vif->bss_conf.assoc)
+               *assoc = true;
+}
+
+bool iwl_mvm_is_associated(struct iwl_mvm *mvm)
+{
+       bool assoc = false;
+
+       ieee80211_iterate_active_interfaces_atomic(
+                       mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
+                       iwl_mvm_assoc_iter, &assoc);
+
+       return assoc;
+}