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
MFC after: 3 days

Details

Provenance
bzAuthored on Sep 30 2023, 7:59 AM
Parents
rGf7a5903de272: zfs: merge openzfs/zfs@e13538856
Branches
Unknown
Tags
Unknown