Where esp_event is used as depends_components:
- components/esp_event/host_test
- components/esp_event/test_apps
- examples/system/esp_event/default_event_loop
- examples/system/esp_event/user_event_loops
1. fix(wifi): Rename old NAN configuration to NAN-Sync
- Rename CONFIG_ESP_WIFI_NAN_ENABLE to CONFIG_ESP_WIFI_NAN_SYNC_ENABLE to indicate
the support for Synchronized NAN (Wi-Fi Aware).
- Because the original flag really controls the synchronized feature set, rename it
to CONFIG_ESP_WIFI_NAN_SYNC_ENABLE so the NAN-Sync and NAN-USD paths can be
selected independently without confusion.
2. Document esp_wifi_start requirement and fix USD examples
3. Rename nan_callbacks to nan_sync_callbacks
4. Remove the discovery_flag, clarify docs for sync vs USD flows, and add USD start/stop APIs
5. Require esp_wifi_start() before USD start
6. docs(nan): add NAN-USD application examples
7. add migration guide and hints for NAN-USD proto field
8. Improve allow_broadcast documentation
9. Add attention to the API esp_wifi_remain_on_channel
10. fix(wifi): align NAN API renames and docs for v6.0
- keep shared APIs under esp_wifi_nan_* while reserving
sync/usd names for mode-specific entry points
- clarify synchronized-cluster scope in headers, docs, and migration notes (EN/zh-CN)
- update examples for renamed helpers and WIFI_NAN_SYNC_CONFIG_DEFAULT()
- rename `wifi_nan_config_t` to `wifi_nan_sync_config_t`
11. Mark NAN-USD as esp-idf experimental feature
1. Remove redundant fixes in upstream wpa_supplicant for USD
- Upstream supplicant has mostly fixed the issues regarding the
unnecessary resetting pauseStateTimeout.
- Upstream supplicant still needs one fix to avoid resetting the
pauseStateTimeout when subscribe message is received from the peer
which had triggered the pauseStateTimeout previously.
2. Replace array-based channel list with bitmap for NaN-USD
Use `wifi_scan_channel_bitmap_t` to represent the channel list for NaN-USD
publisher and subscriber configurations. This replaces the previous approach
that used a large array to store allowed channels.
Also aligns with internal scan bitmap conventions across Wi-Fi stack.
3. call esp_wifi_nan_stop() after USD exchange or STA stop
Ensure esp_wifi_nan_stop() is called after publish/subscribe activity
completes or when WIFI_EVENT_STA_STOP is received. This prevents NAN stop
errors due to inactive interface. NaN-USD currently uses STA interface
for Tx/Rx.
4. Fix task watchdog timer triggered in active USD subscriber:
As both USD supplicant and offchan TX component gets executed
in the wifi task, it created a deadlock like scenario where offchan TX
done callback was never getting executed and supplicant 'nan_de_timer'
keeps running but failing to send any subscribe frame.
5. Make sure that device is able to recieve action management frames
of size more than 1400 bytes.
6. Update proto field in SSI to match Wi-Fi Aware (NaN) spec format
The 'proto' field in the 'wifi_nan_wfa_ssi_t' structure previously used an
enum (wifi_nan_svc_proto_t), resulting in a 32-bit field. According to
the Wi-Fi NAN Specification (Table 5.7), this field must be a single
octet (8 bits). This commit updates the type to uint8_t to ensure
compliance with the specification.
This mismatch previously triggered warnings but did not cause functional
errors.
7. Set `allow_broadcast` to true in USD Remain on channel
This enables the peer discovery as USD uses NAN-Network Multicast BSSID
as A3 address in publish frames.
8. Implement custom channel<->frequency conversion for NAN-USD
NaN-USD only permits 20 MHz bandwidth channels in the 2.4 GHz and 5 GHz bands
(as per section 4.5.3 of the Wi-Fi Aware Specification v4.0). To avoid linking
a large portion of upstream supplicant code for frequency-to-channel and
channel-to-frequency conversion, implement minimal custom helper functions.
9. Limit NAN_DE_MAX_SERVICE to 2 for ESP_SUPPLICANT
10. Note: Upstream clamps negative `os_reltime` deltas to zero in `nan_de_srv_time_to_next()`,
but our ESP_SUPPLICANT port keeps `os_time_t` unsigned, so that guard just provokes a
compiler warning. We skip it for now because the scheduling loop validates past timestamps
before computing the diff.
Co-authored-by: Shyamal Khachane <shyamal.khachane@espressif.com>
1. Make sure that wpa_supplicant does not encapsulate user-given SSI info
with WFA OUI.
2. USD component shall transfer the SSI given by user as it is, without
any modification or encapsulation.
3. Note that this will break the compatibility of ESP USD implementation
with a device running upstream wpa_supplicant as wpa_supplicant
encapsulates the SSI information with WfA oui.
For compatibility with wpa_supplicant, user needs to handle the
SSI encapsulation/decapsulation.
According to the Wi-Fi Direct spec draft, address 3 in unicast USD
frames shall be set to the P2P Device Address of the sender (i.e., this
differs from the Wi-Fi Aware specification). Fix it.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
According to the Wi-Fi Direct spec draft, address 3 in multicast USD
frames shall be set to wildcard BSSID (i.e., this differs from the Wi-Fi
Aware specification). Fix it.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
P2P2 uses USD with a different group address than the NAN Network ID
defined in the Wi-Fi Aware specification. Select the group address based
on whether USD is used with P2P2 or something else. This changes
behavior only for the P2P2 cases.
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
This behavior is not described in the Wi-Fi Aware specification, so
remove it and instead, expect services to terminate USD explicitly when
no further Follow-up messages are needed.
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
Remain waiting for additional Follow-up messages on a publisher that is
in pauseState for a service that requires further service discovery.
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
If a publish service is configured with an explicit lifetime (ttl), do
not allow pauseState duration to exceed that.
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This can be used to optimize listen operations to be as long as the
driver supports instead of having to use a small enough value to work
with all drivers.
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
Do not unpause publisher if more than one second has passed from the
last Follow-up message TX or RX. There is no such behavior described in
the Wi-Fi Aware specification and it is possible for a service to need
more time to generate Follow-up messages. Leave it to the service itself
to force timeout, if desired, or terminate pauseState after the 60
second overall timeout.
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
There is no need to copy the A3 value for follow-up frames through the
control interface events and commands since it can be handled internally
in the service with sufficient accuracy. More parallel operations with
multiple peers might need per-peer information, but that can be extended
in the future, if that level of complexity is really needed in practice.
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
Wi-Fi Aware spec v4.0 was not clear on all cases and used a bit unclear
definition of A3 use in Table 5 (Address field definiton for NAN SDF
frames in USD). That resulted in the initial implementation using
Wildcard BSSID to comply with the IEEE 802.11 rules on Public Action
frame addressing.
For USD to have chances of working with synchronized NNA devices, A3
needs to be set to the NAN Cluster ID when replying to a frame received
from a synchronized NAN device. While there is no cluster ID for USD,
this can be done by copying the A3 from the received frame. For the
cases where sending out an unsolicited multicast frame, the NAN Network
ID should be used instead of the Wildcard BSSID.
While this behavior is not strictly speaking compliant with the IEEE
802.11 standard, this is the expected behavior for NAN devices, so
update the USD implementation to match.
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
hostapd did not accept NAN SDFs that used NAN Network ID instead of
Wildcard BSSID in A3. Extend this to process NAN Network ID just like
Wildcard BSSID for these frames to allow the specific group address to
be used.
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
Add frequency list to active NAN USD Subscriber to search for a
Publisher on multiple channels. This is the publish channel list used by
the Subscriber to periodically search for a service on these channels.
publishChannelList was already supported in the Publisher and this
commit extends that to the Subscriber.
This is needed for a P2P2 seeker that is an active subscriber looking
for an advertiser on a list of publish channels.
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
Extend the NAN Subscribe and Publish methods to allow p2p=1 to be
specified to include P2P attributes in a P2P IE to be added into the NAN
Element Container attribute. In addition, use the P2P Device Address for
the NAN SDFs for the P2P cases.
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
Support implementation architecture where the NAN discovery engine is
located in the driver/firmware instead of wpa_supplicant.
Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
The Wi-Fi Aware Specification v4.0 only defines unsolicited
transmissions only, solicited transmissions only and both unsolicited
and solicited transmissions publish. The other possibility is undefined
so we should reject it.
Signed-off-by: Chien Wong <m@xv97.com>
Add NAN discovery engine and wpa_supplicant interface to use it for the
subset of NAN functionality that is needed for USD.
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit introduces a new feature to the roaming logic. If the
currently connected AP has the 'transition disable' bit set in its
RSN IE, the roaming logic will now ignore any scanned APs that only
support WPA2-PSK. This prevents a security downgrade when roaming in a
mixed WPA2/WPA3 environment.
A new Kconfig option, CONFIG_ESP_WIFI_IGNORE_WPA2_ONLY_ON_TRANSITION_DISABLE,
has been added to control this feature. It is disabled by default.
With RSN overriding enabled, AP can be configured to set MFPC to 0 and
MFPR to 0 in the RSNE and MFPC to 1 and MFPR to 1 in the RSNOE and
RSNO2E. IGTK generation, configuration to the driver, and inclusion of
the IGTK KDE in 4-way handshake should also take into account the
management frame protection settings in the override variants.
Signed-off-by: Sai Pratyusha Magam <quic_smagam@quicinc.com>
Integer promotion converts u8 rsnxe[i] to an int which is not
sufficiently large to be able to handle the maximum shift left of 24
bits here. Type cast rsnxe[i] to u32 explicitly to get rid of the sign
bit and avoid this undefined behavior from the shift operation.
Credit to OSS-Fuzz: https://issues.oss-fuzz.com/issues/376786400
Fixes: d675d3b15b40 ("Add helper functions for parsing RSNXE capabilities")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
When rsn_override_omit_rsnxe=1 is used to omit the RSNXE from Beacon and
Probe Response frames, it should also be omitted from (Re)Association
Response frames since there is a general expectation on the RSNXE being
used consistently between these frames. This is unlikely to have much of
a difference for most use cases in practice, but this could impact FILS
association if the non-AP STA were to confirm that the unprotected and
protected version of the RSNXE from the AP were identical.
Fixes: 8b2ddfdbb688 ("RSNO: Allow RSNXE to be omitted")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>