History log of /linux-master/drivers/net/wireless/intel/iwlwifi/fw/acpi.h
Revision Date Author Comments
# 5f9c1f8f 04-Feb-2024 Johannes Berg <johannes.berg@intel.com>

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: c4c954547755 ("wifi: iwlwifi: implement WPFC ACPI table loading")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


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

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>


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

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>


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

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>


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

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>


# 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>


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

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>


# 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>


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

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>


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

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>


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

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>


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

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>


# 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>


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

wifi: iwlwifi: prepare for reading SAR tables from UEFI

The driver will support reading BIOS tables from UEFI
too. Refactor the SAR tables (WRDS, EWRD, WGDS) flows:

1. Move all the SAR logic/definitions that is common to both
UEFI and ACPI to a new file - regulatory.h/c.
2. Rename the relevant functions/definitions
so it will be clear which is ACPI specific and which is
for both ACPI and UEFI
3. Rename the function that copies the stored tables into the different
commands structures, so will be clear what these functions do.

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


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

wifi: iwlwifi: implement GLAI ACPI table loading

All the regulatory tables from BIOS are going to be loaded
(preferably) from the UEFI instead of the ACPI.
There is a security issue with the fact that anyone can
add these UEFI variables.
The solution for that is to have a lock for all WIFI GUID UEFI
variables, and only if the UEFI variables are locked then we can
read it.
The status of the lock (unlocked, locked, test mode) is indicated
in a ACPI table: Guid Lock ACPI Indicator.
Load this table so the driver knows whether to read from UEFI or
not

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


# 296f3e92 27-Jan-2024 Johannes Berg <johannes.berg@intel.com>

wifi: iwlwifi: acpi: fix WPFC reading

The code reading the WPFC table needs to take into account
the domain type (first element in the package), shouldn't
leak the memory if it fails, and has a bad comment. Fix all
these issues.

Fixes: c4c954547755 ("wifi: iwlwifi: implement WPFC ACPI table loading")
Reported-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman Gregory <gregory.greenman@intel.com>
Link: https://msgid.link/20240128084842.2afeb476b62d.I200568dc42a277e21c12be99d5aaa39b009d45da@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# c8e01fe0 11-Oct-2023 Alon Giladi <alon.giladi@intel.com>

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>


# 2f199ba8 21-Sep-2023 Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>

wifi: iwlwifi: implement enable/disable for China 2022 regulatory

China 2022 regulations are enabled by default. Disable only when
disabled in BIOS or the firmware don't support this capability. If the
firmware has this capability, read BIOS configuration data in
function 4 using ACPI API and send GRP_REGULATORY_LARI_CONFIG_CHANGE_CMD
to the firmware. Any error while reading BIOS data results in enablement
of china 2022 regulations.

Signed-off-by: Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Link: https://lore.kernel.org/r/20230921110726.ba7cb3003e53.If5a180a59ee85ed4a4c9146cfeff841c25b81066@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# c4c95454 13-Jun-2023 Johannes Berg <johannes.berg@intel.com>

wifi: iwlwifi: implement WPFC ACPI table loading

We skipped this in the past, but now we will need it for some
platforms. Implement loading the PHY filter configuration IDs
from the WPFC ACPI table. Note that the firmware must also be
aware of the right filter configuration IDs (they're just the
IDs of a filter configuration, not the actual configuration).

Remove the useless hardcoded zeroes while at 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/20230614123447.035026ea3169.I3a1fc1fe644fefa0d818ee1926c5fc331d68e8a3@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>


# 09396a4f 13-Jun-2023 Johannes Berg <johannes.berg@intel.com>

wifi: iwlwifi: fw: make some ACPI functions static

iwl_acpi_get_wifi_pkg_range(), iwl_acpi_get_wifi_pkg() and
iwl_acpi_get_object() need not be exported etc., they're used
only within the same file. Make them static.

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


# e8e10a37 04-Mar-2022 Matt Chen <matt.chen@intel.com>

iwlwifi: acpi: move ppag code from mvm to fw/acpi

Move the ppag code to fw/acpi to keep consistency
with the other ACPI handling we do.

Signed-off-by: Matt Chen <matt.chen@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20220304131517.7f250088b443.I61e64c2758ad178da729ce00428287cc94430eed@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# b0aa02b3 04-Mar-2022 Ayala Barazani <ayala.barazani@intel.com>

iwlwifi: mvm: add a flag to reduce power command.

