Skip to content

Commit

Permalink
cfg80211: rename offchannel_chain structs to background_chain to avoi…
Browse files Browse the repository at this point in the history
…d 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.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://lore.kernel.org/r/4204cc1d648d76b44557981713231e030a3bd991.1638190762.git.lorenzo@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
  • Loading branch information
Lorenzo Bianconi authored and Johannes Berg committed Dec 20, 2021
1 parent 852a07c commit a95bfb8
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 100 deletions.
20 changes: 10 additions & 10 deletions include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -4073,14 +4073,14 @@ struct mgmt_frame_regs {
* those to decrypt (Re)Association Request and encrypt (Re)Association
* Response frame.
*
* @set_radar_offchan: Configure dedicated offchannel chain available for
* @set_radar_background: Configure dedicated offchannel chain available for
* radar/CAC detection on some hw. This chain can't be used to transmit
* or receive frames and it is bounded to a running wdev.
* Offchannel radar/CAC detection allows to avoid the CAC downtime
* Background radar/CAC detection allows to avoid the CAC downtime
* switching to a different channel during CAC detection on the selected
* radar channel.
* The caller is expected to set chandef pointer to NULL in order to
* disable offchannel CAC/radar detection.
* disable background CAC/radar detection.
*/
struct cfg80211_ops {
int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
Expand Down Expand Up @@ -4413,8 +4413,8 @@ struct cfg80211_ops {
struct cfg80211_color_change_settings *params);
int (*set_fils_aad)(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_fils_aad *fils_aad);
int (*set_radar_offchan)(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef);
int (*set_radar_background)(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef);
};

/*
Expand Down Expand Up @@ -7626,9 +7626,9 @@ cfg80211_radar_event(struct wiphy *wiphy,
}

static inline void
cfg80211_offchan_radar_event(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef,
gfp_t gfp)
cfg80211_background_radar_event(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef,
gfp_t gfp)
{
__cfg80211_radar_event(wiphy, chandef, true, gfp);
}
Expand Down Expand Up @@ -7663,13 +7663,13 @@ void cfg80211_cac_event(struct net_device *netdev,
enum nl80211_radar_event event, gfp_t gfp);

/**
* cfg80211_offchan_cac_abort - Channel Availability Check offchan abort event
* cfg80211_background_cac_abort - Channel Availability Check offchan abort event
* @wiphy: the wiphy
*
* This function is called by the driver when a Channel Availability Check
* (CAC) is aborted by a offchannel dedicated chain.
*/
void cfg80211_offchan_cac_abort(struct wiphy *wiphy);
void cfg80211_background_cac_abort(struct wiphy *wiphy);

/**
* cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
Expand Down
10 changes: 5 additions & 5 deletions include/net/mac80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -3939,14 +3939,14 @@ struct ieee80211_prep_tx_info {
* twt structure.
* @twt_teardown_request: Update the hw with TWT teardown request received
* from the peer.
* @set_radar_offchan: Configure dedicated offchannel chain available for
* @set_radar_background: Configure dedicated offchannel chain available for
* radar/CAC detection on some hw. This chain can't be used to transmit
* or receive frames and it is bounded to a running wdev.
* Offchannel radar/CAC detection allows to avoid the CAC downtime
* Background radar/CAC detection allows to avoid the CAC downtime
* switching to a different channel during CAC detection on the selected
* radar channel.
* The caller is expected to set chandef pointer to NULL in order to
* disable offchannel CAC/radar detection.
* disable background CAC/radar detection.
* @net_fill_forward_path: Called from .ndo_fill_forward_path in order to
* resolve a path for hardware flow offloading
*/
Expand Down Expand Up @@ -4277,8 +4277,8 @@ struct ieee80211_ops {
struct ieee80211_twt_setup *twt);
void (*twt_teardown_request)(struct ieee80211_hw *hw,
struct ieee80211_sta *sta, u8 flowid);
int (*set_radar_offchan)(struct ieee80211_hw *hw,
struct cfg80211_chan_def *chandef);
int (*set_radar_background)(struct ieee80211_hw *hw,
struct cfg80211_chan_def *chandef);
int (*net_fill_forward_path)(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
Expand Down
14 changes: 7 additions & 7 deletions include/uapi/linux/nl80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2646,10 +2646,10 @@ enum nl80211_commands {
* Mandatory parameter for the transmitting interface to enable MBSSID.
* Optional for the non-transmitting interfaces.
*
* @NL80211_ATTR_RADAR_OFFCHAN: Configure dedicated offchannel chain available for
* radar/CAC detection on some hw. This chain can't be used to transmit
* or receive frames and it is bounded to a running wdev.
* Offchannel radar/CAC detection allows to avoid the CAC downtime
* @NL80211_ATTR_RADAR_BACKGROUND: Configure dedicated offchannel chain
* available for radar/CAC detection on some hw. This chain can't be used
* to transmit or receive frames and it is bounded to a running wdev.
* Background radar/CAC detection allows to avoid the CAC downtime
* switching on a different channel during CAC detection on the selected
* radar channel.
*
Expand Down Expand Up @@ -3159,7 +3159,7 @@ enum nl80211_attrs {
NL80211_ATTR_MBSSID_CONFIG,
NL80211_ATTR_MBSSID_ELEMS,

NL80211_ATTR_RADAR_OFFCHAN,
NL80211_ATTR_RADAR_BACKGROUND,

/* add attributes here, update the policy in nl80211.c */

Expand Down Expand Up @@ -6066,7 +6066,7 @@ enum nl80211_feature_flags {
* frames. Userspace has to share FILS AAD details to the driver by using
* @NL80211_CMD_SET_FILS_AAD.
*
* @NL80211_EXT_FEATURE_RADAR_OFFCHAN: Device supports offchannel radar/CAC
* @NL80211_EXT_FEATURE_RADAR_BACKGROUND: Device supports background radar/CAC
* detection.
*
* @NUM_NL80211_EXT_FEATURES: number of extended features.
Expand Down Expand Up @@ -6135,7 +6135,7 @@ enum nl80211_ext_feature_index {
NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
NL80211_EXT_FEATURE_BSS_COLOR,
NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,
NL80211_EXT_FEATURE_RADAR_OFFCHAN,
NL80211_EXT_FEATURE_RADAR_BACKGROUND,

/* add new features before the definition below */
NUM_NL80211_EXT_FEATURES,
Expand Down
10 changes: 5 additions & 5 deletions net/mac80211/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -4414,15 +4414,15 @@ ieee80211_color_change(struct wiphy *wiphy, struct net_device *dev,
}

static int
ieee80211_set_radar_offchan(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef)
ieee80211_set_radar_background(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef)
{
struct ieee80211_local *local = wiphy_priv(wiphy);

if (!local->ops->set_radar_offchan)
if (!local->ops->set_radar_background)
return -EOPNOTSUPP;

return local->ops->set_radar_offchan(&local->hw, chandef);
return local->ops->set_radar_background(&local->hw, chandef);
}

const struct cfg80211_ops mac80211_config_ops = {
Expand Down Expand Up @@ -4529,5 +4529,5 @@ const struct cfg80211_ops mac80211_config_ops = {
.reset_tid_config = ieee80211_reset_tid_config,
.set_sar_specs = ieee80211_set_sar_specs,
.color_change = ieee80211_color_change,
.set_radar_offchan = ieee80211_set_radar_offchan,
.set_radar_background = ieee80211_set_radar_background,
};
6 changes: 3 additions & 3 deletions net/wireless/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -718,13 +718,13 @@ static bool
cfg80211_offchan_chain_is_active(struct cfg80211_registered_device *rdev,
struct ieee80211_channel *channel)
{
if (!rdev->offchan_radar_wdev)
if (!rdev->background_radar_wdev)
return false;

if (!cfg80211_chandef_valid(&rdev->offchan_radar_chandef))
if (!cfg80211_chandef_valid(&rdev->background_radar_chandef))
return false;

return cfg80211_is_sub_chan(&rdev->offchan_radar_chandef, channel);
return cfg80211_is_sub_chan(&rdev->background_radar_chandef, channel);
}

bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,
Expand Down
13 changes: 7 additions & 6 deletions net/wireless/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,10 @@ struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv,
INIT_WORK(&rdev->rfkill_block, cfg80211_rfkill_block_work);
INIT_WORK(&rdev->conn_work, cfg80211_conn_work);
INIT_WORK(&rdev->event_work, cfg80211_event_work);
INIT_WORK(&rdev->offchan_cac_abort_wk, cfg80211_offchan_cac_abort_wk);
INIT_DELAYED_WORK(&rdev->offchan_cac_done_wk,
cfg80211_offchan_cac_done_wk);
INIT_WORK(&rdev->background_cac_abort_wk,
cfg80211_background_cac_abort_wk);
INIT_DELAYED_WORK(&rdev->background_cac_done_wk,
cfg80211_background_cac_done_wk);

init_waitqueue_head(&rdev->dev_wait);

Expand Down Expand Up @@ -1057,13 +1058,13 @@ void wiphy_unregister(struct wiphy *wiphy)
cancel_work_sync(&rdev->conn_work);
flush_work(&rdev->event_work);
cancel_delayed_work_sync(&rdev->dfs_update_channels_wk);
cancel_delayed_work_sync(&rdev->offchan_cac_done_wk);
cancel_delayed_work_sync(&rdev->background_cac_done_wk);
flush_work(&rdev->destroy_work);
flush_work(&rdev->sched_scan_stop_wk);
flush_work(&rdev->propagate_radar_detect_wk);
flush_work(&rdev->propagate_cac_done_wk);
flush_work(&rdev->mgmt_registrations_update_wk);
flush_work(&rdev->offchan_cac_abort_wk);
flush_work(&rdev->background_cac_abort_wk);

#ifdef CONFIG_PM
if (rdev->wiphy.wowlan_config && rdev->ops->set_wakeup)
Expand Down Expand Up @@ -1212,7 +1213,7 @@ void __cfg80211_leave(struct cfg80211_registered_device *rdev,

cfg80211_pmsr_wdev_down(wdev);

cfg80211_stop_offchan_radar_detection(wdev);
cfg80211_stop_background_radar_detection(wdev);

switch (wdev->iftype) {
case NL80211_IFTYPE_ADHOC:
Expand Down
20 changes: 10 additions & 10 deletions net/wireless/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ struct cfg80211_registered_device {

struct delayed_work dfs_update_channels_wk;

struct wireless_dev *offchan_radar_wdev;
struct cfg80211_chan_def offchan_radar_chandef;
struct delayed_work offchan_cac_done_wk;
struct work_struct offchan_cac_abort_wk;
struct wireless_dev *background_radar_wdev;
struct cfg80211_chan_def background_radar_chandef;
struct delayed_work background_cac_done_wk;
struct work_struct background_cac_abort_wk;

/* netlink port which started critical protocol (0 means not started) */
u32 crit_proto_nlportid;
Expand Down Expand Up @@ -497,15 +497,15 @@ cfg80211_chandef_dfs_cac_time(struct wiphy *wiphy,
void cfg80211_sched_dfs_chan_update(struct cfg80211_registered_device *rdev);

int
cfg80211_start_offchan_radar_detection(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev,
struct cfg80211_chan_def *chandef);
cfg80211_start_background_radar_detection(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev,
struct cfg80211_chan_def *chandef);

void cfg80211_stop_offchan_radar_detection(struct wireless_dev *wdev);
void cfg80211_stop_background_radar_detection(struct wireless_dev *wdev);

void cfg80211_offchan_cac_done_wk(struct work_struct *work);
void cfg80211_background_cac_done_wk(struct work_struct *work);

void cfg80211_offchan_cac_abort_wk(struct work_struct *work);
void cfg80211_background_cac_abort_wk(struct work_struct *work);

bool cfg80211_any_wiphy_oper_chan(struct wiphy *wiphy,
struct ieee80211_channel *chan);
Expand Down
Loading

0 comments on commit a95bfb8

Please sign in to comment.