Commit Graph
116 Commits
Author SHA1 Message Date
Sarvesh Bodakhe e952a580db docs(nan): document group-protection fields, CSID ciphers and NIRA
Refresh stale/missing documentation now that the features are implemented:
- group_data_prot / group_mgmt_prot in wifi_nan_discovery_security_params_t
  (esp_wifi_types_generic.h) and wifi_nan_security_params_t (esp_private/
  wifi.h): describe GTKSA / IGTKSA+BIGTKSA instead of "not supported".
- CSID enum: document NCS-GTK-CCM-128 (set internally via group_data_prot,
  not user-selectable) and NCS-PK-PASN-128 (NAN Pairing, via the Wi-Fi
  Aware component).
- Drop "dummy" from the esp_nan_construct_nira() doc (it builds a real
  NIRA) and a stale "IGTK/BIGTK are placeholders" comment.
2026-07-01 18:12:24 +05:30
Sarvesh Bodakhe 932a9e33d8 feat(wifi): add NAN group data and management frame protection
Add Wi-Fi Aware group-key support to secured NDPs so group-addressed
traffic can be protected, for interop with iOS/macOS peers:

- GTK (NCS-GTK-CCM-128) protects group-addressed data.
- IGTK/BIGTK (BIP) protect group management traffic - multicast SDFs,
  Beacons.

Capabilities are advertised in the CSIA IE: group_data_prot maps to GTKSA,
group_mgmt_prot to IGTKSA/BIGTKSA. The CSIA cannot encode IGTK/BIGTK
without GTK (WiFi Aware spec 9.5.21.2, Table 122), so enabling group_mgmt_prot
forces group_data_prot on for every secured service.

Expose per-service group_data_prot and device-global group_mgmt_prot.
2026-07-01 13:35:15 +05:30
Sajia c18887b05c feat(nan): Add support for NAN Pairing Verification
- Add nira attr and verification for pasn auth frames
- Refine key clearing and pairing complete logic for pasn verify
- Add NIRA own-service resolution, cached NIK checks, and dynamic
  pairing IE construction for bootstrap vs verify paths.
- Replace NAN bootstrap events by private callbacks
2026-06-30 12:58:41 +05:30
Jiang Jiang Jian 87a6c90160 Merge branch 'bugfix/pub_ndp_setup_timeout' into 'master'
fix(nan): Cluster merging and NIK NVS persistence, including pairing and NDP fixes

Closes WIFIBUG-1932, WIFIBUG-1931, WIFIBUG-1927, WIFIBUG-1942, WIFIBUG-1948, WIFIBUG-1955, WIFIBUG-1986, and WIFIBUG-1975

See merge request espressif/esp-idf!49185
2026-06-24 20:57:22 +08:00
Akshat Agrawal c4b1e06057 Address review comments VNC 2026-06-23 22:08:06 +05:30
Akshat Agrawal f68fb697f7 fix(nan): fix NAN pairing NIK/NIRA exchange and verification
Register esp_nan_verify_nira, cache NIRA for publish frames, send own_nik
in pairing follow-up, and complete pairing only after peer NIK is stored.
2026-06-23 22:08:06 +05:30
Sajia 1d044feba3 feat(ftm): Update ftm calibration values esp32s31 2026-06-22 16:14:52 +08:00
sibeibei bd7dc2da07 feat(wifi): adpater apb clock is independent 2026-06-08 19:24:30 +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 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 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
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
yinqingzhao be8bc4f247 feat(wifi): support disable 11ac and 11ax in efuse 2026-05-07 12:27:46 +08:00
yinqingzhao c3da80ee52 feat(wifi): add esp32s31 wifi support 2026-04-16 20:17:07 +08:00
zhangyanjiao a0868299ff feat(wifi): Added new API to return value for vendor ie cb 2026-03-27 15:06:22 +08:00
Junchi Chen 3703e15a94 fix(wifi): return specific error in API 2026-03-16 12:06:04 +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
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
muhaidong a6a9c41573 fix(wifi): fix open mode rx fragment fail issue 2025-07-21 20:17:38 +08:00
yinqingzhao c1c78f5838 feat(wifi): add esp32c61 eco3 wifi support 2025-06-27 14:04:55 +08:00
yinqingzhao 5bed100761 feat(wifi): add tx error 0xa0 count 2025-05-13 11:54:59 +08:00
yinqingzhao dd9f8bfcbc feat(wifi): chip esp32c5 eco2 support wifi 2025-04-28 10:52:55 +08:00
liuning c00d092bdb feat(wifi): support sample beacon feature
fix: adapt soc wakeup quick wake, fix light sleep beacon sample

