Skip to content

[noup] zephyr: add support for nan#119

Open
Qingling-Wu wants to merge 2 commits intozephyrproject-rtos:mainfrom
nxp-upstream:main_ql_paf
Open

[noup] zephyr: add support for nan#119
Qingling-Wu wants to merge 2 commits intozephyrproject-rtos:mainfrom
nxp-upstream:main_ql_paf

Conversation

@Qingling-Wu
Copy link
Contributor

@Qingling-Wu Qingling-Wu commented Jan 30, 2026

[noup] zephyr: add NAN SDF frame detection in zephyr driver

Implement NAN Service Discovery Frame detection in the Zephyr WiFi
driver to support WiFi Aware functionality.

- Add is_nan_sdf_frame() to identify NAN SDF frames
- Generate EVENT_TX_WAIT_EXPIRE for NAN SDF TX completion
- Enable proper NAN discovery flow in Zephyr environment

hostap: Initialize NAN USD in wpa_supplicant

Add NAN Unsynchronized Service Discovery (USD) initialization

- Call wpas_nan_usd_init() during interface initialization

@Qingling-Wu Qingling-Wu force-pushed the main_ql_paf branch 2 times, most recently from 01c61a8 to 566596c Compare January 30, 2026 09:28
u32 vendor_type = 0;

/* Minimum length: MAC header (24) + Category (1) + PA (1) + OUI+Type (4) */
if (len < 30)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you follow the coding style used in the other parts of this file.

if (len < 30) {
....
}

Implement NAN Service Discovery Frame detection in the Zephyr WiFi
driver to support WiFi Aware functionality.

- Add is_nan_sdf_frame() to identify NAN SDF frames
- Generate EVENT_TX_WAIT_EXPIRE for NAN SDF TX completion
- Enable proper NAN discovery flow in Zephyr environment

Signed-off-by: Qingling Wu <qingling.wu@nxp.com>
#include "wpas_kay.h"
#include "mesh.h"
#include "dpp_supplicant.h"
#include "nan_usd.h"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Qingling-Wu , if this change is from https://w1.fi/cgit/hostap/, then you can cherry-pick that commit with [fromtree] tag in the commit header.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review! I've updated the commit to use the [fromtree] tag and follow the standard format used in this repository.
I found that the full NAN USD implementation from upstream commit e3f9ab3 is already present in Zephyr's hostap, but the initialization and cleanup calls in wpa_supplicant.c were missing. This change adds those missing calls.

Initialize NAN Unsynchronized Service Discovery (USD) during
wpa_supplicant interface initialization and cleanup.

The full NAN USD implementation from upstream commit e3f9ab3
is already present in Zephyr's hostap repository, including:
- NAN USD core implementation (nan_usd.c, nan_usd.h)
- Control interface commands (NAN_PUBLISH, NAN_SUBSCRIBE, etc.)
- Event handling (wpas_nan_usd_rx_sdf, etc.)
- Driver integration (NAN SDF registration)

However, the initialization and cleanup calls in wpa_supplicant.c were
missing. This change adds the missing initialization code:
- Add #include "nan_usd.h"
- Call wpas_nan_usd_init() during interface initialization
- Call wpas_nan_usd_deinit() during cleanup

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
(cherry picked from commit e3f9ab3)

Signed-off-by: Qingling Wu <qingling.wu@nxp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants