diff --git a/net/wireless/core.c b/net/wireless/core.c index 9176659345f0..45a1709cffe7 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -969,6 +969,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;