aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
diff options
context:
space:
mode:
authorChaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>2015-12-16 09:34:55 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2016-02-27 14:59:48 -0500
commit0a3b7119000d706dfbc7e0c5b66e192a646d365f (patch)
treef0609fcce239aaaebe827243627fddb0a9514958 /drivers/net/wireless/intel/iwlwifi/mvm/tt.c
parent51bcc7386a01074452c585e421a24dfc7b19063b (diff)
iwlwifi: mvm: add CT-KILL notification
Up to today the driver was notified of the temperature from the FW and decided whether to enter CT-kill or not. From now on, the FW will decide when to enter CT-kill and will notify the driver. Add support for this notification. Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/tt.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/tt.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
index 758d05a8c6aa..6ba391099d7e 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
@@ -7,6 +7,7 @@
7 * 7 *
8 * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. 8 * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved.
9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 9 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
10 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH
10 * 11 *
11 * This program is free software; you can redistribute it and/or modify 12 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of version 2 of the GNU General Public License as 13 * it under the terms of version 2 of the GNU General Public License as
@@ -33,7 +34,7 @@
33 * 34 *
34 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. 35 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
35 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH 36 * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH
36 * Copyright(c) 2015 Intel Deutschland GmbH 37 * Copyright(c) 2015 - 2016 Intel Deutschland GmbH
37 * All rights reserved. 38 * All rights reserved.
38 * 39 *
39 * Redistribution and use in source and binary forms, with or without 40 * Redistribution and use in source and binary forms, with or without
@@ -171,6 +172,24 @@ void iwl_mvm_temp_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
171 iwl_mvm_tt_temp_changed(mvm, temp); 172 iwl_mvm_tt_temp_changed(mvm, temp);
172} 173}
173 174
175void iwl_mvm_ct_kill_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
176{
177 struct iwl_rx_packet *pkt = rxb_addr(rxb);
178 struct ct_kill_notif *notif;
179 int len = iwl_rx_packet_payload_len(pkt);
180
181 if (WARN_ON_ONCE(len != sizeof(*notif))) {
182 IWL_ERR(mvm, "Invalid CT_KILL_NOTIFICATION\n");
183 return;
184 }
185
186 notif = (struct ct_kill_notif *)pkt->data;
187 IWL_DEBUG_TEMP(mvm, "CT Kill notification temperature = %d\n",
188 notif->temperature);
189
190 iwl_mvm_enter_ctkill(mvm);
191}
192
174static int iwl_mvm_get_temp_cmd(struct iwl_mvm *mvm) 193static int iwl_mvm_get_temp_cmd(struct iwl_mvm *mvm)
175{ 194{
176 struct iwl_dts_measurement_cmd cmd = { 195 struct iwl_dts_measurement_cmd cmd = {
@@ -236,6 +255,12 @@ static void check_exit_ctkill(struct work_struct *work)
236 tt = container_of(work, struct iwl_mvm_tt_mgmt, ct_kill_exit.work); 255 tt = container_of(work, struct iwl_mvm_tt_mgmt, ct_kill_exit.work);
237 mvm = container_of(tt, struct iwl_mvm, thermal_throttle); 256 mvm = container_of(tt, struct iwl_mvm, thermal_throttle);
238 257
258 if (iwl_mvm_is_tt_in_fw(mvm)) {
259 iwl_mvm_exit_ctkill(mvm);
260
261 return;
262 }
263
239 duration = tt->params.ct_kill_duration; 264 duration = tt->params.ct_kill_duration;
240 265
241 mutex_lock(&mvm->mutex); 266 mutex_lock(&mvm->mutex);