Commit graph

859360 commits

Author SHA1 Message Date
Luca Coelho
0c18714a0d iwlwifi: pcie: set iwl_trans->cfg later in the probe function
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 <luciano.coelho@intel.com>
2019-09-06 15:51:01 +03:00
Luca Coelho
809805a820 iwlwifi: pcie: move some cfg mangling from trans_pcie_alloc to probe
There were a couple of special handling to find the correct cfg inside
iwl_trans_pcie_alloc().  Move them to iwl_pci_probe() so they're
together with the rest of the decisions.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:42:13 +03:00
Luca Coelho
91eff3f820 iwlwifi: pcie: use the cfg we passed to iwl_trans_pcie_alloc()
Instead of using iwl_trans->cfg in iwl_trans_pcie_alloc(), use the
local argument that we received.  This will allow us to not to set the
cfg during iwl_trans_alloc() so it can be decided later.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:35:43 +03:00
Luca Coelho
79b6c8feb6 iwlwifi: separate elements from cfg that are needed by trans_alloc
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-06 15:34:25 +03:00
Shahar S Matityahu
cd6de838e1 iwlwifi: dbg_ini: use regions ops array instead of switch case in dump flow
Make a static regions ops array and use it instead of switch case when
determining what op to use to collect a region.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:23 +03:00
Shahar S Matityahu
bdc6239014 iwlwifi: dbg_ini: make a single ops struct for paging collect
Needed for future changes.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:22 +03:00
Shahar S Matityahu
d4c444ef0d iwlwifi: dbg_ini: move tx fifo data into fw runtime
Needed for future changes.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:22 +03:00
Shahar S Matityahu
0fc296f8ef iwlwifi: dbg_ini: use linked list for dump TLVs during dump creation
Avoid iterating over dump TLVs twice for size calculation by using
linked list to store the dump TLVs.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:22 +03:00
Shahar S Matityahu
00eacde497 iwlwifi: dbg_ini: separate cfg and dump flows to different modules
separate configuration flows and dump collection flows.
make ini configuration flows be in iwl-dbg-tlv.c and dump related flows
in dbg.c to better reflect their logical difference.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:22 +03:00
Tova Mussai
dd36a507c8 iwlwifi: mvm: look for the first supported channel when add/remove phy ctxt
Can't rely that band 2.4 is always supported by the NIC and use the
first channel in this band for the phy ctxt.
Instead, look for the first channel in the first band that is supported

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:22 +03:00
Tova Mussai
c8cfa08e39 iwlwifi: allocate bigger nvm data in case of UHB
In case of Ultra-high-band (UHB), need to allocate nvm data structure in
size of UHB channels array.

Signed-off-by: Tova Mussai <tova.mussai@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:21 +03:00
Luca Coelho
2c0c024035 iwlwifi: remove unnecessary IWL_DEVICE_AX200_COMMON definition
Remove the IWL_DEVICE_AX200_COMMON definition, since it's only used
once and relies mostly on IWL_DEVICE_22000_COMMON anyway.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:21 +03:00
Shahar S Matityahu
a64d4e8d45 iwlwifi: dbg: align wrt log prints to the same format
Align wrt log prints to the driver coding style
Remove the ext field from the log and print it at the beginning of the
apply point.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:21 +03:00
Shahar S Matityahu
f259fc896e iwlwifi: dbg_ini: remove debug flow TLV
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-06 15:31:21 +03:00
Shahar S Matityahu
341bd290b9 iwlwifi: dbg_ini: verify debug TLVs at allocation phase
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-06 15:31:21 +03:00
Shahar S Matityahu
a1af4c486a iwlwifi: dbg_ini: use function to check if ini dbg mode is on
use iwl_trans_dbg_ini_valid function instead of a boolean value check if
dbg_ini mode is on. It is needed for a future patch.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:20 +03:00
Luca Coelho
4a7bd3cf83 iwlwifi: remove duplicate FW string definitions
The string we define as IWL_22000_HR_B_F0_FW_PRE is duplicate with
IWL_22000_QU_B_HR_B_FW_PRE.  Remove the former to avoid confusion.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:20 +03:00
Luca Coelho
2196ea9c8d iwlwifi: bump FW API to 50 for 22000 series
Start supporting API version 50 for 22000 series.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:20 +03:00
Johannes Berg
94c4a2e4c0 iwlwifi: api: fix FTM struct documentation
The real name is struct iwl_tof_range_req_ext_cmd, fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:20 +03:00
Gil Adam
6ce1e5c0c2 iwlwifi: support per-platform antenna gain
TX power limits as defined in the OTP assume the worst case scenario
in terms of the platform's atenna gain, but most platforms are below
that value so they can use more TX power without passing the regulatory
limit. If the platform indicates in the BIOS that it indeed has lower
gain, and the geographic location allows it, higher TX power can be
used. The driver reads the PPAG (Per-Platform Antenna Gain) data from
BIOS (if it exists), validates it and sends the appropriate command to
the FW. This flow happens once at FW init, in case of suspend/resume
there is no need to read again from BIOS as we save those values during
init, so just send the PPAG command again to FW.