feat(pm): giveup beacon and resample if rx prop too low (a16fa11)
2025-04-14 11:50:40 +08:00
liuning 2a0791b223 feat(wifi): support to configure wifi modem sleep parameters 2025-04-14 11:33:22 +08:00
sibeibei 28290c8da3 fix(wifi):fix modem state rx bcn failed when tbtt update, support modem state for coexist 2025-04-09 11:41:56 +08:00
Sajia c4f592679b feat(wifi): Enable bss max idle support on all chips
- Fix issues in Max Idle period negotiation and protected keep alive
- Add BSS Max Idle config in SoftAP config and create a feature flag
- Add a unit test case to test both STA and SoftAP implementation
2025-04-08 12:40:15 +05:30
zhangyanjiao 82bce6c077 fix(wifi): Add new api to get mac clock time
Closes https://github.com/espressif/esp-idf/issues/15348
2025-03-14 15:11:44 +08:00
jgujarathi 6547315dde fix(esp_wifi): Stops roaming app upon application initiated disconnect
Stops roaming app when the application initiates a disconnect.
Roaming app if enabled will be restarted when the station reconnects again.
2024-09-11 11:39:43 +08:00
wangtao@espressif.com 82a951447a feat(wifi): update esp32c2 eco4 wifi lib 2024-09-04 10:31:33 +08:00
xuxiao 8780375859 feat(wifi): add wifi support for esp32c61 2024-08-30 20:43:06 +08:00
xuxiao c6104388aa feat(wifi): add wifi support for esp32c5 mp 2024-07-24 18:03:40 +08:00
liuning 68fe185371 feat(wifi): support coex pwr 2024-05-21 14:14:30 +08:00
wangtao@espressif.com 1dbf032995 feat(wifi): add softap csa&dtim&wait_bcast_data setting and ignore err nodata 2024-05-20 13:59:45 +08:00
Jiang Jiang Jian c119fa05f1 Merge branch 'fix/fix_esp32c6_wifi_iperf_example_build_error' into 'master'
fix(example): fix wifi iperf example build errors when enabled CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS

See merge request espressif/esp-idf!30174
2024-04-22 16:17:47 +08:00
Kapil Gupta 58ee771f3c fix(wifi): Run tools/format.sh on WiFi component 2024-04-16 10:58:37 +05:30
xuxiao 5617bfaaec fix(example): fix wifi iperf example build errors when enabled CONFIG_ESP_WIFI_ENABLE_WIFI_RX_STATS 2024-04-15 19:07:37 +08:00
xuxiao 27f61966cd feat(wifi): add esp32c5 beta3 wifi support 2024-04-10 14:09:40 +08:00
xiehang f3c5047638 feat(extconn): Supports external WiFi connections for ESP32p4 and other espressf chips 2024-04-01 11:44:52 +08:00
Li Shuai a054f89021 fix: modify some typos to ensure CI pipeline run pass 2024-03-30 11:51:52 +08:00
Li Shuai a0a343cb13 change(wifi): use new retention api to implement wifi mac and bb retention 2024-03-30 11:51:50 +08:00
David Cermak 344cb342b8 fix(esp_wifi): Support for esp_wifi_remote 2024-02-01 12:17:43 +01:00