]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: iwlwifi: mld: remove support for iwl_geo_tx_power_profiles_cmd version 4
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Fri, 11 Jul 2025 15:34:22 +0000 (18:34 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Mon, 14 Jul 2025 16:36:13 +0000 (19:36 +0300)
iwlmld was planned to be used for HR/GF, which has version 4,
but it was decided at the end to use iwlmvm for HR/GF, so iwlmld only
needs to support version 5.
Remove version 4 support.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250711183056.faeb1e6bac2a.I1a29b16f59b67c103d1f91dedee27e04cd7fdfdd@changeid
drivers/net/wireless/intel/iwlwifi/mld/regulatory.c

index b82ddd629e249fe8056d916439b48a9bb8166d9b..75d2f5cb23a7c0535518cd62a782742c28728e41 100644 (file)
@@ -71,40 +71,17 @@ void iwl_mld_get_bios_tables(struct iwl_mld *mld)
 static int iwl_mld_geo_sar_init(struct iwl_mld *mld)
 {
        u32 cmd_id = WIDE_ID(PHY_OPS_GROUP, PER_CHAIN_LIMIT_OFFSET_CMD);
-       union iwl_geo_tx_power_profiles_cmd cmd;
-       u16 len;
-       u32 n_bands;
-       __le32 sk = cpu_to_le32(0);
-       int ret;
-       u8 cmd_ver = iwl_fw_lookup_cmd_ver(mld->fw, cmd_id,
-                                          IWL_FW_CMD_VER_UNKNOWN);
-
-       BUILD_BUG_ON(offsetof(struct iwl_geo_tx_power_profiles_cmd_v4, ops) !=
-                    offsetof(struct iwl_geo_tx_power_profiles_cmd_v5, ops));
-
-       cmd.v4.ops = cpu_to_le32(IWL_PER_CHAIN_OFFSET_SET_TABLES);
-
        /* Only set to South Korea if the table revision is 1 */
-       if (mld->fwrt.geo_rev == 1)
-               sk = cpu_to_le32(1);
-
-       if (cmd_ver == 5) {
-               len = sizeof(cmd.v5);
-               n_bands = ARRAY_SIZE(cmd.v5.table[0]);
-               cmd.v5.table_revision = sk;
-       } else if (cmd_ver == 4) {
-               len = sizeof(cmd.v4);
-               n_bands = ARRAY_SIZE(cmd.v4.table[0]);
-               cmd.v4.table_revision = sk;
-       } else {
-               return -EOPNOTSUPP;
-       }
+       __le32 sk = cpu_to_le32(mld->fwrt.geo_rev == 1 ? 1 : 0);
+       union iwl_geo_tx_power_profiles_cmd cmd = {
+               .v5.ops = cpu_to_le32(IWL_PER_CHAIN_OFFSET_SET_TABLES),
+               .v5.table_revision = sk,
+       };
+       int ret;
 
-       BUILD_BUG_ON(offsetof(struct iwl_geo_tx_power_profiles_cmd_v4, table) !=
-                    offsetof(struct iwl_geo_tx_power_profiles_cmd_v5, table));
-       /* the table is at the same position for all versions, so set use v4 */
-       ret = iwl_sar_geo_fill_table(&mld->fwrt, &cmd.v4.table[0][0],
-                                    n_bands, BIOS_GEO_MAX_PROFILE_NUM);
+       ret = iwl_sar_geo_fill_table(&mld->fwrt, &cmd.v5.table[0][0],
+                                    ARRAY_SIZE(cmd.v5.table[0]),
+                                    BIOS_GEO_MAX_PROFILE_NUM);
 
        /* It is a valid scenario to not support SAR, or miss wgds table,
         * but in that case there is no need to send the command.
@@ -112,7 +89,7 @@ static int iwl_mld_geo_sar_init(struct iwl_mld *mld)
        if (ret)
                return 0;
 
-       return iwl_mld_send_cmd_pdu(mld, cmd_id, &cmd, len);
+       return iwl_mld_send_cmd_pdu(mld, cmd_id, &cmd, sizeof(cmd.v5));
 }
 
 int iwl_mld_config_sar_profile(struct iwl_mld *mld, int prof_a, int prof_b)