Skip to content

Commit 7777018

Browse files
Miriam-Racheljmberg-intel
authored andcommitted
wifi: iwlwifi: cancel session protection only if there is one
mac80211 might (due to an unavoidable race) cancel a ROC that has already expired. In that case the driver should not send the session protection cmd to cancel the ROC. When session protection is supported, the te_data::id field is reused to save the configuration id. Check it before sending the cmd. Signed-off-by: Miri Korenblit <[email protected]> Link: https://msgid.link/20240205211151.30176bf869d9.Id811c20d3746b870cbe0c946bbfe1c0ab0a290cb@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 35c1bbd commit 7777018

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/time-event.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,13 +1224,21 @@ void iwl_mvm_stop_roc(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
12241224
if (fw_has_capa(&mvm->fw->ucode_capa,
12251225
IWL_UCODE_TLV_CAPA_SESSION_PROT_CMD)) {
12261226
mvmvif = iwl_mvm_vif_from_mac80211(vif);
1227+
te_data = &mvmvif->time_event_data;
1228+
1229+
if (vif->type == NL80211_IFTYPE_P2P_DEVICE) {
1230+
if (te_data->id >= SESSION_PROTECT_CONF_MAX_ID) {
1231+
IWL_DEBUG_TE(mvm,
1232+
"No remain on channel event\n");
1233+
return;
1234+
}
12271235

1228-
if (vif->type == NL80211_IFTYPE_P2P_DEVICE)
12291236
iwl_mvm_cancel_session_protection(mvm, vif,
1230-
mvmvif->time_event_data.id,
1231-
mvmvif->time_event_data.link_id);
1232-
else
1237+
te_data->id,
1238+
te_data->link_id);
1239+
} else {
12331240
iwl_mvm_roc_station_remove(mvm, mvmvif);
1241+
}
12341242
goto cleanup_roc;
12351243
}
12361244

0 commit comments

Comments
 (0)