refactor(nan): use shared nan_key_type_t from esp_wifi_driver.h

The NAN key-type selectors are defined by the blob in esp_wifi_driver.h
(nan_key_type_t), which nan_i.h already includes. Add the group-integrity
key types NAN_KEY_ND_IGTK (3) and NAN_KEY_ND_BIGTK (4) there to match the
blob, and drop the duplicate host definitions from nan_i.h so a single
shared enum is used. Resolves the review request to declare these in
nan_key_type_t and avoids redefining the typedef.
This commit is contained in:
Sarvesh Bodakhe
2026-07-01 18:12:24 +05:30
parent 8b2b386825
commit ebb9539d17
2 changed files with 5 additions and 10 deletions
@@ -178,16 +178,9 @@ extern void *s_nan_data_lock;
#define NAN_KEY_FLAG_TX BIT(3)
#define NAN_KEY_FLAG_PAIRWISE BIT(5)
/* NAN key-type selector passed as the last arg of esp_wifi_set_nan_key_internal;
* tells the blob which NAN SA the key belongs to. Values match the blob's
* key-type enum. */
typedef enum {
NAN_KEY_ND_TK = 0,
NAN_KEY_ND_GTK = 1,
NAN_KEY_NM_TK = 2,
NAN_KEY_ND_IGTK = 3,
NAN_KEY_ND_BIGTK = 4,
} nan_key_type_t;
/* NAN key-type selector (nan_key_type_t: NAN_KEY_ND_TK / ND_GTK / NM_TK / ND_IGTK /
* ND_BIGTK), passed as the last arg of esp_wifi_set_nan_key_internal, is defined in
* esp_wifi_driver.h (included above) and shared with the blob. */
/* Handshake state */
enum nan_handshake_state {
@@ -238,6 +238,8 @@ typedef enum {
NAN_KEY_ND_TK = 0,
NAN_KEY_ND_GTK,
NAN_KEY_NM_TK,
NAN_KEY_ND_IGTK, /* 3 - NAN Integrity Group Temporal Key (BIP-CMAC-128) */
NAN_KEY_ND_BIGTK, /* 4 - NAN Beacon Integrity Group Temporal Key (BIP-CMAC-128) */
} nan_key_type_t;
typedef struct {