diff options
author | Luciano Coelho <luciano.coelho@intel.com> | 2015-05-05 11:21:34 +0300 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-05-28 13:35:21 +0300 |
commit | dfbf156d05a43f5ffb918f25bc75265ed39011f0 (patch) | |
tree | 656b267be6c16875daffb5b71ea079547641db73 | |
parent | 5d2e8d932c1c3d64418842c159862d003135ad0b (diff) | |
download | linux-dfbf156d05a43f5ffb918f25bc75265ed39011f0.tar.xz |
iwlwifi: mvm: rename umac scan stop function
For consistency with the LMAC functions, rename the UMAC scan stop
function to iwl_mvm_umac_scan_stop(). Additionally, move things
around a bit to avoid an unnecessary forward declaration.
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/mvm/scan.c | 126 |
1 files changed, 62 insertions, 64 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index ec8ef56a15ab..bee92d72f263 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c @@ -101,8 +101,6 @@ struct iwl_mvm_scan_params { } schedule[2]; }; -static int iwl_umac_scan_stop(struct iwl_mvm *mvm, int type); - static u8 iwl_mvm_scan_rx_ant(struct iwl_mvm *mvm) { if (mvm->scan_rx_ant != ANT_NONE) @@ -885,67 +883,6 @@ static int iwl_mvm_scan_lmac(struct iwl_mvm *mvm, struct ieee80211_vif *vif, return 0; } -int iwl_mvm_reg_scan_stop(struct iwl_mvm *mvm) -{ - int ret; - - if (!(mvm->scan_status & IWL_MVM_SCAN_REGULAR)) - return 0; - - if (iwl_mvm_is_radio_killed(mvm)) { - ret = 0; - goto out; - } - - if (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN) - ret = iwl_umac_scan_stop(mvm, IWL_MVM_SCAN_REGULAR); - else - ret = iwl_mvm_lmac_scan_stop(mvm, IWL_MVM_SCAN_REGULAR); - - if (!ret) - mvm->scan_status |= IWL_MVM_SCAN_STOPPING_REGULAR; -out: - /* Clear the scan status so the next scan requests will - * succeed and mark the scan as stopping, so that the Rx - * handler doesn't do anything, as the scan was stopped from - * above. Since the rx handler won't do anything now, we have - * to release the scan reference here. - */ - iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN); - - mvm->scan_status &= ~IWL_MVM_SCAN_REGULAR; - ieee80211_scan_completed(mvm->hw, true); - - return ret; -} - -int iwl_mvm_sched_scan_stop(struct iwl_mvm *mvm, bool notify) -{ - int ret; - - if (!(mvm->scan_status & IWL_MVM_SCAN_SCHED)) - return 0; - - if (iwl_mvm_is_radio_killed(mvm)) { - ret = 0; - goto out; - } - - if (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN) - ret = iwl_umac_scan_stop(mvm, IWL_MVM_SCAN_SCHED); - else - ret = iwl_mvm_lmac_scan_stop(mvm, IWL_MVM_SCAN_SCHED); - - if (!ret) - mvm->scan_status |= IWL_MVM_SCAN_STOPPING_SCHED; -out: - mvm->scan_status &= ~IWL_MVM_SCAN_SCHED; - if (notify) - ieee80211_sched_scan_stopped(mvm->hw); - - return ret; -} - /* UMAC scan API */ struct iwl_umac_scan_done { @@ -1587,7 +1524,7 @@ static int iwl_umac_scan_abort_one(struct iwl_mvm *mvm, u32 uid) return iwl_mvm_send_cmd_pdu(mvm, SCAN_ABORT_UMAC, 0, sizeof(cmd), &cmd); } -static int iwl_umac_scan_stop(struct iwl_mvm *mvm, int type) +static int iwl_mvm_umac_scan_stop(struct iwl_mvm *mvm, int type) { struct iwl_notification_wait wait_scan_done; static const u8 scan_done_notif[] = { SCAN_COMPLETE_UMAC, }; @@ -1681,3 +1618,64 @@ void iwl_mvm_report_scan_aborted(struct iwl_mvm *mvm) ieee80211_sched_scan_stopped(mvm->hw); } } + +int iwl_mvm_reg_scan_stop(struct iwl_mvm *mvm) +{ + int ret; + + if (!(mvm->scan_status & IWL_MVM_SCAN_REGULAR)) + return 0; + + if (iwl_mvm_is_radio_killed(mvm)) { + ret = 0; + goto out; + } + + if (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN) + ret = iwl_mvm_umac_scan_stop(mvm, IWL_MVM_SCAN_REGULAR); + else + ret = iwl_mvm_lmac_scan_stop(mvm, IWL_MVM_SCAN_REGULAR); + + if (!ret) + mvm->scan_status |= IWL_MVM_SCAN_STOPPING_REGULAR; +out: + /* Clear the scan status so the next scan requests will + * succeed and mark the scan as stopping, so that the Rx + * handler doesn't do anything, as the scan was stopped from + * above. Since the rx handler won't do anything now, we have + * to release the scan reference here. + */ + iwl_mvm_unref(mvm, IWL_MVM_REF_SCAN); + + mvm->scan_status &= ~IWL_MVM_SCAN_REGULAR; + ieee80211_scan_completed(mvm->hw, true); + + return ret; +} + +int iwl_mvm_sched_scan_stop(struct iwl_mvm *mvm, bool notify) +{ + int ret; + + if (!(mvm->scan_status & IWL_MVM_SCAN_SCHED)) + return 0; + + if (iwl_mvm_is_radio_killed(mvm)) { + ret = 0; + goto out; + } + + if (mvm->fw->ucode_capa.capa[0] & IWL_UCODE_TLV_CAPA_UMAC_SCAN) + ret = iwl_mvm_umac_scan_stop(mvm, IWL_MVM_SCAN_SCHED); + else + ret = iwl_mvm_lmac_scan_stop(mvm, IWL_MVM_SCAN_SCHED); + + if (!ret) + mvm->scan_status |= IWL_MVM_SCAN_STOPPING_SCHED; +out: + mvm->scan_status &= ~IWL_MVM_SCAN_SCHED; + if (notify) + ieee80211_sched_scan_stopped(mvm->hw); + + return ret; +} |