]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
6 months agowifi: mac80211: avoid double free in auth/assoc timeout
Miri Korenblit [Thu, 2 Jan 2025 14:20:09 +0000 (16:20 +0200)]
wifi: mac80211: avoid double free in auth/assoc timeout

In case of authentication/association timeout (as detected in
ieee80211_iface_work->ieee80211_sta_work), ieee80211_destroy_auth_data
is called.
At the beginning of it, the pointer to ifmgd::auth_data memory is
copied to a local variable.
If iface_work is queued again during the execution of the current one,
and then the driver is flushing the wiphy_works (for its needs),
ieee80211_destroy_auth_data will run again and free auth_data.
Then when the execution of the original worker continues, the previously
copied pointer will be freed, causing a kernel bug:
 kernel BUG at mm/slub.c:553! (double free)

Same for association timeout (just with ieee80211_destroy_assoc_data and
ifmgd::assoc_data)

Fix this by NULLifying auth/assoc data right after we copied
the pointer to it. That way, even in the scenario above, the code will
not handle the same timeout twice.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250102161730.0c3f7f781096.I2b458fb53291b06717077a815755288a81274756@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: ibss: mark IBSS left before leaving
Johannes Berg [Thu, 2 Jan 2025 14:20:08 +0000 (16:20 +0200)]
wifi: mac80211: ibss: mark IBSS left before leaving

Mark that we left the IBSS before actually leaving (which
requires calling the driver). Otherwise, it's possible to
have the driver do some work flushing etc. while leaving,
and then get into the work trying to join again while all
data is being destroyed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.81a6c12b304c.I8484f768371e128152a84aa164854cca9ec1066b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: ibss: stop transmit when merging IBSS
Johannes Berg [Thu, 2 Jan 2025 14:20:07 +0000 (16:20 +0200)]
wifi: mac80211: ibss: stop transmit when merging IBSS

We disable the carrier, but that doesn't immediately take
effect, and as such a concurrent transmit can go into the
driver while drv_leave_ibss() is happening and confuse it.
Synchronize to avoid that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.83b58167e80e.I538751fbe1b4302d20f6ed80afb024bca6a2dbf5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: don't flush non-uploaded STAs
Johannes Berg [Thu, 2 Jan 2025 14:20:06 +0000 (16:20 +0200)]
wifi: mac80211: don't flush non-uploaded STAs

If STA state is pre-moved to AUTHORIZED (such as in IBSS
scenarios) and insertion fails, the station is freed.
In this case, the driver never knew about the station,
so trying to flush it is unexpected and may crash.

Check if the sta was uploaded to the driver before and
fix this.

Fixes: d00800a289c9 ("wifi: mac80211: add flush_sta method")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.e3d10970a7c7.I491bbcccc46f835ade07df0640a75f6ed92f20a3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: set key link ID to the deflink one
Benjamin Berg [Thu, 2 Jan 2025 14:20:05 +0000 (16:20 +0200)]
wifi: mac80211: set key link ID to the deflink one

When in non-MLO mode, the key ID was set to -1 even for keys that are
not pairwise. Change the link ID to be the link ID of the deflink in
this case so that drivers do not need to special cases for this.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.0c066f084677.I4a5c288465e75119edb6a0df90dddf6f30d14a02@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: pass correct link ID on assoc
Benjamin Berg [Thu, 2 Jan 2025 14:20:04 +0000 (16:20 +0200)]
wifi: mac80211: pass correct link ID on assoc

The link ID passed to drv_mgd_complete_tx when handling the association
response was not set.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.2b06504ecaef.Ifb94e9375b910de6cdd2e5865d8cb3ab9790b314@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: simplify nested if checks
Johannes Berg [Thu, 2 Jan 2025 14:20:03 +0000 (16:20 +0200)]
wifi: iwlwifi: simplify nested if checks

In the absence of (an) else clause(s), "if (a) if (b)" is
equivalent to "if (a && b)", so simplify the code a bit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.7ddc9cb1ea50.If18bd94706d6c821e34c38a4704bf85dca6207b2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: nl80211: simplify nested if checks
Johannes Berg [Thu, 2 Jan 2025 14:20:02 +0000 (16:20 +0200)]
wifi: nl80211: simplify nested if checks

In the absence of (an) else clause(s), "if (a) if (b)" is
equivalent to "if (a && b)", so simplify the code a bit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.c8bf7338aa64.Ie49dcc1ba44b507d91d5a9d8bd538d7ac2e46c54@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: Support parsing EPCS ML element
Ilan Peer [Thu, 2 Jan 2025 14:20:01 +0000 (16:20 +0200)]
wifi: mac80211: Support parsing EPCS ML element

Add support for parsing an ML element of type EPCS priority
access, which can optionally be included in EHT protected action
frames used to configure EPCS.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.5afdf65cff46.I0ffa30b40fbad47bc5b608b5fd46047a8c44e904@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: Fix common size calculation for ML element
Ilan Peer [Thu, 2 Jan 2025 14:20:00 +0000 (16:20 +0200)]
wifi: mac80211: Fix common size calculation for ML element

When the ML type is EPCS the control bitmap is reserved, the length
is always 7 and is captured by the 1st octet after the control.

Fixes: 0f48b8b88aa9 ("wifi: ieee80211: add definitions for multi-link element")
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.5790376754a7.I381208cbb72b1be2a88239509294099e9337e254@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: cfg80211: Add support for controlling EPCS
Ilan Peer [Thu, 2 Jan 2025 14:19:59 +0000 (16:19 +0200)]
wifi: cfg80211: Add support for controlling EPCS

Add support for configuring Emergency Preparedness Communication
Services (EPCS) for station mode.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.ea54ac94445c.I11d750188bc0871e13e86146a3b5cc048d853e69@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: Support dynamic link addition and removal
Ilan Peer [Thu, 2 Jan 2025 14:19:58 +0000 (16:19 +0200)]
wifi: mac80211: Support dynamic link addition and removal

Add support for adding and removing station links:

- Adding links is done asynchronously, i.e., first
  an ML reconfiguration action frame is sent to the AP
  requesting to add links, and only when the AP replies,
  links which were added successfully by the AP are added
  locally.
- Removing links is done synchronously, i.e., the links
  are removed before sending the ML reconfiguration
  action frame to the AP (to avoid using this links after
  the AP MLD removed them but before the station got the
  ML reconfiguration response). In case the AP replies with a
  status indicating that a link removal was not successful,
  disconnect (as this should not happen an is an indication
  that something might be wrong on the AP MLD).

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.ec0492a8dd21.I2869686642bbc0f86c40f284ebf7e6f644b551ab@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: Pull link space calculation to a function
Ilan Peer [Thu, 2 Jan 2025 14:19:57 +0000 (16:19 +0200)]
wifi: mac80211: Pull link space calculation to a function

