Skip to content

Commit 100f38b

Browse files
committed
wifi: iwlwifi: mld: remove support for REDUCE_TX_POWER_CMD ver 9
iwlmld was planned to be used for HR, which has version 9, but it was decided at the end to use iwlmvm for HR, so iwlmld only needs to support version 10. Remove version 9 support. Signed-off-by: Miri Korenblit <[email protected]> Link: https://patch.msgid.link/20250711183056.aeeb617abfae.I05101972506180644c42be5096c1b2afa36c625a@changeid
1 parent e3fd06d commit 100f38b

File tree

2 files changed

+7
-32
lines changed

2 files changed

+7
-32
lines changed

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -377,23 +377,15 @@ int iwl_mld_set_tx_power(struct iwl_mld *mld,
377377
u16 u_tx_power = tx_power == IWL_DEFAULT_MAX_TX_POWER ?
378378
IWL_DEV_MAX_TX_POWER : 8 * tx_power;
379379
struct iwl_dev_tx_power_cmd cmd = {
380-
/* Those fields sit on the same place for v9 and v10 */
381380
.common.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_LINK),
382381
.common.pwr_restriction = cpu_to_le16(u_tx_power),
383382
};
384-
u8 cmd_ver = iwl_fw_lookup_cmd_ver(mld->fw, cmd_id,
385-
IWL_FW_CMD_VER_UNKNOWN);
386-
int len = sizeof(cmd.common);
383+
int len = sizeof(cmd.common) + sizeof(cmd.v10);
387384

388385
if (WARN_ON(!mld_link))
389386
return -ENODEV;
390387

391388
cmd.common.link_id = cpu_to_le32(mld_link->fw_id);
392389

393-
if (cmd_ver == 10)
394-
len += sizeof(cmd.v10);
395-
else if (cmd_ver == 9)
396-
len += sizeof(cmd.v9);
397-
398390
return iwl_mld_send_cmd_pdu(mld, cmd_id, &cmd, len);
399391
}

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

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -120,37 +120,20 @@ int iwl_mld_config_sar_profile(struct iwl_mld *mld, int prof_a, int prof_b)
120120
u32 cmd_id = REDUCE_TX_POWER_CMD;
121121
struct iwl_dev_tx_power_cmd cmd = {
122122
.common.set_mode = cpu_to_le32(IWL_TX_POWER_MODE_SET_CHAINS),
123+
.v10.flags = cpu_to_le32(mld->fwrt.reduced_power_flags),
123124
};
124-
__le16 *per_chain;
125125
int ret;
126-
u16 len = sizeof(cmd.common);
127-
u32 n_subbands;
128-
u8 cmd_ver = iwl_fw_lookup_cmd_ver(mld->fw, cmd_id,
129-
IWL_FW_CMD_VER_UNKNOWN);
130-
131-
if (cmd_ver == 10) {
132-
len += sizeof(cmd.v10);
133-
n_subbands = IWL_NUM_SUB_BANDS_V2;
134-
per_chain = &cmd.v10.per_chain[0][0][0];
135-
cmd.v10.flags =
136-
cpu_to_le32(mld->fwrt.reduced_power_flags);
137-
} else if (cmd_ver == 9) {
138-
len += sizeof(cmd.v9);
139-
n_subbands = IWL_NUM_SUB_BANDS_V1;
140-
per_chain = &cmd.v9.per_chain[0][0];
141-
} else {
142-
return -EOPNOTSUPP;
143-
}
144126

145127
/* TODO: CDB - support IWL_NUM_CHAIN_TABLES_V2 */
146-
ret = iwl_sar_fill_profile(&mld->fwrt, per_chain,
147-
IWL_NUM_CHAIN_TABLES,
148-
n_subbands, prof_a, prof_b);
128+
ret = iwl_sar_fill_profile(&mld->fwrt, &cmd.v10.per_chain[0][0][0],
129+
IWL_NUM_CHAIN_TABLES, IWL_NUM_SUB_BANDS_V2,
130+
prof_a, prof_b);
149131
/* return on error or if the profile is disabled (positive number) */
150132
if (ret)
151133
return ret;
152134

153-
return iwl_mld_send_cmd_pdu(mld, cmd_id, &cmd, len);
135+
return iwl_mld_send_cmd_pdu(mld, cmd_id, &cmd,
136+
sizeof(cmd.common) + sizeof(cmd.v10));
154137
}
155138

156139
int iwl_mld_init_sar(struct iwl_mld *mld)

0 commit comments

Comments
 (0)