Instant Communication requires user space to track the NAN beacons, so fail device registration when the device declares NAN Device support for Instant Communication but doesn't support Rx registration for beacon frames. Signed-off-by: Ilan Peer Signed-off-by: Miri Korenblit --- net/wireless/core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/wireless/core.c b/net/wireless/core.c index 068db5de24f3..fc9b97888191 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -893,6 +893,13 @@ int wiphy_register(struct wiphy *wiphy) WIPHY_NAN_FLAGS_CONFIGURABLE_SYNC))) return -EINVAL; + /* Instant Communication requires user space to track NAN beacons */ + if (WARN_ON((wiphy->nan_capa.flags & WIPHY_NAN_FLAGS_INSTANT_COMM) && + (!wiphy->mgmt_stypes || + !(wiphy->mgmt_stypes[NL80211_IFTYPE_NAN].rx & + BIT(IEEE80211_STYPE_BEACON >> 4))))) + return -EINVAL; + if (WARN_ON(wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS))) return -EINVAL; -- 2.55.0