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

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: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: default avatarGregory Greenman <gregory.greenman@intel.com>
Link: https://msgid.link/20240131091413.48acf340e817.I810e457b80015c1931d96d3e13c849f0339723c3@changeidSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 427661e4
...@@ -956,7 +956,6 @@ int iwl_acpi_get_ppag_table(struct iwl_fw_runtime *fwrt) ...@@ -956,7 +956,6 @@ int iwl_acpi_get_ppag_table(struct iwl_fw_runtime *fwrt)
int idx = 2; int idx = 2;
u8 cmd_ver; u8 cmd_ver;
fwrt->ppag_flags = 0;
fwrt->ppag_table_valid = false; fwrt->ppag_table_valid = false;
data = iwl_acpi_get_object(fwrt->dev, ACPI_PPAG_METHOD); data = iwl_acpi_get_object(fwrt->dev, ACPI_PPAG_METHOD);
...@@ -1057,7 +1056,8 @@ int iwl_acpi_get_ppag_table(struct iwl_fw_runtime *fwrt) ...@@ -1057,7 +1056,8 @@ int iwl_acpi_get_ppag_table(struct iwl_fw_runtime *fwrt)
} }
IWL_EXPORT_SYMBOL(iwl_acpi_get_ppag_table); IWL_EXPORT_SYMBOL(iwl_acpi_get_ppag_table);
int iwl_read_ppag_table(struct iwl_fw_runtime *fwrt, union iwl_ppag_table_cmd *cmd, int iwl_fill_ppag_table(struct iwl_fw_runtime *fwrt,
union iwl_ppag_table_cmd *cmd,
int *cmd_size) int *cmd_size)
{ {
u8 cmd_ver; u8 cmd_ver;
...@@ -1117,7 +1117,7 @@ int iwl_read_ppag_table(struct iwl_fw_runtime *fwrt, union iwl_ppag_table_cmd *c ...@@ -1117,7 +1117,7 @@ int iwl_read_ppag_table(struct iwl_fw_runtime *fwrt, union iwl_ppag_table_cmd *c
/* ppag mode */ /* ppag mode */
IWL_DEBUG_RADIO(fwrt, IWL_DEBUG_RADIO(fwrt,
"PPAG MODE bits were read from bios: %d\n", "PPAG MODE bits were read from bios: %d\n",
cmd->v1.flags & cpu_to_le32(ACPI_PPAG_MASK)); cmd->v1.flags);
if ((cmd_ver == 1 && !fw_has_capa(&fwrt->fw->ucode_capa, if ((cmd_ver == 1 && !fw_has_capa(&fwrt->fw->ucode_capa,
IWL_UCODE_TLV_CAPA_PPAG_CHINA_BIOS_SUPPORT)) || IWL_UCODE_TLV_CAPA_PPAG_CHINA_BIOS_SUPPORT)) ||
(cmd_ver == 2 && fwrt->ppag_ver == 2)) { (cmd_ver == 2 && fwrt->ppag_ver == 2)) {
...@@ -1129,7 +1129,7 @@ int iwl_read_ppag_table(struct iwl_fw_runtime *fwrt, union iwl_ppag_table_cmd *c ...@@ -1129,7 +1129,7 @@ int iwl_read_ppag_table(struct iwl_fw_runtime *fwrt, union iwl_ppag_table_cmd *c
IWL_DEBUG_RADIO(fwrt, IWL_DEBUG_RADIO(fwrt,
"PPAG MODE bits going to be sent: %d\n", "PPAG MODE bits going to be sent: %d\n",
cmd->v1.flags & cpu_to_le32(ACPI_PPAG_MASK)); cmd->v1.flags);
for (i = 0; i < IWL_NUM_CHAIN_LIMITS; i++) { for (i = 0; i < IWL_NUM_CHAIN_LIMITS; i++) {
for (j = 0; j < num_sub_bands; j++) { for (j = 0; j < num_sub_bands; j++) {
...@@ -1143,7 +1143,7 @@ int iwl_read_ppag_table(struct iwl_fw_runtime *fwrt, union iwl_ppag_table_cmd *c ...@@ -1143,7 +1143,7 @@ int iwl_read_ppag_table(struct iwl_fw_runtime *fwrt, union iwl_ppag_table_cmd *c
return 0; return 0;
} }
IWL_EXPORT_SYMBOL(iwl_read_ppag_table); IWL_EXPORT_SYMBOL(iwl_fill_ppag_table);
bool iwl_acpi_is_ppag_approved(struct iwl_fw_runtime *fwrt) bool iwl_acpi_is_ppag_approved(struct iwl_fw_runtime *fwrt)
{ {
......
...@@ -207,7 +207,8 @@ __le32 iwl_acpi_get_lari_config_bitmap(struct iwl_fw_runtime *fwrt); ...@@ -207,7 +207,8 @@ __le32 iwl_acpi_get_lari_config_bitmap(struct iwl_fw_runtime *fwrt);
int iwl_acpi_get_ppag_table(struct iwl_fw_runtime *fwrt); int iwl_acpi_get_ppag_table(struct iwl_fw_runtime *fwrt);
int iwl_read_ppag_table(struct iwl_fw_runtime *fwrt, union iwl_ppag_table_cmd *cmd, int iwl_fill_ppag_table(struct iwl_fw_runtime *fwrt,
union iwl_ppag_table_cmd *cmd,
int *cmd_size); int *cmd_size);
bool iwl_acpi_is_ppag_approved(struct iwl_fw_runtime *fwrt); bool iwl_acpi_is_ppag_approved(struct iwl_fw_runtime *fwrt);
...@@ -283,8 +284,9 @@ static inline int iwl_acpi_get_ppag_table(struct iwl_fw_runtime *fwrt) ...@@ -283,8 +284,9 @@ static inline int iwl_acpi_get_ppag_table(struct iwl_fw_runtime *fwrt)
return -ENOENT; return -ENOENT;
} }
static inline int iwl_read_ppag_table(struct iwl_fw_runtime *fwrt, static inline int iwl_fill_ppag_table(struct iwl_fw_runtime *fwrt,
union iwl_ppag_table_cmd *cmd, int *cmd_size) union iwl_ppag_table_cmd *cmd,
int *cmd_size)
{ {
return -ENOENT; return -ENOENT;
} }
......
...@@ -1085,7 +1085,7 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm) ...@@ -1085,7 +1085,7 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
union iwl_ppag_table_cmd cmd; union iwl_ppag_table_cmd cmd;
int ret, cmd_size; int ret, cmd_size;
ret = iwl_read_ppag_table(&mvm->fwrt, &cmd, &cmd_size); ret = iwl_fill_ppag_table(&mvm->fwrt, &cmd, &cmd_size);
/* Not supporting PPAG table is a valid scenario */ /* Not supporting PPAG table is a valid scenario */
if (ret < 0) if (ret < 0)
return 0; return 0;
......
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