sfrench/cifs-2.6.git
7 months agowifi: wl1251: replace deprecated strncpy with strscpy
Justin Stitt [Wed, 18 Oct 2023 21:15:23 +0000 (21:15 +0000)]
wifi: wl1251: replace deprecated strncpy with strscpy

strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.

Based on other assignments of similar fw_version fields we can see that
NUL-termination is required but not NUL-padding:
ethernet/intel/ixgbe/ixgbe_ethtool.c
1111:   strscpy(drvinfo->fw_version, adapter->eeprom_id,
1112:           sizeof(drvinfo->fw_version));

ethernet/intel/igc/igc_ethtool.c
147:    scnprintf(adapter->fw_version,
148:              sizeof(adapter->fw_version),
153:    strscpy(drvinfo->fw_version, adapter->fw_version,
154:            sizeof(drvinfo->fw_version));

wireless/broadcom/brcm80211/brcmfmac/core.c
569:    strscpy(info->fw_version, drvr->fwver, sizeof(info->fw_version));

wireless/broadcom/brcm80211/brcmsmac/main.c
7867:           snprintf(wlc->wiphy->fw_version,
7868:                    sizeof(wlc->wiphy->fw_version), "%u.%u", rev, patch);

wireless/broadcom/b43legacy/main.c
1765:   snprintf(wiphy->fw_version, sizeof(wiphy->fw_version), "%u.%u",

wireless/broadcom/b43/main.c
2730:   snprintf(wiphy->fw_version, sizeof(wiphy->fw_version), "%u.%u",

wireless/intel/iwlwifi/dvm/main.c
1465:   snprintf(priv->hw->wiphy->fw_version,
1466:            sizeof(priv->hw->wiphy->fw_version),

wireless/intel/ipw2x00/ipw2100.c
5905:   snprintf(info->fw_version, sizeof(info->fw_version), "%s:%d:%s",

A suitable replacement is `strscpy` due to the fact that it guarantees
NUL-termination on the destination buffer without unnecessarily
NUL-padding.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231018-strncpy-drivers-net-wireless-ti-wl1251-main-c-v2-1-67b63dfcb1b8@google.com
7 months agowifi: mt76: mt7921: fix kernel panic by accessing invalid 6GHz channel info
Ming Yen Hsieh [Wed, 18 Oct 2023 04:29:35 +0000 (12:29 +0800)]
wifi: mt76: mt7921: fix kernel panic by accessing invalid 6GHz channel info

When the chip not support 6GHz capability, the channels of 6GHz information
should not be updated. This caused a crash:

[   19.442078] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000014
[   19.457535] Mem abort info:
[   19.465329]   ESR = 0x0000000096000004
[   19.473295]   EC = 0x25: DABT (current EL), IL = 32 bits
[   19.482354]   SET = 0, FnV = 0
[   19.489143]   EA = 0, S1PTW = 0
[   19.495991]   FSC = 0x04: level 0 translation fault
[   19.504554] Data abort info:
[   19.511111]   ISV = 0, ISS = 0x00000004, ISS2 = 0x00000000
[   19.520269]   CM = 0, WnR = 0, TnD = 0, TagAccess = 0
[   19.528988]   GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0
[   19.537960] user pgtable: 4k pages, 48-bit VAs, pgdp=00000001027a9000
[   19.548014] [0000000000000014] pgd=0000000000000000, p4d=000000000000
[   19.558429] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
[   19.568270] Modules linked in: mt7921e mt7921_common mt792x_lib
mt76_connac_lib mt76 mac80211 btusb btintel cfg80211 btmtk snd_sof_ipc_msg_
btrtl snd_sof_ipc_flood_test btbcm bluetooth snd_sof_mt8195 uvcvideo
mtk_adsp_common snd_sof_xtensa_dsp uvc snd_sof_of snd_sof videobuf2_vmalloc
ecdh_generic ecc snd_sof_utils cros_ec_lid_angle cros_ec_sensors crct10dif_
cros_ec_sensors_core cros_usbpd_logger crypto_user fuse ip_tables ipv6
[   19.614237] CPU: 1 PID: 105 Comm: kworker/1:1 Not tainted 6.6.0-rc6-next-20231017+ #324
[   19.625957] Hardware name: Acer Tomato (rev2) board (DT)
[   19.634970] Workqueue: events mt7921_init_work [mt7921_common]
[   19.644522] pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTY
[   19.655182] pc : mt7921_regd_notifier+0x180/0x290 [mt7921_common]
[   19.664983] lr : mt7921_regd_notifier+0xd4/0x290 [mt7921_common]
[   19.674679] sp : ffff800080acba80
[   19.681649] x29: ffff800080acba80 x28: 0000000000000000 x27: ffff4faf
[   19.692483] x26: 0000000000000000 x25: 0000000000000000 x24: ffff4faf
[   19.703294] x23: 00000000ffffe926 x22: ffff4faf16031fa0 x21: 00000000
[   19.714108] x20: 000000000000001c x19: ffff4faf16ba6f40 x18: 00000000
[   19.724928] x17: 0000000000000000 x16: ffffac6b891c2750 x15: ffff8000
[   19.735722] x14: 0000000000000180 x13: 0000000000000000 x12: 00000000
[   19.746478] x11: 0000000000000002 x10: ffff4faf01c21780 x9 : ffffac6b
[   19.757214] x8 : 00000000006c0000 x7 : ffffac6b6b020cf0 x6 : ffffac6b
[   19.767945] x5 : ffffac6b6b020d00 x4 : ffffac6b6b020cf8 x3 : ffff4faf
[   19.778648] x2 : 0000000000000000 x1 : 000000000000001c x0 : 00000000
[   19.789366] Call trace:
[   19.795381]  mt7921_regd_notifier+0x180/0x290 [mt7921_common]
[   19.804675]  wiphy_update_regulatory+0x2bc/0xa08 [cfg80211]
[   19.813864]  wiphy_regulatory_register+0x4c/0x88 [cfg80211]
[   19.823029]  wiphy_register+0x75c/0x8d0 [cfg80211]
[   19.831446]  ieee80211_register_hw+0x70c/0xc10 [mac80211]
[   19.840479]  mt76_register_device+0x168/0x2e8 [mt76]
[   19.849008]  mt7921_init_work+0xdc/0x250 [mt7921_common]
[   19.857817]  process_one_work+0x148/0x3c0
[   19.865292]  worker_thread+0x32c/0x450
[   19.872489]  kthread+0x11c/0x128
[   19.879173]  ret_from_fork+0x10/0x20
[   19.886153] Code: f0000041 9100a021 94000aef aa0003f9 (b9401780)
[   19.895634] ---[ end trace 0000000000000000 ]---

Reported-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Closes: https://lore.kernel.org/all/927e7d50-826d-4c92-9931-3c59b18c6945@collabora.com/
Fixes: 09382d8f8641 ("wifi: mt76: mt7921: update the channel usage when the regd domain changed")
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/cf77a58a60d81c77a28388bc8d312b87ffb48434.1697603002.git.deren.wu@mediatek.com
7 months agowifi: ipw2x00: replace deprecated strncpy with strscpy_pad
Justin Stitt [Tue, 17 Oct 2023 21:48:15 +0000 (21:48 +0000)]
wifi: ipw2x00: replace deprecated strncpy with strscpy_pad

strncpy() is deprecated for use on NUL-terminated destination strings
[1] and as such we should prefer more robust and less ambiguous string
interfaces.

`extra` is intended to be NUL-terminated which is evident by the manual
assignment of a NUL-byte as well as its immediate usage with strlen().

Moreover, many of these getters and setters are NUL-padding buffers with
memset():
2439  | memset(&tx_power, 0, sizeof(tx_power));
9998  | memset(sys_config, 0, sizeof(struct ipw_sys_config));
10084 | memset(tfd, 0, sizeof(*tfd));
10261 | memset(&dummystats, 0, sizeof(dummystats));
... let's maintain this behavior and NUL-pad our destination buffer.

Considering the above, a suitable replacement is `strscpy_pad` due to
the fact that it guarantees both NUL-termination and NUL-padding on the
destination buffer.

To be clear, there is no bug in the current implementation as
MAX_WX_STRING is much larger than the size of the string literals being
copied from. Also, strncpy() does NUL-pad the destination buffer and
using strscpy_pad() simply matches that behavior. All in all, there
should be no functional change but we are one step closer to eliminating
usage of strncpy().

Do note that we cannot use the more idiomatic strscpy invocation of
(dest, src, sizeof(dest)) as the destination buffer cannot have its size
determined at compile time. So, let's stick with (dest, src, LEN).

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings
Link: https://github.com/KSPP/linux/issues/90
Cc: linux-hardening@vger.kernel.org
Signed-off-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231017-strncpy-drivers-net-wireless-intel-ipw2x00-ipw2200-c-v2-1-465e10dc817c@google.com
7 months agowifi: rt2x00: fix rt2800 watchdog function
Shiji Yang [Sat, 14 Oct 2023 06:55:01 +0000 (14:55 +0800)]
wifi: rt2x00: fix rt2800 watchdog function

The watchdog function is broken on rt2800 series SoCs. This patch
fixes the incorrect watchdog logic to make it work again.

1. Update current wdt queue index if it's not equal to the previous
   index. Watchdog compares the current and previous queue index to
   judge if the queue hung.
2. Make sure hung_{rx,tx} 'true' status won't be override by the
   normal queue. Any queue hangs should trigger a reset action.
3. Clear the watchdog counter of all queues before resetting the
   hardware. This change may help to avoid the reset loop.
4. Change hang check function return type to bool as we only need
   to return two status, yes or no.

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/TYAP286MB0315BC1D83D31154924F0D39BCD1A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM
7 months agowifi: ath9k_htc: fix format-truncation warning
Kalle Valo [Thu, 12 Oct 2023 13:58:54 +0000 (16:58 +0300)]
wifi: ath9k_htc: fix format-truncation warning

On v6.6-rc4 with GCC 13.2 I see:

drivers/net/wireless/ath/ath9k/hif_usb.c:1223:42: warning: '.0.fw' directive output may be truncated writing 5 bytes into a region of size between 4 and 11 [-Wformat-truncation=]
drivers/net/wireless/ath/ath9k/hif_usb.c:1222:17: note: 'snprintf' output between 27 and 34 bytes into a destination of size 32

Fix it by increasing the size of the fw_name field to 64 bytes.

Compile tested only.

Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231012135854.3473332-3-kvalo@kernel.org
7 months agowifi: ipw2x00: fix format-truncation warnings
Kalle Valo [Thu, 12 Oct 2023 13:58:53 +0000 (16:58 +0300)]
wifi: ipw2x00: fix format-truncation warnings

On v6.6-rc4 with GCC 13.2 I see:

drivers/net/wireless/intel/ipw2x00/ipw2100.c:5905:63: warning: '%s' directive output may be truncated writing up to 63 bytes into a region of size 32 [-Wformat-truncation=]
drivers/net/wireless/intel/ipw2x00/ipw2100.c:5905:9: note: 'snprintf' output between 4 and 140 bytes into a destination of size 32
drivers/net/wireless/intel/ipw2x00/ipw2200.c:10392:63: warning: '%s' directive output may be truncated writing up to 63 bytes into a region of size 32 [-Wformat-truncation=]
drivers/net/wireless/intel/ipw2x00/ipw2200.c:10392:9: note: 'snprintf' output between 4 and 98 bytes into a destination of size 32

Fix this by copying only the firmware version and not providing any extra
information via ethtool. This is an ancient driver anyway and most likely
removed soon so it doesn't really matter.

Compile tested only.

Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231012135854.3473332-2-kvalo@kernel.org
7 months agowifi: brcmfmac: fix format-truncation warnings
Kalle Valo [Thu, 12 Oct 2023 13:58:52 +0000 (16:58 +0300)]
wifi: brcmfmac: fix format-truncation warnings

On v6.6-rc4 with GCC 13.2 I see:

drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:262:52: warning: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size 4 [-Wformat-truncation=]
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:262:46: note: directive argument in the range [0, 65535]
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:262:46: note: directive argument in the range [0, 65535]
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:262:9: note: 'snprintf' output between 9 and 17 bytes into a destination of size 9
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:265:55: warning: '%d' directive output may be truncated writing between 1 and 5 bytes into a region of size 4 [-Wformat-truncation=]
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:265:48: note: directive argument in the range [0, 65535]
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:265:48: note: directive argument in the range [0, 65535]
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:265:9: note: 'snprintf' output between 10 and 18 bytes into a destination of size 10
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:342:50: warning: '/' directive output may be truncated writing 1 byte into a region of size between 0 and 4 [-Wformat-truncation=]
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:342:42: note: directive argument in the range [0, 65535]
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c:342:9: note: 'snprintf' output between 10 and 18 bytes into a destination of size 10

Fix these by increasing the buffer sizes to 20 bytes to make sure there's enough space.

Compile tested only.

Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231012135854.3473332-1-kvalo@kernel.org
7 months agowifi: mac80211: drop robust action frames before assoc
Johannes Berg [Sun, 1 Oct 2023 10:01:09 +0000 (13:01 +0300)]
wifi: mac80211: drop robust action frames before assoc

To be able to more easily understand the code, drop robust
action frames before being associated, even if there's no
MFP in the end, as they are Class 3 Frames and shouldn't
be transmitted in the first place.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231001125722.b2fd37083371.Ie9f4906e2f6c698989bce6681956ed2f9454f27c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: cfg80211: Allow AP/P2PGO to indicate port authorization to peer STA/P2PClient
Vinayak Yadawad [Tue, 26 Sep 2023 10:32:22 +0000 (16:02 +0530)]
wifi: cfg80211: Allow AP/P2PGO to indicate port authorization to peer STA/P2PClient

In 4way handshake offload, cfg80211_port_authorized enables driver
to indicate successful 4way handshake to cfg80211 layer. Currently
this path of port authorization is restricted to interface type
NL80211_IFTYPE_STATION and NL80211_IFTYPE_P2P_CLIENT. This patch
extends the support for NL80211_IFTYPE_AP and NL80211_IFTYPE_P2P_GO
interfaces to authorize peer STA/P2P_CLIENT, whenever authentication
is offloaded on the AP/P2P_GO interface.

Signed-off-by: Vinayak Yadawad <vinayak.yadawad@broadcom.com>
Link: https://lore.kernel.org/r/dee3b0a2b4f617e932c90bff4504a89389273632.1695721435.git.vinayak.yadawad@broadcom.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: drop NULL pointer check in iwl_mvm_tzone_set_trip_temp()
Dmitry Antipov [Tue, 3 Oct 2023 09:20:46 +0000 (12:20 +0300)]
wifi: iwlwifi: drop NULL pointer check in iwl_mvm_tzone_set_trip_temp()

Since 'tz_device' is an in-place member of 'struct iwl_mvm', it can't
be NULL and so relevant check may be dropped. Compile tested only.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Acked-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231003092048.24998-1-dmantipov@yandex.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: bump FW API to 86 for AX/BZ/SC devices
Gregory Greenman [Sun, 22 Oct 2023 14:55:56 +0000 (17:55 +0300)]
wifi: iwlwifi: bump FW API to 86 for AX/BZ/SC devices

Start supporting API version 86 for new devices.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231022173519.e2f720799600.I6e22188a47efe0cbb4e013259955c4019843799f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: read DSM func 2 for specific RF types
Daniel Gabay [Sun, 22 Oct 2023 14:55:55 +0000 (17:55 +0300)]
wifi: iwlwifi: read DSM func 2 for specific RF types

By definition, this DSM func is valid only for HR/JF RF types.
Until now firmware ignored this bit (if set) on other than the
above types, but in future firmware versions sending this bit
will lead to firmware 0x3426 assert.
Avoid that by verifying the HW in driver first.

Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231022173519.eec3b5d6152f.Ibc7ffe5ef1c156d878f1300c6059c6c91b374114@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: show dump even for pldr_sync
Johannes Berg [Sun, 22 Oct 2023 14:55:54 +0000 (17:55 +0300)]
wifi: iwlwifi: mvm: show dump even for pldr_sync

Worst case it's extra (garbage) data, best case we see why
things failed ... Seems the trade-off is better if we print
it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231022173519.30e614ecd540.I47324f555ebcf22d0dd0afa94e7ca0af53a9fdba@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: cycle FW link on chanctx removal
Johannes Berg [Sun, 22 Oct 2023 14:55:53 +0000 (17:55 +0300)]
wifi: iwlwifi: mvm: cycle FW link on chanctx removal

When the vif is in MLD mode, we'll get a vif links change from
non-zero to zero on disassociation, which removes all links in
the firmware and adds the 'deflink' the driver/mac80211 has.
This causes the firmware to clear some internal state.

However, in non-MLD mode, this doesn't happen, and causes some
state to be left around in firmware, which can particularly
cause trouble with the ref-BSSID in multi-BSSID, leading to an
assert later if immediately making a new multi-BSSID connection
with a different ref-BSSID.

Fix this by removing/re-adding the link in the non-MLD case
when the channel is removed from the vif. This way, all of the
state will get cleared out, even if we need the deflink, which
is more for software architecture purposes than otherwise.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231022173519.90c82837ba4d.I341fa30c480f7673b14b48a0e29a2241472c2e13@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: trace full frames with TX status request
Johannes Berg [Sun, 22 Oct 2023 14:55:52 +0000 (17:55 +0300)]
wifi: iwlwifi: trace full frames with TX status request

If upper layers requested a TX status, then the frames are
more important, so trace frames in that case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231022173519.0dfb60a2eaec.I3c3e46ed0eb05700a4d05d293f80d727354a402f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: empty overflow queue during flush
Miri Korenblit [Sun, 22 Oct 2023 14:55:51 +0000 (17:55 +0300)]
wifi: iwlwifi: empty overflow queue during flush

If a TX queue has no space for new TX frames, the driver will keep
these frames in the overflow queue, and during reclaim flow it
will retry to send the frames from that queue.
But if the reclaim flow was invoked from TX queue flush, we will also
TX these frames, which is wrong as we don't want to TX anything
after flush.
This might also cause assert 0x125F when removing the queue,
saying that the driver removes a non-empty queue
Fix this by TXing the overflow queue's frames only if we are
not in flush queue flow.

Fixes: a44509805895 ("iwlwifi: move reclaim flows to the queue file")
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231022173519.caf06c8709d9.Ibf664ccb3f952e836f8fa461ea58fc08e5c46e88@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: fw: Add support for UATS table in UHB
Mukesh Sisodiya [Sun, 22 Oct 2023 14:55:50 +0000 (17:55 +0300)]
wifi: iwlwifi: fw: Add support for UATS table in UHB

Driver need to provide details of VLP, AFC
AP type supported for the specific MCC to firmware.
Driver will read the UATS (UHB AP type support) table
from BIOS and sent to firmware using UATS_TABLE_CMD.

Add the support for the same in the driver.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231022173519.eb6cf7be17b2.I8977a660564412056d9fd383d57b236cd4b22d00@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: add a print when sending RLC command
Miri Korenblit [Sun, 22 Oct 2023 14:55:49 +0000 (17:55 +0300)]
wifi: iwlwifi: mvm: add a print when sending RLC command

Expand RLC logging to simplify the debug.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231022173519.ec227229263f.Iea36e64d4092e04ad561beb87002c7bb8c52596f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: debugfs for fw system stats
Anjaneyulu [Sun, 22 Oct 2023 14:55:48 +0000 (17:55 +0300)]
wifi: iwlwifi: mvm: debugfs for fw system stats

Add debgufs handler for fw system statistics command.

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231022173519.e77efee7cd85.I99f370f26f94f73e06aec2a8eaf21ebcc82f60a9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: implement new firmware API for statistics
Anjaneyulu [Sun, 22 Oct 2023 14:55:47 +0000 (17:55 +0300)]
wifi: iwlwifi: mvm: implement new firmware API for statistics

The new firmware API uses a new command and notification,
the command configures in which statistics types driver is
interested and the notification is sent periodically.
An additional change in the API is that most of the statistics
data is accumulated and reported by the firmware per MLO link.
Implement new command and notification handlers and adjust to
per-link statistics.

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231022173519.8cc7df0ebff2.If1dcb57145841c5b3c68ed112bbfcd0201f7acc3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: fix regdb initialization
Gregory Greenman [Tue, 17 Oct 2023 09:16:49 +0000 (12:16 +0300)]
wifi: iwlwifi: mvm: fix regdb initialization

In order to get regulatory domain, driver sends MCC_UPDATE_CMD to the
FW. One of the parameters in the response is the status which can tell
if the regdomain has changed or not.

When iwl_mvm_init_mcc() is called during iwl_op_mode_mvm_start(), then
sband is still NULL and channel parameters (i.e. chan->flags)  cannot be
initialized. When, further in the flow, iwl_mvm_update_mcc() is called
during iwl_mvm_up(), it first checks if the regdomain has changed and
then skips the update if it remains the same. But, since channel
parameters weren't initialized yet, the update should be forced in this
codepath. Fix that by adding a corresponding parameter to
iwl_mvm_init_fw_regd().

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.78b2c5b891b0.Iac49d52e0bfc0317372015607c63ea9276bbb188@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: update IGTK in mvmvif upon D3 resume
Yedidya Benshimol [Tue, 17 Oct 2023 09:16:48 +0000 (12:16 +0300)]
wifi: iwlwifi: mvm: update IGTK in mvmvif upon D3 resume

During the D3 resume flow, all new rekeys are passed from the FW.
Because the FW supports only one IGTK at a time, every IGTK rekey
update should be done by removing the last IGTK. The mvmvif holds a
pointer to the last IGTK for that reason and thus should be updated
when a new IGTK is passed upon resume.

Fixes: 04f78e242fff ("wifi: iwlwifi: mvm: Add support for IGTK in D3 resume flow")
Signed-off-by: Yedidya Benshimol <yedidya.ben.shimol@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.8ceaf7e5ece7.Ief444f6a2703ed76648b4d414f12bb4130bab36e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: simplify the reorder buffer
Emmanuel Grumbach [Tue, 17 Oct 2023 09:16:47 +0000 (12:16 +0300)]
wifi: iwlwifi: mvm: simplify the reorder buffer

The firmware / hardware of devices supporting RSS is able to report
duplicates and packets that time out inside the reoder buffer. We can
now remove all the complex logic that was implemented to keep all the Rx
queues more the less synchronized: we used to send a message to all the
queues through the firmware to teach the different queues about what is
the current SSN every 2048 packets.

Now that we rely on the firmware / hardware to detect duplicates, we can
completely remove the code that did that in the driver and it has been
reported that this code was spuriously dropping legit packets.

Suggested-by: Sultan Alsawaf <sultan@kerneltoast.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.54cf4d3d5956.Ic06a08c9fb1e1ec315a4b49d632b78b8474dab79@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: disable multi rx queue for 9000
Emmanuel Grumbach [Tue, 17 Oct 2023 09:16:46 +0000 (12:16 +0300)]
wifi: iwlwifi: disable multi rx queue for 9000

Multi rx queue allows to spread the load of the Rx streams on different
CPUs. 9000 series required complex synchronization mechanisms from the
driver side since the hardware / firmware is not able to provide
information about duplicate packets and timeouts inside the reordering
buffer.

Users have complained that for newer devices, all those synchronization
mechanisms have caused spurious packet drops. Those packet drops
disappeared if we simplify the code, but unfortunately, we can't have
RSS enabled on 9000 series without this complex code.

Remove support for RSS on 9000 so that we can make the code much simpler
for newer devices and fix the bugs for them.

The down side of this patch is a that all the Rx path will be routed to
a single CPU, but this has never been an issue, the modern CPUs are just
fast enough to cope with all the traffic.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.2917eb8b7af9.Iddd7dcf335387ba46fcbbb6067ef4ff9cd3755a7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: Return success if link could not be removed
Benjamin Berg [Tue, 17 Oct 2023 09:16:45 +0000 (12:16 +0300)]
wifi: iwlwifi: mvm: Return success if link could not be removed

iwl_mvm_remove_link would return an error if the link could not be
removed. However, doing so prevents recovery if a link was not uploaded
to the FW in the first place and the link_info was not allocated or
fw_link_id is not set.

Returning success means that we can still try to continue with adding
new links in change_vif_links.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.f89bc05aadf6.Idc8fbd671362d962c02b1df87fa6258733631580@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: fix size check for fw_link_id
Gregory Greenman [Tue, 17 Oct 2023 09:16:44 +0000 (12:16 +0300)]
wifi: iwlwifi: mvm: fix size check for fw_link_id

Check that fw_link_id does not exceed the size of link_id_to_link_conf
array. There's no any codepath that can cause that, but it's still
safer to verify in case fw_link_id gets corrupted.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.3385bd11f423.I2d30fdb464f951c648217553c47901857a0046c7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: pcie: synchronize IRQs before NAPI
Johannes Berg [Tue, 17 Oct 2023 09:16:43 +0000 (12:16 +0300)]
wifi: iwlwifi: pcie: synchronize IRQs before NAPI

When we want to synchronize the NAPI, which was added in
commit 5af2bb3168db ("wifi: iwlwifi: call napi_synchronize()
before freeing rx/tx queues"), we also need to make sure we
can't actually reschedule the NAPI. Yes, this happens while
interrupts are disabled, but interrupts may still be running
or pending. Also call iwl_pcie_synchronize_irqs() to ensure
we won't reschedule the NAPI.

Fixes: 4cf2f5904d97 ("iwlwifi: queue: avoid memory leak in reset flow")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.a0f4104b479a.Id5c50a944f709092aa6256e32d8c63b2b8d8d3ac@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: add support for SNPS DPHYIP region type
Daniel Gabay [Tue, 17 Oct 2023 09:16:42 +0000 (12:16 +0300)]
wifi: iwlwifi: add support for SNPS DPHYIP region type

Add the required logic for parsing and dumping this new region.

Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.c859539194e7.I965482de2871e28b09f4572f1aa87ae4e3b366be@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: fix netif csum flags
Johannes Berg [Tue, 17 Oct 2023 09:16:41 +0000 (12:16 +0300)]
wifi: iwlwifi: mvm: fix netif csum flags

We shouldn't advertise arbitrary checksum flags since we had
to remove support for it due to broken hardware.

Fixes: ec18e7d4d20d ("wifi: iwlwifi: mvm: use old checksum for Bz A-step")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.e37327f1a129.Iaee86b00db4db791cd90adaf15384b8c87d2ad49@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: remove set_tim callback for MLD ops
Johannes Berg [Tue, 17 Oct 2023 09:16:40 +0000 (12:16 +0300)]
wifi: iwlwifi: mvm: remove set_tim callback for MLD ops

In new firmware, we don't need this any more and it won't
be called any more by mac80211, since powersave handling
is all done by firmware. Remove it from the MLD ops.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.1a1ded96ffc2.Ie49d3004acdd6299fb84346c76b2b2b2f195196b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: api: fix center_freq label in PHY diagram
Johannes Berg [Tue, 17 Oct 2023 09:16:39 +0000 (12:16 +0300)]
wifi: iwlwifi: api: fix center_freq label in PHY diagram

Somehow I managed to put the EHT line in the wrong place and
also didn't indent the center_freq label correctly. Fix it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.08ac3cf524c0.I538f424e1ab30f73b0af8381224f377893e15526@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: support link id in SESSION_PROTECTION_NOTIF
Miri Korenblit [Tue, 17 Oct 2023 09:16:38 +0000 (12:16 +0300)]
wifi: iwlwifi: support link id in SESSION_PROTECTION_NOTIF

FW is introducing an API change in which link ID will be used
for session protection notif. Add support for it.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.4c59b149086e.I74fe93a6337f4ec9d1bd6f791d315411ac5b40da@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: support link_id in SESSION_PROTECTION cmd
Miri Korenblit [Tue, 17 Oct 2023 09:16:37 +0000 (12:16 +0300)]
wifi: iwlwifi: support link_id in SESSION_PROTECTION cmd

FW is introducing an API change in which link ID will be used
for session protection cmd. Add support for it.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.a3cb29ed0617.I85b8a85b0d9186d3dd4d704254e46775b0ccf7de@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: make time_events MLO aware
Miri Korenblit [Tue, 17 Oct 2023 09:16:36 +0000 (12:16 +0300)]
wifi: iwlwifi: make time_events MLO aware

As session protection API is moving to be per link instead of per mac,
move the time events to be per link too.

Since there is only one concurrent time event per mac, it feels
unnecessary to have the time_event as a member of iwl_mvm_link_info.
(That way we will have to iterate over all links each time we want to
clear a time event, and also we will need mac80211 to tell us the link
id when mgd_tx_complete() is called.)
So leave this as a member of iwl_mvm_vif, but add the link id to the
time_event structure.

The link id in time_event will only be maintained and used for:
1. When SESSION_PROTECTION_CMD is supported (before it, we don't have MLO)
2. For time_events of types SESSION_PROTECT_CONF_ASSOC,
   SESSION_PROTECT_CONF_P2P_DEVICE_DISCOV, and
   SESSION_PROTECT_CONF_P2P_GO_NEGOTIATION
   (not for aux roc/ Hot Spot time_events).

For P2P, non-MLO connections, and pre-MLD API, deflink id, meaning 0,
will be used

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231017115047.21496bcacb18.I79d037325b4fae4c12a22d9477e53fc9c537ad46@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: fix another key installation error path
Johannes Berg [Fri, 20 Oct 2023 07:38:28 +0000 (09:38 +0200)]
wifi: mac80211: fix another key installation error path

Due to overlapping changes and merges, another error
path ended up broken. Fix this one as well.

Reported-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: rename struct cfg80211_rx_assoc_resp to cfg80211_rx_assoc_resp_data
Kalle Valo [Thu, 12 Oct 2023 11:42:29 +0000 (14:42 +0300)]
wifi: mac80211: rename struct cfg80211_rx_assoc_resp to cfg80211_rx_assoc_resp_data

make htmldocs warns:

Documentation/driver-api/80211/cfg80211:48: ./include/net/cfg80211.h:7290: WARNING: Duplicate C declaration, also defined at cfg80211:7251.
Declaration is '.. c:function:: void cfg80211_rx_assoc_resp (struct net_device *dev, struct cfg80211_rx_assoc_resp *data)'.

This is because there's a function named cfg80211_rx_assoc_resp() and a struct
named cfg80211_rx_assoc_resp, see previous patch for more info.

To workaround this rename the struct to cfg80211_rx_assoc_resp_data. The
parameter for the function is named 'data' anyway so the naming here is
consistent.

Compile tested only.

Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20231012114229.2931808-3-kvalo@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: rename ieee80211_tx_status() to ieee80211_tx_status_skb()
Kalle Valo [Thu, 12 Oct 2023 11:42:28 +0000 (14:42 +0300)]
wifi: mac80211: rename ieee80211_tx_status() to ieee80211_tx_status_skb()

make htmldocs warns:

Documentation/driver-api/80211/mac80211:109: ./include/net/mac80211.h:5170: WARNING: Duplicate C declaration, also defined at mac80211:1117.
Declaration is '.. c:function:: void ieee80211_tx_status (struct ieee80211_hw *hw, struct sk_buff *skb)'.

This is because there's a function named ieee80211_tx_status() and a struct named
ieee80211_tx_status. This has been discussed previously but no solution found:

https://lore.kernel.org/all/20220521114629.6ee9fc06@coco.lan/

There's also a bug open for three years with no solution in sight:

https://github.com/sphinx-doc/sphinx/pull/8313

So I guess we have no other solution than to a workaround this in the code,
for example to rename the function to ieee80211_tx_status_skb() to avoid the
name conflict. I got the idea for the name from ieee80211_tx_status_noskb() in
which the skb is not provided as an argument, instead with
ieee80211_tx_status_skb() the skb is provided.

Compile tested only.

Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20231012114229.2931808-2-kvalo@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: add support for activating UNII-1 in WW via BIOS
Miri Korenblit [Wed, 11 Oct 2023 10:07:31 +0000 (13:07 +0300)]
wifi: iwlwifi: add support for activating UNII-1 in WW via BIOS

There is a requirement from OEMs to support a new bit in DSM function 8,
which will indicate that this device is an indoor one, and that it
should activate UNII-1 (5.2GHz) sub band in the World Wide Geo Profile.
Add support for this by reading this bit from BIOS and sending it to the
FW.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.86d4ad178042.Ief40acc08b5482ff147fd17e74e36f1933e43def@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: remove TDLS stations from FW
Johannes Berg [Wed, 11 Oct 2023 10:07:30 +0000 (13:07 +0300)]
wifi: iwlwifi: mvm: remove TDLS stations from FW

When we remove TDLS stations, we need to remove them from FW
immediately, even while associated. Some previous refactoring
here lost the sta ID condition, add it back.

Fixes: 57974a55d995 ("wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.933011e710a9.I77c069c781e8b2b698b86cc3f43fc3c7e2dde114@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: fix iwl_mvm_mac_flush_sta()
Johannes Berg [Wed, 11 Oct 2023 10:07:29 +0000 (13:07 +0300)]
wifi: iwlwifi: mvm: fix iwl_mvm_mac_flush_sta()

When I implemented iwl_mvm_mac_flush_sta() I completely botched it;
it basically always happens after the iwl_mvm_sta_pre_rcu_remove()
call, and that already clears mvm->fw_id_to_mac_id[] entries, so we
cannot rely on those at iwl_mvm_mac_flush_sta() time. This means it
never did anything.

Fix this by just going through the station IDs and now with the new
API for iwl_mvm_flush_sta(), call those.

Fixes: a6cc6ccb1c8a ("wifi: iwlwifi: mvm: support new flush_sta method")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.0b5878e93118.I1093e60163052e7be64d2b01424097cd6a272979@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: change iwl_mvm_flush_sta() API
Johannes Berg [Wed, 11 Oct 2023 10:07:28 +0000 (13:07 +0300)]
wifi: iwlwifi: mvm: change iwl_mvm_flush_sta() API

This API is type unsafe and needs an extra parameter to know
what kind of station was passed, so it has two, but really it
only needs two values. Just pass the values instead of doing
this type-unsafe dance, which will also make it better to use
for multi-link.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.aeb3bf4204cd.I5b0e6d64a67455784bc8fbdaf9ceaf03699d9ce1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: extend alive timeout to 2 seconds
Haim Dreyfuss [Wed, 11 Oct 2023 10:07:27 +0000 (13:07 +0300)]
wifi: iwlwifi: mvm: extend alive timeout to 2 seconds

There are devices that need longer time to get the alive notification.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.f1f0aa1794e6.I34a06ef24b642a32af69c0bd109694de469d5177@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: fix the PHY context resolution for p2p device
Emmanuel Grumbach [Wed, 11 Oct 2023 10:07:26 +0000 (13:07 +0300)]
wifi: iwlwifi: mvm: fix the PHY context resolution for p2p device

We seem to have an issue in case we had a BSS and a P2P device on
channel 1 and then, the P2P device gets an ROC on channel 6. We would
change the channel of the PHY context to channel 6 even if the BSS was
using that same PHY context.

Revamp that code and don't try to change a PHY context, it doesn't mean
much for the firmware anyway. Just remove it and allocate a new one.
This makes the logic easier to follow.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.4bc8b90d7be0.I1232dca3fe007362ec0ae0cf1d96217f2544e0d2@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: fold the ref++ into iwl_mvm_phy_ctxt_add
Emmanuel Grumbach [Wed, 11 Oct 2023 10:07:25 +0000 (13:07 +0300)]
wifi: iwlwifi: mvm: fold the ref++ into iwl_mvm_phy_ctxt_add

When we want to add a phy_ctxt, we need to increase the ref.
Note that all the WARN_ONs are already in place:
* We check that we don't add a context with ref != 0
* We check that we don't modify a context with ref = 0

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.c19c07746b26.I5b0cbe0760811631a320218a10b88870b5bf0897@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: don't add dummy phy context
Emmanuel Grumbach [Wed, 11 Oct 2023 10:07:24 +0000 (13:07 +0300)]
wifi: iwlwifi: mvm: don't add dummy phy context

From its very first stages of development, iwlmvm added all the PHY
context immediately upon firmware boot. Then, all we needed to do is to
modify the contexts. This was fine if the addition of a PHY context that
we don't need is free. This was true until now. Newer devices will run
calibrations upon the addition of a PHY context.

Change the way we work with PHY context in iwlmvm. Fortunately, we
already have all the ref counting in place so that it is not very hard
to do.

Also, since we now remove the PHY context before the link is removed
(but after it has been de-activated of course), it'll confuse the
firmware if we put the late phy_id into the LINK command that removes
the link. Change this to put an invalid phy_id just like we do when we
add a link that has no PHY context yet.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.55a1a78719be.I2032a7d227b57f4fc4370a2793476d47538404fd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: cleanup MLO and non-MLO unification code
Miri Korenblit [Wed, 11 Oct 2023 10:07:23 +0000 (13:07 +0300)]
wifi: iwlwifi: mvm: cleanup MLO and non-MLO unification code

bss_info_changed() callback of mac80211 was originally in both
MLD and non-MLD API. Therefore, we extracted the common part
to a function which receives a callback structure with the
mode-specific (non-MLO\MLO) ops. Eventually, for MLO API,
bss_info_changed() callback was split into 2 callbacks:
link_info_changed() and vif_cfg_changed() so it is no longer in use
for MLO, only for non-MLO.
Remove the code that uses the mode-specific callback structure.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.b65fbcdb9295.I2a64a6f1178ee0466755d728addc77acbb2ed6f4@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: implement ROC version 3
Shaul Triebitz [Wed, 11 Oct 2023 10:07:22 +0000 (13:07 +0300)]
wifi: iwlwifi: mvm: implement ROC version 3

Define the new API for ROC command and notification.
Use ROC version 3 command and notificaiton for hotspot.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.0cff02aecc16.If0a89ddc6b2339988ff51efa6709d4a883569969@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: send EDT table to FW
Alon Giladi [Wed, 11 Oct 2023 10:07:21 +0000 (13:07 +0300)]
wifi: iwlwifi: send EDT table to FW

Read the EDT (Energy detection threshold) optimization configuration
table from BIOS using DSM Function and send it to FW.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.0b78ee48219a.I8ecbd39d258e2ee0514a7e28632f6c18fb798a83@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: Fix key flags for IGTK on AP interface
Ilan Peer [Wed, 11 Oct 2023 10:07:20 +0000 (13:07 +0300)]
wifi: iwlwifi: mvm: Fix key flags for IGTK on AP interface

When an IGTK is installed for an AP interface, there is no station
associated with it. However, the MFP flag must be set for the installed
key as otherwise the FW wouldn't use it.

Fix the security key flag to set the MFP flag also when the AP is
an AP interface and the key index matches that of an IGTK.

Fixes: 5c75a208c244 ("wifi: iwlwifi: mvm: support new key API")
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.f67005e2d4d2.I6832c6e87f3c79fff00689eb10a3a30810e1ee83@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlmvm: fw: Add new OEM vendor to tas approved list
Matt Chen [Wed, 11 Oct 2023 10:07:19 +0000 (13:07 +0300)]
wifi: iwlmvm: fw: Add new OEM vendor to tas approved list

Add new oem/odm pair to tas approved vendors list when specified by platform.

Signed-off-by: Matt Chen <matt.chen@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.a6f10aaae473.I65c3321535674bbc08d96200961a78fab5e7a09f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: Fix unreachable code path
Ilan Peer [Wed, 11 Oct 2023 10:07:18 +0000 (13:07 +0300)]
wifi: iwlwifi: mvm: Fix unreachable code path

Fix unreachable code path that was introduced in the P2P Device
linking refactoring.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.39d76eeea781.I2dc1fc6152a2cd4cf68827f4d3bf83e2293d3dfb@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: add new RF support for wifi7
Mukesh Sisodiya [Wed, 11 Oct 2023 10:07:17 +0000 (13:07 +0300)]
wifi: iwlwifi: add new RF support for wifi7

Add the support for new RF based on step-id.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231011130030.d902aa8cfd1b.I7c7b357ba41c00015d6c6255b45b3d17549948f0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: fw: increase fw_version string size
Gregory Greenman [Thu, 12 Oct 2023 12:41:48 +0000 (15:41 +0300)]
wifi: iwlwifi: fw: increase fw_version string size

In reality 64 bytes are enough to hold fw version string,
but some compilers can complain (with W=1) that output may be
truncated when building this string with snprintf.
Increase the size to avoid this sort of warnings and state
explicitely that we want the size to be trancated to 32 bytes.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Tested-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231012153950.f4465b4b4e2b.Idced2e8d63c492872edcde1a3ce2cdd6cc0f8eb7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: fix change_address deadlock during unregister
Johannes Berg [Thu, 12 Oct 2023 10:34:47 +0000 (12:34 +0200)]
wifi: mac80211: fix change_address deadlock during unregister

When using e.g. bonding, and doing a sequence such as

 # iw wlan0 set type __ap
 # ip link add name bond1 type bond
 # ip link set wlan0 master bond1
 # iw wlan0 interface del

we deadlock, since the wlan0 interface removal will cause
bonding to reset the MAC address of wlan0.

The locking would be somewhat difficult to fix, but since
this only happens during removal, we can simply ignore the
MAC address change at this time.

Reported-by: syzbot+25b3a0b24216651bc2af@syzkaller.appspotmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://lore.kernel.org/r/20231012123447.9f9d7fd1f237.Ic3a5ef4391b670941a69cec5592aefc79d9c2890@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: Add __counted_by for struct ieee802_11_elems and use struct_size()
Gustavo A. R. Silva [Mon, 9 Oct 2023 17:59:41 +0000 (11:59 -0600)]
wifi: mac80211: Add __counted_by for struct ieee802_11_elems and use struct_size()

Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for
array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).

While there, use struct_size() helper, instead of the open-coded
version, to calculate the size for the allocation of the whole
flexible structure including, of course, the flexible-array member.

This code was found with the help of Coccinelle, and audited and
fixed manually.

Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/ZSQ/jcmTAf/PKHg/@work
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: check for kmemdup() return value in iwl_parse_tlv_firmware()
Dmitry Antipov [Mon, 9 Oct 2023 17:04:49 +0000 (20:04 +0300)]
wifi: iwlwifi: check for kmemdup() return value in iwl_parse_tlv_firmware()

In 'iwl_parse_tlv_firmware()', check for 'kmemdup()' return value
when handling IWL_UCODE_TLV_CURRENT_PC and set the number of parsed
entries only if an allocation was successful (just like it does with
handling IWL_UCODE_TLV_CMD_VERSIONS above). Compile tested only.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Acked-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231009170453.149905-1-dmantipov@yandex.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: remove unused argument of ieee80211_get_tdls_action()
Dmitry Antipov [Wed, 4 Oct 2023 15:30:29 +0000 (18:30 +0300)]
wifi: remove unused argument of ieee80211_get_tdls_action()

Remove unused 'hdr_size' argument of 'ieee80211_get_tdls_action()'
and adjust 'ieee80211_report_used_skb()' accordingly.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Link: https://lore.kernel.org/r/20231004153032.206134-1-dmantipov@yandex.ru
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: Correctly set link configuration
Ilan Peer [Wed, 4 Oct 2023 09:36:34 +0000 (12:36 +0300)]
wifi: iwlwifi: mvm: Correctly set link configuration

In case the link puncturing is changed such that the channel
is no longer punctured, configure the FW correctly indicating
the EHT parameters changed (with a 0 punctured map).

Allow EHT parameters configuration only when the link really
supports EHT.

Fixes: 55eb1c5fa4b2 ("wifi: iwlwifi: mvm: add support for the new LINK command")
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.2666ef86e032.I4b0e95722660acc5345ceefba7e8866a69572e8e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: fix the rf step and flavor bits range
Mukesh Sisodiya [Wed, 4 Oct 2023 09:36:33 +0000 (12:36 +0300)]
wifi: iwlwifi: fix the rf step and flavor bits range

The macros used to get the RF step and flavour are using
wrong bit range. Update the bit range for both macros.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.cfd0aaaa5eb3.Ie2dd6c3a3062647f19cb5e888c46f0fdca103484@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: fw: Fix debugfs command sending
Mukesh Sisodiya [Wed, 4 Oct 2023 09:36:32 +0000 (12:36 +0300)]
wifi: iwlwifi: fw: Fix debugfs command sending

During debugfs command handling transport function is used directly,
this bypasses the locking used by runtime operation function
and leads to a kernel warning when two commands are
sent in parallel.

Fix it by using runtime operations function when sending
debugfs command.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.4f80ac90658a.Ia1dfa1195c919f3002fe08db3eefbd2bfa921bbf@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: advertise support for SCS traffic description
Ayala Beker [Wed, 4 Oct 2023 09:36:31 +0000 (12:36 +0300)]
wifi: iwlwifi: mvm: advertise support for SCS traffic description

This doesn't require any special implementation from our device, just
allows transmission of SCS request frame containing a QoS
characteristics sub element.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.cc15de23b07b.I35fa1fbacf113b87ba7a13c37760f893eb57643a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: Don't always bind/link the P2P Device interface
Ilan Peer [Wed, 4 Oct 2023 09:36:30 +0000 (12:36 +0300)]
wifi: iwlwifi: mvm: Don't always bind/link the P2P Device interface

It is not necessary to keep the P2P Device bound/linked to a PHY
context when there is no active ROC.

Modify the P2P Device flows so the binding/linking would be done
only while ROC is active. With this change the switch_phy_ctxt()
is no longer needed so remove it.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.c5b83b4bf9de.Ia80daf3ba0b5fec7d0919247fcbdbdb58bddf02b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: add start mac ctdp sum calculation debugfs handler
iallouch [Wed, 4 Oct 2023 09:36:29 +0000 (12:36 +0300)]
wifi: iwlwifi: mvm: add start mac ctdp sum calculation debugfs handler

mac_ctdp_sum contains the power consumption, appears in power save
report, and is used for debugging and collection of statistics.

Add a debugfs handler to start this calculation, iff ctdp
command is supported in the firmware.

While on it, add an option to force start/stop this calculation,
which is safe from the firmware API side.

Signed-off-by: iallouch <itai.allouche@intel.com>
Signed-off-by: Nitsan Bar <nitsan.bar@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.024d75df9e03.I69fdc826f2931a6e1435b450f0602ea060704697@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: abort scan when rfkill on but device enabled
Miri Korenblit [Wed, 4 Oct 2023 09:36:28 +0000 (12:36 +0300)]
wifi: iwlwifi: abort scan when rfkill on but device enabled

In RFKILL we first set the RFKILL bit, then we abort scan
(if one exists) by waiting for the notification from FW
and notifying mac80211. And then we stop the device.
But in case we have a scan ongoing in the period of time between
rfkill on and before the device is stopped - we will not wait for the
FW notification because of the iwl_mvm_is_radio_killed() condition,
and then the scan_status and uid_status are misconfigured,
(scan_status is cleared but uid_status not)
and when the notification suddenly arrives (before stopping the device)
we will get into the assert about scan_status and uid_status mismatch.
Fix this by waiting for FW notif when rfkill is on but the device isn't
disabled yet.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.c43b69aa2c77.Icc7b5efb47974d6f499156ff7510b786e177993b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: Add basic link selection logic
Ilan Peer [Wed, 4 Oct 2023 09:36:27 +0000 (12:36 +0300)]
wifi: iwlwifi: mvm: Add basic link selection logic

Add simple logic that would allow using EMLSR in case
there are multiple valid links:

- In case the connection establishment has just been
  completed try to find a valid link pair for EMLSR
  functionality where one of the links in the pair is
  the current active link.
- In case the valid links changed after connection
  was already established, try to find a valid link pair
  for EMLSR functionality, in case the EMSLR is not active
  yet.

If a valid link pair is found call mac80211 to asynchronously
set the new link pair, otherwise continue using the current active
links.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.0c7b89ab29c2.I6600bd16551d75e2bf520d8d0add525568a9f85f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mei: return error from register when not built
Johannes Berg [Wed, 4 Oct 2023 09:36:26 +0000 (12:36 +0300)]
wifi: iwlwifi: mei: return error from register when not built

When MEI isn't built, it seems like successfully registering
would be wrong. Change this to an error so that in the rest
of the driver, mei_registered won't be true.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.d410a97cddfb.I7891544938d5edd5e6e7d2d99540b3637f2f1b1b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: fix SB CFG check
Johannes Berg [Wed, 4 Oct 2023 09:36:25 +0000 (12:36 +0300)]
wifi: iwlwifi: mvm: fix SB CFG check

We shouldn't check the 0x10 bit here, since the register
holds different values (not just bit masks.). Check for
the exact value where this is needed only.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.ab21c7d5e219.I4f9906ebc7ecf38fd276510a276280a9261c8f7f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: add a per-link debugfs
Miri Korenblit [Wed, 4 Oct 2023 09:36:24 +0000 (12:36 +0300)]
wifi: iwlwifi: mvm: add a per-link debugfs

Add a per-link debugfs entry in iwlmvm level so we can read/write link
related parameters.
Do it by implementing the link_add_debugfs API introduced by mac80211.

Each entry will have a path like this:
.../netdev:wlan0/link-X/iwlmvm/<file_name>
for each link X.

For non-MLD vifs this callback is called when the original vif
debugfs dir is also created, so handle that case by not creating
the 'iwlmvm' directory again.

Note that we don't have to worry about the cleaning the iwlmvm/*
directory as it is already done by mac80211 when removing the link
(or netdev).

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.6a161f021ae8.Ic8f40f2b4682270c94036e3c11c3996ae34266fa@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: rework debugfs handling
Johannes Berg [Wed, 4 Oct 2023 09:36:23 +0000 (12:36 +0300)]
wifi: iwlwifi: mvm: rework debugfs handling

mac80211 added a new callback to add a vif debugfs.
Implement it instead of adding the debugfs directly,
which will make it properly preserved over switching
the vif from non-MLD/MLD and back.

This requires some rework so that we still have the
symlink but trust mac80211 to add/remove the debugfs.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.818810e242e6.I805a28f9fbef5c52a3a575d04e7a6a909ecf9078@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: yoyo: swap cdb and jacket bits values
Rotem Saado [Wed, 4 Oct 2023 09:36:22 +0000 (12:36 +0300)]
wifi: iwlwifi: yoyo: swap cdb and jacket bits values

The bits are wrong, the jacket bit should be 5 and cdb bit 4.
Fix it.

Fixes: 1f171f4f1437 ("iwlwifi: Add support for getting rf id with blank otp")
Signed-off-by: Rotem Saado <rotem.saado@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.356d8dacda2f.I349ab888b43a11baa2453a1d6978a6a703e422f0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: add support for new ini region types
Miri Korenblit [Wed, 4 Oct 2023 09:36:21 +0000 (12:36 +0300)]
wifi: iwlwifi: add support for new ini region types

YoYo introduces 2 new region types: prph mac and phy blocks.
The data in this regions consists of a list of
(base address, size) pairs.
This way we can set a block of consecutive registers by the
base address and the size, instead of a list of registers.
Add support for parsing and dumping these new region types

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.0a10320f4259.I680ef6e16267d95329ee239f05d0999f5a1719ac@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: Extract common prph mac/phy regions data dump logic
Miri Korenblit [Wed, 4 Oct 2023 09:36:20 +0000 (12:36 +0300)]
wifi: iwlwifi: Extract common prph mac/phy regions data dump logic

YoYo (debug data collection mechanism) is introducing 2 new types
of regions: prph mac/phy ranges.
These types will have a common logic of reading the data from the
device as the mac/phy prph has. Put it in a separate function so it can
be reused.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004123422.16f06414c65c.Ie911bc83a1e2f8fddb27b4c5bd24f933f8b674b6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: nl80211: fix doc typos
Randy Dunlap [Sun, 1 Oct 2023 19:16:33 +0000 (12:16 -0700)]
wifi: nl80211: fix doc typos

Correct some typos.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Kalle Valo <kvalo@kernel.org>
Cc: linux-wireless@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20231001191633.19090-3-rdunlap@infradead.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: fix header kernel-doc typos
Randy Dunlap [Sun, 1 Oct 2023 19:16:32 +0000 (12:16 -0700)]
wifi: mac80211: fix header kernel-doc typos

Correct typos and fix run-on sentences.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Kalle Valo <kvalo@kernel.org>
Cc: linux-wireless@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20231001191633.19090-2-rdunlap@infradead.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: cfg80211: fix header kernel-doc typos
Randy Dunlap [Sun, 1 Oct 2023 19:16:31 +0000 (12:16 -0700)]
wifi: cfg80211: fix header kernel-doc typos

Correct spelling of several words.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Kalle Valo <kvalo@kernel.org>
Cc: linux-wireless@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paolo Abeni <pabeni@redhat.com>
Cc: netdev@vger.kernel.org
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20231001191633.19090-1-rdunlap@infradead.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: add link id to mgd_prepare_tx()
Miri Korenblit [Thu, 28 Sep 2023 14:35:34 +0000 (17:35 +0300)]
wifi: mac80211: add link id to mgd_prepare_tx()

As we are moving to MLO and links terms, also the airtime protection
will be done for a link rather than for a vif. Thus, some
drivers will need to know for which link to protect airtime.
Add link id as a parameter to the mgd_prepare_tx() callback.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.c7fc59a6780b.Ic88a5037d31e184a2dce0b031ece1a0a93a3a9da@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: Check if we had first beacon with relevant links
Miri Korenblit [Wed, 4 Oct 2023 09:12:02 +0000 (12:12 +0300)]
wifi: mac80211: Check if we had first beacon with relevant links

If there is a disassoc before the fisrt beacon we need to protect a
session for the deauth frame. Currently we are checking if we had a
beacon in the default link, which is wrong in a MLO connection and
link id != 0.
Fix this by checking all the active links, if none had a beacon then
protect a session.
If at least one link had a beacon there is no need for session
protection.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20231004120820.d290f0ab77b0.Ic1505cf3d60f74580d31efa7e52046947c490b85@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: flush STA queues on unauthorization
Johannes Berg [Thu, 28 Sep 2023 14:35:39 +0000 (17:35 +0300)]
wifi: mac80211: flush STA queues on unauthorization

When the station is marked as no longer authorized, we shouldn't
transmit to it any longer, but in particular we shouldn't be able
to transmit to it after removing keys, which might lead to frames
being sent out unencrypted depending on the exact hardware offload
mechanism. Thus, instead of flushing only on station destruction,
which covers only some cases, always flush on unauthorization.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.d47f528829e7.I96903652c7ee0c5c66891f8b2364383da8e45a1f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: purge TX queues in flush_queues flow
Miri Korenblit [Thu, 28 Sep 2023 14:35:38 +0000 (17:35 +0300)]
wifi: mac80211: purge TX queues in flush_queues flow

When this flow is invoked with the "drop" parameter as true,
we only drop the frames from the hw queues, but not from the
sw queues.
So when we call wake_queues() after hw queue purging, all the
frames from the sw queues will be TX'ed,
when what we actually want to do is to purge all queues
in order to not TX anything...
This can cause, for example, TXing data frames to the peer
after the deauth frame was sent.
Fix this by purging the sw queues in addition to the hw queues
if the drop parameter is true.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.8fc2ee23e56f.I8b3f6def9c28ea96261e2d31df8786986fb5385b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: cfg80211: wext: convert return value to kernel-doc
Johannes Berg [Thu, 28 Sep 2023 14:35:37 +0000 (17:35 +0300)]
wifi: cfg80211: wext: convert return value to kernel-doc

Since I'm getting a warning here right now, fix the
kernel-doc to be "Returns:" rather than just writing
that out in the doc paragraph.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.ab3b9274bf07.If263f9f6726d6ad4661f8603e6a4485e0385d67f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: fix a expired vs. cancel race in roc
Emmanuel Grumbach [Thu, 28 Sep 2023 14:35:36 +0000 (17:35 +0300)]
wifi: mac80211: fix a expired vs. cancel race in roc

When the remain on channel is removed at the time it should
have expired, we have a race: the driver could be handling
the flow of the expiration while mac80211 is cancelling
that very same remain on channel request.

This wouldn't be problem in itself, but since mac80211
can send the next request to the driver in the cancellation
flow, we can get to the following situation:

           CPU0                             CPU1
expiration of roc in driver
ieee80211_remain_on_channel_expired()
                                         Cancellation of the roc
schedules a worker (hw_roc_done)
                                         Add next roc
hw_roc_done_wk runs and ends
the second roc prematurely.

Since, by design, there is only one single request sent to the
driver at a time, we can safely assume that after the cancel()
request returns from the driver, we should not handle any worker
that handles the expiration of the request.

Cancel the hw_roc_done worker after the cancellation to make
sure we start the next one with a clean slate.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.4e4469be20ac.Iab0525f5cc4698acf23eab98b8b1eec02099cde0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: make mgd_protect_tdls_discover MLO-aware
Miri Korenblit [Thu, 28 Sep 2023 14:35:35 +0000 (17:35 +0300)]
wifi: mac80211: make mgd_protect_tdls_discover MLO-aware

Since userspace can choose now what link to establish the
TDLS on, we should know on what channel to do session protection.
Add a link id parameter to this callback.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.ef12ce3eb835.If864f406cfd9e24f36a2b88fd13a37328633fcf9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: cfg80211: Fix typo in documentation
Ilan Peer [Thu, 28 Sep 2023 14:35:32 +0000 (17:35 +0300)]
wifi: cfg80211: Fix typo in documentation

Fix a small typo in a comment.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.9dce226e393f.I929bfb9371e31c9e8d2bb1c1a96e9b1f3d02f2d0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: Fix setting vif links
Ilan Peer [Thu, 28 Sep 2023 14:35:31 +0000 (17:35 +0300)]
wifi: mac80211: Fix setting vif links

When setting the interface links, ignore the change iff both the
valid links and the dormant links did not change. This is needed
to support cases where the valid links didn't change but the dormant
links did.

Fixes: 6d543b34dbcf ("wifi: mac80211: Support disabled links during association")
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.0357b6306587.I7dbfec347949b629fea680d246a650d6207ff217@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: cfg80211: Handle specific BSSID in 6GHz scanning
Ilan Peer [Thu, 28 Sep 2023 14:35:30 +0000 (17:35 +0300)]
wifi: cfg80211: Handle specific BSSID in 6GHz scanning

When the scan parameters for a 6GHz scan specify a unicast
BSSID address, and the corresponding AP is found in the scan
list, add a corresponding entry in the collocated AP list,
so this AP would be directly probed even if it was not
advertised as a collocated AP.

This is needed for handling a scan request that is intended
for a ML probe flow, where user space can requests a scan
to retrieve information for other links in the AP MLD.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.54b954bc02ad.I1c072793d3d77a4c8fbbc64b4db5cce1bbb00382@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: mesh: fix some kdoc warnings
Benjamin Berg [Thu, 28 Sep 2023 14:35:29 +0000 (17:35 +0300)]
wifi: mac80211: mesh: fix some kdoc warnings

These were mostly missing or incorrectly tagged return values.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.33fea2968c62.I41d197b570370ab7cad1405518512fdd36e08717@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: cfg80211: Include operating class 137 in 6GHz band
Ilan Peer [Thu, 28 Sep 2023 14:35:28 +0000 (17:35 +0300)]
wifi: cfg80211: Include operating class 137 in 6GHz band

Draft P802.11be_D3.1 added operating class to describe 320 MHz
operation in the 6GHz band. Include this new operating class in
ieee80211_operating_class_to_band().

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.bed4a007d81b.I3eb4b8fe39c0c1a988c98a103b11a9f45a92b038@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: Rename and update IEEE80211_VIF_DISABLE_SMPS_OVERRIDE
Ilan Peer [Thu, 28 Sep 2023 14:35:27 +0000 (17:35 +0300)]
wifi: mac80211: Rename and update IEEE80211_VIF_DISABLE_SMPS_OVERRIDE

EMLSR operation and SMPS operation cannot coexist. Thus, when EMLSR is
enabled, all SMPS signaling towards the AP should be stopped (it is
expected that the AP will consider SMPS to be off).

Rename IEEE80211_VIF_DISABLE_SMPS_OVERRIDE to IEEE80211_VIF_EML_ACTIVE
and use the flag as an indication from the driver that EMLSR is enabled.
When EMLSR is enabled SMPS flows towards the AP MLD should be stopped.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.fb2c2f9a0645.If6df5357568abd623a081f0f33b07e63fb8bba99@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: handle debugfs when switching to/from MLO
Miri Korenblit [Thu, 28 Sep 2023 14:35:26 +0000 (17:35 +0300)]
wifi: mac80211: handle debugfs when switching to/from MLO

In MLO, we have a per-link debugfs directory which contains the
per-link files. In case of non-MLO we would like to put the per-link
files in the netdev directory to keep it how it was before MLO.

- Upon interface creation the netdev will be created with the per-link
  files in it.
- Upon switching to MLO: delete the entire netdev directory and then
  recreate it without the per-link files. Then the per-link directories
  with the per-link files in it will be created in ieee80211_link_init()
- Upon switching to non-MLO: delete the entire netdev directory
  (including the per-link directories) and recreate it with the per-link
  files in it.

Note that this also aligns to always call the vif link debugfs
method for the deflink as promised in the documentation, which
wasn't done before.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.082e698caca9.I5bef7b2026e0f58b4a958b3d1f459ac5baeccfc9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: add a driver callback to add vif debugfs
Miri Korenblit [Thu, 28 Sep 2023 14:35:25 +0000 (17:35 +0300)]
wifi: mac80211: add a driver callback to add vif debugfs

Add a callback which the driver can use to add the vif debugfs.
We used to have this back until commit d260ff12e776 ("mac80211:
remove vif debugfs driver callbacks") where we thought that it
will be easier to just add them during interface add/remove.

However, now with multi-link, we want to have proper debugfs
for drivers for multi-link where some files might be in the
netdev for non-MLO connections, and in the links for MLO ones,
so we need to do some reconstruction when switching the mode.

Moving to this new call enables that and MLO drivers will have
to use it for proper debugfs operation.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.ac38913f6ab7.Iee731d746bb08fcc628fa776f337016a12dc62ac@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: don't recreate driver link debugfs in reconfig
Johannes Berg [Thu, 28 Sep 2023 14:35:24 +0000 (17:35 +0300)]
wifi: mac80211: don't recreate driver link debugfs in reconfig

We can delete any that we want to remove, but we can't
recreate the links as they already exist.

Fixes: 170cd6a66d9a ("wifi: mac80211: add netdev per-link debugfs data and driver hook")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.3d0214838421.I512a0ff86f631ff42bf25ea0cb2e8e8616794a94@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: mac80211: cleanup auth_data only if association continues
Benjamin Berg [Thu, 28 Sep 2023 14:35:22 +0000 (17:35 +0300)]
wifi: mac80211: cleanup auth_data only if association continues

If the association command fails then the authentication is still valid
and it makes sense to keep it alive. Otherwise, we would currently get
into an inconsistent state because mac80211 on the one hand is
disconnected but on the other hand the state is not entirely cleared
and a new authentication could not continue.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230928172905.c9855f46ebc8.I7f3dcd4120a186484a91b87560e9b7201d40984f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: bump FW API to 84 for AX/BZ/SC devices
Gregory Greenman [Tue, 26 Sep 2023 08:07:21 +0000 (11:07 +0300)]
wifi: iwlwifi: bump FW API to 84 for AX/BZ/SC devices

Start supporting API version 84 for new devices.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230926110319.eae20f9fdc06.Ifa9be6482121ea6df364bddc96ea6a7d101366b6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: use correct sta ID for IGTK/BIGTK
Johannes Berg [Tue, 26 Sep 2023 08:07:20 +0000 (11:07 +0300)]
wifi: iwlwifi: mvm: use correct sta ID for IGTK/BIGTK

We don't (yet) send the IGTK down to the firmware, but when
we do it needs to be with the broadcast station ID, not the
multicast station ID. Same for the BIGTK, which we may send
already if firmware advertises it (but it doesn't yet.)

Fixes: a5de7de7e78e ("wifi: iwlwifi: mvm: enable TX beacon protection")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230926110319.dbc653913353.I82e90c86010f0b9588a180d9835fd11f666f5196@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: offload IGTK in AP if BIGTK is supported
Johannes Berg [Tue, 26 Sep 2023 08:07:19 +0000 (11:07 +0300)]
wifi: iwlwifi: mvm: offload IGTK in AP if BIGTK is supported

We can't really know easily if a BIGTK will be used, but
in case firmware supports BIGTK it also supports the very
easy IGTK use (nothing to do on the host), and requires
that we program both IGTK and BIGTK to be able to use the
BIGTK. Thus, change the condition here to set the keys in
firmware (both IGTK/BIGTK) if BIGTK is supported.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230926110319.425ebc1ce484.If485ec962636c23d463b678e7da86e11b6fa86c9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: mvm: fix removing pasn station for responder
Avraham Stern [Tue, 26 Sep 2023 08:07:18 +0000 (11:07 +0300)]
wifi: iwlwifi: mvm: fix removing pasn station for responder

In case of MLD operation the station should be removed using the
mld api.

Fixes: fd940de72d49 ("wifi: iwlwifi: mvm: FTM responder MLO support")
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230926110319.7eb353abb95c.I2b30be09b99f5a2379956e010bafaa465ff053ba@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: pcie: clean up WFPM control bits
Johannes Berg [Tue, 26 Sep 2023 08:07:17 +0000 (11:07 +0300)]
wifi: iwlwifi: pcie: clean up WFPM control bits

We define the same bit twice, remove the less precise
definition and use the better one instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230926110319.82d2744690b3.I90c08a27dca26a181dacb069184f39ece77849b5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: fix opmode start/stop race
Johannes Berg [Tue, 26 Sep 2023 08:07:16 +0000 (11:07 +0300)]
wifi: iwlwifi: fix opmode start/stop race

There's a race when the device is unbound (maybe because the
module is unloaded) while the opmode start hasn't finished yet.
The complete(request_firmware_complete) after the opmode start
was meant (and commented accordingly) to prevent this problem,
but it's not sufficient when the opmode module is loaded after
the firmware load already completed, which happens regularly
now because firmware load doesn't require userspace, unlike
module load.

Fix this by using the existing opmode registration mutex to
protected the start/stop flows against each other properly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230926110319.85951554fed8.I62f20f40d79d0f136fa05e46d7fc16dc437fa3db@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: skip opmode start retries on dead transport
Johannes Berg [Tue, 26 Sep 2023 08:07:15 +0000 (11:07 +0300)]
wifi: iwlwifi: skip opmode start retries on dead transport

These retries aren't going to succeed if the device was
deemed dead and needs to be unbound/rebound/... to be
recovered; skip the retries in that case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230926110319.9f472069d75d.Ib6684c5b2ea8ed98f082c9b0e9bb2b03c3ea4fe3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 months agowifi: iwlwifi: pcie: propagate iwl_pcie_gen2_apm_init() error
Johannes Berg [Tue, 26 Sep 2023 08:07:14 +0000 (11:07 +0300)]
wifi: iwlwifi: pcie: propagate iwl_pcie_gen2_apm_init() error

If iwl_pcie_gen2_apm_init() fails, we should propagate the
error code up, rather than ignoring it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230926110319.883768afe77b.Ic47cb8ce0a0abba3b4745cc2a721217c33360d6c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>