summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/utils.c
Commit message (Collapse)AuthorAgeFilesLines
* iwlwifi: mvm: remove update type argument from quota updateJohannes Berg2014-07-071-2/+1
| | | | | | | | | | | | | | | | It turns out that adding the update type argument was pointless as quota update is never called from the add_interface() callback. Therefore, IWL_MVM_QUOTA_UPDATE_TYPE_NEW isn't actually needed and then only a "disabled_vif" argument is needed for the upcoming CSA work. Remove the whole enum iwl_mvm_quota_update_type and pass the right arguments (always NULL for disabled vif right now) to the function in all current call sites. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: let iwl_mvm_update_quotas disregard a disabled vifLuciano Coelho2014-07-071-1/+2
| | | | | | | | | | | In some cases (e.g. when we're doing a channel switch), we may need to disable the quota of a vif temporarily. In order to do so, add an argument to the iwl_mvm_update_quotas() function to tell if the passed vif is a new one or if it should be disregarded. Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: kill iwl_mvm_fw_error_rxf_dumpEmmanuel Grumbach2014-07-061-43/+0
| | | | | | | Its content can move to the caller. While at it, move iwl_mvm_fw_error_rxf_dump to caller. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: don't collect logs in the interrupt threadEmmanuel Grumbach2014-07-061-22/+0
| | | | | | | | | | | Instead of reading all the data in the context of the interrupt thread, collect the data in the restart flow before the actual restart takes place so that the device still has all the information. Remove iwl_mvm_fw_error_sram_dump and move its content to iwl_mvm_fw_error_dump. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: remove vif argument from power_update_macArik Nemtsov2014-05-221-1/+1
| | | | | | | | | The power update function looks at all current vifs to determine the power policy. It doesn't use the current vif. Instead the value was overwritten and used internally. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* Merge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-nextEmmanuel Grumbach2014-05-211-8/+8
|\ | | | | | | | | | | | | Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Conflicts: drivers/net/wireless/iwlwifi/mvm/mac80211.c
| * iwlwifi: mvm: prevent sched scan while not idleDavid Spinadel2014-05-131-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prevent sched scan while not idle (including during association or in AP mode) instead of while associated only. This fixes my previous commit which was incomplete: commit bd5e4744a6ca64299b57a2682c720d00a475a734 Author: David Spinadel <david.spinadel@intel.com> Date: Thu Apr 24 13:15:29 2014 +0300 iwlwifi: mvm: do no sched scan while associated 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> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* | iwlwifi: mvm: don't allow diversity if BT Coex / TT forbid itEmmanuel Grumbach2014-05-191-0/+33
| | | | | | | | | | | | | | | | | | | | We should not allow diversity when BT Coex needs the second antenna. Thermal Throttling can also request to stop using the second antenna. Honour those requests. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* | iwlwifi: remove CMD_SYNCEmmanuel Grumbach2014-05-131-2/+2
| | | | | | | | | | | | | | | | | | CMD_SYNC is really 0 which is confusing: if (cmd.flags & CMD_SYNC) is always false. Fix this by simply removing its definition. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* | Merge remote-tracking branch 'iwlwifi-fixes/master' into HEADEmmanuel Grumbach2014-05-131-0/+19
|\ \ | |/
| * iwlwifi: mvm: do no sched scan while associatedDavid Spinadel2014-05-061-0/+19
| | | | | | | | | | | | | | | | | | | | 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>
* | iwlwifi: mvm: fix sparse warning when _DEBUGFS isn't setEmmanuel Grumbach2014-05-061-0/+2
| | | | | | | | | | | | | | | | | | Since the declaration of iwl_mvm_fw_error_rxf_dump and iwl_mvm_fw_error_sram_dump is under ifdef CONFIG_IWLWIFI_DEBUGFS, do the same for their implementation. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* | iwlwifi: mvm: dump Rx FIFO when the firmware assertsEmmanuel Grumbach2014-04-131-1/+45
|/ | | | | | | | | | | | | | The Rx FIFO includes valuable data - dump it when the FW asserts. Also - free the SRAM and Rx FIFO when we create the file, and don't collect new SRAM / Rx FIFO if the previous file hasn't been collected through debugfs yet. Also - add a comment to saying that the ASSERT output should not be modified since we have automatic scripts that monitor this output. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: ignore unchanged low-latency flagJohannes Berg2014-03-181-0/+3
| | | | | | | | If the low-latency update is called but there's no change then ignore the update instead of triggering all the required work. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: configure low latency dependent scan parametersAlexander Bondar2014-03-181-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | In case of system low latency configure passive scan to be fragmented. Set the following scan parameters for both immediate and scheduled scan: - passive scan fragment duration = 20ms - out-of-channel time = 70ms - suspend time = 105ms Restructure channel's active/passive dwell time configuration to better suit the above change. The idea is that under low latency traffic passive scan is fragmented, i.e. that dwell on a particular channel will be fragmented. Each fragment dwell time is 20ms and fragments period is 105ms. Skipping to next channel will be delayed by the same period (105ms). So suspend_time parameter describing both fragments and channels skipping periods is set to 105ms. This value is chosen so that overall passive scan duration will not be too long. Max_out_time in this case is set to 70ms, so for active scanning operating channel will be left for 70ms while for passive still for 20ms (fragment dwell). Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: send udev event upon firmware error to dump logsEmmanuel Grumbach2014-03-181-17/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the firmware asserts, the driver will dump the firmware state to an internal buffer. This buffer is kept aside until it is dumped through debugfs. Once an external application fetched the data, the buffer is freed and a new buffer can be allocated in case another assert occurs. A udev event is sent to trigger an external application. A simple rule like: DRIVER=="iwlwifi", ACTION=="change", RUN+="/sbin/dump_sram.sh" can fetch the data from debugfs. Here is my dump_sram.sh: phyname=$(basename ${DEVPATH}) date=$(date +%F_%H_%M) filename=/var/log/iwl-sram-${phyname}-${date}.bin cat /sys/kernel/debug/ieee80211/${phyname}/iwlwifi/iwlmvm/fw_error_dump > ${filename} The current SRAM size is 80KB so, currently: $ ls -lh iwl-sram-phy0-2014-03-16_13_14.bin -rw-r--r-- 1 emmanuel emmanuel 81K Mar 16 13:15 iwl-sram-phy0-2014-03-16_13_14.bin and after compression: $ ls -lh iwl-sram-phy0-2014-03-16_13_14.bin.xz -rw-r--r-- 1 emmanuel emmanuel 13K Mar 16 13:15 iwl-sram-phy0-2014-03-16_13_14.bin.xz Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* Merge branch 'for-john' of ↵John W. Linville2014-02-241-3/+3
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
| * iwlwifi: remove iwl_fw_valid_(tx|rx)_ant inlinesJohannes Berg2014-02-131-1/+1
| | | | | | | | | | | | | | | | | | These inlines are pretty pointless now as they just return a fixed struct value, remove them - the code even gets shorter. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Eran Harary <eran.harary@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
| * iwlwifi: make various things constJohannes Berg2014-02-131-2/+2
| | | | | | | | | | | | | | | | | | | | There are a number of things in the .data section that should really be in .rodata, for example all ops structs and strings. Mark everything const that can be, leaving the .data section pretty much empty. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* | Merge branch 'master' of ↵John W. Linville2014-02-131-0/+2
|\ \ | |/ |/| | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
| * iwlwifi: mvm: print the version of the firmware when it assertsEmmanuel Grumbach2014-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | This can be useful to be able to spot the firmware version from the error reports without needing to fetch it from another place. Cc: <stable@vger.kernel.org> [3.10+] Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* | iwlwifi: mvm: support alive notification api version2Eran Harary2014-02-061-0/+61
| | | | | | | | | | | | | | | | | | | | | | Alive notification ver2 support error table information for 2 CPUs. This is useful to fetch the error information in case of firmware assert. Signed-off-by: Eran Harary <eran.harary@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* | iwlwifi: mvm: remove upper limit for error log base pointerAriej Marjieh2014-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | Newer NIC have different memory layout in their SRAM, so change the checks in iwl_mvm_dump_nic_error_log accordingly. Signed-off-by: Ariej Marjieh <ariej.marjieh@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* | iwlwifi: mvm: refactor power codeEmmanuel Grumbach2014-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main complexity of the power code is that it needs to take into account the firmware limitations. These limitations state that we need to have a global picture of the vifs present in the system to be able to decide if we can enable power management on a specific vif. Even device power save (as opposed to vif power management) must be disabled in certain circumstances (monitor vif). Refactor the current code to make this clearer by defining a function that explicitely computes these constraints. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* | iwlwifi: mvm: remove support for legacy power APIEmmanuel Grumbach2014-02-031-1/+1
| | | | | | | | | | | | | | | | | | If the driver detects old firmware, we disable support for power management. This greatly simplifies the code. Reviewed-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* | iwlwifi: mvm: change the format of the SRAM dumpEmmanuel Grumbach2014-02-031-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a debug tool, we dump the SRAM from the device when an error occurs. The main users of this want it in a different format, so change the format to suit their needs. Also - add a short delay between the prints to make sure that the user space logger can catch up. This happens only when the firmware asserts, and only when fw_restart is set to 0 which is typically a testing configuration. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* | iwlwifi: mvm: BT Coex - change SMPS settings in AP modeEmmanuel Grumbach2014-02-031-1/+6
| | | | | | | | | | | | | | | | Based on the Bluetooth activity grading, we can stop using the shared antenna and ask the stations to honor the new SMPS state. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* | iwlwifi: mvm: BT Coex - set low latency vif as primaryEmmanuel Grumbach2014-02-031-0/+3
| | | | | | | | | | | | | | | | | | | | If a vif is in low latency mode, it should be in primary channel. Also tell BT Coex about the change when a vif enters or exits low latency mode. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* | iwlwifi: mvm: disable powersave in low-latencyJohannes Berg2014-02-031-1/+5
| | | | | | | | | | | | | | | | | | | | While an interface is in low-latency mode, for now powersave should be disabled for it, so take low-latency into account in the powersave code and force powersave recalculation when low-latency mode changes. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* | iwlwifi: mvm: add low-latency frameworkJohannes Berg2014-02-031-0/+12
|/ | | | | | | | | | For various traffic use cases, we want to be able to treat multi- channel scenarios differently. Introduce a low-latency framework that currently only has a debugfs file to enable low-latency mode, but can later be extended. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: add inline helper for packet lengthsJohannes Berg2014-01-131-2/+2
| | | | | | | | | | | | | Add an inline helper function for getting an RX packet's length or payload length and use it throughout the code (most of which I did using an spatch.) While at it, adjust some code, and remove a bogus comment from the dvm calibration code. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Eran Harary <eran.harary@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: Update Copyright to 2014Emmanuel Grumbach2013-12-311-2/+2
| | | | | | Happy new year! Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: don't send SMPS action frame with single RX antennaEmmanuel Grumbach2013-12-091-0/+5
| | | | | | | | | | | | | Products that have only 1 antenna in Rx don't support MIMO in RX. As a consequence, they will be in STATIC always. Don't tell mac80211 to update SMPS in that case. mac80211 would send an action frame to the AP which is clearly bogus. As a matter of fact, we have seen that some APs send a deauth when that happens. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: simplify iwl_mvm_send_lq_cmdEyal Shapira2013-12-091-6/+2
| | | | | | | | | Remove the flags parameter which should be set to sync or async according to whether this is called during sta init or not. Signed-off-by: Eyal Shapira <eyal@wizery.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: don't sleep while allocating in atomic contextEmmanuel Grumbach2013-10-021-1/+1
| | | | | | | | | We want to dump the SRAM when we have an error interrupt from the device. This happens in non-sleepable context, hence the change. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: mvm: sram hex dump on NIC errorMatti Gottlieb2013-07-161-0/+23
| | | | | | | | Add sram dump on NIC error for debug improvement. Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: mvm: implement D3 testingJohannes Berg2013-05-291-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For testing the D3 (WoWLAN) firmware, it is useful to be able to run the firmware with instrumentation while the host isn't sleeping and can poke at the firmware debug logging etc. Implement this by a debugfs file. When the file is opened the D3 firmware is loaded and all regular commands are blocked. While the file is being read, poll the firmware's PME status flag and report EOF once it changes to non-zero. When it is closed, do (most of) the resume processing. This lets a user just "cat" the file. Pressing Ctrl-C to kill the cat process will resume the firwmare as though the platform resumed for non-wireless reason and when the firmware wants to wake up reading from the file automatically completes. Unlike in real suspend, only disable interrupts and don't reset the TX/RX hardware while in the test mode. This is a workaround for some interrupt problems that happen only when the PCIe link isn't fully reset (presumably by changing the PCI config space registers which the core PCI code does.) Note that while regular operations are blocked from sending commands to the firmware, they could still be made and cause strange mac80211 issues. Therefore, while using this testing feature you need to be careful to not try to disconnect, roam or similar, and will see warnings for such attempts. Als note that this requires an upcoming firmware change to tell the driver the location of the PME status flag in SRAM. D3 test will fail if the firmware doesn't report the pointer. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: mvm: add thermal throttling and CT killEytan Lifshitz2013-05-291-0/+31
| | | | | | | | | | | | 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>
* iwlwifi: mvm: fix first_antennaEmmanuel Grumbach2013-04-161-2/+3
| | | | | | | | | | | | | first_antenna is supposed to return the first antenna as a 0-based bitmap: ANT_A is BIT(0), ANT_B is BIT(1), etc... Since ffs is 1 based (ffs(BIT(0)) = 1), then we had an off-by-one bug: BIT(ffs(ANT_A)) = BIT(ffs(BIT(0))) = BIT(1) = ANT_B. So what we really want is: BIT(ffs(ANT_A) - 1) = BIT(ffs(BIT(0)) - 1) = BIT(0) = ANT_A. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: mvm: clean up invalid station handlingEmmanuel Grumbach2013-04-031-1/+1
| | | | | | | | | | | | | Using IWL_MVM_STATION_COUNT and IWL_INVALID_STATION together isn't a good idea as they have different values. Always use IWL_MVM_STATION_COUNT for an invalid station in MVM and move the definition of the IWL_INVALID_STATION constant into the DVM driver to avoid making such mistakes again. The one use in the transport code can be hard-coded to -1 instead as the station ID is passed as an integer there. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: a few fixes in licenseEmmanuel Grumbach2013-03-061-1/+1
| | | | | | | | | | 7000.c was released as GPL only by mistake: it should be dual licensed - GPL / BSD. The file that contains the license in the kernel is COPYING and not LICENSE.GPL. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: add the MVM driverJohannes Berg2013-02-011-0/+472
Newer firmware revisions have a completely new firmware API. This is the new driver for this new API. I've listed the people who directly contributed code, but many others from various teams have contributed in other ways. Cc: Alexander Bondar <alexander.bondar@intel.com> Cc: Amit Beka <amit.beka@intel.com> Cc: Amnon Paz <amnonx.paz@intel.com> Cc: Assaf Krauss <assaf.krauss@intel.com> Cc: David Spinadel <david.spinadel@intel.com> Cc: Dor Shaish <dor.shaish@intel.com> Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Cc: Eytan Lifshitz <eytan.lifshitz@intel.com> Cc: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
OpenPOWER on IntegriCloud