Skip to content

Commit

Permalink
iwlwifi: mvm: do no sched scan while associated
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Spinadel authored and Emmanuel Grumbach committed May 6, 2014
1 parent 8e96440 commit bd5e474
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/wireless/iwlwifi/mvm/mac80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 3 additions & 0 deletions drivers/net/wireless/iwlwifi/mvm/mvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 19 additions & 0 deletions drivers/net/wireless/iwlwifi/mvm/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit bd5e474

Please sign in to comment.