]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Configure 'enable DW notification' NAN flag
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Tue, 23 Dec 2025 11:46:05 +0000 (13:46 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 29 Jan 2026 10:31:55 +0000 (12:31 +0200)
Add enable_dw_notif flag to NAN cluster configuration parameters. This
flag is needed to toggle DW notifications generated by kernel in case
user space DE implementation is used.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
src/drivers/driver.h
src/drivers/driver_nl80211.c

index f171a612e038c70c217d470124651d8774cd84f6..af13a1e055c9430ac211897c0114525cc874ccd8 100644 (file)
@@ -3212,6 +3212,7 @@ struct driver_sta_mlo_info {
 struct nan_cluster_config {
        u8 master_pref;
        u8 dual_band;
+       bool enable_dw_notif;
 };
 
 /**
index 4f8b763dea687e55ef39b22e561902d1b07df10d..d7fb9507f0a83cefcc390e0fdc4f21751b9707af 100644 (file)
@@ -15225,6 +15225,7 @@ static int wpa_driver_nl80211_nan_start(void *priv,
        struct i802_bss *bss = priv;
        struct wpa_driver_nl80211_data *drv = bss->drv;
        struct nl_msg *msg;
+       struct nlattr *conf;
        u32 bands = 0;
        int ret;
 
@@ -15261,6 +15262,25 @@ static int wpa_driver_nl80211_nan_start(void *priv,
                goto fail;
        }
 
+       conf = nla_nest_start(msg, NL80211_ATTR_NAN_CONFIG);
+       if (!conf)
+               goto fail;
+
+       if (params->enable_dw_notif) {
+               if (!(drv->capa.nan_flags &
+                     WPA_DRIVER_FLAGS_NAN_SUPPORT_USERSPACE_DE)) {
+                       wpa_printf(MSG_INFO,
+                                  "nl80211: Driver doesn't support NAN DW notifications");
+                       goto fail;
+               }
+
+               if (nla_put_flag(msg, NL80211_NAN_CONF_NOTIFY_DW))
+                       goto fail;
+       }
+
+       /* TODO: Set more attributes */
+       nla_nest_end(msg, conf);
+
        ret = send_and_recv_resp(drv, msg, NULL, NULL);
        if (!ret)
                drv->nan_started = 1;