If the driver advertises WIPHY_NAN_FLAGS_USERSPACE_DE, the NAN Discovery Engine is not offloaded to the driver. Reject the request to add a NAN function in cfg80211. Signed-off-by: Shivani Baranwal --- net/wireless/nl80211.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index d790e204aee3..77b75367de27 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -17383,6 +17383,12 @@ static int nl80211_nan_add_func(struct sk_buff *skb, if (!wdev_running(wdev)) return -ENOTCONN; + if (wdev->wiphy->nan_capa.flags & WIPHY_NAN_FLAGS_USERSPACE_DE) { + NL_SET_ERR_MSG(info->extack, + "NAN Discovery Engine is in userspace"); + return -EOPNOTSUPP; + } + if (!info->attrs[NL80211_ATTR_NAN_FUNC]) return -EINVAL; -- 2.34.1