Commit graph

1033150 commits

Author SHA1 Message Date
Gregory Greenman
058b94dc9b iwlwifi: mvm: support version 11 of wowlan statuses notification
The new version of the command has same size and layout as
version 10. It just sends corresponding station id in one
of the reserved fields. It's not used in the driver, so just
be ready to accept version 11.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805141826.0a387598eef1.I3be0bbf603ef95c644218be8a12b329411f11646@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:36:09 +03:00
Luca Coelho
5bf7a9eddd iwlwifi: convert flat GEO profile table to a struct version
The GEO profiles have been stored in single-dimension arrays and the
access has been done via a single index.  We will soon need to support
different revisions of this table, which will make the flat array even
harder to handle.  To prepare for that, convert the single-dimension
array to a struct with substructures.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805141826.56f3506411a2.I600ed3708d19f2263a5a8d143f6711d08499bbb0@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:36:09 +03:00
Luca Coelho
de95c9288a iwlwifi: remove unused ACPI_WGDS_TABLE_SIZE definition
When we started supporting the new FW API for the geo profiles, we
stopped using this definition, but left it there.  Remove it now.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805141826.91dec6fad3e8.Ica42d5538d83b1407efe0c441c61aa8830e7496d@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:36:08 +03:00
Luca Coelho
51266c11ce iwlwifi: support reading and storing EWRD revisions 1 and 2
As an extension to the WRDS support for revisions 1 and 2, do the same
for the EWRD tables.  These tables have a very similar format to the
WRDS table, so most of the code is similar.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805141826.2d5494de683c.Ia024b1368873d488906a639e29454cbbdc788d03@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:36:08 +03:00
Luca Coelho
2a8084147b iwlwifi: acpi: support reading and storing WRDS revision 1 and 2
Change the SAR profile tables storage to revision 2 regardless of the
revision we read from ACPI.  Revision 2 is a superset of revision 1,
which is in turn a superset of revision 0, so they can all be stored
inside revision 2.

Add support for reading and storing also revisions 1 and 2, whose only
difference is the number of chains and number of sub-bands.  So most
of the code revolves around passing different chain and sub-band
sizes.

With this patch we still pass only revision 0 to the firmware, but
that will be changed in a separate patch.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805141826.2edad09415c8.I36297aef90a9ec6a3ea1bf1a151a62f272826d59@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:36:08 +03:00
Luca Coelho
8ecf0477b9 iwlwifi: pass number of chains and sub-bands to iwl_sar_set_profile()
The number of chains and sub-bands read from the ACPI tables varies
depending on the revision.  Pass these numbers to the
iwl_sar_set_profile() function in order to make using different
revisions easier.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805141826.905b54c398f8.I9bac8c3bc3b1b6bbe813de53746daee33e53fc86@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:36:07 +03:00
Luca Coelho
dac7171c81 iwlwifi: remove ACPI_SAR_NUM_TABLES definition
This definition was only used to pass the size of the tables in the FW
API to the iwl_sar_select_profile() function, but we should actually
pass the definition from the FW API file.  We don't have the concept
of tables in the ACPI definition, so we can remove it.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805130823.00b5084be918.I18efb3c45bffacfa9a356c2c8d34e5ffbb3eb423@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:35:18 +03:00
Luca Coelho
81870d138d iwlwifi: convert flat SAR profile table to a struct version
The SAR profiles have been stored in single-dimension arrays and the
access has been done via a single index.  We will soon need to support
different revisions of this table, which will make the flat array even
harder to handle.  To prepare for that, convert the single-dimension
array to a struct with substructures.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805130823.01530088097f.I903c236a574c7e4c0fc4db101fc39c0f5415ca43@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:35:18 +03:00
Luca Coelho
248e7e2a1d iwlwifi: rename ACPI_SAR_NUM_CHAIN_LIMITS to ACPI_SAR_NUM_CHAINS
The "LIMITS" in the macro name don't have much meaning, so remove it
to make the macro shorter and better reflect that this is the number
of chains that we have limits for.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805130823.65591c9fa2af.Ie7e4ba94c903ef444cb07df61891394c11c7c864@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:35:17 +03:00
Johannes Berg
6c608cd696 iwlwifi: mvm: fix access to BSS elements
BSS elements are protected using RCU, so we need to use
RCU properly to access them, fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805130823.fd8b5791ab44.Iba26800a6301078d3782fb249c476dd8ac2bf3c6@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:35:17 +03:00
Ilan Peer
967a39832e iwlwifi: mvm: Refactor setting of SSIDs for 6GHz scan
- Short SSIDs should always be added for direct SSIDs included
  in the scan request. However, this was not done in case that
  information for collocated APs was included. Fix this.