Add a flags bitfield in REDUCED_TX_POWER_CMD, and
send it as is to FW.

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.20220304131517.55c2f014f5ee.Iceb632f620de959800f979e212f0dc20240f9d38@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 8f323d06 05-Feb-2022 Ayala Barazani <ayala.barazani@intel.com>

iwlwifi: mvm: Disable WiFi bands selectively with BIOS

The BIOS can contain data about sets of disabled channels.
Pass the bitmap to the firmware if present.

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.20220205112029.9e6d9209293d.If5b22a9afe5f9dac9c7c45e68e494ffce4df8910@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 6da7ba3a 28-Jan-2022 Ayala Barazani <ayala.barazani@intel.com>

iwlwifi: mvm: allow enabling UHB TAS in the USA via ACPI setting

Read a new bit defined in ACPI WTAS that allows OEMs to specify whether
TAS is allowed in UHB (6-7GHz) in the USA. This can be used by OEMs
that got certified to use this feature.

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.20220128153014.1d2ae1e6bcdb.I177929ed01ed7bf4614ea0f6db2af9e52de13316@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 8bdc52b9 18-Dec-2021 Miri Korenblit <miriam.rachel.korenblit@intel.com>

iwlwifi: mvm: always store the PPAG table as the latest version.

In case of a conflict between BIOS version and FW
version of the PPAG table - the values arrive in the FW in the wrong
places. This happens because we're storing the table in different
structures depending on the BIOS version, not on the FW version,
and so the FW doesn't get what it expect to.
Always store the table in a v2 structure (which is a superset
of v1 and v0).

Also store the table in a structured way and in it's own structure,
rather then storing it in the ppag command structure, similarly to
the WRDS, EWRD and WGDS tables.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211219121514.793a509da7bd.Ia176746a28b816b5f788cce9a281139735909e2a@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 7c530588 10-Dec-2021 Miri Korenblit <miriam.rachel.korenblit@intel.com>

iwlwifi: mvm: support revision 1 of WTAS table

A new revision of WTAS was added in order to support
IEC optimisation. Add support for reading the new revision from ACPI and
passing it to the FW.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211210090244.ff455b9d66bd.Ic7c1460e89f6b22101f3c5a2ea438031c7f11771@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 698b166e 24-Oct-2021 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: mvm: read 6E enablement flags from DSM and pass to FW

We need to call a new DSM function and pass the values to the firmware
in order to allow enablement of 6E support by the OEMs via ACPI.

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


# 97f8a3d1 24-Oct-2021 Ayala Barazani <ayala.barazani@intel.com>

iwlwifi: ACPI: support revision 3 WGDS tables

There's a new revision of the WGDS table with more data,
and corresponding firmware API to pass it through. Add
support for both.

Since we now support 4 different versions, make a table
to load them instead of hard-coding it all.

Signed-off-by: Ayala Barazani <ayala.barazani@intel.com>
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.20211024165252.2f9b8e304f25.If88d2d1309270e659d4845c5b5c22d5e8d8e2caf@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 1f578d4f 17-Oct-2021 Miri Korenblit <miriam.rachel.korenblit@intel.com>

iwlwifi: mvm: Read acpi dsm to get channel activation bitmap

Read the bitmap from the ACPI and pass it to he FW
through LARI_CONFIG_CHANGE_CMD.

This allows OEMs to override channel state to active
as per Geo Location bitmap.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211017165728.23d4f2d182c0.I39ac5ff74ac6f2223f393657205eddc1c8e48890@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 664c011b 05-Aug-2021 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: acpi: support reading and storing WGDS revision 2

Revisions 0 and 1 are identical, so we were already supporting that.
But revision 2 has a different size, so we have to try to read them
separately.

Add support for this new revision.

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


# 78a19d52 05-Aug-2021 Miri Korenblit <miriam.rachel.korenblit@intel.com>

iwlwifi: mvm: Read the PPAG and SAR tables at INIT stage

We used to read the PPAG, WRDS, EWRD, WGDS tables from ACPI
in the load stage only. This prevented vendor commands from
being executed before bringing the interface up. Move reading those tables
to INIT stage.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210805141826.ce3b60f0b426.I3643bf00e714aae930880cc7d6cf390b142eaccb@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 5bf7a9ed 05-Aug-2021 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: convert flat GEO profile table to a struct version

