Commit graph

1249229 commits

Author SHA1 Message Date
Ping-Ke Shih 9c66da3b19 wifi: rtw89: rfk: add H2C command to trigger IQK
IQ signal calibration is a basic and important calibration to yield good RF
performance. Do this calibration on AP channel if we are going to connect.
During scanning phase, it transmits with low data rate, so without IQK
RF performance is still acceptable.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240202030642.108385-4-pkshih@realtek.com
2024-02-06 20:05:22 +02:00
Ping-Ke Shih 80f47f82f3 wifi: rtw89: rfk: send channel information to firmware for RF calibrations
We are going to do RF calibrations in firmware, so driver needs to provide
channel information for calibrations, which can do the same things as
they did in driver.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240202030642.108385-3-pkshih@realtek.com
2024-02-06 20:05:22 +02:00
Ping-Ke Shih ad1c86e926 wifi: rtw89: rfk: add a completion to wait RF calibration report from C2H event
The RF calibrations should be executed one by one, so add a completion
to ensure one is finish before next. The report from C2H event contains
state and optional version, and we only check the state for now. We also
care about the time a RF calibration takes, so record start time before
asking firmware to do calibration and get the delta time when receiving
report.

Consider SER recovery, we can't receive C2H event, use half of argument
'ms' as fixed delay that is 2 times of measured maximum time of
calibrations.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240202030642.108385-2-pkshih@realtek.com
2024-02-06 20:05:21 +02:00
David Lechner bed41a3444 wifi: wilc1000: remove setting msg.spi
Calling spi_sync() unconditionally sets the spi field of struct
spi_message. Therefore setting msg.spi = spi before calling spi_sync()
has no effect and can be removed.

(spi_message_add_tail() does not access this field.)

Signed-off-by: David Lechner <dlechner@baylibre.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240201201248.2334798-2-dlechner@baylibre.com
2024-02-05 20:17:48 +02:00
Linus Walleij 2719a9e715 wifi: cw1200: Convert to GPIO descriptors
The CW1200 uses two GPIOs to control the powerup and reset
pins, get these from GPIO descriptors instead of being passed
as platform data from boardfiles.

The RESET line will need to be marked as active low as we will
let gpiolib handle the polarity inversion.

The SDIO case is a bit special since the "card" need to be
powered up before it gets detected on the SDIO bus and
properly probed. Fix this by using board-specific GPIOs
assigned to device "NULL".

There are currently no in-tree users.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240131-descriptors-wireless-v1-6-e1c7c5d68746@linaro.org
2024-02-05 20:17:10 +02:00
Linus Walleij d8da5a2138 wifi: plfxlc: Drop unused include
The driver includes the legacy GPIO header <linux/gpio.h>
but does not use any symbols from it. Drop the include.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240131-descriptors-wireless-v1-5-e1c7c5d68746@linaro.org
2024-02-05 20:17:10 +02:00
Linus Walleij 163857d995 wifi: mwifiex: Drop unused headers
The mwifiex driver include two legacy GPIO headers but does
not use symbols from any of them.

The driver does contain some "gpio" handling code, but this
is some custom GPIO interface, not the Linux GPIO.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240131-descriptors-wireless-v1-4-e1c7c5d68746@linaro.org
2024-02-05 20:17:10 +02:00
Linus Walleij b303de763b wifi: brcmsmac: Drop legacy header
The driver is using all the modern abstractions to obtain and use
GPIOs and the legacy <linux/gpio.h> header is unused, so drop it.

Fixes: a8e59744e1 ("gpiolib: split linux/gpio/driver.h out of linux/gpio.h")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240131-descriptors-wireless-v1-3-e1c7c5d68746@linaro.org
2024-02-05 20:17:10 +02:00
Linus Walleij 04e9c8af8b wifi: ti: wlcore: sdio: Drop unused include
The file is including the legacy GPIO header <linux/gpio.h> but
is not using any symbols from it, drop the header.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240131-descriptors-wireless-v1-2-e1c7c5d68746@linaro.org
2024-02-05 20:17:09 +02:00
Kalle Valo 7ceade6534 wifi: cw1200: fix __le16 sparse warnings
Sparse warns:

