summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/debugfs.c
Commit message (Collapse)AuthorAgeFilesLines
* iwlwifi: split fw-error-dump between transport and mvmEmmanuel Grumbach2014-07-221-5/+35
| | | | | | | | | | | The mvm op_mode won't allocate the buffer for the transport any more. The transport allocates its own buffer and mvm is in charge of splicing the buffers in the debugfs hook. This makes the repartition easier to handle. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: BT Coex - fix the ACK / CTS kill maskEmmanuel Grumbach2014-07-221-6/+15
| | | | | | | | | | | | According to new requirements, the ACK / CTS kill mask is not related to reduced TX power anymore. This allows to remove the code that tracked reduced TX power enablement across different interfaces. The ACK / CTS kill mask is now fetch from a table. It depends on the Activity grading (activity from BT) and on the Look Up Table (LUT) type. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: add some missing iwl_mvm_ref_sync() callsEliad Peller2014-07-211-9/+34
| | | | | | | | | | | | | | | Add iwl_mvm_ref_sync() calls (with new ref types) to flows that might access the device directly. These calls make sure the device is out of d0i3, and the bus is available for direct access. Since some of these functions are reentrant, convert the refs_bitmap to a ref counter, so multiple refs of the same type could be taken concurrently. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: BT Coex - fix debugfs with old APIEmmanuel Grumbach2014-07-071-35/+148
| | | | | | | Fix the debugfs hook to make it able to display the data with the old firmware API. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: BT Coex - new APIEmmanuel Grumbach2014-07-071-16/+6
| | | | | | | | | | | | Start the new BT Coex implementation. Don't react to notifications for now - only the initial configuration is implemented. The rest will happen in next patches. Since coex.c now uses the new the new structures in all functions, we need to adapt the code to compile, even if it doesn't run yet. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: BT Coex - prepare towards new APIEmmanuel Grumbach2014-07-071-2/+2
| | | | | | | | | | | | A new API is coming. This new API is not backward compatible. So we need to keep the old commands to be able to work with the former API. Move all the current code into a new file: coex_legacy. If a firmware with the new API is detected, we currently just bail out since the implementation of the new API will come in future patches. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: BT Coex - allow to force the antenna allocationEmmanuel Grumbach2014-06-241-0/+39
| | | | | | This can be used for testing. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: update nmi registerLiad Kaufman2014-05-151-2/+1
| | | | | | | | | | | In the 8000 HW family the register for forcing an NMI has changed, so this allows to still be able to force an NMI while taking into account the HW in order to write to the correct register. Signed-off-by: Liad Kaufman <liad.kaufman@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-3/+3
| | | | | | | | | 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>
* iwlwifi: mvm/pcie: capture last commands on firmware errorJohannes Berg2014-05-061-1/+1
| | | | | | | | When a firmware error occurs, capture the last 32 commands (which are still in memory) in the error dump debugfs file. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: replace leading spaces by tabsEmmanuel Grumbach2014-04-131-3/+3
| | | | | | | Somehow I added spaces instead of tabs to a few lines in debugfs.c. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: don't use d3 fw if d0i3 is usedEliad Peller2014-04-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | bail out from the suspend/resume callbacks if d0i3 is used. declare support for ANY wowlan trigger (i.e. normal operation). On resume, we shouldn't execute the d0i3 exit flow (which might disconnect stations, etc.) until mac80211 was resumed. Add new flags to indicate we are in suspend, and call the pending exit work on resume. Since the resume flow can take some time, add a new EXIT_WORK reference type to prevent going back to d0i3 at this stage. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: remove IWL_UCODE_TLV_FLAGS_DEVICE_PS_CMD flagEmmanuel Grumbach2014-04-131-3/+2
| | | | | | | All the supported firmwares have this flag set. Reviewed-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: dump Rx FIFO when the firmware assertsEmmanuel Grumbach2014-04-131-3/+0
| | | | | | | | | | | | | | 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: add missing includeEmmanuel Grumbach2014-03-191-0/+2
| | | | | | | | | | | | | | This fixes the build for powerpc: After merging the final tree, today's linux-next build (powerpc allyesconfig) failed like this: drivers/net/wireless/iwlwifi/mvm/debugfs.c: In function 'iwl_dbgfs_fw_error_dump_release': drivers/net/wireless/iwlwifi/mvm/debugfs.c:161:2: error: implicit declaration of function 'vfree' [-Werror=implicit-function-declaration] vfree(file->private_data); ^ Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: BT Coex - add debugfs hook to set BT Tx priorityEmmanuel Grumbach2014-03-181-0/+18
| | | | | | | | | | | | In order to debug the firmware, we need to be able to set the BT priority of WiFi packets. This priority is set based on the type of the packet (control frames, EAPOL etc...). For debugging purposes, allow to override this priority by a debugfs controlled value. Enable this feature that needs this priority to be able to test it. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: send udev event upon firmware error to dump logsEmmanuel Grumbach2014-03-181-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* iwlwifi: mvm: BT Coex add support for Co-running blockEmmanuel Grumbach2014-03-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | 7265 features a new calibration which is called antenna coupling. The purpose of this calibration (which isn't really a calibration), is to measure the isolation between the antennas and that can give us useful information for the Coex modules. With this information, we can tune the LookUpTables (LUTs) that define the BT / WiFi contention policy. The LUTs currently contain dummy values - but they will be updated soon. While at it, change the current code to stop duplicate the host command while sending. This was needed back then, when the command was short enough to be allocated on the stack. Since then, the command grew a lot and is now allocated on the heap - hence we can use the NOCOPY option instead. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: cleanups in iwl_dbgfs_frame_stats_readEyal Shapira2014-03-091-15/+19
| | | | | | | | | Switch pos to char * which makes the code a bit shorter as well as other minor cleanups suggested by Joe Perches. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: init drv_stats_lockJohannes Berg2014-03-091-0/+2
| | | | | | | | Otherwise lockdep complains about the lock, I'm not sure why we didn't see this before. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: add Rx frames statistics via debugfsEyal Shapira2014-02-201-0/+72
| | | | | | | | Collect statistics regarding rates and aggregations in Rx frames and export the data via debugfs. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* 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: mvm: add debugfs for prph reg read/writeEliad Peller2014-02-131-0/+44
| | | | | | | | | | | | | | | | | | | Allow reading/writing prph registers. The address is set in the first argument of the write operation. second argument is optional and can be used for writing. e.g. echo '0xA01234 0x99' > /sys/kernel/debug/ieee80211/phy0/iwlwifi/iwlmvm/prph_reg will write 0x99 into reg 0xA01234 cat /sys/kernel/debug/ieee80211/phy0/iwlwifi/iwlmvm/prph_reg will show its current value (probably 0x99) Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> 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: add debugfs hook to take an mvm refEliad Peller2014-02-031-2/+31
| | | | | | | | | | | Support taking an mvm ref (and preventing D0i3) by writing '1' into the d0i3_refs debugfs file. The reference can be unref by writing 0 to the same file. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: add d0i3_refs debugfs fileEliad Peller2014-02-031-0/+30
| | | | | | | | | Add d0i3_refs debugfs file that prints the currently taken mvm D0i3 refs. Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: add bcast_filtering debugfs entriesEliad Peller2014-02-031-2/+211
| | | | | | | | | | | | | | | | | | | | | Allow reading and setting bcast filtering configuration through debugfs. By default, mvm->bcast_filters is used for setting the bcast filtering configuration (these filters will be configured for each associated station). For testing purposes, allow overriding this configuration, and setting the bcast filtering configuration manually. The following debugfs keys can be used: * bcast_filtering/override - use debugfs values instead of default configuration * bcast_filtering/filters - set filters (+ attributes) * bcast_filtering/macs - per-mac bcast filtering configuration (policy + attached filters) Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: provide helper to fetch the iwl_mvm_sta from sta_idEmmanuel Grumbach2014-02-031-6/+5
| | | | | | | | We somtimes need to fetch the iwl_mvm_sta structure from a station index - provide a helper to do that. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: fix SRAM dump debugfs handlerEmmanuel Grumbach2014-01-131-1/+1
| | | | | | | | If the length isn't set it means we want all the SRAM. Also - this is perfectly valid to partially dump starting at offset 0. 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: dump to debugfs the SRAM as binaryEmmanuel Grumbach2013-12-311-28/+21
| | | | | | | | | | | | | This allows to format it at will using external tools. Since different teams want it in different formats, dump the raw data and everyone can play with the data the way they want. While at it - make this code slightly more robust by making the required verification on the offsets / length in the write handler. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: dump NVM from debugfsEmmanuel Grumbach2013-12-091-0/+13
| | | | | | | | This allows to see the content of the NVM the driver reads. Note that the output is in binary, and requires some external user space tool to display the data properly. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: refactor debugfs copy_from_user()Johannes Berg2013-12-091-65/+22
| | | | | | | | | Abstract the copy_from_user() pattern into the macros defining debugfs files, reducing the code and making adding new files safer by avoiding having deal with copy_from_user() directly. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: move interface-specific debugfs to a new fileJohannes Berg2013-12-091-504/+1
| | | | | | | | | | | The debugfs file is getting pretty large and mixed up between code for the hardware and code for each interface (the two aren't even clearly separated in the code). Make it easier to handle by splitting the per-interface code into a separate file called debugfs-vif.c. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: small debugfs cleanupsJohannes Berg2013-12-091-50/+27
| | | | | | | | | | | | | | Just clean up the code a bit, in particular * make all the debugfs writes follow the same pattern with respect to buf/buf_size variables * get rid of useless comments * check return values of all file creations * drop unnecessary parentheses * remove an unused struct definition * fix some whitespace Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: Add debugfs entry to generate NMI to NICAlexander Bondar2013-12-091-0/+14
| | | | | | | | | Writting to fw_nmi entry will set DEVICE_SET_NMI_REG (0x00a01c30) generating NMI that halts NIC CPU. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: check sta_id/drain values in debugfsJohannes Berg2013-11-251-0/+4
| | | | | | | | | | | | The station ID must be valid, if it's out of range then the array access may crash. Validate the station ID to the array length, and also validate the drain value even if that doesn't matter all that much. Cc: stable@vger.kernel.org Fixes: 8ca151b568b6 ("iwlwifi: add the MVM driver") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: add missing break in debugfsJohannes Berg2013-10-291-0/+1
| | | | | | | | | When writing the disable_power_off value, the LPRX enable value also gets written unintentionally, so fix that by adding the missing break statement. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
* iwlwifi: mvm: fix fw_rx_stats debugfs entryLuciano Coelho2013-10-181-3/+6
| | | | | | | | | | | | | | | The fw_rx_stats entry in debugfs was getting truncated because the internal buffer used to hold the string was too short. The calculation of the needed buffer size was rather bogus. Simplify the calculation by multiplying the number of entries in the entire structure by the size of each data line and adding the size of the header lines. Additionally, add the mac_id value, which was missing. Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: mvm: Add device wide power commandAlexander Bondar2013-10-111-42/+40
| | | | | | | | | | | | | | | FW starts using legacy power table command (0x77) for device wide power settings. Currently this command contains only option flags field. It can configure the following: CAM (Continuous Active Mode) and POWER_SAVE_ENABLE debug option. Send this command when firmware is loaded - D0 and D3. Note: Setting this command is important to avoid unwanted FW behavior. It particularly fixes a bug when a device does not drop to low power after disassociation from AP. Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: mvm: BT Coex - adapt debugfs to new APIEmmanuel Grumbach2013-10-021-5/+45
| | | | | Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: mvm: make debugfs write() operations write up to count bytesDjalal Harouni2013-10-021-4/+8
| | | | | | | | | | | | | Some debugfs write() operations of the MVM Firmware will ignore the count argument, and will copy more bytes than what was specified. Fix this by getting the right count of bytes. This will honor restrictions put on the number of bytes to write and avoid strcmp() calls on garbage data. Signed-off-by: Djalal Harouni <tixxdz@opendz.org> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* iwlwifi: mvm: debugfs: add an option to set antennas for scan commandOren Givon2013-10-021-0/+57
| | | | | | | | | | | Add an option to set rx antennas for the scan command from debugfs. Create a file called ant_rxchain in the mvm debugfs directory. To choose antennas, write a number between 1-7 to ant_rxchain. Write 1 for A, 2 for B, 3 for AB and so on. Signed-off-by: Oren Givon <oren.givon@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* Merge branch 'for-john' of ↵John W. Linville2013-08-161-6/+11
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
| * iwlwifi: mvm: Add PBW snoozing enablementAlexander Bondar2013-08-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | The Performance Based Window snooze mechanism is based on uAPSD and is used in low-medium traffic scenarios, in order to provide better power performance while insuring low latency and jitter for the incoming traffic. This patch enables PBW snoozing in case uAPSD is enabled and all ACs are uAPSD trigger and delivery enabled. Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * iwlwifi: mvm: Implement CQM offloadingAndrei Otcheretianski2013-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Use beacon statistics notification to track RSSI. Notify mac80211 when the tresholds are crossed. The roaming treshold is configured to be equal to cqm_thold. If the beacon filtering command is not supported by fw fall back and use mac80211 mechanism. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * iwlwifi: mvm: Add basic uAPSD client supportAlexander Bondar2013-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement basic uAPSD client support adding the following: - Advertise uAPSD support in HW capabilities - Set all ACs trigger- and delivery-enabled - Set max SP length to 2 buffered frames - Assign QNDP with the highest TID with no mandatory admission control required - Set uAPSD related parameters in Power Table command Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * iwlwifi: mvm: Fix beacon filtering enablement via debugfsAlexander Bondar2013-08-091-4/+1
| | | | | | | | | | | | | | | | The code was only enabling it when already enabled, which obviously can't work. Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | Merge branch 'for-john' of ↵John W. Linville2013-08-091-0/+138
|\ \ | |/ | | | | git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
| * iwlwifi: mvm: Add RX statistics debugfs entryMatti Gottlieb2013-08-061-0/+138
| | | | | | | | | | | | | | | | | | Add a debugfs entry for the RX statistics received from the firmware. 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>
OpenPOWER on IntegriCloud