History

cfg80211: rename offchannel_chain structs to background_chain to avoid confusion with ETSI standard

ETSI standard defines "Offchannel CAC" as: "Off-Channel CAC is performed by a number of non-continuous checks spread over a period in time. This period, which is required to determine the presence of radar signals, is defined as the Off-Channel CAC Time.. Minimum Off-Channel CAC Time 6 minutes and Maximum Off-Channel CAC Time 4 hours..". mac80211 implementation refers to a dedicated hw chain used for continuous radar monitoring. Rename offchannel_* references to background_* in order to avoid confusion with ETSI standard.

Lorenzo Bianconi committed 4 years ago

Commit a95bfb81 parent 852a07c11 files · +102 −100Browse files

Unified · Split

11 files
  1. include/net/cfg80211.h +10 −10
  2. include/net/mac80211.h +5 −5
  3. include/uapi/linux/nl80211.h +7 −7
  4. net/mac80211/cfg.c +5 −5
  5. net/wireless/chan.c +3 −3
  6. net/wireless/core.c +7 −6
  7. net/wireless/core.h +10 −10
  8. net/wireless/mlme.c +45 −44
  9. net/wireless/nl80211.c +4 −4
  10. net/wireless/rdev-ops.h +5 −5
  11. net/wireless/trace.h +1 −1