drivers/net/wireless/st/cw1200/cw1200_spi.c:83:17:    got restricted __le16 [usertype]
drivers/net/wireless/st/cw1200/cw1200_spi.c:148:17: warning: incorrect type in assignment (different base types)
drivers/net/wireless/st/cw1200/cw1200_spi.c:148:17:    expected unsigned short [addressable] [assigned] [usertype] regaddr
drivers/net/wireless/st/cw1200/cw1200_spi.c:148:17:    got restricted __le16 [usertype]

These cpu_to_le16() calls are not really making any sense to me. On a big
endian system we first convert regaddr from big to little using cpu_to_le16()
but immediately after we convert them back to big endian? So just remove them.

Compile tested only.

Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240130151556.2315951-4-kvalo@kernel.org
2024-02-05 20:16:29 +02:00
Kalle Valo 0583e5acaf wifi: rsi: fix restricted __le32 degrades to integer sparse warnings
drivers/net/wireless/rsi/rsi_91x_usb.c:235:27: warning: restricted __le32 degrades to integer
drivers/net/wireless/rsi/rsi_91x_usb.c:236:27: warning: restricted __le32 degrades to integer
drivers/net/wireless/rsi/rsi_91x_usb.c:237:27: warning: restricted __le32 degrades to integer
drivers/net/wireless/rsi/rsi_91x_usb.c:238:27: warning: restricted __le32 degrades to integer
drivers/net/wireless/rsi/rsi_91x_usb.c:244:36: warning: restricted __le32 degrades to integer
drivers/net/wireless/rsi/rsi_91x_usb.c:245:35: warning: restricted __le32 degrades to integer

These cpu_to_le32() are not making sense. With usb_reg_buf we handle the values
byte at a time to make sure usb_reg_buf is in little endian so no need to
convert anything. And usb_control_msg() expects to have the values in native
endian anyway. So just remove these so they are not spamming our logs.

Compile tested only.

Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240130151556.2315951-3-kvalo@kernel.org
2024-02-05 20:16:29 +02:00
Kalle Valo 2b59c9c30b wifi: zd1211rw: remove __nocast from zd_addr_t
Sparse warns:

drivers/net/wireless/zydas/zd1211rw/zd_usb.c:383:24: warning: implicit cast from nocast type
drivers/net/wireless/zydas/zd1211rw/zd_usb.c:419:24: warning: implicit cast from nocast type

This is an ancient driver which has not have any meaningfuli changes for a long
time and hopefully removed soon. So just remove the __nocast to get rid of the
sparse warnings.

Compile tested only.

Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240130151556.2315951-2-kvalo@kernel.org
2024-02-05 20:16:28 +02:00
Chun Qiu 1209f487d4 wifi: rtl8xxxu: Add TP-Link TL-WN823N V2
TP-Link TL-WN823N V2 (2357:0135) is based on rtl8192fu and has been
tested to work with the rtl8xxxu driver.

Signed-off-by: Chun Qiu <cqca@cock.lu>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240129053030.16369-1-cqca@cock.lu
2024-02-05 20:15:52 +02:00
Zhipeng Lu 5f0e4aede0 wifi: libertas: fix some memleaks in lbs_allocate_cmd_buffer()
In the for statement of lbs_allocate_cmd_buffer(), if the allocation of
cmdarray[i].cmdbuf fails, both cmdarray and cmdarray[i].cmdbuf needs to
be freed. Otherwise, there will be memleaks in lbs_allocate_cmd_buffer().

