Skip to content

Commit 8bec2ec

Browse files
committed
wifi: iwlwifi: mld: remove support for iwl_geo_tx_power_profiles_cmd version 4
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 <[email protected]> Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250711183056.faeb1e6bac2a.I1a29b16f59b67c103d1f91dedee27e04cd7fdfdd@changeid
1 parent 9696454 commit 8bec2ec

File tree

1 file changed

+10
-33
lines changed

1 file changed

+10
-33
lines changed

drivers/net/wireless/intel/iwlwifi/mld/regulatory.c

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -71,48 +71,25 @@ void iwl_mld_get_bios_tables(struct iwl_mld *mld)
7171
static int iwl_mld_geo_sar_init(struct iwl_mld *mld)
7272
{
7373
u32 cmd_id = WIDE_ID(PHY_OPS_GROUP, PER_CHAIN_LIMIT_OFFSET_CMD);
74-
union iwl_geo_tx_power_profiles_cmd cmd;
75-
u16 len;
76-
u32 n_bands;
77-
__le32 sk = cpu_to_le32(0);
78-
int ret;
79-
u8 cmd_ver = iwl_fw_lookup_cmd_ver(mld->fw, cmd_id,
80-
IWL_FW_CMD_VER_UNKNOWN);
81-
82-
BUILD_BUG_ON(offsetof(struct iwl_geo_tx_power_profiles_cmd_v4, ops) !=
83-
offsetof(struct iwl_geo_tx_power_profiles_cmd_v5, ops));
84-
85-
cmd.v4.ops = cpu_to_le32(IWL_PER_CHAIN_OFFSET_SET_TABLES);
86-
8774
/* Only set to South Korea if the table revision is 1 */
88-
if (mld->fwrt.geo_rev == 1)
89-
sk = cpu_to_le32(1);
90-
91-
if (cmd_ver == 5) {
92-
len = sizeof(cmd.v5);
93-
n_bands = ARRAY_SIZE(cmd.v5.table[0]);
94-
cmd.v5.table_revision = sk;
95-
} else if (cmd_ver == 4) {
96-
len = sizeof(cmd.v4);
97-
n_bands = ARRAY_SIZE(cmd.v4.table[0]);
98-
cmd.v4.table_revision = sk;
99-
} else {
100-
return -EOPNOTSUPP;
101-
}
75+
__le32 sk = cpu_to_le32(mld->fwrt.geo_rev == 1 ? 1 : 0);
76+
union iwl_geo_tx_power_profiles_cmd cmd = {
77+
.v5.ops = cpu_to_le32(IWL_PER_CHAIN_OFFSET_SET_TABLES),
78+
.v5.table_revision = sk,
79+
};
80+
int ret;
10281

103-
BUILD_BUG_ON(offsetof(struct iwl_geo_tx_power_profiles_cmd_v4, table) !=
104-
offsetof(struct iwl_geo_tx_power_profiles_cmd_v5, table));
105-
/* the table is at the same position for all versions, so set use v4 */
106-
ret = iwl_sar_geo_fill_table(&mld->fwrt, &cmd.v4.table[0][0],
107-
n_bands, BIOS_GEO_MAX_PROFILE_NUM);
82+
ret = iwl_sar_geo_fill_table(&mld->fwrt, &cmd.v5.table[0][0],
83+
ARRAY_SIZE(cmd.v5.table[0]),
84+
BIOS_GEO_MAX_PROFILE_NUM);
10885

10986
/* It is a valid scenario to not support SAR, or miss wgds table,
11087
* but in that case there is no need to send the command.
11188
*/
11289
if (ret)
11390
return 0;
11491

115-
return iwl_mld_send_cmd_pdu(mld, cmd_id, &cmd, len);
92+
return iwl_mld_send_cmd_pdu(mld, cmd_id, &cmd, sizeof(cmd.v5));
11693
}
11794

11895
int iwl_mld_config_sar_profile(struct iwl_mld *mld, int prof_a, int prof_b)

0 commit comments

Comments
 (0)