Skip to content

Commit a35f64a

Browse files
committed
Miri Korenblit says: ==================== iwlwifi fixes: - avoid link toggling - fix beacon template rate - don't use iterator outside the loop ==================== Link: https://patch.msgid.link/DM3PPF63A6024A9E52FF4A7B23F283B7FC7A3CCA@DM3PPF63A6024A9.namprd11.prod.outlook.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2 parents c4e1ac0 + 1a22262 commit a35f64a

4 files changed

Lines changed: 20 additions & 26 deletions

File tree

drivers/net/wireless/intel/iwlwifi/mld/link.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -708,18 +708,13 @@ static int
708708
iwl_mld_get_chan_load_from_element(struct iwl_mld *mld,
709709
struct ieee80211_bss_conf *link_conf)
710710
{
711-
struct ieee80211_vif *vif = link_conf->vif;
712711
const struct cfg80211_bss_ies *ies;
713712
const struct element *bss_load_elem = NULL;
714713
const struct ieee80211_bss_load_elem *bss_load;
715714

716715
guard(rcu)();
717716

718-
if (ieee80211_vif_link_active(vif, link_conf->link_id))
719-
ies = rcu_dereference(link_conf->bss->beacon_ies);
720-
else
721-
ies = rcu_dereference(link_conf->bss->ies);
722-
717+
ies = rcu_dereference(link_conf->bss->beacon_ies);
723718
if (ies)
724719
bss_load_elem = cfg80211_find_elem(WLAN_EID_QBSS_LOAD,
725720
ies->data, ies->len);

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/time-event.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ static int iwl_mvm_aux_roc_te_handle_notif(struct iwl_mvm *mvm,
463463
if (!aux_roc_te) /* Not a Aux ROC time event */
464464
return -EINVAL;
465465

466-
iwl_mvm_te_check_trigger(mvm, notif, te_data);
466+
iwl_mvm_te_check_trigger(mvm, notif, aux_roc_te);
467467

468468
IWL_DEBUG_TE(mvm,
469469
"Aux ROC time event notification - UID = 0x%x action %d (error = %d)\n",
@@ -475,14 +475,14 @@ static int iwl_mvm_aux_roc_te_handle_notif(struct iwl_mvm *mvm,
475475
/* End TE, notify mac80211 */
476476
ieee80211_remain_on_channel_expired(mvm->hw);
477477
iwl_mvm_roc_finished(mvm); /* flush aux queue */
478-
list_del(&te_data->list); /* remove from list */
479-
te_data->running = false;
480-
te_data->vif = NULL;
481-
te_data->uid = 0;
482-
te_data->id = TE_MAX;
478+
list_del(&aux_roc_te->list); /* remove from list */
479+
aux_roc_te->running = false;
480+
aux_roc_te->vif = NULL;
481+
aux_roc_te->uid = 0;
482+
aux_roc_te->id = TE_MAX;
483483
} else if (le32_to_cpu(notif->action) == TE_V2_NOTIF_HOST_EVENT_START) {
484484
set_bit(IWL_MVM_STATUS_ROC_AUX_RUNNING, &mvm->status);
485-
te_data->running = true;
485+
aux_roc_te->running = true;
486486
ieee80211_ready_on_channel(mvm->hw); /* Start TE */
487487
} else {
488488
IWL_DEBUG_TE(mvm,

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)