Fixes: 876c9d3aeb ("[PATCH] Marvell Libertas 8388 802.11b/g USB driver")
Signed-off-by: Zhipeng Lu <alexious@zju.edu.cn>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://msgid.link/20240126075336.2825608-1-alexious@zju.edu.cn
2024-02-05 20:15:27 +02:00
Johannes Berg 679dd27b4e wifi: cfg80211: fix kunit exports
These can only be exported if cfg80211's kunit is enabled,
since they're otherwise static. kunit itself can be enabled
even if cfg80211's kunit isn't. Fix that by using the right
macro.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202402040534.6AEKtZ7Y-lkp@intel.com/
Fixes: 45d43937a4 ("wifi: cfg80211: add a kunit test for 6 GHz colocated AP parsing")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-04 11:03:39 +01:00
Johannes Berg 6256760f37 wifi: iwlwifi: mvm: fix warnings from dmi_get_system_info()
dmi_get_system_info() will statically return NULL when the
kernel is compiled without CONFIG_DMI, leading to compiler
warnings. Fix that by printing "<unknown>" in that case.

Fixes: c3f40c3e02 ("iwlwifi: mvm: add US/CA to TAS block list if OEM isn't allowed")
Fixes: 9457077df4 ("wifi: iwlwifi: mvm: Add debugfs to get TAS status")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-04 10:58:54 +01:00
Johannes Berg 4c60c8054d wifi: iwlwifi: fw: fix compiler warning for NULL string print
When the system is compiled without CONFIG_DMI, the function
here statically returns NULL, leading to a compiler warning.
Catch that and print "<unknown>" in that case.

While at it, fix some indentation in the function.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202402030641.zUTuACYV-lkp@intel.com/
Fixes: 09059c6764 ("wifi: iwlwifi: prepare for reading PPAG table from UEFI")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-04 10:53:18 +01:00
Johannes Berg 5f9c1f8f9a wifi: iwlwifi: fw: fix compile w/o CONFIG_ACPI
The user of this function passes a pointer to a value that
doesn't exist when compiled w/o CONFIG_ACPI. Since we don't
need the value then, make the non-ACPI version a macro to
allow it to still build.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202402031454.syX4cSGN-lkp@intel.com/
Fixes: c4c9545477 ("wifi: iwlwifi: implement WPFC ACPI table loading")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-04 10:49:56 +01:00
Shaul Triebitz 5932ad8782 wifi: iwlwifi: mvm: make functions public
In the following patch, iwl_mvm_roc_duration_and_delay and
iwl_mvm_roc_add_cmd will be called also from time-event.c.
Move then there (where they more belong) and make then
public.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240201155157.3edafc4d59aa.Ic68e90758bcad9ae00e0aa602101842dac60e1a1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:28 +01:00
Miri Korenblit 12e1a6a5b0 wifi: iwlwifi: bump FW API to 88 for AX/BZ/SC devices
Start supporting API version 88 for new devices.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240201155157.e35556d3f956.I6543857041a33e2b35e67eecf648c9cc6972e60a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:28 +01:00
Emmanuel Grumbach c1b393a7dc wifi: iwlwifi: mvm: don't send BT_COEX_CI command on new devices
AX210 and above have this logic offloaded in the firmware and it just
ignores the command coming from the driver.
Stop sending it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240201155157.4e3e0b52f98b.I7e9481050921d95c38f5a21ccc47112b3698e859@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:28 +01:00
Miri Korenblit fc7214c3c9 wifi: iwlwifi: read DSM functions from UEFI
For each DSM function, try to first read it from the UEFI.
If the UEFI WIFI GUID is unclocked, or the DSM function in
UEFI is invalid/unavailable - read it from ACPI.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240201155157.27dd626ce2bd.Ib90bab74a9d56deb2362edb712294360e4ddae5b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:27 +01:00
Miri Korenblit dc4fe7500e wifi: iwlwifi: prepare for reading DSM from UEFI
Move all the common items (functions, enumerations and mcaros)
to regulatory.h/c files, and rename it to a common name.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240201155157.eae9bcbc0023.If1175f3143d6369076669ddd5d6ad4df0ee00659@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:27 +01:00
Miri Korenblit 091d89428f wifi: iwlwifi: simplify getting DSM from ACPI
As DSMs are going to be read from UEFI too, we need a unified API
to get DSMs for both ACPI and UEFI.

The difference in getting DSM in each one of these methods (ACPI, UEFI)
is in the GUID, revision (0 for ACPI, 4 for UEFI), and size of the DSM
values (8 or 32 for ACPI, 32 for UEFI).

