summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/iwl-trans.h
AgeCommit message (Collapse)Author
2019-03-22iwlwifi: use sync nmi in case of init flow failureShahar S Matityahu
In case of alive interrupt timeout or any failure in the init flow the driver generates FW nmi. The driver assumes that the nmi will generate SW interrupt. This assumption does not hold and leads to faulty behavior in the recovery flow. Solve this by using sync nmi, this way, even if the driver does not receive SW interrupt, it still starts the recovery flow. Also remove the wait queue from iwl_fwrt_stop_device since the driver is handling the SW interrupt synchronously. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-22iwlwifi: add sync_nmi to trans opsShahar S Matityahu
Allow modules from outside pcie to call sync_nmi. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@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-02-04iwlwifi: fix send hcmd timeout recovery flowShahar S Matityahu
Both iwl_trans_fw_error and iwl_force_nmi initiate async recovery flow. Calling them both is redundant and causing a race. Solve this by removing the call to iwl_trans_fw_error. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Fixes: cfadc3ffccd5 ("iwlwifi: pcie: stop the firmware when we restart it") Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-04iwlwifi: dbg_ini: implement paging memory dumpShahar S Matityahu
Implement paging memory dump in the new dump mechanism. To support this change, moved iwl_self_init_dram strcut from trans_pcie to trans so that it will accessible via fw_runtime. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-04iwlwifi: Fix pre operational dumping flowsShahar S Matityahu
There are several dumping flows in the driver in case of a fail prior to operational. In some cases we get 2 dumps while in others we get none. Fix this by uniting the different flows. Add a different dump type to driver triggered dumps in case we want a dump but did not got assert, and make all dumping go through iwl_fw_dbg_collect_desc to avoid multiple dumps. Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
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: dbg: add apply point logicSara Sharon
Add a function to be called when apply point occurs. For each of the TLVs, the function will perform the apply point logic: - For HCMD - send the stored host command - For buffer allocation - allocate the memory and send the buffer allocation command - For trigger and region - update the stored configuration Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-11-23iwlwifi: dbg: disable triggers for iniSara Sharon
When ini is loaded, disable all legacy trigger configuration. Signed-off-by: Sara Sharon <sara.sharon@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-11-23iwlwifi: dbg: don't limit dump decisions to all or monitorSara Sharon
Currently opmode is limited to asking transport to either dump all the dumps configured at startup, or monitor only. Instead, pass to transport a bitmask, to allow flexibility. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-11-11iwlwifi: dbg: avoid passing trigger aroundSara Sharon
The trigger structure is being passed around, when all we care about is whether to dump only monitor or not. Pass a bool instead. Signed-off-by: Sara Sharon <sara.sharon@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-09-28iwlwifi: pcie: add infrastructure for multiple debug buffersSara Sharon
In future devices we will have more than one debug buffer. Prepare the infrastructure for allocation and release of multiple debug buffers by grouping the variables in an array of structures and moving it to trans section, where they will be visible to opmode and FW. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-08-31iwlwifi: refactor txq_alloc for supporting more command typeGolan Ben Ami
Support more txq_alloc command types by moving the command declaration to the gen specific area. While at it, move some of the code segments to a common place for re-use. Signed-off-by: Golan Ben Ami <golan.ben.ami@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: remove dump_regs() from transport opsJohannes Berg
This is used only within PCIe, and there's no reason to go through the transport methods for a function call within PCIe itself. Remove the dump_regs() method and call the function directly. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2018-08-31iwlwifi: drop packets with bad status in CDSara Sharon
We need to drop packets with errors (such as replay, MIC, ICV, conversion, duplicate and so on). Drop invalid packets, put the status bits in the metadata and move the enum definition to the correct place (FW API header). Signed-off-by: Sara Sharon <sara.sharon@intel.com> 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-08-02iwlwifi: trans: add a new op for getting DMA dataSara Sharon
Op mode will need this data in order to feed FW with it. Signed-off-by: Sara Sharon <sara.sharon@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-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-04-20iwlwifi: add TX queue size parameter to TX queue allocationSara Sharon
As preparation for dynamic queue sizing, add a parameter of the TX queue size to the dynamic queue allocation op mode API. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-12-20iwlwifi: avoid duplicate sw reset executions in the codeGolan Ben Ami
Most of the sw resets in the code are done by one function, which writes to the relevant CSR. Use the common function to perform the only reset which was done separately, redundant to the common code. Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
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-12-19Merge tag 'wireless-drivers-next-for-davem-2017-12-18' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next The drivers/net/wireless/intel/iwlwifi/pcie/drv.c conflict was resolved using a diff provided by Kalle in his pull request. Kalle Valo says: ==================== wireless-drivers-next patches for 4.16 A bigger pull request this time, the most visible change being the new driver mt76. But there's also Kconfig refactoring in ath9k and ath10k, work beginning in iwlwifi to have rate scaling in firmware/hardware, wcn3990 support getting closer in ath10k and lots of smaller changes. mt76 * a new driver for MT76x2e, a 2x2 PCIe 802.11ac chipset by MediaTek ath10k * enable multiqueue support for all hw using mac80211 wake_tx_queue op * new Kconfig option ATH10K_SPECTRAL to save RAM * show tx stats on QCA9880 * new qcom,ath10k-calibration-variant DT entry * WMI layer support for wcn3990 ath9k * new Kconfig option ATH9K_COMMON_SPECTRAL to save RAM wcn36xx * hardware scan offload support wil6210 * run-time PM support when interface is down iwlwifi * initial work for rate-scaling offload * Support for new FW API version 36 * Rename the temporary hw name A000 to 22000 ssb * make SSB a menuconfig to ease disabling it all mwl8k * enable non-DFS 5G channels 149-165 ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2017-12-05iwlwifi: mvm: enable RX offloading with TKIP and WEPDavid Spinadel
Set the flag that indicates that ICV was stripped on if this option was enabled in the HW. Cc: stable@vger.kernel.org # 4.13+ [this is needed for the 9000-series HW to work properly] Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-11-28iwlwifi: rename the temporary name of A000 to the official 22000Luca Coelho
The family name A000 was just a place-holder when we didn't know what the official name would be yet. Now we know that the family name is 22000, so rename all occurrences accordingly. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-11-03iwlwifi: Add more call-sites for pcie reg dumperKirtika Ruchandani
Commit a6d24fad00d9 ("iwlwifi: pcie: dump registers when HW becomes inaccessible") added a function to dump pcie config registers and memory mapped registers on a failure. It is currently only accessible within trans.c. Add it to struct iwl_trans_ops, so that failure cases in other files can call it. While there, add a call to this function from iwl_pcie_load_firmware_chunk in pcie/tx.c, since this is a common failure case seen on some platforms. Signed-off-by: Kirtika Ruchandani <kirtika@chromium.org> [modified the commit message slightly] Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-11-03iwlwifi: remove host assisted pagingEmmanuel Grumbach
This was used for internal devices that are now deprecated. All the currently existing devices can do paging without any help from the host. 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: remove dflt_pwr_limit from the transportLuca Coelho
The default power limit read from the SPLC method in ACPI doesn't have anything to do with the transport and is only used in the opmode, so we can remove it from the trans. Additionally, this value is only user when the opmode is starting, so we don't need to store it anywhere. Remove the dflt_pwr_limit element from the trans and move call to iwl_acpi_get_pwr_limit() call to mvm. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-10-06iwlwifi: trans: move ref/unref code to the common part of the transportLuca Coelho
De-inline iwl_trans_ref/unref and move it to common transport code in preparation for more common code to come to these functions. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-08-01iwlwifi: reorganize firmware APIJohannes Berg
Apart from DVM, all firmware uses the same base API, and there's code outside iwlmvm that needs to interact with it. Reflect this in the source better and reorganize the firmware API to a new fw/api/ directory. While at it, split the already pretty large fw-api.h file into a number of smaller files, going from almost 3k lines in there to a maximum number of lines less than 1k. Signed-off-by: Johannes Berg <johannes.berg@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-23iwlwifi: add a W/A for a scheduler hardware bugEmmanuel Grumbach
In case we need to move the scheduler write pointer by steps of 0x40, 0x80 or 0xc0, the scheduler gets stuck. This leads to hardware error interrupts with status: 0x5A5A5A5A or alike. In order to work around this, detect in the transport layer that we are going to hit this case and tell iwlmvm to increment the sequence number of the packets. This allows to keep the requirement that the WiFi sequence number is in sync with the index in the scheduler Tx queue and it also allows to avoid the problematic sequence. This means that from time to time, we will start a queue from ssn + 1, but that shouldn't be a problem since we don't switch to new queues for AMPDU now that we have DQA which allows to keep the same queue while toggling the AMPDU state. This bug has been fixed on 9000 devices and up. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-23iwlwifi: pcie: don't report RF-kill enabled while shutting downJohannes Berg
When toggling the RF-kill pin quickly in succession, the driver can get rather confused because it might be in the process of shutting down, expecting all commands to go through quickly due to rfkill, but the transport already thinks the device is accessible again, even though it previously shut it down. This leads to bugs, and I even observed a kernel panic. Avoid this by making the PCIe code only report that the radio is enabled again after the higher layers actually decided to shut it off. This also pulls out this common RF-kill checking code into a common function called by both transport generations and also moves it to the direct method - in the internal helper we don't really care about the RF-kill status anymore since we won't report it up until the stop anyway. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-05iwlwifi: remove unnecessary code in iwl_trans_alloc_tx_cmdLuca Coelho
When we removed dev_cmd_headroom, the check for dev_cmd_ptr == NULL became unnecessary, since we just return dev_cmd_ptr anyway. Cleanup the function to avoid useless code. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-05iwlwifi: split firmware API from iwl-trans.hJohannes Berg
In order to more clearly document which parts of this file are firmware API and which are something else, split the firmware API into a separate file to include here. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-05iwlwifi: fix a kernel-doc tagJohannes Berg
The kernel-doc here is on an enum, so don't tag it as struct but correctly as enum instead, preventing an error. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-06-02iwlwifi: add wait for tx queue emptySara Sharon
Now that we have 512 queues, add a wait for single TX queue to gen2. This replaces gen1 wait_tx_queues_empty, which was limited to 32 queues. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-04-25iwlwifi: rename wait_for_tx_queues_emptySara Sharon
Rename current wait_tx_queue_empty to wait_tx_queues_empty since it waits for multiple queues (up to 32). Next patch will add a wait for single TX queue which is needed for gen2 to be scalable for 512. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-04-25iwlwifi: move to 512 queuesSara Sharon
Avoid using the old define since it will enlarge necessary structs for previous HW. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-04-19iwlwifi: move to TVQM modeSara Sharon
In TVQM firmware returns the value of the queue ID and code should accept it. The TX queue config API was changed. Move to new API. This has to be done in parallel in mvm and pcie. Do not move yet to 512 queues since there are some opens with enabling it. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-04-19iwlwifi: mvm: support moving to mgmt tidSara Sharon
For a000 FW moved to 15 as management TID. The change for us is fairly local - translate old TID to 15 when enabling and disabling a queue, and make sure to cover it also on TX responses. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-04-19iwlwifi: pcie: introduce a000 TX queues managementSara Sharon
In a000 devices the TX handling is different in a few ways: * Queues are allocated dynamically * DQA is enabled by default * Driver shouldn't access TFH registers - ucode configures it all in SCD_QUEUE_CFG command Support all this in a new API with op mode, where op mode sends the command, transport will allocate the queue dynamically, fill in DMA properties, send the command to FW and get the ID back. Current implementation only sets the new transport API and fills the DMA properties. Future patches will complete the other parts. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-04-11iwlwifi: remove unnecessary dev_cmd_headroom parameterLuca Coelho
We don't need this parameter anymore, since we always pass 0 anyway. Remove it from the structure and from all the relevant functions. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2017-04-11Revert "iwlwifi: introduce trans API to get byte count table"Sara Sharon
This reverts commit 8aacf4b73fe8 ("iwlwifi: introduce trans API to get byte count table"). The commit is not needed as a better approach will be taken. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19iwlwifi: move to wide ID for all commandsSara Sharon
Due to firmware design considerations, move to wide ID for all commands. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>