Pull the calculation of the size needed for a link in an association
request frame to a function, so it could also be used during the
construction of other frames as well, e.g., ML link configuration
request frame.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.ac16adfa39d4.I9e28c2fcd5ca252341c817fc03ea8df7b807fcbf@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: Refactor adding association elements
Ilan Peer [Thu, 2 Jan 2025 14:19:56 +0000 (16:19 +0200)]
wifi: mac80211: Refactor adding association elements

Instead of always using 'sdata->u.mgd.assoc_data' have
the association data be passed as an argument.

This will later allow to use the same functionality
for adding links to the current association.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.191f58f2bba7.I6baa6e2989a39937234ff91d7db5ff1359a6bb30@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: cfg80211: Add support for dynamic addition/removal of links
Ilan Peer [Thu, 2 Jan 2025 14:19:55 +0000 (16:19 +0200)]
wifi: cfg80211: Add support for dynamic addition/removal of links

Add support for requesting dynamic addition/removal of links to the
current MLO association.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.cef23352f2a2.I79c849974c494cb1cbf9e1b22a5d2d37395ff5ac@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: nl80211: Split the links handling of an association request
Ilan Peer [Thu, 2 Jan 2025 14:19:54 +0000 (16:19 +0200)]
wifi: nl80211: Split the links handling of an association request

And move it to a separate function so it could later be reused for
dynamic addition of links.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.1e9c1873796a.I27a51c8c1d455f0a6d5b59f93f2c9ac49282febb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: ieee80211: Add some missing MLO related definitions
Ilan Peer [Thu, 2 Jan 2025 14:19:53 +0000 (16:19 +0200)]
wifi: ieee80211: Add some missing MLO related definitions

As a preparation to support ML reconfiguration request and
response, add additional ML reconfiguration definitions
required to support the flow. See Section 9.4.2.321.4 in
Draft P802.11be_D6.0.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250102161730.4970ca10ebfd.Ibe7f6108cd0e04b8c739a8e35a4f485f664a17e6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: nl80211: fix nl80211_start_radar_detection return value
Nicolas Escande [Thu, 9 Jan 2025 16:10:40 +0000 (17:10 +0100)]
wifi: nl80211: fix nl80211_start_radar_detection return value

Since the wiphy_guard changes, rdev_start_radar_detection's return value
in nl80211_start_radar_detection is ignored and we always returned 0.

Fixes: f42d22d3f796 ("wifi: cfg80211: define and use wiphy guard")
Signed-off-by: Nicolas Escande <nico.escande@gmail.com>
Link: https://patch.msgid.link/20250109161040.325742-1-nico.escande@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: cfg80211: skip regulatory for punctured subchannels
Kavita Kavita [Thu, 9 Jan 2025 05:04:09 +0000 (10:34 +0530)]
wifi: cfg80211: skip regulatory for punctured subchannels

The kernel performs several regulatory checks for AP mode in
nl80211/cfg80211. These checks include radar detection,
verification of whether the sub-channel is disabled, and
an examination to determine if the channel is a DFS channel
(both DFS usable and DFS available). These checks are
performed across a frequency range, examining each sub-channel.

However, these checks are also performed on subchannels that
have been punctured which should not be examined as they are
not in use.

This leads to the issue where the AP stops because one of
the 20 MHz sub-channels is disabled or radar detected on
the channel, even when the sub-channel is punctured.

To address this issue, add a condition check wherever
regulatory checks exist for AP mode in nl80211/cfg80211.
This check identifies punctured channels and, upon finding
them, skips the regulatory checks for those channels.

Co-developed-by: Manaswini Paluri <quic_mpaluri@quicinc.com>
Signed-off-by: Manaswini Paluri <quic_mpaluri@quicinc.com>
Signed-off-by: Kavita Kavita <quic_kkavita@quicinc.com>
Link: https://patch.msgid.link/20250109050409.25351-1-quic_kkavita@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: fix tid removal during mesh forwarding
Andy Strohman [Tue, 7 Jan 2025 10:44:31 +0000 (10:44 +0000)]
wifi: mac80211: fix tid removal during mesh forwarding

With change (wifi: mac80211: fix receiving A-MSDU
frames on mesh interfaces), a non-zero TID assignment
is lost during slow path mesh forwarding.

Prior to this change, ieee80211_rx_h_mesh_fwding()
left the TID intact in the header.

As a result of this header corruption, packets belonging
to non-zero TIDs will get treating as belonging
TID 0 by functions such as ieee80211_get_tid().
While this miscategorization by itself is an
issue, there are additional ramifications
due to the fact that skb->priority still reflects
the mesh forwarded packet's ingress (correct) TID.

The mt7915 driver inspects the TID recorded within
skb->priority and relays this to the
hardware/radio during TX. The radio firmware appears to
react to this by changing the sequence control
header, but it does not also ensure/correct the TID in
the QoS control header. As a result, the receiver
will see packets with sequence numbers corresponding
to the wrong TID. The receiver of the forwarded
packet will see TID 0 in QoS control but a sequence number
corresponding to the correct (different) TID in sequence
control. This causes data stalls for TID 0 until
the TID 0 sequence number advances past what the receiver
believes it should be due to this bug.

Mesh routing mpath changes cause a brief transition
from fast path forwarding to slow path forwarding.
Since this bug only affects the slow path forwarding,
mpath changes bring opportunity for the bug to be triggered.
In the author's case, he was experiencing TID 0 data stalls
after mpath changes on an intermediate mesh node.

These observed stalls may be specific
to mediatek radios. But the inconsistency between
the packet header and skb->priority may cause problems
for other drivers as well. Regardless if this causes
connectivity issues on other radios, this change is
necessary in order transmit (forward) the packet on the
correct TID and to have a consistent view a packet's TID
within mac80211.

Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
Signed-off-by: Andy Strohman <andrew@andrewstrohman.com>
Link: https://patch.msgid.link/20250107104431.446775-1-andrew@andrewstrohman.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: rename iwl_datapath_monitor_notif::mac_id to link_id
Miri Korenblit [Tue, 31 Dec 2024 11:59:15 +0000 (13:59 +0200)]
wifi: iwlwifi: rename iwl_datapath_monitor_notif::mac_id to link_id

The FW really sends the link_id here. Rename it, while leaving a FIXME
in iwlmvm.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20241231135726.a3d07be17fb1.Ib8a623af099b9b0f2b8d552fca546c476a69a82d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: pcie: make iwl_pcie_d3_complete_suspend() static
Johannes Berg [Tue, 31 Dec 2024 11:59:14 +0000 (13:59 +0200)]
wifi: iwlwifi: pcie: make iwl_pcie_d3_complete_suspend() static

The function is only used in the same file, so it can
trivially be static. Do that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241231135726.c09d2251824c.Ibcfbb4bbe27a0767a1da4a5897b2b0f70193dc3d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: pcie: make _iwl_trans_pcie_gen2_stop_device() static
Johannes Berg [Tue, 31 Dec 2024 11:59:13 +0000 (13:59 +0200)]
wifi: iwlwifi: pcie: make _iwl_trans_pcie_gen2_stop_device() static