Therefore, change the iwl_acpi_get_dsm_x() to iwl_acpi_get_dsm() which
determines the GUID, revision (these two are the same for all WiFi DSMs),
and size (based on a func-to-size mapping) internally.

While at it, fix DSM_FUNC_RFI_CONFIG to expect a 32-bit value
(as defined in Intel BIOS spec) and not a 8-bit one.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240201155157.1bcd7072a7a5.I344ee0a11abbc27da0c693187d1b8bee653aaeef@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:27 +01:00
Miri Korenblit b97ada404c wifi: iwlwifi: take send-DSM-to-FW flows out of ACPI ifdef
These functions shouldn't be ACPI_CONFIG dependent, as they don't
access the ACPI. The functions that really access ACPI -
already handle the case that CONFIG_ACPI is not set.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240201155157.1412e6d561f8.I84f67478d01b576457e1bf489fbcb044adfda6fe@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:27 +01:00
Miri Korenblit dc2b94a111 wifi: iwlwifi: rfi: use a single DSM function for all RFI configurations
RFI configuration moved from internal guid to the wifi guid, DSM
function 11. Update reading RFI configuration from BIOS.

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240201155157.f4e62435310d.I4f9b6860dd8e3c7ae1f816be5ff8b5967eee266f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:27 +01:00
Miri Korenblit 20935f3e64 wifi: iwlwifi: read ECKV table from UEFI
Try to read the ECKV table from UEFI first,
and if the WIFI UEFI tables are unlocked or the
table doesn't exist - try to read it from ACPI.

Change iwl_acpi_get_eckv() to receive fwrt as argument so
it will be the same as all iwl_acpi_get_x() functions,
so it could  be generated by the macro.

While at it - move the reading of ECKV to INIT stage. There is no
reason to read it each time we load the FW.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240201155157.d4937cc00727.I36e5fc7f7850229b9b377c80b5203aa47137c97c@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:27 +01:00
Miri Korenblit 669761e897 wifi: iwlwifi: read WRDD table from UEFI
Try to read the WRDD table from UEFI first,
and if the WIFI UEFI tables are unlocked or the
table doesn't exist - try to read it from ACPI.

Change iwl_acpi_get_mcc() to receive fwrt as argument so
it will be the same as all iwl_acpi_get_x() functions,
so it could be generated by the macro.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240201155157.5d52eeb109f7.I4d81700a7ae7fe2dfee14e363de358be59de7823@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:27 +01:00
Shaul Triebitz 4dde4ff0ea wifi: iwlwifi: support link command version 2
In version 2, listen_lmac becomes reserved.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240201155157.df1890aba2fd.Icad9ba10f8bab770adc6a559b2c7bff5cccbffe9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:27 +01:00
Ayala Beker dd273e8a22 wifi: iwlwifi: mvm: use fast balance scan in case of an active P2P GO
Set fast balance scan in case of active P2P GO, regardless of the
BSS DTIM interval.
This will increase the chances of scheduler to successfully schedule
out-of-channel events.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240201155157.310a00388e11.Ib136140dffa8704e68ff14e8fb69d35b97057171@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:26 +01:00
Emmanuel Grumbach 61ff84440c wifi: iwlwifi: mvm: don't send NDPs for new tx devices
New tx devices may have issues sending NDPs from the host.
Send a CQM event instead. If the AP is really gone, we will get a beacon
loss and disconnect.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Reviewed-by: Berg, Johannes <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240201155157.e95d53448e94.I0ec92f1ca56a62cd8c13390b9fe60e9a7e9411c7@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:26 +01:00
Miri Korenblit 18f523654d wifi: iwlwifi: read SPLC from UEFI
Try to read the SPLC table from UEFI first,
and if the WIFI UEFI tables are unlocked or the
table doesn't exist - try to read it from ACPI

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240201155157.3d9d835b6edb.I7ea262df9431ced787b77c87149c6d7bddb7e7d6@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:26 +01:00
Miri Korenblit a51d1cf5ad wifi: iwlwifi: prepare for reading SPLC from UEFI
As the iwl_bios_get_x() functions are now generated using a macro,
and this macro requires the all iwl_acpi_get_x() to have the same
prototype, change iwl_acpi_get_pwr_limit() to return a int
and the actuall power limit will be filled in a pointer function
parameter.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240201155157.4cce81198afe.Ice8b1b97a68da9ec7b5a4799ddb668642198e1af@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:37:26 +01:00
Johannes Berg f74f397afe wifi: iwlwifi: api: clean up some kernel-doc/typos
Add some kernel-doc for a union, and fix a couple of typos
I noticed looking through this.

