Commit a51d1cf5 authored by Miri Korenblit's avatar Miri Korenblit Committed by Johannes Berg

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: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240201155157.4cce81198afe.Ice8b1b97a68da9ec7b5a4799ddb668642198e1af@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent f74f397a
......@@ -362,31 +362,28 @@ int iwl_acpi_get_mcc(struct device *dev, char *mcc)
}
IWL_EXPORT_SYMBOL(iwl_acpi_get_mcc);
u64 iwl_acpi_get_pwr_limit(struct device *dev)
int iwl_acpi_get_pwr_limit(struct iwl_fw_runtime *fwrt, u64 *dflt_pwr_limit)
{
union acpi_object *data, *wifi_pkg;
u64 dflt_pwr_limit;
int tbl_rev;
int tbl_rev, ret = -EINVAL;
data = iwl_acpi_get_object(dev, ACPI_SPLC_METHOD);
if (IS_ERR(data)) {
dflt_pwr_limit = 0;
*dflt_pwr_limit = 0;
data = iwl_acpi_get_object(fwrt->dev, ACPI_SPLC_METHOD);
if (IS_ERR(data))
goto out;
}
wifi_pkg = iwl_acpi_get_wifi_pkg(dev, data,
wifi_pkg = iwl_acpi_get_wifi_pkg(fwrt->dev, data,
ACPI_SPLC_WIFI_DATA_SIZE, &tbl_rev);
if (IS_ERR(wifi_pkg) || tbl_rev != 0 ||
wifi_pkg->package.elements[1].integer.value != ACPI_TYPE_INTEGER) {
dflt_pwr_limit = 0;
wifi_pkg->package.elements[1].integer.value != ACPI_TYPE_INTEGER)
goto out_free;
}
dflt_pwr_limit = wifi_pkg->package.elements[1].integer.value;
*dflt_pwr_limit = wifi_pkg->package.elements[1].integer.value;
ret = 0;
out_free:
kfree(data);
out:
return dflt_pwr_limit;
return ret;
}
IWL_EXPORT_SYMBOL(iwl_acpi_get_pwr_limit);
......
......@@ -156,7 +156,7 @@ int iwl_acpi_get_dsm_u32(struct device *dev, int rev, int func,
*/
int iwl_acpi_get_mcc(struct device *dev, char *mcc);
u64 iwl_acpi_get_pwr_limit(struct device *dev);
int iwl_acpi_get_pwr_limit(struct iwl_fw_runtime *fwrt, u64 *dflt_pwr_limit);
/*
* iwl_acpi_get_eckv - read external clock validation from ACPI, if available
......@@ -212,8 +212,10 @@ static inline int iwl_acpi_get_mcc(struct device *dev, char *mcc)
return -ENOENT;
}
static inline u64 iwl_acpi_get_pwr_limit(struct device *dev)
static inline int iwl_acpi_get_pwr_limit(struct iwl_fw_runtime *fwrt,
u64 *dflt_pwr_limit)
{
*dflt_pwr_limit = 0;
return 0;
}
......
......@@ -689,7 +689,7 @@ static u32 iwl_mvm_min_backoff(struct iwl_mvm *mvm)
if (!backoff)
return 0;
dflt_pwr_limit = iwl_acpi_get_pwr_limit(mvm->dev);
iwl_acpi_get_pwr_limit(&mvm->fwrt, &dflt_pwr_limit);
while (backoff->pwr) {
if (dflt_pwr_limit >= backoff->pwr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment