summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/fw/uefi.c
AgeCommit message (Collapse)Author
2023-10-23wifi: iwlwifi: fw: Add support for UATS table in UHBMukesh Sisodiya
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>
2023-06-06wifi: iwlwifi: pnvm: handle memory descriptor tlvGregory Greenman
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>
2023-06-06wifi: iwlwifi: fw: don't use constant size with efi.get_variableGregory Greenman
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>
2023-06-06wifi: iwlwifi: Separate reading and parsing of reduce power tableAlon Giladi
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>
2023-06-06wifi: iwlwifi: Use iwl_pnvm_image in reduce power tables flowAlon Giladi
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>
2023-04-20wifi: iwlwifi: fw: fix argument to efi.get_variableAlon Giladi
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>
2023-01-30wifi: iwlwifi: mvm: Support STEP equalizer settings from BIOS.Ayala Barazani
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>
2022-06-20iwlwifi: Switch to proper EFI variable store interfaceArd Biesheuvel
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>
2022-02-18iwlwifi: fix various more -Wcast-qual warningsJohannes Berg
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>
2021-12-16Merge tag 'iwlwifi-next-for-kalle-2021-12-08' of ↵Kalle Valo
git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next first set of iwlwifi patches for v5.17 * A few mei fixes; * Some improvements in D3; * Support for new FW API commands; * Fixes and cleanups in device configurations; * Support some new FW API command versions; * Fix WGDS revision 3 reading bug; * Some firmware debugging improvements; * Fixes for in device configuration structures; * Improvements in the session protection code; * Support SAR GEO Offset Mapping (SGOM) via BIOS; * Continued work on the new Bz device family; * Some more firmware debugging improvements; * Support new FW API version 68; * Add some new device IDs; * Some other small fixes, clean-ups and improvements.
2021-12-07iwlwifi: support SAR GEO Offset Mapping override via BIOSAyala Barazani
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>
2021-11-22iwlwifi: Fix memory leaks in error handling pathChristophe JAILLET
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
2021-09-06iwl: fix debug printf format stringsLinus Torvalds
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>
2021-06-22iwlwifi: support loading the reduced power table from UEFILuca Coelho
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>
2021-06-22iwlwifi: move UEFI code to a separate fileLuca Coelho
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>