This function isn't used outside the file it's implemented in,
so make it static.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241231135726.060c01653d4e.I3f0675b3977e474b633ff10965fe6512f34ae593@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: remove unused tas_rsp variable
Anjaneyulu [Tue, 31 Dec 2024 11:59:12 +0000 (13:59 +0200)]
wifi: iwlwifi: mvm: remove unused tas_rsp variable

optimize local variable usage in iwl_dbgfs_tas_get_status_read().

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241231135726.fab845da5c6f.Ica84a4c0df33db9c9b6baef28893bb42e1f367b7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: handle version 3 GET_TAS_STATUS notification
Anjaneyulu [Tue, 31 Dec 2024 11:59:11 +0000 (13:59 +0200)]
wifi: iwlwifi: mvm: handle version 3 GET_TAS_STATUS notification

Add a check to ensure only version-3 of GET_TAS_STATUS notification
is allowed.

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241231135726.1d571ac80957.Ia48b1cf5585a2a9f9c461e80f5a0ba2bb16c3af4@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: extend TAS_CONFIG cmd support for v5
Anjaneyulu [Tue, 31 Dec 2024 11:59:10 +0000 (13:59 +0200)]
wifi: iwlwifi: extend TAS_CONFIG cmd support for v5

Extend TAS_CONFIG to send exact data read from bios to firmware
without filtering/altering bios data. This enables driver becoming
purely a pipe for TAS features.

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241231135726.f46d58e7cfd1.Ifd81e632fa3e7039b8d139ee0d1c24e09669dff5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: remove Mr/Ms radio
Johannes Berg [Tue, 31 Dec 2024 11:59:09 +0000 (13:59 +0200)]
wifi: iwlwifi: remove Mr/Ms radio

This radio never shipped, so we don't need to have it in the code.
Remove the configurations and a few lines of code for it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241231135726.9f984db3efa0.I5a39ec951430e765bdea49ff150dd41af5e911f3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: add WIKO to PPAG approved list
Anjaneyulu [Tue, 31 Dec 2024 11:59:08 +0000 (13:59 +0200)]
wifi: iwlwifi: add WIKO to PPAG approved list

Add WIKO to the list of the OEMs that are allowed to use
the PPAG feature

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241231135726.d2ba5aee512a.I529cfefabd04c64d801895d6a274e3225a952090@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: support EMLSR on WH/PE
Johannes Berg [Tue, 31 Dec 2024 11:59:07 +0000 (13:59 +0200)]
wifi: iwlwifi: mvm: support EMLSR on WH/PE

Unlike FM which only supported EMLSR on B-step and later, here
it can be supported starting from A-step.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241231135726.65a3b822e002.I4d6f10e02686f1cc159121cf702d6b747cab5b8a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: config: unify fw/pnvm MODULE_FIRMWARE
Johannes Berg [Tue, 31 Dec 2024 11:59:06 +0000 (13:59 +0200)]
wifi: iwlwifi: config: unify fw/pnvm MODULE_FIRMWARE

All newer devices now require PNVM files, so don't list them
separately but simply generate the relevant MODULE_FIRMWARE()
declarations together. This simplifies the code and adds a
large number of missing PVNM declarations.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241231135726.302e521e08e9.I782513432d3dcbf801e8262522ded95302548e1c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: improve/fix chanctx min_def use logic
Johannes Berg [Tue, 31 Dec 2024 11:59:05 +0000 (13:59 +0200)]
wifi: iwlwifi: mvm: improve/fix chanctx min_def use logic

There are two cases in which the min_def isn't used:
 a) if FILS will be enabled
 b) if FTM responder is enabled

Both of these apply to AP mode only, but for FILS we're
not checking that right now. Change the code to iterate
the interfaces and links using the channel context, and
check for AP mode for both, not just for FTM responder.

In the case of iwl_mvm_enable_fils() this might also fix
an issue where FILS is enabled for an IBSS network that
happens to be started on 6 GHz, though that's not very
likely to be possible due to regulatory.

However for RX OMI bandwidth reduction the driver needs
to use the min_def in client mode as well, in order to
actually reduce bandwidth when it requested that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241231135726.7b91025e103d.I4c99c03fd32363d574ab5e34798b6099401f0729@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: implement reset escalation
Johannes Berg [Tue, 31 Dec 2024 11:59:04 +0000 (13:59 +0200)]
wifi: iwlwifi: implement reset escalation

If the normal reset methods don't work well, attempt to
escalate to ever increasing methods. TOP reset will only
be available for SC (and presumably higher) devices, and
still needs to be filled in.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241231135726.804e005403d8.I9558f09cd68eec16b02373b1e47adafd28fdffa3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: implement product reset for TOP errors
Johannes Berg [Tue, 31 Dec 2024 11:59:03 +0000 (13:59 +0200)]
wifi: iwlwifi: implement product reset for TOP errors

The TOP is a shared (between BT and WiFi) hardware component,
and if it has an error we need to reset the whole device, i.e.
both BT and WiFi. This is achieved by calling a specific ACPI
DSM (device-specific method) with the right arguments before
doing a reset via the object referenced by _PRR.

Since this is needed here, but a function reset will always do
better than just re-enumerating the bus in case of errors, we
can always try to at least do a function reset and do the full
product reset only when needed for TOP errors.

Also, for some Bz and Sc devices where BT is PCIe/IOSF as well,
find the BT device and unbind that device as well so the BT
driver can recover from the reset that's going to happen,
rather than having to somehow detect that the device was reset.

Also add - currently unused - the function reset mode, this is
going to get used in the upcoming escalation model.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241231135726.5b0f846d3e13.Ia14ccac38ac3d48adf5f341b17c7e34ccc41c065@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: get the max number of links from the firmware
Emmanuel Grumbach [Tue, 31 Dec 2024 11:59:02 +0000 (13:59 +0200)]
wifi: iwlwifi: get the max number of links from the firmware

The firmware advertises the maximum number of links.
Use it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241231135726.5eb29510f2b4.I7f35f61987c2ee905960ee476df6803632b0feb8@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: pcie: check for WiAMT/CSME presence
Johannes Berg [Tue, 31 Dec 2024 11:59:01 +0000 (13:59 +0200)]
wifi: iwlwifi: pcie: check for WiAMT/CSME presence

In order to know whether or not a product reset can safely
be done (without risking locking up the system completely),
check for ME presence with the known methods.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241231135726.0ac9173f1f37.Id83b80b61548b8f4f01e96a356dafe063543c4ac@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: cfg80211: Move cfg80211_scan_req_add_chan() n_channels increment earlier
Kees Cook [Mon, 30 Dec 2024 18:36:14 +0000 (10:36 -0800)]
wifi: cfg80211: Move cfg80211_scan_req_add_chan() n_channels increment earlier

Since adding __counted_by(n_channels) to struct cfg80211_scan_request,
anything adding to the channels array must increment n_channels first.
Move n_channels increment earlier.