The GEO profiles have been stored in single-dimension arrays and the
access has been done via a single index. We will soon need to support
different revisions of this table, which will make the flat array even
harder to handle. To prepare for that, convert the single-dimension
array to a struct with substructures.

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


# de95c928 05-Aug-2021 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: remove unused ACPI_WGDS_TABLE_SIZE definition

When we started supporting the new FW API for the geo profiles, we
stopped using this definition, but left it there. Remove it now.

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


# 51266c11 05-Aug-2021 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: support reading and storing EWRD revisions 1 and 2

As an extension to the WRDS support for revisions 1 and 2, do the same
for the EWRD tables. These tables have a very similar format to the
WRDS table, so most of the code is similar.

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


# 2a808414 05-Aug-2021 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: acpi: support reading and storing WRDS revision 1 and 2

Change the SAR profile tables storage to revision 2 regardless of the
revision we read from ACPI. Revision 2 is a superset of revision 1,
which is in turn a superset of revision 0, so they can all be stored
inside revision 2.

Add support for reading and storing also revisions 1 and 2, whose only
difference is the number of chains and number of sub-bands. So most
of the code revolves around passing different chain and sub-band
sizes.

With this patch we still pass only revision 0 to the firmware, but
that will be changed in a separate patch.

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


# dac7171c 05-Aug-2021 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: remove ACPI_SAR_NUM_TABLES definition

This definition was only used to pass the size of the tables in the FW
API to the iwl_sar_select_profile() function, but we should actually
pass the definition from the FW API file. We don't have the concept
of tables in the ACPI definition, so we can remove it.

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


# 81870d13 05-Aug-2021 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: convert flat SAR profile table to a struct version

The SAR profiles have been stored in single-dimension arrays and the
access has been done via a single index. We will soon need to support
different revisions of this table, which will make the flat array even
harder to handle. To prepare for that, convert the single-dimension
array to a struct with substructures.

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


# 248e7e2a 05-Aug-2021 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: rename ACPI_SAR_NUM_CHAIN_LIMITS to ACPI_SAR_NUM_CHAINS

The "LIMITS" in the macro name don't have much meaning, so remove it
to make the macro shorter and better reflect that this is the number
of chains that we have limits for.

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


# 54b4fda5 17-Jun-2021 Abhishek Naik <abhishek.naik@intel.com>

iwlwifi: mvm: Read acpi dsm to get unii4 enable/disable bitmap.

Read the UNII4 setting from the ACPI table and use it in the
LARI_CONFIG_CHANGE_CMD accordingly.

This setting allows OEMs to enable or disable UNII4, bypassing the FW
defaults.

Signed-off-by: Abhishek Naik <abhishek.naik@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210617100544.223090c509c4.If03cb5393607ae494041b6187bcec134d6a1e06d@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 7119f02b 12-Jun-2021 Miri Korenblit <miriam.rachel.korenblit@intel.com>

iwlwifi: mvm: support BIOS enable/disable for 11ax in Russia

Read the new BIOS DSM and Pass to FW if to disable\enable
11ax for Russia according to the BIOS key. This is
needed to enable OEMs to control enable/disable 11ax in Russia.
Also add support for future "enable 11ax in country X" features.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210612142637.a705f7cedff8.I580f1021cabcc37e88f5ec5e9a6bbf00aae514b6@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# f21afaba 30-Mar-2021 Harish Mitty <harish.mitty@intel.com>

iwlwifi: mvm: refactor ACPI DSM evaluation function

Instead of implementing the DSM evaluation function in the MVM code,
refactor it so it can be generalized and part of the common ACPI
implementation.

Signed-off-by: Harish Mitty <harish.mitty@intel.com>
[reworded subject and commit message]
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.a24af3551aac.I8e6bd5eb05f853b6331fa4823750f7ba8ffe46e6@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# d2bfda8a 30-Mar-2021 Miri Korenblit <miriam.rachel.korenblit@intel.com>

iwlwifi: mvm: support BIOS enable/disable for 11ax in Ukraine

Read the new BIOS DSM and Pass to FW if to disable\enable
11ax for Ukraine according to the BIOS key. this is
needed to enable OEMs to control enable/disable 11ax in Ukraine

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.055654e7707e.If7eaf9839cd5d59729a235df07e31668b408e740@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# e12cfc7b 30-Mar-2021 Miri Korenblit <miriam.rachel.korenblit@intel.com>

iwlwifi: mvm: enable PPAG in China

