wifi: cfg80211: nan: check Rx registration for NAN beacons

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 <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20261005084458.3666739-4-ilan.peer@intel.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Ilan Peer 2026-10-05 11:44:50 +03:00 committed by Johannes Berg
parent 05b44bd48f
commit f4134597a0

View File

@ -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;