22#ifndef ZEPHYR_INCLUDE_NET_WIFI_H_
23#define ZEPHYR_INCLUDE_NET_WIFI_H_
28#define WIFI_COUNTRY_CODE_LEN 2
32#define WIFI_LISTEN_INTERVAL_MIN 0
33#define WIFI_LISTEN_INTERVAL_MAX 65535
83 __WIFI_SECURITY_TYPE_AFTER_LAST,
84 WIFI_SECURITY_TYPE_MAX = __WIFI_SECURITY_TYPE_AFTER_LAST - 1,
85 WIFI_SECURITY_TYPE_UNKNOWN
187 __WIFI_MFP_AFTER_LAST,
188 WIFI_MFP_MAX = __WIFI_MFP_AFTER_LAST - 1,
208 __WIFI_FREQ_BAND_AFTER_LAST,
219#define WIFI_SSID_MAX_LEN 32
221#define WIFI_PSK_MIN_LEN 8
223#define WIFI_PSK_MAX_LEN 64
225#define WIFI_SAE_PSWD_MAX_LEN 128
227#define WIFI_MAC_ADDR_LEN 6
229#define WIFI_ENT_IDENTITY_MAX_LEN 64
231#define WIFI_ENT_PSWD_MAX_LEN 128
234#define WIFI_CHANNEL_MIN 1
236#define WIFI_CHANNEL_MAX 233
238#define WIFI_CHANNEL_ANY 255
267 __WIFI_STATE_AFTER_LAST,
268 WIFI_STATE_MAX = __WIFI_STATE_AFTER_LAST - 1,
307 __WIFI_MODE_AFTER_LAST,
308 WIFI_MODE_MAX = __WIFI_MODE_AFTER_LAST - 1,
341 __WIFI_LINK_MODE_AFTER_LAST,
342 WIFI_LINK_MODE_MAX = __WIFI_LINK_MODE_AFTER_LAST - 1,
343 WIFI_LINK_MODE_UNKNOWN
384#define WIFI_INTERFACE_INDEX_MIN 1
386#define WIFI_INTERFACE_INDEX_MAX 255
506static const char *
const wifi_twt_err_code_tbl[] = {
510 "Operation not supported",
512 "Unable to get iface status",
514 "Device not connected",
518 "Operation already in progress",
520 "Invalid negotiated flow id",
522 "IP address not assigned",
524 "Flow already exists",
532 return wifi_twt_err_code_tbl[err_no];
576 WIFI_PS_EXIT_MAX = WIFI_PS_EXIT_LAST - 1,
604static const char *
const wifi_ps_param_config_err_code_tbl[] = {
608 "Operation not supported",
610 "Unable to get iface status",
612 "Cannot set parameters while device not connected",
614 "Cannot set parameters while device connected",
616 "Parameter out of range",
620#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM
624enum wifi_btm_query_reason {
626 WIFI_BTM_QUERY_REASON_UNSPECIFIED = 0,
628 WIFI_BTM_QUERY_REASON_LOW_RSSI = 16,
630 WIFI_BTM_QUERY_REASON_LEAVING_ESS = 20,
638 return wifi_ps_param_config_err_code_tbl[err_no];
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
#define ARRAY_SIZE(array)
Number of elements in the given array.
Definition util.h:127
const char * wifi_state_txt(enum wifi_iface_state state)
Helper function to get user-friendly interface state name.
const char * wifi_link_mode_txt(enum wifi_link_mode link_mode)
Helper function to get user-friendly link mode name.
wifi_ps
Wi-Fi power save states.
Definition wifi.h:359
wifi_suiteb_type
Enterprise security WPA3 suiteb types.
Definition wifi.h:106
wifi_frequency_bands
IEEE 802.11 operational frequency bands (not exhaustive).
Definition wifi.h:199
wifi_mfp_options
IEEE 802.11w - Management frame protection.
Definition wifi.h:178
const char * wifi_mfp_txt(enum wifi_mfp_options mfp)
Helper function to get user-friendly MFP name.
wifi_ps_exit_strategy
Wi-Fi power save exit strategy.
Definition wifi.h:568
wifi_twt_setup_cmd
Wi-Fi Target Wake Time (TWT) setup commands.
Definition wifi.h:441
const char * wifi_band_txt(enum wifi_frequency_bands band)
Helper function to get user-friendly frequency band name.
wifi_operational_modes
Wifi operational mode.
Definition wifi.h:389
wifi_twt_setup_resp_status
Wi-Fi Target Wake Time (TWT) negotiation status.
Definition wifi.h:464
wifi_iface_mode
Wi-Fi interface modes.
Definition wifi.h:292
wifi_twt_negotiation_type
Wi-Fi Target Wake Time (TWT) negotiation types.
Definition wifi.h:428
const char * wifi_twt_negotiation_type_txt(enum wifi_twt_negotiation_type twt_negotiation)
Helper function to get user-friendly twt negotiation type name.
const char * wifi_ps_wakeup_mode_txt(enum wifi_ps_wakeup_mode ps_wakeup_mode)
Helper function to get user-friendly ps wakeup mode name.
wifi_cipher_type
Group cipher and pairwise cipher types.
Definition wifi.h:114
wifi_ap_config_param
Wi-Fi AP mode configuration parameter.
Definition wifi.h:645
static const char * wifi_ps_get_config_err_code_str(int16_t err_no)
Helper function to get user-friendly power save error code name.
Definition wifi.h:635
wifi_eap_type
EPA method Types.
Definition wifi.h:90
wifi_twt_fail_reason
Target Wake Time (TWT) error codes.
Definition wifi.h:472
wifi_iface_state
Wi-Fi interface states.
Definition wifi.h:244
const char * wifi_security_txt(enum wifi_security_type security)
Helper function to get user-friendly security type name.
wifi_filter
Mode filter settings.
Definition wifi.h:405
static const char * wifi_twt_get_err_code_str(int16_t err_no)
Helper function to get user-friendly TWT error code name.
Definition wifi.h:529
wifi_link_mode
Wi-Fi link operating modes.
Definition wifi.h:320
wifi_ps_param_type
Wi-Fi power save parameters.
Definition wifi.h:539
wifi_ps_wakeup_mode
Wi-Fi power save modes.
Definition wifi.h:555
wifi_twt_operation
Wi-Fi Target Wake Time (TWT) operations.
Definition wifi.h:417
wifi_scan_type
Wi-Fi scanning types.
Definition wifi.h:351
wifi_twt_teardown_status
Wi-Fi Target Wake Time (TWT) teradown status.
Definition wifi.h:498
const char * wifi_mode_txt(enum wifi_iface_mode mode)
Helper function to get user-friendly interface mode name.
wifi_config_ps_param_fail_reason
Wi-Fi power save error codes.
Definition wifi.h:584
const char * wifi_twt_operation_txt(enum wifi_twt_operation twt_operation)
Helper function to get user-friendly twt operation name.
const char * wifi_ps_mode_txt(enum wifi_ps_mode ps_mode)
Helper function to get user-friendly ps mode name.
wifi_security_type
IEEE 802.11 security types.
Definition wifi.h:42
const char *const wifi_ps_exit_strategy_txt(enum wifi_ps_exit_strategy ps_exit_strategy)
Helper function to get user-friendly ps exit strategy name.
const char * wifi_twt_setup_cmd_txt(enum wifi_twt_setup_cmd twt_setup)
Helper function to get user-friendly twt setup cmd name.
wifi_group_mgmt_cipher_type
group mgmt cipher types.
Definition wifi.h:124
const char * wifi_ps_txt(enum wifi_ps ps_name)
Helper function to get user-friendly ps name.
wifi_ps_mode
Wi-Fi power save modes.
Definition wifi.h:370
@ WIFI_PS_ENABLED
Power save enabled.
Definition wifi.h:363
@ WIFI_PS_DISABLED
Power save disabled.
Definition wifi.h:361
@ WIFI_SUITEB_192
suiteb-192.
Definition wifi.h:110
@ WIFI_SUITEB
suiteb.
Definition wifi.h:108
@ WIFI_FREQ_BAND_6_GHZ
6 GHz band (Wi-Fi 6E, also extends to 7GHz).
Definition wifi.h:205
@ WIFI_FREQ_BAND_2_4_GHZ
2.4 GHz band.
Definition wifi.h:201
@ WIFI_FREQ_BAND_UNKNOWN
Invalid frequency band.
Definition wifi.h:212
@ WIFI_FREQ_BAND_5_GHZ
5 GHz band.
Definition wifi.h:203
@ WIFI_FREQ_BAND_MAX
Highest frequency band available.
Definition wifi.h:210
@ WIFI_MFP_DISABLE
MFP disabled.
Definition wifi.h:180
@ WIFI_MFP_OPTIONAL
MFP optional.
Definition wifi.h:182
@ WIFI_MFP_REQUIRED
MFP required.
Definition wifi.h:184
@ WIFI_PS_EXIT_EVERY_TIM
QoS NULL frame based.
Definition wifi.h:572
@ WIFI_PS_EXIT_CUSTOM_ALGO
PS-Poll frame based.
Definition wifi.h:570
@ WIFI_TWT_SETUP_CMD_DEMAND
TWT setup demand (parameters can not be changed by AP)
Definition wifi.h:447
@ WIFI_TWT_SETUP_CMD_REQUEST
TWT setup request.
Definition wifi.h:443
@ WIFI_TWT_SETUP_CMD_ALTERNATE
TWT setup alternate (alternate parameters suggested by AP)
Definition wifi.h:453
@ WIFI_TWT_SETUP_CMD_GROUPING
TWT setup grouping (grouping of TWT flows)
Definition wifi.h:449
@ WIFI_TWT_SETUP_CMD_DICTATE
TWT setup dictate (parameters dictated by AP)
Definition wifi.h:455
@ WIFI_TWT_SETUP_CMD_SUGGEST
TWT setup suggest (parameters can be changed by AP)
Definition wifi.h:445
@ WIFI_TWT_SETUP_CMD_REJECT
TWT setup reject (parameters rejected by AP)
Definition wifi.h:457
@ WIFI_TWT_SETUP_CMD_ACCEPT
TWT setup accept (parameters accepted by AP)
Definition wifi.h:451
@ WIFI_TX_INJECTION_MODE
TX injection mode setting enable.
Definition wifi.h:395
@ WIFI_STA_MODE
STA mode setting enable.
Definition wifi.h:391
@ WIFI_AP_MODE
AP mode setting enable.
Definition wifi.h:399
@ WIFI_SOFTAP_MODE
Softap mode setting enable.
Definition wifi.h:401
@ WIFI_MONITOR_MODE
Monitor mode setting enable.
Definition wifi.h:393
@ WIFI_PROMISCUOUS_MODE
Promiscuous mode setting enable.
Definition wifi.h:397
@ WIFI_TWT_RESP_RECEIVED
TWT response received for TWT request.
Definition wifi.h:466
@ WIFI_TWT_RESP_NOT_RECEIVED
TWT response not received for TWT request.
Definition wifi.h:468
@ WIFI_MODE_AP
AP mode.
Definition wifi.h:298
@ WIFI_MODE_IBSS
IBSS (ad-hoc) station mode.
Definition wifi.h:296
@ WIFI_MODE_P2P_GO
P2P group owner mode.
Definition wifi.h:300
@ WIFI_MODE_P2P_GROUP_FORMATION
P2P group formation mode.
Definition wifi.h:302
@ WIFI_MODE_INFRA
Infrastructure station mode.
Definition wifi.h:294
@ WIFI_MODE_MESH
802.11s Mesh mode.
Definition wifi.h:304
@ WIFI_TWT_BROADCAST
TWT broadcast negotiation.
Definition wifi.h:432
@ WIFI_TWT_WAKE_TBTT
TWT wake TBTT negotiation.
Definition wifi.h:434
@ WIFI_TWT_INDIVIDUAL
TWT individual negotiation.
Definition wifi.h:430
@ WPA_CAPA_ENC_GCMP_256
256-bit Galois/Counter Mode Protocol.
Definition wifi.h:120
@ WPA_CAPA_ENC_GCMP
128-bit Galois/Counter Mode Protocol.
Definition wifi.h:118
@ WPA_CAPA_ENC_CCMP
AES in counter mode with CBC-MAC (CCMP-128).
Definition wifi.h:116
@ WIFI_AP_CONFIG_PARAM_MAX_INACTIVITY
Used for AP mode configuration parameter ap_max_inactivity.
Definition wifi.h:647
@ WIFI_AP_CONFIG_PARAM_MAX_NUM_STA
Used for AP mode configuration parameter max_num_sta.
Definition wifi.h:649
@ WIFI_EAP_TYPE_TTLS
EPA TTLS security, refer to rfc5281.
Definition wifi.h:98
@ WIFI_EAP_TYPE_MSCHAPV2
EPA MSCHAPV2 security, refer to draft-kamath-pppext-eap-mschapv2-00.txt.
Definition wifi.h:102
@ WIFI_EAP_TYPE_NONE
No EPA security.
Definition wifi.h:92
@ WIFI_EAP_TYPE_TLS
EPA TLS security, refer to rfc5216.
Definition wifi.h:96
@ WIFI_EAP_TYPE_GTC
EPA GTC security, refer to rfc3748 chapter 5.
Definition wifi.h:94
@ WIFI_EAP_TYPE_PEAP
EPA PEAP security, refer to draft-josefsson-pppext-eap-tls-eap-06.txt.
Definition wifi.h:100
@ WIFI_TWT_FAIL_IP_NOT_ASSIGNED
IP address not assigned or configured.
Definition wifi.h:492
@ WIFI_TWT_FAIL_INVALID_FLOW_ID
Invalid negotiated flow id.
Definition wifi.h:490
@ WIFI_TWT_FAIL_CMD_EXEC_FAIL
Command execution failed.
Definition wifi.h:476
@ WIFI_TWT_FAIL_OPERATION_NOT_SUPPORTED
Operation not supported.
Definition wifi.h:478
@ WIFI_TWT_FAIL_UNABLE_TO_GET_IFACE_STATUS
Unable to get interface status.
Definition wifi.h:480
@ WIFI_TWT_FAIL_PEER_NOT_HE_CAPAB
Peer not HE (802.11ax/Wi-Fi 6) capable.
Definition wifi.h:484
@ WIFI_TWT_FAIL_DEVICE_NOT_CONNECTED
Device not connected to AP.
Definition wifi.h:482
@ WIFI_TWT_FAIL_OPERATION_IN_PROGRESS
A TWT flow is already in progress.
Definition wifi.h:488
@ WIFI_TWT_FAIL_PEER_NOT_TWT_CAPAB
Peer not TWT capable.
Definition wifi.h:486
@ WIFI_TWT_FAIL_UNSPECIFIED
Unspecified error.
Definition wifi.h:474
@ WIFI_TWT_FAIL_FLOW_ALREADY_EXISTS
Flow already exists.
Definition wifi.h:494
@ WIFI_STATE_DISCONNECTED
Interface is disconnected.
Definition wifi.h:246
@ WIFI_STATE_GROUP_HANDSHAKE
Group Key exchange with a network is in progress.
Definition wifi.h:262
@ WIFI_STATE_INTERFACE_DISABLED
Interface is disabled (administratively).
Definition wifi.h:248
@ WIFI_STATE_4WAY_HANDSHAKE
4-way handshake with a network is in progress.
Definition wifi.h:260
@ WIFI_STATE_ASSOCIATED
Association with a network completed.
Definition wifi.h:258
@ WIFI_STATE_SCANNING
Interface is scanning for networks.
Definition wifi.h:252
@ WIFI_STATE_AUTHENTICATING
Authentication with a network is in progress.
Definition wifi.h:254
@ WIFI_STATE_COMPLETED
All authentication completed, ready to pass data.
Definition wifi.h:264
@ WIFI_STATE_ASSOCIATING
Association with a network is in progress.
Definition wifi.h:256
@ WIFI_STATE_INACTIVE
No enabled networks in the configuration.
Definition wifi.h:250
@ WIFI_PACKET_FILTER_MGMT
Support only sniffing of management packets.
Definition wifi.h:409
@ WIFI_PACKET_FILTER_ALL
Support management, data and control packet sniffing.
Definition wifi.h:407
@ WIFI_PACKET_FILTER_DATA
Support only sniffing of data packets.
Definition wifi.h:411
@ WIFI_PACKET_FILTER_CTRL
Support only sniffing of control packets.
Definition wifi.h:413
@ WIFI_6E
802.11ax 6GHz.
Definition wifi.h:336
@ WIFI_5
802.11ac.
Definition wifi.h:332
@ WIFI_0
802.11 (legacy).
Definition wifi.h:322
@ WIFI_7
802.11be.
Definition wifi.h:338
@ WIFI_4
802.11n.
Definition wifi.h:330
@ WIFI_2
802.11a.
Definition wifi.h:326
@ WIFI_6
802.11ax.
Definition wifi.h:334
@ WIFI_1
802.11b.
Definition wifi.h:324
@ WIFI_3
802.11g.
Definition wifi.h:328
@ WIFI_PS_PARAM_LISTEN_INTERVAL
Power save listen interval.
Definition wifi.h:543
@ WIFI_PS_PARAM_STATE
Power save state.
Definition wifi.h:541
@ WIFI_PS_PARAM_EXIT_STRATEGY
Power save exit strategy.
Definition wifi.h:549
@ WIFI_PS_PARAM_WAKEUP_MODE
Power save wakeup mode.
Definition wifi.h:545
@ WIFI_PS_PARAM_MODE
Power save mode.
Definition wifi.h:547
@ WIFI_PS_PARAM_TIMEOUT
Power save timeout.
Definition wifi.h:551
@ WIFI_PS_WAKEUP_MODE_LISTEN_INTERVAL
Listen interval based wakeup.
Definition wifi.h:559
@ WIFI_PS_WAKEUP_MODE_DTIM
DTIM based wakeup.
Definition wifi.h:557
@ WIFI_TWT_SETUP
TWT setup operation.
Definition wifi.h:419
@ WIFI_TWT_TEARDOWN
TWT teardown operation.
Definition wifi.h:421
@ WIFI_SCAN_TYPE_ACTIVE
Active scanning (default).
Definition wifi.h:353
@ WIFI_SCAN_TYPE_PASSIVE
Passive scanning.
Definition wifi.h:355
@ WIFI_TWT_TEARDOWN_SUCCESS
TWT teardown success.
Definition wifi.h:500
@ WIFI_TWT_TEARDOWN_FAILED
TWT teardown failure.
Definition wifi.h:502
@ WIFI_PS_PARAM_FAIL_UNABLE_TO_GET_IFACE_STATUS
Unable to get interface status.
Definition wifi.h:592
@ WIFI_PS_PARAM_FAIL_UNSPECIFIED
Unspecified error.
Definition wifi.h:586
@ WIFI_PS_PARAM_FAIL_CMD_EXEC_FAIL
Command execution failed.
Definition wifi.h:588
@ WIFI_PS_PARAM_FAIL_DEVICE_NOT_CONNECTED
Device not connected to AP.
Definition wifi.h:594
@ WIFI_PS_PARAM_LISTEN_INTERVAL_RANGE_INVALID
Listen interval out of range.
Definition wifi.h:598
@ WIFI_PS_PARAM_FAIL_INVALID_EXIT_STRATEGY
Invalid exit strategy.
Definition wifi.h:600
@ WIFI_PS_PARAM_FAIL_OPERATION_NOT_SUPPORTED
Parameter not supported.
Definition wifi.h:590
@ WIFI_PS_PARAM_FAIL_DEVICE_CONNECTED
Device already connected to AP.
Definition wifi.h:596
@ WIFI_SECURITY_TYPE_SAE
WPA3-SAE security.
Definition wifi.h:50
@ WIFI_SECURITY_TYPE_PSK_SHA256
WPA2-PSK-SHA256 security.
Definition wifi.h:48
@ WIFI_SECURITY_TYPE_EAP_PEAP_GTC
EAP PEAP GTC security - Enterprise.
Definition wifi.h:74
@ WIFI_SECURITY_TYPE_PSK
WPA2-PSK security.
Definition wifi.h:46
@ WIFI_SECURITY_TYPE_SAE_H2E
WPA3-SAE security with hash-to-element.
Definition wifi.h:54
@ WIFI_SECURITY_TYPE_WPA_AUTO_PERSONAL
WPA/WPA2/WPA3 PSK security.
Definition wifi.h:68
@ WIFI_SECURITY_TYPE_WAPI
GB 15629.11-2003 WAPI security.
Definition wifi.h:58
@ WIFI_SECURITY_TYPE_WEP
WEP security.
Definition wifi.h:64
@ WIFI_SECURITY_TYPE_EAP_TTLS_MSCHAPV2
EAP TTLS MSCHAPV2 security - Enterprise.
Definition wifi.h:76
@ WIFI_SECURITY_TYPE_NONE
No security.
Definition wifi.h:44
@ WIFI_SECURITY_TYPE_SAE_AUTO
WPA3-SAE security with both hunting-and-pecking loop and hash-to-element enabled.
Definition wifi.h:56
@ WIFI_SECURITY_TYPE_WPA_PSK
WPA-PSK security.
Definition wifi.h:66
@ WIFI_SECURITY_TYPE_EAP_TLS_SHA256
EAP TLS SHA256 security - Enterprise.
Definition wifi.h:80
@ WIFI_SECURITY_TYPE_DPP
DPP security.
Definition wifi.h:70
@ WIFI_SECURITY_TYPE_EAP_PEAP_TLS
EAP PEAP security - Enterprise.
Definition wifi.h:78
@ WIFI_SECURITY_TYPE_EAP_TLS
EAP TLS security - Enterprise.
Definition wifi.h:62
@ WIFI_SECURITY_TYPE_EAP_PEAP_MSCHAPV2
EAP PEAP MSCHAPV2 security - Enterprise.
Definition wifi.h:72
@ WIFI_SECURITY_TYPE_SAE_HNP
WPA3-SAE security with hunting-and-pecking loop.
Definition wifi.h:52
@ WIFI_SECURITY_TYPE_EAP
EAP security - Enterprise.
Definition wifi.h:60
@ WPA_CAPA_ENC_BIP
128-bit Broadcast/Multicast Integrity Protocol Cipher-based Message Authentication Code .
Definition wifi.h:128
@ WPA_CAPA_ENC_BIP_GMAC_128
128-bit Broadcast/Multicast Integrity Protocol Galois Message Authentication Code .
Definition wifi.h:132
@ WPA_CAPA_ENC_BIP_GMAC_256
256-bit Broadcast/Multicast Integrity Protocol Galois Message Authentication Code .
Definition wifi.h:136
@ WIFI_PS_MODE_WMM
WMM power save mode.
Definition wifi.h:377
@ WIFI_PS_MODE_LEGACY
Legacy power save mode.
Definition wifi.h:372
state
Definition parser_state.h:29
__INT16_TYPE__ int16_t
Definition stdint.h:73
unsigned int capa
Cipher capability.
Definition wifi.h:141
char * name
Cipher name string.
Definition wifi.h:143
char * openssl_ciphers
OpenSSL cipher string.
Definition wifi.h:150
char * key_mgmt
Key management type string.
Definition wifi.h:148
char * pairwise_cipher
Pairwise_cipher cipher string.
Definition wifi.h:154
char * group_cipher
Group cipher cipher string.
Definition wifi.h:152
char * group_mgmt_cipher
Group management cipher string.
Definition wifi.h:156
char * tls_flags
Used to confiure TLS features.
Definition wifi.h:158
unsigned int type
Security type.
Definition wifi.h:163
char * method
EPA method string.
Definition wifi.h:169
enum wifi_eap_type eap_type_phase2
EPA method type of phase2.
Definition wifi.h:167
enum wifi_eap_type eap_type_phase1
EPA method type of phase1.
Definition wifi.h:165
char * phase2
Phase2 setting string.
Definition wifi.h:171