]> www.infradead.org Git - users/hch/misc.git/commitdiff
wifi: iwlwifi: mld: don't consider old versions of PPAG
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Thu, 21 Aug 2025 17:47:23 +0000 (20:47 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 26 Aug 2025 15:39:45 +0000 (18:39 +0300)
There is a utility function, iwl_fill_ppag_table, to fill the PPAG table
according the version of the FW API and on of the BIOS table.
But this function handles really old APIs that iwlmld will not support.
Also, iwlmvm will no longer have new APIs of PPAG (because it is loaded
on frozen devices only). So in the next versions we might introdue
regressions to iwlmvm.
Simply fill the PPAG table separately in iwlmld code, without using this
utility.

Reviewed-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250821204455.35698eb46b67.Ie77dc9c3ee8275d1c2e4eafa27f1c7899c2660ce@changeid
drivers/net/wireless/intel/iwlwifi/fw/regulatory.c
drivers/net/wireless/intel/iwlwifi/mld/regulatory.c

index 00921f86286a08954de8dd7f0614727a792531b6..6e98ac34199788bc14ec6246dbfa5c579df78aaf 100644 (file)
@@ -305,6 +305,7 @@ static bool iwl_ppag_value_valid(struct iwl_fw_runtime *fwrt, int chain,
        return true;
 }
 
+/* Utility function for iwlmvm and iwlxvt */
 int iwl_fill_ppag_table(struct iwl_fw_runtime *fwrt,
                        union iwl_ppag_table_cmd *cmd, int *cmd_size)
 {
index 75d2f5cb23a7c0535518cd62a782742c28728e41..40571125b3ab2d2b22c4e7b9b230897895554c6d 100644 (file)
@@ -163,18 +163,32 @@ int iwl_mld_init_sgom(struct iwl_mld *mld)
 
 static int iwl_mld_ppag_send_cmd(struct iwl_mld *mld)
 {
-       union iwl_ppag_table_cmd cmd = {};
-       int ret, len;
+       struct iwl_fw_runtime *fwrt = &mld->fwrt;
+       union iwl_ppag_table_cmd cmd = {
+               .v7.ppag_config_info.table_source = fwrt->ppag_bios_source,
+               .v7.ppag_config_info.table_revision = fwrt->ppag_bios_rev,
+               .v7.ppag_config_info.value = cpu_to_le32(fwrt->ppag_flags),
+       };
+       int ret;
 
-       ret = iwl_fill_ppag_table(&mld->fwrt, &cmd, &len);
-       /* Not supporting PPAG table is a valid scenario */
-       if (ret < 0)
-               return 0;
+       IWL_DEBUG_RADIO(fwrt,
+                       "PPAG MODE bits going to be sent: %d\n",
+                       fwrt->ppag_flags);
+
+       for (int chain = 0; chain < IWL_NUM_CHAIN_LIMITS; chain++) {
+               for (int subband = 0; subband < IWL_NUM_SUB_BANDS_V2; subband++) {
+                       cmd.v7.gain[chain][subband] =
+                               fwrt->ppag_chains[chain].subbands[subband];
+                       IWL_DEBUG_RADIO(fwrt,
+                                       "PPAG table: chain[%d] band[%d]: gain = %d\n",
+                                       chain, subband, cmd.v7.gain[chain][subband]);
+               }
+       }
 
        IWL_DEBUG_RADIO(mld, "Sending PER_PLATFORM_ANT_GAIN_CMD\n");
        ret = iwl_mld_send_cmd_pdu(mld, WIDE_ID(PHY_OPS_GROUP,
                                                PER_PLATFORM_ANT_GAIN_CMD),
-                                  &cmd, len);
+                                  &cmd, sizeof(cmd.v7));
        if (ret < 0)
                IWL_ERR(mld, "failed to send PER_PLATFORM_ANT_GAIN_CMD (%d)\n",
                        ret);