12#ifndef ZEPHYR_INCLUDE_NET_WIFI_MGMT_H_
13#define ZEPHYR_INCLUDE_NET_WIFI_MGMT_H_
26#define _NET_WIFI_LAYER NET_MGMT_LAYER_L2
27#define _NET_WIFI_CODE 0x156
28#define _NET_WIFI_BASE (NET_MGMT_IFACE_BIT | \
29 NET_MGMT_LAYER(_NET_WIFI_LAYER) | \
30 NET_MGMT_LAYER_CODE(_NET_WIFI_CODE))
31#define _NET_WIFI_EVENT (_NET_WIFI_BASE | NET_MGMT_EVENT_BIT)
49#define NET_REQUEST_WIFI_SCAN \
50 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_SCAN)
54#define NET_REQUEST_WIFI_CONNECT \
55 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_CONNECT)
59#define NET_REQUEST_WIFI_DISCONNECT \
60 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_DISCONNECT)
64#define NET_REQUEST_WIFI_AP_ENABLE \
65 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_ENABLE)
69#define NET_REQUEST_WIFI_AP_DISABLE \
70 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_DISABLE)
74#define NET_REQUEST_WIFI_IFACE_STATUS \
75 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_IFACE_STATUS)
79#define NET_REQUEST_WIFI_PS \
80 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS)
84#define NET_REQUEST_WIFI_PS_MODE \
85 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS_MODE)
89#define NET_REQUEST_WIFI_TWT \
90 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_TWT)
94#define NET_REQUEST_WIFI_PS_CONFIG \
95 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS_CONFIG)
98#define NET_REQUEST_WIFI_REG_DOMAIN \
99 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_REG_DOMAIN)
103#define NET_REQUEST_WIFI_PS_TIMEOUT \
104 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS_TIMEOUT)
120#define NET_EVENT_WIFI_SCAN_RESULT \
121 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_SCAN_RESULT)
123#define NET_EVENT_WIFI_SCAN_DONE \
124 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_SCAN_DONE)
126#define NET_EVENT_WIFI_CONNECT_RESULT \
127 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_CONNECT_RESULT)
129#define NET_EVENT_WIFI_DISCONNECT_RESULT \
130 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_DISCONNECT_RESULT)
132#define NET_EVENT_WIFI_IFACE_STATUS \
133 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_IFACE_STATUS)
135#define NET_EVENT_WIFI_TWT \
136 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_TWT)
138#define NET_EVENT_WIFI_TWT_SLEEP_STATE \
139 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE)
141#define NET_EVENT_WIFI_RAW_SCAN_RESULT \
142 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT)
144#define NET_EVENT_WIFI_DISCONNECT_COMPLETE \
145 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE)
240#define WIFI_MAX_TWT_FLOWS 8
241#define WIFI_MAX_TWT_INTERVAL_US (LONG_MAX - 1)
243#define WIFI_MAX_TWT_WAKE_INTERVAL_US 262144
284#ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS
285struct wifi_raw_scan_result {
288 unsigned short frequency;
289 uint8_t data[CONFIG_WIFI_MGMT_RAW_SCAN_RESULT_LENGTH];
297#ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS
298typedef void (*raw_scan_result_cb_t)(
struct net_if *iface,
int status,
299 struct wifi_raw_scan_result *entry);
308#ifdef CONFIG_WIFI_USE_NATIVE_NETWORKING
326#ifdef CONFIG_NET_STATISTICS_WIFI
347#ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS
348void wifi_mgmt_raise_raw_scan_result_event(
struct net_if *iface,
349 struct wifi_raw_scan_result *raw_scan_info);
#define NET_MGMT_DEFINE_REQUEST_HANDLER(_mgmt_request)
Definition: net_mgmt.h:95
Public API for network interface.
Network Management API public header.
Offloaded network device iface API.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINT64_TYPE__ uint64_t
Definition: stdint.h:91
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__INT8_TYPE__ int8_t
Definition: stdint.h:72
Runtime device structure (in ROM) per driver instance.
Definition: device.h:380
Definition: ethernet.h:404
Network Interface structure.
Definition: net_if.h:516
All Wi-Fi specific statistics.
Definition: net_stats.h:490
Definition: wifi_mgmt.h:301
int(* set_twt)(const struct device *dev, struct wifi_twt_params *params)
Definition: wifi_mgmt.h:330
int(* get_power_save_config)(const struct device *dev, struct wifi_ps_config *config)
Definition: wifi_mgmt.h:331
int(* set_power_save)(const struct device *dev, struct wifi_ps_params *params)
Definition: wifi_mgmt.h:329
int(* scan)(const struct device *dev, scan_result_cb_t cb)
Definition: wifi_mgmt.h:318
int(* disconnect)(const struct device *dev)
Definition: wifi_mgmt.h:321
int(* reg_domain)(const struct device *dev, struct wifi_reg_domain *reg_domain)
Definition: wifi_mgmt.h:332
int(* ap_disable)(const struct device *dev)
Definition: wifi_mgmt.h:324
int(* ap_enable)(const struct device *dev, struct wifi_connect_req_params *params)
Definition: wifi_mgmt.h:322
int(* connect)(const struct device *dev, struct wifi_connect_req_params *params)
Definition: wifi_mgmt.h:319
struct offloaded_if_api wifi_iface
Definition: wifi_mgmt.h:311
int(* iface_status)(const struct device *dev, struct wifi_iface_status *status)
Definition: wifi_mgmt.h:325
Extended net_if_api for offloaded ifaces/network devices, allowing handling of admin up/down state ch...
Definition: offloaded_netdev.h:36
Definition: wifi_mgmt.h:163
enum wifi_security_type security
Definition: wifi_mgmt.h:175
uint8_t * psk
Definition: wifi_mgmt.h:167
uint8_t channel
Definition: wifi_mgmt.h:174
uint8_t ssid_length
Definition: wifi_mgmt.h:165
int timeout
Definition: wifi_mgmt.h:177
enum wifi_mfp_options mfp
Definition: wifi_mgmt.h:176
uint8_t sae_password_length
Definition: wifi_mgmt.h:171
uint8_t band
Definition: wifi_mgmt.h:173
uint8_t * sae_password
Definition: wifi_mgmt.h:170
uint8_t psk_length
Definition: wifi_mgmt.h:168
const uint8_t * ssid
Definition: wifi_mgmt.h:164
Definition: wifi_mgmt.h:184
char ssid[WIFI_SSID_MAX_LEN]
Definition: wifi_mgmt.h:187
unsigned short beacon_interval
Definition: wifi_mgmt.h:197
int rssi
Definition: wifi_mgmt.h:195
char bssid[WIFI_MAC_ADDR_LEN]
Definition: wifi_mgmt.h:188
enum wifi_security_type security
Definition: wifi_mgmt.h:193
unsigned int channel
Definition: wifi_mgmt.h:190
enum wifi_mfp_options mfp
Definition: wifi_mgmt.h:194
unsigned char dtim_period
Definition: wifi_mgmt.h:196
int state
Definition: wifi_mgmt.h:185
bool twt_capable
Definition: wifi_mgmt.h:198
enum wifi_iface_mode iface_mode
Definition: wifi_mgmt.h:191
unsigned int ssid_len
Definition: wifi_mgmt.h:186
enum wifi_frequency_bands band
Definition: wifi_mgmt.h:189
enum wifi_link_mode link_mode
Definition: wifi_mgmt.h:192
Definition: wifi_mgmt.h:260
struct wifi_ps_params ps_params
Definition: wifi_mgmt.h:263
char num_twt_flows
Definition: wifi_mgmt.h:261
struct wifi_twt_flow_info twt_flows[8]
Definition: wifi_mgmt.h:262
Definition: wifi_mgmt.h:201
int timeout_ms
Definition: wifi_mgmt.h:206
enum wifi_ps_mode mode
Definition: wifi_mgmt.h:205
enum wifi_config_ps_param_fail_reason fail_reason
Definition: wifi_mgmt.h:208
enum wifi_ps_wakeup_mode wakeup_mode
Definition: wifi_mgmt.h:204
unsigned short listen_interval
Definition: wifi_mgmt.h:203
enum wifi_ps enabled
Definition: wifi_mgmt.h:202
enum ps_param_type type
Definition: wifi_mgmt.h:207
Definition: wifi_mgmt.h:272
enum wifi_mgmt_op oper
Definition: wifi_mgmt.h:273
bool force
Definition: wifi_mgmt.h:275
uint8_t country_code[WIFI_COUNTRY_CODE_LEN]
Definition: wifi_mgmt.h:276
Definition: wifi_mgmt.h:149
uint8_t ssid_length
Definition: wifi_mgmt.h:151
uint8_t band
Definition: wifi_mgmt.h:153
uint8_t mac[WIFI_MAC_ADDR_LEN]
Definition: wifi_mgmt.h:159
int8_t rssi
Definition: wifi_mgmt.h:157
uint8_t mac_length
Definition: wifi_mgmt.h:160
enum wifi_mfp_options mfp
Definition: wifi_mgmt.h:156
uint8_t channel
Definition: wifi_mgmt.h:154
uint8_t ssid[WIFI_SSID_MAX_LEN]
Definition: wifi_mgmt.h:150
enum wifi_security_type security
Definition: wifi_mgmt.h:155
Definition: wifi_mgmt.h:180
int status
Definition: wifi_mgmt.h:181
Definition: wifi_mgmt.h:244
uint8_t dialog_token
Definition: wifi_mgmt.h:248
enum wifi_twt_negotiation_type negotiation_type
Definition: wifi_mgmt.h:251
bool trigger
Definition: wifi_mgmt.h:253
bool responder
Definition: wifi_mgmt.h:252
uint8_t flow_id
Definition: wifi_mgmt.h:250
uint64_t twt_interval
Definition: wifi_mgmt.h:246
uint32_t twt_wake_interval
Definition: wifi_mgmt.h:257
bool implicit
Definition: wifi_mgmt.h:254
bool announce
Definition: wifi_mgmt.h:255
Definition: wifi_mgmt.h:211
bool announce
Definition: wifi_mgmt.h:227
bool teardown_all
Definition: wifi_mgmt.h:233
struct wifi_twt_params::@303::@305 setup
enum wifi_twt_setup_cmd setup_cmd
Definition: wifi_mgmt.h:214
bool trigger
Definition: wifi_mgmt.h:225
enum wifi_twt_negotiation_type negotiation_type
Definition: wifi_mgmt.h:213
enum wifi_twt_operation operation
Definition: wifi_mgmt.h:212
enum wifi_twt_fail_reason fail_reason
Definition: wifi_mgmt.h:236
uint32_t twt_wake_interval
Definition: wifi_mgmt.h:229
enum wifi_twt_setup_resp_status resp_status
Definition: wifi_mgmt.h:215
bool implicit
Definition: wifi_mgmt.h:226
uint8_t flow_id
Definition: wifi_mgmt.h:219
struct wifi_twt_params::@303::@306 teardown
uint64_t twt_interval
Definition: wifi_mgmt.h:223
uint8_t dialog_token
Definition: wifi_mgmt.h:217
bool responder
Definition: wifi_mgmt.h:224
static fdata_t data[2]
Definition: test_fifo_contexts.c:15
General WiFi Definitions.
wifi_ps
Definition: wifi.h:267
wifi_frequency_bands
Definition: wifi.h:97
wifi_mfp_options
Definition: wifi.h:69
#define WIFI_MAC_ADDR_LEN
Definition: wifi.h:127
wifi_twt_setup_cmd
Definition: wifi.h:312
wifi_twt_setup_resp_status
Definition: wifi.h:338
wifi_iface_mode
Definition: wifi.h:183
#define WIFI_COUNTRY_CODE_LEN
Definition: wifi.h:17
wifi_twt_negotiation_type
Definition: wifi.h:300
ps_param_type
Definition: wifi.h:382
wifi_twt_fail_reason
Definition: wifi.h:344
wifi_link_mode
Definition: wifi.h:221
wifi_ps_wakeup_mode
Definition: wifi.h:390
wifi_twt_operation
Definition: wifi.h:290
#define WIFI_SSID_MAX_LEN
Definition: wifi.h:125
wifi_config_ps_param_fail_reason
Definition: wifi.h:400
wifi_security_type
Definition: wifi.h:25
wifi_ps_mode
Definition: wifi.h:277
void wifi_mgmt_raise_connect_result_event(struct net_if *iface, int status)
#define NET_REQUEST_WIFI_PS_CONFIG
Definition: wifi_mgmt.h:94
void wifi_mgmt_raise_twt_sleep_state(struct net_if *iface, int twt_sleep_state)
#define NET_REQUEST_WIFI_SCAN
Definition: wifi_mgmt.h:49
#define NET_REQUEST_WIFI_REG_DOMAIN
Definition: wifi_mgmt.h:98
wifi_twt_sleep_state
Definition: wifi_mgmt.h:279
@ WIFI_TWT_STATE_SLEEP
Definition: wifi_mgmt.h:280
@ WIFI_TWT_STATE_AWAKE
Definition: wifi_mgmt.h:281
void wifi_mgmt_raise_twt_event(struct net_if *iface, struct wifi_twt_params *twt_params)
void wifi_mgmt_raise_disconnect_result_event(struct net_if *iface, int status)
#define NET_REQUEST_WIFI_IFACE_STATUS
Definition: wifi_mgmt.h:74
#define NET_REQUEST_WIFI_PS_MODE
Definition: wifi_mgmt.h:84
#define NET_REQUEST_WIFI_PS_TIMEOUT
Definition: wifi_mgmt.h:103
#define WIFI_MAX_TWT_FLOWS
Definition: wifi_mgmt.h:240
#define NET_REQUEST_WIFI_AP_ENABLE
Definition: wifi_mgmt.h:64
#define NET_REQUEST_WIFI_PS
Definition: wifi_mgmt.h:79
void wifi_mgmt_raise_iface_status_event(struct net_if *iface, struct wifi_iface_status *iface_status)
#define NET_REQUEST_WIFI_DISCONNECT
Definition: wifi_mgmt.h:59
net_request_wifi_cmd
Definition: wifi_mgmt.h:33
@ NET_REQUEST_WIFI_CMD_TWT
Definition: wifi_mgmt.h:42
@ NET_REQUEST_WIFI_CMD_AP_ENABLE
Definition: wifi_mgmt.h:37
@ NET_REQUEST_WIFI_CMD_REG_DOMAIN
Definition: wifi_mgmt.h:44
@ NET_REQUEST_WIFI_CMD_SCAN
Definition: wifi_mgmt.h:34
@ NET_REQUEST_WIFI_CMD_IFACE_STATUS
Definition: wifi_mgmt.h:39
@ NET_REQUEST_WIFI_CMD_AP_DISABLE
Definition: wifi_mgmt.h:38
@ NET_REQUEST_WIFI_CMD_CONNECT
Definition: wifi_mgmt.h:35
@ NET_REQUEST_WIFI_CMD_PS_MODE
Definition: wifi_mgmt.h:41
@ NET_REQUEST_WIFI_CMD_PS
Definition: wifi_mgmt.h:40
@ NET_REQUEST_WIFI_CMD_DISCONNECT
Definition: wifi_mgmt.h:36
@ NET_REQUEST_WIFI_CMD_PS_CONFIG
Definition: wifi_mgmt.h:43
@ NET_REQUEST_WIFI_CMD_MAX
Definition: wifi_mgmt.h:46
@ NET_REQUEST_WIFI_CMD_PS_TIMEOUT
Definition: wifi_mgmt.h:45
void wifi_mgmt_raise_disconnect_complete_event(struct net_if *iface, int status)
#define NET_REQUEST_WIFI_CONNECT
Definition: wifi_mgmt.h:54
#define NET_REQUEST_WIFI_TWT
Definition: wifi_mgmt.h:89
net_event_wifi_cmd
Definition: wifi_mgmt.h:108
@ NET_EVENT_WIFI_CMD_SCAN_RESULT
Definition: wifi_mgmt.h:109
@ NET_EVENT_WIFI_CMD_DISCONNECT_RESULT
Definition: wifi_mgmt.h:112
@ NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE
Definition: wifi_mgmt.h:115
@ NET_EVENT_WIFI_CMD_SCAN_DONE
Definition: wifi_mgmt.h:110
@ NET_EVENT_WIFI_CMD_TWT
Definition: wifi_mgmt.h:114
@ NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT
Definition: wifi_mgmt.h:116
@ NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE
Definition: wifi_mgmt.h:117
@ NET_EVENT_WIFI_CMD_IFACE_STATUS
Definition: wifi_mgmt.h:113
@ NET_EVENT_WIFI_CMD_CONNECT_RESULT
Definition: wifi_mgmt.h:111
void(* scan_result_cb_t)(struct net_if *iface, int status, struct wifi_scan_result *entry)
Definition: wifi_mgmt.h:294
wifi_mgmt_op
Definition: wifi_mgmt.h:267
@ WIFI_MGMT_GET
Definition: wifi_mgmt.h:268
@ WIFI_MGMT_SET
Definition: wifi_mgmt.h:269
#define NET_REQUEST_WIFI_AP_DISABLE
Definition: wifi_mgmt.h:69