Reported-by: John Rowley <lkml@johnrowley.me>
Closes: https://lore.kernel.org/stable/1815535c709ba9d9.156c6a5c9cdf6e59.b249b6b6a5ee4634@localhost.localdomain/
Fixes: aa4ec06c455d ("wifi: cfg80211: use __counted_by where appropriate")
Signed-off-by: Kees Cook <kees@kernel.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://patch.msgid.link/20241230183610.work.680-kees@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: prohibit deactivating all links
Johannes Berg [Mon, 30 Dec 2024 08:14:07 +0000 (09:14 +0100)]
wifi: mac80211: prohibit deactivating all links

In the internal API this calls this is a WARN_ON, but that
should remain since internally we want to know about bugs
that may cause this. Prevent deactivating all links in the
debugfs write directly.

Reported-by: syzbot+0c5d8e65f23569a8ffec@syzkaller.appspotmail.com
Fixes: 3d9011029227 ("wifi: mac80211: implement link switching")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20241230091408.505bd125c35a.Ic3c1f9572b980a952a444cad62b09b9c6721732b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: tests: add utility to create sdata skeleton
Benjamin Berg [Wed, 1 Jan 2025 05:05:38 +0000 (07:05 +0200)]
wifi: mac80211: tests: add utility to create sdata skeleton

Some functions that should be tested may expect an sdata object that is
configured to a basic degree. Add setup code to create such an object
for use by tests.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.12eeefd3c98b.I6e8c2b8374d4305f16675524ca30621e089b6fb0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: also verify requirements in EXT_SUPP_RATES
Benjamin Berg [Wed, 1 Jan 2025 05:05:37 +0000 (07:05 +0200)]
wifi: mac80211: also verify requirements in EXT_SUPP_RATES

Parse both the Supported Rates and BSS Membership Selectors as well as
the extended version of the tag when verifying whether we support all
features.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.f1840f19afa7.I12e3a0e634ce7014f5067256d9a6215fec6bf165@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: verify BSS membership selectors and basic rates
Benjamin Berg [Wed, 1 Jan 2025 05:05:36 +0000 (07:05 +0200)]
wifi: mac80211: verify BSS membership selectors and basic rates

We should not attempt a connection if the BSS we are connecting to
requires support for a basic rate or other feature using the BSS
membership selector. Add a check verifying this.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.e58a0f34c798.Ifeb3bfd7b157ffa2ccdb20ca1cba6cf068fd117d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: nl80211: permit userspace to pass supported selectors
Benjamin Berg [Wed, 1 Jan 2025 05:05:35 +0000 (07:05 +0200)]
wifi: nl80211: permit userspace to pass supported selectors

Currently the SAE_H2E selector already exists, which needs to be
implemented by the SME. As new such selectors might be added in the
future, add a feature to permit userspace to report a selector as
supported.

If not given, the kernel should assume that userspace does support
SAE_H2E.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.fe67b871cc39.Ieb98390328927e998e612345a58b6dbc00b0e3a2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: parse BSS selectors and unknown rates
Benjamin Berg [Wed, 1 Jan 2025 05:05:34 +0000 (07:05 +0200)]
wifi: mac80211: parse BSS selectors and unknown rates

Doing so enables further checking whether we are implementing the
requested features. Also allow passing in NULL for more parameters as
they may not be needed by the caller.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.76433fd3d69f.I94e8718de26ab32282b60ae257b8c6c334b7c528@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: skip all known membership selectors
Benjamin Berg [Wed, 1 Jan 2025 05:05:33 +0000 (07:05 +0200)]
wifi: mac80211: skip all known membership selectors

The GLK and EPD Selectors are also not rates, so add a new macro for the
minimum value of a selector and test against that instead of the entire
list. Also fix the typo in the EPD selector define.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.2c19a2dc53db.If187b7d93d8b43a6c70e422c837b7636538fb358@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: log link information in ieee80211_determine_chan_mode
Benjamin Berg [Wed, 1 Jan 2025 05:05:31 +0000 (07:05 +0200)]
wifi: mac80211: log link information in ieee80211_determine_chan_mode

ieee80211_determine_chan_mode is called for each link and if there is a
downgrade, then it is interesting to know on which link it happened.
Pass through the link_id where relevant and use the new link_id_info
macro instead of sdata_info so that the link ID is printed when
relevant.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.d400da710fc4.I64775ec914603d3c7b0c6ea14b507c0370c11622@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: fix typo in HE MCS check
Benjamin Berg [Wed, 1 Jan 2025 05:05:30 +0000 (07:05 +0200)]
wifi: mac80211: fix typo in HE MCS check

It printed the AP RX MCS value instead of the TX one.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.743c7c1914f4.I1e5888ac6c8324d078fe91d01da31daa76d0e328@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: Remove unused basic_rates variable
Benjamin Berg [Wed, 1 Jan 2025 05:05:29 +0000 (07:05 +0200)]
wifi: mac80211: Remove unused basic_rates variable

The basic_rates variable was passed to mesh_sta_info_init as an out
parameter even though the result is not used. Passing NULL instead is
safe here, so do that.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.23a86a9bad0c.If79bc2c1c98d01cfb4c7e93c18b198fe6c6ea44c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: improve stop/wake queue tracing
Emmanuel Grumbach [Wed, 1 Jan 2025 05:05:28 +0000 (07:05 +0200)]
wifi: mac80211: improve stop/wake queue tracing

Add the refcount. This can be useful when we want to understand why a
queue stays stopped after it is woken.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.bd320c6e6702.I6ae0f19d922aea1f28236d72bf260acac428fc02@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: cfg80211: check extended MLD capa/ops in assoc
Johannes Berg [Wed, 1 Jan 2025 05:05:27 +0000 (07:05 +0200)]
wifi: cfg80211: check extended MLD capa/ops in assoc

Check that additionally extended MLD capa/ops for the MLD is
consistent, i.e. the same value is reported by all affiliated
APs/links.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.e29f42c7ae21.Ib2cdce608321ad154e4b13103cc315c3e3cb6b2b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: cfg80211: scan: skip duplicate RNR entries
Johannes Berg [Wed, 1 Jan 2025 05:05:26 +0000 (07:05 +0200)]
wifi: cfg80211: scan: skip duplicate RNR entries

There really shouldn't be duplicate entries when we give
the list to the driver, and since we already have a list
it's easy to avoid.

While at it, remove the unnecessary allocation there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.b0012c70f503.Id6fcad979434c1437340aa283abae2906345cca1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: mlme: improve messages from config_bw()
Johannes Berg [Wed, 1 Jan 2025 05:05:25 +0000 (07:05 +0200)]
wifi: mac80211: mlme: improve messages from config_bw()

The ieee80211_config_bw() function is called in different
contexts: during association with the association response
and during beacon tracking with the beacon. This can be a
bit misleading, so disambiguate the messages for those.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.ee574cf7553b.Ie7c78877d20b5e9de4cce3cf8e4f1b9e0c7ee005@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: reject per-band vendor elements with MLO
Johannes Berg [Wed, 1 Jan 2025 05:05:24 +0000 (07:05 +0200)]
wifi: mac80211: reject per-band vendor elements with MLO