Add support for ppag in China by reading revision 2 of the ppag table
from ACPI, and passing the data to the FW.
This is needed to enable OEMs to control ppag enablement
in China.

Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210331121101.69af388d0dce.I8cfddf9e6837bf394b00390181b4b774ded19acd@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 4e8fe214 10-Feb-2021 Gregory Greenman <gregory.greenman@intel.com>

iwlwifi: acpi: add support for DSM RFI

BIOS provides RFI feature enable/disable state via WiFi DSM ACPI
object. By default the feature should be disabled.
The GUID for this feature is different from the one driver currently
uses, so need to provide a set of new definitions.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20210210171218.242bfe368981.Iaccce1e2fa3986b174d0b08942aa4fbf8bb94a95@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# f9a78edb 10-Feb-2021 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: acpi: fix PPAG table sizes

We were erroneously adding 3 extra values to the table size
calculation, when we should actually add only a 2 (one for the domain
type and one for the enabled/disabled flag). Fix this for both
revisions we support.

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


# aefbe5c4 22-Jan-2021 Matt Chen <matt.chen@intel.com>

iwlwifi: mvm: fix the return type for DSM functions 1 and 2

The return type value of functions 1 and 2 were considered to be an
integer inside a buffer, but they can also be only an integer, without
the buffer. Fix the code in iwl_acpi_get_dsm_u8() to handle it as a
single integer value, as well as packed inside a buffer.

Signed-off-by: Matt Chen <matt.chen@intel.com>
Fixes: 9db93491f29e ("iwlwifi: acpi: support device specific method (DSM)")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20210122144849.5757092adcd6.Ic24524627b899c9a01af38107a62a626bdf5ae3a@changeid


# 8e99ea8d 09-Dec-2020 Johannes Berg <johannes.berg@intel.com>

iwlwifi: use SPDX tags

Use SPDX tags instead of the long copyright notices. Also cleanup
some duplicate copyright notices and combine the years where possible.

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.20201210000603.481bcb512a6f.I8146abe5a637079e7336209f23cb26af98b12b31@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# cdaba917 09-Dec-2020 Emmanuel Grumbach <emmanuel.grumbach@intel.com>

iwlwifi: follow the new inclusive terminology

The new inclusive terminology requires to change a few
terms that were used in iwlwifi.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20201209231352.1eb4c8625f36.I1b17b68d4a8e77071da3e15ffbd902d15c1d4938@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 45acebf8 08-Oct-2020 Naftali Goldstein <naftali.goldstein@intel.com>

iwlwifi: fix sar geo table initialization

When adding support for version 3 of the GEO_TX_POWER_LIMIT command,
the table argument of iwl_sar_geo_init was changed from a pointer a 1d
array of now-removed iwl_per_chain_offset_group_v1 to a pointer to a 2d
array of iwl_per_chain_offset (iwl_per_chain_offset_group_v1 was a
struct containing 2 copies of iwl_per_chain_offset).

So even for version 2 where the second dimension is of length 2, which
means that the underlying memory layout of the array didn't change, this
requires a small change in the way we loop over it, and this was missed.

Additionally, for the case of version 3 where the second dimension is now
3, in order to fill the first two elements of each row correctly (lb and
hb), iwl_sar_geo_init must get the true number of bands supported.
But because we don't yet store any values for the 3rd (uhb) band, skip
that band.

Signed-off-by: Naftali Goldstein <naftali.goldstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20201008181047.73605b6e0548.Id0ec98333277ff9e017e3938ae413b34acc68947@changeid


# 4795983b 27-Sep-2020 Mordechay Goodstein <mordechay.goodstein@intel.com>

iwlwifi: acpi: in non acpi compilations remove iwl_sar_geo_init

In non acpi compilations iwl_sar_geo_init isn't called which results with
compilation warning so just remove the declaration.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200928121852.3de51c557566.I67a0eedddbd56e51eb5150c65756eb5724b65e69@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 0ea788ed 27-Sep-2020 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: support version 3 of GEO_TX_POWER_LIMIT

Add support for the new version of the GEO_TX_POWER_LIMIT command.
This new version includes UHB values in the table, but for now, since
we don't have the ACPI values yet, we support the API, but don't set
the extra values.

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


# dd2a1256 27-Sep-2020 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: acpi: rename geo structs to contain versioning

Add the version number to the iwl_geo_tx_power_profile_cmd structs and
move the union into a common place. Additionally, reuse the code that
sets elements that are at the same place in the struct across
different versions.

