]> git.ipfire.org Git - thirdparty/linux.git/commit
wifi: cfg80211: fix CQM for non-range use
authorJohannes Berg <johannes.berg@intel.com>
Mon, 6 Nov 2023 22:17:16 +0000 (23:17 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 24 Nov 2023 17:29:35 +0000 (18:29 +0100)
commit7e7efdda6adb385fbdfd6f819d76bc68c923c394
tree0277d1dd09ee0fd09386cd8b78ca15670f4aeaa6
parent3e3a2b645c043f7e3e488d5011478cefb69bbe8b
wifi: cfg80211: fix CQM for non-range use

My prior race fix here broke CQM when ranges aren't used, as
the reporting worker now requires the cqm_config to be set in
the wdev, but isn't set when there's no range configured.

Rather than continuing to special-case the range version, set
the cqm_config always and configure accordingly, also tracking
if range was used or not to be able to clear the configuration
appropriately with the same API, which was actually not right
if both were implemented by a driver for some reason, as is
the case with mac80211 (though there the implementations are
equivalent so it doesn't matter.)

Also, the original multiple-RSSI commit lost checking for the
callback, so might have potentially crashed if a driver had
neither implementation, and userspace tried to use it despite
not being advertised as supported.

Cc: stable@vger.kernel.org
Fixes: 4a4b8169501b ("cfg80211: Accept multiple RSSI thresholds for CQM")
Fixes: 37c20b2effe9 ("wifi: cfg80211: fix cqm_config access race")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/core.h
net/wireless/nl80211.c