Link: https://msgid.link/20240131220227.7fd507f09bb1.I278edc9a3d5de7fddcd84009a93c494c42686b68@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:34:10 +01:00
Johannes Berg 3ec064e0a2 wifi: iwlwifi: remove unused function prototype
Saw this while going through the code, this function
hasn't existed for a while now; remove it.

Link: https://msgid.link/20240131220039.6fdb8cbf4814.I6c46065b836cafd93df676dd88c99a626a25bf46@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:33:01 +01:00
Emmanuel Grumbach d10fb5ecc8 iwlwifi: fw: fix more kernel-doc warnings
Fix some more kernel-doc warnings in FW API definitions.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Link: https://msgid.link/20240131213817.9f30c6529216.I69e98612c6c81cf1b7bd480d8041b5d3e25610d3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:32:19 +01:00
Miri Korenblit b341590e77 wifi: mac80211: don't allow deactivation of all links
The set_active_links API is intended for link switching, so switching
to no links at all is not supported.
Add a warning to check that.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240129200054.e3c113f94508.Ia35f927f914bf98dd8f9350dd4f78b1d901b1c1d@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:20:43 +01:00
Miri Korenblit 358ddc7bfa wifi: mac80211_hwsim: enable all links only in MLO
The existing code is enabling all usable links when moving to
authorized state, but this should happen only for MLO connections.
Fix this.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240129200054.f5459f6c29c8.I397814449e17950fcf882ef44a1e790a71aa1dce@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:20:43 +01:00
Johannes Berg 57d1b4632e wifi: nl80211: move WPA version validation to policy
For a contiguous mask (starting with bit 0) of allowed values
in a bitmap, it's equivalent to check "!(val & ~mask)" and
"val ∈ [0, mask]". Use that to move the WPA versions check to
the policy, for better error reporting.

Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://msgid.link/20240129195421.e8cae9866ccb.I2539b395e3476307d702c6867e51a937e52e57a0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:20:43 +01:00
Johannes Berg 392d3dfdfd wifi: mac80211: clean up FILS discovery change flags handling
It doesn't make sense to return BSS change flags in an int, as
they're a bigger type. For this particular function it still
works OK, but clean it up to avoid future errors (or copying
this code in a broken way.)

Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://msgid.link/20240129195739.e340a7d5e7c6.I1dfcca32d43dce903494a2c474844491682671b4@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:20:42 +01:00
Johannes Berg f455f5ad50 wifi: mac80211: trace SMPS requests from driver
Even if there are a lot of possible ways drivers might
call this, at least knowing when they do and with what
settings can be useful. Add tracing for it.

