Prior starting tx on DFS channels, the DFS master device shall perform a Channel Availability Check to ensure that there is no radar interference on those channels. Once CAC done, the tx can be enabled with ieee80211_dfs_en_tx(). Signed-off-by: Victor Goldenshtein <victorg@xxxxxx> --- include/net/mac80211.h | 2 ++ net/mac80211/cfg.c | 16 ++++++++++++++++ net/mac80211/driver-ops.h | 12 ++++++++++++ net/mac80211/driver-trace.h | 6 ++++++ 4 files changed, 36 insertions(+), 0 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index de3a97ee..d08b808 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -2238,6 +2238,8 @@ struct ieee80211_ops { bool more_data); int (*hw_dfs_start_radar_detection)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); + int (*hw_dfs_en_tx)(struct ieee80211_hw *hw, + struct ieee80211_vif *vif); }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 080a2a4..2d85a97 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2029,6 +2029,21 @@ static int ieee80211_dfs_start_radar_detection(struct wiphy *wiphy, return ret; } +static int ieee80211_dfs_en_tx(struct wiphy *wiphy, struct net_device *dev) +{ + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + struct ieee80211_local *local = sdata->local; + int ret = -ENOENT; + + if (!local->ops->hw_dfs_en_tx) + return -EOPNOTSUPP; + + mutex_lock(&local->mtx); + ret = drv_dfs_en_tx(local, sdata); + mutex_unlock(&local->mtx); + return ret; +} + static enum work_done_result ieee80211_offchan_tx_done(struct ieee80211_work *wk, struct sk_buff *skb) { @@ -2777,4 +2792,5 @@ struct cfg80211_ops mac80211_config_ops = { .get_channel = ieee80211_wiphy_get_channel, .set_noack_map = ieee80211_set_noack_map, .dfs_start_radar_detection = ieee80211_dfs_start_radar_detection, + .dfs_en_tx = ieee80211_dfs_en_tx, }; diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index b84cade..b37fac5 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -321,6 +321,18 @@ static inline int drv_dfs_en_radar_detection(struct ieee80211_local *local, return ret; } +static inline int drv_dfs_en_tx(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata) +{ + int ret; + + might_sleep(); + + trace_drv_dfs_en_tx(local, sdata); + ret = local->ops->hw_dfs_en_tx(&local->hw, &sdata->vif); + return ret; +} + static inline int drv_sched_scan_start(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata, diff --git a/net/mac80211/driver-trace.h b/net/mac80211/driver-trace.h index 75cca02..5ec9792 100644 --- a/net/mac80211/driver-trace.h +++ b/net/mac80211/driver-trace.h @@ -504,6 +504,12 @@ DEFINE_EVENT(local_sdata_evt, drv_dfs_en_radar_detection, TP_ARGS(local, sdata) ); +DEFINE_EVENT(local_sdata_evt, drv_dfs_en_tx, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata), + TP_ARGS(local, sdata) +); + DEFINE_EVENT(local_sdata_evt, drv_sched_scan_start, TP_PROTO(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata), -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html