aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>2025-09-08 14:12:56 +0300
committerJohannes Berg <johannes.berg@intel.com>2025-09-19 11:26:21 +0200
commitba9b2ceaa2558a38a5da59fd654b641610a8568e (patch)
treecd19ebaeb2223e184693fbe827d8d7954fda42fb /include
parentwifi: nl80211: Add more configuration options for NAN commands (diff)
downloadlinux-ba9b2ceaa2558a38a5da59fd654b641610a8568e.tar.gz
linux-ba9b2ceaa2558a38a5da59fd654b641610a8568e.zip
wifi: nl80211: Add NAN Discovery Window (DW) notification
This notification will be used by the device to inform user space about upcoming DW. When received, user space will be able to prepare multicast Service Discovery Frames (SDFs) to be transmitted during the next DW using %NL80211_CMD_FRAME command on the NAN management interface. The device/driver will take care to transmit the frames in the correct timing. This allows to implement a synchronized Discovery Engine (DE) in user space, if the device doesn't support DE offload. Note that this notification can be sent before the actual DW starts as long as the driver/device handles the actual timing of the SDF transmission. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250908140015.0e1d15031bab.I5b1721e61b63910452b3c5cdcdc1e94cb094d4c9@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/net/cfg80211.h12
-rw-r--r--include/uapi/linux/nl80211.h16
2 files changed, 28 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index e2f4ca500ea3..0c1311d254be 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3959,6 +3959,8 @@ struct cfg80211_nan_band_config {
* @scan_period: period (in seconds) between NAN scans.
* @scan_dwell_time: dwell time (in milliseconds) for NAN scans.
* @discovery_beacon_interval: interval (in TUs) for discovery beacons.
+ * @enable_dw_notification: flag to enable/disable discovery window
+ * notifications.
* @band_cfgs: array of band specific configurations, indexed by
* &enum nl80211_band values.
* @extra_nan_attrs: pointer to additional NAN attributes.
@@ -3973,6 +3975,7 @@ struct cfg80211_nan_conf {
u16 scan_period;
u16 scan_dwell_time;
u8 discovery_beacon_interval;
+ bool enable_dw_notification;
struct cfg80211_nan_band_config band_cfgs[NUM_NL80211_BANDS];
const u8 *extra_nan_attrs;
u16 extra_nan_attrs_len;
@@ -10062,6 +10065,15 @@ void cfg80211_schedule_channels_check(struct wireless_dev *wdev);
*/
void cfg80211_epcs_changed(struct net_device *netdev, bool enabled);
+/**
+ * cfg80211_next_nan_dw_notif - Notify about the next NAN Discovery Window (DW)
+ * @wdev: Pointer to the wireless device structure
+ * @chan: DW channel (6, 44 or 149)
+ * @gfp: Memory allocation flags
+ */
+void cfg80211_next_nan_dw_notif(struct wireless_dev *wdev,
+ struct ieee80211_channel *chan, gfp_t gfp);
+
#ifdef CONFIG_CFG80211_DEBUGFS
/**
* wiphy_locked_debugfs_read - do a locked read in debugfs
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 20b8202a3d58..d674608e2635 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -1349,6 +1349,15 @@
* control EPCS configuration. Used to notify userland on the current state
* of EPCS.
*
+ * @NL80211_CMD_NAN_NEXT_DW_NOTIFICATION: This command is used to notify
+ * user space about the next NAN Discovery Window (DW). User space may use
+ * it to prepare frames to be sent in the next DW.
+ * %NL80211_ATTR_WIPHY_FREQ is used to indicate the frequency of the next
+ * DW. SDF transmission should be requested with %NL80211_CMD_FRAME and
+ * the device/driver shall take care of the actual transmission timing.
+ * This notification is only sent to the NAN interface owning socket
+ * (see %NL80211_ATTR_SOCKET_OWNER flag).
+ *
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -1609,6 +1618,8 @@ enum nl80211_commands {
NL80211_CMD_ASSOC_MLO_RECONF,
NL80211_CMD_EPCS_CFG,
+ NL80211_CMD_NAN_NEXT_DW_NOTIFICATION,
+
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
@@ -7409,6 +7420,10 @@ enum nl80211_nan_band_conf_attributes {
* @NL80211_NAN_CONF_DISCOVERY_BEACON_INTERVAL: Discovery beacon interval
* in TUs. Valid range is 50-200 TUs. If not configured the device default
* value is used. This is u8 (optional)
+ * @NL80211_NAN_CONF_NOTIFY_DW: If set, the driver will notify userspace about
+ * the upcoming discovery window with
+ * %NL80211_CMD_NAN_NEXT_DW_NOTIFICATION.
+ * This is a flag attribute.
* @NUM_NL80211_NAN_CONF_ATTR: Internal.
* @NL80211_NAN_CONF_ATTR_MAX: Highest NAN configuration attribute.
*
@@ -7423,6 +7438,7 @@ enum nl80211_nan_conf_attributes {
NL80211_NAN_CONF_SCAN_PERIOD,
NL80211_NAN_CONF_SCAN_DWELL_TIME,
NL80211_NAN_CONF_DISCOVERY_BEACON_INTERVAL,
+ NL80211_NAN_CONF_NOTIFY_DW,
/* keep last */
NUM_NL80211_NAN_CONF_ATTR,