Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

wifi: cfg80211: stop radar detection in cfg80211_leave()

If an interface is set down or, per the previous patch, changes
type, radar detection for it should be cancelled. This is done
for AP mode in mac80211 (somewhat needlessly, since cfg80211 can
do it, but didn't until now), but wasn't handled for mesh, so if
radar detection was started and then the interface set down or
its type switched (the latter sometimes happning in the hwsim
test 'mesh_peer_connected_dfs'), radar detection would be around
with the interface unknown to the driver, later leading to some
warnings around chanctx usage.

Link: https://patch.msgid.link/20251121174021.290120e419e3.I2a5650c9062e29c988992dd8ce0d8eb570d23267@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+21
+1
net/wireless/core.c
··· 1380 1380 1381 1381 cfg80211_pmsr_wdev_down(wdev); 1382 1382 1383 + cfg80211_stop_radar_detection(wdev); 1383 1384 cfg80211_stop_background_radar_detection(wdev); 1384 1385 1385 1386 switch (wdev->iftype) {
+1
net/wireless/core.h
··· 489 489 struct wireless_dev *wdev, 490 490 struct cfg80211_chan_def *chandef); 491 491 492 + void cfg80211_stop_radar_detection(struct wireless_dev *wdev); 492 493 void cfg80211_stop_background_radar_detection(struct wireless_dev *wdev); 493 494 494 495 void cfg80211_background_cac_done_wk(struct work_struct *work);
+19
net/wireless/mlme.c
··· 1295 1295 return 0; 1296 1296 } 1297 1297 1298 + void cfg80211_stop_radar_detection(struct wireless_dev *wdev) 1299 + { 1300 + struct wiphy *wiphy = wdev->wiphy; 1301 + struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); 1302 + int link_id; 1303 + 1304 + for_each_valid_link(wdev, link_id) { 1305 + struct cfg80211_chan_def chandef; 1306 + 1307 + if (!wdev->links[link_id].cac_started) 1308 + continue; 1309 + 1310 + chandef = *wdev_chandef(wdev, link_id); 1311 + rdev_end_cac(rdev, wdev->netdev, link_id); 1312 + nl80211_radar_notify(rdev, &chandef, NL80211_RADAR_CAC_ABORTED, 1313 + wdev->netdev, GFP_KERNEL); 1314 + } 1315 + } 1316 + 1298 1317 void cfg80211_stop_background_radar_detection(struct wireless_dev *wdev) 1299 1318 { 1300 1319 struct wiphy *wiphy = wdev->wiphy;