1 From: Lorenzo Bianconi <lorenzo@kernel.org>
2 Date: Mon, 29 Nov 2021 14:11:24 +0100
3 Subject: [PATCH] cfg80211: rename offchannel_chain structs to background_chain
4 to avoid confusion with ETSI standard
6 ETSI standard defines "Offchannel CAC" as:
7 "Off-Channel CAC is performed by a number of non-continuous checks
8 spread over a period in time. This period, which is required to
9 determine the presence of radar signals, is defined as the Off-Channel
11 Minimum Off-Channel CAC Time 6 minutes and Maximum Off-Channel CAC Time
13 mac80211 implementation refers to a dedicated hw chain used for continuous
14 radar monitoring. Rename offchannel_* references to background_* in
15 order to avoid confusion with ETSI standard.
17 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
18 Link: https://lore.kernel.org/r/4204cc1d648d76b44557981713231e030a3bd991.1638190762.git.lorenzo@kernel.org
19 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
22 --- a/include/net/cfg80211.h
23 +++ b/include/net/cfg80211.h
24 @@ -4058,14 +4058,14 @@ struct mgmt_frame_regs {
26 * @color_change: Initiate a color change.
28 - * @set_radar_offchan: Configure dedicated offchannel chain available for
29 + * @set_radar_background: Configure dedicated offchannel chain available for
30 * radar/CAC detection on some hw. This chain can't be used to transmit
31 * or receive frames and it is bounded to a running wdev.
32 - * Offchannel radar/CAC detection allows to avoid the CAC downtime
33 + * Background radar/CAC detection allows to avoid the CAC downtime
34 * switching to a different channel during CAC detection on the selected
36 * The caller is expected to set chandef pointer to NULL in order to
37 - * disable offchannel CAC/radar detection.
38 + * disable background CAC/radar detection.
41 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
42 @@ -4396,8 +4396,8 @@ struct cfg80211_ops {
43 int (*color_change)(struct wiphy *wiphy,
44 struct net_device *dev,
45 struct cfg80211_color_change_settings *params);
46 - int (*set_radar_offchan)(struct wiphy *wiphy,
47 - struct cfg80211_chan_def *chandef);
48 + int (*set_radar_background)(struct wiphy *wiphy,
49 + struct cfg80211_chan_def *chandef);
53 @@ -7601,9 +7601,9 @@ cfg80211_radar_event(struct wiphy *wiphy
57 -cfg80211_offchan_radar_event(struct wiphy *wiphy,
58 - struct cfg80211_chan_def *chandef,
60 +cfg80211_background_radar_event(struct wiphy *wiphy,
61 + struct cfg80211_chan_def *chandef,
64 __cfg80211_radar_event(wiphy, chandef, true, gfp);
66 @@ -7638,13 +7638,13 @@ void cfg80211_cac_event(struct net_devic
67 enum nl80211_radar_event event, gfp_t gfp);
70 - * cfg80211_offchan_cac_abort - Channel Availability Check offchan abort event
71 + * cfg80211_background_cac_abort - Channel Availability Check offchan abort event
74 * This function is called by the driver when a Channel Availability Check
75 * (CAC) is aborted by a offchannel dedicated chain.
77 -void cfg80211_offchan_cac_abort(struct wiphy *wiphy);
78 +void cfg80211_background_cac_abort(struct wiphy *wiphy);
81 * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
82 --- a/include/net/mac80211.h
83 +++ b/include/net/mac80211.h
84 @@ -3937,14 +3937,14 @@ struct ieee80211_prep_tx_info {
86 * @twt_teardown_request: Update the hw with TWT teardown request received
88 - * @set_radar_offchan: Configure dedicated offchannel chain available for
89 + * @set_radar_background: Configure dedicated offchannel chain available for
90 * radar/CAC detection on some hw. This chain can't be used to transmit
91 * or receive frames and it is bounded to a running wdev.
92 - * Offchannel radar/CAC detection allows to avoid the CAC downtime
93 + * Background radar/CAC detection allows to avoid the CAC downtime
94 * switching to a different channel during CAC detection on the selected
96 * The caller is expected to set chandef pointer to NULL in order to
97 - * disable offchannel CAC/radar detection.
98 + * disable background CAC/radar detection.
99 * @net_fill_forward_path: Called from .ndo_fill_forward_path in order to
100 * resolve a path for hardware flow offloading
102 @@ -4275,8 +4275,8 @@ struct ieee80211_ops {
103 struct ieee80211_twt_setup *twt);
104 void (*twt_teardown_request)(struct ieee80211_hw *hw,
105 struct ieee80211_sta *sta, u8 flowid);
106 - int (*set_radar_offchan)(struct ieee80211_hw *hw,
107 - struct cfg80211_chan_def *chandef);
108 + int (*set_radar_background)(struct ieee80211_hw *hw,
109 + struct cfg80211_chan_def *chandef);
110 #if LINUX_VERSION_IS_GEQ(5,10,0)
111 int (*net_fill_forward_path)(struct ieee80211_hw *hw,
112 struct ieee80211_vif *vif,
113 --- a/include/uapi/linux/nl80211.h
114 +++ b/include/uapi/linux/nl80211.h
115 @@ -2608,10 +2608,10 @@ enum nl80211_commands {
116 * Mandatory parameter for the transmitting interface to enable MBSSID.
117 * Optional for the non-transmitting interfaces.
119 - * @NL80211_ATTR_RADAR_OFFCHAN: Configure dedicated offchannel chain available for
120 - * radar/CAC detection on some hw. This chain can't be used to transmit
121 - * or receive frames and it is bounded to a running wdev.
122 - * Offchannel radar/CAC detection allows to avoid the CAC downtime
123 + * @NL80211_ATTR_RADAR_BACKGROUND: Configure dedicated offchannel chain
124 + * available for radar/CAC detection on some hw. This chain can't be used
125 + * to transmit or receive frames and it is bounded to a running wdev.
126 + * Background radar/CAC detection allows to avoid the CAC downtime
127 * switching on a different channel during CAC detection on the selected
130 @@ -3121,7 +3121,7 @@ enum nl80211_attrs {
131 NL80211_ATTR_MBSSID_CONFIG,
132 NL80211_ATTR_MBSSID_ELEMS,
134 - NL80211_ATTR_RADAR_OFFCHAN,
135 + NL80211_ATTR_RADAR_BACKGROUND,
137 /* add attributes here, update the policy in nl80211.c */
139 @@ -6022,7 +6022,7 @@ enum nl80211_feature_flags {
140 * @NL80211_EXT_FEATURE_BSS_COLOR: The driver supports BSS color collision
141 * detection and change announcemnts.
143 - * @NL80211_EXT_FEATURE_RADAR_OFFCHAN: Device supports offchannel radar/CAC
144 + * @NL80211_EXT_FEATURE_RADAR_BACKGROUND: Device supports background radar/CAC
147 * @NUM_NL80211_EXT_FEATURES: number of extended features.
148 @@ -6090,7 +6090,7 @@ enum nl80211_ext_feature_index {
149 NL80211_EXT_FEATURE_SECURE_RTT,
150 NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
151 NL80211_EXT_FEATURE_BSS_COLOR,
152 - NL80211_EXT_FEATURE_RADAR_OFFCHAN,
153 + NL80211_EXT_FEATURE_RADAR_BACKGROUND,
155 /* add new features before the definition below */
156 NUM_NL80211_EXT_FEATURES,
157 --- a/net/mac80211/cfg.c
158 +++ b/net/mac80211/cfg.c
159 @@ -4342,15 +4342,15 @@ out:
163 -ieee80211_set_radar_offchan(struct wiphy *wiphy,
164 - struct cfg80211_chan_def *chandef)
165 +ieee80211_set_radar_background(struct wiphy *wiphy,
166 + struct cfg80211_chan_def *chandef)
168 struct ieee80211_local *local = wiphy_priv(wiphy);
170 - if (!local->ops->set_radar_offchan)
171 + if (!local->ops->set_radar_background)
174 - return local->ops->set_radar_offchan(&local->hw, chandef);
175 + return local->ops->set_radar_background(&local->hw, chandef);
178 const struct cfg80211_ops mac80211_config_ops = {
179 @@ -4457,5 +4457,5 @@ const struct cfg80211_ops mac80211_confi
180 .reset_tid_config = ieee80211_reset_tid_config,
181 .set_sar_specs = ieee80211_set_sar_specs,
182 .color_change = ieee80211_color_change,
183 - .set_radar_offchan = ieee80211_set_radar_offchan,
184 + .set_radar_background = ieee80211_set_radar_background,
186 --- a/net/wireless/chan.c
187 +++ b/net/wireless/chan.c
188 @@ -716,13 +716,13 @@ static bool
189 cfg80211_offchan_chain_is_active(struct cfg80211_registered_device *rdev,
190 struct ieee80211_channel *channel)
192 - if (!rdev->offchan_radar_wdev)
193 + if (!rdev->background_radar_wdev)
196 - if (!cfg80211_chandef_valid(&rdev->offchan_radar_chandef))
197 + if (!cfg80211_chandef_valid(&rdev->background_radar_chandef))
200 - return cfg80211_is_sub_chan(&rdev->offchan_radar_chandef, channel);
201 + return cfg80211_is_sub_chan(&rdev->background_radar_chandef, channel);
204 bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,
205 --- a/net/wireless/core.c
206 +++ b/net/wireless/core.c
207 @@ -543,9 +543,10 @@ use_default_name:
208 INIT_WORK(&rdev->rfkill_block, cfg80211_rfkill_block_work);
209 INIT_WORK(&rdev->conn_work, cfg80211_conn_work);
210 INIT_WORK(&rdev->event_work, cfg80211_event_work);
211 - INIT_WORK(&rdev->offchan_cac_abort_wk, cfg80211_offchan_cac_abort_wk);
212 - INIT_DELAYED_WORK(&rdev->offchan_cac_done_wk,
213 - cfg80211_offchan_cac_done_wk);
214 + INIT_WORK(&rdev->background_cac_abort_wk,
215 + cfg80211_background_cac_abort_wk);
216 + INIT_DELAYED_WORK(&rdev->background_cac_done_wk,
217 + cfg80211_background_cac_done_wk);
219 init_waitqueue_head(&rdev->dev_wait);
221 @@ -1055,13 +1056,13 @@ void wiphy_unregister(struct wiphy *wiph
222 cancel_work_sync(&rdev->conn_work);
223 flush_work(&rdev->event_work);
224 cancel_delayed_work_sync(&rdev->dfs_update_channels_wk);
225 - cancel_delayed_work_sync(&rdev->offchan_cac_done_wk);
226 + cancel_delayed_work_sync(&rdev->background_cac_done_wk);
227 flush_work(&rdev->destroy_work);
228 flush_work(&rdev->sched_scan_stop_wk);
229 flush_work(&rdev->propagate_radar_detect_wk);
230 flush_work(&rdev->propagate_cac_done_wk);
231 flush_work(&rdev->mgmt_registrations_update_wk);
232 - flush_work(&rdev->offchan_cac_abort_wk);
233 + flush_work(&rdev->background_cac_abort_wk);
236 if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup)
237 @@ -1210,7 +1211,7 @@ void __cfg80211_leave(struct cfg80211_re
239 cfg80211_pmsr_wdev_down(wdev);
241 - cfg80211_stop_offchan_radar_detection(wdev);
242 + cfg80211_stop_background_radar_detection(wdev);
244 switch (wdev->iftype) {
245 case NL80211_IFTYPE_ADHOC:
246 --- a/net/wireless/core.h
247 +++ b/net/wireless/core.h
248 @@ -84,10 +84,10 @@ struct cfg80211_registered_device {
250 struct delayed_work dfs_update_channels_wk;
252 - struct wireless_dev *offchan_radar_wdev;
253 - struct cfg80211_chan_def offchan_radar_chandef;
254 - struct delayed_work offchan_cac_done_wk;
255 - struct work_struct offchan_cac_abort_wk;
256 + struct wireless_dev *background_radar_wdev;
257 + struct cfg80211_chan_def background_radar_chandef;
258 + struct delayed_work background_cac_done_wk;
259 + struct work_struct background_cac_abort_wk;
261 /* netlink port which started critical protocol (0 means not started) */
262 u32 crit_proto_nlportid;
263 @@ -497,15 +497,15 @@ cfg80211_chandef_dfs_cac_time(struct wip
264 void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev);
267 -cfg80211_start_offchan_radar_detection(struct cfg80211_registered_device *rdev,
268 - struct wireless_dev *wdev,
269 - struct cfg80211_chan_def *chandef);
270 +cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rdev,
271 + struct wireless_dev *wdev,
272 + struct cfg80211_chan_def *chandef);
274 -void cfg80211_stop_offchan_radar_detection(struct wireless_dev *wdev);
275 +void cfg80211_stop_background_radar_detection(struct wireless_dev *wdev);
277 -void cfg80211_offchan_cac_done_wk(struct work_struct *work);
278 +void cfg80211_background_cac_done_wk(struct work_struct *work);
280 -void cfg80211_offchan_cac_abort_wk(struct work_struct *work);
281 +void cfg80211_background_cac_abort_wk(struct work_struct *work);
283 bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,
284 struct ieee80211_channel *chan);
285 --- a/net/wireless/mlme.c
286 +++ b/net/wireless/mlme.c
287 @@ -920,7 +920,7 @@ void __cfg80211_radar_event(struct wiphy
288 cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_UNAVAILABLE);
291 - queue_work(cfg80211_wq, &rdev->offchan_cac_abort_wk);
292 + queue_work(cfg80211_wq, &rdev->background_cac_abort_wk);
294 cfg80211_sched_dfs_chan_update(rdev);
296 @@ -975,10 +975,10 @@ void cfg80211_cac_event(struct net_devic
297 EXPORT_SYMBOL(cfg80211_cac_event);
300 -__cfg80211_offchan_cac_event(struct cfg80211_registered_device *rdev,
301 - struct wireless_dev *wdev,
302 - const struct cfg80211_chan_def *chandef,
303 - enum nl80211_radar_event event)
304 +__cfg80211_background_cac_event(struct cfg80211_registered_device *rdev,
305 + struct wireless_dev *wdev,
306 + const struct cfg80211_chan_def *chandef,
307 + enum nl80211_radar_event event)
309 struct wiphy *wiphy = &rdev->wiphy;
310 struct net_device *netdev;
311 @@ -988,7 +988,7 @@ __cfg80211_offchan_cac_event(struct cfg8
312 if (!cfg80211_chandef_valid(chandef))
315 - if (!rdev->offchan_radar_wdev)
316 + if (!rdev->background_radar_wdev)
320 @@ -997,12 +997,12 @@ __cfg80211_offchan_cac_event(struct cfg8
321 memcpy(&rdev->cac_done_chandef, chandef, sizeof(*chandef));
322 queue_work(cfg80211_wq, &rdev->propagate_cac_done_wk);
323 cfg80211_sched_dfs_chan_update(rdev);
324 - wdev = rdev->offchan_radar_wdev;
325 + wdev = rdev->background_radar_wdev;
327 case NL80211_RADAR_CAC_ABORTED:
328 - if (!cancel_delayed_work(&rdev->offchan_cac_done_wk))
329 + if (!cancel_delayed_work(&rdev->background_cac_done_wk))
331 - wdev = rdev->offchan_radar_wdev;
332 + wdev = rdev->background_radar_wdev;
334 case NL80211_RADAR_CAC_STARTED:
336 @@ -1015,49 +1015,49 @@ __cfg80211_offchan_cac_event(struct cfg8
340 -cfg80211_offchan_cac_event(struct cfg80211_registered_device *rdev,
341 - const struct cfg80211_chan_def *chandef,
342 - enum nl80211_radar_event event)
343 +cfg80211_background_cac_event(struct cfg80211_registered_device *rdev,
344 + const struct cfg80211_chan_def *chandef,
345 + enum nl80211_radar_event event)
347 wiphy_lock(&rdev->wiphy);
348 - __cfg80211_offchan_cac_event(rdev, rdev->offchan_radar_wdev,
350 + __cfg80211_background_cac_event(rdev, rdev->background_radar_wdev,
352 wiphy_unlock(&rdev->wiphy);
355 -void cfg80211_offchan_cac_done_wk(struct work_struct *work)
356 +void cfg80211_background_cac_done_wk(struct work_struct *work)
358 struct delayed_work *delayed_work = to_delayed_work(work);
359 struct cfg80211_registered_device *rdev;
361 rdev = container_of(delayed_work, struct cfg80211_registered_device,
362 - offchan_cac_done_wk);
363 - cfg80211_offchan_cac_event(rdev, &rdev->offchan_radar_chandef,
364 - NL80211_RADAR_CAC_FINISHED);
365 + background_cac_done_wk);
366 + cfg80211_background_cac_event(rdev, &rdev->background_radar_chandef,
367 + NL80211_RADAR_CAC_FINISHED);
370 -void cfg80211_offchan_cac_abort_wk(struct work_struct *work)
371 +void cfg80211_background_cac_abort_wk(struct work_struct *work)
373 struct cfg80211_registered_device *rdev;
375 rdev = container_of(work, struct cfg80211_registered_device,
376 - offchan_cac_abort_wk);
377 - cfg80211_offchan_cac_event(rdev, &rdev->offchan_radar_chandef,
378 - NL80211_RADAR_CAC_ABORTED);
379 + background_cac_abort_wk);
380 + cfg80211_background_cac_event(rdev, &rdev->background_radar_chandef,
381 + NL80211_RADAR_CAC_ABORTED);
384 -void cfg80211_offchan_cac_abort(struct wiphy *wiphy)
385 +void cfg80211_background_cac_abort(struct wiphy *wiphy)
387 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
389 - queue_work(cfg80211_wq, &rdev->offchan_cac_abort_wk);
390 + queue_work(cfg80211_wq, &rdev->background_cac_abort_wk);
392 -EXPORT_SYMBOL(cfg80211_offchan_cac_abort);
393 +EXPORT_SYMBOL(cfg80211_background_cac_abort);
396 -cfg80211_start_offchan_radar_detection(struct cfg80211_registered_device *rdev,
397 - struct wireless_dev *wdev,
398 - struct cfg80211_chan_def *chandef)
399 +cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rdev,
400 + struct wireless_dev *wdev,
401 + struct cfg80211_chan_def *chandef)
403 unsigned int cac_time_ms;
405 @@ -1065,19 +1065,19 @@ cfg80211_start_offchan_radar_detection(s
406 lockdep_assert_wiphy(&rdev->wiphy);
408 if (!wiphy_ext_feature_isset(&rdev->wiphy,
409 - NL80211_EXT_FEATURE_RADAR_OFFCHAN))
410 + NL80211_EXT_FEATURE_RADAR_BACKGROUND))
413 /* Offchannel chain already locked by another wdev */
414 - if (rdev->offchan_radar_wdev && rdev->offchan_radar_wdev != wdev)
415 + if (rdev->background_radar_wdev && rdev->background_radar_wdev != wdev)
418 /* CAC already in progress on the offchannel chain */
419 - if (rdev->offchan_radar_wdev == wdev &&
420 - delayed_work_pending(&rdev->offchan_cac_done_wk))
421 + if (rdev->background_radar_wdev == wdev &&
422 + delayed_work_pending(&rdev->background_cac_done_wk))
425 - err = rdev_set_radar_offchan(rdev, chandef);
426 + err = rdev_set_radar_background(rdev, chandef);
430 @@ -1085,30 +1085,31 @@ cfg80211_start_offchan_radar_detection(s
432 cac_time_ms = IEEE80211_DFS_MIN_CAC_TIME_MS;
434 - rdev->offchan_radar_chandef = *chandef;
435 - rdev->offchan_radar_wdev = wdev; /* Get offchain ownership */
436 + rdev->background_radar_chandef = *chandef;
437 + rdev->background_radar_wdev = wdev; /* Get offchain ownership */
439 - __cfg80211_offchan_cac_event(rdev, wdev, chandef,
440 - NL80211_RADAR_CAC_STARTED);
441 - queue_delayed_work(cfg80211_wq, &rdev->offchan_cac_done_wk,
442 + __cfg80211_background_cac_event(rdev, wdev, chandef,
443 + NL80211_RADAR_CAC_STARTED);
444 + queue_delayed_work(cfg80211_wq, &rdev->background_cac_done_wk,
445 msecs_to_jiffies(cac_time_ms));
450 -void cfg80211_stop_offchan_radar_detection(struct wireless_dev *wdev)
451 +void cfg80211_stop_background_radar_detection(struct wireless_dev *wdev)
453 struct wiphy *wiphy = wdev->wiphy;
454 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
456 lockdep_assert_wiphy(wiphy);
458 - if (wdev != rdev->offchan_radar_wdev)
459 + if (wdev != rdev->background_radar_wdev)
462 - rdev_set_radar_offchan(rdev, NULL);
463 - rdev->offchan_radar_wdev = NULL; /* Release offchain ownership */
464 + rdev_set_radar_background(rdev, NULL);
465 + rdev->background_radar_wdev = NULL; /* Release offchain ownership */
467 - __cfg80211_offchan_cac_event(rdev, wdev, &rdev->offchan_radar_chandef,
468 - NL80211_RADAR_CAC_ABORTED);
469 + __cfg80211_background_cac_event(rdev, wdev,
470 + &rdev->background_radar_chandef,
471 + NL80211_RADAR_CAC_ABORTED);
473 --- a/net/wireless/nl80211.c
474 +++ b/net/wireless/nl80211.c
475 @@ -801,7 +801,7 @@ static const struct nla_policy nl80211_p
476 [NL80211_ATTR_MBSSID_CONFIG] =
477 NLA_POLICY_NESTED(nl80211_mbssid_config_policy),
478 [NL80211_ATTR_MBSSID_ELEMS] = { .type = NLA_NESTED },
479 - [NL80211_ATTR_RADAR_OFFCHAN] = { .type = NLA_FLAG },
480 + [NL80211_ATTR_RADAR_BACKGROUND] = { .type = NLA_FLAG },
483 /* policy for the key attributes */
484 @@ -9306,9 +9306,9 @@ static int nl80211_start_radar_detection
488 - if (nla_get_flag(info->attrs[NL80211_ATTR_RADAR_OFFCHAN])) {
489 - err = cfg80211_start_offchan_radar_detection(rdev, wdev,
491 + if (nla_get_flag(info->attrs[NL80211_ATTR_RADAR_BACKGROUND])) {
492 + err = cfg80211_start_background_radar_detection(rdev, wdev,
497 --- a/net/wireless/rdev-ops.h
498 +++ b/net/wireless/rdev-ops.h
499 @@ -1382,17 +1382,17 @@ static inline int rdev_color_change(stru
503 -rdev_set_radar_offchan(struct cfg80211_registered_device *rdev,
504 - struct cfg80211_chan_def *chandef)
505 +rdev_set_radar_background(struct cfg80211_registered_device *rdev,
506 + struct cfg80211_chan_def *chandef)
508 struct wiphy *wiphy = &rdev->wiphy;
511 - if (!rdev->ops->set_radar_offchan)
512 + if (!rdev->ops->set_radar_background)
515 - trace_rdev_set_radar_offchan(wiphy, chandef);
516 - ret = rdev->ops->set_radar_offchan(wiphy, chandef);
517 + trace_rdev_set_radar_background(wiphy, chandef);
518 + ret = rdev->ops->set_radar_background(wiphy, chandef);
519 trace_rdev_return_int(wiphy, ret);
522 --- a/net/wireless/trace.h
523 +++ b/net/wireless/trace.h
524 @@ -3646,7 +3646,7 @@ TRACE_EVENT(cfg80211_bss_color_notify,
525 __entry->color_bitmap)
528 -TRACE_EVENT(rdev_set_radar_offchan,
529 +TRACE_EVENT(rdev_set_radar_background,
530 TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
532 TP_ARGS(wiphy, chandef),