1 /***************************************************************************/ /**
2  * @file  sl_wifi_constants.h
3  *******************************************************************************
4  * # License
5  * <b>Copyright 2024 Silicon Laboratories Inc. www.silabs.com</b>
6  *******************************************************************************
7  *
8  * SPDX-License-Identifier: Zlib
9  *
10  * The licensor of this software is Silicon Laboratories Inc.
11  *
12  * This software is provided 'as-is', without any express or implied
13  * warranty. In no event will the authors be held liable for any damages
14  * arising from the use of this software.
15  *
16  * Permission is granted to anyone to use this software for any purpose,
17  * including commercial applications, and to alter it and redistribute it
18  * freely, subject to the following restrictions:
19  *
20  * 1. The origin of this software must not be misrepresented; you must not
21  *    claim that you wrote the original software. If you use this software
22  *    in a product, an acknowledgment in the product documentation would be
23  *    appreciated but is not required.
24  * 2. Altered source versions must be plainly marked as such, and must not be
25  *    misrepresented as being the original software.
26  * 3. This notice may not be removed or altered from any source distribution.
27  *
28  ******************************************************************************/
29 
30 #ifndef _SL_WIFI_CONSTANTS_H_
31 #define _SL_WIFI_CONSTANTS_H_
32 
33 #include <stdint.h>
34 
35 /** \addtogroup SL_WIFI_CONSTANTS Constants
36   * @{ */
37 
38 /// Maximum number of Access Points are scanned in response to a normal scan request.
39 /// @note This is not a configurable value.
40 #define SL_WIFI_MAX_SCANNED_AP 11
41 
42 /// Maximum number of clients supported when module is running in Access Point mode.
43 #define SL_WIFI_MAX_CLIENT_COUNT 16
44 
45 /// Maximum length of the Wi-Fi Pre-Shared Key (PSK) credential.
46 #define SL_WIFI_MAX_PSK_LENGTH 32
47 
48 /// Maximum length of the Wi-Fi Pairwise Master Key (PMK) credential.
49 #define SL_WIFI_MAX_PMK_LENGTH 64
50 
51 /// Maximum length of the key in WEP security.
52 #define SL_WIFI_WEP_KEY_LENGTH 32
53 
54 /// Maximum number of keys supported for WEP security.
55 #define SL_WIFI_WEP_KEY_COUNT 4
56 
57 /// Maximum length of the username in enterprise security.
58 #define SL_WIFI_EAP_USER_NAME_LENGTH 64
59 
60 /// Maximum length of the password in enterprise security.
61 #define SL_WIFI_EAP_PASSWORD_LENGTH 128
62 
63 /// Maximum length of the certificate key in enterprise security.
64 #define SL_WIFI_EAP_CERTIFICATE_KEY_LENGTH 80
65 
66 /// Select Internal Antenna for Wi-Fi.
67 #define SL_WIFI_SELECT_INTERNAL_ANTENNA 0
68 
69 /// Select External Antenna for Wi-Fi.
70 #define SL_WIFI_SELECT_EXTERNAL_ANTENNA 1
71 
72 /// Macro to get the default Wi-Fi interface.
73 #define SL_WIFI_DEFAULT_INTERFACE sl_wifi_get_default_interface()
74 
75 /// Maximum interval for Wi-Fi roaming trigger in milliseconds.
76 #define SL_WIFI_NEVER_ROAM 0x7FFFFFFF
77 
78 /**
79  * @enum sl_wifi_security_t
80  * @brief Enumeration for Wi-Fi security types.
81  *
82  * @note WPA3 Transition security type is not currently supported while running as an Access Point (AP).
83  */
84 typedef enum {
85   SL_WIFI_OPEN                       = 0,  ///< Wi-Fi Open security type
86   SL_WIFI_WPA                        = 1,  ///< Wi-Fi WPA security type
87   SL_WIFI_WPA2                       = 2,  ///< Wi-Fi WPA2 security type
88   SL_WIFI_WEP                        = 3,  ///< Wi-Fi WEP security type
89   SL_WIFI_WPA_ENTERPRISE             = 4,  ///< Wi-Fi WPA enterprise security type
90   SL_WIFI_WPA2_ENTERPRISE            = 5,  ///< Wi-Fi WPA2 enterprise security type
91   SL_WIFI_WPA_WPA2_MIXED             = 6,  ///< Wi-Fi WPA/WPA2 mixed security type that supports both WPA and WPA2
92   SL_WIFI_WPA3                       = 7,  ///< Wi-Fi WPA3 security type
93   SL_WIFI_WPA3_TRANSITION            = 8,  ///< Wi-Fi WPA3 Transition security type (not currently supported in AP mode)
94   SL_WIFI_WPA3_ENTERPRISE            = 9,  ///< Wi-Fi WPA3 enterprise security type
95   SL_WIFI_WPA3_TRANSITION_ENTERPRISE = 10, ///< Wi-Fi WPA3 Transition enterprise security type
96 
97   SL_WIFI_SECURITY_UNKNOWN = 0xFFFF, ///< Wi-Fi Unknown Security type
98 } sl_wifi_security_t;
99 
100 /**
101  * @enum sl_wifi_encryption_t
102  * @brief Enumeration for Wi-Fi encryption methods.
103  *
104  * @note Some encryption types are not currently supported in station (STA) mode.
105  * @note If encryption type is configured anything other than SL_WIFI_DEFAULT_ENCRYPTION, then make sure the AP (third party) supports the configured encryption type. If not, there might be a possibility of getting join failure due to the encryption type mismatch between AP (third party) and STA.
106  */
107 typedef enum {
108   SL_WIFI_DEFAULT_ENCRYPTION,       ///< Default Wi-Fi encryption
109   SL_WIFI_NO_ENCRYPTION,            ///< Wi-Fi with no Encryption (not currently supported in STA mode)
110   SL_WIFI_WEP_ENCRYPTION,           ///< Wi-Fi with WEP Encryption (not currently supported in STA mode)
111   SL_WIFI_TKIP_ENCRYPTION,          ///< Wi-Fi with TKIP Encryption (not currently supported in STA mode)
112   SL_WIFI_CCMP_ENCRYPTION,          ///< Wi-Fi with CCMP Encryption
113   SL_WIFI_EAP_TLS_ENCRYPTION,       ///< Wi-Fi with Enterprise TLS Encryption
114   SL_WIFI_EAP_TTLS_ENCRYPTION,      ///< Wi-Fi with Enterprise TTLS Encryption
115   SL_WIFI_EAP_FAST_ENCRYPTION,      ///< Wi-Fi with Enterprise FAST Encryption
116   SL_WIFI_PEAP_MSCHAPV2_ENCRYPTION, ///< Wi-Fi with Enterprise PEAP Encryption
117   SL_WIFI_EAP_LEAP_ENCRYPTION       ///< Wi-Fi with Enterprise LEAP Encryption
118 } sl_wifi_encryption_t;
119 
120 /**
121  * @enum sl_wifi_tdi_t
122  * @brief Enumeration for Wi-Fi Transition Disable Indication (TDI).
123  *
124  * @note TDI is supported only in WPA3 (Personal or Personal Transition) security in Access Point (AP) mode.
125  */
126 typedef enum {
127   SL_WIFI_TDI_NONE = 0, ///< Allows stations to transition within AP network.
128   SL_WIFI_TDI_SAE =
129     (1
130      << 4), ///< Disallows stations from transitioning within the AP network and only allows connections with WPA3-SAE security mode.
131 } sl_wifi_tdi_t;
132 
133 /**
134  * @enum sl_wifi_credential_type_t
135  * @brief Enumeration for Wi-Fi Credential Types.
136  */
137 typedef enum {
138   SL_WIFI_PSK_CREDENTIAL = 0,         ///< Wi-Fi Personal Credential
139   SL_WIFI_PMK_CREDENTIAL,             ///< Wi-Fi Pairwise Master Key
140   SL_WIFI_WEP_CREDENTIAL,             ///< Wi-Fi WEP Credential
141   SL_WIFI_EAP_CREDENTIAL,             ///< Wi-Fi Enterprise Client Credential
142   SL_WIFI_USER_CREDENTIAL = (1 << 31) ///< Wi-Fi User Credential
143 } sl_wifi_credential_type_t;
144 
145 /**
146  * @enum sl_wifi_antenna_t
147  * @brief Enumeration of Wi-Fi antenna selections.
148  *
149  * @note Only the internal antenna is currently supported.
150  */
151 typedef enum {
152   SL_WIFI_ANTENNA_1,        ///< Wi-Fi Radio Antenna 1 (not currently supported)
153   SL_WIFI_ANTENNA_2,        ///< Wi-Fi Radio Antenna 2 (not currently supported)
154   SL_WIFI_ANTENNA_AUTO,     ///< Wi-Fi Radio Antenna Auto Selection (not currently supported)
155   SL_WIFI_ANTENNA_EXTERNAL, ///< Wi-Fi Radio External Antenna (not currently supported)
156   SL_WIFI_ANTENNA_INTERNAL, ///< Wi-Fi Radio Internal Antenna
157 } sl_wifi_antenna_t;
158 
159 /**
160  * @enum sl_wifi_interface_index_t
161  * @brief Enumeration of Wi-Fi interface indices.
162  *
163  * @note 5 GHz interfaces are not currently supported.
164  */
165 typedef enum {
166   SL_WIFI_CLIENT_2_4GHZ_INTERFACE_INDEX = 0, ///< Wi-Fi client on 2.4 GHz interface
167   SL_WIFI_AP_2_4GHZ_INTERFACE_INDEX,         ///< Wi-Fi access point on 2.4 GHz interface
168   SL_WIFI_CLIENT_5GHZ_INTERFACE_INDEX,       ///< Wi-Fi client on 5 GHz interface (not currently supported)
169   SL_WIFI_AP_5GHZ_INTERFACE_INDEX,           ///< Wi-Fi access point on 5 GHz interface (not currently supported)
170   SL_WIFI_TRANSCEIVER_INTERFACE_INDEX,       ///< Wi-Fi transceiver mode
171   SL_WIFI_MAX_INTERFACE_INDEX                ///< Used for internally by SDK
172 } sl_wifi_interface_index_t;
173 
174 /**
175  * @enum sl_wifi_interface_t
176  * @brief Enumeration of Wi-Fi interfaces.
177  *
178  * @note 5 GHz radio interfaces are not currently supported.
179  */
180 typedef enum {
181   SL_WIFI_INVALID_INTERFACE = 0, ///< Invalid interface
182 
183   SL_WIFI_CLIENT_INTERFACE = (1 << 0), ///< Wi-Fi client interface
184   SL_WIFI_AP_INTERFACE     = (1 << 1), ///< Wi-Fi access point interface
185 
186   SL_WIFI_2_4GHZ_INTERFACE = (1 << 2), ///<  2.4 GHz radio interface
187   SL_WIFI_5GHZ_INTERFACE   = (1 << 3), ///< 5 GHz radio interface (currently not supported for Si91x)
188 
189   // BIT(4), BIT(5) - Reserved for 6 GHz and Sub-GHz
190 
191   SL_WIFI_TRANSCEIVER_INTERFACE = (1 << 7), ///< Wi-Fi Transceiver mode interface
192 
193   SL_WIFI_CLIENT_2_4GHZ_INTERFACE = SL_WIFI_CLIENT_INTERFACE
194                                     | SL_WIFI_2_4GHZ_INTERFACE, ///< Wi-Fi client interface on 2.4 GHz radio
195   SL_WIFI_AP_2_4GHZ_INTERFACE = SL_WIFI_AP_INTERFACE
196                                 | SL_WIFI_2_4GHZ_INTERFACE, ///< Wi-Fi access point interface on 2.4 GHz radio
197 
198   SL_WIFI_CLIENT_5GHZ_INTERFACE =
199     SL_WIFI_CLIENT_INTERFACE
200     | SL_WIFI_5GHZ_INTERFACE, ///< Wi-Fi client interface on 5 GHz radio (currently not supported for Si91x)
201   SL_WIFI_AP_5GHZ_INTERFACE =
202     SL_WIFI_AP_INTERFACE
203     | SL_WIFI_5GHZ_INTERFACE, ///< Wi-Fi access point interface on 5 GHz radio (currently not supported for Si91x)
204 
205   SL_WIFI_ALL_INTERFACES =
206     SL_WIFI_CLIENT_INTERFACE | SL_WIFI_AP_INTERFACE | SL_WIFI_2_4GHZ_INTERFACE
207     | SL_WIFI_5GHZ_INTERFACE, ///< All available Wi-Fi interfaces (5GHz is currently not supported for Si91x)
208 
209 } sl_wifi_interface_t;
210 
211 /// Enumeration of de-authentication reasons from an access point.
212 typedef enum {
213   SL_WIFI_DEAUTH,             ///< De-Authentication from radius server
214   SL_WIFI_DEAUTH_UNSPECIFIED, ///< Unspecified de-authentication reason
215 } sl_wifi_deauth_reason_t;
216 
217 /**
218  * @enum sl_wifi_regulatory_region_t
219  * @brief Enumeration of Wi-Fi regulatory regions.
220  *
221  * @note Australia and France regions are not currently supported.
222  */
223 typedef enum {
224   SL_WIFI_REGION_AUSTRALIA,      ///< Wi-Fi Region Australia (not currently supported)
225   SL_WIFI_REGION_FRANCE,         ///< Wi-Fi Region France (not currently supported)
226   SL_WIFI_REGION_EUROPEAN_UNION, ///< Wi-Fi Region European Union
227   SL_WIFI_REGION_JAPAN,          ///< Wi-Fi Region Japan
228   SL_WIFI_REGION_UNITED_STATES,  ///< Wi-Fi Region United States
229 } sl_wifi_regulatory_region_t;
230 
231 /**
232  * @brief Wi-Fi rate protocols.
233  * @note Recommended value for default behavior is SL_WIFI_RATE_PROTOCOL_AUTO.
234  * @note 802.11ac not currently supported.
235  */
236 typedef enum {
237   SL_WIFI_RATE_PROTOCOL_B_ONLY,  ///< 802.11b rates only (rates go here)
238   SL_WIFI_RATE_PROTOCOL_G_ONLY,  ///< 802.11g rates only (rates go here)
239   SL_WIFI_RATE_PROTOCOL_N_ONLY,  ///< 802.11n rates only (rates go here)
240   SL_WIFI_RATE_PROTOCOL_AC_ONLY, ///< 802.11ac rates only (rates go here) (not currently supported)
241   SL_WIFI_RATE_PROTOCOL_AX_ONLY, ///< 802.11ax rates only (rates go here)
242   SL_WIFI_RATE_PROTOCOL_AUTO,    ///< Automatic rate selection
243 } sl_wifi_rate_protocol_t;
244 
245 /// Wi-Fi scan types.
246 typedef enum {
247   SL_WIFI_SCAN_TYPE_ACTIVE = 0x00, ///< Active scan: Transmit probe requests and listen for responses
248   SL_WIFI_SCAN_TYPE_PASSIVE =
249     0x01, ///< Passive scan: No active transmissions, listen for AP beacons and broadcast probe responses
250   SL_WIFI_SCAN_TYPE_EXTENDED =
251     0x02, ///< Extended Active scan. Transmit probe requests and listen for responses to get more than SL_WIFI_MAX_SCANNED_AP number of results
252   SL_WIFI_SCAN_TYPE_PROHIBITED_CHANNELS = 0x04, ///< Scan channels prohibited by regulatory region
253   SL_WIFI_SCAN_TYPE_ADV_SCAN = 0X08 ///< Advanced scan: Scan for Access Points while the module is in connected state
254 } sl_wifi_scan_type_t;
255 
256 /**
257  * @enum sl_wifi_rate_t
258  * @brief Enumeration of Wi-Fi transfer rates.
259  */
260 typedef enum {
261   SL_WIFI_AUTO_RATE = 0, ///< Wi-Fi Auto transfer rate
262 
263   SL_WIFI_RATE_11B_1,                         ///< Wi-Fi 1 Mbps transfer rate for 802.11b
264   SL_WIFI_RATE_11B_MIN = SL_WIFI_RATE_11B_1,  ///< Wi-Fi Minimum transfer rate for 802.11b
265   SL_WIFI_RATE_11B_2,                         ///< Wi-Fi 2 Mbps transfer rate for 802.11b
266   SL_WIFI_RATE_11B_5_5,                       ///< Wi-Fi 5.5 Mbps transfer rate for 802.11b
267   SL_WIFI_RATE_11B_11,                        ///< Wi-Fi 11 Mbps transfer rate for 802.11b
268   SL_WIFI_RATE_11B_MAX = SL_WIFI_RATE_11B_11, ///< Wi-Fi Maximum transfer rate for 802.11b
269 
270   SL_WIFI_RATE_11G_6,                         ///< Wi-Fi 6 Mbps transfer rate for 802.11g
271   SL_WIFI_RATE_11G_MIN = SL_WIFI_RATE_11G_6,  ///< Wi-Fi Minimum transfer rate for 802.11g
272   SL_WIFI_RATE_11G_9,                         ///< Wi-Fi 9 Mbps transfer rate for 802.11g
273   SL_WIFI_RATE_11G_12,                        ///< Wi-Fi 12 Mbps transfer rate for 802.11g
274   SL_WIFI_RATE_11G_18,                        ///< Wi-Fi 18 Mbps transfer rate for 802.11g
275   SL_WIFI_RATE_11G_24,                        ///< Wi-Fi 24 Mbps transfer rate for 802.11g
276   SL_WIFI_RATE_11G_36,                        ///< Wi-Fi 36 Mbps transfer rate for 802.11g
277   SL_WIFI_RATE_11G_48,                        ///< Wi-Fi 48 Mbps transfer rate for 802.11g
278   SL_WIFI_RATE_11G_54,                        ///< Wi-Fi 54 Mbps transfer rate for 802.11g
279   SL_WIFI_RATE_11G_MAX = SL_WIFI_RATE_11G_54, ///< Wi-Fi Maximum transfer rate for 802.11g
280 
281   SL_WIFI_RATE_11N_MCS0,                        ///< Wi-Fi MCS index 0 transfer rate for 802.11n
282   SL_WIFI_RATE_11N_MIN = SL_WIFI_RATE_11N_MCS0, ///< Wi-Fi Minimum transfer rate for 802.11n
283   SL_WIFI_RATE_11N_MCS1,                        ///< Wi-Fi MCS index 1 transfer rate for 802.11n
284   SL_WIFI_RATE_11N_MCS2,                        ///< Wi-Fi MCS index 2 transfer rate for 802.11n
285   SL_WIFI_RATE_11N_MCS3,                        ///< Wi-Fi MCS index 3 transfer rate for 802.11n
286   SL_WIFI_RATE_11N_MCS4,                        ///< Wi-Fi MCS index 4 transfer rate for 802.11n
287   SL_WIFI_RATE_11N_MCS5,                        ///< Wi-Fi MCS index 5 transfer rate for 802.11n
288   SL_WIFI_RATE_11N_MCS6,                        ///< Wi-Fi MCS index 6 transfer rate for 802.11n
289   SL_WIFI_RATE_11N_MCS7,                        ///< Wi-Fi MCS index 7 transfer rate for 802.11n
290   SL_WIFI_RATE_11N_MAX = SL_WIFI_RATE_11N_MCS7, ///< Wi-Fi Maximum transfer rate for 802.11n
291 
292   SL_WIFI_RATE_11AX_MCS0,                         ///< Wi-Fi MCS index 0 transfer rate for 802.11ax
293   SL_WIFI_RATE_11AX_MIN = SL_WIFI_RATE_11AX_MCS0, ///< Wi-Fi Minimum transfer rate for 802.11ax
294   SL_WIFI_RATE_11AX_MCS1,                         ///< Wi-Fi MCS index 1 transfer rate for 802.11ax
295   SL_WIFI_RATE_11AX_MCS2,                         ///< Wi-Fi MCS index 2 transfer rate for 802.11ax
296   SL_WIFI_RATE_11AX_MCS3,                         ///< Wi-Fi MCS index 3 transfer rate for 802.11ax
297   SL_WIFI_RATE_11AX_MCS4,                         ///< Wi-Fi MCS index 4 transfer rate for 802.11ax
298   SL_WIFI_RATE_11AX_MCS5,                         ///< Wi-Fi MCS index 5 transfer rate for 802.11ax
299   SL_WIFI_RATE_11AX_MCS6,                         ///< Wi-Fi MCS index 6 transfer rate for 802.11ax
300   SL_WIFI_RATE_11AX_MCS7,                         ///< Wi-Fi MCS index 7 transfer rate for 802.11ax
301   SL_WIFI_RATE_11AX_MAX = SL_WIFI_RATE_11AX_MCS7, ///< Wi-Fi Maximum transfer rate for 802.11ax
302 
303   SL_WIFI_RATE_INVALID = 0xFF ///< Wi-Fi Invalid transfer rate
304 } sl_wifi_rate_t;
305 
306 /**
307  * @enum sl_wifi_bss_type_t
308  * @brief Enumeration of Wi-Fi Basic Service Set (BSS) types.
309  */
310 typedef enum {
311   SL_WIFI_BSS_TYPE_INFRASTRUCTURE =
312     0,                            ///< Infrastructure BSS: Standard Wi-Fi Infrastructure network with an access point
313   SL_WIFI_BSS_TYPE_ADHOC   = 1,   ///< Ad-hoc BSS: Peer-to-peer Wi-Fi network without an access point
314   SL_WIFI_BSS_TYPE_ANY     = 2,   ///< Any Wi-Fi BSS type
315   SL_WIFI_BSS_TYPE_UNKNOWN = 0xFF ///< Unknown Wi-Fi BSS type
316 } sl_wifi_bss_type_t;
317 
318 /**
319  * @enum sl_wifi_band_t
320  * @brief Enumeration of Wi-Fi radio bands.
321  *
322  * @note Only the 2.4 GHz band is currently supported.
323  */
324 typedef enum {
325   SL_WIFI_AUTO_BAND   = 0, ///< Wi-Fi Band Auto
326   SL_WIFI_BAND_900MHZ = 1, ///< Wi-Fi Band 900 MHz (not currently supported)
327   SL_WIFI_BAND_2_4GHZ = 2, ///< Wi-Fi Band 2.4 GHz
328   SL_WIFI_BAND_5GHZ   = 3, ///< Wi-Fi Band 5 GHz (not currently supported)
329   SL_WIFI_BAND_6GHZ   = 4, ///< Wi-Fi Band 6 GHz (not currently supported)
330   SL_WIFI_BAND_60GHZ  = 5, ///< Wi-Fi Band 60 GHz (not currently supported)
331 } sl_wifi_band_t;
332 
333 /**
334  * @enum sl_wifi_bandwidth_t
335  * @brief Enumeration of Wi-Fi bandwidth options.
336  *
337  * @note Only 20 MHz bandwidth is currently supported.
338  */
339 typedef enum {
340   SL_WIFI_AUTO_BANDWIDTH   = 0, ///< Wi-Fi Bandwidth Auto
341   SL_WIFI_BANDWIDTH_10MHz  = 0, ///< Wi-Fi Bandwidth 10 MHz (not currently supported)
342   SL_WIFI_BANDWIDTH_20MHz  = 1, ///< Wi-Fi Bandwidth 20 MHz
343   SL_WIFI_BANDWIDTH_40MHz  = 2, ///< Wi-Fi Bandwidth 40 MHz (not currently supported)
344   SL_WIFI_BANDWIDTH_80MHz  = 3, ///< Wi-Fi Bandwidth 80 MHz (not currently supported)
345   SL_WIFI_BANDWIDTH_160MHz = 4, ///< Wi-Fi Bandwidth 160 MHz (not currently supported)
346 } sl_wifi_bandwidth_t;
347 
348 /**
349  * @enum sl_wifi_client_flag_t
350  * @brief Option flags for Wi-Fi client interfaces.
351  */
352 typedef enum {
353   SL_WIFI_NO_JOIN_OPTION   = 0,        ///< Wi-Fi Client Join with no flags
354   SL_WIFI_JOIN_WITH_NO_CSA = (1 << 0), ///< Wi-Fi Client Join without Channel Switch Announcement (CSA)
355   SL_WIFI_JOIN_WITH_SCAN   = (1 << 1)  ///< Wi-Fi Client Join with Scan
356 } sl_wifi_client_flag_t;
357 
358 /**
359  * @enum sl_wifi_ap_flag_t
360  * @brief Option flags for Access Point (AP) interfaces.
361  */
362 typedef enum {
363   SL_WIFI_HIDDEN_SSID = (1 << 0), ///< Hide the SSID of the AP
364 } sl_wifi_ap_flag_t;
365 
366 /**
367  * @enum sl_wifi_listen_interval_time_unit_t
368  * @brief Enumeration of listen interval time units.
369  */
370 typedef enum {
371   SL_WIFI_LISTEN_INTERVAL_TIME_UNIT_BEACON, ///< Time units specified in beacon periods
372   SL_WIFI_LISTEN_INTERVAL_TIME_UNIT_DTIM ///< Time units specified in Delivery Traffic Indication Message (DTIM) periods
373 } sl_wifi_listen_interval_time_unit_t;
374 
375 /**
376  * @enum sl_wifi_wps_mode_t
377  * @brief Enumeration of Wi-Fi WPS (Wi-Fi Protected Setup) modes.
378  */
379 typedef enum {
380   SL_WIFI_WPS_PIN_MODE, ///< WPS pin mode: Requires a PIN to be entered on the client device.
381   SL_WIFI_WPS_PUSH_BUTTON_MODE, ///< WPS push button mode: Requires the user to press a physical or virtual button on both the AP and the client device.
382 } sl_wifi_wps_mode_t;
383 
384 /**
385  * @enum sl_wifi_event_group_t
386  * @brief Enumeration of Wi-Fi event groups.
387  */
388 typedef enum {
389   SL_WIFI_SCAN_RESULT_EVENTS, ///< Event group for Wi-Fi scan results
390   SL_WIFI_JOIN_EVENTS,        ///< Event group for Wi-Fi join status
391   SL_WIFI_RX_PACKET_EVENTS, ///< Event group for Wi-Fi received packet. This feature is not supported in current release
392   SL_WIFI_COMMAND_RESPONSE_EVENTS, ///< Event group for Wi-Fi command response. This feature is not supported in current release
393   SL_WIFI_STATS_RESPONSE_EVENTS,     ///< Event group for Wi-Fi statistics response
394   SL_WIFI_HTTP_OTA_FW_UPDATE_EVENTS, ///< Event group for Wi-Fi OTA firmware update status via HTTP
395   SL_WIFI_NETWORK_DOWN_EVENTS, ///< Event group for Wi-Fi network down. This feature is not supported in current release
396   SL_WIFI_NETWORK_UP_EVENTS,   ///< Event group for Wi-Fi network up. This feature is not supported in current release
397   SL_WIFI_CLIENT_CONNECTED_EVENTS,    ///< Event group for Wi-Fi client connected status
398   SL_WIFI_TWT_RESPONSE_EVENTS,        ///< Event group for Wi-Fi TWT response
399   SL_WIFI_CLIENT_DISCONNECTED_EVENTS, ///< Event group for Wi-Fi client disconnection status
400   SL_WIFI_TRANSCEIVER_EVENTS,         ///< Event group for Wi-Fi transceiver events
401   SL_WIFI_EVENT_GROUP_COUNT,          ///< Event group for Wi-Fi maximum default group count. Used internally by SDK
402   SL_WIFI_EVENT_FAIL_INDICATION_EVENTS = (1 << 31), ///< Event group for Wi-Fi fail indication
403 } sl_wifi_event_group_t;
404 
405 /**
406  * @enum sl_wifi_event_t
407  * @brief Enumeration of Wi-Fi events.
408  *
409  * @note Each event group has a matching event.
410  * @note Each event group may be a source of multiple different events.
411  */
412 typedef enum {
413   SL_WIFI_SCAN_RESULT_EVENT =
414     SL_WIFI_SCAN_RESULT_EVENTS, ///< Event for Wi-Fi scan result. Data would be type of @ref sl_wifi_scan_result_t
415   SL_WIFI_JOIN_EVENT = SL_WIFI_JOIN_EVENTS, ///< Event for Wi-Fi join status. Data would be of type string
416   SL_WIFI_RX_PACKET_EVENT =
417     SL_WIFI_RX_PACKET_EVENTS, ///< Event for Wi-Fi received packet. This feature is not supported in current release
418   SL_WIFI_COMMAND_RESPONSE_EVENT =
419     SL_WIFI_COMMAND_RESPONSE_EVENTS, ///< Event for Wi-Fi command response. This feature is not supported in current release
420   SL_WIFI_STATS_RESPONSE_EVENT =
421     SL_WIFI_STATS_RESPONSE_EVENTS, ///< Event for Wi-Fi statistics response. Data would be NULL
422   SL_WIFI_HTTP_OTA_FW_UPDATE_EVENT =
423     SL_WIFI_HTTP_OTA_FW_UPDATE_EVENTS, ///< Event for Wi-Fi OTA firmware update status via HTTP. Data would be NULL
424   SL_WIFI_NETWORK_DOWN_EVENT =
425     SL_WIFI_NETWORK_DOWN_EVENTS, ///< Event for Wi-Fi network down. This feature is not supported in current release
426   SL_WIFI_NETWORK_UP_EVENT =
427     SL_WIFI_NETWORK_UP_EVENTS, ///< Event for Wi-Fi network up. This feature is not supported in current release
428   SL_WIFI_CLIENT_CONNECTED_EVENT =
429     SL_WIFI_CLIENT_CONNECTED_EVENTS, ///< Event for Wi-Fi client connected status in Access Point Mode. Data would be of type [sl_mac_address_t](../wiseconnect-api-reference-guide-nwk-mgmt/sl-net-types#sl-mac-address-t).
430   SL_WIFI_TWT_RESPONSE_EVENT =
431     SL_WIFI_TWT_RESPONSE_EVENTS, ///< Event for Wi-Fi TWT response in WiFi Client mode. Data would be NULL
432   SL_WIFI_CLIENT_DISCONNECTED_EVENT =
433     SL_WIFI_CLIENT_DISCONNECTED_EVENTS, ///< Event for Wi-Fi client disconnection status in Access Point Mode. Data would of type [sl_mac_address_t](../wiseconnect-api-reference-guide-common/ieee802#sl-mac-address-t).
434   SL_WIFI_TRANSCEIVER_EVENT =
435     SL_WIFI_TRANSCEIVER_EVENTS, ///< Event for Wi-Fi transceiver TX/RX events in WiFi Client mode.
436   // TWT specific events
437   SL_WIFI_TWT_UNSOLICITED_SESSION_SUCCESS_EVENT =
438     SL_WIFI_TWT_RESPONSE_EVENTS
439     | (1
440        << 16), ///< Event for TWT unsolicited session success. Data would be of type [sl_si91x_twt_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-twt-response-t).
441   SL_WIFI_TWT_AP_REJECTED_EVENT =
442     SL_WIFI_TWT_RESPONSE_EVENTS
443     | (4
444        << 16), ///< Event for TWT AP rejection. Data would be of type [sl_si91x_twt_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-twt-response-t).
445   SL_WIFI_TWT_OUT_OF_TOLERANCE_EVENT =
446     SL_WIFI_TWT_RESPONSE_EVENTS
447     | (5
448        << 16), ///< Event for TWT out of tolerance. Data would be of type [sl_si91x_twt_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-twt-response-t).
449   SL_WIFI_TWT_RESPONSE_NOT_MATCHED_EVENT =
450     SL_WIFI_TWT_RESPONSE_EVENTS
451     | (6
452        << 16), ///<  Event for TWT response not matched. Data would be of type [sl_si91x_twt_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-twt-response-t).
453   SL_WIFI_TWT_UNSUPPORTED_RESPONSE_EVENT =
454     SL_WIFI_TWT_RESPONSE_EVENTS
455     | (10
456        << 16), ///< Event for TWT unsupported response. Data would be of type [sl_si91x_twt_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-twt-response-t).
457   SL_WIFI_TWT_TEARDOWN_SUCCESS_EVENT =
458     SL_WIFI_TWT_RESPONSE_EVENTS
459     | (11
460        << 16), ///< Event for TWT teardown success. Data would be of type [sl_si91x_twt_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-twt-response-t).
461   SL_WIFI_TWT_AP_TEARDOWN_SUCCESS_EVENT =
462     SL_WIFI_TWT_RESPONSE_EVENTS
463     | (12
464        << 16), ///< Event for TWT AP teardown success. Data would be of type [sl_si91x_twt_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-twt-response-t).
465   SL_WIFI_TWT_FAIL_MAX_RETRIES_REACHED_EVENT =
466     SL_WIFI_TWT_RESPONSE_EVENTS
467     | (15
468        << 16), ///< Event for TWT maximum retries reached. Data would be of type [sl_si91x_twt_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-twt-response-t).
469   SL_WIFI_TWT_INACTIVE_DUE_TO_ROAMING_EVENT =
470     SL_WIFI_TWT_RESPONSE_EVENTS
471     | (16
472        << 16), ///< Event for TWT inactive due to roaming. Data would be of type [sl_si91x_twt_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-twt-response-t).
473   SL_WIFI_TWT_INACTIVE_DUE_TO_DISCONNECT_EVENT =
474     SL_WIFI_TWT_RESPONSE_EVENTS
475     | (17
476        << 16), ///< Event for TWT inactive due to disconnect. Data would be of type [sl_si91x_twt_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-twt-response-t).
477   SL_WIFI_TWT_INACTIVE_NO_AP_SUPPORT_EVENT =
478     SL_WIFI_TWT_RESPONSE_EVENTS
479     | (18
480        << 16), ///< Event for TWT inactive due to no AP support. Data would be of type [sl_si91x_twt_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-twt-response-t).
481   SL_WIFI_RESCHEDULE_TWT_SUCCESS_EVENT =
482     SL_WIFI_TWT_RESPONSE_EVENTS
483     | (19
484        << 16), ///<  Event for TWT suspend resume success. Data would be of type [sl_si91x_twt_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-twt-response-t).
485   SL_WIFI_TWT_INFO_FRAME_EXCHANGE_FAILED_EVENT =
486     SL_WIFI_TWT_RESPONSE_EVENTS
487     | (20
488        << 16), ///< Event for TWT info frame exchange failure. Data would be of type [sl_si91x_twt_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-twt-response-t).
489   SL_WIFI_TWT_EVENTS_END =
490     SL_WIFI_TWT_RESPONSE_EVENTS
491     | (21
492        << 16), ///< Event for TWT event end.  Data would be of type [sl_si91x_twt_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-twt-response-t).
493 
494   // Stats specific events
495   SL_WIFI_STATS_EVENT = SL_WIFI_STATS_RESPONSE_EVENTS
496                         | (1 << 16), ///< Event for Wi-Fi statistics. This feature is not supported in current release
497   SL_WIFI_STATS_ASYNC_EVENT =
498     SL_WIFI_STATS_RESPONSE_EVENTS
499     | (2
500        << 16), ///< Event for Wi-Fi asynchronous statistics. Data would be of type [sl_si91x_async_stats_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-async-stats-response-t)
501   SL_WIFI_STATS_ADVANCE_EVENT =
502     SL_WIFI_STATS_RESPONSE_EVENTS
503     | (3
504        << 16), ///< Event for Wi-Fi advance statistics. Data would be of type [sl_si91x_advance_stats_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-advance-stats-response-t)
505   SL_WIFI_STATS_TEST_MODE_EVENT =
506     SL_WIFI_STATS_RESPONSE_EVENTS
507     | (4 << 16), ///< Event for Wi-Fi test mode statistics. This feature is not supported in current release
508   SL_WIFI_STATS_MODULE_STATE_EVENT =
509     SL_WIFI_STATS_RESPONSE_EVENTS
510     | (5
511        << 16), ///< Event for Wi-Fi module state statistics. Data would be of type [sl_si91x_module_state_stats_response_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91x-module-state-stats-response-t)
512 
513   SL_WIFI_TRANSCEIVER_RX_DATA_RECEIVE_CB = SL_WIFI_TRANSCEIVER_EVENTS | (1 << 16),
514   SL_WIFI_TRANSCEIVER_TX_DATA_STATUS_CB  = SL_WIFI_TRANSCEIVER_EVENTS | (2 << 16),
515 
516   // Single bit to indicate relevant event is related to a failure condition
517   SL_WIFI_EVENT_FAIL_INDICATION = (1 << 31),  ///< Event for Wi-Fi event failure indication
518   SL_WIFI_INVALID_EVENT         = 0xFFFFFFFF, ///< Invalid Wi-Fi event.  Data would be NULL
519 } sl_wifi_event_t;
520 
521 /**
522  * @enum sl_wifi_reschedule_twt_action_t
523  * @brief Enumeration defining actions related to Target Wake Time (TWT).
524  */
525 typedef enum {
526   SL_WIFI_SUSPEND_INDEFINITELY, ///< Suspend TWT indefinitely, effectively disabling TWT functionality until explicitly resumed.
527   SL_WIFI_SUSPEND_FOR_DURATION, ///< Suspend TWT for a specified duration, after which it can automatically resume.
528   SL_WIFI_RESUME_IMMEDIATELY    ///< Resume TWT immediately, allowing devices to continue adhering to TWT schedules.
529 } sl_wifi_reschedule_twt_action_t;
530 
531 /**
532  * @enum sl_wifi_data_rate_t
533  * @brief Enumeration of Wi-Fi data rates.
534  */
535 typedef enum {
536   SL_WIFI_DATA_RATE_1       = 0,   ///< Wi-Fi 1 Mbps transfer rate
537   SL_WIFI_DATA_RATE_2       = 2,   ///< Wi-Fi 2 Mbps transfer rate
538   SL_WIFI_DATA_RATE_5_5     = 4,   ///< Wi-Fi 5.5 Mbps transfer rate
539   SL_WIFI_DATA_RATE_11      = 6,   ///< Wi-Fi 11 Mbps transfer rate
540   SL_WIFI_DATA_RATE_6       = 139, ///< Wi-Fi 6 Mbps transfer rate
541   SL_WIFI_DATA_RATE_9       = 143, ///< Wi-Fi 9 Mbps transfer rate
542   SL_WIFI_DATA_RATE_12      = 138, ///< Wi-Fi 12 Mbps transfer rate
543   SL_WIFI_DATA_RATE_18      = 142, ///< Wi-Fi 18 Mbps transfer rate
544   SL_WIFI_DATA_RATE_24      = 137, ///< Wi-Fi 24 Mbps transfer rate
545   SL_WIFI_DATA_RATE_36      = 141, ///< Wi-Fi 36 Mbps transfer rate
546   SL_WIFI_DATA_RATE_48      = 136, ///< Wif-Fi 48 Mbps transfer rate
547   SL_WIFI_DATA_RATE_54      = 140, ///< Wi-Fi 54 Mbps transfer rate
548   SL_WIFI_DATA_RATE_MCS0    = 256, ///< Wi-Fi MCS index 0 transfer rate
549   SL_WIFI_DATA_RATE_MCS1    = 257, ///< Wi-Fi MCS index 1 transfer rate
550   SL_WIFI_DATA_RATE_MCS2    = 258, ///< Wi-Fi MCS index 2 transfer rate
551   SL_WIFI_DATA_RATE_MCS3    = 259, ///< Wi-Fi MCS index 3 transfer rate
552   SL_WIFI_DATA_RATE_MCS4    = 260, ///< Wi-Fi MCS index 4 transfer rate
553   SL_WIFI_DATA_RATE_MCS5    = 261, ///< Wi-Fi MCS index 5 transfer rate
554   SL_WIFI_DATA_RATE_MCS6    = 262, ///< Wi-Fi MCS index 6 transfer rate
555   SL_WIFI_DATA_RATE_MCS7    = 263, ///< Wi-Fi MCS index 7 transfer rate
556   SL_WIFI_DATA_RATE_MCS7_SG = 775,
557 } sl_wifi_data_rate_t;
558 
559 /**
560  * @enum sl_wifi_tx_test_mode_t
561  * @brief Enumeration of Wi-Fi TX test modes.
562  */
563 typedef enum {
564   SL_WIFI_TEST_BURST_MODE                          = 0, ///< Burst Mode
565   SL_WIFI_TEST_CONTINOUS_MODE                      = 1, ///< Continuous Mode
566   SL_WIFI_TEST_CONTINOUS_WAVE_MODE                 = 2, ///< CW Mode
567   SL_WIFI_TEST_CONTINOUS_WAVE_MODE_OFF_CENTER_LOW  = 3, ///< CW Mode center frequency - 2.5 MHZ Mode
568   SL_WIFI_TEST_CONTINOUS_WAVE_MODE_OFF_CENTER_HIGH = 4, ///< CW Mode center frequency + 5 MHZ Mode
569 } sl_wifi_tx_test_mode_t;
570 
571 /**
572  * @enum sl_wifi_high_throughput_capability_types_t
573  * @brief Enumeration of High Throughput (HT) capabilities.
574  */
575 typedef enum {
576   SL_WIFI_HT_CAPS_NUM_RX_STBC    = (1 << 8), ///< Number of RX Space-Time Block Coding (STBC) streams supported
577   SL_WIFI_HT_CAPS_SHORT_GI_20MHZ = (1 << 5), ///< Support for Short Guard Interval (GI) in 20 MHz channels
578   SL_WIFI_HT_CAPS_GREENFIELD_EN =
579     (1 << 4), ///< Support for Greenfield mode, which improves efficiency by eliminating legacy preambles
580   SL_WIFI_HT_CAPS_SUPPORT_CH_WIDTH = (1 << 1), ///< Support for wider channel bandwidths
581 } sl_wifi_high_throughput_capability_types_t;
582 
583 /**
584  * @enum sl_wifi_multicast_filter_command_t
585  * @brief Enumeration of multicast filter command types.
586  */
587 typedef enum {
588   SL_WIFI_MULTICAST_MAC_ADD_BIT   = 0, ///< To set particular bit in multicast bitmap
589   SL_WIFI_MULTICAST_MAC_CLEAR_BIT = 1, ///< To reset particular bit in multicast bitmap
590   SL_WIFI_MULTICAST_MAC_CLEAR_ALL = 2, ///< To clear all the bits in multicast bitmap
591   SL_WIFI_MULTICAST_MAC_SET_ALL   = 3, ///< To set all the bits in multicast bitmap
592 } sl_wifi_multicast_filter_command_t;
593 
594 /**
595  * @enum sl_wifi_eap_client_flag_t
596  * @brief Option flags for EAP (Extensible Authentication Protocol) client interfaces.
597  */
598 typedef enum {
599   SL_WIFI_EAP_ENABLE_OKC = (1 << 0), ///< Wi-Fi EAP Client flag to enable Opportunistic Key Caching (OKC)
600   SL_WIFI_EAP_ENABLE_PEAP_CA =
601     (1 << 1), ///< Wi-Fi EAP Client flag to enable CA certificate requirement for PEAP connection
602   SL_WIFI_EAP_DHE_RSA_AES256_SHA256 =
603     (1 << 2), ///< Wi-Fi EAP Client flag to use DHE-RSA-AES256-SHA256 Cipher for EAP connection
604   SL_WIFI_EAP_DHE_RSA_AES128_SHA256 =
605     (1 << 3), ///< Wi-Fi EAP Client flag to use DHE-RSA-AES128-SHA256 Cipher for EAP connection
606   SL_WIFI_EAP_DHE_RSA_AES256_SHA =
607     (1 << 4), ///< Wi-Fi EAP Client flag to use DHE-RSA-AES256-SHA Cipher for EAP connection
608   SL_WIFI_EAP_DHE_RSA_AES128_SHA =
609     (1 << 5),                            ///< Wi-Fi EAP Client flag to use DHE-RSA-AES128-SHA Cipher for EAP connection
610   SL_WIFI_EAP_AES256_SHA256 = (1 << 6),  ///< Wi-Fi EAP Client flag to use AES256-SHA256 Cipher for EAP connection
611   SL_WIFI_EAP_AES128_SHA256 = (1 << 7),  ///< Wi-Fi EAP Client flag to use AES128-SHA256 Cipher for EAP connection
612   SL_WIFI_EAP_AES256_SHA    = (1 << 8),  ///< Wi-Fi EAP Client flag to use AES256-SHA Cipher for EAP connection
613   SL_WIFI_EAP_AES128_SHA    = (1 << 9),  ///< Wi-Fi EAP Client flag to use AES128-SHA Cipher for EAP connection
614   SL_WIFI_EAP_RC4_SHA       = (1 << 10), ///< Wi-Fi EAP Client flag to use RC4-SHA Cipher for EAP connection
615   SL_WIFI_EAP_DES_CBC3_SHA  = (1 << 11), ///< Wi-Fi EAP Client flag to use DES-CBC3-SHA Cipher for EAP connection
616   SL_WIFI_EAP_RC4_MD5       = (1 << 12)  ///< Wi-Fi EAP Client flag to use RC4-MD5 Cipher for EAP connection
617 } sl_wifi_eap_client_flag_t;
618 
619 /**
620  * @def SL_WIFI_AUTO_CHANNEL
621  * @brief Macro to enable Auto Channel Selection (ACS).
622  *
623  * This macro defines the value to enable the Auto Channel Selection (ACS) feature, which automatically determines the operating channel for the Access Point (AP).
624  *
625  * @note
626  * - The channel in which the AP operates. A value of zero enables the ACS feature.
627  * - If ACS is enabled, AP start may take approximately 9 seconds as the device scans all channels to select the best channel.
628  */
629 #define SL_WIFI_AUTO_CHANNEL 0
630 
631 /**
632  * @def SL_WIFI_DEFAULT_CHANNEL_BITMAP
633  * @brief Macro to define the default channel bitmap for scanning.
634  *
635  * @note
636  * - The selected or preferred channels to be scanned before the client connects to the AP. A value of zero means to scan on all available channels.
637  */
638 #define SL_WIFI_DEFAULT_CHANNEL_BITMAP 0
639 
640 /**
641  * @def SL_WIFI_ARGS_CHECK_NULL_POINTER(ptr)
642  * @brief Macro to check for null pointers in API inputs.
643  */
644 #define SL_WIFI_ARGS_CHECK_NULL_POINTER(ptr) \
645   do {                                       \
646     if (ptr == NULL) {                       \
647       return SL_STATUS_NULL_POINTER;         \
648     }                                        \
649   } while (0)
650 
651 /**
652  * @def SL_WIFI_ARGS_CHECK_INVALID_INTERFACE(interface)
653  * @brief Macro to check for invalid Wi-Fi interfaces in API inputs.
654  */
655 #define SL_WIFI_ARGS_CHECK_INVALID_INTERFACE(interface)                                                   \
656   {                                                                                                       \
657     if (!((interface == SL_WIFI_CLIENT_INTERFACE) || (interface == SL_WIFI_AP_INTERFACE)                  \
658           || (interface == SL_WIFI_CLIENT_2_4GHZ_INTERFACE) || (interface == SL_WIFI_AP_2_4GHZ_INTERFACE) \
659           || (interface == SL_WIFI_2_4GHZ_INTERFACE))) {                                                  \
660       return SL_STATUS_WIFI_UNKNOWN_INTERFACE;                                                            \
661     }                                                                                                     \
662   }
663 
664 /** @} */
665 #endif // _SL_WIFI_CONSTANTS_H_
666