Zephyr API Documentation  3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
wifi_mgmt.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12#ifndef ZEPHYR_INCLUDE_NET_WIFI_MGMT_H_
13#define ZEPHYR_INCLUDE_NET_WIFI_MGMT_H_
14
15#include <zephyr/net/net_mgmt.h>
16#include <zephyr/net/wifi.h>
17#include <zephyr/net/ethernet.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
29/* Management part definitions */
30
33#define _NET_WIFI_LAYER NET_MGMT_LAYER_L2
34#define _NET_WIFI_CODE 0x156
35#define _NET_WIFI_BASE (NET_MGMT_IFACE_BIT | \
36 NET_MGMT_LAYER(_NET_WIFI_LAYER) | \
37 NET_MGMT_LAYER_CODE(_NET_WIFI_CODE))
38#define _NET_WIFI_EVENT (_NET_WIFI_BASE | NET_MGMT_EVENT_BIT)
39
40#ifdef CONFIG_WIFI_MGMT_SCAN_SSID_FILT_MAX
41#define WIFI_MGMT_SCAN_SSID_FILT_MAX CONFIG_WIFI_MGMT_SCAN_SSID_FILT_MAX
42#else
43#define WIFI_MGMT_SCAN_SSID_FILT_MAX 1
44#endif /* CONFIG_WIFI_MGMT_SCAN_SSID_FILT_MAX */
45
46#ifdef CONFIG_WIFI_MGMT_SCAN_CHAN_MAX_MANUAL
47#define WIFI_MGMT_SCAN_CHAN_MAX_MANUAL CONFIG_WIFI_MGMT_SCAN_CHAN_MAX_MANUAL
48#else
49#define WIFI_MGMT_SCAN_CHAN_MAX_MANUAL 1
50#endif /* CONFIG_WIFI_MGMT_SCAN_CHAN_MAX_MANUAL */
51
52#define WIFI_MGMT_BAND_STR_SIZE_MAX 8
53#define WIFI_MGMT_SCAN_MAX_BSS_CNT 65535
54
55#define WIFI_MGMT_SKIP_INACTIVITY_POLL IS_ENABLED(CONFIG_WIFI_MGMT_AP_STA_SKIP_INACTIVITY_POLL)
95 NET_REQUEST_WIFI_CMD_MAX
97};
98
100#define NET_REQUEST_WIFI_SCAN \
101 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_SCAN)
102
104
106#define NET_REQUEST_WIFI_CONNECT \
107 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_CONNECT)
108
110
112#define NET_REQUEST_WIFI_DISCONNECT \
113 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_DISCONNECT)
114
116
118#define NET_REQUEST_WIFI_AP_ENABLE \
119 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_ENABLE)
120
122
124#define NET_REQUEST_WIFI_AP_DISABLE \
125 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_DISABLE)
126
128
130#define NET_REQUEST_WIFI_IFACE_STATUS \
131 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_IFACE_STATUS)
132
134
136#define NET_REQUEST_WIFI_PS \
137 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS)
138
140
142#define NET_REQUEST_WIFI_TWT \
143 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_TWT)
144
146
148#define NET_REQUEST_WIFI_PS_CONFIG \
149 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PS_CONFIG)
150
152
154#define NET_REQUEST_WIFI_REG_DOMAIN \
155 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_REG_DOMAIN)
156
158
160#define NET_REQUEST_WIFI_MODE \
161 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_MODE)
162
164
166#define NET_REQUEST_WIFI_PACKET_FILTER \
167 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_PACKET_FILTER)
168
170
172#define NET_REQUEST_WIFI_CHANNEL \
173 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_CHANNEL)
174
176
178#define NET_REQUEST_WIFI_AP_STA_DISCONNECT \
179 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_STA_DISCONNECT)
180
182
184#define NET_REQUEST_WIFI_VERSION \
185 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_VERSION)
186
188
190#define NET_REQUEST_WIFI_RTS_THRESHOLD \
191 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_RTS_THRESHOLD)
192
194
196#define NET_REQUEST_WIFI_AP_CONFIG_PARAM \
197 (_NET_WIFI_BASE | NET_REQUEST_WIFI_CMD_AP_CONFIG_PARAM)
198
200
231};
232
234#define NET_EVENT_WIFI_SCAN_RESULT \
235 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_SCAN_RESULT)
236
238#define NET_EVENT_WIFI_SCAN_DONE \
239 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_SCAN_DONE)
240
242#define NET_EVENT_WIFI_CONNECT_RESULT \
243 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_CONNECT_RESULT)
244
246#define NET_EVENT_WIFI_DISCONNECT_RESULT \
247 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_DISCONNECT_RESULT)
248
250#define NET_EVENT_WIFI_IFACE_STATUS \
251 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_IFACE_STATUS)
252
254#define NET_EVENT_WIFI_TWT \
255 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_TWT)
256
258#define NET_EVENT_WIFI_TWT_SLEEP_STATE \
259 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE)
260
262#define NET_EVENT_WIFI_RAW_SCAN_RESULT \
263 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT)
264
266#define NET_EVENT_WIFI_DISCONNECT_COMPLETE \
267 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE)
268
270#define NET_EVENT_WIFI_AP_ENABLE_RESULT \
271 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_ENABLE_RESULT)
272
274#define NET_EVENT_WIFI_AP_DISABLE_RESULT \
275 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_DISABLE_RESULT)
276
278#define NET_EVENT_WIFI_AP_STA_CONNECTED \
279 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_STA_CONNECTED)
280
282#define NET_EVENT_WIFI_AP_STA_DISCONNECTED \
283 (_NET_WIFI_EVENT | NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED)
284
288 const char *drv_version;
290 const char *fw_version;
291};
292
301};
302
329 const char *ssids[WIFI_MGMT_SCAN_SSID_FILT_MAX];
352 struct wifi_band_channel band_chan[WIFI_MGMT_SCAN_CHAN_MAX_MANUAL];
353};
354
377};
378
382 const uint8_t *ssid;
384 uint8_t ssid_length; /* Max 32 */
386 const uint8_t *psk;
388 uint8_t psk_length; /* Min 8 - Max 64 */
392 uint8_t sae_password_length; /* No length restrictions */
405};
406
432};
433
448};
449
470};
471
474 union {
483 };
484};
485
489 int state;
491 unsigned int ssid_len;
499 unsigned int channel;
509 int rssi;
511 unsigned char dtim_period;
513 unsigned short beacon_interval;
516};
517
523 unsigned short listen_interval;
536 unsigned int timeout_ms;
541};
542
559 union {
561 struct {
582 struct {
586 };
589};
590
593/* Flow ID is only 3 bits */
594#define WIFI_MAX_TWT_FLOWS 8
595#define WIFI_MAX_TWT_INTERVAL_US (LONG_MAX - 1)
596/* 256 (u8) * 1TU */
597#define WIFI_MAX_TWT_WAKE_INTERVAL_US 262144
598#define WIFI_MAX_TWT_WAKE_AHEAD_DURATION_US (LONG_MAX - 1)
599
624};
625
631 struct wifi_twt_flow_info twt_flows[WIFI_MAX_TWT_FLOWS];
634};
635
642};
643
645#define MAX_REG_CHAN_NUM 42
646
650 unsigned short center_frequency;
652 unsigned short max_power:8;
654 unsigned short supported:1;
656 unsigned short passive_only:1;
658 unsigned short dfs:1;
659} __packed;
660
666 bool force;
670 unsigned int num_channels;
673};
674
681};
682
683#if defined(CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS) || defined(__DOXYGEN__)
691 unsigned short frequency;
693 uint8_t data[CONFIG_WIFI_MGMT_RAW_SCAN_RESULT_LENGTH];
694};
695#endif /* CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS */
696
707};
708
711/* for use in max info size calculations */
712union wifi_mgmt_events {
713 struct wifi_scan_result scan_result;
714 struct wifi_status connect_status;
715 struct wifi_iface_status iface_status;
716#ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS
717 struct wifi_raw_scan_result raw_scan_result;
718#endif /* CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS */
719 struct wifi_twt_params twt_params;
720 struct wifi_ap_sta_info ap_sta_info;
721};
722
733};
734
745};
746
755};
756
758#define WIFI_AP_STA_MAX_INACTIVITY (LONG_MAX - 1)
769};
770
771#include <zephyr/net/net_if.h>
772
779typedef void (*scan_result_cb_t)(struct net_if *iface, int status,
780 struct wifi_scan_result *entry);
781
782#ifdef CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS
789typedef void (*raw_scan_result_cb_t)(struct net_if *iface, int status,
790 struct wifi_raw_scan_result *entry);
791#endif /* CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS */
792
806 int (*scan)(const struct device *dev,
807 struct wifi_scan_params *params,
816 int (*connect)(const struct device *dev,
817 struct wifi_connect_req_params *params);
824 int (*disconnect)(const struct device *dev);
832 int (*ap_enable)(const struct device *dev,
833 struct wifi_connect_req_params *params);
840 int (*ap_disable)(const struct device *dev);
848 int (*ap_sta_disconnect)(const struct device *dev, const uint8_t *mac);
856 int (*iface_status)(const struct device *dev, struct wifi_iface_status *status);
857#if defined(CONFIG_NET_STATISTICS_WIFI) || defined(__DOXYGEN__)
865 int (*get_stats)(const struct device *dev, struct net_stats_wifi *stats);
866#endif /* CONFIG_NET_STATISTICS_WIFI */
874 int (*set_power_save)(const struct device *dev, struct wifi_ps_params *params);
882 int (*set_twt)(const struct device *dev, struct wifi_twt_params *params);
890 int (*get_power_save_config)(const struct device *dev, struct wifi_ps_config *config);
898 int (*reg_domain)(const struct device *dev, struct wifi_reg_domain *reg_domain);
906 int (*filter)(const struct device *dev, struct wifi_filter_info *filter);
914 int (*mode)(const struct device *dev, struct wifi_mode_info *mode);
922 int (*channel)(const struct device *dev, struct wifi_channel_info *channel);
935 int (*get_version)(const struct device *dev, struct wifi_version *params);
943 int (*set_rts_threshold)(const struct device *dev, unsigned int rts_threshold);
951 int (*ap_config_params)(const struct device *dev, struct wifi_ap_config_params *params);
952};
953
962#if defined(CONFIG_WIFI_USE_NATIVE_NETWORKING) || defined(__DOXYGEN__)
965#else
968#endif
970 const struct wifi_mgmt_ops *const wifi_mgmt_api;
971
972#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT) || defined(__DOXYGEN__)
974 const void *wifi_drv_ops;
975#endif
976};
977
978#if defined(CONFIG_WIFI_NM_WPA_SUPPLICANT)
979/* Make sure wifi_drv_ops is after wifi_mgmt_api */
980BUILD_ASSERT(offsetof(struct net_wifi_mgmt_offload, wifi_mgmt_api) <
981 offsetof(struct net_wifi_mgmt_offload, wifi_drv_ops));
982#endif
983
984/* Make sure that the network interface API is properly setup inside
985 * Wifi mgmt offload API struct (it is the first one).
986 */
987BUILD_ASSERT(offsetof(struct net_wifi_mgmt_offload, wifi_iface) == 0);
988
994void wifi_mgmt_raise_connect_result_event(struct net_if *iface, int status);
995
1001void wifi_mgmt_raise_disconnect_result_event(struct net_if *iface, int status);
1002
1010
1017 struct wifi_twt_params *twt_params);
1018
1024void wifi_mgmt_raise_twt_sleep_state(struct net_if *iface, int twt_sleep_state);
1025
1026#if defined(CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS) || defined(__DOXYGEN__)
1033 struct wifi_raw_scan_result *raw_scan_info);
1034#endif /* CONFIG_WIFI_MGMT_RAW_SCAN_RESULTS */
1035
1042
1049
1056
1063 struct wifi_ap_sta_info *sta_info);
1064
1070 struct wifi_ap_sta_info *sta_info);
1071
1075#ifdef __cplusplus
1076}
1077#endif
1078
1079#endif /* ZEPHYR_INCLUDE_NET_WIFI_MGMT_H_ */
Ethernet.
#define NET_MGMT_DEFINE_REQUEST_HANDLER(_mgmt_request)
Declare a request handler function for the given network event.
Definition: net_mgmt.h:109
void wifi_mgmt_raise_connect_result_event(struct net_if *iface, int status)
Wi-Fi management connect result event.
wifi_ps
Wi-Fi power save states.
Definition: wifi.h:248
#define NET_REQUEST_WIFI_PS_CONFIG
Request a Wi-Fi power save configuration.
Definition: wifi_mgmt.h:148
void wifi_mgmt_raise_twt_sleep_state(struct net_if *iface, int twt_sleep_state)
Wi-Fi management TWT sleep state event.
#define NET_REQUEST_WIFI_SCAN
Request a Wi-Fi scan.
Definition: wifi_mgmt.h:100
wifi_frequency_bands
IEEE 802.11 operational frequency bands (not exhaustive).
Definition: wifi.h:92
wifi_mfp_options
IEEE 802.11w - Management frame protection.
Definition: wifi.h:71
#define NET_REQUEST_WIFI_RTS_THRESHOLD
Request a Wi-Fi RTS threshold.
Definition: wifi_mgmt.h:190
#define WIFI_MAC_ADDR_LEN
MAC address length.
Definition: wifi.h:120
#define NET_REQUEST_WIFI_REG_DOMAIN
Request a Wi-Fi regulatory domain.
Definition: wifi_mgmt.h:154
#define NET_REQUEST_WIFI_PACKET_FILTER
Request Wi-Fi packet filter.
Definition: wifi_mgmt.h:166
wifi_twt_setup_cmd
Wi-Fi Target Wake Time (TWT) setup commands.
Definition: wifi.h:330
wifi_twt_sleep_state
Wi-Fi TWT sleep states.
Definition: wifi_mgmt.h:676
void wifi_mgmt_raise_twt_event(struct net_if *iface, struct wifi_twt_params *twt_params)
Wi-Fi management TWT event.
void wifi_mgmt_raise_disconnect_result_event(struct net_if *iface, int status)
Wi-Fi management disconnect result event.
#define NET_REQUEST_WIFI_IFACE_STATUS
Request a Wi-Fi network interface status.
Definition: wifi_mgmt.h:130
#define NET_REQUEST_WIFI_VERSION
Request a Wi-Fi version.
Definition: wifi_mgmt.h:184
void wifi_mgmt_raise_ap_sta_disconnected_event(struct net_if *iface, struct wifi_ap_sta_info *sta_info)
Wi-Fi management AP mode STA disconnected event.
wifi_twt_setup_resp_status
Wi-Fi Target Wake Time (TWT) negotiation status.
Definition: wifi.h:353
wifi_iface_mode
Wi-Fi interface modes.
Definition: wifi.h:181
#define NET_REQUEST_WIFI_AP_ENABLE
Request a Wi-Fi access point enable.
Definition: wifi_mgmt.h:118
#define WIFI_COUNTRY_CODE_LEN
Length of the country code string.
Definition: wifi.h:26
void wifi_mgmt_raise_ap_enable_result_event(struct net_if *iface, enum wifi_ap_status status)
Wi-Fi management AP mode enable result event.
#define NET_REQUEST_WIFI_PS
Request a Wi-Fi power save.
Definition: wifi_mgmt.h:136
wifi_twt_negotiation_type
Wi-Fi Target Wake Time (TWT) negotiation types.
Definition: wifi.h:317
void wifi_mgmt_raise_raw_scan_result_event(struct net_if *iface, struct wifi_raw_scan_result *raw_scan_info)
Wi-Fi management raw scan result event.
void wifi_mgmt_raise_iface_status_event(struct net_if *iface, struct wifi_iface_status *iface_status)
Wi-Fi management interface status event.
wifi_ap_config_param
Wi-Fi AP mode configuration parameter.
Definition: wifi.h:498
wifi_conn_status
Wi-Fi connect result codes.
Definition: wifi_mgmt.h:410
#define NET_REQUEST_WIFI_DISCONNECT
Request a Wi-Fi disconnect.
Definition: wifi_mgmt.h:112
wifi_twt_fail_reason
Target Wake Time (TWT) error codes.
Definition: wifi.h:361
net_request_wifi_cmd
Wi-Fi management commands.
Definition: wifi_mgmt.h:59
#define NET_REQUEST_WIFI_MODE
Request current Wi-Fi mode.
Definition: wifi_mgmt.h:160
#define NET_REQUEST_WIFI_AP_STA_DISCONNECT
Request a Wi-Fi access point to disconnect a station.
Definition: wifi_mgmt.h:178
void wifi_mgmt_raise_disconnect_complete_event(struct net_if *iface, int status)
Wi-Fi management disconnect complete event.
#define NET_REQUEST_WIFI_CONNECT
Request a Wi-Fi connect.
Definition: wifi_mgmt.h:106
wifi_ap_status
Wi-Fi AP mode result codes.
Definition: wifi_mgmt.h:453
#define NET_REQUEST_WIFI_TWT
Request a Wi-Fi TWT.
Definition: wifi_mgmt.h:142
wifi_link_mode
Wi-Fi link operating modes.
Definition: wifi.h:209
wifi_ps_param_type
Wi-Fi power save parameters.
Definition: wifi.h:428
net_event_wifi_cmd
Wi-Fi management events.
Definition: wifi_mgmt.h:202
wifi_disconn_reason
Wi-Fi disconnect reason codes.
Definition: wifi_mgmt.h:437
wifi_ps_wakeup_mode
Wi-Fi power save modes.
Definition: wifi.h:442
void wifi_mgmt_raise_ap_sta_connected_event(struct net_if *iface, struct wifi_ap_sta_info *sta_info)
Wi-Fi management AP mode STA connected event.
wifi_twt_operation
Wi-Fi Target Wake Time (TWT) operations.
Definition: wifi.h:306
wifi_scan_type
Wi-Fi scanning types.
Definition: wifi.h:240
void(* scan_result_cb_t)(struct net_if *iface, int status, struct wifi_scan_result *entry)
Scan result callback.
Definition: wifi_mgmt.h:779
wifi_twt_teardown_status
Wi-Fi Target Wake Time (TWT) teradown status.
Definition: wifi.h:387
#define WIFI_SSID_MAX_LEN
Max SSID length.
Definition: wifi.h:112
#define NET_REQUEST_WIFI_CHANNEL
Request a Wi-Fi channel.
Definition: wifi_mgmt.h:172
wifi_config_ps_param_fail_reason
Wi-Fi power save error codes.
Definition: wifi.h:453
wifi_security_type
IEEE 802.11 security types.
Definition: wifi.h:40
void wifi_mgmt_raise_ap_disable_result_event(struct net_if *iface, enum wifi_ap_status status)
Wi-Fi management AP mode disable result event.
wifi_mgmt_op
Generic get/set operation for any command.
Definition: wifi_mgmt.h:637
#define NET_REQUEST_WIFI_AP_CONFIG_PARAM
Request a Wi-Fi AP parameters configuration.
Definition: wifi_mgmt.h:196
#define NET_REQUEST_WIFI_AP_DISABLE
Request a Wi-Fi access point disable.
Definition: wifi_mgmt.h:124
wifi_ps_mode
Wi-Fi power save modes.
Definition: wifi.h:259
@ WIFI_TWT_STATE_SLEEP
TWT sleep state: sleeping.
Definition: wifi_mgmt.h:678
@ WIFI_TWT_STATE_AWAKE
TWT sleep state: awake.
Definition: wifi_mgmt.h:680
@ WIFI_STATUS_CONN_AP_NOT_FOUND
Connection failed - AP not found.
Definition: wifi_mgmt.h:427
@ WIFI_STATUS_CONN_SUCCESS
Connection successful.
Definition: wifi_mgmt.h:412
@ WIFI_STATUS_CONN_WRONG_PASSWORD
Connection failed - wrong password Few possible reasons for 4-way handshake failure that we can guess...
Definition: wifi_mgmt.h:423
@ WIFI_STATUS_CONN_FAIL
Connection failed - generic failure.
Definition: wifi_mgmt.h:414
@ WIFI_STATUS_CONN_TIMEOUT
Connection timed out.
Definition: wifi_mgmt.h:425
@ WIFI_STATUS_DISCONN_FIRST_STATUS
Connection disconnected status.
Definition: wifi_mgmt.h:431
@ WIFI_STATUS_CONN_LAST_STATUS
Last connection status.
Definition: wifi_mgmt.h:429
@ NET_REQUEST_WIFI_CMD_AP_CONFIG_PARAM
Configure AP parameter.
Definition: wifi_mgmt.h:93
@ NET_REQUEST_WIFI_CMD_TWT
Setup or teardown TWT flow.
Definition: wifi_mgmt.h:75
@ NET_REQUEST_WIFI_CMD_PACKET_FILTER
Set or get packet filter setting for current mode.
Definition: wifi_mgmt.h:83
@ NET_REQUEST_WIFI_CMD_AP_ENABLE
Enable AP mode.
Definition: wifi_mgmt.h:67
@ NET_REQUEST_WIFI_CMD_REG_DOMAIN
Set or get regulatory domain.
Definition: wifi_mgmt.h:79
@ NET_REQUEST_WIFI_CMD_SCAN
Scan for Wi-Fi networks.
Definition: wifi_mgmt.h:61
@ NET_REQUEST_WIFI_CMD_IFACE_STATUS
Get interface status.
Definition: wifi_mgmt.h:71
@ NET_REQUEST_WIFI_CMD_AP_STA_DISCONNECT
Disconnect a STA from AP.
Definition: wifi_mgmt.h:87
@ NET_REQUEST_WIFI_CMD_AP_DISABLE
Disable AP mode.
Definition: wifi_mgmt.h:69
@ NET_REQUEST_WIFI_CMD_RTS_THRESHOLD
Set RTS threshold.
Definition: wifi_mgmt.h:91
@ NET_REQUEST_WIFI_CMD_CONNECT
Connect to a Wi-Fi network.
Definition: wifi_mgmt.h:63
@ NET_REQUEST_WIFI_CMD_VERSION
Get Wi-Fi driver and Firmware versions.
Definition: wifi_mgmt.h:89
@ NET_REQUEST_WIFI_CMD_CHANNEL
Set or get Wi-Fi channel for Monitor or TX-Injection mode.
Definition: wifi_mgmt.h:85
@ NET_REQUEST_WIFI_CMD_MODE
Set or get Mode of operation.
Definition: wifi_mgmt.h:81
@ NET_REQUEST_WIFI_CMD_PS
Set power save status.
Definition: wifi_mgmt.h:73
@ NET_REQUEST_WIFI_CMD_DISCONNECT
Disconnect from a Wi-Fi network.
Definition: wifi_mgmt.h:65
@ NET_REQUEST_WIFI_CMD_PS_CONFIG
Get power save config.
Definition: wifi_mgmt.h:77
@ WIFI_STATUS_AP_CHANNEL_NOT_ALLOWED
AP mode enable failed - channel not allowed.
Definition: wifi_mgmt.h:461
@ WIFI_STATUS_AP_SUCCESS
AP mode enable or disable successful.
Definition: wifi_mgmt.h:455
@ WIFI_STATUS_AP_OP_NOT_SUPPORTED
AP mode enable failed - operation not supported.
Definition: wifi_mgmt.h:467
@ WIFI_STATUS_AP_OP_NOT_PERMITTED
AP mode enable failed - operation not permitted.
Definition: wifi_mgmt.h:469
@ WIFI_STATUS_AP_CHANNEL_NOT_SUPPORTED
AP mode enable failed - channel not supported.
Definition: wifi_mgmt.h:459
@ WIFI_STATUS_AP_FAIL
AP mode enable or disable failed - generic failure.
Definition: wifi_mgmt.h:457
@ WIFI_STATUS_AP_AUTH_TYPE_NOT_SUPPORTED
AP mode enable failed - authentication type not supported.
Definition: wifi_mgmt.h:465
@ WIFI_STATUS_AP_SSID_NOT_ALLOWED
AP mode enable failed - SSID not allowed.
Definition: wifi_mgmt.h:463
@ NET_EVENT_WIFI_CMD_AP_STA_DISCONNECTED
STA disconnected from AP.
Definition: wifi_mgmt.h:230
@ NET_EVENT_WIFI_CMD_SCAN_RESULT
Scan results available.
Definition: wifi_mgmt.h:204
@ NET_EVENT_WIFI_CMD_DISCONNECT_RESULT
Disconnect result.
Definition: wifi_mgmt.h:210
@ NET_EVENT_WIFI_CMD_TWT_SLEEP_STATE
TWT sleep status: awake or sleeping, can be used by application to determine if it can send data or n...
Definition: wifi_mgmt.h:218
@ NET_EVENT_WIFI_CMD_AP_ENABLE_RESULT
AP mode enable result.
Definition: wifi_mgmt.h:224
@ NET_EVENT_WIFI_CMD_AP_STA_CONNECTED
STA connected to AP.
Definition: wifi_mgmt.h:228
@ NET_EVENT_WIFI_CMD_SCAN_DONE
Scan done.
Definition: wifi_mgmt.h:206
@ NET_EVENT_WIFI_CMD_TWT
TWT events.
Definition: wifi_mgmt.h:214
@ NET_EVENT_WIFI_CMD_RAW_SCAN_RESULT
Raw scan results available.
Definition: wifi_mgmt.h:220
@ NET_EVENT_WIFI_CMD_AP_DISABLE_RESULT
AP mode disable result.
Definition: wifi_mgmt.h:226
@ NET_EVENT_WIFI_CMD_DISCONNECT_COMPLETE
Disconnect complete.
Definition: wifi_mgmt.h:222
@ NET_EVENT_WIFI_CMD_IFACE_STATUS
Interface status.
Definition: wifi_mgmt.h:212
@ NET_EVENT_WIFI_CMD_CONNECT_RESULT
Connect result.
Definition: wifi_mgmt.h:208
@ WIFI_REASON_DISCONN_INACTIVITY
Disconnected due to inactivity.
Definition: wifi_mgmt.h:447
@ WIFI_REASON_DISCONN_AP_LEAVING
Disconnected due to AP leaving.
Definition: wifi_mgmt.h:445
@ WIFI_REASON_DISCONN_SUCCESS
Success, overload status as reason.
Definition: wifi_mgmt.h:439
@ WIFI_REASON_DISCONN_UNSPECIFIED
Unspecified reason.
Definition: wifi_mgmt.h:441
@ WIFI_REASON_DISCONN_USER_REQUEST
Disconnected due to user request.
Definition: wifi_mgmt.h:443
@ WIFI_MGMT_GET
Get operation.
Definition: wifi_mgmt.h:639
@ WIFI_MGMT_SET
Set operation.
Definition: wifi_mgmt.h:641
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
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
__INT8_TYPE__ int8_t
Definition: stdint.h:72
Runtime device structure (in ROM) per driver instance.
Definition: device.h:403
Ethernet L2 API operations.
Definition: ethernet.h:526
Network Interface structure.
Definition: net_if.h:678
All Wi-Fi specific statistics.
Definition: net_stats.h:603
Wi-Fi management offload API.
Definition: wifi_mgmt.h:955
struct ethernet_api wifi_iface
Mandatory to get in first position.
Definition: wifi_mgmt.h:964
const struct wifi_mgmt_ops *const wifi_mgmt_api
Wi-Fi management API.
Definition: wifi_mgmt.h:970
const void * wifi_drv_ops
Wi-Fi supplicant driver API.
Definition: wifi_mgmt.h:974
Extended net_if_api for offloaded ifaces/network devices, allowing handling of admin up/down state ch...
Definition: offloaded_netdev.h:51
Wi-Fi AP configuration parameter.
Definition: wifi_mgmt.h:762
uint32_t max_inactivity
Parameter used for setting maximum inactivity duration for stations.
Definition: wifi_mgmt.h:766
enum wifi_ap_config_param type
Parameter used to identify the different AP parameters.
Definition: wifi_mgmt.h:764
uint32_t max_num_sta
Parameter used for setting maximum number of stations.
Definition: wifi_mgmt.h:768
AP mode - connected STA details.
Definition: wifi_mgmt.h:698
enum wifi_link_mode link_mode
Link mode, see enum wifi_link_mode.
Definition: wifi_mgmt.h:700
uint8_t mac[WIFI_MAC_ADDR_LEN]
MAC address.
Definition: wifi_mgmt.h:702
uint8_t mac_length
MAC address length.
Definition: wifi_mgmt.h:704
bool twt_capable
is TWT capable ?
Definition: wifi_mgmt.h:706
Wi-Fi structure to uniquely identify a band-channel pair.
Definition: wifi_mgmt.h:296
uint8_t band
Frequency band.
Definition: wifi_mgmt.h:298
uint8_t channel
Channel.
Definition: wifi_mgmt.h:300
Wi-Fi channel setting for monitor and TX-injection modes.
Definition: wifi_mgmt.h:748
uint8_t if_index
Interface index.
Definition: wifi_mgmt.h:752
uint16_t channel
Channel value to set.
Definition: wifi_mgmt.h:750
enum wifi_mgmt_op oper
Get or set operation.
Definition: wifi_mgmt.h:754
Wi-Fi connect request parameters.
Definition: wifi_mgmt.h:380
enum wifi_security_type security
Security type.
Definition: wifi_mgmt.h:398
const uint8_t * sae_password
SAE password (same as PSK but with no length restrictions), optional.
Definition: wifi_mgmt.h:390
uint8_t channel
Channel.
Definition: wifi_mgmt.h:396
uint8_t ssid_length
SSID length.
Definition: wifi_mgmt.h:384
int timeout
Connect timeout in seconds, SYS_FOREVER_MS for no timeout.
Definition: wifi_mgmt.h:404
enum wifi_mfp_options mfp
MFP options.
Definition: wifi_mgmt.h:400
uint8_t sae_password_length
SAE password length.
Definition: wifi_mgmt.h:392
uint8_t band
Frequency band.
Definition: wifi_mgmt.h:394
const uint8_t * psk
Pre-shared key.
Definition: wifi_mgmt.h:386
uint8_t bssid[WIFI_MAC_ADDR_LEN]
BSSID.
Definition: wifi_mgmt.h:402
uint8_t psk_length
Pre-shared key length.
Definition: wifi_mgmt.h:388
const uint8_t * ssid
SSID.
Definition: wifi_mgmt.h:382
Wi-Fi filter setting for monitor, prmoiscuous, TX-injection modes.
Definition: wifi_mgmt.h:736
uint16_t buffer_size
Filter buffer size.
Definition: wifi_mgmt.h:742
uint8_t filter
Filter setting.
Definition: wifi_mgmt.h:738
enum wifi_mgmt_op oper
Get or set operation.
Definition: wifi_mgmt.h:744
uint8_t if_index
Interface index.
Definition: wifi_mgmt.h:740
Wi-Fi interface status.
Definition: wifi_mgmt.h:487
char ssid[WIFI_SSID_MAX_LEN]
SSID.
Definition: wifi_mgmt.h:493
unsigned short beacon_interval
Beacon interval.
Definition: wifi_mgmt.h:513
int rssi
RSSI.
Definition: wifi_mgmt.h:509
char bssid[WIFI_MAC_ADDR_LEN]
BSSID.
Definition: wifi_mgmt.h:495
enum wifi_security_type security
Security type, see enum wifi_security_type.
Definition: wifi_mgmt.h:505
unsigned int channel
Channel.
Definition: wifi_mgmt.h:499
enum wifi_mfp_options mfp
MFP options, see enum wifi_mfp_options.
Definition: wifi_mgmt.h:507
unsigned char dtim_period
DTIM period.
Definition: wifi_mgmt.h:511
int state
Interface state, see enum wifi_iface_state.
Definition: wifi_mgmt.h:489
bool twt_capable
is TWT capable?
Definition: wifi_mgmt.h:515
enum wifi_iface_mode iface_mode
Interface mode, see enum wifi_iface_mode.
Definition: wifi_mgmt.h:501
unsigned int ssid_len
SSID length.
Definition: wifi_mgmt.h:491
enum wifi_frequency_bands band
Frequency band.
Definition: wifi_mgmt.h:497
enum wifi_link_mode link_mode
Link mode, see enum wifi_link_mode.
Definition: wifi_mgmt.h:503
Wi-Fi management API.
Definition: wifi_mgmt.h:794
int(* reg_domain)(const struct device *dev, struct wifi_reg_domain *reg_domain)
Set or get regulatory domain.
Definition: wifi_mgmt.h:898
int(* ap_config_params)(const struct device *dev, struct wifi_ap_config_params *params)
Configure AP parameter.
Definition: wifi_mgmt.h:951
int(* scan)(const struct device *dev, struct wifi_scan_params *params, scan_result_cb_t cb)
Scan for Wi-Fi networks.
Definition: wifi_mgmt.h:806
int(* set_rts_threshold)(const struct device *dev, unsigned int rts_threshold)
Set RTS threshold value.
Definition: wifi_mgmt.h:943
int(* get_power_save_config)(const struct device *dev, struct wifi_ps_config *config)
Get power save config.
Definition: wifi_mgmt.h:890
int(* disconnect)(const struct device *dev)
Disconnect from a Wi-Fi network.
Definition: wifi_mgmt.h:824
int(* ap_disable)(const struct device *dev)
Disable AP mode.
Definition: wifi_mgmt.h:840
int(* get_stats)(const struct device *dev, struct net_stats_wifi *stats)
Get Wi-Fi statistics.
Definition: wifi_mgmt.h:865
int(* get_version)(const struct device *dev, struct wifi_version *params)
Get Version of WiFi driver and Firmware.
Definition: wifi_mgmt.h:935
int(* set_twt)(const struct device *dev, struct wifi_twt_params *params)
Setup or teardown TWT flow.
Definition: wifi_mgmt.h:882
int(* set_power_save)(const struct device *dev, struct wifi_ps_params *params)
Set power save status.
Definition: wifi_mgmt.h:874
int(* ap_enable)(const struct device *dev, struct wifi_connect_req_params *params)
Enable AP mode.
Definition: wifi_mgmt.h:832
int(* filter)(const struct device *dev, struct wifi_filter_info *filter)
Set or get packet filter settings for monitor and promiscuous modes.
Definition: wifi_mgmt.h:906
int(* iface_status)(const struct device *dev, struct wifi_iface_status *status)
Get interface status.
Definition: wifi_mgmt.h:856
int(* mode)(const struct device *dev, struct wifi_mode_info *mode)
Set or get mode of operation.
Definition: wifi_mgmt.h:914
int(* connect)(const struct device *dev, struct wifi_connect_req_params *params)
Connect to a Wi-Fi network.
Definition: wifi_mgmt.h:816
int(* ap_sta_disconnect)(const struct device *dev, const uint8_t *mac)
Disconnect a STA from AP.
Definition: wifi_mgmt.h:848
int(* channel)(const struct device *dev, struct wifi_channel_info *channel)
Set or get current channel of operation.
Definition: wifi_mgmt.h:922
Wi-Fi mode setup.
Definition: wifi_mgmt.h:726
enum wifi_mgmt_op oper
Get or set operation.
Definition: wifi_mgmt.h:732
uint8_t mode
Mode setting for a specific mode of operation.
Definition: wifi_mgmt.h:728
uint8_t if_index
Interface index.
Definition: wifi_mgmt.h:730
Wi-Fi power save configuration.
Definition: wifi_mgmt.h:627
struct wifi_ps_params ps_params
Power save configuration.
Definition: wifi_mgmt.h:633
char num_twt_flows
Number of TWT flows.
Definition: wifi_mgmt.h:629
struct wifi_twt_flow_info twt_flows[WIFI_MAX_TWT_FLOWS]
TWT flow details.
Definition: wifi_mgmt.h:631
Wi-Fi power save parameters.
Definition: wifi_mgmt.h:519
enum wifi_ps_mode mode
Wi-Fi power save mode.
Definition: wifi_mgmt.h:527
enum wifi_config_ps_param_fail_reason fail_reason
Wi-Fi power save fail reason.
Definition: wifi_mgmt.h:540
enum wifi_ps_wakeup_mode wakeup_mode
Wi-Fi power save wakeup mode.
Definition: wifi_mgmt.h:525
unsigned short listen_interval
Listen interval.
Definition: wifi_mgmt.h:523
enum wifi_ps enabled
Power save state.
Definition: wifi_mgmt.h:521
unsigned int timeout_ms
Wi-Fi power save timeout.
Definition: wifi_mgmt.h:536
enum wifi_ps_param_type type
Wi-Fi power save type.
Definition: wifi_mgmt.h:538
Wi-Fi raw scan result.
Definition: wifi_mgmt.h:685
int8_t rssi
RSSI.
Definition: wifi_mgmt.h:687
uint8_t data[CONFIG_WIFI_MGMT_RAW_SCAN_RESULT_LENGTH]
Raw scan data.
Definition: wifi_mgmt.h:693
int frame_length
Frame length.
Definition: wifi_mgmt.h:689
unsigned short frequency
Frequency.
Definition: wifi_mgmt.h:691
Per-channel regulatory attributes.
Definition: wifi_mgmt.h:648
unsigned short center_frequency
Center frequency in MHz.
Definition: wifi_mgmt.h:650
unsigned short dfs
Is a DFS channel.
Definition: wifi_mgmt.h:658
unsigned short supported
Is channel supported or not.
Definition: wifi_mgmt.h:654
unsigned short passive_only
Passive transmissions only.
Definition: wifi_mgmt.h:656
unsigned short max_power
Maximum transmission power (in dBm)
Definition: wifi_mgmt.h:652
Regulatory domain information or configuration.
Definition: wifi_mgmt.h:662
unsigned int num_channels
Number of channels supported.
Definition: wifi_mgmt.h:670
enum wifi_mgmt_op oper
Regulatory domain operation.
Definition: wifi_mgmt.h:664
struct wifi_reg_chan_info * chan_info
Channels information.
Definition: wifi_mgmt.h:672
bool force
Ignore all other regulatory hints over this one.
Definition: wifi_mgmt.h:666
uint8_t country_code[WIFI_COUNTRY_CODE_LEN]
Country code: ISO/IEC 3166-1 alpha-2.
Definition: wifi_mgmt.h:668
Wi-Fi scan parameters structure.
Definition: wifi_mgmt.h:308
uint16_t max_bss_cnt
Specifies the maximum number of scan results to return.
Definition: wifi_mgmt.h:337
uint16_t dwell_time_active
Active scan dwell time (in ms) on a channel.
Definition: wifi_mgmt.h:323
enum wifi_scan_type scan_type
Scan type, see enum wifi_scan_type.
Definition: wifi_mgmt.h:316
uint8_t bands
Bitmap of bands to be scanned.
Definition: wifi_mgmt.h:320
uint16_t dwell_time_passive
Passive scan dwell time (in ms) on a channel.
Definition: wifi_mgmt.h:326
struct wifi_band_channel band_chan[WIFI_MGMT_SCAN_CHAN_MAX_MANUAL]
Channel information array indexed on Wi-Fi frequency bands and channels within that band.
Definition: wifi_mgmt.h:352
const char * ssids[WIFI_MGMT_SCAN_SSID_FILT_MAX]
Array of SSID strings to scan.
Definition: wifi_mgmt.h:329
Wi-Fi scan result, each result is provided to the net_mgmt_event_callback via its info attribute (see...
Definition: wifi_mgmt.h:358
uint8_t ssid_length
SSID length.
Definition: wifi_mgmt.h:362
uint8_t band
Frequency band.
Definition: wifi_mgmt.h:364
uint8_t mac[WIFI_MAC_ADDR_LEN]
BSSID.
Definition: wifi_mgmt.h:374
int8_t rssi
RSSI.
Definition: wifi_mgmt.h:372
uint8_t mac_length
BSSID length.
Definition: wifi_mgmt.h:376
enum wifi_mfp_options mfp
MFP options.
Definition: wifi_mgmt.h:370
uint8_t channel
Channel.
Definition: wifi_mgmt.h:366
uint8_t ssid[WIFI_SSID_MAX_LEN]
SSID.
Definition: wifi_mgmt.h:360
enum wifi_security_type security
Security type.
Definition: wifi_mgmt.h:368
Generic Wi-Fi status for commands and events.
Definition: wifi_mgmt.h:473
enum wifi_ap_status ap_status
Access point status.
Definition: wifi_mgmt.h:482
enum wifi_conn_status conn_status
Connection status.
Definition: wifi_mgmt.h:478
enum wifi_disconn_reason disconn_reason
Disconnection reason status.
Definition: wifi_mgmt.h:480
int status
Status value.
Definition: wifi_mgmt.h:476
Wi-Fi TWT flow information.
Definition: wifi_mgmt.h:603
uint8_t dialog_token
Dialog token, used to map requests to responses.
Definition: wifi_mgmt.h:607
enum wifi_twt_negotiation_type negotiation_type
TWT negotiation type, see enum wifi_twt_negotiation_type.
Definition: wifi_mgmt.h:611
uint32_t twt_wake_ahead_duration
Wake ahead duration.
Definition: wifi_mgmt.h:623
bool trigger
Trigger enabled or disabled.
Definition: wifi_mgmt.h:615
bool responder
Requestor or responder.
Definition: wifi_mgmt.h:613
uint8_t flow_id
Flow ID, used to map setup with teardown.
Definition: wifi_mgmt.h:609
uint64_t twt_interval
Interval = Wake up time + Sleeping time.
Definition: wifi_mgmt.h:605
uint32_t twt_wake_interval
Wake up time.
Definition: wifi_mgmt.h:621
bool implicit
Implicit or explicit.
Definition: wifi_mgmt.h:617
bool announce
Announced or unannounced.
Definition: wifi_mgmt.h:619
Wi-Fi TWT parameters.
Definition: wifi_mgmt.h:544
bool announce
Announced or unannounced.
Definition: wifi_mgmt.h:571
bool teardown_all
Teardown all flows.
Definition: wifi_mgmt.h:584
enum wifi_twt_setup_cmd setup_cmd
TWT setup command, see enum wifi_twt_setup_cmd.
Definition: wifi_mgmt.h:550
bool trigger
Trigger enabled or disabled.
Definition: wifi_mgmt.h:567
enum wifi_twt_negotiation_type negotiation_type
TWT negotiation type, see enum wifi_twt_negotiation_type.
Definition: wifi_mgmt.h:548
enum wifi_twt_operation operation
TWT operation, see enum wifi_twt_operation.
Definition: wifi_mgmt.h:546
uint32_t twt_wake_ahead_duration
Wake ahead notification is sent earlier than TWT Service period (SP) start based on this duration.
Definition: wifi_mgmt.h:579
enum wifi_twt_fail_reason fail_reason
TWT fail reason, see enum wifi_twt_fail_reason.
Definition: wifi_mgmt.h:588
uint32_t twt_wake_interval
Wake up time.
Definition: wifi_mgmt.h:573
struct wifi_twt_params::@362::@365 teardown
Teardown specific parameters.
enum wifi_twt_setup_resp_status resp_status
TWT setup response status, see enum wifi_twt_setup_resp_status.
Definition: wifi_mgmt.h:552
bool implicit
Implicit or explicit.
Definition: wifi_mgmt.h:569
uint8_t flow_id
Flow ID, used to map setup with teardown.
Definition: wifi_mgmt.h:558
enum wifi_twt_teardown_status teardown_status
TWT teardown cmd status, see enum wifi_twt_teardown_status.
Definition: wifi_mgmt.h:554
struct wifi_twt_params::@362::@364 setup
Setup specific parameters.
uint64_t twt_interval
Interval = Wake up time + Sleeping time.
Definition: wifi_mgmt.h:563
uint8_t dialog_token
Dialog token, used to map requests to responses.
Definition: wifi_mgmt.h:556
bool responder
Requestor or responder.
Definition: wifi_mgmt.h:565
Wi-Fi version.
Definition: wifi_mgmt.h:286
const char * fw_version
Firmware version.
Definition: wifi_mgmt.h:290
const char * drv_version
Driver version.
Definition: wifi_mgmt.h:288
IEEE 802.11 protocol and general Wi-Fi definitions.