[PATCH 05/71] drivers: Define new NAN capabilities struct
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Wed Apr 1 15:01:14 PDT 2026
Define nan_capa struct that aggregates new NAN capabilities which will
be requried for NAN data path and scheduling.
Add additinal driver flag to indicate NAN Data Path support.
Move the existing nan_flags field into the same struct and adjust the
code accordingly.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
src/drivers/driver.h | 80 ++++++++++++++++++++++++++++---
src/drivers/driver_nl80211.c | 6 +--
src/drivers/driver_nl80211_capa.c | 6 +--
wpa_supplicant/wpa_supplicant.c | 2 +-
4 files changed, 80 insertions(+), 14 deletions(-)
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 1e4a3da355..42b18d7a7c 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -2163,6 +2163,78 @@ enum wpa_driver_if_type {
WPA_IF_MAX
};
+/**
+ * struct nan_capa - NAN capabilities
+ *
+ * @drv_flags: NAN capability flags (WPA_DRIVER_FLAGS_NAN_*)
+ * @num_radios: Maximum number of NAN radios
+ * @sched_chans: Maximum number of channels in NAN schedule (per map)
+ * @slot_duration: NAN schedule bitmap slot duration (16, 32, 64 or 128) in TUs
+ * @schedule_period: Schedule period (powers of 2 in range: 128 - 8192) in TUs
+ * @max_channel_switch_time: Max channel switch time in microseconds
+ * @num_antennas: Number of antennas (lower nibble TX, upper nibble RX)
+ * @op_modes: NAN capability operation modes
+ * @dev_capa: NAN device capabilities
+ * @ht_capab: HT capabilities information as defined in IEEE80211
+ * specification in section 9.4.2.54.2 (HT Capability Information field)
+ * @ht_ampdu_params: HT A-MPDU parameters as defined in IEEE80211
+ * specification in section 9.4.2.54.3 (A-MPDU Parameters field)
+ * @ht_mcs_set: HT MCS set as defined in IEEE80211 specification in
+ * section 9.4.2.54.4 (Supported MCS Set field)
+ * @vht_capab: VHT capabilities information as defined in IEEE80211
+ * specification in section 9.4.2.156.2 (VHT Capabilities Information
+ * field)
+ * @vht_mcs_set: VHT MCS set as defined in IEEE80211 specification in section
+ * 9.4.2.156.3 (Supported VHT-MCS and NSS Set field)
+ * @vht_valid: Whether &vht_capab and &vht_mcs_set are both valid
+ * @he_capab: HE capabilities. See &struct he_capabilities.
+ * @he_valid: Whether HE capabilities are valid
+ *
+ * For the schedule capabilities, even if the driver/device supports multiple
+ * options, only a single option should be selected. For example, if both 16 TU
+ * and 32 TU slot durations are supported, the driver should report
+ * the shortest supported slot duration (16 TU). For schedule period, the
+ * driver should report the maximum supported period, as longer periods can
+ * always be represented by repetitions of the shorter schedule bitmap. In any
+ * case 512/16 configuration is recommended for better interoperability.
+ *
+ * As for the PHY capabilities, HT must be supported for NAN Data path, and
+ * without valid HT capabilities NAN Data path would be disabled.
+ *
+ * TODO: For now support only a single PHY capabilities configuration. This
+ * might need to be extended to support multiple configurations in the future.
+ */
+struct nan_capa {
+/* Driver supports dual band NAN operation */
+#define WPA_DRIVER_FLAGS_NAN_SUPPORT_DUAL_BAND 0x00000001
+/* Driver supports NAN synchronization configuration */
+#define WPA_DRIVER_FLAGS_NAN_SUPPORT_SYNC_CONFIG 0x00000002
+/* Driver supports DW notifications and SDF TX/RX over NAN device interface */
+#define WPA_DRIVER_FLAGS_NAN_SUPPORT_USERSPACE_DE 0x00000004
+/** Driver supports NAN Data path */
+#define WPA_DRIVER_FLAGS_NAN_SUPPORT_NDP 0x00000008
+ u32 drv_flags;
+ u8 num_radios;
+ u8 sched_chans;
+ u8 slot_duration;
+ u16 schedule_period;
+ u16 max_channel_switch_time;
+ u8 num_antennas;
+ u8 op_modes;
+ u8 dev_capa;
+
+ u16 ht_capab;
+ u8 ht_mcs_set[16];
+ u8 ht_ampdu_params;
+
+ u32 vht_capab;
+ u8 vht_mcs_set[8];
+ bool vht_valid;
+
+ struct he_capabilities he_capab;
+ bool he_valid;
+};
+
/**
* struct wpa_driver_capa - Driver capability information
*/
@@ -2586,13 +2658,7 @@ struct wpa_driver_capa {
u8 max_tx_sts_gt_80;
#ifdef CONFIG_NAN
-/* Driver supports dual band NAN operation */
-#define WPA_DRIVER_FLAGS_NAN_SUPPORT_DUAL_BAND 0x00000001
-/* Driver supports NAN synchronization configuration */
-#define WPA_DRIVER_FLAGS_NAN_SUPPORT_SYNC_CONFIG 0x00000002
-/* Driver supports DW notifications and SDF TX/RX over NAN device interface */
-#define WPA_DRIVER_FLAGS_NAN_SUPPORT_USERSPACE_DE 0x00000004
- u32 nan_flags;
+ struct nan_capa nan_capa;
#endif /* CONFIG_NAN */
};
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 52c561dfc1..bcb4148d6b 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -2736,7 +2736,7 @@ static int nl80211_mgmt_subscribe_nan(struct i802_bss *bss)
#ifdef CONFIG_NAN
struct wpa_driver_nl80211_data *drv = bss->drv;
- if (!(drv->capa.nan_flags &
+ if (!(drv->capa.nan_capa.drv_flags &
WPA_DRIVER_FLAGS_NAN_SUPPORT_USERSPACE_DE)) {
wpa_printf(MSG_DEBUG,
"nl80211: User space DE is not supported, don't subscribe to NAN public action frames");
@@ -15302,7 +15302,7 @@ static int nl80211_nan_config(struct i802_bss *bss,
bands |= BIT(NL80211_BAND_2GHZ);
if (params->dual_band) {
- if (drv->capa.nan_flags &
+ if (drv->capa.nan_capa.drv_flags &
WPA_DRIVER_FLAGS_NAN_SUPPORT_DUAL_BAND) {
bands |= BIT(NL80211_BAND_5GHZ);
} else {
@@ -15326,7 +15326,7 @@ static int nl80211_nan_config(struct i802_bss *bss,
goto fail;
if (params->enable_dw_notif) {
- if (!(drv->capa.nan_flags &
+ if (!(drv->capa.nan_capa.drv_flags &
WPA_DRIVER_FLAGS_NAN_SUPPORT_USERSPACE_DE)) {
wpa_printf(MSG_INFO,
"nl80211: Driver doesn't support NAN DW notifications");
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 1ee021cd90..637ccc7c74 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -1221,7 +1221,7 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
bands);
if ((bands & BIT(NL80211_BAND_2GHZ)) &&
(bands & BIT(NL80211_BAND_5GHZ)))
- capa->nan_flags |=
+ capa->nan_capa.drv_flags |=
WPA_DRIVER_FLAGS_NAN_SUPPORT_DUAL_BAND;
}
@@ -1246,14 +1246,14 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
if (tb_nan_capa[NL80211_NAN_CAPA_CONFIGURABLE_SYNC]) {
wpa_printf(MSG_DEBUG,
"nl80211: NAN sync offload supported");
- capa->nan_flags |=
+ capa->nan_capa.drv_flags |=
WPA_DRIVER_FLAGS_NAN_SUPPORT_SYNC_CONFIG;
}
if (tb_nan_capa[NL80211_NAN_CAPA_USERSPACE_DE]) {
wpa_printf(MSG_DEBUG,
"nl80211: NAN user space DE is supported");
- capa->nan_flags |=
+ capa->nan_capa.drv_flags |=
WPA_DRIVER_FLAGS_NAN_SUPPORT_USERSPACE_DE;
}
}
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 72079bccf2..f0e68eb991 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -8010,7 +8010,7 @@ static int wpa_supplicant_init_iface(struct wpa_supplicant *wpa_s,
return -1;
#ifdef CONFIG_NAN
- wpa_s->nan_drv_flags = capa.nan_flags;
+ wpa_s->nan_drv_flags = capa.nan_capa.drv_flags;
#endif /* CONFIG_NAN */
if (wpa_supplicant_init_eapol(wpa_s) < 0)
--
2.53.0
More information about the Hostap
mailing list