While at it remove an unused variable, add a comment and move the v2
specific element setting to inside the if statement. Additionally,
invert the if for slightly more readability.

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


# 9c08cef8 27-Sep-2020 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: acpi: prepare SAR profile selection code for multiple sizes

The SAR profile tables will be larger in the next version, so prepare
the iwl_sar_select_profile() function to handle multiple sizes and
update the relevant callers.

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


# 216cdfb5 27-Sep-2020 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: add a common struct for all iwl_tx_power_cmd versions

Create a common structure to contain all different versions of the
tx_power_cmd instead of making a union of the different structs
everywhere we need them. Also move the common part of these structs
into a separate structure (instead of reusing v3) and leave the
per_chain_restriction part out of the common part, because this will
change in version 6 of the command (which will be added soon).

While at it, rename per_chain_restriction to per_chain to shorten it.

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


# f961e9fc 25-Sep-2020 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: acpi: remove dummy definition of iwl_sar_set_profile()

This function is only called from acpi.c, which is only included in
the makefile if CONFIG_ACPI is set. So it doesn't make sense to
declare a dummy version of it when CONFIG_ACPI is not defined.

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


# f604324e 25-Sep-2020 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: remove iwl_validate_sar_geo_profile() export

Only iwlmvm uses this function and it's so simple that it's clearer if
it's spelled out in the code anyway, so remove it and add the check
where needed.

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


# 090a5d7c 25-Sep-2020 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: don't export acpi functions unnecessarily

A couple of functions were exported from the acpi.c file
unnecessarily, since they are only used internally in that file. Make
them static.

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


# f2134f66 24-Sep-2020 Gil Adam <gil.adam@intel.com>

iwlwifi: acpi: support ppag table command v2

Version 2 of the PPAG table command supports more sub-bands than
previous. Change relevant command structs and the reading of the ACPI
tables.

Signed-off-by: Gil Adam <gil.adam@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200924162106.fb29c33d2cb9.I942bfe645e9d47cd1fcf6435506061f8b2cea21a@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 02d31e9b 11-Sep-2020 Gil Adam <gil.adam@intel.com>

iwlwifi: acpi: evaluate dsm to disable 5.8GHz channels

Evaluate the appropriate DSM from ACPI to set ETSI SRD 5.8GHz
channels to passive or disabled, default behaviour is enabled.
Add enums and refactor evaluation of DSM functions for better
readablity and more informative debug prints.

Signed-off-by: Gil Adam <gil.adam@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200911204056.816130ee75e0.I727a217be7c967a97960b197a816fc053d10c48a@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 9db93491 29-May-2020 Gil Adam <gil.adam@intel.com>

iwlwifi: acpi: support device specific method (DSM)

ACPI Device Specific Method (DSM) allows standardized feature
configuration through the ACPI interface without the namespace
pollution of the usual mechanism (ACPI method for each feature).
Add generic function for evaluating DSM objects and function for
evaluating a DSM with no arguments and a single int return value.
also implement the required backport for UUID.

Signed-off-by: Gil Adam <gil.adam@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200529092401.c3242ff3ba5c.Icb48c8d61bede5dda7ef267bff10e4798e9dc77b@changeid


# 28dd7ccd 18-Apr-2020 Mordechay Goodstein <mordechay.goodstein@intel.com>

iwlwifi: acpi: read TAS table from ACPI and send it to the FW

Read the Time Averaged SAR (TAS) table from ACPI and if TAS
feature is enabled in the FW send the black list countries
which TAS is disabled in to the FW

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200418110539.40a327d32cfd.I7203f3afc8186cca34c48a1a116baac1df5eff4e@changeid


# 0433ae55 18-Mar-2020 Golan Ben Ami <golan.ben.ami@intel.com>

iwlwifi: don't send GEO_TX_POWER_LIMIT if no wgds table

The GEO_TX_POWER_LIMIT command was sent although
there is no wgds table, so the fw got wrong SAR values
from the driver.

Fix this by avoiding sending the command if no wgds
tables are available.

Signed-off-by: Golan Ben Ami <golan.ben.ami@intel.com>
Fixes: 39c1a9728f93 ("iwlwifi: refactor the SAR tables from mvm to acpi")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Tested-By: Jonathan McDowell <noodles@earth.li>
Tested-by: Len Brown <len.brown@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20200318081237.46db40617cc6.Id5cf852ec8c5dbf20ba86bad7b165a0c828f8b2e@changeid