The MLME code doesn't currently handle adding vendor elements
correctly with multi-link due to element inheritance. Simply
prevent that for now completely, if someone needs it we can
fix this later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.bb82d3aaf6ef.Ib30573d0666430a3d7a905e513dfc661edf0bf65@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: clarify key idx documententaion
Miri Korenblit [Wed, 1 Jan 2025 05:05:23 +0000 (07:05 +0200)]
wifi: mac80211: clarify key idx documententaion

ieee80211_key_conf::keyidx s in range 0-7, ano not 0-3. Make this clear
in the documentation.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250101070249.4e414710fba7.Ib739c40dd5aa6ed148c3151220eb38d8a9e238de@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: remove an unneeded check in Rx
Emmanuel Grumbach [Wed, 1 Jan 2025 05:05:22 +0000 (07:05 +0200)]
wifi: mac80211: remove an unneeded check in Rx

Coverity pointed out that __ieee80211_rx_h_amsdu() checks if rx->sta is
NULL before dereferencing it but not always.

Since rx->sta can't be NULL at this point, just remove the check to
avoid confusion

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.033096029d0a.I0923387246a6152f589d278f27f27bce52daee79@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: mac80211: add some support for RX OMI power saving
Johannes Berg [Wed, 1 Jan 2025 05:05:21 +0000 (07:05 +0200)]
wifi: mac80211: add some support for RX OMI power saving

In order to save power, it can be desirable to change the
RX operating mode using OMI to reduce the bandwidth. As the
handshake must be done in the HTC+ field, it cannot be done
by mac80211 directly, so expose functions to the driver to
request and finalize the necessary updates.

Note that RX OMI really only changes what the peer (AP) will
transmit to us, but in order to use it to actually save some
power (by reducing the listen bandwidth) we also update rate
scaling and then the channel context's mindef accordingly.

The updates are split into two in order to sequence them
correctly, when reducing bandwidth first reduce the rate
scaling and thus TX, then send OMI, then reduce the listen
bandwidth (chandef); when increasing bandwidth this is the
other way around. This also requires tracking in different
variables which part is applicable already.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250101070249.2c1a1934bd73.I4e90fd503504e37f9eac5bdae62e3f07e7071275@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: fw: fix repeated words in comments
Jilin Yuan [Sun, 29 Dec 2024 14:44:52 +0000 (16:44 +0200)]
wifi: iwlwifi: fw: fix repeated words in comments

Delete the redundant word 'for'.

Signed-off-by: Jilin Yuan <yuanjilin@cdjrlc.com>
Link: https://msgid.link/20220709140036.48913-1-yuanjilin@cdjrlc.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20241229164246.2981c3b5a40e.I96ebda41f230d453d4bc0afb01ac43011c13a182@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: Fix duplicated 'the' in comment
Miri Korenblit [Sun, 29 Dec 2024 14:44:51 +0000 (16:44 +0200)]
wifi: iwlwifi: mvm: Fix duplicated 'the' in comment

The double `the' is duplicated in the comment, remove one.

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20241229164246.76502dda646b.I0a1d012eaa1cd8d39430cde981cae8c4cc058442@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: Fix duplicated 'if' in comment
Jason Wang [Sun, 29 Dec 2024 14:44:50 +0000 (16:44 +0200)]
wifi: iwlwifi: mvm: Fix duplicated 'if' in comment

The double `if' is duplicated in the comment, remove one.

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
Link: https://msgid.link/20220811115958.8423-1-wangborong@cdjrlc.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20241229164246.9d8c224e9d4c.Iaacfbd1e9432f31d5d7d037ad925aadbb0d5c4d6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: Remove a duplicate assignment in iwl_dbgfs_amsdu_len_write()
Minjie Du [Sun, 29 Dec 2024 14:44:49 +0000 (16:44 +0200)]
wifi: iwlwifi: Remove a duplicate assignment in iwl_dbgfs_amsdu_len_write()

Delete a duplicate statement from this function implementation.

Signed-off-by: Minjie Du <duminjie@vivo.com>
Link: https://msgid.link/20230705114934.16523-1-duminjie@vivo.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20241229164246.b1b0dadc2e9e.Ie57cbe8039b9f388632141447ac910b6fcc3d0c0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: Use helper function IS_ERR_OR_NULL()
Miri Korenblit [Sun, 29 Dec 2024 14:44:48 +0000 (16:44 +0200)]
wifi: iwlwifi: mvm: Use helper function IS_ERR_OR_NULL()

Use IS_ERR_OR_NULL() instead of open-coding it
to simplify the code.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241229164246.d3423626d981.I3b4cc7f19d1bfecdb2e6a4eba8da1c7a41461115@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: Fix spelling typo in comment
shitao [Sun, 29 Dec 2024 14:44:47 +0000 (16:44 +0200)]
wifi: iwlwifi: Fix spelling typo in comment

Fix spelling typo in iwl-context-info.h comment.

Reported-by: k2ci <kernel-bot@kylinos.cn>
Signed-off-by: shitao <shitao@kylinos.cn>
Link: https://msgid.link/20231212093424.3104329-1-shitao@kylinos.cn
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241229164246.c79c132f811b.Ie07a0007b96359b3552878e23c4b9efeb07bba8d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: api: remove the double word
Deming Wang [Sun, 29 Dec 2024 14:44:46 +0000 (16:44 +0200)]
wifi: iwlwifi: api: remove the double word

Remove the duplicate "the".

Signed-off-by: Deming Wang <wangdeming@inspur.com>
Link: https://msgid.link/20240318054853.2352-1-wangdeming@inspur.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20241229164246.7b385f337e46.Iae60151e718f344098058b0e4fa6f6c1e43cb414@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: fix iwl_ssid_exist() check
Miri Korenblit [Sun, 29 Dec 2024 14:44:45 +0000 (16:44 +0200)]
wifi: iwlwifi: mvm: fix iwl_ssid_exist() check

iwl_ssid_exist() seems to check if a given ssid/ssid_len already
exists in a given array ssid_list.
Correctly compare the ssid to the SSID of each array element
(with a matching SSID length) to better remove duplicates.

Signed-off-by: Bjoern A. Zeeb <bz@FreeBSD.org>
Sponsored by: The FreeBSD Foundation
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Daniel Gabay <daniel.gabay@intel.com>
Link: https://patch.msgid.link/20241229164246.4471cd3d8dba.Iab8409b22bf6f01d05571ecef1e97dd3c8b1cc75@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: Improve code style in pointer declarations
Juan José Arboleda [Sun, 29 Dec 2024 14:44:44 +0000 (16:44 +0200)]
wifi: iwlwifi: mvm: Improve code style in pointer declarations

The changes ensure that there is a space between the `u8` type and the
`*` character as preferred by the guidelines.

