// 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"
/* 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 :
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;
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);
/* 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
u8 set_tx_ant;
u8 set_rx_ant;
- bool fw_rates_ver_3;
-
struct iwl_mld_low_latency low_latency;
bool ibss_manager;
}
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;
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);
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
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;
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);