# 39c1a972 15-Nov-2019 Ihab Zhaika <ihab.zhaika@intel.com>

iwlwifi: refactor the SAR tables from mvm to acpi

Refactored the SAR related functions from iwlmvm to acpi
in order to make it shared between different opmodes
in addition to removing unused variable ppag_rev.

Signed-off-by: Ihab Zhaika <ihab.zhaika@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>


# 6ce1e5c0 16-Jun-2019 Gil Adam <gil.adam@intel.com>

iwlwifi: support per-platform antenna gain

TX power limits as defined in the OTP assume the worst case scenario
in terms of the platform's atenna gain, but most platforms are below
that value so they can use more TX power without passing the regulatory
limit. If the platform indicates in the BIOS that it indeed has lower
gain, and the geographic location allows it, higher TX power can be
used. The driver reads the PPAG (Per-Platform Antenna Gain) data from
BIOS (if it exists), validates it and sends the appropriate command to
the FW. This flow happens once at FW init, in case of suspend/resume
there is no need to read again from BIOS as we save those values during
init, so just send the PPAG command again to FW.

Signed-off-by: Gil Adam <gil.adam@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 0c3d7282 27-Feb-2019 Haim Dreyfuss <haim.dreyfuss@intel.com>

iwlwifi: Add support for SAR South Korea limitation

South Korea is adding a more strict SAR limit called "Limb SAR".
Currently, WGDS SAR offset group 3 is not used (not mapped to any country).
In order to be able to comply with South Korea new restriction:
- OEM will use WGDS SAR offset group 3 to South Korea limitation.
- OEM will change WGDS revision to 1 (currently latest revision is 0)
to notify that Korea Limb SAR applied.
- Driver will read the WGDS table and pass the values to FW (as usual)
- Driver will pass to FW an indication that Korea Limb SAR is applied
in case table revision is 1.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 48e775e6 01-Jan-2019 Haim Dreyfuss <haim.dreyfuss@intel.com>

iwlwifi: mvm: add support for 32kHz external clock indication

In low power modes, the chip clock source for platform integrated
devices is 32kHz. It is generated internally and supplied by a crystal
oscillator. However using a 32kHz sourced from crystal oscillator
has high power penalty.

There is an option to get an external 32kHz clock from the platform. Past
experience shows that the reliability is platform dependent,
i.e. on some platforms it works good and on other it doesn’t.

Working from external clock will save 0.5 mW in sleep state, from overall
1.8mW that we have today, i.e. almost 30%.

Each OEM can enable or disable the use of the external 32kHz clock by
setting a BIOS configuration. In case the OEM configured to use 32kHz
external clock the driver will pass this indication to the FW.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 66e83903 03-Aug-2018 Matt Chen <matt.chen@intel.com>

iwlwifi: fix wrong WGDS_WIFI_DATA_SIZE

From coreboot/BIOS:
Name ("WGDS", Package() {
Revision,
Package() {
DomainType, // 0x7:WiFi ==> We miss this one.
WgdsWiFiSarDeltaGroup1PowerMax1, // Group 1 FCC 2400 Max
WgdsWiFiSarDeltaGroup1PowerChainA1, // Group 1 FCC 2400 A Offset
WgdsWiFiSarDeltaGroup1PowerChainB1, // Group 1 FCC 2400 B Offset
WgdsWiFiSarDeltaGroup1PowerMax2, // Group 1 FCC 5200 Max
WgdsWiFiSarDeltaGroup1PowerChainA2, // Group 1 FCC 5200 A Offset
WgdsWiFiSarDeltaGroup1PowerChainB2, // Group 1 FCC 5200 B Offset
WgdsWiFiSarDeltaGroup2PowerMax1, // Group 2 EC Jap 2400 Max
WgdsWiFiSarDeltaGroup2PowerChainA1, // Group 2 EC Jap 2400 A Offset
WgdsWiFiSarDeltaGroup2PowerChainB1, // Group 2 EC Jap 2400 B Offset
WgdsWiFiSarDeltaGroup2PowerMax2, // Group 2 EC Jap 5200 Max
WgdsWiFiSarDeltaGroup2PowerChainA2, // Group 2 EC Jap 5200 A Offset
WgdsWiFiSarDeltaGroup2PowerChainB2, // Group 2 EC Jap 5200 B Offset
WgdsWiFiSarDeltaGroup3PowerMax1, // Group 3 ROW 2400 Max
WgdsWiFiSarDeltaGroup3PowerChainA1, // Group 3 ROW 2400 A Offset
WgdsWiFiSarDeltaGroup3PowerChainB1, // Group 3 ROW 2400 B Offset
WgdsWiFiSarDeltaGroup3PowerMax2, // Group 3 ROW 5200 Max
WgdsWiFiSarDeltaGroup3PowerChainA2, // Group 3 ROW 5200 A Offset
WgdsWiFiSarDeltaGroup3PowerChainB2, // Group 3 ROW 5200 B Offset
}
})

