From: Yan-Hsuan Chuang Date: Thu, 12 Mar 2020 07:43:37 +0000 (+0800) Subject: mac80211: driver can remain on channel if not using chan_ctx X-Git-Tag: microblaze-v5.10~1137^2~113^2 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=8fa180bb4aceaa25233ea61032eab5b025fb522f;p=linux-2.6-microblaze.git mac80211: driver can remain on channel if not using chan_ctx Some of the drivers are not using channel context, but let the stack to control/switch channels instead. For such cases, driver can still remain on channel because the mac80211 stack actually supports it. The stack will check if the driver is using chan_ctx and has ops->remain_on_channel been hooked. Otherwise it will start its ROC work to remain on channel. So, even if the driver is not using chan_ctx, the driver is still capable of doing remain on channel. Signed-off-by: Yan-Hsuan Chuang Link: https://lore.kernel.org/r/20200312074337.16198-1-yhchuang@realtek.com Signed-off-by: Johannes Berg --- diff --git a/net/mac80211/main.c b/net/mac80211/main.c index fefdd1ca8365..8345926193de 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -576,7 +576,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len, WIPHY_FLAG_REPORTS_OBSS | WIPHY_FLAG_OFFCHAN_TX; - if (ops->remain_on_channel) + if (!use_chanctx || ops->remain_on_channel) wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; wiphy->features |= NL80211_FEATURE_SK_TX_STATUS |