Link: https://msgid.link/20240129195435.b20d2ead2013.I8213e65c274451d523a3397519ac578c3ed2df4d@changeid
[removed link-id contortions as suggested by Jeff]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:20:42 +01:00
Johannes Berg 7d366663b7 wifi: mac80211_hwsim: add control to skip beacons
To test certain beacon loss scenarios it can be useful to
simply not send a couple of beacons. Add a simple debugfs
file (per vif) to skip sending the beacons. They're still
fully prepared etc. so their DTIM count etc. will appear
as if they were simply corrupt over the air or otherwise
not received.

Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://msgid.link/20240129200001.a267383709e6.I36f427d17c3478a7df46e205716f5ebc9b35a918@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:20:42 +01:00
Miri Korenblit 084e0452a4 wifi: iwlwifi: read WTAS table from UEFI
Try to read the WTAS table from UEFI first,
and if the WIFI UEFI tables are unlocked or the
table doesn't exist - try to read it from ACPI.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240131091413.45e6ff7b5063.Id3aec70887e14533b10d564f32c0cf5f2a14b792@changeid
[move uefi_tables_lock_status outside ifdef to fix build errors]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:20:26 +01:00
Miri Korenblit 3bc67e7c18 wifi: iwlwifi: separate TAS 'read-from-BIOS' and 'send-to-FW' flows
Currently the TAS 'read-from-BIOS' flow receives the command struct
and the version of it as read from FW TLVs, and fills the command
accordingly.
This seems wrong, we should have the 'read-from-BIOS' flow
(iwl_acpi_get_tas in iwlwifi) reading/parsing/validating the table from
BIOS, and the 'send-to-FW' flow (iwl_mvm_tas_init) doing
all the FW versioning checks and cmd filling.
Move the cmd filling to the 'send-to-fw' flow.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240131091413.24df27772a71.I57b702af4feb3f38dc21d52593c25de4b1999e4b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:15:15 +01:00
Miri Korenblit ad5a85d8fd wifi: iwlwifi: prepare for reading TAS table from UEFI
We are going to support reading BIOS tables from UEFI
too, Refactor the TAS table flow:

1. Rename and move the common code to the regulatory.h/c files.
2. Remove the IWL_TAS_BLOCK_LIST_MAX, as we can use IWL_WTAS_BLACK_LIST_MAX
   instead.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240131091413.0c2197cf1feb.Ib0e83d5bd3f4d5cfa9c3d2925317ba49377d257f@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:15:15 +01:00
Miri Korenblit e1c54d6377 wifi: iwlwifi: don't check TAS block list size twice
Currenltly we check the validity of this variable twice.
Remove the second check.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240131091413.2234490624c4.I6399b652a3c83afff1b0b5f114604d15892ee01e@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:15:15 +01:00
Miri Korenblit bc8d0a4528 wifi: iwlwifi: read PPAG table from UEFI
Try to read the PPAG table from UEFI first,
and if the WIFI UEFI tables are unlocked or the
table doesn't exist - try to read it from ACPI

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240131091413.6516da09aec1.I0dcaf0b6d8857417ba1318467a28da5d0d7d7f27@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:15:15 +01:00
Miri Korenblit 8408e83e16 wifi: iwlwifi: validate PPAG table when sent to FW
We used to check enablement/validity of the PPAG table while reading
it from BIOS.
For newer FWs this checks were offloaded, and the driver needs
to send the PPAG table anyway.
The desicion whether the table needs to be validated before sending it
is FW related and shouln't be in 'read-from-bios' flow.
Move it to 'send-to-fw' flow instead.
This will also help to avoid code duplication of checking validity in
both ACPI and UEFI caes.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240131091413.7043b4087dda.I5a189f9a349556b84a79597fe1e46ffa93664df9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:15:15 +01:00
Miri Korenblit 09059c6764 wifi: iwlwifi: prepare for reading PPAG table from UEFI
As PPAG table is going to be read from UEFI, there are some
cleanups required:
Move functions/definitions that are common to both UEFI and ACPI to
regulatory.h/c.
In addition, rename the functions/macros names so it will be clear which
one is ACPI specific, and which is common for ACPI and UEFI.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240131091413.25623670b422.I8132af7517e4faf0ea8cbeb2efe9651edd319b98@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:15:15 +01:00
Miri Korenblit be3a8cbb1c wifi: iwlwifi: small cleanups in PPAG table flows
1. The name of iwl_read_ppag_table is misleading, as this function only
   fills the command structure from the previously read table. Rename it.
2. Don't initialize fwrt::ppag_flags to 0 as the entire fwrt is zeroed
   in the INIT stage anyway.
3. Don't filter out the reserved bits from fwrt::ppag_flags when printing
   it, as it is already done in 'read-from-bios' flow.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240131091413.48acf340e817.I810e457b80015c1931d96d3e13c849f0339723c3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02 14:15:14 +01:00