HomeFreeBSD

LinuxKPI: 802.11: rework sta state machine compatibility

Description

LinuxKPI: 802.11: rework sta state machine compatibility

Rework the state machine parts for various reasons:
(1) to add sta tracing to be able to better follow ni and lsta state
(2) factor out/implement lkpi_lsta_remove() to unlink the lsta and

free the ni reference.

(3) avoid calling lkpi_disassoc() when you would think you should as

changing BSS_CHANGED_ASSOC setting vif->bss_conf.assoc to false
triggers a sta removal from firmware in iwlwifi which then triggers
follow-up errors.  I do not understand why they use flags and state
and ?? in parallel (too many options and ways to do things?).

(4) when "roaming" (or being disassoc/deauth) from an AP both net80211

and apparently so mac80211 re-start with a new node/sta.  This
results in us losing one or the other state in the compat layer
or not updating firmware appropriately.  To resolve this make use
of (a) the newly introduced (*iv_update_bss)() and (b) always tear
a station down to "State 1" (INIT/SCAN/pre-AUTH) and only if needed
re-create the new one (if we go to AUTH).
A slightly earlier version has survived a night of wpa_supplicant
and hostapd fighting each other over disassoc and deauth and
re-associating/authorizing.

While there update a few comments and typos and do a few minor auxiliary
changes which are hard or not worth to extract.

Sponsored by: The FreeBSD Foundation

(cherry picked from commit d9f59799fc3e7940c47aa674c25994e640eae45e)
(cherry picked from commit 67674c1cb11512f09873c6d8e463af31548ef87f)

Details

Provenance
bzAuthored on Mar 22 2022, 6:34 PM
Parents
rGbc472e0a3ef0: LinuxKPI: 802.11: factor out dtim/tsf updates
Branches
Unknown
Tags
Unknown