This change is purely stylistic and do not affect the functionality
of the code.

Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
Link: https://msgid.link/10b6d4945675cada713e819f7bd6782a66a1c0d2.1724103043.git.soyjuanarbol@gmail.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20241229164246.f09a200be4f8.Ia564ae1c59136bd3c2864ccfb3a244b3257dcd5f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: fw: fix typo 'adderss'
Gan Jie [Sun, 29 Dec 2024 14:44:43 +0000 (16:44 +0200)]
wifi: iwlwifi: fw: fix typo 'adderss'

Fix typo 'adderss' to 'address'.

Signed-off-by: Gan Jie <ganjie182@gmail.com>
Link: https://msgid.link/20241101143052.1531-1-ganjie182@gmail.com
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20241229164246.ad8978ee5673.I388e314a4be8333192b3994f43efa5dbd3ac715d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: remove unneeded NULL pointer checks
Emmanuel Grumbach [Sun, 29 Dec 2024 14:44:42 +0000 (16:44 +0200)]
wifi: iwlwifi: mvm: remove unneeded NULL pointer checks

Smatch reported that we dereference the data pointer to calculate the
expected length before we check it's not NULL. While this is true (and
hence needs to be fixed), this will never happen because the data
pointer comes from struct iwl_rx_packet object which has the following
layout:

struct iwl_rx_packet {
        __le32 len_n_flags;
        struct iwl_cmd_header hdr;
        u8 data[];
} __packed;

So, if the pointer to iwl_rx_packet is valid, data will be valid as
well.

Remove the NULL pointer check on 'data' to avoid confusing smatch.
Also remove the check from similar functions in the same flow that were
cargo cult copy-pasted.

Fixes: 4635e6eaa0fe ("wifi: iwlwifi: mvm: support new versions of the wowlan APIs")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202411210812.0eLaonw3-lkp@intel.com/
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241229164246.c8ce6e041e4b.I4dc19289e3f3807386768c846e08be3ea322cd15@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: fix AP STA comparison
Johannes Berg [Sun, 29 Dec 2024 14:44:41 +0000 (16:44 +0200)]
wifi: iwlwifi: mvm: fix AP STA comparison

This should be comparing the AP STA, not the deflink firmware STA
ID. Correct the implementation so that statistics can be requested
for the AP, but not for other stations that may end up with the
firmware STA ID matching 0 in the deflink, or so.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241229164246.08b05aca37cf.Iba1a6a637a758691f710dc4f3f03bd1d960fb087@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: cleanup unused variable in trans.h
Emmanuel Grumbach [Sun, 29 Dec 2024 14:44:39 +0000 (16:44 +0200)]
wifi: iwlwifi: cleanup unused variable in trans.h

Remove unused fields from the transport API.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241229164246.1d04ce18a0ec.Ibfac364163b55b52196d30ff2b43945c5aa804a9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: don't count mgmt frames as MPDU
Daniel Gabay [Sun, 29 Dec 2024 14:44:38 +0000 (16:44 +0200)]
wifi: iwlwifi: mvm: don't count mgmt frames as MPDU

When handling TX_CMD notification, for mgmt frames tid is equal
to IWL_MAX_TID_COUNT, so with the current logic we'll count
that as MPDU, fix that.

Fixes: ec0d43d26f2c ("wifi: iwlwifi: mvm: Activate EMLSR based on traffic volume")
Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241229164246.80b119bb5d08.I31b1e8ba25cce15819225e5ac80332e4eaa20c13@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: fw: api: tdls: remove MVM_ from name
Johannes Berg [Sun, 29 Dec 2024 14:44:37 +0000 (16:44 +0200)]
wifi: iwlwifi: fw: api: tdls: remove MVM_ from name

The API isn't really MVM specific, it's just the firmware
API. Remove the "MVM_" from the name here as well, as we've
already done in many other places.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241229164246.66e17791c392.I6998e263973c26c1e22b4f470b974a519011b29a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: avoid NULL pointer dereference
Miri Korenblit [Sun, 29 Dec 2024 14:44:36 +0000 (16:44 +0200)]
wifi: iwlwifi: mvm: avoid NULL pointer dereference

When iterating over the links of a vif, we need to make sure that the
pointer is valid (in other words - that the link exists) before
dereferncing it.
Use for_each_vif_active_link that also does the check.

Fixes: 2b7ee1a10a72 ("wifi: iwlwiif: mvm: handle the new BT notif")
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20241229164246.31d41f7d3eab.I7fb7036a0b187c1636b01970207259cb2327952c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: bump FW API to 96 for BZ/SC devices
Miri Korenblit [Sat, 28 Dec 2024 20:34:19 +0000 (22:34 +0200)]
wifi: iwlwifi: bump FW API to 96 for BZ/SC devices

Start supporting API version 96 for new devices.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241228223206.4028b66f4563.I5d5caf4bffeabcab72a69c2b31445e7bee4a94b6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: fix add stream vs. restart race
Johannes Berg [Sat, 28 Dec 2024 20:34:18 +0000 (22:34 +0200)]
wifi: iwlwifi: mvm: fix add stream vs. restart race

My recent restart related work has made this race more likely
to happen and we've now noticed it, but it seems that it was
always possible. The race is that the add stream work can be
scheduled just before a restart is scheduled and then execute
before the restart, accessing the device while it's doing the
restart and not accessible.

To fix this, check if the device is restarting and abort the
work in that case. Reschedule it after the restart as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241228223206.9c30af039b4d.I1a32936776f8ba5e83dda0a68ffc2722d9d37950@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: move fw_dbg_collect to fw debugfs
Emmanuel Grumbach [Sat, 28 Dec 2024 20:34:17 +0000 (22:34 +0200)]
wifi: iwlwifi: move fw_dbg_collect to fw debugfs

This debugfs hook really belongs to the firmware handling code and then
we can use it across different op_modes.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241228223206.d31f5994c6a6.Ibe3bc7a25e2bbf7a575287e19db58833bb3e6b9e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: api: remove version number from latest stored_beacon_notif
Yedidya Benshimol [Sat, 28 Dec 2024 20:34:16 +0000 (22:34 +0200)]
wifi: iwlwifi: api: remove version number from latest stored_beacon_notif

By convention the newest version of a command/notification structure is
named with out the _ver_# suffix. Apply to stored_beacon_notif.

Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241228223206.e2140aa3c65b.Ie851bdda6df02dcc352bf765a3ec6bdac45c65a2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: avoid memory leak
Miri Korenblit [Sat, 28 Dec 2024 20:34:15 +0000 (22:34 +0200)]
wifi: iwlwifi: avoid memory leak

A caller of iwl_acpi_get_dsm_object must free the returned object.
iwl_acpi_get_dsm_integer returns immediately without freeing
it if the expected size is more than 8 bytes. Fix that.

Note that with the current code this will never happen, since the caller
of iwl_acpi_get_dsm_integer already checks that the expected size if
either 1 or 4 bytes, so it can't exceed 8 bytes.

