Commit Graph
420 Commits
Author SHA1 Message Date
sibeibei 837a490595 feat(wifi): adpater apb clock is independent 2026-06-10 20:40:27 +08:00
tarun.kumar cfb5457470 fix(wifi) : Add Mode/threshold checks in esp_wifi_disable_pmf_config()
- Updated API documentation for esp_wifi_disable_pmf_config()
2026-05-27 12:02:26 +05:30
Shreyas Sheth 41b4d70ad4 feat(esp_wifi): Add support for multiconfig support for DPP 2026-05-25 13:57:28 +08:00
Shreyas Sheth 2d3c11b277 fix(esp_wifi): Fix ci pipeline for random mac feature 2026-05-25 11:22:45 +08:00
Aditi 18cbdbf2b1 feat(esp_wifi): Add improvements for privacy extension
1) Add support for MAC randomization in Active scan and connect
  2) Add support for randomizaton of sequence numbers
  3) Add support for randomization of dialog token for GAS frames
2026-05-25 11:22:45 +08:00
0f8d4b74a0 feat(esp_wifi): NAN Pairing Improvements and bugfixes
- Route NAN pairing bootstrap via NPBA receive path
- extend datapath_req wait time to fit secured M1-M4 handshake
- Plug ND-PMK derived from KDK into NDP
- prefers paired-peer cached ND-PMK (from PASN pairing complete), when available
- carry ND-PMK metadata in pairing install callback
- Extend PASN key-installed callback payload to include role, mapped NDP CSID
  and derived ND-PMK so the NAN layer can populate paired-peer security cache.

Co-authored-by: Akshat Agrawal <akshat.agrawal@espressif.com>
Co-authored-by: Sarvesh Bodakhe <sarvesh.bodakhe@espressif.com>
2026-05-22 11:30:00 +05:30
9f361f478d feat(esp_wifi): Add NAN Pairing support
- Add container struct for internal extra params for follow-up
- Support for parsing Shared Key Desc in Pairing follow-up
- Implement NAN Pairing API's with required parameters
- In KeyData set cipher_ver to 0, Key Info to 0x12C8
  (AKM-defined | Pairwise | Install | ACK |
   Secure | Encrypted Key Data) for iOS compatibility
- Move NAN PASN into esp_nan_supplicant.c, move declarations
  to esp_private/esp_supp_nan.h
- Align PASN/ND-PMK derivation with hostap

Co-authored-by: Sajia <sajia.ali@espressif.com>
Co-authored-by: Akshat Agrawal <akshat.agrawal@espressif.com>
Co-authored-by: Sarvesh Bodakhe <sarvesh.bodakhe@espressif.com>
2026-05-22 13:01:51 +08:00
Nachiket Kukade e731ff3598 feat(wpa_supplicant): Add PASN Support to for NAN Pairing
- Create pasn module from upstream. Changes till 1a791e9c
- Add ecdh prime len api to MbedTLS port
- Integrate nan and pasn modules for PIN code method
- Fix KCK length and add auth timeout
- Add NAN Pairing PASN support
2026-05-22 13:01:51 +08:00
Nachiket Kukade 38182e38c0 feat(esp_wifi): Add NAN pairing bootstrapping APIs for Wi-Fi Aware 4.0
- Implement the bootstrapping handshake phase of NAN pairing (spec 7.6.4.1).
- Add pairing support to NAN Publish/Subscribe APIs:
- Add dummy NIRA , MME Attributes
2026-05-22 13:01:51 +08:00
sibeibei 68c9de209b feat(wifi): add sleep retention attach/detach in hw start/stop 2026-05-21 11:46:16 +08:00
Sarvesh Bodakhe b3512ccf7d change(wifi): NAN security_cfg as pointer
security_cfg in wifi_nan_publish_cfg_t / wifi_nan_subscribe_cfg_t is a
large struct; pass it by pointer so callers don't bloat their cfg copy.
Driver deep-copies during publish/subscribe, so caller may free right
after the API returns. Add NULL-check when security_reqd is set.

Update both example apps to declare a local security_cfg and assign its
address. Add help text on EXAMPLE_NAN_SECURITY_ENABLED.
2026-05-19 16:54:17 +05:30
Sarvesh Bodakhe caba5dcfea refactor(wifi): NAN datapath header cleanups and docs
- Rename NAN_IPV6_ADDR_ID_LEN / IS_ZERO_NAN_ADDR_ID to ..._IPV6_IDENTIFIER
  so the names no longer read like MAC-address constants; drop the
  duplicate macro definition in esp_nan.h.
- Replace literal lengths with named macros: WIFI_OUI_LEN for
  nan_vendor_ie_t.vendor_oui, and a new WIFI_MAC_ADDR_LEN (private)
  applied to the NAN-related structs and callbacks in esp_private/wifi.h.
- Document each callback in struct nan_sync_callbacks and each helper
  in struct nan_secure_dp_funcs: when fired / when invoked, what each
  argument means, and the matching spec section where useful.