Signed-off-by: Gil Adam <gil.adam@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:20 +03:00
Luca Coelho
e533f74589 iwlwifi: mvm: remove check for lq_sta in __iwl_mvm_rs_tx_status()
The check is not necessary anymore, because now the struct is not
allocated separately, but is part of the mvmsta struct.  Remove the
check, since it's dead code.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:19 +03:00
Emmanuel Grumbach
0202bcf0e3 iwlwifi: mvm: simplify the channel switch flow for newer firmware
Any firmware that supports the new channel switch flow is
able to close / re-open the queues when needed. It takes
into account the channel switch mode etc...
Don't open / close the queues or enable / disable beacon
abort before and after the channel switch in case the
firmware is able to do this by itself.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:19 +03:00
Christoph Hellwig
2d46f7af5e iwlwifi: stop passing bogus gfp flags arguments to dma_alloc_coherent
dma_alloc_coherent is not just the page allocator.  The only valid
arguments to pass are either GFP_ATOMIC or GFP_ATOMIC with possible
modifiers of __GFP_NORETRY or __GFP_NOWARN.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:19 +03:00
Shahar S Matityahu
5b79c32352 iwlwifi: dbg_ini: remove periphery phy and aux regions handling
periphery phy and aux regions should not be collected like periphery mac
region. Remove their handling. The handling will be added in the future
once the FW will support it.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Fixes: 7a14c23dcd ("iwlwifi: dbg: dump data according to the new ini TLVs")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:18 +03:00
Shahar S Matityahu
40b7d22d1f iwlwifi: dbg_ini: use linked list to store debug TLVs
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-06 15:31:18 +03:00
Shahar S Matityahu
ccdc3d6d15 iwlwifi: dbg_ini: maintain buffer allocations from trans instead of TLVs buffer
Maintain DRAM debug buffer status in trans instead of keeping it as
part of the TLVs buffer to avoid allocating extra space for it.
Needed for future changes.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:18 +03:00
Shahar S Matityahu
15995b7593 iwlwifi: dbg: add debug periphery registers to 9000 device family
Add debug HW periphery registers to 9000 device family.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:18 +03:00
Haim Dreyfuss
1971c4f9d9 iwlwifi: remove unused regdb_ptrs allocation
regdb_ptrs is not in used anymore, remove it.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:18 +03:00
Shahar S Matityahu
41874d3a0b iwlwifi: dbg_ini: align dbg tlv functions names to a single format
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-06 15:31:17 +03:00
Ayala Beker
b5baefdad2 iwlwifi: scan: don't pass large argument by value
Function iwl_mvm_scan_set_legacy_probe_req() second argument
size is too large to be passed by value.
Fix it to be passed by reference.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:17 +03:00
Emmanuel Grumbach
bab3cb9285 iwlwifi: remove pm_runtime completely
This means:
1) stop calling pm_runtime_resume when starting the hardware
2) removing the unneeded low_power parameter to start / stop hw / fw
   transport ops
