Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
wifi.h File Reference

IEEE 802.11 protocol and general Wi-Fi definitions. More...

#include <zephyr/sys/util.h>

Go to the source code of this file.

Macros

#define WIFI_COUNTRY_CODE_LEN   2
 Length of the country code string.
 
#define WIFI_SSID_MAX_LEN   32
 Max SSID length.
 
#define WIFI_PSK_MIN_LEN   8
 Minimum PSK length.
 
#define WIFI_PSK_MAX_LEN   64
 Maximum PSK length.
 
#define WIFI_SAE_PSWD_MAX_LEN   128
 Max SAW password length.
 
#define WIFI_MAC_ADDR_LEN   6
 MAC address length.
 
#define WIFI_ENT_IDENTITY_MAX_LEN   64
 Max enterprise identity length.
 
#define WIFI_ENT_PSWD_MAX_LEN   128
 Max enterprise password length.
 
#define WIFI_CHANNEL_MIN   1
 Minimum channel number.
 
#define WIFI_CHANNEL_MAX   233
 Maximum channel number.
 
#define WIFI_CHANNEL_ANY   255
 Any channel number.
 
#define WIFI_INTERFACE_INDEX_MIN   1
 Network interface index min value.
 
#define WIFI_INTERFACE_INDEX_MAX   255
 Network interface index max value.
 

Enumerations

enum  wifi_security_type {
  WIFI_SECURITY_TYPE_NONE = 0 , WIFI_SECURITY_TYPE_PSK , WIFI_SECURITY_TYPE_PSK_SHA256 , WIFI_SECURITY_TYPE_SAE ,
  WIFI_SECURITY_TYPE_SAE_HNP = WIFI_SECURITY_TYPE_SAE , WIFI_SECURITY_TYPE_SAE_H2E , WIFI_SECURITY_TYPE_SAE_AUTO , WIFI_SECURITY_TYPE_WAPI ,
  WIFI_SECURITY_TYPE_EAP , WIFI_SECURITY_TYPE_EAP_TLS = WIFI_SECURITY_TYPE_EAP , WIFI_SECURITY_TYPE_WEP , WIFI_SECURITY_TYPE_WPA_PSK ,
  WIFI_SECURITY_TYPE_WPA_AUTO_PERSONAL , WIFI_SECURITY_TYPE_DPP
}
 IEEE 802.11 security types. More...
 
enum  wifi_mfp_options { WIFI_MFP_DISABLE = 0 , WIFI_MFP_OPTIONAL , WIFI_MFP_REQUIRED }
 IEEE 802.11w - Management frame protection. More...
 
enum  wifi_frequency_bands {
  WIFI_FREQ_BAND_2_4_GHZ = 0 , WIFI_FREQ_BAND_5_GHZ , WIFI_FREQ_BAND_6_GHZ , __WIFI_FREQ_BAND_AFTER_LAST ,
  WIFI_FREQ_BAND_MAX = __WIFI_FREQ_BAND_AFTER_LAST - 1 , WIFI_FREQ_BAND_UNKNOWN
}
 IEEE 802.11 operational frequency bands (not exhaustive). More...
 
enum  wifi_iface_state {
  WIFI_STATE_DISCONNECTED = 0 , WIFI_STATE_INTERFACE_DISABLED , WIFI_STATE_INACTIVE , WIFI_STATE_SCANNING ,
  WIFI_STATE_AUTHENTICATING , WIFI_STATE_ASSOCIATING , WIFI_STATE_ASSOCIATED , WIFI_STATE_4WAY_HANDSHAKE ,
  WIFI_STATE_GROUP_HANDSHAKE , WIFI_STATE_COMPLETED
}
 Wi-Fi interface states. More...
 
enum  wifi_iface_mode {
  WIFI_MODE_INFRA = 0 , WIFI_MODE_IBSS = 1 , WIFI_MODE_AP = 2 , WIFI_MODE_P2P_GO = 3 ,
  WIFI_MODE_P2P_GROUP_FORMATION = 4 , WIFI_MODE_MESH = 5
}
 Wi-Fi interface modes. More...
 
enum  wifi_link_mode {
  WIFI_0 = 0 , WIFI_1 , WIFI_2 , WIFI_3 ,
  WIFI_4 , WIFI_5 , WIFI_6 , WIFI_6E ,
  WIFI_7
}
 Wi-Fi link operating modes. More...
 
enum  wifi_scan_type { WIFI_SCAN_TYPE_ACTIVE = 0 , WIFI_SCAN_TYPE_PASSIVE }
 Wi-Fi scanning types. More...
 
enum  wifi_ps { WIFI_PS_DISABLED = 0 , WIFI_PS_ENABLED }
 Wi-Fi power save states. More...
 
enum  wifi_ps_mode { WIFI_PS_MODE_LEGACY = 0 , WIFI_PS_MODE_WMM }
 Wi-Fi power save modes. More...
 
enum  wifi_operational_modes {
  WIFI_STA_MODE = BIT(0) , WIFI_MONITOR_MODE = BIT(1) , WIFI_TX_INJECTION_MODE = BIT(2) , WIFI_PROMISCUOUS_MODE = BIT(3) ,
  WIFI_AP_MODE = BIT(4) , WIFI_SOFTAP_MODE = BIT(5)
}
 Wifi operational mode. More...
 
enum  wifi_filter { WIFI_PACKET_FILTER_ALL = BIT(0) , WIFI_PACKET_FILTER_MGMT = BIT(1) , WIFI_PACKET_FILTER_DATA = BIT(2) , WIFI_PACKET_FILTER_CTRL = BIT(3) }
 Mode filter settings. More...
 