- Note in wifi_nan_datapath_req_t / wifi_nan_datapath_resp_t that they
  cover the NCS-SK credential model only; pairing-based cipher suites
  (NCS-PK-PASN) install per-peer ND-PMKs via a separate pairing API
  without changing these structs. Record why per-NDP credential
  injection at response time is not viable: the responder's PMKID
  lookup happens at M1 receive time, before the indication event
  surfaces to the host.
2026-05-19 16:54:12 +05:30
Sarvesh Bodakhe cfecf60986 feat(wifi): NAN multi-credential discovery security
Replace scalar passphrase/PMK in wifi_nan_discovery_security_params_t
with wifi_nan_credential_t[N] array (cap 4) per Wi-Fi Aware v4.0
§9.5.21.4. Drop public PMKID array and service-level csid_bitmap.

Rename wifi_nan_datapath_security_params_t -> wifi_nan_security_params_t;
add wifi_nan_peer_sdf_security_t for multi-PMKID peer-RX. The
derive_security_params callback takes (svc_name, sec_cfg, out_derived[])
and runs once per credential on the WiFi task. Split nan_record_own_svc
into claim/finalize so the WiFi-task callback finds the pending slot
by name and mirrors derived material — no main-task PBKDF2.
2026-05-19 11:11:55 +05:30
Sarvesh Bodakhe 94f226d73b feat(wifi): NAN encrypted datapath (Wi-Fi Aware M1-M4 handshake)
Implement the NAN Data Path encrypted datapath per Wi-Fi Aware v4.0
(§7.1.3.5, §9.5.16):

- Responder + initiator sides of the M1-M4 Shared-Key Descriptor
  exchange, with MIC compute/verify, PTK derivation, and PMK/PMKID
  derivation via PBKDF2-SHA256 over passphrase or pre-shared PMK.
- CSIA / SCIA attribute build + parse, NCS-SK-128 cipher suite.
- Per-NDL security context on ndl_info::security_ctx; per-svc PMK cache.
- ndp_response_indication callback for initiator peer-NDI binding.
- host<->blob ABI migrated from 27 direct esp_nan_* externs to a single
  nan_secure_dp_funcs callback struct in esp_private/wifi.h.
- nan_security.c split out of nan_app.c (~340 lines de-duplicated into
  shared M1-M4 helpers).
- CONFIG_ESP_WIFI_NAN_ENCRYPTED_DATAPATH gates the secure path so non-
  security builds compile out the crypto/handshake code.
- ROM patch (esp32s31): mask ieee80211_encap_esfbuf to match the
  c5/c6/c61 pattern for NAN-capable chips.

Hardening: PMK stack copies zeroized on every return, NDP attribute
parsers bounds-checked, CSID range-checked before shifting, NDL slot
reuse only when handshake state is IDLE, get_csia/scia_len aligned with
their builders on empty input.

API surface: NDP security types moved out of esp_wifi_types_generic.h
into esp_private/wifi.h (internal-only). security pointer dropped from
struct ndp_cb_peer_info. Discovery-side wifi_nan_security_type_t and
the NDP Info callbacks removed (subsumed by csid_bitmap and SSI
respectively).
2026-05-19 11:07:06 +05:30
muhaidong a1d2b468e8 fix(wifi): update auth mode threshold doc 2026-05-18 15:49:34 +08:00
muhaidong b173349c3b fix(wifi): update wifi scan threshold doc 2026-05-18 14:36:01 +08:00
muhaidong 2dcab6cc00 fix(wifi): support weak func for wifi lmac assert 2026-05-15 14:48:04 +08:00
Akshat Agrawal d66ccc2479 feat(wifi): Add multiple NAN Service Discovery improvements
- Add Country Code, Vendor IE to NAN frames
 - Support parsing of multiple availibility & SDA attributes
 - Add parsing of service response filter
 - Support Bloom filter parsing and generation
 - Record peer_svc for nan_indication_cb
 - Add support for NDPE Extension attribute
2026-05-13 12:08:17 +05:30
yinqingzhao 34ff741b6e feat(regdomain): update regdomain according to wireless-regdb 2026-05-08 12:44:38 +08:00
Nachiket Kukade 4e86f21be9 refactor(ftm): Add dummy FTM calibration values for S31 2026-05-07 18:53:00 +05:30
Akshat Agrawal e36a818a75 refactor(ftm): Update the FTM Comp Header file 2026-05-07 18:51:29 +05:30
Sajia e2e93cc572 refactor(ftm): Use ROC mechanism for offchan ftm 2026-05-07 18:51:27 +05:30
Jiang Jiang Jian 1aae08cb12 Merge branch 'fix/fix_lost_ip_event_issue' into 'master'
fix(lwip): add some feature for dhcp and improve api

Closes WIFI-7304

See merge request espressif/esp-idf!47221
2026-05-07 20:53:23 +08:00
yinqingzhao be8bc4f247 feat(wifi): support disable 11ac and 11ax in efuse 2026-05-07 12:27:46 +08:00
muhaidong 47e680d2cd fix(wifi): fix max connection number issue 2026-05-06 20:48:22 +08:00
tarun.kumar d698d5345a feat(wifi) : OWE softAP review follow ups
- OWE: clear PRK on HKDF failure; wipe PMK with bin_clear_free; reuse PMK
      buffer when size matches.
    - 4-way handshake: drop extra OWE check so WPA2-PSK can try the next passphrase.
    - SoftAP: simpler OWE key setup and assoc response IEs (skip useless RSNXE step).
2026-05-05 21:40:56 +05:30
Aditi 7d0551257c feat(esp_wifi): Add changes for addressing some review comments
Closes https://github.com/espressif/esp-idf/issues/13457
2026-05-05 21:40:29 +05:30
yinqingzhao 2746df37bf feat(wifi): Add DFS channel handling and CSA support 2026-04-30 14:49:22 +08:00
wangtao@espressif.com 78d59c4cc6 feat(lwip): softap can get sta ip from arp table 2026-04-30 11:52:28 +08:00
yinqingzhao c3da80ee52 feat(wifi): add esp32s31 wifi support 2026-04-16 20:17:07 +08:00
zhangyanjiao a74f9daab0 feat(wifi): add new api to return home channel info 2026-03-27 19:30:06 +08:00
zhangyanjiao a0868299ff feat(wifi): Added new API to return value for vendor ie cb 2026-03-27 15:06:22 +08:00
muhaidong faf8c4f1c3 feat(wifi): support auto mode connect passive channel hidden ap 2026-03-19 12:15:43 +08:00
Sajia e5e65ce0ae fix(wifi): Add bss max idle timer and protected keep alive fixes 2026-03-18 17:53:12 +05:30
Junchi Chen 3703e15a94 fix(wifi): return specific error in API 2026-03-16 12:06:04 +08:00
muhaidong c5d94afac1 fix(wifi): fix arp and dns affect signaling test issue
1. fix arp and dns affect signaling test issue
2. improve ap channel parameter documentation
3. fix set country change ap channel issue
2026-03-10 19:46:29 +08:00
yinqingzhao c6072de7f6 feat(wifi): support skip whole band when scanning 2026-03-06 14:24:40 +08:00
yinqingzhao aa097c8e4f feat(wifi): add csi lltf bit mode config 2026-01-20 11:21:25 +08:00
Shreyas Sheth 94de5f1219 fix(esp_wifi): Set default NVS sae pwe value to SAE_PWE_BOTH for ap and station 2025-12-29 17:56:48 +05:30
yinqingzhao a6b2eb6ad0 refactor(wifi): remove enum values WIFI_BW_HT20 and WIFI_BW_HT40 2025-12-24 14:11:52 +08:00
zhangyanjiao e93e827185 fix(wifi): fixed the vendor ie length issue 2025-12-16 11:22:33 +08:00
zhangyanjiao 345fcf2834 fix(wifi/espnow): Remove doxygen groups as esp-docs is flat docs style 2025-10-24 10:08:02 +08:00
Sarvesh Bodakhe 4c3d6c1292 fix(wifi): Add refactoring and migration guide for USD, Offchan_tx, ROC
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
2025-10-20 12:46:55 +05:30
Sarvesh Bodakhe a5f6bc639b feat(wifi): Add support to set BSSID (A3) in esp_wifi_action_tx_req 2025-10-20 12:46:44 +05:30
Sarvesh BodakheandShyamal Khachane 93347494b3 feat(wifi): Add support for Wi-Fi Aware: Unsynchronized Service Discover (USD)
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>
2025-10-20 12:18:28 +05:30
Sarvesh Bodakhe 6255a67654 fix(wifi): Add support to receive broadcast frames in ROC (Remain on Channel)
This commit adds the support to receive broadcast frames in ROC Rx
callback. Some use cases may need to receive broadcast packets for
discovery of other peers.

- This can be enabled/disabled through 'allow__broadcast' flag in
  'wifi_roc_req_t' structure.
- In default configration, broadcast packets will always be filtered out and
  will not be passed to the Rx callback to save CPU consumption.
2025-10-20 12:18:19 +05:30
Nachiket Kukade 5c73eef918 fix(esp_wifi): Partially revert NAN event API change from b0498569c8 2025-09-28 22:58:28 +05:30
Nachiket Kukadeandakshat 783b80f9d5 fix(esp_wifi): NAN improvements and bugfixes
- Add NDP Peer inactivity detection and termination support
- Add NDP Action frames internal retries
- Fix NAN API return status to match with Tx status
- Fix false wait events during NAN datapath setup
- Replace NAN default event handlers with callbacks to
  avoid race conditions between wifi and user tasks
- Fix parsing Availability of third party devices

Closes https://github.com/espressif/esp-idf/issues/17529

Co-authored-by: akshat <akshat.agrawal@espressif.com>
2025-09-28 22:58:22 +05:30
Shreyas Sheth 0b0b38ea4c fix(esp_wifi): Set default nvs value for sae identifier to NULL
Resolves regression introduced in 6f7cf98ffe
which may impact WPA3 station connection in certain conditions
2025-09-28 10:37:19 +05:30
Shreyas Sheth 28219461ee fix(esp_wifi): Resolve comments for wpa3_compat mode documentation 2025-09-28 09:10:50 +05:30