aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/iwl-trans.c
AgeCommit message (Collapse)AuthorFilesLines
2020-10-09Revert "iwlwifi: remove wide_cmd_header field"Luca Coelho1-1/+1
This reverts commit 0a8159cbd11abf586693f1ec5264d0df587b71d8. It turns out that this flag is used by iwldvm, so we can't get rid of it. This broke iwldvm devices with BAD_COMMAND errors. Fixes: 0a8159cbd11a ("iwlwifi: remove wide_cmd_header field") Signed-off-by: Luca Coelho <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20201009122123.3e4ee0ad7a71.Id6d95ae601f048aeb4d2ed63a1712e469da84369@changeid
2020-10-01iwlwifi: move all bus-independent TX functions to common codeMordechay Goodstein1-0/+19
After moving out all Tx fields not related to pcie-bus it's time to move the code to a common place. We also rename all pcie functions name to txq. Signed-off-by: Mordechay Goodstein <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20200930161256.3947a5276003.I3fe1bec2b25a965a49532df288f47b8b59eb1500@changeid Signed-off-by: Luca Coelho <[email protected]>
2020-10-01iwlwifi: remove wide_cmd_header fieldMordechay Goodstein1-1/+1
Driver doesn't support fw without wide_cmd so driver always sets it to true. instead of setting it always to true just remove the field. Signed-off-by: Mordechay Goodstein <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20200928121852.e6137861d917.I93405604eb503568688b28d3169fea7fbb88ed7e@changeid Signed-off-by: Luca Coelho <[email protected]>
2020-10-01iwlwifi: iwl-trans: move tfd to trans layerMordechay Goodstein1-0/+12
The tfd_* code is not directly related to the PCIe transport, so move the structures it uses to the common iwl-trans.h header. Signed-off-by: Mordechay Goodstein <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20200924162105.a1a2ce2bce38.Ieada0fe087ebcc9bc84e22fc5abc9dba8914dd9f@changeid Signed-off-by: Luca Coelho <[email protected]>
2020-10-01iwlwifi: move bc_pool to a common trans headerMordechay Goodstein1-0/+17
The bc_pool code is not directly related to the PCIe transport, so move the structures it uses to the common iwl-trans.h header. Signed-off-by: Mordechay Goodstein <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20200924162105.f6469c62665d.Id920f1ae8f70886b66a98956a6412726d29a9481@changeid Signed-off-by: Luca Coelho <[email protected]>
2020-10-01iwlwifi: iwl-trans: move all txcmd init to trans allocMordechay Goodstein1-3/+25
txcmd fields is not directly related to the PCIe transport, so move to the common iwl_trans_alloc function. Signed-off-by: Mordechay Goodstein <[email protected]> Signed-off-by: Luca Coelho <[email protected]> Link: https://lore.kernel.org/r/iwlwifi.20200924162105.862ef88d1ab2.Iba220a962b5d6d05c030b9275d97a89202d055dc@changeid Signed-off-by: Luca Coelho <[email protected]>
2019-12-23iwlwifi: pcie: allocate smaller dev_cmd for TX headersJohannes Berg1-5/+5
As noted in the previous commit, due to the way we allocate the dev_cmd headers with 324 byte size, and 4/8 byte alignment, the part we use of them (bytes 20..40-68) could still cross a page and thus 2^32 boundary. Address this by using alignment to ensure that the allocation cannot cross a page boundary, on hardware that's affected. To make that not cause more memory consumption, reduce the size of the allocations to the necessary size - we go from 324 bytes in each allocation to 60/68 on gen2 depending on family, and ~120 or so on gen1 (so on gen1 it's a pure reduction in size, since we don't need alignment there). To avoid size and clearing issues, add a new structure that's just the header, and use kmem_cache_zalloc(). Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: pcie: set iwl_trans->cfg later in the probe functionLuca Coelho1-2/+0
Instead of setting the cfg to iwl_trans already during allocation, set it only later when we have had the time to decide which cfg to use. This is part of the effort to be able to decide the cfg based on HW revision and RF ID after iwl_trans_alloc() has been called. For now, since we still have a bunch of code checking the HW revision and the RF ID, we set iwl_trans->cfg early, even before we decided the real cfg to use. We only use the trans configuration at this point, so this is fine for now. In the future, the trans configuration will be completely independent from the rest of the config structure, so we'll be able to avoid this. Additionally, we can't access the PRPH registers in iwl_trans_alloc() anymore, so move the HW REV C-step check for family 8000 code later to the probe function as well. This step is probably not necessary, but if that's the case it should be removed separately later on. Signed-off-by: Luca Coelho <[email protected]>
2019-09-06iwlwifi: pcie: remove the refs / unrefs from the transportEmmanuel Grumbach1-14/+0
This code is now stale Signed-off-by: Emmanuel Grumbach <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2018-08-31iwlwifi: remove all occurrences of the FSF address paragraphLuca Coelho1-5/+0
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 <[email protected]>
2017-10-06iwlwifi: trans: move ref/unref code to the common part of the transportLuca Coelho1-0/+16
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 <[email protected]>
2017-06-23iwlwifi: pcie: don't report RF-kill enabled while shutting downJohannes Berg1-1/+1
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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-23iwlwifi: remove resp_pkt NULL checksJohannes Berg1-0/+3
Contrary to what some of the comments say, if rfkill was asserted the transport will return -ERFKILL instead of success, if CMD_WANT_SKB was set, so it's not necessary to check cmd.resp_pkt for being NULL if the return code was success. Validate that this is true in iwl_trans_send_cmd(). Most of the other code modifications were done with the following spatch: @@ struct iwl_host_cmd cmd; identifier pkt; @@ <... ( pkt = cmd.resp_pkt; ... -if (!pkt) { ... } | pkt = cmd.resp_pkt; ... -if (WARN_ON(!pkt)) { ... } | -if (!cmd.resp_pkt) { ... } ) ...> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-06-02iwlwifi: add wait for tx queue emptySara Sharon1-0/+2
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 <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2017-04-11iwlwifi: remove unnecessary dev_cmd_headroom parameterLuca Coelho1-5/+2
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 <[email protected]>
2016-09-19iwlwifi: migrate to devm_* APISharon Dvir1-6/+2
Change PCIE and trans resource allocations to managed resources. Signed-off-by: Sharon Dvir <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2016-09-19iwlwifi: move to wide ID for all commandsSara Sharon1-0/+3
Due to firmware design considerations, move to wide ID for all commands. Signed-off-by: Sara Sharon <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2016-09-15iwlwifi: pcie: introduce new tfd and tb formatsSara Sharon1-0/+1
New hardware supports bigger TFDs and TBs. Introduce the new formats and adjust defines and code relying on old format. Changing the actual TFD allocation is trickier and deferred to the next patch. Signed-off-by: Sara Sharon <[email protected]> Signed-off-by: Luca Coelho <[email protected]>
2015-12-13iwlwifi: update host command messages to new formatSharon Dvir1-1/+59
Host commands now have a group id, express this in printed messages. Signed-off-by: Sharon Dvir <[email protected]> Signed-off-by: Emmanuel Grumbach <[email protected]>
2015-12-13iwlwifi: uninline iwl_trans_send_cmdEmmanuel Grumbach1-0/+33
This function got too big to be inlined. Uninline it. Signed-off-by: Emmanuel Grumbach <[email protected]>
2015-12-01iwlwifi: change the Intel Wireless email addressEmmanuel Grumbach1-1/+1
[email protected] is not available anymore. [email protected] should be used instead. Signed-off-by: Emmanuel Grumbach <[email protected]>
2015-11-18iwlwifi: move under intel vendor directoryKalle Valo1-0/+114
Part of reorganising wireless drivers directory and Kconfig. Signed-off-by: Kalle Valo <[email protected]>