wifi: iwlwifi: mvm: rename iwl_mvm_mac80211_idx_to_hwrate()

Given that we now use v3 rates with FW index throughout,
_to_hwrate() is confusing, since the hardware still uses
the PLCP value, the driver just doesn't see that now (as
it talks to firmware, not hardware.)

Rename this to iwl_mvm_rate_idx_to_fw_idx() to more
clearly indicate what it's doing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20260527230313.a60c8aea5b6c.I6af48d5d9748e184eed9d3437d312291cab61d7f@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
This commit is contained in:
Johannes Berg 2026-05-27 23:05:03 +03:00 committed by Miri Korenblit
parent f60f215921
commit 18928cd2b0
4 changed files with 9 additions and 9 deletions

View File

@ -935,7 +935,7 @@ u16 iwl_mvm_mac_ctxt_get_beacon_flags(const struct iwl_fw *fw, u8 rate_idx)
: IWL_MAC_BEACON_CCK_V1;
if (iwl_fw_lookup_cmd_ver(fw, TX_CMD, 0) > 8)
flags |= iwl_mvm_mac80211_idx_to_hwrate(fw, rate_idx);
flags |= iwl_mvm_rate_idx_to_fw_idx(fw, rate_idx);
else
flags |= iwl_fw_rate_idx_to_plcp(rate_idx);
@ -998,7 +998,7 @@ static void iwl_mvm_mac_ctxt_set_tx(struct iwl_mvm *mvm,
else
rate_n_flags |= RATE_MCS_MOD_TYPE_LEGACY_OFDM;
rate_n_flags |= iwl_mvm_mac80211_idx_to_hwrate(mvm->fw, rate);
rate_n_flags |= iwl_mvm_rate_idx_to_fw_idx(mvm->fw, rate);
tx_params->rate_n_flags = iwl_mvm_v3_rate_to_fw(rate_n_flags,
mvm->fw_rates_ver);

View File

@ -1653,7 +1653,7 @@ int iwl_mvm_legacy_rate_to_mac80211_idx(u32 rate_n_flags,
void iwl_mvm_hwrate_to_tx_rate(u32 rate_n_flags,
enum nl80211_band band,
struct ieee80211_tx_rate *r);
u8 iwl_mvm_mac80211_idx_to_hwrate(const struct iwl_fw *fw, int rate_idx);
u8 iwl_mvm_rate_idx_to_fw_idx(const struct iwl_fw *fw, int rate_idx);
u8 iwl_mvm_mac80211_ac_to_ucode_ac(enum ieee80211_ac_numbers ac);
bool iwl_mvm_is_nic_ack_enabled(struct iwl_mvm *mvm, struct ieee80211_vif *vif);

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
* Copyright (C) 2012-2014, 2018-2025 Intel Corporation
* Copyright (C) 2012-2014, 2018-2026 Intel Corporation
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
* Copyright (C) 2016-2017 Intel Deutschland GmbH
*/
@ -268,7 +268,6 @@ static u32 iwl_mvm_convert_rate_idx(struct iwl_mvm *mvm,
int rate_idx)
{
u32 rate_flags = 0;
u8 rate_plcp;
bool is_cck;
/* if the rate isn't a well known legacy rate, take the lowest one */
@ -277,8 +276,9 @@ static u32 iwl_mvm_convert_rate_idx(struct iwl_mvm *mvm,
info,
info->control.vif);
/* Get PLCP rate for tx_cmd->rate_n_flags */
rate_plcp = iwl_mvm_mac80211_idx_to_hwrate(mvm->fw, rate_idx);
/* Get FW rate for tx_cmd->rate_n_flags */
rate_flags |= iwl_mvm_rate_idx_to_fw_idx(mvm->fw, rate_idx);
is_cck = (rate_idx >= IWL_FIRST_CCK_RATE) &&
(rate_idx <= IWL_LAST_CCK_RATE);
@ -288,7 +288,7 @@ static u32 iwl_mvm_convert_rate_idx(struct iwl_mvm *mvm,
else
rate_flags |= RATE_MCS_MOD_TYPE_CCK;
return (u32)rate_plcp | rate_flags;
return rate_flags;
}
static u32 iwl_mvm_get_inject_tx_rate(struct iwl_mvm *mvm,

View File

@ -157,7 +157,7 @@ int iwl_mvm_legacy_rate_to_mac80211_idx(u32 rate_n_flags,
return -1;
}
u8 iwl_mvm_mac80211_idx_to_hwrate(const struct iwl_fw *fw, int rate_idx)
u8 iwl_mvm_rate_idx_to_fw_idx(const struct iwl_fw *fw, int rate_idx)
{
return rate_idx >= IWL_FIRST_OFDM_RATE ?
rate_idx - IWL_FIRST_OFDM_RATE :