diff options
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 09d96a8f6c2c..fb306814576a 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -3285,6 +3285,7 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy, | |||
3285 | struct cfg80211_chan_def *chandef) | 3285 | struct cfg80211_chan_def *chandef) |
3286 | { | 3286 | { |
3287 | struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); | 3287 | struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); |
3288 | struct ieee80211_local *local = wiphy_priv(wiphy); | ||
3288 | struct ieee80211_chanctx_conf *chanctx_conf; | 3289 | struct ieee80211_chanctx_conf *chanctx_conf; |
3289 | int ret = -ENODATA; | 3290 | int ret = -ENODATA; |
3290 | 3291 | ||
@@ -3293,6 +3294,16 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy, | |||
3293 | if (chanctx_conf) { | 3294 | if (chanctx_conf) { |
3294 | *chandef = chanctx_conf->def; | 3295 | *chandef = chanctx_conf->def; |
3295 | ret = 0; | 3296 | ret = 0; |
3297 | } else if (local->open_count > 0 && | ||
3298 | local->open_count == local->monitors && | ||
3299 | sdata->vif.type == NL80211_IFTYPE_MONITOR) { | ||
3300 | if (local->use_chanctx) | ||
3301 | *chandef = local->monitor_chandef; | ||
3302 | else | ||
3303 | cfg80211_chandef_create(chandef, | ||
3304 | local->_oper_channel, | ||
3305 | local->_oper_channel_type); | ||
3306 | ret = 0; | ||
3296 | } | 3307 | } |
3297 | rcu_read_unlock(); | 3308 | rcu_read_unlock(); |
3298 | 3309 | ||