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
91 __WIFI_SECURITY_TYPE_AFTER_LAST,
92 WIFI_SECURITY_TYPE_MAX = __WIFI_SECURITY_TYPE_AFTER_LAST - 1,
93 WIFI_SECURITY_TYPE_UNKNOWN
195 __WIFI_MFP_AFTER_LAST,
196 WIFI_MFP_MAX = __WIFI_MFP_AFTER_LAST - 1,
216 __WIFI_FREQ_BAND_AFTER_LAST,
227#define WIFI_SSID_MAX_LEN 32
229#define WIFI_PSK_MIN_LEN 8
231#define WIFI_PSK_MAX_LEN 64
233#define WIFI_SAE_PSWD_MAX_LEN 128
235#define WIFI_MAC_ADDR_LEN 6
237#define WIFI_ENT_IDENTITY_MAX_LEN 64
239#define WIFI_ENT_PSWD_MAX_LEN 128
242#define WIFI_CHANNEL_MIN 1
244#define WIFI_CHANNEL_MAX 233
246#define WIFI_CHANNEL_ANY 255
275 __WIFI_STATE_AFTER_LAST,
276 WIFI_STATE_MAX = __WIFI_STATE_AFTER_LAST - 1,
315 __WIFI_MODE_AFTER_LAST,
316 WIFI_MODE_MAX = __WIFI_MODE_AFTER_LAST - 1,
349 __WIFI_LINK_MODE_AFTER_LAST,
350 WIFI_LINK_MODE_MAX = __WIFI_LINK_MODE_AFTER_LAST - 1,
351 WIFI_LINK_MODE_UNKNOWN
392#define WIFI_INTERFACE_INDEX_MIN 1
394#define WIFI_INTERFACE_INDEX_MAX 255
514static const char *
const wifi_twt_err_code_tbl[] = {
518 "Operation not supported",
520 "Unable to get iface status",
522 "Device not connected",
526 "Operation already in progress",
528 "Invalid negotiated flow id",
530 "IP address not assigned",
532 "Flow already exists",
540 return wifi_twt_err_code_tbl[err_no];
584 WIFI_PS_EXIT_MAX = WIFI_PS_EXIT_LAST - 1,
612static const char *
const wifi_ps_param_config_err_code_tbl[] = {
616 "Operation not supported",
618 "Unable to get iface status",
620 "Cannot set parameters while device not connected",
622 "Cannot set parameters while device connected",
624 "Parameter out of range",
628#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM
632enum wifi_btm_query_reason {
634 WIFI_BTM_QUERY_REASON_UNSPECIFIED = 0,
636 WIFI_BTM_QUERY_REASON_LOW_RSSI = 16,
638 WIFI_BTM_QUERY_REASON_LEAVING_ESS = 20,
646 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:120
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:367
wifi_suiteb_type
Enterprise security WPA3 suiteb types.
Definition wifi.h:114
wifi_frequency_bands
IEEE 802.11 operational frequency bands (not exhaustive).
Definition wifi.h:207
wifi_mfp_options
IEEE 802.11w - Management frame protection.
Definition wifi.h:186
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:576
wifi_twt_setup_cmd
Wi-Fi Target Wake Time (TWT) setup commands.
Definition wifi.h:449
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:397
wifi_twt_setup_resp_status
Wi-Fi Target Wake Time (TWT) negotiation status.
Definition wifi.h:472
wifi_iface_mode
Wi-Fi interface modes.
Definition wifi.h:300
wifi_twt_negotiation_type
Wi-Fi Target Wake Time (TWT) negotiation types.
Definition wifi.h:436
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:122
wifi_ap_config_param
Wi-Fi AP mode configuration parameter.
Definition wifi.h:653
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:643
wifi_eap_type
EPA method Types.
Definition wifi.h:98
wifi_twt_fail_reason
Target Wake Time (TWT) error codes.
Definition wifi.h:480
wifi_iface_state
Wi-Fi interface states.
Definition wifi.h:252
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:413
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:537
wifi_link_mode
Wi-Fi link operating modes.
Definition wifi.h:328
wifi_ps_param_type
Wi-Fi power save parameters.
Definition wifi.h:547
wifi_ps_wakeup_mode
Wi-Fi power save modes.
Definition wifi.h:563
wifi_twt_operation
Wi-Fi Target Wake Time (TWT) operations.
Definition wifi.h:425
wifi_scan_type
Wi-Fi scanning types.
Definition wifi.h:359
wifi_twt_teardown_status
Wi-Fi Target Wake Time (TWT) teradown status.
Definition wifi.h:506
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:592
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:132
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:378
@ WIFI_PS_ENABLED
Power save enabled.
Definition wifi.h:371
@ WIFI_PS_DISABLED
Power save disabled.
Definition wifi.h:369
@ WIFI_SUITEB_192
suiteb-192.
Definition wifi.h:118
@ WIFI_SUITEB
suiteb.
Definition wifi.h:116
@ WIFI_FREQ_BAND_6_GHZ
6 GHz band (Wi-Fi 6E, also extends to 7GHz).
Definition wifi.h:213
@ WIFI_FREQ_BAND_2_4_GHZ
2.4 GHz band.
Definition wifi.h:209
@ WIFI_FREQ_BAND_UNKNOWN
Invalid frequency band.
Definition wifi.h:220
@ WIFI_FREQ_BAND_5_GHZ
5 GHz band.
Definition wifi.h:211
@ WIFI_FREQ_BAND_MAX
Highest frequency band available.
Definition wifi.h:218
@ WIFI_MFP_DISABLE
MFP disabled.
Definition wifi.h:188
@ WIFI_MFP_OPTIONAL
MFP optional.
Definition wifi.h:190
@ WIFI_MFP_REQUIRED
MFP required.
Definition wifi.h:192
@ WIFI_PS_EXIT_EVERY_TIM
QoS NULL frame based.
Definition wifi.h:580
@ WIFI_PS_EXIT_CUSTOM_ALGO
PS-Poll frame based.
Definition wifi.h:578
@ WIFI_TWT_SETUP_CMD_DEMAND
TWT setup demand (parameters can not be changed by AP)
Definition wifi.h:455
@ WIFI_TWT_SETUP_CMD_REQUEST
TWT setup request.
Definition wifi.h:451
@ WIFI_TWT_SETUP_CMD_ALTERNATE
TWT setup alternate (alternate parameters suggested by AP)
Definition wifi.h:461
@ WIFI_TWT_SETUP_CMD_GROUPING
TWT setup grouping (grouping of TWT flows)
Definition wifi.h:457
@ WIFI_TWT_SETUP_CMD_DICTATE
TWT setup dictate (parameters dictated by AP)
Definition wifi.h:463
@ WIFI_TWT_SETUP_CMD_SUGGEST
TWT setup suggest (parameters can be changed by AP)
Definition wifi.h:453
@ WIFI_TWT_SETUP_CMD_REJECT
TWT setup reject (parameters rejected by AP)
Definition wifi.h:465
@ WIFI_TWT_SETUP_CMD_ACCEPT
TWT setup accept (parameters accepted by AP)
Definition wifi.h:459
@ WIFI_TX_INJECTION_MODE
TX injection mode setting enable.
Definition wifi.h:403
@ WIFI_STA_MODE
STA mode setting enable.
Definition wifi.h:399
@ WIFI_AP_MODE
AP mode setting enable.
Definition wifi.h:407
@ WIFI_SOFTAP_MODE
Softap mode setting enable.
Definition wifi.h:409
@ WIFI_MONITOR_MODE
Monitor mode setting enable.
Definition wifi.h:401
@ WIFI_PROMISCUOUS_MODE
Promiscuous mode setting enable.
Definition wifi.h:405
@ WIFI_TWT_RESP_RECEIVED
TWT response received for TWT request.
Definition wifi.h:474
@ WIFI_TWT_RESP_NOT_RECEIVED
TWT response not received for TWT request.
Definition wifi.h:476
@ WIFI_MODE_AP
AP mode.
Definition wifi.h:306
@ WIFI_MODE_IBSS
IBSS (ad-hoc) station mode.
Definition wifi.h:304
@ WIFI_MODE_P2P_GO
P2P group owner mode.
Definition wifi.h:308
@ WIFI_MODE_P2P_GROUP_FORMATION
P2P group formation mode.
Definition wifi.h:310
@ WIFI_MODE_INFRA
Infrastructure station mode.
Definition wifi.h:302
@ WIFI_MODE_MESH
802.11s Mesh mode.
Definition wifi.h:312
@ WIFI_TWT_BROADCAST
TWT broadcast negotiation.
Definition wifi.h:440
@ WIFI_TWT_WAKE_TBTT
TWT wake TBTT negotiation.
Definition wifi.h:442
@ WIFI_TWT_INDIVIDUAL
TWT individual negotiation.
Definition wifi.h:438
@ WPA_CAPA_ENC_GCMP_256
256-bit Galois/Counter Mode Protocol.
Definition wifi.h:128
@ WPA_CAPA_ENC_GCMP
128-bit Galois/Counter Mode Protocol.
Definition wifi.h:126
@ WPA_CAPA_ENC_CCMP
AES in counter mode with CBC-MAC (CCMP-128).
Definition wifi.h:124
@ WIFI_AP_CONFIG_PARAM_MAX_INACTIVITY
Used for AP mode configuration parameter ap_max_inactivity.
Definition wifi.h:655
@ WIFI_AP_CONFIG_PARAM_MAX_NUM_STA
Used for AP mode configuration parameter max_num_sta.
Definition wifi.h:657
@ WIFI_EAP_TYPE_TTLS
EPA TTLS security, refer to rfc5281.
Definition wifi.h:106
@ WIFI_EAP_TYPE_MSCHAPV2
EPA MSCHAPV2 security, refer to draft-kamath-pppext-eap-mschapv2-00.txt.
Definition wifi.h:110
@ WIFI_EAP_TYPE_NONE
No EPA security.
Definition wifi.h:100
@ WIFI_EAP_TYPE_TLS
EPA TLS security, refer to rfc5216.
Definition wifi.h:104
@ WIFI_EAP_TYPE_GTC
EPA GTC security, refer to rfc3748 chapter 5.
Definition wifi.h:102
@ WIFI_EAP_TYPE_PEAP
EPA PEAP security, refer to draft-josefsson-pppext-eap-tls-eap-06.txt.
Definition wifi.h:108
@ WIFI_TWT_FAIL_IP_NOT_ASSIGNED
IP address not assigned or configured.
Definition wifi.h:500
@ WIFI_TWT_FAIL_INVALID_FLOW_ID
Invalid negotiated flow id.
Definition wifi.h:498
@ WIFI_TWT_FAIL_CMD_EXEC_FAIL
Command execution failed.
Definition wifi.h:484
@ WIFI_TWT_FAIL_OPERATION_NOT_SUPPORTED
Operation not supported.
Definition wifi.h:486
@ WIFI_TWT_FAIL_UNABLE_TO_GET_IFACE_STATUS
Unable to get interface status.
Definition wifi.h:488
@ WIFI_TWT_FAIL_PEER_NOT_HE_CAPAB
Peer not HE (802.11ax/Wi-Fi 6) capable.
Definition wifi.h:492
@ WIFI_TWT_FAIL_DEVICE_NOT_CONNECTED
Device not connected to AP.
Definition wifi.h:490
@ WIFI_TWT_FAIL_OPERATION_IN_PROGRESS
A TWT flow is already in progress.
Definition wifi.h:496
@ WIFI_TWT_FAIL_PEER_NOT_TWT_CAPAB
Peer not TWT capable.
Definition wifi.h:494
@ WIFI_TWT_FAIL_UNSPECIFIED
Unspecified error.
Definition wifi.h:482
@ WIFI_TWT_FAIL_FLOW_ALREADY_EXISTS
Flow already exists.
Definition wifi.h:502
@ WIFI_STATE_DISCONNECTED
Interface is disconnected.
Definition wifi.h:254
@ WIFI_STATE_GROUP_HANDSHAKE
Group Key exchange with a network is in progress.
Definition wifi.h:270
@ WIFI_STATE_INTERFACE_DISABLED
Interface is disabled (administratively).
Definition wifi.h:256
@ WIFI_STATE_4WAY_HANDSHAKE
4-way handshake with a network is in progress.
Definition wifi.h:268
@ WIFI_STATE_ASSOCIATED
Association with a network completed.
Definition wifi.h:266
@ WIFI_STATE_SCANNING
Interface is scanning for networks.
Definition wifi.h:260
@ WIFI_STATE_AUTHENTICATING
Authentication with a network is in progress.
Definition wifi.h:262
@ WIFI_STATE_COMPLETED
All authentication completed, ready to pass data.
Definition wifi.h:272
@ WIFI_STATE_ASSOCIATING
Association with a network is in progress.
Definition wifi.h:264
@ WIFI_STATE_INACTIVE
No enabled networks in the configuration.
Definition wifi.h:258
@ WIFI_PACKET_FILTER_MGMT
Support only sniffing of management packets.
Definition wifi.h:417
@ WIFI_PACKET_FILTER_ALL
Support management, data and control packet sniffing.
Definition wifi.h:415
@ WIFI_PACKET_FILTER_DATA
Support only sniffing of data packets.
Definition wifi.h:419
@ WIFI_PACKET_FILTER_CTRL
Support only sniffing of control packets.
Definition wifi.h:421
@ WIFI_6E
802.11ax 6GHz.
Definition wifi.h:344
@ WIFI_5
802.11ac.
Definition wifi.h:340
@ WIFI_0
802.11 (legacy).
Definition wifi.h:330
@ WIFI_7
802.11be.
Definition wifi.h:346
@ WIFI_4
802.11n.
Definition wifi.h:338
@ WIFI_2
802.11a.
Definition wifi.h:334
@ WIFI_6
802.11ax.
Definition wifi.h:342
@ WIFI_1
802.11b.
Definition wifi.h:332
@ WIFI_3
802.11g.
Definition wifi.h:336
@ WIFI_PS_PARAM_LISTEN_INTERVAL
Power save listen interval (units: (short) beacon intervals).
Definition wifi.h:551
@ WIFI_PS_PARAM_STATE
Power save state.
Definition wifi.h:549
@ WIFI_PS_PARAM_EXIT_STRATEGY
Power save exit strategy.
Definition wifi.h:557
@ WIFI_PS_PARAM_WAKEUP_MODE
Power save wakeup mode.
Definition wifi.h:553
@ WIFI_PS_PARAM_MODE
Power save mode.
Definition wifi.h:555
@ WIFI_PS_PARAM_TIMEOUT
Power save timeout.
Definition wifi.h:559
@ WIFI_PS_WAKEUP_MODE_LISTEN_INTERVAL
Listen interval based wakeup.
Definition wifi.h:567
@ WIFI_PS_WAKEUP_MODE_DTIM
DTIM based wakeup.
Definition wifi.h:565
@ WIFI_TWT_SETUP
TWT setup operation.
Definition wifi.h:427
@ WIFI_TWT_TEARDOWN
TWT teardown operation.
Definition wifi.h:429
@ WIFI_SCAN_TYPE_ACTIVE
Active scanning (default).
Definition wifi.h:361
@ WIFI_SCAN_TYPE_PASSIVE
Passive scanning.
Definition wifi.h:363
@ WIFI_TWT_TEARDOWN_SUCCESS
TWT teardown success.
Definition wifi.h:508
@ WIFI_TWT_TEARDOWN_FAILED
TWT teardown failure.
Definition wifi.h:510
@ WIFI_PS_PARAM_FAIL_UNABLE_TO_GET_IFACE_STATUS
Unable to get interface status.
Definition wifi.h:600
@ WIFI_PS_PARAM_FAIL_UNSPECIFIED
Unspecified error.
Definition wifi.h:594
@ WIFI_PS_PARAM_FAIL_CMD_EXEC_FAIL
Command execution failed.
Definition wifi.h:596
@ WIFI_PS_PARAM_FAIL_DEVICE_NOT_CONNECTED
Device not connected to AP.
Definition wifi.h:602
@ WIFI_PS_PARAM_LISTEN_INTERVAL_RANGE_INVALID
Listen interval out of range.
Definition wifi.h:606
@ WIFI_PS_PARAM_FAIL_INVALID_EXIT_STRATEGY
Invalid exit strategy.
Definition wifi.h:608
@ WIFI_PS_PARAM_FAIL_OPERATION_NOT_SUPPORTED
Parameter not supported.
Definition wifi.h:598
@ WIFI_PS_PARAM_FAIL_DEVICE_CONNECTED
Device already connected to AP.
Definition wifi.h:604
@ WIFI_SECURITY_TYPE_SAE
WPA3-SAE security.
Definition wifi.h:50
@ WIFI_SECURITY_TYPE_FT_EAP
FT-EAP security.
Definition wifi.h:86
@ 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_FT_PSK
FT-PSK security.
Definition wifi.h:82
@ 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_FT_EAP_SHA384
FT-EAP-SHA384 security.
Definition wifi.h:88
@ 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_FT_SAE
FT-SAE security.
Definition wifi.h:84
@ 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:136
@ WPA_CAPA_ENC_BIP_GMAC_128
128-bit Broadcast/Multicast Integrity Protocol Galois Message Authentication Code .
Definition wifi.h:140
@ WPA_CAPA_ENC_BIP_GMAC_256
256-bit Broadcast/Multicast Integrity Protocol Galois Message Authentication Code .
Definition wifi.h:144
@ WIFI_PS_MODE_WMM
WMM power save mode.
Definition wifi.h:385
@ WIFI_PS_MODE_LEGACY
Legacy power save mode.
Definition wifi.h:380
state
Definition parser_state.h:29
__INT16_TYPE__ int16_t
Definition stdint.h:73
unsigned int capa
Cipher capability.
Definition wifi.h:149
char * name
Cipher name string.
Definition wifi.h:151
char * openssl_ciphers
OpenSSL cipher string.
Definition wifi.h:158
char * key_mgmt
Key management type string.
Definition wifi.h:156
char * pairwise_cipher
Pairwise_cipher cipher string.
Definition wifi.h:162
char * group_cipher
Group cipher cipher string.
Definition wifi.h:160
char * group_mgmt_cipher
Group management cipher string.
Definition wifi.h:164
char * tls_flags
Used to confiure TLS features.
Definition wifi.h:166
unsigned int type
Security type.
Definition wifi.h:171
char * method
EPA method string.
Definition wifi.h:177
enum wifi_eap_type eap_type_phase2
EPA method type of phase2.
Definition wifi.h:175
enum wifi_eap_type eap_type_phase1
EPA method type of phase1.
Definition wifi.h:173
char * phase2
Phase2 setting string.
Definition wifi.h:179