When read the ACPI data to find out the WGDS, the DATA_SIZE is never
matched.
From the above format, it gives 19 numbers, but our driver is hardcode
as 18.
Fix it to pass then can parse the data into our wgds table.
Then we will see:
iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init Sending GEO_TX_POWER_LIMIT
iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[0]
Band[0]: chain A = 68 chain B = 69 max_tx_power = 54
iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[0]
Band[1]: chain A = 48 chain B = 49 max_tx_power = 70
iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[1]
Band[0]: chain A = 51 chain B = 67 max_tx_power = 50
iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[1]
Band[1]: chain A = 69 chain B = 70 max_tx_power = 68
iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[2]
Band[0]: chain A = 49 chain B = 50 max_tx_power = 48
iwlwifi 0000:01:00.0: U iwl_mvm_sar_geo_init SAR geographic profile[2]
Band[1]: chain A = 52 chain B = 53 max_tx_power = 51

Cc: stable@vger.kernel.org # 4.12+
Fixes: a6bff3cb19b7 ("iwlwifi: mvm: add GEO_TX_POWER_LIMIT cmd for geographic tx power table")
Signed-off-by: Matt Chen <matt.chen@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 754f890a 24-Aug-2018 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: remove all occurrences of the FSF address paragraph

The Free Software Foundation address is superfluous and causes
checkpatch to issue a warning when present. Remove all paragraphs
with FSF's address to prevent that.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 1184611e 28-Sep-2017 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: acpi: move code that reads SPLC to acpi

Move most of the set_dflt_pwr_limit() function to acpi.c and make it
return the pwr_limit value instead of setting directly. Also rename
it to iwl_acpi_get_pwr_limit().

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 45f65569 26-Sep-2017 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: acpi: move function to get mcc into acpi code

The iwl_get_bios_mcc() function was in the iwl-nvm-parse.c file, but
it has nothing to do with the NVM. Move it to fw/acpi.c and rename it
to iwl_acpi_get_mcc().

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# ed1a962d 26-Sep-2017 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: acpi: make iwl_get_bios_mcc() use the common acpi functions

The way iwl_get_bios_mcc() gets the WiFi package and checks for its
integrity is almost identical to the new iwl_acpi_get_wifi_pkg()
function. Instead of having duplicate code, convert it to use the
common code.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 45a5c6f6 21-Sep-2017 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: acpi: use iwl_acpi_get_wifi_pkg when reading reading SPLC

Instead of finding the wifi package with its own code, we can reuse
the new iwl_acpi_get_wifi_pkg() function when reading the default
power limit from SPLC.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 2fa388cf 21-Sep-2017 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: acpi: generalize iwl_mvm_sar_find_wifi_pkg()

Move this function to acpi.c, renaming it to iwl_acpi_get_wifi_pkg(),
because it can also be used with other methods (i.e. SPLC and WRDD).

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# e7a3b8d8 21-Sep-2017 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: acpi: move ACPI-related definitions to acpi.h

The ACPI table size definitions were spread around the different files
that used them. Move them all to a common place.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 1c73acf5 21-Sep-2017 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: acpi: move ACPI method definitions to acpi.h

Instead of defining each method where they are used and re-defining
WIFI_DOMAIN in each one of them, move all the definitions to a central
place and define the domain only a single time.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>


# 813df5ce 18-Sep-2017 Luca Coelho <luciano.coelho@intel.com>

iwlwifi: acpi: add common code to read from ACPI

There are many places where the same process of invoking a method from
ACPI is used, causing a lot of duplicate code. To improve this,
introduce a new function to get an ACPI object by invoking an ACPI
method that can be reused.

Additionally, since this function needs to be called when we only have
the trans, the opmode or the device, introduce a new debug macro that
gets the device as a parameter so it can be used in the new function.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>