include/net/cfg80211.h+10−10
@@ -4073,14 +4073,14 @@ struct mgmt_frame_regs { · 4072 unmodified lines
4073 * those to decrypt (Re)Association Request and encrypt (Re)Association4073 * those to decrypt (Re)Association Request and encrypt (Re)Association
4074 * Response frame.4074 * Response frame.
4075 *4075 *
4076 * @set_radar_offchan: Configure dedicated offchannel chain available for4076 * @set_radar_background: Configure dedicated offchannel chain available for
4077 * radar/CAC detection on some hw. This chain can't be used to transmit4077 * radar/CAC detection on some hw. This chain can't be used to transmit
4078 * or receive frames and it is bounded to a running wdev.4078 * or receive frames and it is bounded to a running wdev.
4079 * Offchannel radar/CAC detection allows to avoid the CAC downtime4079 * Background radar/CAC detection allows to avoid the CAC downtime
4080 * switching to a different channel during CAC detection on the selected4080 * switching to a different channel during CAC detection on the selected
4081 * radar channel.4081 * radar channel.
4082 * The caller is expected to set chandef pointer to NULL in order to4082 * The caller is expected to set chandef pointer to NULL in order to
4083 * disable offchannel CAC/radar detection.4083 * disable background CAC/radar detection.
4084 */4084 */
4085struct cfg80211_ops {4085struct cfg80211_ops {
4086 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);4086 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -4413,8 +4413,8 @@ struct cfg80211_ops { · 326 unmodified lines
4413 struct cfg80211_color_change_settings *params);4413 struct cfg80211_color_change_settings *params);
4414 int (*set_fils_aad)(struct wiphy *wiphy, struct net_device *dev,4414 int (*set_fils_aad)(struct wiphy *wiphy, struct net_device *dev,
4415 struct cfg80211_fils_aad *fils_aad);4415 struct cfg80211_fils_aad *fils_aad);
4416 int (*set_radar_offchan)(struct wiphy *wiphy,4416 int (*set_radar_background)(struct wiphy *wiphy,
4417 struct cfg80211_chan_def *chandef);4417 struct cfg80211_chan_def *chandef);
4418};4418};
4419 4419
4420/*4420/*
@@ -7626,9 +7626,9 @@ cfg80211_radar_event(struct wiphy *wiphy, · 3205 unmodified lines
7626}7626}
7627 7627
7628static inline void7628static inline void
7629cfg80211_offchan_radar_event(struct wiphy *wiphy,7629cfg80211_background_radar_event(struct wiphy *wiphy,
7630 struct cfg80211_chan_def *chandef,7630 struct cfg80211_chan_def *chandef,
7631 gfp_t gfp)7631 gfp_t gfp)
7632{7632{
7633 __cfg80211_radar_event(wiphy, chandef, true, gfp);7633 __cfg80211_radar_event(wiphy, chandef, true, gfp);
7634}7634}
@@ -7663,13 +7663,13 @@ void cfg80211_cac_event(struct net_device *netdev, · 28 unmodified lines
7663 enum nl80211_radar_event event, gfp_t gfp);7663 enum nl80211_radar_event event, gfp_t gfp);
7664 7664
7665/**7665/**
7666 * cfg80211_offchan_cac_abort - Channel Availability Check offchan abort event7666 * cfg80211_background_cac_abort - Channel Availability Check offchan abort event
7667 * @wiphy: the wiphy7667 * @wiphy: the wiphy
7668 *7668 *
7669 * This function is called by the driver when a Channel Availability Check7669 * This function is called by the driver when a Channel Availability Check
7670 * (CAC) is aborted by a offchannel dedicated chain.7670 * (CAC) is aborted by a offchannel dedicated chain.
7671 */7671 */
7672void cfg80211_offchan_cac_abort(struct wiphy *wiphy);7672void cfg80211_background_cac_abort(struct wiphy *wiphy);
7673 7673
7674/**7674/**
7675 * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying7675 * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
include/net/mac80211.h+5−5
@@ -3939,14 +3939,14 @@ struct ieee80211_prep_tx_info { · 3938 unmodified lines
3939 * twt structure.3939 * twt structure.
3940 * @twt_teardown_request: Update the hw with TWT teardown request received3940 * @twt_teardown_request: Update the hw with TWT teardown request received
3941 * from the peer.3941 * from the peer.
3942 * @set_radar_offchan: Configure dedicated offchannel chain available for3942 * @set_radar_background: Configure dedicated offchannel chain available for
3943 * radar/CAC detection on some hw. This chain can't be used to transmit3943 * radar/CAC detection on some hw. This chain can't be used to transmit
3944 * or receive frames and it is bounded to a running wdev.3944 * or receive frames and it is bounded to a running wdev.
3945 * Offchannel radar/CAC detection allows to avoid the CAC downtime3945 * Background radar/CAC detection allows to avoid the CAC downtime
3946 * switching to a different channel during CAC detection on the selected3946 * switching to a different channel during CAC detection on the selected
3947 * radar channel.3947 * radar channel.
3948 * The caller is expected to set chandef pointer to NULL in order to3948 * The caller is expected to set chandef pointer to NULL in order to
3949 * disable offchannel CAC/radar detection.3949 * disable background CAC/radar detection.
3950 * @net_fill_forward_path: Called from .ndo_fill_forward_path in order to3950 * @net_fill_forward_path: Called from .ndo_fill_forward_path in order to
3951 * resolve a path for hardware flow offloading3951 * resolve a path for hardware flow offloading
3952 */3952 */
@@ -4277,8 +4277,8 @@ struct ieee80211_ops { · 324 unmodified lines
4277 struct ieee80211_twt_setup *twt);4277 struct ieee80211_twt_setup *twt);
4278 void (*twt_teardown_request)(struct ieee80211_hw *hw,4278 void (*twt_teardown_request)(struct ieee80211_hw *hw,
4279 struct ieee80211_sta *sta, u8 flowid);4279 struct ieee80211_sta *sta, u8 flowid);
4280 int (*set_radar_offchan)(struct ieee80211_hw *hw,4280 int (*set_radar_background)(struct ieee80211_hw *hw,
4281 struct cfg80211_chan_def *chandef);4281 struct cfg80211_chan_def *chandef);
4282 int (*net_fill_forward_path)(struct ieee80211_hw *hw,4282 int (*net_fill_forward_path)(struct ieee80211_hw *hw,
4283 struct ieee80211_vif *vif,4283 struct ieee80211_vif *vif,
4284 struct ieee80211_sta *sta,4284 struct ieee80211_sta *sta,
include/uapi/linux/nl80211.h+7−7
@@ -2646,10 +2646,10 @@ enum nl80211_commands { · 2645 unmodified lines
2646 * Mandatory parameter for the transmitting interface to enable MBSSID.2646 * Mandatory parameter for the transmitting interface to enable MBSSID.
2647 * Optional for the non-transmitting interfaces.2647 * Optional for the non-transmitting interfaces.
2648 *2648 *
2649 * @NL80211_ATTR_RADAR_OFFCHAN: Configure dedicated offchannel chain available for2649 * @NL80211_ATTR_RADAR_BACKGROUND: Configure dedicated offchannel chain
2650 * radar/CAC detection on some hw. This chain can't be used to transmit2650 * available for radar/CAC detection on some hw. This chain can't be used
2651 * or receive frames and it is bounded to a running wdev.2651 * to transmit or receive frames and it is bounded to a running wdev.
2652 * Offchannel radar/CAC detection allows to avoid the CAC downtime2652 * Background radar/CAC detection allows to avoid the CAC downtime
2653 * switching on a different channel during CAC detection on the selected2653 * switching on a different channel during CAC detection on the selected
2654 * radar channel.2654 * radar channel.
2655 *2655 *
@@ -3159,7 +3159,7 @@ enum nl80211_attrs { · 503 unmodified lines
3159 NL80211_ATTR_MBSSID_CONFIG,3159 NL80211_ATTR_MBSSID_CONFIG,
3160 NL80211_ATTR_MBSSID_ELEMS,3160 NL80211_ATTR_MBSSID_ELEMS,
3161 3161
3162 NL80211_ATTR_RADAR_OFFCHAN,3162 NL80211_ATTR_RADAR_BACKGROUND,
3163 3163
3164 /* add attributes here, update the policy in nl80211.c */3164 /* add attributes here, update the policy in nl80211.c */
3165 3165
@@ -6066,7 +6066,7 @@ enum nl80211_feature_flags { · 2900 unmodified lines
6066 * frames. Userspace has to share FILS AAD details to the driver by using6066 * frames. Userspace has to share FILS AAD details to the driver by using
6067 * @NL80211_CMD_SET_FILS_AAD.6067 * @NL80211_CMD_SET_FILS_AAD.
6068 *6068 *
6069 * @NL80211_EXT_FEATURE_RADAR_OFFCHAN: Device supports offchannel radar/CAC6069 * @NL80211_EXT_FEATURE_RADAR_BACKGROUND: Device supports background radar/CAC
6070 * detection.6070 * detection.
6071 *6071 *
6072 * @NUM_NL80211_EXT_FEATURES: number of extended features.6072 * @NUM_NL80211_EXT_FEATURES: number of extended features.
@@ -6135,7 +6135,7 @@ enum nl80211_ext_feature_index { · 62 unmodified lines
6135 NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,6135 NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
6136 NL80211_EXT_FEATURE_BSS_COLOR,6136 NL80211_EXT_FEATURE_BSS_COLOR,
6137 NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,6137 NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,
6138 NL80211_EXT_FEATURE_RADAR_OFFCHAN,6138 NL80211_EXT_FEATURE_RADAR_BACKGROUND,
6139 6139
6140 /* add new features before the definition below */6140 /* add new features before the definition below */
6141 NUM_NL80211_EXT_FEATURES,6141 NUM_NL80211_EXT_FEATURES,
net/mac80211/cfg.c+5−5
@@ -4414,15 +4414,15 @@ out: · 4413 unmodified lines
4414}4414}
4415 4415
4416static int4416static int
4417ieee80211_set_radar_offchan(struct wiphy *wiphy,4417ieee80211_set_radar_background(struct wiphy *wiphy,
4418 struct cfg80211_chan_def *chandef)4418 struct cfg80211_chan_def *chandef)
4419{4419{
4420 struct ieee80211_local *local = wiphy_priv(wiphy);4420 struct ieee80211_local *local = wiphy_priv(wiphy);
4421 4421
4422 if (!local->ops->set_radar_offchan)4422 if (!local->ops->set_radar_background)
4423 return -EOPNOTSUPP;4423 return -EOPNOTSUPP;
4424 4424
4425 return local->ops->set_radar_offchan(&local->hw, chandef);4425 return local->ops->set_radar_background(&local->hw, chandef);
4426}4426}
4427 4427
4428const struct cfg80211_ops mac80211_config_ops = {4428const struct cfg80211_ops mac80211_config_ops = {
@@ -4529,5 +4529,5 @@ const struct cfg80211_ops mac80211_config_ops = { · 100 unmodified lines
4529 .reset_tid_config = ieee80211_reset_tid_config,4529 .reset_tid_config = ieee80211_reset_tid_config,
4530 .set_sar_specs = ieee80211_set_sar_specs,4530 .set_sar_specs = ieee80211_set_sar_specs,
4531 .color_change = ieee80211_color_change,4531 .color_change = ieee80211_color_change,
4532 .set_radar_offchan = ieee80211_set_radar_offchan,4532 .set_radar_background = ieee80211_set_radar_background,
4533};4533};
net/wireless/chan.c+3−3
@@ -718,13 +718,13 @@ static bool · 717 unmodified lines
718cfg80211_offchan_chain_is_active(struct cfg80211_registered_device *rdev,718cfg80211_offchan_chain_is_active(struct cfg80211_registered_device *rdev,
719 struct ieee80211_channel *channel)719 struct ieee80211_channel *channel)
720{720{
721 if (!rdev->offchan_radar_wdev)721 if (!rdev->background_radar_wdev)
722 return false;722 return false;
723 723
724 if (!cfg80211_chandef_valid(&rdev->offchan_radar_chandef))724 if (!cfg80211_chandef_valid(&rdev->background_radar_chandef))
725 return false;725 return false;
726 726
727 return cfg80211_is_sub_chan(&rdev->offchan_radar_chandef, channel);727 return cfg80211_is_sub_chan(&rdev->background_radar_chandef, channel);
728}728}
729 729
730bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,730bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,
net/wireless/core.c+7−6
@@ -545,9 +545,10 @@ use_default_name: · 544 unmodified lines
545 INIT_WORK(&rdev->rfkill_block, cfg80211_rfkill_block_work);545 INIT_WORK(&rdev->rfkill_block, cfg80211_rfkill_block_work);
546 INIT_WORK(&rdev->conn_work, cfg80211_conn_work);546 INIT_WORK(&rdev->conn_work, cfg80211_conn_work);
547 INIT_WORK(&rdev->event_work, cfg80211_event_work);547 INIT_WORK(&rdev->event_work, cfg80211_event_work);
548 INIT_WORK(&rdev->offchan_cac_abort_wk, cfg80211_offchan_cac_abort_wk);548 INIT_WORK(&rdev->background_cac_abort_wk,
549 INIT_DELAYED_WORK(&rdev->offchan_cac_done_wk,549 cfg80211_background_cac_abort_wk);
550 cfg80211_offchan_cac_done_wk);550 INIT_DELAYED_WORK(&rdev->background_cac_done_wk,
551 cfg80211_background_cac_done_wk);
551 552
552 init_waitqueue_head(&rdev->dev_wait);553 init_waitqueue_head(&rdev->dev_wait);
553 554
@@ -1057,13 +1058,13 @@ void wiphy_unregister(struct wiphy *wiphy) · 503 unmodified lines
1057 cancel_work_sync(&rdev->conn_work);1058 cancel_work_sync(&rdev->conn_work);
1058 flush_work(&rdev->event_work);1059 flush_work(&rdev->event_work);
1059 cancel_delayed_work_sync(&rdev->dfs_update_channels_wk);1060 cancel_delayed_work_sync(&rdev->dfs_update_channels_wk);
1060 cancel_delayed_work_sync(&rdev->offchan_cac_done_wk);1061 cancel_delayed_work_sync(&rdev->background_cac_done_wk);
1061 flush_work(&rdev->destroy_work);1062 flush_work(&rdev->destroy_work);
1062 flush_work(&rdev->sched_scan_stop_wk);1063 flush_work(&rdev->sched_scan_stop_wk);
1063 flush_work(&rdev->propagate_radar_detect_wk);1064 flush_work(&rdev->propagate_radar_detect_wk);
1064 flush_work(&rdev->propagate_cac_done_wk);1065 flush_work(&rdev->propagate_cac_done_wk);
1065 flush_work(&rdev->mgmt_registrations_update_wk);1066 flush_work(&rdev->mgmt_registrations_update_wk);
1066 flush_work(&rdev->offchan_cac_abort_wk);1067 flush_work(&rdev->background_cac_abort_wk);
1067 1068
1068#ifdef CONFIG_PM1069#ifdef CONFIG_PM
1069 if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup)1070 if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup)
@@ -1212,7 +1213,7 @@ void __cfg80211_leave(struct cfg80211_registered_device *rdev, · 142 unmodified lines
1212 1213
1213 cfg80211_pmsr_wdev_down(wdev);1214 cfg80211_pmsr_wdev_down(wdev);
1214 1215
1215 cfg80211_stop_offchan_radar_detection(wdev);1216 cfg80211_stop_background_radar_detection(wdev);
1216 1217
1217 switch (wdev->iftype) {1218 switch (wdev->iftype) {
1218 case NL80211_IFTYPE_ADHOC:1219 case NL80211_IFTYPE_ADHOC:
net/wireless/core.h+10−10
@@ -84,10 +84,10 @@ struct cfg80211_registered_device { · 83 unmodified lines
84 84
85 struct delayed_work dfs_update_channels_wk;85 struct delayed_work dfs_update_channels_wk;
86 86
87 struct wireless_dev *offchan_radar_wdev;87 struct wireless_dev *background_radar_wdev;
88 struct cfg80211_chan_def offchan_radar_chandef;88 struct cfg80211_chan_def background_radar_chandef;
89 struct delayed_work offchan_cac_done_wk;89 struct delayed_work background_cac_done_wk;
90 struct work_struct offchan_cac_abort_wk;90 struct work_struct background_cac_abort_wk;
91 91
92 /* netlink port which started critical protocol (0 means not started) */92 /* netlink port which started critical protocol (0 means not started) */
93 u32 crit_proto_nlportid;93 u32 crit_proto_nlportid;
@@ -497,15 +497,15 @@ cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy, · 403 unmodified lines
497void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev);497void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev);
498 498
499int499int
500cfg80211_start_offchan_radar_detection(struct cfg80211_registered_device *rdev,500cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rdev,
501 struct wireless_dev *wdev,501 struct wireless_dev *wdev,
502 struct cfg80211_chan_def *chandef);502 struct cfg80211_chan_def *chandef);
503 503
504void cfg80211_stop_offchan_radar_detection(struct wireless_dev *wdev);504void cfg80211_stop_background_radar_detection(struct wireless_dev *wdev);
505 505
506void cfg80211_offchan_cac_done_wk(struct work_struct *work);506void cfg80211_background_cac_done_wk(struct work_struct *work);
507 507
508void cfg80211_offchan_cac_abort_wk(struct work_struct *work);508void cfg80211_background_cac_abort_wk(struct work_struct *work);
509 509
510bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,510bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,
511 struct ieee80211_channel *chan);511 struct ieee80211_channel *chan);
net/wireless/mlme.c+45−44
@@ -920,7 +920,7 @@ void __cfg80211_radar_event(struct wiphy *wiphy, · 919 unmodified lines
920 cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_UNAVAILABLE);920 cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_UNAVAILABLE);
921 921
922 if (offchan)922 if (offchan)
923 queue_work(cfg80211_wq, &rdev->offchan_cac_abort_wk);923 queue_work(cfg80211_wq, &rdev->background_cac_abort_wk);
924 924
925 cfg80211_sched_dfs_chan_update(rdev);925 cfg80211_sched_dfs_chan_update(rdev);
926 926
@@ -975,10 +975,10 @@ void cfg80211_cac_event(struct net_device *netdev, · 48 unmodified lines
975EXPORT_SYMBOL(cfg80211_cac_event);975EXPORT_SYMBOL(cfg80211_cac_event);
976 976
977static void977static void
978__cfg80211_offchan_cac_event(struct cfg80211_registered_device *rdev,978__cfg80211_background_cac_event(struct cfg80211_registered_device *rdev,
979 struct wireless_dev *wdev,979 struct wireless_dev *wdev,
980 const struct cfg80211_chan_def *chandef,980 const struct cfg80211_chan_def *chandef,
981 enum nl80211_radar_event event)981 enum nl80211_radar_event event)
982{982{
983 struct wiphy *wiphy = &rdev->wiphy;983 struct wiphy *wiphy = &rdev->wiphy;
984 struct net_device *netdev;984 struct net_device *netdev;
@@ -988,7 +988,7 @@ __cfg80211_offchan_cac_event(struct cfg80211_registered_device *rdev, · 3 unmodified lines
988 if (!cfg80211_chandef_valid(chandef))988 if (!cfg80211_chandef_valid(chandef))
989 return;989 return;
990 990
991 if (!rdev->offchan_radar_wdev)991 if (!rdev->background_radar_wdev)
992 return;992 return;
993 993
994 switch (event) {994 switch (event) {
@@ -997,12 +997,12 @@ __cfg80211_offchan_cac_event(struct cfg80211_registered_device *rdev, · 2 unmodified lines
997 memcpy(&rdev->cac_done_chandef, chandef, sizeof(*chandef));997 memcpy(&rdev->cac_done_chandef, chandef, sizeof(*chandef));
998 queue_work(cfg80211_wq, &rdev->propagate_cac_done_wk);998 queue_work(cfg80211_wq, &rdev->propagate_cac_done_wk);
999 cfg80211_sched_dfs_chan_update(rdev);999 cfg80211_sched_dfs_chan_update(rdev);
1000 wdev = rdev->offchan_radar_wdev;1000 wdev = rdev->background_radar_wdev;
1001 break;1001 break;
1002 case NL80211_RADAR_CAC_ABORTED:1002 case NL80211_RADAR_CAC_ABORTED:
1003 if (!cancel_delayed_work(&rdev->offchan_cac_done_wk))1003 if (!cancel_delayed_work(&rdev->background_cac_done_wk))
1004 return;1004 return;
1005 wdev = rdev->offchan_radar_wdev;1005 wdev = rdev->background_radar_wdev;
1006 break;1006 break;
1007 case NL80211_RADAR_CAC_STARTED:1007 case NL80211_RADAR_CAC_STARTED:
1008 break;1008 break;
@@ -1015,49 +1015,49 @@ __cfg80211_offchan_cac_event(struct cfg80211_registered_device *rdev, · 6 unmodified lines
1015}1015}
1016 1016
1017static void1017static void
1018cfg80211_offchan_cac_event(struct cfg80211_registered_device *rdev,1018cfg80211_background_cac_event(struct cfg80211_registered_device *rdev,
1019 const struct cfg80211_chan_def *chandef,1019 const struct cfg80211_chan_def *chandef,
1020 enum nl80211_radar_event event)1020 enum nl80211_radar_event event)
1021{1021{
1022 wiphy_lock(&rdev->wiphy);1022 wiphy_lock(&rdev->wiphy);
1023 __cfg80211_offchan_cac_event(rdev, rdev->offchan_radar_wdev,1023 __cfg80211_background_cac_event(rdev, rdev->background_radar_wdev,
1024 chandef, event);1024 chandef, event);
1025 wiphy_unlock(&rdev->wiphy);1025 wiphy_unlock(&rdev->wiphy);
1026}1026}
1027 1027
1028void cfg80211_offchan_cac_done_wk(struct work_struct *work)1028void cfg80211_background_cac_done_wk(struct work_struct *work)
1029{1029{
1030 struct delayed_work *delayed_work = to_delayed_work(work);1030 struct delayed_work *delayed_work = to_delayed_work(work);
1031 struct cfg80211_registered_device *rdev;1031 struct cfg80211_registered_device *rdev;
1032 1032
1033 rdev = container_of(delayed_work, struct cfg80211_registered_device,1033 rdev = container_of(delayed_work, struct cfg80211_registered_device,
1034 offchan_cac_done_wk);1034 background_cac_done_wk);
1035 cfg80211_offchan_cac_event(rdev, &rdev->offchan_radar_chandef,1035 cfg80211_background_cac_event(rdev, &rdev->background_radar_chandef,
1036 NL80211_RADAR_CAC_FINISHED);1036 NL80211_RADAR_CAC_FINISHED);
1037}1037}
1038 1038
1039void cfg80211_offchan_cac_abort_wk(struct work_struct *work)1039void cfg80211_background_cac_abort_wk(struct work_struct *work)
1040{1040{
1041 struct cfg80211_registered_device *rdev;1041 struct cfg80211_registered_device *rdev;
1042 1042
1043 rdev = container_of(work, struct cfg80211_registered_device,1043 rdev = container_of(work, struct cfg80211_registered_device,
1044 offchan_cac_abort_wk);1044 background_cac_abort_wk);
1045 cfg80211_offchan_cac_event(rdev, &rdev->offchan_radar_chandef,1045 cfg80211_background_cac_event(rdev, &rdev->background_radar_chandef,
1046 NL80211_RADAR_CAC_ABORTED);1046 NL80211_RADAR_CAC_ABORTED);
1047}1047}
1048 1048
1049void cfg80211_offchan_cac_abort(struct wiphy *wiphy)1049void cfg80211_background_cac_abort(struct wiphy *wiphy)
1050{1050{
1051 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);1051 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
1052 1052
1053 queue_work(cfg80211_wq, &rdev->offchan_cac_abort_wk);1053 queue_work(cfg80211_wq, &rdev->background_cac_abort_wk);
1054}1054}
1055EXPORT_SYMBOL(cfg80211_offchan_cac_abort);1055EXPORT_SYMBOL(cfg80211_background_cac_abort);
1056 1056
1057int1057int
1058cfg80211_start_offchan_radar_detection(struct cfg80211_registered_device *rdev,1058cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rdev,
1059 struct wireless_dev *wdev,1059 struct wireless_dev *wdev,
1060 struct cfg80211_chan_def *chandef)1060 struct cfg80211_chan_def *chandef)
1061{1061{
1062 unsigned int cac_time_ms;1062 unsigned int cac_time_ms;
1063 int err;1063 int err;
@@ -1065,19 +1065,19 @@ cfg80211_start_offchan_radar_detection(struct cfg80211_registered_device *rdev, · 1 unmodified line
1065 lockdep_assert_wiphy(&rdev->wiphy);1065 lockdep_assert_wiphy(&rdev->wiphy);
1066 1066
1067 if (!wiphy_ext_feature_isset(&rdev->wiphy,1067 if (!wiphy_ext_feature_isset(&rdev->wiphy,
1068 NL80211_EXT_FEATURE_RADAR_OFFCHAN))1068 NL80211_EXT_FEATURE_RADAR_BACKGROUND))
1069 return -EOPNOTSUPP;1069 return -EOPNOTSUPP;
1070 1070
1071 /* Offchannel chain already locked by another wdev */1071 /* Offchannel chain already locked by another wdev */
1072 if (rdev->offchan_radar_wdev && rdev->offchan_radar_wdev != wdev)1072 if (rdev->background_radar_wdev && rdev->background_radar_wdev != wdev)
1073 return -EBUSY;1073 return -EBUSY;
1074 1074
1075 /* CAC already in progress on the offchannel chain */1075 /* CAC already in progress on the offchannel chain */
1076 if (rdev->offchan_radar_wdev == wdev &&1076 if (rdev->background_radar_wdev == wdev &&
1077 delayed_work_pending(&rdev->offchan_cac_done_wk))1077 delayed_work_pending(&rdev->background_cac_done_wk))
1078 return -EBUSY;1078 return -EBUSY;
1079 1079
1080 err = rdev_set_radar_offchan(rdev, chandef);1080 err = rdev_set_radar_background(rdev, chandef);
1081 if (err)1081 if (err)
1082 return err;1082 return err;
1083 1083
@@ -1085,30 +1085,31 @@ cfg80211_start_offchan_radar_detection(struct cfg80211_registered_device *rdev, · 1 unmodified line
1085 if (!cac_time_ms)1085 if (!cac_time_ms)
1086 cac_time_ms = IEEE80211_DFS_MIN_CAC_TIME_MS;1086 cac_time_ms = IEEE80211_DFS_MIN_CAC_TIME_MS;
1087 1087
1088 rdev->offchan_radar_chandef = *chandef;1088 rdev->background_radar_chandef = *chandef;
1089 rdev->offchan_radar_wdev = wdev; /* Get offchain ownership */1089 rdev->background_radar_wdev = wdev; /* Get offchain ownership */
1090 1090
1091 __cfg80211_offchan_cac_event(rdev, wdev, chandef,1091 __cfg80211_background_cac_event(rdev, wdev, chandef,
1092 NL80211_RADAR_CAC_STARTED);1092 NL80211_RADAR_CAC_STARTED);
1093 queue_delayed_work(cfg80211_wq, &rdev->offchan_cac_done_wk,1093 queue_delayed_work(cfg80211_wq, &rdev->background_cac_done_wk,
1094 msecs_to_jiffies(cac_time_ms));1094 msecs_to_jiffies(cac_time_ms));
1095 1095
1096 return 0;1096 return 0;
1097}1097}
1098 1098
1099void cfg80211_stop_offchan_radar_detection(struct wireless_dev *wdev)1099void cfg80211_stop_background_radar_detection(struct wireless_dev *wdev)
1100{1100{
1101 struct wiphy *wiphy = wdev->wiphy;1101 struct wiphy *wiphy = wdev->wiphy;
1102 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);1102 struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy);
1103 1103
1104 lockdep_assert_wiphy(wiphy);1104 lockdep_assert_wiphy(wiphy);
1105 1105
1106 if (wdev != rdev->offchan_radar_wdev)1106 if (wdev != rdev->background_radar_wdev)
1107 return;1107 return;
1108 1108
1109 rdev_set_radar_offchan(rdev, NULL);1109 rdev_set_radar_background(rdev, NULL);
1110 rdev->offchan_radar_wdev = NULL; /* Release offchain ownership */1110 rdev->background_radar_wdev = NULL; /* Release offchain ownership */
1111 1111
1112 __cfg80211_offchan_cac_event(rdev, wdev, &rdev->offchan_radar_chandef,1112 __cfg80211_background_cac_event(rdev, wdev,
1113 NL80211_RADAR_CAC_ABORTED);1113 &rdev->background_radar_chandef,
1114 NL80211_RADAR_CAC_ABORTED);
1114}1115}
net/wireless/nl80211.c+4−4
@@ -776,7 +776,7 @@ static const struct nla_policy nl80211_policy[NUM_NL80211_ATTR] = { · 775 unmodified lines
776 [NL80211_ATTR_MBSSID_CONFIG] =776 [NL80211_ATTR_MBSSID_CONFIG] =
777 NLA_POLICY_NESTED(nl80211_mbssid_config_policy),777 NLA_POLICY_NESTED(nl80211_mbssid_config_policy),
778 [NL80211_ATTR_MBSSID_ELEMS] = { .type = NLA_NESTED },778 [NL80211_ATTR_MBSSID_ELEMS] = { .type = NLA_NESTED },
779 [NL80211_ATTR_RADAR_OFFCHAN] = { .type = NLA_FLAG },779 [NL80211_ATTR_RADAR_BACKGROUND] = { .type = NLA_FLAG },
780};780};
781 781
782/* policy for the key attributes */782/* policy for the key attributes */
@@ -9305,9 +9305,9 @@ static int nl80211_start_radar_detection(struct sk_buff *skb, · 8522 unmodified lines
9305 goto unlock;9305 goto unlock;
9306 }9306 }
9307 9307
9308 if (nla_get_flag(info->attrs[NL80211_ATTR_RADAR_OFFCHAN])) {9308 if (nla_get_flag(info->attrs[NL80211_ATTR_RADAR_BACKGROUND])) {
9309 err = cfg80211_start_offchan_radar_detection(rdev, wdev,9309 err = cfg80211_start_background_radar_detection(rdev, wdev,
9310 &chandef);9310 &chandef);
9311 goto unlock;9311 goto unlock;
9312 }9312 }
9313 9313
net/wireless/rdev-ops.h+5−5
@@ -1396,17 +1396,17 @@ rdev_set_fils_aad(struct cfg80211_registered_device *rdev, · 1395 unmodified lines
1396}1396}
1397 1397
1398static inline int1398static inline int
1399rdev_set_radar_offchan(struct cfg80211_registered_device *rdev,1399rdev_set_radar_background(struct cfg80211_registered_device *rdev,
1400 struct cfg80211_chan_def *chandef)1400 struct cfg80211_chan_def *chandef)
1401{1401{
1402 struct wiphy *wiphy = &rdev->wiphy;1402 struct wiphy *wiphy = &rdev->wiphy;
1403 int ret;1403 int ret;
1404 1404
1405 if (!rdev->ops->set_radar_offchan)1405 if (!rdev->ops->set_radar_background)
1406 return -EOPNOTSUPP;1406 return -EOPNOTSUPP;
1407 1407
1408 trace_rdev_set_radar_offchan(wiphy, chandef);1408 trace_rdev_set_radar_background(wiphy, chandef);
1409 ret = rdev->ops->set_radar_offchan(wiphy, chandef);1409 ret = rdev->ops->set_radar_background(wiphy, chandef);
1410 trace_rdev_return_int(wiphy, ret);1410 trace_rdev_return_int(wiphy, ret);
1411 1411
1412 return ret;1412 return ret;
net/wireless/trace.h+1−1
@@ -3677,7 +3677,7 @@ TRACE_EVENT(cfg80211_bss_color_notify, · 3676 unmodified lines
3677 __entry->color_bitmap)3677 __entry->color_bitmap)
3678);3678);
3679 3679
3680TRACE_EVENT(rdev_set_radar_offchan,3680TRACE_EVENT(rdev_set_radar_background,
3681 TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),3681 TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
3682 3682
3683 TP_ARGS(wiphy, chandef),3683 TP_ARGS(wiphy, chandef),