History log of /linux-master/drivers/net/wireless/intel/iwlwifi/fw/uefi.c
Revision Date Author Comments
# 74f4cd71 05-Feb-2024 Miri Korenblit <miriam.rachel.korenblit@intel.com>

wifi: iwlwifi: take SGOM and UATS code out of ACPI ifdef

The BIOS tables SGOM and UATS are read from UEFI, but require
additional tables (WGDS and DSM func 3, respectively) which used to be
read from ACPI only, so the code handling those tables had to be under
ifdef ACPI. But now the driver reads those tables (WGDS and DSM) from
both ACPI and UEFI, so SGOM and UATS code shouldn't be under ifdef ACPI
anymore.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240205211151.dcaa3325773f.I649079c842369dcae3a362842322deca422a61d5@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 3d801a75 04-Feb-2024 Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>

wifi: iwlwifi: Add support for PPAG cmd v5 and PPAG revision 3

Add support for
- PPAG revision 3 in BIOS to enable PPAG in UHB
- PPAG command version 5, this command allows OEM to control
enablement of PPAG for LPI for UHB mode in USA and ETSI countries.

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240204235836.d17425824b11.If2c1b29e3c579f4135383681af2d625cfe2cffcd@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# f29a8be8 06-Feb-2024 Dan Carpenter <dan.carpenter@linaro.org>

wifi: iwlwifi: return negative -EINVAL instead of positive EINVAL

The '-' character is missing in -EINVAL.

Fixes: fc7214c3c986 ("wifi: iwlwifi: read DSM functions from UEFI")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://msgid.link/f0391316-ab30-4664-96ac-03445ab2aeba@moroto.mountain
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# fc7214c3 01-Feb-2024 Miri Korenblit <miriam.rachel.korenblit@intel.com>

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>


# 20935f3e 01-Feb-2024 Miri Korenblit <miriam.rachel.korenblit@intel.com>

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>


# 669761e8 01-Feb-2024 Miri Korenblit <miriam.rachel.korenblit@intel.com>

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>


# 18f52365 01-Feb-2024 Miri Korenblit <miriam.rachel.korenblit@intel.com>

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>


# 084e0452 31-Jan-2024 Miri Korenblit <miriam.rachel.korenblit@intel.com>

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>


# bc8d0a45 31-Jan-2024 Miri Korenblit <miriam.rachel.korenblit@intel.com>

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>


# 427661e4 31-Jan-2024 Miri Korenblit <miriam.rachel.korenblit@intel.com>

wifi: iwlwifi: read SAR tables from UEFI

All the regulatory tables will be read from UEFI, and
only if it doesn't exist - they will be read from ACPI.
Read SAR tables (WRDS, EWRD and WGDS) from UEFI.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240131091413.533b687e1efb.Icb316291e593c8d53f41fdea2d083367dc97e3c4@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# a6dfe1e7 27-Jan-2024 Miri Korenblit <miriam.rachel.korenblit@intel.com>

wifi: iwlwifi: cleanup uefi variables loading

Extract the logic that is common to all variables loading
to a function.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240128084842.454f32c4bcfe.I4835fe657475ac28ef6aef4d292fac63c6ce9a34@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 4a9bb5b4 22-Oct-2023 Mukesh Sisodiya <mukesh.sisodiya@intel.com>

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>


# 372a7148 06-Jun-2023 Gregory Greenman <gregory.greenman@intel.com>

wifi: iwlwifi: pnvm: handle memory descriptor tlv

When PNVM is obtained from UEFI, there's an additional memory
descriptor TLV that has to be handled. It is the same TLV that
holds data in the reduced power tables. Also, in this TLV, the
actual data is located after address and size, so add the
corresponding offset.

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


# 8ae3e231 06-Jun-2023 Gregory Greenman <gregory.greenman@intel.com>

wifi: iwlwifi: fw: don't use constant size with efi.get_variable

Use efi.get_variable() with NULL pointer for data in order to
obtain entry size and then call it again with the correct size
to get the entry itself.

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


# 380bf72d 06-Jun-2023 Alon Giladi <alon.giladi@intel.com>

wifi: iwlwifi: Separate reading and parsing of reduce power table

It enables to better handle error cases. Also save the image till the
end of the loading and only then free it.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.71e3b3e0e794.Ifbe69ad99a7e805eb70e09280365821eb146b1c9@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# ea3571f4 06-Jun-2023 Alon Giladi <alon.giladi@intel.com>

wifi: iwlwifi: Use iwl_pnvm_image in reduce power tables flow

Generalize the parsing, loading, and setting of the power-reduce
tables, in order to support allocation of several DRAM payloads
in the future.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230606103519.564f1eead99b.Iaba653b21dc09aafc72b9bbb3928abddce0db50a@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# f4d4ba46 17-Apr-2023 Alon Giladi <alon.giladi@intel.com>

wifi: iwlwifi: fw: fix argument to efi.get_variable

We should pass the newly allocated data to fill.

Signed-off-by: Alon Giladi <alon.giladi@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230418122405.aaa6d8874442.I734841c71aad9564cb22c50f2737aaff489fadaf@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 09b4c35d 26-Jan-2023 Ayala Barazani <ayala.barazani@intel.com>

wifi: iwlwifi: mvm: Support STEP equalizer settings from BIOS.

