On 6/23/2025 3:54 AM, Andrei Otcheretianski wrote:
Add better break down for NAN capabilities, as NAN has multiple optional
features. This allows to better indicate which features are supported or
or offloaded to the device.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@xxxxxxxxx>
---
include/uapi/linux/nl80211.h | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index a68c486e2083..f2d4a2007463 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -2915,6 +2915,10 @@ enum nl80211_commands {
* %NL80211_CMD_START_NAN and %NL80211_CMD_CHANGE_NAN_CONFIG.
* See &enum nl80211_nan_conf_attributes for details.
* This attribute is optional.
+ * @NL80211_ATTR_NAN_CAPABILITIES: Nested attribute for NAN capabilities.
+ * This is used with %NL80211_CMD_GET_WIPHY to indicate the NAN
+ * capabilities supported by the driver. See &enum nl80211_nan_capabilities
+ * for details.
*
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
@@ -3474,6 +3478,7 @@ enum nl80211_attrs {
NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS,
NL80211_ATTR_NAN_CONFIG,
+ NL80211_ATTR_NAN_CAPABILITIES,
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -8226,4 +8231,35 @@ enum nl80211_wiphy_radio_freq_range {
NL80211_WIPHY_RADIO_FREQ_ATTR_MAX = __NL80211_WIPHY_RADIO_FREQ_ATTR_LAST - 1,
};
+/**
+ * enum nl80211_nan_capabilities - NAN (Neighbor Aware Networking)
+ * capabilities.
+ *
+ * @__NL80211_NAN_CAPABILITIES_INVALID: Invalid.
+ * @NL80211_NAN_CAPA_SYNC_OFFLOAD: Flag attribute indicating that
+ * NAN synchronization offload is supported. If this capability is set,
+ * the driver must be able to handle %NL80211_ATTR_NAN_CONFIG
+ * attribute in the %NL80211_CMD_START_NAN (and change) command.
+ * @NL80211_NAN_CAPA_DE_OFFLOAD: Flag attribute indicating that
+ * NAN Discovery Engine (DE) offload is supported. Drivers/devices that set
+ * this capability must be able to handle %NL80211_CMD_ADD_NAN_FUNCTION,
+ * %NL80211_CMD_DEL_NAN_FUNCTION and %NL80211_CMD_NAN_MATCH commands.
+ * @NL80211_NAN_CAPA_DW_NOTIF_SUPPORT: Flag attribute indicating that
+ * the device supports notifying user space about the upcoming
+ * discovery window (DW) using %NL80211_CMD_NAN_NEXT_DW_NOTIFICATION.
Can we add below additional capabilities also.
* @NL80211_NAN_CAPA_INSTANT_MODE_SUPPORT: Flag attribute indicating if the
* device supports instant mode operation for faster NAN session setup.
* @NL80211_NAN_CAPA_6G_SUPPORT: Flag attribute indicating if the device
* supports NAN operation in 6 GHz band.
* @NL80211_NAN_CAPA_HE_SUPPORT: Flag attribute indicating if the device
* supports 802.11ax (HE) features in NAN.
* @NL80211_NAN_CAPA_PAIRING_SUPPORT: Flag attribute indicating if the
device
* supports secure pairing over NAN.
* @NL80211_NAN_CAPA_SET_CLUSTER_ID_SUPPORT: Flag attribute indicating
if the
* device supports setting a custom cluster ID for NAN operation.
* @NL80211_NAN_CAPA_PERIODIC_RANGING_SUPPORT: Flag attribute
indicating if the
* device supports periodic ranging sessions over NAN.
* @NL80211_NAN_CAPA_RTT_SUPPORTED_BW: (u32) Bitmask indicating supported
* bandwidths for RTT (ranging) over NAN.
* @NL80211_NAN_CAPA_MAX_CONCURRENT_CLUSTERS: (u8) value to indicate
maximum
* number of clusters the device can join concurrently.
* @NL80211_NAN_CAPA_MAX_PUBLISH_SESSIONS: (u8) value to indicate
maximum number
* of concurrent publish sessions supported.
* @NL80211_NAN_CAPA_MAX_SUBSCRIBE_SESSIONS: (u8) value to indicate maximum
* number of concurrent subscribe sessions supported.
* @NL80211_NAN_CAPA_MAX_MATCH_FILTER_LEN: (u16) Maximum length (in
bytes) of an
* individual match filter.
* @NL80211_NAN_CAPA_MAX_TOTAL_MATCH_FILTER_LEN: (u16) Maximum total length
* (in bytes) of all match filters combined across sessions.
* @NL80211_NAN_CAPA_MAX_SSI_LEN: (u16) Maximum length (in bytes) of
the service
* specific info (SSI) field.
* @NL80211_NAN_CAPA_MAX_NDI_IFACES: (u8) Maximum number of NAN Data
Interfaces
* (NDI) supported concurrently.
* @NL80211_NAN_CAPA_MAX_NDP_SESSIONS: (u8) Maximum number of
concurrent NAN
* Data Path (NDP) sessions supported.
* @NL80211_NAN_CAPA_MAX_QUEUED_TRANSMIT_FOLLOWUP_MSGS: (u16) Maximum
number of
* follow-up messages that can be queued for transmission.
* @NL80211_NAN_CAPA_MAX_SDEA_SSI_LEN: (u16) Maximum length (in bytes)
of the
* extended service specific info (SDEA SSI) field.
* @NL80211_NAN_CAPA_MAX_SUBSCRIBE_ADDRESSES: (u8) Maximum number of
subscribe
* addresses supported.
* @NL80211_NAN_CAPA_MAX_RX_CHAINS: (u8) Maximum number of receive chains
* supported for NAN operation.
+ *
+ * @__NL80211_NAN_CAPABILITIES_LAST: Internal
+ * @NL80211_NAN_CAPABILITES_MAX: Highest NAN capability attribute.
+ */
+enum nl80211_nan_capabilities {
+ __NL80211_NAN_CAPABILITIES_INVALID,
+
+ NL80211_NAN_CAPA_SYNC_OFFLOAD,
+ NL80211_NAN_CAPA_DE_OFFLOAD,
+ NL80211_NAN_CAPA_DW_NOTIF_SUPPORT,
NL80211_NAN_CAPA_INSTANT_MODE_SUPPORT,
NL80211_NAN_CAPA_6G_SUPPORT,
NL80211_NAN_CAPA_HE_SUPPORT,
NL80211_NAN_CAPA_PAIRING_SUPPORT,
NL80211_NAN_CAPA_SET_CLUSTER_ID_SUPPORT,
NL80211_NAN_CAPA_PERIODIC_RANGING_SUPPORT,
NL80211_NAN_CAPA_RTT_SUPPORTED_BW,
NL80211_NAN_CAPA_MAX_CONCURRENT_CLUSTERS,
NL80211_NAN_CAPA_MAX_PUBLISH_SESSIONS,
NL80211_NAN_CAPA_MAX_SUBSCRIBE_SESSIONS,
NL80211_NAN_CAPA_MAX_MATCH_FILTER_LEN,
NL80211_NAN_CAPA_MAX_TOTAL_MATCH_FILTER_LEN,
NL80211_NAN_CAPA_MAX_SSI_LEN,
NL80211_NAN_CAPA_MAX_NDI_IFACES,
NL80211_NAN_CAPA_MAX_NDP_SESSIONS,
NL80211_NAN_CAPA_MAX_QUEUED_TRANSMIT_FOLLOWUP_MSGS,
NL80211_NAN_CAPA_MAX_SDEA_SSI_LEN,
NL80211_NAN_CAPA_MAX_SUBSCRIBE_ADDRESSES,
NL80211_NAN_CAPA_MAX_RX_CHAINS,
+ /* keep last */
+ __NL80211_NAN_CAPABILITIES_LAST,
+ NL80211_NAN_CAPABILITES_MAX = __NL80211_NAN_CAPABILITIES_LAST - 1,
+};
+
#endif /* __LINUX_NL80211_H */