3) squashing transport functions that are now the same
   _iwl_trans_pcie_start_hw / iwl_trans_pcie_start_hw

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:17 +03:00
Emmanuel Grumbach
75dfa6d58b iwlwifi: remove the d0i3 related module parameters
Those are now effectless.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:17 +03:00
Emmanuel Grumbach
043fa90173 iwlwifi: pcie: remove some more d0i3 code from the transport
CMD_SEND_IN_IDLE, CMD_MAKE_TRANS_IDLE and CMD_WAKE_UP_TRANS
are not used. Remove them.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:17 +03:00
Emmanuel Grumbach
0d52497ac8 iwlwifi: pcie: remove the refs / unrefs from the transport
This code is now stale

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:17 +03:00
Emmanuel Grumbach
ea74343aeb iwlwifi: remove the opmode's d0i3 handlers
Remove the now unneeded functions that called those from the
transport layer.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:16 +03:00
Emmanuel Grumbach
f60e275081 iwlwifi: remove runtime_pm_mode
This is always set to IWL_PLAT_PM_MODE_DISABLED

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:16 +03:00
Alex Malamud
ba7136f3f9 iwlwifi: Set w-pointer upon resume according to SN
During D3 state, FW may send packets.
As a result, "write" queue pointer will be incremented by FW.
Upon resume from D3, driver should adjust its shadows of "write" and "read"
pointers to the value reported by FW.

1. Keep TID used during wowlan configuration.
2. Upon resume, set driver's "write" and "read" queue pointers
	to the value reported by FW.

Signed-off-by: Alex Malamud <alex.malamud@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:16 +03:00
Johannes Berg
242d9c8b9a iwlwifi: mvm: use FW thermal monitoring regardless of CONFIG_THERMAL
It doesn't make sense to use the FW thermal monitoring only if we
have CONFIG_THERMAL, because then we use the default thresholds
etc. which may be different from what the firmware implements, as
we don't maintain them in the driver now. Only the CTDP code needs
to actually be under CONFIG_THERMAL.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:16 +03:00
Mordechay Goodstein
2e838c6f18 iwlwifi: mvm: name magic numbers with enum
It's hard to follow the numbers so rename it with enum

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:15 +03:00
Ayala Beker
de645c9346 iwlwifi: scan: add support for new scan request command version
Scan API was changed to support 6Ghz channels as well.
Support the new version.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:15 +03:00
Alex Malamud
aa43ae1216 iwlwifi: LTR updates
New FW versions introduces LTR feature enablement by default.
For such FW versions, driver (mvm/xvt) should not send
host command to enable LTR feature, also it should be possible to
override LTR configuration through the debugfs.

1. Send LTR feature enablement command only for FW versions
which does not advertises SET_LTR_GEN2 capability.
2. Implement ltr_config file in debugfs for LTR configuration override.

Signed-off-by: Alex Malamud <alex.malamud@intel.com>
2019-09-06 15:31:15 +03:00
Emmanuel Grumbach
24d2176d17 iwlwifi: remove the code under IWLWIFI_PCIE_RTPM
This flag should never be set unless integration work with the
platform is done.  We don't support any platforms officially and don't
plan to do so in the near future, so we can remove this option
entirely in order to avoid having it enabled by mistake.

This has been marked with "depends on EXPERT", so there shouldn't be
many systems running with it set.  And, if there are systems, they
should not be using this flag.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:15 +03:00
Emmanuel Grumbach
3596ad2b3e iwlwifi: trans: remove suspending flag
This is set but never read.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:15 +03:00
Emmanuel Grumbach
1877fa3d5f iwlwifi: remove CMD_HIGH_PRIO
This flag is never set on any host command. Remove it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:14 +03:00
Emmanuel Grumbach
66cdca01e0 iwlwifi: mvm: remove last leftovers of d0i3
We're now left with a status bit that is never set and a few
other leftovers.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:14 +03:00
Emmanuel Grumbach
632fa0eabc iwlwifi: mvm: remove iwl_mvm_update_d0i3_power_mode
Also change the signature of the power functions that won't
receive d0i3=true anymore.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:14 +03:00
Emmanuel Grumbach
99970e4afb iwlwifi: mvm: remove d0i3_ap_sta_id
This variable read, but never set. Remove it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:14 +03:00
Emmanuel Grumbach
0ea933880a iwlwifi: mvm: iwl_mvm_wowlan_config_key_params is for wowlan only
Now that d0i3 is dead, this function can't be called from d0i3
flows. Change its signature and make it static.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:13 +03:00
Emmanuel Grumbach
4574536333 iwlwifi: mvm: remove the d0i3 entry/exit flow
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:13 +03:00
Emmanuel Grumbach
4d4183c45e iwlwifi: mvm: remove the tx defer for d0i3
This is not needed anymore

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-09-06 15:31:13 +03:00