Read the STEP equalizer parameters from the BIOS during init
and transfer it to the firmware.

This table provides values to configure an equalizer at the transmitter
that can be used to compensate for PCB channel attenuation.

Signed-off-by: Ayala Barazani <ayala.barazani@intel.com>
Link: https://lore.kernel.org/r/20230127002430.f25f871c5e17.I8390ab916c8f681229433ebc576ed37a594c6d30@changeid
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>


# 0c4bad7f 17-Jun-2022 Ard Biesheuvel <ardb@kernel.org>

iwlwifi: Switch to proper EFI variable store interface

Using half of the efivar API with locally baked efivar_entry instances
is not the right way to use this API, and these uses impede planned work
on the efivar layer itself.

So switch to direct EFI variable store accesses: we don't need the
efivar layer anyway.

Acked-by: Kalle Valo <kvalo@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>


# 86e8e657 28-Jan-2022 Johannes Berg <johannes.berg@intel.com>

iwlwifi: fix various more -Wcast-qual warnings

When enabling W=3 that gets us -Wcast-qual, fix those warnings
in the code and propagate constness properly, or cast it away
via (uintptr_t) where really needed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220128153014.4ac2f19c121e.Ied9469d93f8199206242bfba96e4e8d1949e3a08@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# c593d2fa 04-Dec-2021 Ayala Barazani <ayala.barazani@intel.com>

iwlwifi: support SAR GEO Offset Mapping override via BIOS

Support reading the SAR Geographic Offset Mapping (SGOM) table from UEFI
to allow OEMs to override the values according to geographical regions.

Signed-off-by: Ayala Barazani <ayala.barazani@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211204174546.e6dfd8b5dd40.Ibc9a8fe2bfde345f49df5d57ec56663da6a53dc4@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# a571bc28 11-Nov-2021 Christophe JAILLET <christophe.jaillet@wanadoo.fr>

iwlwifi: Fix memory leaks in error handling path

Should an error occur (invalid TLV len or memory allocation failure), the
memory already allocated in 'reduce_power_data' should be freed before
returning, otherwise it is leaking.

Fixes: 9dad325f9d57 ("iwlwifi: support loading the reduced power table from UEFI")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1504cd7d842d13ddb8244e18004523128d5c9523.1636615284.git.christophe.jaillet@wanadoo.fr


# e4457a45 20-Aug-2021 Randy Dunlap <rdunlap@infradead.org>

iwlwifi: fix printk format warnings in uefi.c

The kernel test robot reports printk format warnings in uefi.c, so
correct them.

../drivers/net/wireless/intel/iwlwifi/fw/uefi.c: In function 'iwl_uefi_get_pnvm':
../drivers/net/wireless/intel/iwlwifi/fw/uefi.c:52:30: warning: format '%zd' expects argument of type 'signed size_t', but argument 7 has type 'long unsigned int' [-Wformat=]
52 | "PNVM UEFI variable not found %d (len %zd)\n",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53 | err, package_size);
| ~~~~~~~~~~~~
| |
| long unsigned int
../drivers/net/wireless/intel/iwlwifi/fw/uefi.c:59:29: warning: format '%zd' expects argument of type 'signed size_t', but argument 6 has type 'long unsigned int' [-Wformat=]
59 | IWL_DEBUG_FW(trans, "Read PNVM from UEFI with size %zd\n", package_size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~
| |
| long unsigned int

Fixes: 84c3c9952afb ("iwlwifi: move UEFI code to a separate file")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Kalle Valo <kvalo@codeaurora.org>
Cc: Luca Coelho <luciano.coelho@intel.com>
Cc: linux-wireless@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210821020901.25901-1-rdunlap@infradead.org


# 1476ff21 06-Sep-2021 Linus Torvalds <torvalds@linux-foundation.org>

iwl: fix debug printf format strings

The variable 'package_size' is an unsigned long, and should be printed
out using '%lu', not '%zd' (that would be for a size_t).

Yes, on many architectures (including x86-64), 'size_t' is in fact the
same type as 'long', but that's a fairly random architecture definition,
and on some platforms 'size_t' is in fact 'int' rather than 'long'.

That is the case on traditional 32-bit x86. Yes, both types are the
exact same 32-bit size, and it would all print out perfectly correctly,
but '%zd' ends up still being wrong.

And we can't make 'package_size' be a 'size_t', because we get the
actual value using efivar_entry_get() that takes a pointer to an
'unsigned long'. So '%lu' it is.

This fixes two of the i386 allmodconfig build warnings (that is now an
error due to -Werror).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 9dad325f 21-Jun-2021 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: support loading the reduced power table from UEFI

This new feature allows OEMs to set a special reduced power table in a
UEFI variable, which we use to tell the firmware to change the TX
power tables.

Read the variable and store it in a dram block to pass it to the
firmware. We do this as part of the PNVM loading flow.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210621103449.259a33ba5074.I2e0bb142d2a9c412547cba89b62dd077b328fdc4@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 84c3c995 21-Jun-2021 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: move UEFI code to a separate file

We are going to read more variables from UEFI, so it's cleaner to have
all the code that handles UEFI variables in a separate file.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210621103449.c705ac86f2e9.Ia7421c17fe52929e4098b4f0cf070809ed3ef906@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>