aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/utils.c
diff options
context:
space:
mode:
authorEytan Lifshitz <eytan.lifshitz@intel.com>2013-05-19 12:14:41 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-05-29 03:03:18 -0400
commit9ee718aa9269cf56040cf12f0f6ac6e0057397b2 (patch)
tree5d4b9d8bb7b16f758ea0d6c8a4c85e87f4681600 /drivers/net/wireless/iwlwifi/mvm/utils.c
parentf68d18f202d50f60746a8bcce1dc965b2f5035c0 (diff)
iwlwifi: mvm: add thermal throttling and CT kill
In order to avoid NIC destruction due to high temperature, CT kill will power down the NIC. To avoid this, thermal throttling will decrease throughput to prevent the NIC from reaching the temperature at which CT kill is performed. Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/mvm/utils.c')
-rw-r--r--drivers/net/wireless/iwlwifi/mvm/utils.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/mvm/utils.c b/drivers/net/wireless/iwlwifi/mvm/utils.c
index 687b34e387ac..c9b44ab4af07 100644
--- a/drivers/net/wireless/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/iwlwifi/mvm/utils.c
@@ -471,3 +471,34 @@ int iwl_mvm_send_lq_cmd(struct iwl_mvm *mvm, struct iwl_lq_cmd *lq,
471 471
472 return iwl_mvm_send_cmd(mvm, &cmd); 472 return iwl_mvm_send_cmd(mvm, &cmd);
473} 473}
474
475/**
476 * iwl_mvm_update_smps - Get a requst to change the SMPS mode
477 * @req_type: The part of the driver who call for a change.
478 * @smps_requests: The request to change the SMPS mode.
479 *
480 * Get a requst to change the SMPS mode,
481 * and change it according to all other requests in the driver.
482 */
483void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
484 enum iwl_mvm_smps_type_request req_type,
485 enum ieee80211_smps_mode smps_request)
486{
487 struct iwl_mvm_vif *mvmvif;
488 enum ieee80211_smps_mode smps_mode = IEEE80211_SMPS_AUTOMATIC;
489 int i;
490
491 lockdep_assert_held(&mvm->mutex);
492 mvmvif = iwl_mvm_vif_from_mac80211(vif);
493 mvmvif->smps_requests[req_type] = smps_request;
494 for (i = 0; i < NUM_IWL_MVM_SMPS_REQ; i++) {
495 if (mvmvif->smps_requests[i] == IEEE80211_SMPS_STATIC) {
496 smps_mode = IEEE80211_SMPS_STATIC;
497 break;
498 }
499 if (mvmvif->smps_requests[i] == IEEE80211_SMPS_DYNAMIC)
500 smps_mode = IEEE80211_SMPS_DYNAMIC;
501 }
502
503 ieee80211_request_smps(vif, smps_mode);
504}