summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
AgeCommit message (Collapse)Author
2019-11-15iwlwifi: remove IWL_DEVICE_22560/IWL_DEVICE_FAMILY_22560Johannes Berg
This is dead code, nothing uses the IWL_DEVICE_22560 macro and thus nothing every uses IWL_DEVICE_FAMILY_22560. Remove it all. While at it, remove some code and definitions used only in this case, and clean up some comments/names that still refer to it. 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-10-25iwlwifi: dbg_ini: load external dbg cfg after internal cfg is loadedShahar S Matityahu
In the new API implementation the driver does not keep the internal and external debug configurations in separate structs so the last configuration that is loaded overrides the previous ones (this is true only in some of the TLVs e.g. the buffer allocation TLV). Load the external configuration after the internal is loaded so that user configuration will override the default coming with the FW. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: add a pointer to the trans_cfg directly in transLuca Coelho
Add a pointer to the iwl_trans structure and point it to the trans part of the cfg. This is the first step in disassociating the trans configuration from the rest of the configuration. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: separate elements from cfg that are needed by trans_allocLuca Coelho
In order to be able to select the cfg depending on the HW revision or on the RF ID, we need to set up the trans before selecting the cfg. To do so, move the elements from cfg that are needed by iwl_trans_alloc() to a separate struct at the top of the cfg, so it can be used by other cfg types as well, before selecting the rest of the configuration. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: dbg_ini: remove debug flow TLVShahar S Matityahu
Debug flow TLV was removed from the FW. Remove the TLV from the driver as well. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: dbg_ini: verify debug TLVs at allocation phaseShahar S Matityahu
Reimplement debug TLV allocation flow. The driver will check the validity of the debug TLVs prior allocating space for them. Any malformed or unsupported TLV will be skipped. The TLV specific checks will be added in later patches. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: dbg_ini: use linked list to store debug TLVsShahar S Matityahu
Use a linked list to maintain the debug TLVs instead of a single buffer. This way, the driver does not need to iterate over the binary file twice and allocates smaller chunks of memory. Also, in case one allocation fails the driver will work with the partial configuration instead of aborting the entire debug configuration. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: dbg_ini: align dbg tlv functions names to a single formatShahar S Matityahu
align the naming to iwl_dbg_tlv_* Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06iwlwifi: remove the d0i3 related module parametersEmmanuel Grumbach
Those are now effectless. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-07-30iwlwifi: dbg_ini: move iwl_dbg_tlv_free outside of debugfs ifdefShahar S Matityahu
The driver should call iwl_dbg_tlv_free even if debugfs is not defined since ini mode does not depend on debugfs ifdef. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Fixes: 68f6f492c4fa ("iwlwifi: trans: support loading ini TLVs from external file") Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-07-30iwlwifi: dbg_ini: move iwl_dbg_tlv_load_bin out of debug override ifdefShahar S Matityahu
ini debug mode should work even if debug override is not defined. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Fixes: 68f6f492c4fa ("iwlwifi: trans: support loading ini TLVs from external file") Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-06-29iwlwifi: support FSEQ TLV even when FMAC is not compiledEmmanuel Grumbach
FSEQ TLV should be parsed and read even when FMAC is not compiled. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-06-29iwlwifi: dbg: move trans debug fields to a separate structShahar S Matityahu
Unite iwl_trans debug related fields under iwl_trans_debug struct to increase readability and keep iwl_trans clean. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-06-29iwlwifi: fix module init error pathsJohannes Berg
When the module fails to initialize for some reason, it doesn't clean up properly. Fix that. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-06-29iwlwifi: dbg_ini: support debug info TLVShahar S Matityahu
Add support to debug info TLV. The TLV contains human readable naming of the FW image and the debug configuration. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-06-01iwlwifi: Fix double-free problems in iwl_req_fw_callback()Jia-Ju Bai
In the error handling code of iwl_req_fw_callback(), iwl_dealloc_ucode() is called to free data. In iwl_drv_stop(), iwl_dealloc_ucode() is called again, which can cause double-free problems. To fix this bug, the call to iwl_dealloc_ucode() in iwl_req_fw_callback() is deleted. This bug is found by a runtime fuzzing tool named FIZZER written by us. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-29iwlwifi: parse command version TLVJohannes Berg
In newer firmware images there's a command version TLV that states, for each listed command or notification, which version of the command and/or notification structure is used. Read and keep this data to be able to use it in the future. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-19iwlwifi: add FW_INFO debug levelShahar S Matityahu
Add FW_INFO debug level. This level is enabled if INFO or FW debug levels are set. Also, set fw request and callback prints under this debug level. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-20iwlwifi: iwl-drv: no need to check return value of debugfs_create functionsGreg Kroah-Hartman
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Johannes Berg <johannes.berg@intel.com> Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Cc: Luca Coelho <luciano.coelho@intel.com> Cc: Intel Linux Wireless <linuxwifi@intel.com> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: linux-wireless@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-14iwlwifi: mvm: add a debug_enable opShahar S Matityahu
D3 debug data is disabled by default. Currently it is done by tampering the dump mask. Add an operation that will allow this to be changed without recompilation. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-14iwlwifi: add FW recovery flowMordechay Goodstein
Add new API and TLV for the ability to send commands in the beginning and end of reset flow. The full flow of recovery is: 1. While loading FW, get address (from the TLV) of target buffer to read in case of reset 2. If an error/assert happens read the address data from step 1. 3. Reset the HW and load the FW. 4. Send the data read in step 2. 5. Add station keys 6. Send notification to FW that reset flow is done. The main use of the recovery flow is for support in PN/SN recovery when offloaded Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-14iwlwifi: receive umac and lmac error table addresses from TLVsShahar S Matityahu
TLV 54 holds umac debug related addresses. TLV 55 holds lmac debug related addresses. These TLVs aim to replace the alive notification data in the future. Parse and keep error table addresses received from the TLVs for both lmac and umac and use these addresses instead of the pointer received from alive notification. The feature supports only unified image. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25iwlwifi: remove support for 9000 A-step devicesLuca Coelho
We don't support 9000 A-step devices anymore, so we can remove support for loading both the a0/a0 and a0/b0 FWs. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-12-20iwlwifi: dbg_ini: fix bad ini tlv parsingShahar S Matityahu
Add a break at the end of the ini tlv case. Fix both the internal and external tlv parsing. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-11-23iwlwifi: add debugfs file to read fw debug data recordingLior Cohen
FW debug data will oneshot read all data available in DRAM and fill the supplied user buffer. In case the read request is greater than the new data in DRAM, the driver will write all data it has and return the buffer immediately. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Lior Cohen <lior2.cohen@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-11-23iwlwifi: trans: support loading ini TLVs from external fileSara Sharon
Support loading and storing ini TLVs from external file. Those TLVs are appended to the default TLVs, so store them separately. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-11-23iwlwifi: trans: parse and store debug ini TLVsSara Sharon
The new debug ini TLVs can be either packed into firmware binary or written in external file. Support loading them from both. Store the data per apply point. Apply point is a point during driver runtime, where the TLV becomes active. For example, a trigger of hardware error may be configured to collect a subset of data pre-alive, as a opposed to HW error that occurs after alive. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-10-06iwlwifi: add fall through commentJohannes Berg
The fall-through to the MVM case is intended as we have to do *something* to continue, and can't easily clean up. So we'll just fail in mvm later, if this does happen. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-10-06iwlwifi: dbg: move debug data to a structSara Sharon
The debug variables are bloating the iwl_fw struct. And the fields are out of order, missing docs and some are redundant. Clean this up. This serves as preparation for unionizing it for the new ini infra. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-08-31Revert "iwlwifi: allow memory debug TLV to specify the memory type"Johannes Berg
This reverts the addition of memory type in the memory debug TLV as the firmware never ended up implementing it, and now the PRPH dump is added as a different TLV. Signed-off-by: Johannes Berg <johannes.berg@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>
2018-08-31iwlwifi: add d3 debug data supportShahar S Matityahu
During d3, the firmware records debug data into internal buffer if debug data collection occurs, collect the data that was written to the buffer Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-08-02iwlwifi: mvm: remove dead gscan codeLuca Coelho
There was a bunch of code to support gscan which has never been used. Remove it all to cleanup and get rid of a lot of dead code. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-08-02iwlwifi: allow masking out memory areas from the fw dumpShahar S Matityahu
Reading and dumping memory areas takes time, and sometimes dumping all of the areas isn't necessary. Allow choosing the memory areas which should be dumped. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-07-26iwlwifi: pcie: support 2k rx buffersGolan Ben Ami
The smallest rb size supported today is 4k rx buffers. 22560 devices use 2k rxb's, so allow using 2k buffers. Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-07-26iwlwifi: add module parameter to disable 802.11axLuca Coelho
Add a module parameter to disable 802.11ax features in supported devices. This is useful for testing or if there are interoperability issues with some APs. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-04-26iwlwifi: pcie: remove non-responsive deviceLuca Coelho
If we fail to to grab NIC access because the device is not responding (i.e. CSR_GP_CNTRL returns 0xFFFFFFFF), remove the device from the PCI bus, to avoid any further damage, and to let the user space rescan. In order to inform the userspace that a rescan is needed, we send a kobject uevent with "INACCESSIBLE". This functionality is disabled by default, but can be enabled via a new module parameter called "remove_when_gone". In the future we may change this module parameter to include 3 modes instead: do nothing; auto-rescan or; send uevent. Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Rajat Jain <rajatja@google.com>
2018-04-26iwlwifi: introduce Image Loader (IML) - new firmware imageGolan Ben-Ami
In future devices a new image will be introduced - IML. The IML, image loader, is loaded by the ROM, and as part of the new self-init flow, loads the rest of the firmware images to the device. Store the image, so the ROM can load it to the device. Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-03-27wireless: Use octal not symbolic permissionsJoe Perches
Prefer the direct use of octal for permissions. Done with checkpatch -f --types=SYMBOLIC_PERMS --fix-inplace and some typing. Miscellanea: o Whitespace neatening around these conversions. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-12-20iwlwifi: support internal debug data collection for new devicesGolan Ben Ami
Support internal debug data collection on 9000 and newer devices. The method for finding the base and end address has changed on new HW's, so introduce a new version of debug destination tlv. Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-11-25iwlwifi: print the version number of the firmware in hexEmmanuel Grumbach
Starting from a version 35, the minor version should be printed in hexa. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-11-03iwlwifi: remove dead code for internal devices onlyEmmanuel Grumbach
We had a bunch of code that was relevant for internal devices only. Those devices are now being depreceated. Kill all the now unneeded code. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06iwlwifi: fix minor code style issuesChristoph Böhmwalder
Fixes three trivial issues as reported by checkpatch.pl, namely two switch/case indentation issues and one alignment issue in a multiline comment. Signed-off-by: Christoph Böhmwalder <christoph@boehmwalder.at> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-24Merge git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.gitKalle Valo
Stephen Rothwell reported quite a few conflicts in iwlwifi between wireless-drivers and wireless-drivers-next. To avoid any problems later in other trees merge w-d to w-d-next to fix those conflicts early.
2017-08-18iwlwifi: Demote messages about fw flags size to infoJoão Paulo Rechi Vita
These messages are not reporting a real error, just the fact that the firmware knows about more flags than the driver. Currently these messages are presented to the user during boot if there is no bootsplash covering the console, even when booting the kernel with "quiet". Demoting it to the warn level helps having a clean boot process. Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-09iwlwifi: change functions that can only return 0 to voidSharon Dvir
Change iwl_set_ucode_api_flags(), iwl_set_ucode_capabilities() to be void. No need to check returned values. Found by Klocwork. Signed-off-by: Sharon Dvir <sharon.dvir@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-01iwlwifi: fix fw_pre_next_step to apply also for C stepHaim Dreyfuss
C step NICs should use the latest FW (currently B step). Correct the condition to make C step NICs advanced its default FW name to the latest one. Also rename _next_ to b_or_c to avoid confusion. Fixes: 5da083d1922c ("iwlwifi: add support for 9000 HW B-step NICs") Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-29iwlwifi: create new subdirectory for FW interactionJohannes Berg
There's a lot of mvm code that really should be more generic and part of the iwlwifi module. Start by making a place to keep such code - in the new "fw" subdirectory - and already move the firmware related header files there. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-29iwlwifi: unify external & internal modparam namesJohannes Berg
Where possible (all except for "11n_disable", which isn't valid in C) rename the internal names for module parameters to be the same as the externally visible names, to aid finding their use etc. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-05iwlwifi: add 9000 and A000 device familiesSara Sharon
Add two new device families to differentiate them from 8000. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>