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
71 __WIFI_SECURITY_TYPE_AFTER_LAST,
72 WIFI_SECURITY_TYPE_MAX = __WIFI_SECURITY_TYPE_AFTER_LAST - 1,
73 WIFI_SECURITY_TYPE_UNKNOWN
90 __WIFI_MFP_AFTER_LAST,
91 WIFI_MFP_MAX = __WIFI_MFP_AFTER_LAST - 1,
111 __WIFI_FREQ_BAND_AFTER_LAST,
122#define WIFI_SSID_MAX_LEN 32
124#define WIFI_PSK_MIN_LEN 8
126#define WIFI_PSK_MAX_LEN 64
128#define WIFI_SAE_PSWD_MAX_LEN 128
130#define WIFI_MAC_ADDR_LEN 6
132#define WIFI_ENT_IDENTITY_MAX_LEN 64
134#define WIFI_ENT_PSWD_MAX_LEN 128
137#define WIFI_CHANNEL_MIN 1
139#define WIFI_CHANNEL_MAX 233
141#define WIFI_CHANNEL_ANY 255
170 __WIFI_STATE_AFTER_LAST,
171 WIFI_STATE_MAX = __WIFI_STATE_AFTER_LAST - 1,
210 __WIFI_MODE_AFTER_LAST,
211 WIFI_MODE_MAX = __WIFI_MODE_AFTER_LAST - 1,
244 __WIFI_LINK_MODE_AFTER_LAST,
245 WIFI_LINK_MODE_MAX = __WIFI_LINK_MODE_AFTER_LAST - 1,
246 WIFI_LINK_MODE_UNKNOWN
287#define WIFI_INTERFACE_INDEX_MIN 1
289#define WIFI_INTERFACE_INDEX_MAX 255
409static const char *
const wifi_twt_err_code_tbl[] = {
413 "Operation not supported",
415 "Unable to get iface status",
417 "Device not connected",
421 "Operation already in progress",
423 "Invalid negotiated flow id",
425 "IP address not assigned",
427 "Flow already exists",
435 return wifi_twt_err_code_tbl[err_no];
485static const char *
const wifi_ps_param_config_err_code_tbl[] = {
489 "Operation not supported",
491 "Unable to get iface status",
493 "Cannot set parameters while device not connected",
495 "Cannot set parameters while device connected",
497 "Parameter out of range",
501#ifdef CONFIG_WIFI_NM_WPA_SUPPLICANT_WNM
505enum wifi_btm_query_reason {
507 WIFI_BTM_QUERY_REASON_UNSPECIFIED = 0,
509 WIFI_BTM_QUERY_REASON_LOW_RSSI = 16,
511 WIFI_BTM_QUERY_REASON_LEAVING_ESS = 20,
519 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:262
wifi_frequency_bands
IEEE 802.11 operational frequency bands (not exhaustive).
Definition wifi.h:102
wifi_mfp_options
IEEE 802.11w - Management frame protection.
Definition wifi.h:81
const char * wifi_mfp_txt(enum wifi_mfp_options mfp)
Helper function to get user-friendly MFP name.
wifi_twt_setup_cmd
Wi-Fi Target Wake Time (TWT) setup commands.
Definition wifi.h:344
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:292
wifi_twt_setup_resp_status
Wi-Fi Target Wake Time (TWT) negotiation status.
Definition wifi.h:367
wifi_iface_mode
Wi-Fi interface modes.
Definition wifi.h:195
wifi_twt_negotiation_type
Wi-Fi Target Wake Time (TWT) negotiation types.
Definition wifi.h:331
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_ap_config_param
Wi-Fi AP mode configuration parameter.
Definition wifi.h:526
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:516
wifi_twt_fail_reason
Target Wake Time (TWT) error codes.
Definition wifi.h:375
wifi_iface_state
Wi-Fi interface states.
Definition wifi.h:147
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:308
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:432
wifi_link_mode
Wi-Fi link operating modes.
Definition wifi.h:223
wifi_ps_param_type
Wi-Fi power save parameters.
Definition wifi.h:442
wifi_ps_wakeup_mode
Wi-Fi power save modes.
Definition wifi.h:456
wifi_twt_operation
Wi-Fi Target Wake Time (TWT) operations.
Definition wifi.h:320
wifi_scan_type
Wi-Fi scanning types.
Definition wifi.h:254
wifi_twt_teardown_status
Wi-Fi Target Wake Time (TWT) teradown status.
Definition wifi.h:401
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:467
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 * wifi_twt_setup_cmd_txt(enum wifi_twt_setup_cmd twt_setup)
Helper function to get user-friendly twt setup cmd name.
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:273
@ WIFI_PS_ENABLED
Power save enabled.
Definition wifi.h:266
@ WIFI_PS_DISABLED
Power save disabled.
Definition wifi.h:264
@ WIFI_FREQ_BAND_6_GHZ
6 GHz band (Wi-Fi 6E, also extends to 7GHz).
Definition wifi.h:108
@ WIFI_FREQ_BAND_2_4_GHZ
2.4 GHz band.
Definition wifi.h:104
@ WIFI_FREQ_BAND_UNKNOWN
Invalid frequency band.
Definition wifi.h:115
@ WIFI_FREQ_BAND_5_GHZ
5 GHz band.
Definition wifi.h:106
@ WIFI_FREQ_BAND_MAX
Highest frequency band available.
Definition wifi.h:113
@ WIFI_MFP_DISABLE
MFP disabled.
Definition wifi.h:83
@ WIFI_MFP_OPTIONAL
MFP optional.
Definition wifi.h:85
@ WIFI_MFP_REQUIRED
MFP required.
Definition wifi.h:87
@ WIFI_TWT_SETUP_CMD_DEMAND
TWT setup demand (parameters can not be changed by AP)
Definition wifi.h:350
@ WIFI_TWT_SETUP_CMD_REQUEST
TWT setup request.
Definition wifi.h:346
@ WIFI_TWT_SETUP_CMD_ALTERNATE
TWT setup alternate (alternate parameters suggested by AP)
Definition wifi.h:356
@ WIFI_TWT_SETUP_CMD_GROUPING
TWT setup grouping (grouping of TWT flows)
Definition wifi.h:352
@ WIFI_TWT_SETUP_CMD_DICTATE
TWT setup dictate (parameters dictated by AP)
Definition wifi.h:358
@ WIFI_TWT_SETUP_CMD_SUGGEST
TWT setup suggest (parameters can be changed by AP)
Definition wifi.h:348
@ WIFI_TWT_SETUP_CMD_REJECT
TWT setup reject (parameters rejected by AP)
Definition wifi.h:360
@ WIFI_TWT_SETUP_CMD_ACCEPT
TWT setup accept (parameters accepted by AP)
Definition wifi.h:354
@ WIFI_TX_INJECTION_MODE
TX injection mode setting enable.
Definition wifi.h:298
@ WIFI_STA_MODE
STA mode setting enable.
Definition wifi.h:294
@ WIFI_AP_MODE
AP mode setting enable.
Definition wifi.h:302
@ WIFI_SOFTAP_MODE
Softap mode setting enable.
Definition wifi.h:304
@ WIFI_MONITOR_MODE
Monitor mode setting enable.
Definition wifi.h:296
@ WIFI_PROMISCUOUS_MODE
Promiscuous mode setting enable.
Definition wifi.h:300
@ WIFI_TWT_RESP_RECEIVED
TWT response received for TWT request.
Definition wifi.h:369
@ WIFI_TWT_RESP_NOT_RECEIVED
TWT response not received for TWT request.
Definition wifi.h:371
@ WIFI_MODE_AP
AP mode.
Definition wifi.h:201
@ WIFI_MODE_IBSS
IBSS (ad-hoc) station mode.
Definition wifi.h:199
@ WIFI_MODE_P2P_GO
P2P group owner mode.
Definition wifi.h:203
@ WIFI_MODE_P2P_GROUP_FORMATION
P2P group formation mode.
Definition wifi.h:205
@ WIFI_MODE_INFRA
Infrastructure station mode.
Definition wifi.h:197
@ WIFI_MODE_MESH
802.11s Mesh mode.
Definition wifi.h:207
@ WIFI_TWT_BROADCAST
TWT broadcast negotiation.
Definition wifi.h:335
@ WIFI_TWT_WAKE_TBTT
TWT wake TBTT negotiation.
Definition wifi.h:337
@ WIFI_TWT_INDIVIDUAL
TWT individual negotiation.
Definition wifi.h:333
@ WIFI_AP_CONFIG_PARAM_MAX_INACTIVITY
Used for AP mode configuration parameter ap_max_inactivity.
Definition wifi.h:528
@ WIFI_AP_CONFIG_PARAM_MAX_NUM_STA
Used for AP mode configuration parameter max_num_sta.
Definition wifi.h:530
@ WIFI_TWT_FAIL_IP_NOT_ASSIGNED
IP address not assigned or configured.
Definition wifi.h:395
@ WIFI_TWT_FAIL_INVALID_FLOW_ID
Invalid negotiated flow id.
Definition wifi.h:393
@ WIFI_TWT_FAIL_CMD_EXEC_FAIL
Command execution failed.
Definition wifi.h:379
@ WIFI_TWT_FAIL_OPERATION_NOT_SUPPORTED
Operation not supported.
Definition wifi.h:381
@ WIFI_TWT_FAIL_UNABLE_TO_GET_IFACE_STATUS
Unable to get interface status.
Definition wifi.h:383
@ WIFI_TWT_FAIL_PEER_NOT_HE_CAPAB
Peer not HE (802.11ax/Wi-Fi 6) capable.
Definition wifi.h:387
@ WIFI_TWT_FAIL_DEVICE_NOT_CONNECTED
Device not connected to AP.
Definition wifi.h:385
@ WIFI_TWT_FAIL_OPERATION_IN_PROGRESS
A TWT flow is already in progress.
Definition wifi.h:391
@ WIFI_TWT_FAIL_PEER_NOT_TWT_CAPAB
Peer not TWT capable.
Definition wifi.h:389
@ WIFI_TWT_FAIL_UNSPECIFIED
Unspecified error.
Definition wifi.h:377
@ WIFI_TWT_FAIL_FLOW_ALREADY_EXISTS
Flow already exists.
Definition wifi.h:397
@ WIFI_STATE_DISCONNECTED
Interface is disconnected.
Definition wifi.h:149
@ WIFI_STATE_GROUP_HANDSHAKE
Group Key exchange with a network is in progress.
Definition wifi.h:165
@ WIFI_STATE_INTERFACE_DISABLED
Interface is disabled (administratively).
Definition wifi.h:151
@ WIFI_STATE_4WAY_HANDSHAKE
4-way handshake with a network is in progress.
Definition wifi.h:163
@ WIFI_STATE_ASSOCIATED
Association with a network completed.
Definition wifi.h:161
@ WIFI_STATE_SCANNING
Interface is scanning for networks.
Definition wifi.h:155
@ WIFI_STATE_AUTHENTICATING
Authentication with a network is in progress.
Definition wifi.h:157
@ WIFI_STATE_COMPLETED
All authentication completed, ready to pass data.
Definition wifi.h:167
@ WIFI_STATE_ASSOCIATING
Association with a network is in progress.
Definition wifi.h:159
@ WIFI_STATE_INACTIVE
No enabled networks in the configuration.
Definition wifi.h:153
@ WIFI_PACKET_FILTER_MGMT
Support only sniffing of management packets.
Definition wifi.h:312
@ WIFI_PACKET_FILTER_ALL
Support management, data and control packet sniffing.
Definition wifi.h:310
@ WIFI_PACKET_FILTER_DATA
Support only sniffing of data packets.
Definition wifi.h:314
@ WIFI_PACKET_FILTER_CTRL
Support only sniffing of control packets.
Definition wifi.h:316
@ WIFI_6E
802.11ax 6GHz.
Definition wifi.h:239
@ WIFI_5
802.11ac.
Definition wifi.h:235
@ WIFI_0
802.11 (legacy).
Definition wifi.h:225
@ WIFI_7
802.11be.
Definition wifi.h:241
@ WIFI_4
802.11n.
Definition wifi.h:233
@ WIFI_2
802.11a.
Definition wifi.h:229
@ WIFI_6
802.11ax.
Definition wifi.h:237
@ WIFI_1
802.11b.
Definition wifi.h:227
@ WIFI_3
802.11g.
Definition wifi.h:231
@ WIFI_PS_PARAM_LISTEN_INTERVAL
Power save listen interval.
Definition wifi.h:446
@ WIFI_PS_PARAM_STATE
Power save state.
Definition wifi.h:444
@ WIFI_PS_PARAM_WAKEUP_MODE
Power save wakeup mode.
Definition wifi.h:448
@ WIFI_PS_PARAM_MODE
Power save mode.
Definition wifi.h:450
@ WIFI_PS_PARAM_TIMEOUT
Power save timeout.
Definition wifi.h:452
@ WIFI_PS_WAKEUP_MODE_LISTEN_INTERVAL
Listen interval based wakeup.
Definition wifi.h:460
@ WIFI_PS_WAKEUP_MODE_DTIM
DTIM based wakeup.
Definition wifi.h:458
@ WIFI_TWT_SETUP
TWT setup operation.
Definition wifi.h:322
@ WIFI_TWT_TEARDOWN
TWT teardown operation.
Definition wifi.h:324
@ WIFI_SCAN_TYPE_ACTIVE
Active scanning (default).
Definition wifi.h:256
@ WIFI_SCAN_TYPE_PASSIVE
Passive scanning.
Definition wifi.h:258
@ WIFI_TWT_TEARDOWN_SUCCESS
TWT teardown success.
Definition wifi.h:403
@ WIFI_TWT_TEARDOWN_FAILED
TWT teardown failure.
Definition wifi.h:405
@ WIFI_PS_PARAM_FAIL_UNABLE_TO_GET_IFACE_STATUS
Unable to get interface status.
Definition wifi.h:475
@ WIFI_PS_PARAM_FAIL_UNSPECIFIED
Unspecified error.
Definition wifi.h:469
@ WIFI_PS_PARAM_FAIL_CMD_EXEC_FAIL
Command execution failed.
Definition wifi.h:471
@ WIFI_PS_PARAM_FAIL_DEVICE_NOT_CONNECTED
Device not connected to AP.
Definition wifi.h:477
@ WIFI_PS_PARAM_LISTEN_INTERVAL_RANGE_INVALID
Listen interval out of range.
Definition wifi.h:481
@ WIFI_PS_PARAM_FAIL_OPERATION_NOT_SUPPORTED
Parameter not supported.
Definition wifi.h:473
@ WIFI_PS_PARAM_FAIL_DEVICE_CONNECTED
Device already connected to AP.
Definition wifi.h:479
@ 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_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_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
EAP TLS security - Enterprise.
Definition wifi.h:62
@ 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
@ WIFI_PS_MODE_WMM
WMM power save mode.
Definition wifi.h:280
@ WIFI_PS_MODE_LEGACY
Legacy power save mode.
Definition wifi.h:275
state
Definition parser_state.h:29
__INT16_TYPE__ int16_t
Definition stdint.h:73