While at it, print the DSM value instead of the return value, as this
was the intention in the first place.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241228223206.bf61eaab99f8.Ibdc5df02f885208c222456d42c889c43b7e3b2f7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mark that we support TX_CMD_API_S_VER_10
Miri Korenblit [Sat, 28 Dec 2024 20:34:14 +0000 (22:34 +0200)]
wifi: iwlwifi: mark that we support TX_CMD_API_S_VER_10

Usually each struct that represent an API needs to have a comment
specifying all the versions of the API that this struct corresponds to.
iwl_tx_cmd_gen3 was long supporting also version 10. Say that.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20241228223206.83d681dc9cf7.I355270fb20b23978d9402cb70caf52a0108b8cd4@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: add channel_load_not_by_us in iwl_mvm_phy_ctxt
Somashekhar(Som) [Sat, 28 Dec 2024 20:34:12 +0000 (22:34 +0200)]
wifi: iwlwifi: add channel_load_not_by_us in iwl_mvm_phy_ctxt

Adding channel_load_not_by_us in the mvm phy context.

Signed-off-by: Somashekhar(Som) <somashekhar.puttagangaiah@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241228223206.7c7f3ebebadf.Ifac005cf1e3b02cba0861eb19bfd8099957faad9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: add mapping of prph register crf for PE RF
Somashekhar(Som) [Sat, 28 Dec 2024 20:34:11 +0000 (22:34 +0200)]
wifi: iwlwifi: add mapping of prph register crf for PE RF

In blank OTP, we get the CRF type from a peripheral register,
support it for PE CRF

Signed-off-by: Somashekhar(Som) <somashekhar.puttagangaiah@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241228223206.a8899d585a6e.I9d9b223c75d5370811220291c62c364967c0acc3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: Allow entering EMLSR for more band combinations
Somashekhar(Som) [Sat, 28 Dec 2024 20:34:10 +0000 (22:34 +0200)]
wifi: iwlwifi: Allow entering EMLSR for more band combinations

Enter EMLSR only when two bands are different.
EMLSR should be allowed when one of the link is LB.

Signed-off-by: Somashekhar(Som) <somashekhar.puttagangaiah@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241228223206.ec659168eeb7.I403f61f0e827c14cf2b245f48e1736559f17c476@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: iwl-drv: refactor image loading a bit
Johannes Berg [Sat, 28 Dec 2024 20:34:09 +0000 (22:34 +0200)]
wifi: iwlwifi: iwl-drv: refactor image loading a bit

Refactor some parts of the image loading to be able to
extend the code for external FSEQ image loading more
easily.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241228223206.224ac6599bbe.Iadc1974d633eec09797522f7d3fa543ea18bd7f6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: Remove MVM prefix from TX API macros
Daniel Gabay [Sat, 28 Dec 2024 20:34:08 +0000 (22:34 +0200)]
wifi: iwlwifi: Remove MVM prefix from TX API macros

These are not mvm specific.

Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241228223206.1b235ec5354e.If99a38b1f0d7e42ea4ee3907e6c395846c4aa9b0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: rename bits in config/boot control register
Johannes Berg [Sat, 28 Dec 2024 20:34:07 +0000 (22:34 +0200)]
wifi: iwlwifi: rename bits in config/boot control register

The register 0x000 is now really boot control, and some
of the old bit names were (even for old hardware) not
reflecting the names on the hardware side; rename them
in the driver to align the naming.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241228223206.6f25be160619.I3ffc9601e99dc414a9ae54a0d90c9d20c0253da5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: move fw_ver debugfs to firmware runtime
Emmanuel Grumbach [Sat, 28 Dec 2024 20:34:06 +0000 (22:34 +0200)]
wifi: iwlwifi: move fw_ver debugfs to firmware runtime

This is really where it belongs.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241228223206.98bdc5e62828.Iee7a8365dd63ebf580d324f90e1e04466d8ef5d5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mld: make iwl_mvm_find_ie_offset a iwlwifi util
Miri Korenblit [Sat, 28 Dec 2024 20:34:05 +0000 (22:34 +0200)]
wifi: iwlwifi: mld: make iwl_mvm_find_ie_offset a iwlwifi util

This is needed also for more opmodes, and is really not opmode dependent.
Make it a iwlwifi util.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://patch.msgid.link/20241228223206.a36373eefbf2.Ib1f305b78508c98934f6000720d6455c88a860cb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: iwl_fw_error_collect() is always called sync
Johannes Berg [Fri, 27 Dec 2024 08:01:12 +0000 (10:01 +0200)]
wifi: iwlwifi: iwl_fw_error_collect() is always called sync

Since iwl_fw_error_collect() is now always called with the sync
argument set to true, to collect data synchronously, remove the
argument from it entirely.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.08f515513e88.I780a557743ca7f029f46a1cc75d0799542e39d83@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: rework firmware error handling
Johannes Berg [Fri, 27 Dec 2024 08:01:11 +0000 (10:01 +0200)]
wifi: iwlwifi: rework firmware error handling

In order to later add the ability to do deeper resets of the
device when it crashes, first restructure the firmware error
handling. Instead of having just a single nic_error() method
that handles all, split it:
 - nic_error() just handles and prints the error itself,
 - dump_error() synchronously creates an error dump, and
 - sw_reset() will be called to request doing a SW reset.

This changes the architecture so that the transport is now
responsible for deciding how to do the reset, and therefore
the handling of reprobe if error occurs during reconfig
moves there, which necessitates adding a method there that
notifies the transport that the recovery was completed.

Actually introducing the model under which deeper resets can
be done will be in future patches.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.6d4f741ae907.I96a9243e7877808ed6d1bff6967c15d6c24882f0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: restart device through NMI
Johannes Berg [Fri, 27 Dec 2024 08:01:10 +0000 (10:01 +0200)]
wifi: iwlwifi: mvm: restart device through NMI

When some channel context manipulations fail, the device
is going to be restarted to try to recover. Make this go
through a real FW restart via an NMI so the transport is
aware of it and can later handle escalation, and to make
it easier to restructure the code later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.96b732029d20.I2e729f402db58a76cea620b6f62a02da49a10b48@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: unify cmd_queue_full() into nic_error()
Johannes Berg [Fri, 27 Dec 2024 08:01:09 +0000 (10:01 +0200)]
wifi: iwlwifi: unify cmd_queue_full() into nic_error()

Except for some special handling in DVM, error dump and some
message behaviour, cmd_queue_full and nic_error are equivalent
now. Unify by giving a special error type, so DVM can continue
to differentiate.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.0222183504aa.Ie29cef75fbd91b64a43619bc36bd5b29c5b9f957@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: clean up FW restart a bit
Johannes Berg [Fri, 27 Dec 2024 08:01:08 +0000 (10:01 +0200)]
wifi: iwlwifi: mvm: clean up FW restart a bit

