summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/mvm/tt.c
AgeCommit message (Collapse)Author
2019-11-15iwlwifi: mvm: start CTDP budget from 2400mAMordechay Goodstein
The current budget of 2000mA is preventing us from reaching maximum throughput. According to our system engineers, we can increase the maximum budget to 2400mA to solve this problem. Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-09-19iwlwifi: mvm: fix build w/o CONFIG_THERMALJohannes Berg
Without CONFIG_THERMAL, the driver fails to link as it calls iwl_mvm_send_temp_report_ths_cmd() unconditionally. Fix this by making that function available, but do almost nothing but send the empty firmware command to enable CT-kill reporting. While at it, also fix that function itself to not error out when the thermal zone hasn't been initialized, but instead just send the empty firmware command in this case as well. Fixes: 242d9c8b9a93 ("iwlwifi: mvm: use FW thermal monitoring regardless of CONFIG_THERMAL") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-09-06iwlwifi: remove all the d0i3 referencesEmmanuel Grumbach
As part of the d0i3 removal. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-08-31iwlwifi: remove all occurrences of the FSF address paragraphLuca Coelho
The Free Software Foundation address is superfluous and causes checkpatch to issue a warning when present. Remove all paragraphs with FSF's address to prevent that. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06iwlwifi: mvm: return -ENODATA when reading the temperature with the FW downLuca Coelho
It seems that libsensors treats -EIO as a special non-recoverable failure when it tries to read the temperature while the firmware is not running. To solve that, change the error code to a milder -ENODATA. This fixes https://bugzilla.kernel.org/show_bug.cgi?id=196941 Fixes: c221daf219b1 ("iwlwifi: mvm: add registration to thermal zone") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-09-08iwlwifi: mvm: set status before calling iwl_mvm_send_cmd_status()Luca Coelho
We always must set the status to what we consider success before calling iwl_mvm_send_cmd_status() (also iwl_mvm_send_cmd_pdu_status() which calls it). Fix a few places where initialization is missing. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-09iwlwifi: mvm: add debugfs to force CT-killChaya Rachel Ivgi
CT-kill is a thermal-based "RF-kill", which disables the NIC completely if the temperature gets too high, in order to avoid damage. Add a debugfs entry to simulate high temperatures, in order to test CT-kill flows in the driver without having to physically heat the device up. Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-09iwlwifi: mvm: add const to thermal_cooling_device_ops structureBhumika Goyal
Declare thermal_cooling_device_ops structure as const as it is only passed as an argument to the function thermal_cooling_device_register and this argument is of type const. So, declare the structure as const. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-01iwlwifi: track current firmware image in common codeJohannes Berg
Track the current firmware image in the common code instead of in the opmode so that later patches can access it there in a common way. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-12Merge tag 'iwlwifi-next-for-kalle-2017-06-06' of ↵Kalle Valo
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next First batch of iwlwifi driver patches 4.13 * Loads of FW API documentation improvements (for tools and htmldoc); * Continued work for the new A000 family; * Bumped the maximum supported FW API to 31; * Improve the differentiation between 8000, 9000 and A000 families; * A lot of fixes and cleanups here and there; kvalo: There were conflicts iwl_mvm_stop_device() and iwl_mvm_tcool_set_cur_state(). The former was easy but latter needed more thought. Apparently the mutex was taken too late, so I fixed so that the mutex is taken first and then check for iwl_mvm_firmware_running().
2017-06-05iwlwifi: mvm: add and use iwl_mvm_device_running()Johannes Berg
This will help refactor this later. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-05iwlwifi: mvm: support init flow debuggingLiad Kaufman
In case an assert happens on init flow, the current driver powers down the NIC, except if iwlmvm modparam init_dbg=1, and only on very specific flows. Extend this capability to cover most failure cases by keeping track of what init configurations have been completed. This way, we can allow NOT powering down the NIC, while making sure that when the driver is removed we don't try to free resources that haven't been allocated. (This can result in a kernel panic.) Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-05iwlwifi: tt: move ucode_loaded check under mutexJohannes Berg
The ucode_loaded check should be under the mutex, since it can otherwise change state after we looked at it and before we got the mutex. Fix that. Fixes: 5c89e7bc557e ("iwlwifi: mvm: add registration to cooling device") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-04-19iwlwifi: mvm: prepare for station count changeSara Sharon
In a000 devices we will support up to 32 stations. The max station define is used also for invalid station marking which makes finding usages of actual maximum station pretty hard to sort through - change it to be a different define in order to make future changes easier. Use also ARRAY_SIZE intead of define when possible. Do not move yet to 32 stations until firmware do it though. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-01-21iwlwifi: fix kernel crash when unregistering thermal zoneJens Axboe
A recent firmware change seems to have enabled thermal zones on the iwlwifi driver. Unfortunately, my device fails when registering the thermal zone. This doesn't stop the driver from attempting to unregister the thermal zone at unload time, triggering a NULL pointer deference in strlen() off the thermal_zone_device_unregister() path. Don't unregister if name is NULL, for that case we failed registering. Do the same for the cooling zone. Signed-off-by: Jens Axboe <axboe@fb.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-26iwlwifi: remove support for fw older than -17 and -22Luca Coelho
FW versions older than -17 for 3160 and 7260 and older than -22 for newer NICs are not supported anymore. Don't load these versions and remove code that handles them. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-05-10iwlwifi: mvm: use helpers to get iwl_mvm_staSara Sharon
Getting the mvm station out of station id requires dereferencing the station id to get ieee80211_sta, then checking for pointer validity and only then extract mvm station out. Given that there are helpers to do it - use them instead of duplicating the code whenever we need only mvm station. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-03-30iwlwifi: mvm: allow setting the thermal state in D0i3Luca Coelho
We were not allowing the thermal state to be set when we were in D0i3 mode. It was not very clearly specified how it should work, but now a decision was made to allow the state to be set in D0i3 (which will cause a brief wake up). Remove the check in the set_cur_state operation. Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-03-30iwlwifi: mvm: remove uneeded D0I3 checkingChaya Rachel Ivgi
The driver can read the current state during D0I3, therefore there is no reason not to do it. Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-03-30iwlwifi: mvm: handle async temperature notification with unlocked mutexChaya Rachel Ivgi
Use RX_HANDLER_ASYNC_UNLOCKED instead of unlock and re-lock the mutex independently. Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-03-09iwlwifi: mvm: return the cooling state index instead of the budgetChaya Rachel Ivgi
iwl_mvm_tcool_get_cur_state is the function that returns the cooling state index to the sysfs handler. This function returns mvm->cooling_dev.cur_state but that variable was set to the budget and not the cooling state index. Fix that. Add a missing blank line while at it. Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-03-09iwlwifi: mvm: add ctdp operations to debugfsChaya Rachel Ivgi
Add debugfs entries to get the ctdp budget average and to stop ctdp. Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-03-06iwlwifi: mvm: avoid panics with thermal device usageEmmanuel Grumbach
Thermal zone device registration can fail, and in this case we don't want to remove WiFi functionality. This is why the thermal zone registration function is void, and the flows continue even if the thermal zone device registration failed. Same applies for the cooling device. This means that we at least need to remember that the thermal zone device didn't register properly and take the minimal precautions to avoid panic'ing when we access it. This was missing. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-02-27iwlwifi: mvm: add registration to cooling deviceChaya Rachel Ivgi
Register cooling device in order to have the Thermal Manager handle the device's power budget according to the sent notifications. The interface adds a new thermal cooling device to /sys/class/thermal/ folder. 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>
2016-02-27iwlwifi: mvm: add registration to thermal zoneChaya Rachel Ivgi
Register to thermal_zone interface and implement the thermal ops. The thermal handles the device throttling, and sets the the temperature thresholds the Thermal Manager would be notified of crossing. The thermal interface adds a new thermal zone device sensor under /sys/class/thermal/ folder. 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>
2016-02-27iwlwifi: mvm: add CT-KILL notificationChaya Rachel Ivgi
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>
2016-02-01iwlwifi: mvm: add support for negative temperaturesChaya Rachel Ivgi
The driver should support also negative temperatures. So there is a need to separate between the return value and temperature in order to be able to distinguish between a negative temperature and error value. Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2016-01-07iwlwifi: mvm: check minimum temperature notification lengthJohannes Berg
This notification will be extended with extra data, so just check that it has a minimum length, not the exact length; we might later add handling for the extra fields added and have more code to handle both versions. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-12-01iwlwifi: change the Intel Wireless email addressEmmanuel Grumbach
ilw@linux.intel.com is not available anymore. linuxwifi@intel.com should be used instead. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-11-18iwlwifi: move under intel vendor directoryKalle Valo
Part of reorganising wireless drivers directory and Kconfig. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>