HomeFreeBSD

LinuxKPI: 802.11: fix problem removing sta

Description

LinuxKPI: 802.11: fix problem removing sta

Move the call to lkpi_disassoc() before the state change to
IEEE80211_STA_NOTEXIST which will remove the sta (from firmware).
Based on a comment it seems that originally we had to do it the
other way round.
iwlwifi(4) has a check and will silently not remove the sta from
the firmware when vif->cfg.assoc is still set (see iwl_mvm_sta_del()).
This leads to the LinuxKPI 802.11 code thinking the sta is gone as
downward state changes by the mac80211 op (*sta_state)() may not fail.
Once we try to assoc with a newly added station later, iwlwifi firmware
will run into an assert having two ap_sta set on the same vif.
We can observe that problem in iwlwifi(4) having __le32 sta_id = 1
instead of sta_id = 0 in iwl_mvm_sta_cfg_cmd{} on the HCMD.

This should fix one of the most seen problems with iwlwifi(4), e.g.,
when running service netif restart wlan0 or
service wpa_supplicant restart wlan0.

Sponsored by: The FreeBSD Foundation
Approved by: re (gjb)

(cherry picked from commit 16e688b2a403a3dbc05de3b9f8a3132838613790)
(cherry picked from commit 4e26de26431be8b830ef9d2d2397490b68437ddd)

Details

Provenance
bzAuthored on Sep 30 2023, 7:59 AM
Parents
rGf45c8d49afb5: iwlwifi: update driver from upstream
Branches
Unknown
Tags
Unknown