wifi: iwlwifi: small cleanups in PPAG table flows
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 31 Jan 2024 08:24:40 +0000 (10:24 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 2 Feb 2024 13:15:14 +0000 (14:15 +0100)
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>
drivers/net/wireless/intel/iwlwifi/fw/acpi.c
drivers/net/wireless/intel/iwlwifi/fw/acpi.h
drivers/net/wireless/intel/iwlwifi/mvm/fw.c

index 4e638287e9a410b0f34a7e6d8608e9d76b26f948..d2689d93da0c9fefc2dc7d511e071f35544ab03f 100644 (file)
@@ -956,7 +956,6 @@ int iwl_acpi_get_ppag_table(struct iwl_fw_runtime *fwrt)
        int idx = 2;
        u8 cmd_ver;
 
-       fwrt->ppag_flags = 0;
        fwrt->ppag_table_valid = false;
 
        data = iwl_acpi_get_object(fwrt->dev, ACPI_PPAG_METHOD);
@@ -1057,7 +1056,8 @@ out_free:
 }
 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)
 {
         u8 cmd_ver;
@@ -1117,7 +1117,7 @@ int iwl_read_ppag_table(struct iwl_fw_runtime *fwrt, union iwl_ppag_table_cmd *c
        /* ppag mode */
        IWL_DEBUG_RADIO(fwrt,
                        "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,
                                          IWL_UCODE_TLV_CAPA_PPAG_CHINA_BIOS_SUPPORT)) ||
            (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
 
        IWL_DEBUG_RADIO(fwrt,
                        "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 (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
 
        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)
 {
index 3498deec58a55517dcf655ee550a7dfb864c9436..ef927d74bc7cb3222a52985e27ed5aaa93b257d3 100644 (file)
@@ -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_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);
 
 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)
        return -ENOENT;
 }
 
-static inline int iwl_read_ppag_table(struct iwl_fw_runtime *fwrt,
-                                   union iwl_ppag_table_cmd *cmd, int *cmd_size)
+static inline int iwl_fill_ppag_table(struct iwl_fw_runtime *fwrt,
+                                     union iwl_ppag_table_cmd *cmd,
+                                     int *cmd_size)
 {
        return -ENOENT;
 }
index c2267e0bd08ea30250cf40916adeac39545146af..d52fc3119972dbb6fc526b6d4139a6b3ed17ad72 100644 (file)
@@ -1085,7 +1085,7 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
        union iwl_ppag_table_cmd cmd;
        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 */
        if (ret < 0)
                return 0;