]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: iwlwifi: mvm: rename iwl_mvm_mac80211_idx_to_hwrate()
authorJohannes Berg <johannes.berg@intel.com>
Wed, 27 May 2026 20:05:03 +0000 (23:05 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 3 Jun 2026 14:02:54 +0000 (17:02 +0300)
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>
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
drivers/net/wireless/intel/iwlwifi/mvm/tx.c
drivers/net/wireless/intel/iwlwifi/mvm/utils.c

index 8ffa72aca3cf7b10c5cea06f4c6ed842ad226e00..3e5084d10a60bf6259da943de0a3b5d96bfab44b 100644 (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);
index be89b84204fb3b578aa14260dd90aacdb445ee63..393acf5c5f55ab65da84587eabf428fc6b34aad8 100644 (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);
 
index bca13417e82c91b4b21e7b23deec35c000a7e372..dc69c71faa76cae14fa2540e6cc5269097133c7f 100644 (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,
index f052537e9567e933fd0a6ed7e16ce6154abf137d..8aba9768afcfc564da9a4a605690262ca1924f48 100644 (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 :