diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index 357f451a3f1..4540c1aaf1c 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2021,6 +2021,7 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int struct ieee80211_prep_tx_info prep_tx_info; uint32_t changed; int error; + bool synched; /* * In here we use vap->iv_bss until lvif->lvif_bss is set. @@ -2211,14 +2212,6 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int __func__, ni, ni->ni_drv_data)); lsta = ni->ni_drv_data; - /* - * Make sure in case the sta did not change and we re-add it, - * that we can tx again. - */ - LKPI_80211_LSTA_TXQ_LOCK(lsta); - lsta->txq_ready = true; - LKPI_80211_LSTA_TXQ_UNLOCK(lsta); - /* Insert the [l]sta into the list of known stations. */ list_add_tail(&lsta->lsta_list, &lvif->lsta_list); @@ -2292,10 +2285,10 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int ieee80211_ref_node(lsta->ni); lvif->lvif_bss = lsta; if (lsta->ni == vap->iv_bss) { - lvif->lvif_bss_synched = true; + lvif->lvif_bss_synched = synched = true; } else { /* Set to un-synched no matter what. */ - lvif->lvif_bss_synched = false; + lvif->lvif_bss_synched = synched = false; /* * We do not error as someone has to take us down. * If we are followed by a 2nd, new net80211::join1() going to @@ -2305,9 +2298,20 @@ lkpi_sta_scan_to_auth(struct ieee80211vap *vap, enum ieee80211_state nstate, int * to net80211 as we never used the node beyond alloc()/free() * and we do not hold an extra reference for that anymore given * ni : lsta == 1:1. + * Problem is if we do not error a MGMT/AUTH frame will be + * sent from net80211::sta_newstate(); disable lsta queue below. */ } LKPI_80211_LVIF_UNLOCK(lvif); + /* + * Make sure in case the sta did not change and we re-added it, + * that we can tx again but only if the vif/iv_bss are in sync. + * Otherwise this should prevent the MGMT/AUTH frame from being + * sent triggering a warning in iwlwifi. + */ + LKPI_80211_LSTA_TXQ_LOCK(lsta); + lsta->txq_ready = synched; + LKPI_80211_LSTA_TXQ_UNLOCK(lsta); goto out_relocked; out: