]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: iwlwifi: mld: stop supporting rate_n_flags version 2
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 12 May 2026 05:23:07 +0000 (08:23 +0300)
committerMiri Korenblit <miriam.rachel.korenblit@intel.com>
Tue, 26 May 2026 12:17:10 +0000 (15:17 +0300)
Now as the oldest fw we support is core 101, and it supports only
version 3, remove version 2.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20260512082114.39e460bc8235.I4cd02612a68a3f183d51f428569448670bd19d9b@changeid
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
drivers/net/wireless/intel/iwlwifi/mld/debugfs.c
drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
drivers/net/wireless/intel/iwlwifi/mld/mld.c
drivers/net/wireless/intel/iwlwifi/mld/mld.h
drivers/net/wireless/intel/iwlwifi/mld/rx.c
drivers/net/wireless/intel/iwlwifi/mld/tlc.c
drivers/net/wireless/intel/iwlwifi/mld/tx.c

index b05b58eb12813c765e849a73ce022b2e2116a8bd..9ec8ddce0c38de3dad9e00185c7f0c6f36bcebdd 100644 (file)
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2024-2025 Intel Corporation
+ * Copyright (C) 2024-2026 Intel Corporation
  */
 
 #include "mld.h"
@@ -1035,7 +1035,6 @@ static ssize_t _iwl_dbgfs_fixed_rate_write(struct iwl_mld *mld, char *buf,
 
        /* input is in FW format (v2 or v3) so convert to v3 */
        rate = iwl_v3_rate_from_v2_v3(cpu_to_le32(rate), v3);
-       rate = le32_to_cpu(iwl_v3_rate_to_v2_v3(rate, mld->fw_rates_ver_3));
 
        ret = iwl_mld_send_tlc_dhc(mld, fw_sta_id,
                                   partial ? IWL_TLC_DEBUG_PARTIAL_FIXED_RATE :
index f37a365a87a48190433c41e8ee73c666edfca912..4315b1b2b36bcb4a51e1735d4fa083c00d4f81bd 100644 (file)
@@ -455,22 +455,6 @@ static void iwl_mac_hw_set_misc(struct iwl_mld *mld)
 
 static int iwl_mld_hw_verify_preconditions(struct iwl_mld *mld)
 {
-       int ratecheck;
-
-       /* check for rates version 3 */
-       ratecheck =
-               (iwl_fw_lookup_cmd_ver(mld->fw, TX_CMD, 0) >= 11) +
-               (iwl_fw_lookup_notif_ver(mld->fw, DATA_PATH_GROUP,
-                                        TLC_MNG_UPDATE_NOTIF, 0) >= 4) +
-               (iwl_fw_lookup_notif_ver(mld->fw, LEGACY_GROUP,
-                                        REPLY_RX_MPDU_CMD, 0) >= 6) +
-               (iwl_fw_lookup_notif_ver(mld->fw, LONG_GROUP, TX_CMD, 0) >= 9);
-
-       if (ratecheck != 0 && ratecheck != 4) {
-               IWL_ERR(mld, "Firmware has inconsistent rates\n");
-               return -EINVAL;
-       }
-
        /* 11ax is expected to be enabled for all supported devices */
        if (WARN_ON(!mld->nvm_data->sku_cap_11ax_enable))
                return -EINVAL;
index dfd4798c103a1341d9bef6c868ea1e74115e0eff..9a3b768fce7ad89b2354f8741ee82993dc2b70bb 100644 (file)
@@ -413,9 +413,6 @@ iwl_op_mode_mld_start(struct iwl_trans *trans, const struct iwl_rf_cfg *cfg,
 
        iwl_construct_mld(mld, trans, cfg, fw, hw, dbgfs_dir);
 
-       /* we'll verify later it matches between commands */
-       mld->fw_rates_ver_3 = iwl_fw_lookup_cmd_ver(mld->fw, TX_CMD, 0) >= 11;
-
        iwl_mld_construct_fw_runtime(mld, trans, fw, dbgfs_dir);
 
        iwl_mld_get_bios_tables(mld);
index 69da3c346394b6fb44f5eca5b73def30bf7a270f..1a59b3e4014d640aa0b46ddf67627e60373b83e2 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
 /*
- * Copyright (C) 2024-2025 Intel Corporation
+ * Copyright (C) 2024-2026 Intel Corporation
  */
 #ifndef __iwl_mld_h__
 #define __iwl_mld_h__
  *     TX rate_n_flags for non-STA mgmt frames (toggles on every TX failure).
  * @set_tx_ant: stores the last TX antenna bitmask set by user space (if any)
  * @set_rx_ant: stores the last RX antenna bitmask set by user space (if any)
- * @fw_rates_ver_3: FW rates are in version 3
  * @low_latency: low-latency manager.
  * @tzone: thermal zone device's data
  * @cooling_dev: cooling device's related data
@@ -299,8 +298,6 @@ struct iwl_mld {
        u8 set_tx_ant;
        u8 set_rx_ant;
 
-       bool fw_rates_ver_3;
-
        struct iwl_mld_low_latency low_latency;
 
        bool ibss_manager;
index a9f08f9846339dbde92a8130766230d78158acb6..01603dc07f0afea33123d809aa83fffa3b02e1c4 100644 (file)
@@ -39,8 +39,7 @@ iwl_mld_fill_phy_data_from_mpdu(struct iwl_mld *mld,
        }
 
        phy_data->phy_info = le16_to_cpu(desc->phy_info);
-       phy_data->rate_n_flags = iwl_v3_rate_from_v2_v3(desc->v3.rate_n_flags,
-                                                       mld->fw_rates_ver_3);
+       phy_data->rate_n_flags = le32_to_cpu(desc->v3.rate_n_flags);
        phy_data->gp2_on_air_rise = le32_to_cpu(desc->v3.gp2_on_air_rise);
        phy_data->energy_a = desc->v3.energy_a;
        phy_data->energy_b = desc->v3.energy_b;
index 7db56eefc7df71787b144f7ca170d50f2e86ba47..fb68d8810e149e7b9b0a7769d4da473638261049 100644 (file)
@@ -956,9 +956,7 @@ void iwl_mld_handle_tlc_notif(struct iwl_mld *mld,
                if (WARN_ON(!mld_link_sta))
                        return;
 
-               mld_link_sta->last_rate_n_flags =
-                       iwl_v3_rate_from_v2_v3(notif->rate,
-                                              mld->fw_rates_ver_3);
+               mld_link_sta->last_rate_n_flags = le32_to_cpu(notif->rate);
 
                rs_pretty_print_rate(pretty_rate, sizeof(pretty_rate),
                                     mld_link_sta->last_rate_n_flags);
index dec8ecd6b805aaa553a60ffccbf7dbee0c574d76..636d24633e57aac5c666addd5618f462851408b5 100644 (file)
@@ -494,7 +494,7 @@ static __le32 iwl_mld_get_tx_rate_n_flags(struct iwl_mld *mld,
                rate = iwl_mld_mac80211_rate_idx_to_fw(mld, info, -1) |
                       iwl_mld_get_tx_ant(mld, info, sta, fc);
 
-       return iwl_v3_rate_to_v2_v3(rate, mld->fw_rates_ver_3);
+       return cpu_to_le32(rate);
 }
 
 static void
@@ -1012,14 +1012,11 @@ void iwl_mld_tx_from_txq(struct iwl_mld *mld, struct ieee80211_txq *txq)
        rcu_read_unlock();
 }
 
-static void iwl_mld_hwrate_to_tx_rate(struct iwl_mld *mld,
-                                     __le32 rate_n_flags_fw,
+static void iwl_mld_hwrate_to_tx_rate(u32 rate_n_flags,
                                      struct ieee80211_tx_info *info)
 {
        enum nl80211_band band = info->band;
        struct ieee80211_tx_rate *tx_rate = &info->status.rates[0];
-       u32 rate_n_flags = iwl_v3_rate_from_v2_v3(rate_n_flags_fw,
-                                                 mld->fw_rates_ver_3);
        u32 sgi = rate_n_flags & RATE_MCS_SGI_MSK;
        u32 chan_width = rate_n_flags & RATE_MCS_CHAN_WIDTH_MSK;
        u32 format = rate_n_flags & RATE_MCS_MOD_TYPE_MSK;
@@ -1150,7 +1147,8 @@ void iwl_mld_handle_tx_resp_notif(struct iwl_mld *mld,
                        iwl_dbg_tlv_time_point(&mld->fwrt, tp, NULL);
                }
 
-               iwl_mld_hwrate_to_tx_rate(mld, tx_resp->initial_rate, info);
+               iwl_mld_hwrate_to_tx_rate(le32_to_cpu(tx_resp->initial_rate),
+                                         info);
 
                if (likely(!iwl_mld_time_sync_frame(mld, skb, hdr->addr1)))
                        ieee80211_tx_status_skb(mld->hw, skb);