Approximately three years ago, in commit ddb6b76b6f96
("iwlwifi: yoyo: support TLV-based firmware reset"), the code
was (likely erroneously) changed to no longer treat error
interrupts as firmware errors. As a result, this meant that
the fw_restart counter was only applied in case of command
queue being stuck, which never seems to happen. Also, there's
no longer any way to set the mvm->fw_restart to a value that
doesn't match exactly the module parameter behaviour.

Instead of trying to fix this, simply remove the logic that
limits the number of restarts, it's clearly unused.

However, restore the logic that restart isn't unconditional,
by checking the module parameter.

Since the "fw_error" argument to iwl_mvm_nic_restart() is now
always true (except in the "never happens" case of CMD queue
stuck), just remove it too and treat command queue stuck the
same way as everything else.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.b0489daf323c.I0cd3233b2214c5f06e059f746041b19d08647e40@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: remove STARTING state
Johannes Berg [Fri, 27 Dec 2024 08:01:07 +0000 (10:01 +0200)]
wifi: iwlwifi: mvm: remove STARTING state

Now that the retry loop only happens when timeouts occur
and firmware errors are different, we no longer need the
STARTING state with all the infrastructure for it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.c55d73436521.I08e9f6a71d56f86872bca4d4e3048faa113a7120@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: restrict MAC start retry to timeouts
Johannes Berg [Fri, 27 Dec 2024 08:01:06 +0000 (10:01 +0200)]
wifi: iwlwifi: mvm: restrict MAC start retry to timeouts

We had reverted the retry loop removal because of an issue
with PNVM loading, but that issue manifests as timeouts.
Since the retries aren't needed in other cases, only do
them when there were timeouts while starting, not other
errors.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.98201c79f66d.I5d7e12b219d533c6a77741ec5863984d35711f48@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: restrict driver retry loops to timeouts
Johannes Berg [Fri, 27 Dec 2024 08:01:05 +0000 (10:01 +0200)]
wifi: iwlwifi: restrict driver retry loops to timeouts

We had reverted the retry loop removal because of an issue
with PNVM loading, but that issue manifests as timeouts.
Since the retry loops aren't needed in other cases, only
do them when there were timeouts while loading, not other
errors.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.a21bf40b0fd3.I70166e460906d6d183359889d7543b9c587b7182@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: return ERR_PTR from opmode start()
Johannes Berg [Fri, 27 Dec 2024 08:01:04 +0000 (10:01 +0200)]
wifi: iwlwifi: return ERR_PTR from opmode start()

In order to restrict the retry loops for timeouts, first
pass the error code up using ERR_PTR(). This of course
requires all existing functions to be updated accordingly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.3fe5031d5784.I7307996c91dac69619ff9c616b8a077423fac19f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: context-info: add kernel-doc markers
Johannes Berg [Fri, 27 Dec 2024 08:01:03 +0000 (10:01 +0200)]
wifi: iwlwifi: context-info: add kernel-doc markers

These comments have kernel-doc markup and were meant to
be handled as such, add the right /** marker to them.

Add missing entries where needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.c5c04b641479.I702b8122d307a0d9d09df038cda10be063f7f2d7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: interpret STEP URM BIOS configuration
Somashekhar(Som) [Fri, 27 Dec 2024 08:01:02 +0000 (10:01 +0200)]
wifi: iwlwifi: interpret STEP URM BIOS configuration

For certain platforms, it may necessary to use the STEP in URM
(ultra reliable mode.) Read the necessary flags from the BIOS
(ACPI or UEFI) and indicate the chosen mode to the firmware in
the context info. Whether or not URM really was configured is
already read back later, to adjust capabilities accordingly.

Signed-off-by: Somashekhar(Som) <somashekhar.puttagangaiah@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.b30024905de3.If3c578af2c15f8005bbe71499bc4091348ed7bb0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: fw: read STEP table from correct UEFI var
Johannes Berg [Fri, 27 Dec 2024 08:01:01 +0000 (10:01 +0200)]
wifi: iwlwifi: fw: read STEP table from correct UEFI var

This variable exists for the "common" (WiFi/BT) GUID, not the
WiFi-only GUID. Fix that by passing the GUID to the function.
A short-cut for the wifi-only version remains so not all code
must be updated.

However, rename the GUID defines to be clearer.

Fixes: 09b4c35d73a5 ("wifi: iwlwifi: mvm: Support STEP equalizer settings from BIOS.")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.89a5ad921b6d.Idae95a70ff69d2ba1b610e8eced826961ce7de98@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: rename iwl_dev_tx_power_common::mac_context_id
Emmanuel Grumbach [Fri, 27 Dec 2024 08:00:59 +0000 (10:00 +0200)]
wifi: iwlwifi: mvm: rename iwl_dev_tx_power_common::mac_context_id

This is becoming the link_id. Since this makes no difference on non-MLD
devices, just rename to link_id for all the APIs that use the common
structure.

Starting from command 9, feed the link_id to the firmware instead of the
mac id.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.f1155e713201.I753900d10e82f339cf9679ed403027d38dc1fd58@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: skip short statistics window when updating EMLSR
Benjamin Berg [Fri, 27 Dec 2024 08:00:58 +0000 (10:00 +0200)]
wifi: iwlwifi: mvm: skip short statistics window when updating EMLSR

The statistics are not synchronized with the time that we enter EMLSR.
This means that we can receive the statistic notification just after
having cleared the counters, causing us to immediately exit EMLSR again.

Fix this by checking that most of the time for the window has passed. If
that is not the case, ignore this window and wait for the next
notification.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.0eb0f2044535.Ic2af92737ccfc873f3b6c228704238ebb9f983ca@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: mvm: remove warning on unallocated BAID
Johannes Berg [Fri, 27 Dec 2024 08:00:57 +0000 (10:00 +0200)]
wifi: iwlwifi: mvm: remove warning on unallocated BAID

Due to the firmware allocating the BAID, we can only install
the data structure after the BAID is valid from the firmware's
point of view. As a result, the firmware can start sending
frame release notifications to the driver immediately. This
isn't supposed to happen by protocol, since the peer STA is
not expected to use the blockack session until the AddBA has
a response. However, firmware doesn't know that, our RX path
can't know when it was, so simply don't WARN in this case but
only have a debug message.

Since the BAID comes from firmware, also use IWL_FW_CHECK()
instead of a warning for the validity check.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.4360f2b9e185.I447f9a5fc6dfdc78ec238200338e2da040ee7e61@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 months agowifi: iwlwifi: differentiate NIC error types
Johannes Berg [Fri, 27 Dec 2024 08:00:56 +0000 (10:00 +0200)]
wifi: iwlwifi: differentiate NIC error types

Instead of differentiating only sync/async, differentiate
the type of error, and document that only reset handshake
timeout (IWL_ERR_TYPE_RESET_HS_TIMEOUT) needs sync handling.

The special sync handling is somewhat temporary, the idea
is to later split the nic_error() method into error dump,
synchronizing the dump, and SW reset methods, and the type
is mostly in order to unify command queue full handling
into that new architecture as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.aed9c9e4fac0.I2288042bec4728a75b61cb7f6ded5214bfa3ce85@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>