]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: cfg80211: Support Tx/Rx of action frame for NAN
authorIlan Peer <ilan.peer@intel.com>
Mon, 8 Sep 2025 11:13:00 +0000 (14:13 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 19 Sep 2025 09:26:22 +0000 (11:26 +0200)
Add support for sending and receiving action frames over a NAN Device
interface:

- For Synchronized NAN operation NAN Service Discovery
  Frames (SDFs) and NAN Action Frames (NAFs) transmissions
  over a NAN Device interface, a channel parameter is not
  mandatory as the frame can be transmitted based on the NAN
  Device schedule.
- For Unsynchronized NAN Discovery (USD) operation the
  SDFs and NAFs could be transmitted using NL80211_CMD_FRAME
  where a specific channel and dwell time are configured.

As Synchronized NAN Operation and USD can be done concurrently,
both modes need to be supported. Thus, allow sending NAN action
frames when user space handles the NAN Discovery Engine (DE) with
and without providing a channel as a parameter.

To support reception of NAN Action frames and Authentication
frames (used for NAN paring and verification) allow to
register for management frame reception of NAN Device interface
when user space handles the NAN DE.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250908140015.71da2b062929.I0166d51dcf14393f628cd5da366c21114f518618@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index bcd18ae59e8495e5e2113b2864e8917960f190db..72f68a17c92be09de09859d9c5ccc2cec97a2351 100644 (file)
@@ -13782,7 +13782,9 @@ static int nl80211_register_mgmt(struct sk_buff *skb, struct genl_info *info)
                break;
        case NL80211_IFTYPE_NAN:
                if (!wiphy_ext_feature_isset(wdev->wiphy,
-                                            NL80211_EXT_FEATURE_SECURE_NAN))
+                                            NL80211_EXT_FEATURE_SECURE_NAN) &&
+                   !(wdev->wiphy->nan_capa.flags &
+                     WIPHY_NAN_FLAGS_USERSPACE_DE))
                        return -EOPNOTSUPP;
                break;
        default:
@@ -13843,7 +13845,9 @@ static int nl80211_tx_mgmt(struct sk_buff *skb, struct genl_info *info)
                break;
        case NL80211_IFTYPE_NAN:
                if (!wiphy_ext_feature_isset(wdev->wiphy,
-                                            NL80211_EXT_FEATURE_SECURE_NAN))
+                                            NL80211_EXT_FEATURE_SECURE_NAN) &&
+                   !(wdev->wiphy->nan_capa.flags &
+                     WIPHY_NAN_FLAGS_USERSPACE_DE))
                        return -EOPNOTSUPP;
                break;
        default: