From: Andrei Otcheretianski Date: Tue, 23 Dec 2025 11:46:05 +0000 (+0200) Subject: nl80211: Configure 'enable DW notification' NAN flag X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab5a7a1f0998f7143083bb31b50034c50b1aede2;p=thirdparty%2Fhostap.git nl80211: Configure 'enable DW notification' NAN flag 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 --- diff --git a/src/drivers/driver.h b/src/drivers/driver.h index f171a612e..af13a1e05 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -3212,6 +3212,7 @@ struct driver_sta_mlo_info { struct nan_cluster_config { u8 master_pref; u8 dual_band; + bool enable_dw_notif; }; /** diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 4f8b763de..d7fb9507f 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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;