@@ -4018,6 +4018,10 @@ struct mgmt_frame_regs {
* @set_sar_specs: Update the SAR (TX power) settings.
*
* @color_change: Initiate a color change.
+ *
+ * @set_offchan_chain: Configure dedicated chain available for radar detection
+ * on some hw. The driver is supposed to implement CAC management in sw
+ * or fw.
*/
struct cfg80211_ops {
int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -4348,6 +4352,8 @@ struct cfg80211_ops {
int (*color_change)(struct wiphy *wiphy,
struct net_device *dev,
struct cfg80211_color_change_settings *params);
+ int (*set_offchan_chain)(struct wiphy *wiphy,
+ struct cfg80211_chan_def *chandef);
};
/*
@@ -3933,6 +3933,9 @@ struct ieee80211_prep_tx_info {
* twt structure.
* @twt_teardown_request: Update the hw with TWT teardown request received
* from the peer.
+ * @set_offchan_chain: Configure dedicated chain available for radar detection
+ * on some hw. The driver is supposed to implement CAC management in sw
+ * or fw.
*/
struct ieee80211_ops {
void (*tx)(struct ieee80211_hw *hw,
@@ -4261,6 +4264,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_offchan_chain)(struct ieee80211_hw *hw,
+ struct cfg80211_chan_def *chandef);
};
/**
@@ -4341,6 +4341,18 @@ ieee80211_color_change(struct wiphy *wiphy, struct net_device *dev,
return err;
}
+static int
+ieee80211_set_offchan_chain(struct wiphy *wiphy,
+ struct cfg80211_chan_def *chandef)
+{
+ struct ieee80211_local *local = wiphy_priv(wiphy);
+
+ if (!local->ops->set_offchan_chain)
+ return -EOPNOTSUPP;
+
+ return local->ops->set_offchan_chain(&local->hw, chandef);
+}
+
const struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -4445,4 +4457,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_offchan_chain = ieee80211_set_offchan_chain,
};
@@ -1381,4 +1381,21 @@ static inline int rdev_color_change(struct cfg80211_registered_device *rdev,
return ret;
}
+static inline int
+rdev_set_offchan_chain(struct cfg80211_registered_device *rdev,
+ struct cfg80211_chan_def *chandef)
+{
+ struct wiphy *wiphy = &rdev->wiphy;
+ int ret;
+
+ if (!rdev->ops->set_offchan_chain)
+ return -EOPNOTSUPP;
+
+ trace_rdev_set_offchan_chain(wiphy, chandef);
+ ret = rdev->ops->set_offchan_chain(wiphy, chandef);
+ trace_rdev_return_int(wiphy, ret);
+
+ return ret;
+}
+
#endif /* __CFG80211_RDEV_OPS */
@@ -3643,6 +3643,25 @@ TRACE_EVENT(cfg80211_bss_color_notify,
__entry->color_bitmap)
);
+TRACE_EVENT(rdev_set_offchan_chain,
+ TP_PROTO(struct wiphy *wiphy, struct cfg80211_chan_def *chandef),
+
+ TP_ARGS(wiphy, chandef),
+
+ TP_STRUCT__entry(
+ WIPHY_ENTRY
+ CHAN_DEF_ENTRY
+ ),
+
+ TP_fast_assign(
+ WIPHY_ASSIGN;
+ CHAN_DEF_ASSIGN(chandef)
+ ),
+
+ TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
+ WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
+);
+
#endif /* !__RDEV_OPS_TRACE || TRACE_HEADER_MULTI_READ */
#undef TRACE_INCLUDE_PATH
Introduce set_offchan_chain callback in cfg80211/mac80211_ops in order to configure a dedicated chain available on some hw (e.g. mt7915) to perfrom offchannel CAC detection. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> --- include/net/cfg80211.h | 6 ++++++ include/net/mac80211.h | 5 +++++ net/mac80211/cfg.c | 13 +++++++++++++ net/wireless/rdev-ops.h | 17 +++++++++++++++++ net/wireless/trace.h | 19 +++++++++++++++++++ 5 files changed, 60 insertions(+)