]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mac80211: allow userspace TX/RX over NAN Data interfaces
authorIlan Peer <ilan.peer@intel.com>
Mon, 4 May 2026 07:20:42 +0000 (10:20 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 5 May 2026 10:10:14 +0000 (12:10 +0200)
Allow TX/RX of action frames (for NAN action frames) over
NAN Data interfaces to support cases where there's a secure
NDP and NAFs may be exchanged over that.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260504101829.4ac207c60ebb.Ic4b1c90552497b7ff2616651a408e5fe8bde7b99@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/main.c
net/mac80211/offchannel.c
net/mac80211/tx.c

index f47dd58770adb9b88fa8067f6cc363d907e356f5..8400792d67e286185d02a99b6d449aacd772232e 100644 (file)
@@ -750,6 +750,10 @@ ieee80211_default_mgmt_stypes[NUM_NL80211_IFTYPES] = {
                .rx = BIT(IEEE80211_STYPE_ACTION >> 4) |
                        BIT(IEEE80211_STYPE_AUTH >> 4),
        },
+       [NL80211_IFTYPE_NAN_DATA] = {
+               .tx = 0xffff,
+               .rx = BIT(IEEE80211_STYPE_ACTION >> 4),
+       },
 };
 
 static const struct ieee80211_ht_cap mac80211_ht_capa_mod_mask = {
index f60f6a58948b15e17cc23c2d5c9353cb53d6235e..10c962d2803734c27554716c274a449ff9507de3 100644 (file)
@@ -8,7 +8,7 @@
  * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
  * Copyright 2007, Michael Wu <flamingice@sourmilk.net>
  * Copyright 2009      Johannes Berg <johannes@sipsolutions.net>
- * Copyright (C) 2019, 2022-2025 Intel Corporation
+ * Copyright (C) 2019, 2022-2026 Intel Corporation
  */
 #include <linux/export.h>
 #include <net/mac80211.h>
@@ -898,6 +898,10 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
                break;
        case NL80211_IFTYPE_NAN:
                break;
+       case NL80211_IFTYPE_NAN_DATA:
+               if (is_multicast_ether_addr(mgmt->da))
+                       return -EOPNOTSUPP;
+               break;
        default:
                return -EOPNOTSUPP;
        }
@@ -911,7 +915,8 @@ int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
        /* Check if the operating channel is the requested channel */
        if (!params->chan && mlo_sta) {
                need_offchan = false;
-       } else if (sdata->vif.type == NL80211_IFTYPE_NAN) {
+       } else if (sdata->vif.type == NL80211_IFTYPE_NAN ||
+                  sdata->vif.type == NL80211_IFTYPE_NAN_DATA) {
                /* Frames can be sent during NAN schedule */
        } else if (!need_offchan) {
                struct ieee80211_chanctx_conf *chanctx_conf = NULL;
index 1702f816419b79cb310c50680d724b7317455733..c18de2cb3769a95bf2353d779866ad4e9760226d 100644 (file)
@@ -5,7 +5,7 @@
  * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
  * Copyright 2007      Johannes Berg <johannes@sipsolutions.net>
  * Copyright 2013-2014  Intel Mobile Communications GmbH
- * Copyright (C) 2018-2025 Intel Corporation
+ * Copyright (C) 2018-2026 Intel Corporation
  *
  * Transmit and frame generation functions.
  */
@@ -6377,7 +6377,8 @@ void ieee80211_tx_skb_tid(struct ieee80211_sub_if_data *sdata,
        enum nl80211_band band;
 
        rcu_read_lock();
-       if (sdata->vif.type == NL80211_IFTYPE_NAN) {
+       if (sdata->vif.type == NL80211_IFTYPE_NAN ||
+           sdata->vif.type == NL80211_IFTYPE_NAN_DATA) {
                band = NUM_NL80211_BANDS;
        } else if (!ieee80211_vif_is_mld(&sdata->vif)) {
                WARN_ON(link_id >= 0);