2020-03-03 11:57:28

by Markus Theil

[permalink] [raw]
Subject: [PATCH 2/3] mac80211: conditionally allow scan in monitor mode

This patch checks the monitor mode scan feature flag and conditionally
allows scanning in monitor mode for hw which supports this.

Signed-off-by: Markus Theil <[email protected]>
---
net/mac80211/cfg.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 7b654d2b8bb2..01a20f2dbf86 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2313,6 +2313,12 @@ static int ieee80211_scan(struct wiphy *wiphy,
!(req->flags & NL80211_SCAN_FLAG_AP)))
return -EOPNOTSUPP;
break;
+ case NL80211_IFTYPE_MONITOR:
+ if (wiphy_ext_feature_isset(wiphy,
+ NL80211_EXT_FEATURE_MONITOR_MODE_SCAN))
+ break;
+ else
+ return -EOPNOTSUPP;
case NL80211_IFTYPE_NAN:
default:
return -EOPNOTSUPP;
--
2.25.1