From: Ilan Peer <ilan.peer@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org, Ilan Peer <ilan.peer@intel.com>,
Miri Korenblit <miriam.rachel.korenblit@intel.com>
Subject: [PATCH v2 01/11] wifi: cfg80211: nan: add Instant Communication support
Date: Mon, 5 Oct 2026 10:40:26 +0300 [thread overview]
Message-ID: <20261005074037.3506633-2-ilan.peer@intel.com> (raw)
In-Reply-To: <20261005074037.3506633-1-ilan.peer@intel.com>
Add NL80211_NAN_CONF_INSTANT_COMM flag to let user space request that
the NAN synchronization logic starts Instant Communication (IC) as
defined in Chapter 13 of the Wi-Fi Aware Specification v4.0.
Add NL80211_NAN_CAPA_INSTANT_COMM for drivers to advertise it. The
capability requires configurable synchronization support, and IC
requests are rejected if it isn't advertised.
When IC is enabled, user space must also configure the discovery
beacon interval. The IC schedule is expected to be configured
by user space.
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
include/net/cfg80211.h | 9 ++++++++-
include/uapi/linux/nl80211.h | 12 ++++++++++++
net/wireless/core.c | 5 +++++
net/wireless/nl80211.c | 22 ++++++++++++++++++++++
4 files changed, 47 insertions(+), 1 deletion(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 97c16d4ff127..f9d590facfc0 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4183,9 +4183,12 @@ struct cfg80211_nan_band_config {
* that can take a value from 50-6F-9A-01-00-00 to 50-6F-9A-01-FF-FF.
* @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.
+ * @discovery_beacon_interval: interval (in TUs) for discovery beacons. Must be
+ * greater than 0 when @instant_comm is true.
* @enable_dw_notification: flag to enable/disable discovery window
* notifications.
+ * @instant_comm: if true, start Instant Communication (IC) as defined in
+ * Chapter 13 of the Wi-Fi Aware Specification v4.0.
* @band_cfgs: array of band specific configurations, indexed by
* &enum nl80211_band values.
* @extra_nan_attrs: pointer to additional NAN attributes.
@@ -4201,6 +4204,7 @@ struct cfg80211_nan_conf {
u16 scan_dwell_time;
u8 discovery_beacon_interval;
bool enable_dw_notification;
+ bool instant_comm;
struct cfg80211_nan_band_config band_cfgs[NUM_NL80211_BANDS];
const u8 *extra_nan_attrs;
u16 extra_nan_attrs_len;
@@ -6266,10 +6270,13 @@ struct wiphy_radio {
* @WIPHY_NAN_FLAGS_CONFIGURABLE_SYNC: Device supports NAN configurable
* synchronization.
* @WIPHY_NAN_FLAGS_USERSPACE_DE: Device doesn't support DE offload.
+ * @WIPHY_NAN_FLAGS_INSTANT_COMM: Device can switch to Instant Communication
+ * (IC) mode. Can only be set along with %WIPHY_NAN_FLAGS_CONFIGURABLE_SYNC.
*/
enum wiphy_nan_flags {
WIPHY_NAN_FLAGS_CONFIGURABLE_SYNC = BIT(0),
WIPHY_NAN_FLAGS_USERSPACE_DE = BIT(1),
+ WIPHY_NAN_FLAGS_INSTANT_COMM = BIT(2),
};
/**
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 020387d76412..5ac9f02f5ad2 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -7826,6 +7826,11 @@ enum nl80211_nan_band_conf_attributes {
* the upcoming discovery window with
* %NL80211_CMD_NAN_NEXT_DW_NOTIFICATION.
* This is a flag attribute.
+ * @NL80211_NAN_CONF_INSTANT_COMM: If set, the NAN synchronization logic will
+ * start Instant Communication (IC) as defined in Chapter 13 of the
+ * Wi-Fi Aware Specification v4.0.
+ * %NL80211_NAN_CONF_DISCOVERY_BEACON_INTERVAL must be set as well.
+ * This is a flag attribute.
* @NUM_NL80211_NAN_CONF_ATTR: Internal.
* @NL80211_NAN_CONF_ATTR_MAX: Highest NAN configuration attribute.
*
@@ -7841,6 +7846,7 @@ enum nl80211_nan_conf_attributes {
NL80211_NAN_CONF_SCAN_DWELL_TIME,
NL80211_NAN_CONF_DISCOVERY_BEACON_INTERVAL,
NL80211_NAN_CONF_NOTIFY_DW,
+ NL80211_NAN_CONF_INSTANT_COMM,
/* keep last */
NUM_NL80211_NAN_CONF_ATTR,
@@ -9057,6 +9063,11 @@ enum nl80211_s1g_short_beacon_attrs {
* specification Table 79 (Capabilities field).
* @NL80211_NAN_CAPA_PHY: nested attribute containing band-agnostic
* capabilities for NAN data path. See &enum nl80211_nan_phy_cap_attr.
+ * @NL80211_NAN_CAPA_INSTANT_COMM: Flag attribute indicating that the device
+ * can switch to Instant Communication (IC) mode, as defined in Chapter 13
+ * of the Wi-Fi Aware Specification v4.0. Can only be set if
+ * %NL80211_NAN_CAPA_CONFIGURABLE_SYNC is set. When IC is enabled, the IC
+ * schedule is expected to be configured by user space.
* @__NL80211_NAN_CAPABILITIES_LAST: Internal
* @NL80211_NAN_CAPABILITIES_MAX: Highest NAN capability attribute.
*/
@@ -9070,6 +9081,7 @@ enum nl80211_nan_capabilities {
NL80211_NAN_CAPA_MAX_CHANNEL_SWITCH_TIME,
NL80211_NAN_CAPA_CAPABILITIES,
NL80211_NAN_CAPA_PHY,
+ NL80211_NAN_CAPA_INSTANT_COMM,
/* keep last */
__NL80211_NAN_CAPABILITIES_LAST,
NL80211_NAN_CAPABILITIES_MAX = __NL80211_NAN_CAPABILITIES_LAST - 1,
diff --git a/net/wireless/core.c b/net/wireless/core.c
index d13310fef691..068db5de24f3 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -888,6 +888,11 @@ int wiphy_register(struct wiphy *wiphy)
(!wiphy->nan_capa.phy.ht.ht_supported || wiphy->n_radio > 1)))
return -EINVAL;
+ if (WARN_ON((wiphy->nan_capa.flags & WIPHY_NAN_FLAGS_INSTANT_COMM) &&
+ !(wiphy->nan_capa.flags &
+ WIPHY_NAN_FLAGS_CONFIGURABLE_SYNC)))
+ return -EINVAL;
+
if (WARN_ON(wiphy->interface_modes & BIT(NL80211_IFTYPE_WDS)))
return -EINVAL;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 44f2bad08670..94d92b0ebc54 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -686,6 +686,7 @@ nl80211_nan_conf_policy[NL80211_NAN_CONF_ATTR_MAX + 1] = {
[NL80211_NAN_CONF_DISCOVERY_BEACON_INTERVAL] =
NLA_POLICY_RANGE(NLA_U8, 50, 200),
[NL80211_NAN_CONF_NOTIFY_DW] = { .type = NLA_FLAG },
+ [NL80211_NAN_CONF_INSTANT_COMM] = { .type = NLA_FLAG },
};
static const struct netlink_range_validation nl80211_punct_bitmap_range = {
@@ -3025,6 +3026,10 @@ static int nl80211_put_nan_capa(struct wiphy *wiphy, struct sk_buff *msg)
nla_put_flag(msg, NL80211_NAN_CAPA_USERSPACE_DE))
goto fail;
+ if ((wiphy->nan_capa.flags & WIPHY_NAN_FLAGS_INSTANT_COMM) &&
+ nla_put_flag(msg, NL80211_NAN_CAPA_INSTANT_COMM))
+ goto fail;
+
if (nla_put_u8(msg, NL80211_NAN_CAPA_OP_MODE,
wiphy->nan_capa.op_mode) ||
nla_put_u8(msg, NL80211_NAN_CAPA_NUM_ANTENNAS,
@@ -16663,6 +16668,23 @@ static int nl80211_parse_nan_conf(struct wiphy *wiphy,
conf->enable_dw_notification =
nla_get_flag(attrs[NL80211_NAN_CONF_NOTIFY_DW]);
+ conf->instant_comm = nla_get_flag(attrs[NL80211_NAN_CONF_INSTANT_COMM]);
+ if (conf->instant_comm) {
+ if (!(wiphy->nan_capa.flags & WIPHY_NAN_FLAGS_INSTANT_COMM)) {
+ NL_SET_ERR_MSG_ATTR(info->extack,
+ attrs[NL80211_NAN_CONF_INSTANT_COMM],
+ "Instant Communication is not supported");
+ return -EOPNOTSUPP;
+ }
+
+ if (!conf->discovery_beacon_interval) {
+ NL_SET_ERR_MSG_ATTR(info->extack,
+ attrs[NL80211_NAN_CONF_INSTANT_COMM],
+ "Instant Communication requires a discovery beacon interval");
+ return -EINVAL;
+ }
+ }
+
out:
if (!conf->band_cfgs[NL80211_BAND_5GHZ].chan &&
(!conf->bands || conf->bands & BIT(NL80211_BAND_5GHZ))) {
--
2.55.0
next prev parent reply other threads:[~2026-10-04 13:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 7:40 [PATCH v2 00/11] wifi: cfg80211/mac80211: add NAN Instant Communication support Ilan Peer
2026-10-04 13:41 ` Johannes Berg
2026-10-04 13:54 ` Peer, Ilan
2026-10-05 7:40 ` Ilan Peer [this message]
2026-10-05 7:40 ` [PATCH v2 02/11] wifi: mac80211: nan: Update NAN configuration copy Ilan Peer
2026-10-05 7:40 ` [PATCH v2 03/11] wifi: cfg80211: nan: check Rx registration for NAN beacons Ilan Peer
2026-10-05 7:40 ` [PATCH v2 04/11] wifi: cfg80211: do not use NAN beacons to update the BSS table Ilan Peer
2026-10-05 7:40 ` [PATCH v2 05/11] wifi: mac80211: nan: allow Rx registration for NAN beacons Ilan Peer
2026-10-05 7:40 ` [PATCH v2 06/11] wifi: mac80211: accept NAN beacons only when IC is enabled Ilan Peer
2026-10-05 7:40 ` [PATCH v2 07/11] wifi: ieee80211: add NAN service ID list attribute definitions Ilan Peer
2026-10-05 7:40 ` [PATCH v2 08/11] wifi: mac80211_hwsim: nan: use ieee80211_is_nan_beacon() helper Ilan Peer
2026-10-05 7:40 ` [PATCH v2 09/11] wifi: mac80211_hwsim: nan: prepare for more configurable NAN settings Ilan Peer
2026-10-05 7:40 ` [PATCH v2 10/11] wifi: mac80211_hwsim: nan: Handle more of the NAN configuration Ilan Peer
2026-10-05 7:40 ` [PATCH v2 11/11] wifi: mac80211_hwsim: add NAN Instant Communication support Ilan Peer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261005074037.3506633-2-ilan.peer@intel.com \
--to=ilan.peer@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=miriam.rachel.korenblit@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox