Skip to content

Commit 3592c00

Browse files
jmberg-intelMiriam-Rachel
authored andcommitted
wifi: iwlwifi: mvm: fix beacon template/fixed rate
During the development of the rate changes, I evidently made some changes that shouldn't have been there; beacon templates with rate_n_flags are only in old versions, so no changes to them should have been necessary, and evidently broke on some devices. This also would have broken fixed (injection) rates, it would seem. Restore the old handling of this. Fixes: dabc88c ("wifi: iwlwifi: handle v3 rates") Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220558 Reviewed-by: Benjamin Berg <benjamin.berg@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Link: https://patch.msgid.link/20251008112044.3bb8ea849d8d.I90f4d2b2c1f62eaedaf304a61d2ab9e50c491c2d@changeid Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
1 parent f4c737d commit 3592c00

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -938,19 +938,12 @@ u8 iwl_mvm_mac_ctxt_get_lowest_rate(struct iwl_mvm *mvm,
938938

939939
u16 iwl_mvm_mac_ctxt_get_beacon_flags(const struct iwl_fw *fw, u8 rate_idx)
940940
{
941+
u16 flags = iwl_mvm_mac80211_idx_to_hwrate(fw, rate_idx);
941942
bool is_new_rate = iwl_fw_lookup_cmd_ver(fw, BEACON_TEMPLATE_CMD, 0) > 10;
942-
u16 flags, cck_flag;
943-
944-
if (is_new_rate) {
945-
flags = iwl_mvm_mac80211_idx_to_hwrate(fw, rate_idx);
946-
cck_flag = IWL_MAC_BEACON_CCK;
947-
} else {
948-
cck_flag = IWL_MAC_BEACON_CCK_V1;
949-
flags = iwl_fw_rate_idx_to_plcp(rate_idx);
950-
}
951943

952944
if (rate_idx <= IWL_LAST_CCK_RATE)
953-
flags |= cck_flag;
945+
flags |= is_new_rate ? IWL_MAC_BEACON_CCK
946+
: IWL_MAC_BEACON_CCK_V1;
954947

955948
return flags;
956949
}

drivers/net/wireless/intel/iwlwifi/mvm/utils.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,15 @@ int iwl_mvm_legacy_rate_to_mac80211_idx(u32 rate_n_flags,
159159

160160
u8 iwl_mvm_mac80211_idx_to_hwrate(const struct iwl_fw *fw, int rate_idx)
161161
{
162-
return (rate_idx >= IWL_FIRST_OFDM_RATE ?
163-
rate_idx - IWL_FIRST_OFDM_RATE :
164-
rate_idx);
162+
if (iwl_fw_lookup_cmd_ver(fw, TX_CMD, 0) > 8)
163+
/* In the new rate legacy rates are indexed:
164+
* 0 - 3 for CCK and 0 - 7 for OFDM.
165+
*/
166+
return (rate_idx >= IWL_FIRST_OFDM_RATE ?
167+
rate_idx - IWL_FIRST_OFDM_RATE :
168+
rate_idx);
169+
170+
return iwl_fw_rate_idx_to_plcp(rate_idx);
165171
}
166172

167173
u8 iwl_mvm_mac80211_ac_to_ucode_ac(enum ieee80211_ac_numbers ac)

0 commit comments

Comments
 (0)