From: Hari Chandrakanthan Add a new API ieee80211_incumbent_signal_detected() that can be used by wireless drivers to notify the higher layers about the interference of incumbent signals in 6 GHz band with the operating channel (mandatory to pass during MLO) and the interference bitmap in which each bit denotes the affected 20 MHz in the operating channel. Signed-off-by: Hari Chandrakanthan Co-developed-by: Aditya Kumar Singh Signed-off-by: Aditya Kumar Singh Signed-off-by: Amith A --- include/net/mac80211.h | 14 ++++++++++++++ net/mac80211/trace.h | 26 ++++++++++++++++++++++++++ net/mac80211/util.c | 14 ++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 36ae7fe9ddf3..d586eab10f26 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -7899,4 +7899,18 @@ int ieee80211_emulate_switch_vif_chanctx(struct ieee80211_hw *hw, * Return: %true iff the vif is a NAN interface and NAN is started */ bool ieee80211_vif_nan_started(struct ieee80211_vif *vif); + +/** + * ieee80211_incumbent_signal_detected - inform that an incumbent signal + * interference was detected + * @hw: pointer as obtained from ieee80211_alloc_hw() + * @chanctx_conf: Channel context on which the signal interference was detected. + * Mandatory to pass a valid pointer for MLO. For non-MLO %NULL can be + * passed + * @incumbt_sig_intf_bmap: Bitmap indicating where the incumbent signal was + * detected. + */ +void ieee80211_incumbent_signal_detected(struct ieee80211_hw *hw, + struct ieee80211_chanctx_conf *chanctx_conf, + u32 incumbt_sig_intf_bmap); #endif /* MAC80211_H */ diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h index 0bfbce157486..74741a61546c 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -3136,6 +3136,32 @@ TRACE_EVENT(api_radar_detected, ) ); +TRACE_EVENT(api_incumbent_signal_detected, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_chanctx_conf *chanctx_conf, + u32 bitmap), + + TP_ARGS(local, chanctx_conf, bitmap), + + TP_STRUCT__entry( + LOCAL_ENTRY + CHANDEF_ENTRY + __field(u32, bitmap) + ), + + TP_fast_assign( + LOCAL_ASSIGN; + CHANDEF_ASSIGN(&chanctx_conf->def) + __entry->bitmap = bitmap; + ), + + TP_printk( + LOCAL_PR_FMT " Incumbent signal detected." + CHANDEF_PR_FMT " Bitmap: 0x%x ", + LOCAL_PR_ARG, CHANDEF_PR_ARG, __entry->bitmap + ) +); + TRACE_EVENT(api_request_smps, TP_PROTO(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata, diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 4d5680da7aa0..0e1ee2559130 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -3670,6 +3670,20 @@ void ieee80211_radar_detected(struct ieee80211_hw *hw, } EXPORT_SYMBOL(ieee80211_radar_detected); +void ieee80211_incumbent_signal_detected(struct ieee80211_hw *hw, + struct ieee80211_chanctx_conf *chanctx_conf, + u32 incumbt_sig_intf_bmap) +{ + struct ieee80211_local *local = hw_to_local(hw); + + trace_api_incumbent_signal_detected(local, chanctx_conf, incumbt_sig_intf_bmap); + cfg80211_incumbent_signal_notify(hw->wiphy, + &chanctx_conf->def, + incumbt_sig_intf_bmap, + GFP_ATOMIC); +} +EXPORT_SYMBOL(ieee80211_incumbent_signal_detected); + void ieee80211_chandef_downgrade(struct cfg80211_chan_def *c, struct ieee80211_conn_settings *conn) { -- 2.34.1