- With the above fix, if the FW also supports discovery of hidden
  APs over the 6GHz band, also set the corresponding full SSID
  information.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805130823.02512b7a1443.Ibb023b09b86179ed049a195f4e32e887c2f4971d@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:35:17 +03:00
Avraham Stern
3df5c0ddcf iwlwifi: mvm: silently drop encrypted frames for unknown station
When a station is removed, the driver-mac80211 station mapping is removed
before the station is actually deleted from the FW. As a result, it is
reasonable that the FW will continue to pass frames although the driver
doesn't have a station for them anymore. Thus change the message
severity level from ERR to DEBUG_DROP.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805130823.a751177743c6.I5607504dade88ba461508643f58390dd661c05ba@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:35:17 +03:00
Johannes Berg
79e561f0f0 iwlwifi: mvm: d3: implement RSC command version 5
In later firmware we haven't needed the TSC anyway since
we have it already (and firmware image doesn't change),
but the new version adds the ability to send down replay
counters for more than one GTK. Implement that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805130823.28cd065e8c4a.Ic8406a78ee46b07e0ca1b8199522ef08ec6eef53@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:35:17 +03:00
Johannes Berg
af3aab9ce2 iwlwifi: mvm: d3: make key reprogramming iteration optional
Now that only reprogramming is left in the initial key iteration,
skip it entirely on unified firmware images instead of skipping
only the command sending inside of it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805130823.c6f77325c430.I798ce9d757492a9e3d223c1de5d4e62ebbc00b2c@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:35:16 +03:00
Johannes Berg
be05fae23d iwlwifi: mvm: d3: add separate key iteration for GTK type
If we're sending the KEK/KCK data we also need the GTK and
IGTK type, add a separate key iteration for that so we can
make the configure_key iteration optional later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805130823.c99f86423702.Icf7d4e93be77ea05a80235d01851ad0155593de9@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:35:16 +03:00
Johannes Berg
631ee51202 iwlwifi: mvm: d3: refactor TSC/RSC configuration
Refactor the TSC/RSC configuration out from the normal wowlan
key iteration so we can replace it later with a different one
adapted to a different firmware API.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805130823.78e431c9aaeb.I5b83b8b30e3e7c04706a1f99b3970e4e5f36af9e@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:35:16 +03:00
Johannes Berg
398760aa96 iwlwifi: mvm: d3: remove fixed cmd_flags argument
We only ever pass cmd_flags == CMD_ASYNC, so might as well
not have the argument. Remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805130823.9130db608b77.I352cbc35fefd98cc00aa0c69ea43863942aa62f5@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:35:16 +03:00
Johannes Berg
0419e5e672 iwlwifi: mvm: d3: separate TKIP data from key iteration
We do a key iteration to program the keys, and while at it
we also collect the data necessary for TKIP. This code has
all kinds of dependencies on the firmware API though, so
take out the TKIP phase 1 key generation and do that in a
separate key iteration only if necessary.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805130823.80721fc0fd61.I5a8fbba4e3a9606f700ee41c7a4244dd5e2af935@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:35:15 +03:00
Johannes Berg
95a62c331f iwlwifi: mvm: simplify __iwl_mvm_set_sta_key()
There's no need to differentiate identical default and cipher
type cases, nor do we really need to have a 'ret' variable.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802215208.e89178b22fbf.I4d62baad9a9fdfd5c645a3cc5dbffb22feab5033@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:34:27 +03:00
Johannes Berg
199d895f47 iwlwifi: mvm: support new station key API
The new version 3 of the station key API has gotten rid of the
strange hole in the sequence counter values, support that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802215208.39a00ca1a1a6.Ifb4adeb4edd2b72232046dd2d59c0b3732f497c2@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:34:27 +03:00
Ilan Peer
35fc5feca7 iwlwifi: mvm: Fix umac scan request probe parameters
Both 'iwl_scan_probe_params_v3' and 'iwl_scan_probe_params_v4'
wrongly addressed the 'bssid_array' field which should supposed
to be any array of BSSIDs each of size ETH_ALEN and not the
opposite. Fix it.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802215208.04146f24794f.I90726440ddff75013e9fecbe9fa1a05c69e3f17b@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:34:26 +03:00
Johannes Berg
9de168a012 iwlwifi: pcie: implement Bz reset flow
Bz device reset flow changed, now the hardware (instead of
firmware) will reset the PCI bus etc., this can take up to
100ms.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802215208.df30875c6ff9.I962ed0f2c3358903dc6ba1abb65726ce5acbbd48@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:34:26 +03:00
Johannes Berg
6c0795f1a5 iwlwifi: implement Bz NMI behaviour
The method to NMI the firmware also changed in Bz devices,
implement the new logic.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802215208.c9bd2034dc05.I983c25caa09c3776c7640fff73fe739362ecc5b6@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:34:25 +03:00
Johannes Berg
9ce041f596 iwlwifi: pcie: implement Bz device startup
Device startup changed in Bz, some register bits moved around.
Change the code accordingly.

The new Bz hardware changes also the way we wake it (grab NIC
access) and the way we disable bus mastering, update the driver
code accordingly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802215208.00a137364a95.I059a2abac948965458862941ee7db6a2e1076fa6@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:34:25 +03:00
Johannes Berg
7e6dffda95 iwlwifi: read MAC address from correct place on Bz
On Bz devices, the MAC address CSRs changed from 0x380 to 0x30.
Change the boolean configuration "mac_addr_from_csr" to hold the
base address instead, and set it correctly for the different
devices using this feature.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802215208.928c7983f014.Ic5ba92d98946c1b4640280a05dcfd75119c0f0c0@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:34:24 +03:00
Johannes Berg
d01408ee3a iwlwifi: give Bz devices their own name
The real name isn't determined yet, but give them a new
name that isn't clashing with older devices.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802215208.46b86c8074b2.I94d58b8e622ca87658dc05b05483fb954d526eab@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:34:24 +03:00
Johannes Berg
d98cee05e3 iwlwifi: split off Bz devices into their own family
These devices have some places with different behaviour
required, so split them off into their own family as they
should be.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802215208.90257303559f.I4c4342229dcb9513099a3152605f0947423e86dc@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:34:21 +03:00
Mukesh Sisodiya
e75bc5f3f1 iwlwifi: yoyo: cleanup internal buffer allocation in D3
With recent changes in the firmware SRAM debug during D3 is
enabled by default and need not be enabled by driver.
cleaning the code to align the same.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802215208.8535203d0ef7.Ib1695ce5de921b0472d0b1052e729e071573b863@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:34:20 +03:00
Johannes Berg
105167830d iwlwifi: mvm: treat MMPDUs in iwl_mvm_mac_tx() as bcast
There's no need for all the complicated conditions here, any
bufferable MMPDUs or MMPDUs for client interfaces are already
coming through the TXQ interface, not iwl_mvm_mac_tx().

Simplify the logic.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802172232.3939f7c5c43a.I1d5cb5262e31a000023d79acbb897b8db50adf0d@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:33:25 +03:00
Johannes Berg
366fc672d6 iwlwifi: mvm: clean up number of HW queues
Since switching to mac80211 TXQs, we no longer need to
advertise more hardware queues than ACs, since we don't
even set QUEUE_CONTROL anyway, so the vif->hw_queue[]
mapping array won't be used.

All we need (at least for now) is for hw->queues to
indicate that we have enough queues to handle QoS.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802172232.80611a3c1ee7.I8a3d2b269421b6d8bada8c12cce3e095e6cfaeed@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:33:25 +03:00
Johannes Berg
c6ce1c74ef iwlwifi: mvm: avoid static queue number aliasing
When TVQM is enabled (iwl_mvm_has_new_tx_api() is true), then
queue numbers are just sequentially assigned 0, 1, 2, ...
Prior to TVQM, in DQA, there were some statically allocated
queue numbers:
 * IWL_MVM_DQA_AUX_QUEUE == 1,
 * both IWL_MVM_DQA_INJECT_MONITOR_QUEUE and
   IWL_MVM_DQA_P2P_DEVICE_QUEUE == 2, and
 * IWL_MVM_DQA_AP_PROBE_RESP_QUEUE == 9.

Now, these values are assigned to the members mvm->aux_queue,
mvm->snif_queue, mvm->probe_queue and mvm->p2p_dev_queue by
default. Normally, this doesn't really matter, and if TVQM is
in fact available we override them to the real values after
allocating a queue for use there.

However, this allocation doesn't always happen. For example,
for mvm->p2p_dev_queue (== 2) it only happens when the P2P
Device interface is started, if any. If it's not started, the
value in mvm->p2p_dev_queue remains 2. This wouldn't really
matter all that much if it weren't for iwl_mvm_is_static_queue()
which checks a queue number against one of those four static
numbers.

Now, if no P2P Device or monitor interface is added then queue
2 may be dynamically allocated, yet alias mvm->p2p_dev_queue or
mvm->snif_queue, and thus iwl_mvm_is_static_queue() erroneously
returns true for it. If it then gets full, all interface queues
are stopped, instead of just backpressuring against the one TXQ
that's really the only affected one.

This clearly can lead to issues, as everything is stopped even
if just a single TXQ filled its corresponding HW queue, if it
happens to have an appropriate number (2 or 9, AUX is always
reassigned.) Due to a mac80211 bug, this also led to a situation
in which the queues remained stopped across a deauthentication
and then attempts to connect to a new AP started failing, but
that's fixed separately.

Fix all of this by simply initializing the queue numbers to
the invalid value until they're used, if TVQM is enabled, and
also setting them back to that value when the queues are later
freed again.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802172232.2e47e623f9e2.I9b0830dafbb68ef35b7b8f0f46160abec02ac7d0@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:33:24 +03:00
Zheng Yongjun
5993c90ccb iwlwifi: use DEFINE_MUTEX() for mutex lock
mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802172232.2a583d006739.Ia782c08525397b6430b1c877a870d688a7f3f494@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:33:24 +03:00
Tom Rix
2b06127df0 iwlwifi: remove trailing semicolon in macro definition
The macro use will already have a semicolon.

Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802172232.3db450ebbb3c.Ic63f85b85a043256318da49d7b5a63f7dddf3986@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:33:24 +03:00
Zhang Qilong
0f5d44ac6e iwlwifi: mvm: fix a memory leak in iwl_mvm_mac_ctxt_beacon_changed
If beacon_inject_active is true, we will return without freeing
beacon.  Fid that by freeing it before returning.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
[reworded the commit message]
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802172232.d16206ca60fc.I9984a9b442c84814c307cee3213044e24d26f38a@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:33:23 +03:00
Wei Yongjun
cd7ae54934 iwlwifi: mvm: fix old-style static const declaration
GCC reports warning as follows:

drivers/net/wireless/intel/iwlwifi/mvm/rfi.c:14:1: warning:
 'static' is not at beginning of declaration [-Wold-style-declaration]
   14 | const static struct iwl_rfi_lut_entry iwl_rfi_table[IWL_RFI_LUT_SIZE] = {
      | ^~~~~

Move static to the beginning of declaration.

Fixes: 21254908cb ("iwlwifi: mvm: add RFI-M support")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802172232.f60b39bbb0c0.I8b0ad9105003d13cc4aa64fc957aec9582e8b26d@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:33:23 +03:00
Luca Coelho
c1868c0b78 iwlwifi: mvm: remove check for vif in iwl_mvm_vif_from_mac80211()
This check is useless, because we would return NULL in that case and
none of the callers actually check that the return value was not NULL
before accessing it.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802172232.f1c4844a2650.If4dc009e22cda51099a1dc4237d04bf4313055d6@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:33:22 +03:00
Luca Coelho
02289645a0 iwlwifi: pcie: remove spaces from queue names
If we use spaces in the queue names, we get files with spaces in their
name in procfs, which is ugly.  Remove the spaces.

Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802172232.0ef8aedd4f9b.If527b9ae5bf8de8c6877d4b6a21ed8d81b0f877e@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:33:22 +03:00
Johannes Berg
de34d1c1d3 iwlwifi: mvm: restrict FW SMPS request
The firmware SMPS request should only be honoured if the
connection is currently with HE and on 160 MHz, so check
that and then potentially reapply any request if the BW
changes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802172232.0cdcac5660da.I9ee7956fd4f48399855d1f97728bc58b36caf112@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:33:22 +03:00
Johannes Berg
a6dfbd040e iwlwifi: mvm: set replay counter on key install
When installing a (new) key, set the replay counter so that
after FW restart the firmware has the correct value of the
replay counters.

This doesn't have a large effect - for frames that reach
the driver, it will do a replay check, and when installing
a new key, the counter is normally zero to start with (not
for GTK though, if joining the BSS for the first time).

Since this only affects frames handled entirely by the FW,
and that's restricted to a few unicast management frames,
the only affect here is for those after a firmware restart.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802172232.1cedf2ca7bb6.I2e609c28eaa301436e6740f4f1beca838f69a96a@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:33:21 +03:00
Mordechay Goodstein
1a81bddf7f iwlwifi: mvm: remove trigger EAPOL time event
EAPOL failure results in deauthentication with various reasons, not
related to AUTH failure specifically, so we just merge AUTH failure
with failed to assoc to AP.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802172232.2ff350d85eab.I02c5b5d29c0d5c2e014bd1081b07ed33772ae04d@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:33:21 +03:00
Mordechay Goodstein
8fc3015d0d iwlwifi: iwl-dbg-tlv: add info about loading external dbg bin
This helps understand why and what debug capabilities are running.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802170640.98980f8bd17f.Ifcedf415a545a87cb341a4142085b5723d8cac4d@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:32:23 +03:00
Ilan Peer
16cff731a3 iwlwifi: mvm: Add support for hidden network scan on 6GHz band
Add support for discovery of hidden networks on the 6GHz band,
by including the scan request direct SSIDs in the FW scan request
command:

- In case a short SSID matches one of the direct SSIDs in the scan
  request command, add the matching SSID in the same offset in the
  'direct_ssids' array.
- Otherwise, add the SSID in one of the available slots.

Additionally, as a preparation to handle hidden APs, refactor
iwl_mvm_umac_scan_cfg_channels_v6_6g() the function.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802170640.ffb540a70212.Ia2bb9bc9435b833820bcc7dc30adcedb5a5a9869@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:32:22 +03:00
Ilan Peer
deedf9b97c iwlwifi: mvm: Do not use full SSIDs in 6GHz scan
The scan request processing populated the direct SSIDs
in the FW scan request command also for 6GHz scan, which is not
needed and might result in unexpected behavior.

Fix the code to add the direct SSIDs only in case the scan
is not a 6GHz scan.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802170640.f465937c7bbf.Ic11a1659ddda850c3ec1b1afbe9e2b9577ac1800@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:32:22 +03:00
Luca Coelho
2a1d2fcf2b iwlwifi: print PNVM complete notification status in hexadecimal
This value is not a simple incrementing integer, it contains some
flags as well, so reading it in hexadecimal is easier.  Change the
print to do it in hex instead of decimal.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802170640.5e35f930d0ed.I5f94575a835f060bdc8ed3477871256f8a2cbaaa@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:32:22 +03:00
Johannes Berg
e63aafea74 iwlwifi: pcie: dump error on FW reset handshake failures
If the firmware crashes while we're waiting for the reset
handshake then it cannot possibly make progress anymore,
and we will just time out the wait. That's pointless, so
just stop waiting at that point.

Additionally, if it never acknowledges the reset handshake,
something went wrong.

Dump an error in both of these cases, but we need to do it
synchronously here since the device will be turned off.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802170640.8b6a33544b4b.I55f97f70f8efa64db064a9207177a094c60ac8f1@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:32:21 +03:00
Johannes Berg
b8221b0f75 iwlwifi: prepare for synchronous error dumps
In some cases it may be necessary to synchronously create
a firmware error report, add the necessary infrastructure
for this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802170640.481b6642f0fc.I7c9c958408a285e3d19aceed2a5a3341cfc08382@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:32:21 +03:00
Johannes Berg
6ac5720086 iwlwifi: pcie: free RBs during configure
When switching op-modes, or more generally when reconfiguring,
we might switch the RB size. In _iwl_pcie_rx_init() we have a
comment saying we must free all RBs since we might switch the
size, but this is actually too late: the switch has been done
and we'll free the buffers with the wrong size.

Fix this by always freeing the buffers, if any, at the start
of configure, instead of only after the size may have changed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802170640.42d7c93279c4.I07f74e65aab0e3d965a81206fcb289dc92d74878@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:32:20 +03:00
Johannes Berg
95fe8d89bb iwlwifi: pcie: optimise struct iwl_rx_mem_buffer layout
On 64-bit machines, struct iwl_rx_mem_buffer has a lot of
padding due to the use of pointers after the small items.
Move the list entry before them, and while at it also add
documentation for it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802170640.6a62255b3df0.I47bb36530a3c2cdbd73454c796ce608ee2a32a6c@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:32:20 +03:00
Johannes Berg
2f308f008f iwlwifi: mvm: avoid FW restart while shutting down
If the firmware crashes while we're already shutting down
the system, there isn't much we can do since the shutdown
process is continuing and we wanted to do that. Don't do
a FW restart, with the implied debug collection, in this
case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802170640.43a7351ae6bd.I164d48ce4379accf76ea0637983fd946d52dc6f5@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:32:19 +03:00
Johannes Berg
0eb5a554bb iwlwifi: nvm: enable IEEE80211_HE_PHY_CAP10_HE_MU_M1RU_MAX_LTF
The device is capable of receiving MU-MIMO frames with 8 symbols,
enable the bit here that says so.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210802170640.90cf2eb42794.I692e6d0fde6e99a1db97d2e678952f043f48f603@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26 23:32:19 +03:00