enum  wifi_twt_operation { WIFI_TWT_SETUP = 0 , WIFI_TWT_TEARDOWN }
 Wi-Fi Target Wake Time (TWT) operations. More...
 
enum  wifi_twt_negotiation_type { WIFI_TWT_INDIVIDUAL = 0 , WIFI_TWT_BROADCAST , WIFI_TWT_WAKE_TBTT }
 Wi-Fi Target Wake Time (TWT) negotiation types. More...
 
enum  wifi_twt_setup_cmd {
  WIFI_TWT_SETUP_CMD_REQUEST = 0 , WIFI_TWT_SETUP_CMD_SUGGEST , WIFI_TWT_SETUP_CMD_DEMAND , WIFI_TWT_SETUP_CMD_GROUPING ,
  WIFI_TWT_SETUP_CMD_ACCEPT , WIFI_TWT_SETUP_CMD_ALTERNATE , WIFI_TWT_SETUP_CMD_DICTATE , WIFI_TWT_SETUP_CMD_REJECT
}
 Wi-Fi Target Wake Time (TWT) setup commands. More...
 
enum  wifi_twt_setup_resp_status { WIFI_TWT_RESP_RECEIVED = 0 , WIFI_TWT_RESP_NOT_RECEIVED }
 Wi-Fi Target Wake Time (TWT) negotiation status. More...
 
enum  wifi_twt_fail_reason {
  WIFI_TWT_FAIL_UNSPECIFIED , WIFI_TWT_FAIL_CMD_EXEC_FAIL , WIFI_TWT_FAIL_OPERATION_NOT_SUPPORTED , WIFI_TWT_FAIL_UNABLE_TO_GET_IFACE_STATUS ,
  WIFI_TWT_FAIL_DEVICE_NOT_CONNECTED , WIFI_TWT_FAIL_PEER_NOT_HE_CAPAB , WIFI_TWT_FAIL_PEER_NOT_TWT_CAPAB , WIFI_TWT_FAIL_OPERATION_IN_PROGRESS ,
  WIFI_TWT_FAIL_INVALID_FLOW_ID , WIFI_TWT_FAIL_IP_NOT_ASSIGNED , WIFI_TWT_FAIL_FLOW_ALREADY_EXISTS
}
 Target Wake Time (TWT) error codes. More...
 
enum  wifi_twt_teardown_status { WIFI_TWT_TEARDOWN_SUCCESS = 0 , WIFI_TWT_TEARDOWN_FAILED }
 Wi-Fi Target Wake Time (TWT) teradown status. More...
 
enum  wifi_ps_param_type {
  WIFI_PS_PARAM_STATE , WIFI_PS_PARAM_LISTEN_INTERVAL , WIFI_PS_PARAM_WAKEUP_MODE , WIFI_PS_PARAM_MODE ,
  WIFI_PS_PARAM_TIMEOUT
}
 Wi-Fi power save parameters. More...
 
enum  wifi_ps_wakeup_mode { WIFI_PS_WAKEUP_MODE_DTIM = 0 , WIFI_PS_WAKEUP_MODE_LISTEN_INTERVAL }
 Wi-Fi power save modes. More...
 
enum  wifi_config_ps_param_fail_reason {
  WIFI_PS_PARAM_FAIL_UNSPECIFIED , WIFI_PS_PARAM_FAIL_CMD_EXEC_FAIL , WIFI_PS_PARAM_FAIL_OPERATION_NOT_SUPPORTED , WIFI_PS_PARAM_FAIL_UNABLE_TO_GET_IFACE_STATUS ,
  WIFI_PS_PARAM_FAIL_DEVICE_NOT_CONNECTED , WIFI_PS_PARAM_FAIL_DEVICE_CONNECTED , WIFI_PS_PARAM_LISTEN_INTERVAL_RANGE_INVALID
}
 Wi-Fi power save error codes. More...
 
enum  wifi_ap_config_param { WIFI_AP_CONFIG_PARAM_MAX_INACTIVITY = BIT(0) , WIFI_AP_CONFIG_PARAM_MAX_NUM_STA = BIT(1) }
 Wi-Fi AP mode configuration parameter. More...
 

Functions

const char * wifi_security_txt (enum wifi_security_type security)
 Helper function to get user-friendly security type name.
 
const char * wifi_mfp_txt (enum wifi_mfp_options mfp)
 Helper function to get user-friendly MFP name.
 
const char * wifi_band_txt (enum wifi_frequency_bands band)
 Helper function to get user-friendly frequency band name.
 
const char * wifi_state_txt (enum wifi_iface_state state)
 Helper function to get user-friendly interface state name.
 
const char * wifi_mode_txt (enum wifi_iface_mode mode)
 Helper function to get user-friendly interface mode name.
 
const char * wifi_link_mode_txt (enum wifi_link_mode link_mode)
 Helper function to get user-friendly link mode name.
 
const char * wifi_ps_txt (enum wifi_ps ps_name)
 Helper function to get user-friendly ps name.
 
const char * wifi_ps_mode_txt (enum wifi_ps_mode ps_mode)
 Helper function to get user-friendly ps mode name.
 
const char * wifi_twt_operation_txt (enum wifi_twt_operation twt_operation)
 Helper function to get user-friendly twt operation name.
 
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_twt_setup_cmd_txt (enum wifi_twt_setup_cmd twt_setup)
 Helper function to get user-friendly twt setup cmd name.
 
static const char * wifi_twt_get_err_code_str (int16_t err_no)
 Helper function to get user-friendly TWT error code 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.
 
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.
 

Detailed Description

IEEE 802.11 protocol and general Wi-Fi definitions.