1 /********************************************************************************
2  * @file  sl_wifi_types.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 #pragma once
31 
32 #include "sl_wifi_constants.h"
33 #include "sl_wifi_host_interface.h"
34 #include "sl_ieee802_types.h"
35 #include "sl_status.h"
36 #include "sl_ip_types.h"
37 #include <stdint.h>
38 
39 // Default Timeout Configuration
40 #define SL_WIFI_DEFAULT_AUTH_ASSOCIATION_TIMEOUT  0xFFFF
41 #define SL_WIFI_DEFAULT_ACTIVE_CHANNEL_SCAN_TIME  0xFFFF
42 #define SL_WIFI_DEFAULT_KEEP_ALIVE_TIMEOUT        0xFFFF
43 #define SL_WIFI_DEFAULT_PASSIVE_CHANNEL_SCAN_TIME 0
44 
45 /// Wi-Fi transceiver mode configurations
46 #define MAX_PAYLOAD_LEN                     2020
47 #define MAC_INFO_ENABLE                     BIT(0)
48 #define BCAST_INDICATION                    BIT(1)
49 #define CONFIRM_REQUIRED_TO_HOST            BIT(2)
50 #define QOS_ENABLE                          BIT(4)
51 #define MAC80211_HDR_MIN_LEN                24
52 #define MAC80211_HDR_QOS_CTRL_LEN           2
53 #define MAC80211_HDR_ADDR4_LEN              6
54 #define WME_AC_BE                           0 /* best effort */
55 #define WME_AC_BK                           1 /* background */
56 #define WME_AC_VI                           2 /* video */
57 #define WME_AC_VO                           3 /* voice */
58 #define WME_AC_TO_TID(_ac)                  (((_ac) == WME_AC_VO) ? 6 : ((_ac) == WME_AC_VI) ? 5 : ((_ac) == WME_AC_BK) ? 1 : 0)
59 #define WME_AC_TO_QNUM(_ac)                 (((_ac) == WME_AC_BK) ? 0 : ((_ac) == WME_AC_BE) ? 1 : ((_ac) == WME_AC_VI) ? 2 : 3)
60 #define FC_TYPE_DATA                        BIT(3)
61 #define FC_SUBTYPE_QOS_DATA                 BIT(7)
62 #define FC_TO_DS                            BIT(8)
63 #define FC_FROM_DS                          BIT(9)
64 #define TX_DATA_CTRL_FLAG_QOS_BIT           BIT(1)
65 #define IS_QOS_PKT(ctrl_flags)              (ctrl_flags & TX_DATA_CTRL_FLAG_QOS_BIT)
66 #define IS_PEER_DS_SUPPORT_ENABLED(bitmap)  (bitmap & SL_SI91X_FEAT_TRANSCEIVER_MAC_PEER_DS_SUPPORT)
67 #define IS_4ADDR(ctrl_flags)                (ctrl_flags & BIT(0))
68 #define IS_FIXED_DATA_RATE(ctrl_flags)      (ctrl_flags & BIT(2))
69 #define IS_TODS(ctrl_flags)                 (ctrl_flags & BIT(3))
70 #define IS_FROMDS(ctrl_flags)               (ctrl_flags & BIT(4))
71 #define IS_CFM_TO_HOST_SET(ctrl_flags)      (ctrl_flags & BIT(5))
72 #define IS_BCAST_MCAST_MAC(addr)            (addr & BIT(0))
73 #define IS_MAC_ZERO(mac)                    (!(mac[0] | mac[1] | mac[2] | mac[3] | mac[4] | mac[5]))
74 #define MAX_RETRANSMIT_COUNT                15
75 #define MAX_CW_EXPN_COUNT                   15
76 #define MAX_AIFSN                           15
77 #define TRANSCEIVER_PEER_ADD_FLAG           BIT(0)
78 #define TRANSCEIVER_PEER_AUTO_RATE_FLAG     BIT(1)
79 #define TRANSCEIVER_MCAST_FILTER_EN         BIT(0)
80 #define TRANSCEIVER_MCAST_FILTER_ADDR_LIMIT 2
81 #define TRANSCEIVER_TX_DATA_EXT_DESC_SIZE   4
82 #define SL_STATUS_ACK_ERR                   0x1
83 #define SL_STATUS_CS_BUSY                   0x2
84 #define SL_STATUS_UNKNOWN_PEER              0x3
85 #define TRANSCEIVER_RX_PKT_TA_MATCH_BIT     BIT(20)
86 
87 /** @addtogroup SL_WIFI_CONSTANTS
88   * @{ */
89 #define SL_WIFI_TRANSCEIVER_CHANNEL_NO               14 ///< Wi-Fi transceiver default channel
90 #define SL_WIFI_TRANSCEIVER_TX_POWER                 20 ///< Wi-Fi transceiver default TX power
91 #define SL_WIFI_TRANSCEIVER_DEFAULT_RETRANSMIT_COUNT 15 ///< Wi-Fi transceiver default retransmit count
92 #define SL_WIFI_TRANSCEIVER_DEFAULT_QOS_BE_CWMIN     4  ///< Wi-Fi transceiver default BE cwmin contention param value
93 #define SL_WIFI_TRANSCEIVER_DEFAULT_QOS_BE_CWMAX     6  ///< Wi-Fi transceiver default BE cwmax contention param value
94 #define SL_WIFI_TRANSCEIVER_DEFAULT_QOS_BE_AIFSN     3  ///< Wi-Fi transceiver default BE aifsn contention param value
95 #define SL_WIFI_TRANSCEIVER_DEFAULT_QOS_BK_CWMIN     4  ///< Wi-Fi transceiver default BK cwmin contention param value
96 #define SL_WIFI_TRANSCEIVER_DEFAULT_QOS_BK_CWMAX     10 ///< Wi-Fi transceiver default BK cwmax contention param value
97 #define SL_WIFI_TRANSCEIVER_DEFAULT_QOS_BK_AIFSN     7  ///< Wi-Fi transceiver default BK aifsn contention param value
98 #define SL_WIFI_TRANSCEIVER_DEFAULT_QOS_VI_CWMIN     3  ///< Wi-Fi transceiver default VI cwmin contention param value
99 #define SL_WIFI_TRANSCEIVER_DEFAULT_QOS_VI_CWMAX     4  ///< Wi-Fi transceiver default VI cwmax contention param value
100 #define SL_WIFI_TRANSCEIVER_DEFAULT_QOS_VI_AIFSN     1  ///< Wi-Fi transceiver default VI aifsn contention param value
101 #define SL_WIFI_TRANSCEIVER_DEFAULT_QOS_VO_CWMIN     2  ///< Wi-Fi transceiver default VO cwmin contention param value
102 #define SL_WIFI_TRANSCEIVER_DEFAULT_QOS_VO_CWMAX     3  ///< Wi-Fi transceiver default VO cwmax contention param value
103 #define SL_WIFI_TRANSCEIVER_DEFAULT_QOS_VO_AIFSN     1  ///< Wi-Fi transceiver default VO aifsn contention param value
104 /** @} */
105 
106 /** @addtogroup SL_WIFI_TYPES Types
107   * @{ */
108 
109 /**
110  * @typedef sl_wifi_event_handler_t
111  * @brief Generic callback for handling Wi-Fi events.
112  *
113  * @param event
114  *   Wi-Fi event of type @ref sl_wifi_event_t.
115  * @param buffer
116  *   Pointer to a Wi-Fi buffer contains information related to the event, of type @ref sl_wifi_buffer_t
117  * @return
118  *   sl_status_t. See [Status Codes](https://docs.silabs.com/gecko-platform/latest/platform-common/status)
119  *   and [Additional Status Codes](../wiseconnect-api-reference-guide-err-codes/sl-additional-status-errors) for details.
120  * @note
121  *   In case of event failure, SL_WIFI_FAIL_EVENT_STATUS_INDICATION bit is set in the event.
122  *   The data would be of type sl_status_t, and data_length can be ignored.
123  */
124 typedef sl_status_t (*sl_wifi_event_handler_t)(sl_wifi_event_t event, sl_wifi_buffer_t *buffer);
125 
126 /// Wi-Fi credential handle
127 typedef uint32_t sl_wifi_credential_id_t;
128 
129 /**
130  * @struct sl_wifi_channel_t
131  * @brief Wi-Fi channel configuration.
132  */
133 typedef struct {
134   uint16_t channel;              ///< Channel number
135   sl_wifi_band_t band;           ///< Wi-Fi radio band of type @ref sl_wifi_band_t
136   sl_wifi_bandwidth_t bandwidth; ///< Channel bandwidth of type @ref sl_wifi_bandwidth_t
137 } sl_wifi_channel_t;
138 
139 /**
140  * @struct sl_wifi_ssid_t
141  * @brief SSID data structure.
142  *
143  * Specifies the Service Set Identifier (SSID) used in Wi-Fi networks.
144  */
145 typedef struct {
146   uint8_t value[32]; ///< SSID value
147   uint8_t length;    ///< Length of the SSID
148 } sl_wifi_ssid_t;
149 
150 /**
151  * @struct sl_wifi_roam_configuration_t
152  * @brief Wi-Fi roaming configuration structure.
153  */
154 typedef struct {
155   int32_t
156     trigger_level; ///< RSSI level to trigger the roam algorithm, setting the value to SL_WIFI_NEVER_ROAM will disable roaming configuration
157   uint32_t trigger_level_change; ///< RSSI level delta change to trigger the roam algorithm
158 } sl_wifi_roam_configuration_t;
159 
160 /**
161  * @struct sl_wifi_firmware_version_t
162  * @brief Wi-Fi firmware version information.
163  *
164  * Contains the detailed information about the Wi-Fi firmware version.
165  */
166 typedef struct {
167   uint8_t chip_id;          ///< Chip ID
168   uint8_t rom_id;           ///< ROM ID
169   uint8_t major;            ///< Major version number
170   uint8_t minor;            ///< Minor version number
171   uint8_t security_version; ///< Security enabled or disabled
172   uint8_t patch_num;        ///< Patch number
173   uint8_t customer_id;      ///< Customer ID
174   uint16_t build_num;       ///< Build number
175 } sl_wifi_firmware_version_t;
176 
177 /**
178  * @struct sl_wifi_scan_result_t
179  * @brief Wi-Fi scan result structure.
180  *
181  * Indicates the results of a Wi-Fi scan operation.
182  */
183 typedef struct {
184   uint32_t scan_count; ///< Number of available scan results
185   uint32_t reserved;   ///< Reserved
186   struct {
187     uint8_t rf_channel;    ///< Channel number of the AP
188     uint8_t security_mode; ///< Security mode of the AP
189     uint8_t rssi_val;      ///< RSSI value of the AP
190     uint8_t network_type;  ///< AP network type
191     uint8_t ssid[34];      ///< SSID of the AP
192     uint8_t bssid[6];      ///< BSSID of the AP
193     uint8_t reserved[2];   ///< Reserved
194   } scan_info[];           ///< Array of scan result data
195 } sl_wifi_scan_result_t;
196 
197 /// Extended Wi-Fi scan result
198 typedef struct {
199   uint8_t rf_channel;    ///< Channel number of the AP
200   uint8_t security_mode; ///< Security mode of the AP
201   uint8_t rssi;          ///< RSSI value of the AP
202   uint8_t network_type;  ///< Network type of the AP
203   uint8_t ssid[34];      ///< SSID of the AP
204   uint8_t bssid[6];      ///< BSSID of the AP
205 } sl_wifi_extended_scan_result_t;
206 
207 /// Extended Wi-Fi scan result parameters
208 typedef struct {
209   sl_wifi_extended_scan_result_t
210     *scan_results;         ///< Pointer to an array containing scan results of type @ref sl_wifi_extended_scan_result_t
211   uint16_t array_length;   ///< Length of the scan results array provided by the user.
212   uint16_t *result_count;  ///< Pointer to store the total count of scan results returned.
213   uint8_t *channel_filter; ///< Pointer to Channel number (Filter based on Channel number of the AP).
214   uint8_t *security_mode_filter; ///< Pointer to Security mode (Filter based on the Security mode of the AP).
215   uint8_t *rssi_filter; ///< Pointer to RSSI (Filter for APs with an RSSI greater than or equal to given RSSI value).
216   uint8_t *network_type_filter; ///< Pointer to Network type (Filter based on APs network type).
217 } sl_wifi_extended_scan_result_parameters_t;
218 
219 /**
220  * @struct sl_wifi_scan_configuration_t
221  * @brief Wi-Fi scan configuration structure.
222  *
223  * Indicates the configuration parameters for a Wi-Fi scan operation.
224  *
225  * @note The Quick Scan feature is enabled when a specific channel and SSID are given for scanning.
226  *       SiWx91x scans for the AP given in the scan API and posts the scan results immediately
227  *       after finding the access point.
228  * @note The `channel_bitmap_2g4` uses the lower 14 bits to represent channels from 1 to 14,
229  *       where channel 1 = (1 << 0), channel 2 = (1 << 1), and so on.
230  * @note 5GHz is not supported.
231  *
232  * | Channel Number 2.4 GHz | channel_bitmap_2g4    |
233  * |------------------------|-----------------------|
234  * | 1                      | (1 << 0)              |
235  * | 2                      | (1 << 1)              |
236  * | 3                      | (1 << 2)              |
237  * | 4                      | (1 << 3)              |
238  * | 5                      | (1 << 4)              |
239  * | 6                      | (1 << 5)              |
240  * | 7                      | (1 << 6)              |
241  * | 8                      | (1 << 7)              |
242  * | 9                      | (1 << 8)              |
243  * | 10                     | (1 << 9)              |
244  * | 11                     | (1 << 10)             |
245  * | 12                     | (1 << 11)             |
246  * | 13                     | (1 << 12)             |
247  * | 14                     | (1 << 13)             |
248  */
249 typedef struct {
250   sl_wifi_scan_type_t type;        ///< Scan type to be configured of type @ref sl_wifi_scan_type_t
251   uint32_t flags;                  ///< Reserved
252   uint32_t periodic_scan_interval; ///< Duration in milliseconds between periodic scans
253   uint16_t channel_bitmap_2g4;     ///< Bitmap of selected 2.4GHz channels
254   uint32_t channel_bitmap_5g[8];   ///< Bitmap of selected 5GHz channels (currently not supported)
255   uint8_t lp_mode;                 ///< Enable LP mode, 1 - Enable LP mode, 0 - Disable LP mode
256 } sl_wifi_scan_configuration_t;
257 
258 /**
259  * @struct sl_wifi_advanced_scan_configuration_t
260  * @brief Wi-Fi advanced scan configuration options.
261  *
262  * Indicates the configuration parameters for an advanced Wi-Fi scan operation.
263  */
264 typedef struct {
265   int32_t trigger_level;         ///< RSSI level to trigger advanced scan
266   uint32_t trigger_level_change; ///< RSSI level change to trigger advanced scan
267   uint16_t active_channel_time;  ///< Time spent on each channel during active scan (milliseconds)
268   uint16_t passive_channel_time; ///< Time spent on each channel during passive scan (milliseconds)
269   uint8_t enable_instant_scan;   ///< Flag to start advanced scan immediately
270   uint8_t
271     enable_multi_probe; ///< Flag to send multiple probes to AP. If the value is set to 1, a probe request would be sent to all access points in addition to the connected SSID.
272 } sl_wifi_advanced_scan_configuration_t;
273 
274 /**
275  * @struct sl_wifi_ap_configuration_t
276  * @brief Wi-Fi Access Point configuration structure.
277  *
278  * Indicates the configuration parameters for setting up a Wi-Fi Access Point (AP).
279  */
280 typedef struct {
281   sl_wifi_ssid_t ssid;                   ///< SSID (Service Set Identifier) of the Access Point
282   sl_wifi_security_t security;           ///< Security mode of the Access Point
283   sl_wifi_encryption_t encryption;       ///< Encryption mode of the Access Point
284   sl_wifi_channel_t channel;             ///< Channel configuration of the Access Point
285   sl_wifi_rate_protocol_t rate_protocol; ///< Rate protocol of the Access Point
286   sl_wifi_ap_flag_t options;             ///< Optional flags for AP configuration
287   sl_wifi_credential_id_t credential_id; ///< ID of secure credentials
288   uint8_t
289     keepalive_type; ///< Keep alive type of the access point. One of the values from [sl_si91x_ap_keepalive_type_t](../wiseconnect-api-reference-guide-si91x-driver/sl-si91-x-types#sl-si91x-ap-keepalive-type-t)
290   uint16_t beacon_interval;     ///< Beacon interval of the access point in milliseconds
291   uint32_t client_idle_timeout; ///< Duration in milliseconds to kick idle client
292   uint16_t dtim_beacon_count;   ///< Number of beacons per DTIM
293   uint8_t maximum_clients;      ///< Maximum number of associated clients
294   uint8_t beacon_stop;          ///< Flag to stop beaconing when there are no associated clients
295   sl_wifi_tdi_t
296     tdi_flags; ///< Flags to enable Transition Disable Indication (TDI). One of the values from @ref sl_wifi_tdi_t
297   uint8_t is_11n_enabled; ///< A flag to enable 11n.
298 } sl_wifi_ap_configuration_t;
299 
300 /**
301  * @struct sl_wifi_advanced_ap_configuration_t
302  * @brief Wi-Fi Access Point advanced configuration structure.
303  *
304  * Indicates the advanced configuration parameters for a Wi-Fi Access Point (AP).
305  */
306 typedef struct {
307   uint8_t csa_announcement_delay; ///< In beacon periods
308   uint32_t tbd;                   ///< Advanced configuration option to be added
309 } sl_wifi_advanced_ap_configuration_t;
310 
311 /**
312  * @struct sl_si91x_ap_reconfiguration_t
313  * @brief Wi-Fi Access Point dynamic configuration structure.
314  *
315  * Specifies the dynamic configuration parameters for a Wi-Fi Access Point (AP).
316  */
317 typedef struct {
318   uint8_t beacon_stop; ///< Beaconing control when no clients are connected
319 } sl_si91x_ap_reconfiguration_t;
320 
321 /**
322  * @struct sl_wifi_channel_bitmap_t
323  * @brief Channel bitmap for scanning in a set of selective channels.
324  *
325  * @note A 2.4 GHz channel is enabled by setting the bit of the corresponding channel number minus 1.
326  * For example, for channel 1, set bit 0;
327  				for channel 2, set bit 1, and so on. @ref sl_wifi_scan_configuration_t
328  * @note 5 GHz chnannels are not supported.
329  */
330 typedef struct {
331   uint16_t channel_bitmap_2_4; ///< Channel bitmap for scanning in a set of selective channels in 2.4 GHz.
332   uint32_t
333     channel_bitmap_5; ///< Channel bitmap for scanning in a set of selective channels in 5 GHz. (Currently not supported.)
334 } sl_wifi_channel_bitmap_t;
335 
336 /**
337  * @struct sl_wifi_client_configuration_t
338  * @brief Wi-Fi Client interface configuration structure.
339  *
340  * Defines the configuration parameters for a Wi-Fi client interface.
341  */
342 typedef struct {
343   sl_wifi_ssid_t ssid; ///< SSID (Service Set Identifier) of the Wi-Fi network. This is of type @ref sl_wifi_ssid_t
344   sl_wifi_channel_t channel; ///< The channel configuration of the Wi-Fi network. This is of type @ref sl_wifi_channel_t
345   sl_mac_address_t bssid;    ///< BSSID of the Wi-Fi network
346   sl_wifi_bss_type_t bss_type;     ///< BSS type of the Wi-Fi network
347   sl_wifi_security_t security;     ///< Security mode of type @ref sl_wifi_security_t
348   sl_wifi_encryption_t encryption; ///< Encryption mode of the Wi-Fi network. This is of type @ref sl_wifi_encryption_t
349   sl_wifi_client_flag_t client_options;  ///< Optional flags for client configuration of type @ref sl_wifi_client_flag_t
350   sl_wifi_credential_id_t credential_id; ///< ID of secure credentials of type @ref sl_wifi_credential_id_t
351   sl_wifi_channel_bitmap_t channel_bitmap; ///< Channel bitmap for scanning of type @ref sl_wifi_channel_bitmap_t
352 } sl_wifi_client_configuration_t;
353 
354 /**
355  * @struct sl_wifi_advanced_client_configuration_t
356  * @brief Wi-Fi Client interface advanced configuration structure.
357  */
358 typedef struct {
359   uint32_t max_retry_attempts;      ///< Maximum number of retries before indicating join failure
360   uint32_t scan_interval;           ///< Scan interval in seconds between each retry
361   uint32_t beacon_missed_count;     ///< Number of missed beacons that will trigger rejoin
362   uint32_t first_time_retry_enable; ///< Retry enable or disable for first time joining
363 } sl_wifi_advanced_client_configuration_t;
364 
365 /**
366  * @struct sl_wifi_psk_credential_t
367  * @brief Wi-Fi PSK (Pre-Shared Key) security credentials structure.
368  *
369  * Specifies the PSK security credentials used for Wi-Fi connections.
370  * The PSK is used for authenticating and securing the Wi-Fi connection.
371  */
372 typedef struct {
373   uint8_t value[SL_WIFI_MAX_PSK_LENGTH]; ///< PSK buffer
374 } sl_wifi_psk_credential_t;
375 
376 /**
377  * @struct sl_wifi_pmk_credential_t
378  * @brief Wi-Fi PMK (Pairwise Master Key) security credentials structure.
379  *
380  * Specifies the PMK security credentials used for Wi-Fi connections.
381  * The PMK is used for authenticating and securing the Wi-Fi connection.
382  */
383 typedef struct {
384   uint8_t value[SL_WIFI_MAX_PMK_LENGTH]; ///< PMK buffer
385 } sl_wifi_pmk_credential_t;
386 
387 /**
388  * @struct sl_wifi_wep_credential_t
389  * @brief Wi-Fi WEP (Wired Equivalent Privacy) security credentials structure.
390  *
391  * Specifies the WEP security credentials used for Wi-Fi connections.
392  * These keys are used for authenticating and securing the Wi-Fi connection.
393  */
394 typedef struct {
395   uint8_t index[2];                                           ///< Index of the active WEP key
396   uint8_t key[SL_WIFI_WEP_KEY_COUNT][SL_WIFI_WEP_KEY_LENGTH]; ///< WEP Keys
397 } sl_wifi_wep_credential_t;
398 
399 /**
400  * @struct sl_wifi_eap_credential_t
401  * @brief Wi-Fi Enterprise security credentials structure.
402  *
403  * Specifies the security credentials used for Wi-Fi Enterprise authentication.
404  */
405 typedef struct {
406   uint8_t username[SL_WIFI_EAP_USER_NAME_LENGTH];              ///< Enterprise User Name
407   uint8_t password[SL_WIFI_EAP_PASSWORD_LENGTH];               ///< Enterprise password
408   uint8_t certificate_key[SL_WIFI_EAP_CERTIFICATE_KEY_LENGTH]; ///< Certificate password
409   uint32_t certificate_id;                                     ///< Certificate Id for Enterprise authentication
410   /**
411 	   * @note
412      *  - BIT[0] of Opportunistic Key Caching (OKC) is used to enable or disable OKC:
413      *    - 0 – disable
414      *    - 1 – enable
415      *    When this is enabled, the module will use cached PMKID to get the Master Session Key (MSK), which is needed for generating PMK that is needed for the 4-way handshake.
416      * - BIT[1] of OKC is used to enable or disable CA certification for PEAP connection:
417      *   – 0 – CA certificate is not required
418      *   – 1 – CA certificate is required
419 	   * - BIT[2-12] of OKC argument are used for cipher list selection for EAP connection. All possible ciphers are listed below:
420 	   *       | BIT position| Cipher selected       |
421 	   *       |-------------|-----------------------|
422 	   *       | 2           | DHE-RSA-AES256-SHA256 |
423 	   *       | 3           | DHE-RSA-AES128-SHA256 |
424 	   *       | 4           | DHE-RSA-AES256-SHA    |
425 	   *       | 5           | DHE-RSA-AES128-SHA    |
426 	   *       | 6           | AES256-SHA256         |
427 	   *       | 7           | AES128-SHA256         |
428 	   *       | 8           | AES256-SHA            |
429 	   *       | 9           | AES128-SHA            |
430 	   *       | 10          | RC4-SHA               |
431 	   *       | 11          | DES-CBC3-SHA          |
432 	   *       | 12          | RC4-MD5               |
433 	   * - BIT[13-31] of OKC argument is reserved.
434 	   * @note If a user sets BIT[1] and does not provide the CA certificate for PEAP connection, an error is thrown. If a user provides an invalid CA certificate, an error is also thrown. A user can set either one or multiple bits from BIT[2-12] to provide the cipher list. If a user does not provide any values in OKC BIT[2-12], all ciphers are selected by default.
435 	   */
436   uint32_t eap_flags; ///< EAP Flags of type @ref sl_wifi_eap_client_flag_t
437 } sl_wifi_eap_credential_t;
438 
439 #if defined(__Keil)
440 #pragma anon_unions
441 #endif
442 
443 /**
444  * @struct sl_wifi_credential_t
445  * @brief Wi-Fi security credentials structure.
446  */
447 typedef struct {
448   sl_wifi_credential_type_t type; ///< Credential type
449   union {
450     sl_wifi_psk_credential_t psk; ///< WiFi Personal credentials
451     sl_wifi_pmk_credential_t pmk; ///< WiFi PMK credentials
452     sl_wifi_wep_credential_t wep; ///< WEP keys
453     sl_wifi_eap_credential_t eap; ///< Enterprise client credentials
454   };                              ///< WiFi Credential structure
455 } sl_wifi_credential_t;
456 
457 /**
458  * @struct sl_wifi_twt_request_t
459  * @brief TWT (Target Wake Time) request structure to configure a session.
460  */
461 typedef struct {
462   uint8_t wake_duration; ///< Nominal minimum wake duration. Range : 0 - 255
463   uint8_t
464     wake_duration_tol; ///< Tolerance allowed for wake duration in case of suggest TWT. Received TWT wake duration from AP will be validated against tolerance limits and decided if TWT config received is in acceptable range. Range : 0 - 255.
465   uint8_t wake_int_exp; ///< Wake interval exponent to the base 2. Range : 0 - 31.
466   uint8_t
467     wake_int_exp_tol; ///< Tolerance allowed for wake_int_exp in case of suggest TWT request. Received TWT wake interval exponent from AP will be validated against tolerance limits and decided if TWT config received is in acceptable range. Range : 0 - 31.
468   uint16_t wake_int_mantissa; ///< Wake interval mantissa. Range : 0 - 65535.
469   uint16_t
470     wake_int_mantissa_tol; ///< Tolerance allowed for wake_int_mantissa in case of suggest TWT. Received TWT wake interval mantissa from AP will be validated against tolerance limits and decided if TWT config received is in acceptable range. Range : 0 - 65535.
471   uint8_t
472     implicit_twt; ///< If enabled (1), the TWT requesting STA calculates the next TWT by adding a fixed value to the current TWT value. Explicit TWT is currently not allowed.
473   uint8_t
474     un_announced_twt; ///< If enabled (1), the TWT requesting STA does not announce its wake up to AP through PS-POLLs or UAPSD Trigger frames. Values : 0 or 1.
475   uint8_t
476     triggered_twt; ///< If enabled(1), at least one trigger frame is included in the TWT Service Period(TSP). Values : 0 or 1.
477   uint8_t negotiation_type; ///< Negotiation type : 0 - Individual TWT; 1 - Broadcast TWT.
478   uint8_t twt_channel;      ///< Currently this configuration is not supported. Range : 0 - 7.
479   uint8_t
480     twt_protection; ///< If enabled (1), TSP is protected. This is negotiable with AP. Currently this is not supported. Values : 0 or 1.
481   uint8_t twt_flow_id; ///< TWT session flow id. 0 - 7 valid. 0xFF to disable all active TWT sessions.
482   uint8_t
483     restrict_tx_outside_tsp;  ///< 1 - Any Tx outside the TSP is restricted. 0 - TX can happen outside the TSP also.
484   uint8_t twt_retry_limit;    ///< TWT retry limit. Range : 0 - 15.
485   uint8_t twt_retry_interval; ///< TWT retry interval in seconds between two twt requests. Range : 5 - 255.
486   uint8_t req_type;           ///< TWT request type. 0 - Request TWT; 1 - Suggest TWT; 2 - Demand TWT.
487   uint8_t twt_enable;         ///< TWT enable. 0 - TWT session teardown; 1 - TWT session setup.
488   uint8_t wake_duration_unit; ///< Wake duration unit. 0 - 256 microseconds ; 1 - 1024 microseconds.
489 } sl_wifi_twt_request_t;
490 
491 /**
492  * @struct sl_wifi_twt_selection_t
493  * @brief TWT (Target Wake Time) request structure to auto select a session.
494  */
495 typedef struct {
496   uint8_t twt_enable; ///< TWT enable. 0 - TWT session teardown; 1 - TWT session setup.
497   uint16_t
498     average_tx_throughput; ///< This is the expected average Tx throughput in Kbps. Value ranges from 0 to 10Mbps, which is half of the default [device_average_throughput](https://docs.silabs.com/wiseconnect/latest/wiseconnect-api-reference-guide-wi-fi/sl-wifi-twt-selection-t#device-average-throughput) (20Mbps by default).
499   uint32_t
500     tx_latency; ///< The allowed latency, in milliseconds, within which the given Tx operation is expected to be completed. If 0 is configured, maximum allowed Tx latency is same as rx_latency. Otherwise, valid values are in the range of [200ms - 6hrs].
501   uint32_t
502     rx_latency; ///< The maximum latency, in milliseconds, for receiving buffered packets from the AP. The device wakes up at least once for a TWT service period within the configured rx_latency if there are any pending packets destined for the device from the AP. If set to 0, the default latency of 2 seconds is used. Valid range is between 2 seconds to 6 hours. Recommended range is 2 seconds to 60 seconds to avoid connection failures with AP due to longer sleep time.
503   uint16_t
504     device_average_throughput; ///< Refers to the average Tx throughput that the device is capable of achieving in Kbps. The default value is 20Mbps. Internal SDK use only: do not use.
505   uint8_t
506     estimated_extra_wake_duration_percent; ///< The percentage by which wake duration is supposed to be overestimated to compensate for bss congestion. Recommended input range is 0 - 50%. The default value is 0. Internal SDK use only: do not use.
507   uint8_t
508     twt_tolerable_deviation; ///< The allowed deviation percentage of wake duration TWT response. Recommended input range is 0 - 50%. The default value is 10. Internal SDK use only: do not use.
509   uint32_t
510     default_wake_interval_ms; ///< Default minimum wake interval. Recommended Range: 512ms to 1024ms. The default value is 1024msec. Internal SDK use only: do not use.
511   uint32_t
512     default_minimum_wake_duration_ms; ///< Default minimum wake interval. Recommended Range: 8ms - 16ms. The default value is 8ms. Internal SDK use only: do not use.
513   uint8_t
514     beacon_wake_up_count_after_sp; ///< The number of beacons after the service period completion for which the module wakes up and listens for any pending RX. The default value is 2. Internal SDK use only: do not use.
515 } sl_wifi_twt_selection_t;
516 
517 /**
518  * @struct sl_wifi_reschedule_twt_config_t
519  * @brief TWT (Target Wake Time) reschedule configuration structure.
520  */
521 typedef struct {
522   uint8_t flow_id; ///< TWT session flow ID
523   sl_wifi_reschedule_twt_action_t
524     twt_action; ///< Specifies the action need to be taken for rescheduling the TWT session. This determines how and when the TWT session would be suspended or adjusted. See @ref sl_wifi_reschedule_twt_action_t for the possible actions.
525   uint16_t reserved1;        ///< Reserved
526   uint8_t reserved2;         ///< Reserved
527   uint64_t suspend_duration; ///< Duration to suspend the respective TWT session, in microseconds.
528 } sl_wifi_reschedule_twt_config_t;
529 
530 /**
531  * @struct sl_wifi_status_t
532  * @brief Wi-Fi device status structure.
533  *
534  * Indicates the status of various Wi-Fi functionalities on the device.
535  * It uses bit fields to indicate the status of different Wi-Fi modes and operations.
536  */
537 typedef struct {
538   uint8_t client_active : 1;       ///< WiFi Client active
539   uint8_t ap_active : 1;           ///< WiFi Access point active
540   uint8_t monitor_mode_active : 1; ///< WiFi promiscuous mode active
541   uint8_t wfd_go_active : 1;       ///< Reserved Status bit
542   uint8_t wfd_client_active : 1;   ///< Reserved Status bit
543   uint8_t scan_active : 1;         ///< Scan in Progress
544   uint8_t _reserved : 1;           ///< Reserved Status bit
545   uint8_t _reserved2 : 1;          ///< Reserved Status bit
546 } sl_wifi_status_t;
547 
548 /**
549  * @struct sl_wifi_statistics_t
550  * @brief Wi-Fi interface statistics structure.
551  */
552 typedef struct {
553   uint32_t beacon_lost_count; ///< Number of missed beacons
554   uint32_t beacon_rx_count;   ///< Number of received beacons
555   uint32_t mcast_rx_count;    ///< Multicast packets received
556   uint32_t mcast_tx_count;    ///< Multicast packets transmitted
557   uint32_t ucast_rx_count;    ///< Unicast packets received
558   uint32_t ucast_tx_count;    ///< Unicast packets transmitted
559   uint32_t
560     overrun_count; ///< Number of packets dropped either at ingress or egress, due to lack of buffer memory to retain all packets.
561 } sl_wifi_statistics_t;
562 
563 /**
564  * @struct sl_wifi_operational_statistics_t
565  * @brief Wi-Fi Operational Statistics structure.
566  */
567 typedef struct {
568   uint8_t operating_mode; ///< Operating mode of the Wi-Fi interface
569   uint8_t
570     dtim_period; ///< DTIM (Delivery Traffic Indication Message) period. Indicates the number of beacon intervals between DTIM frames
571   uint8_t ideal_beacon_info[2]; ///< Idle beacon information
572   uint8_t busy_beacon_info[2];  ///< Busy beacon information
573   uint8_t beacon_interval
574     [2]; ///< Beacon Interval. Indicates the time interval between successive beacons, in Time Units (TUs).
575 } sl_wifi_operational_statistics_t;
576 
577 /**
578  * @struct sl_wifi_p2p_configuration_t
579  * @brief Wi-Fi Direct (P2P) configuration structure.
580  */
581 typedef struct {
582   uint16_t group_owner_intent; ///< Group owner intent
583   const char *device_name;     ///< Device name
584   sl_wifi_channel_t channel;   ///< Wi-Fi channel. This is of type @ref sl_wifi_channel_t
585   char ssid_suffix[6];         ///< SSID suffix
586 } sl_wifi_p2p_configuration_t;
587 
588 /**
589  * @union sl_wifi_event_data_t
590  * @brief Wi-Fi event data.
591  *
592  * Indicates the data associated with a Wi-Fi event.
593  */
594 typedef union {
595   sl_wifi_scan_result_t scan_results; ///< Scan Result structure. This is of type @ref sl_wifi_scan_result_t
596   uint32_t join_status;               ///< Join status
597 } sl_wifi_event_data_t;
598 
599 /**
600  * @struct sl_wifi_wps_pin_t
601  * @brief Wi-Fi WPS PIN object that is an 8 digit number.
602  */
603 typedef struct {
604   char digits[8]; ///< Array to store digits of WPS Pin
605 } sl_wifi_wps_pin_t;
606 
607 /**
608  * @struct sl_wifi_listen_interval_t
609  * @brief Wi-Fi Listen interval structure.
610  *
611  * Specifies the Wi-Fi Listen interval in milliseconds.
612  * The listen interval is the time interval between two consecutive Target Beacon Transmission (TBTT) events.
613  */
614 typedef struct {
615   uint32_t listen_interval; ///< Wi-Fi Listen interval in millisecs
616 } sl_wifi_listen_interval_t;
617 
618 /**
619  * @struct sl_wifi_client_info_t
620  * @brief Wi-Fi client information structure.
621  *
622  * Indicates the MAC and IP address information related to a Wi-Fi client connected to the network.
623  */
624 typedef struct {
625   sl_mac_address_t mac_adddress; ///< MAC address of the client
626   sl_ip_address_t ip_address;    ///< IP address of client
627 } sl_wifi_client_info_t;
628 
629 /**
630  * @struct sl_wifi_client_info_response_t
631  * @brief Wi-Fi client information response structure.
632  */
633 typedef struct {
634   uint8_t client_count; ///< Indicates the total count of Wi-Fi clients currently connected to the network
635   sl_wifi_client_info_t client_info[SL_WIFI_MAX_CLIENT_COUNT]; ///< Array of client information
636 } sl_wifi_client_info_response_t;
637 
638 /**
639  * @struct sl_wifi_max_tx_power_t
640  * @brief Wi-Fi maximum transmit power structure.
641  *
642  * Indicates the maximum transmit power settings for the Wi-Fi interface.
643  *
644  * @note
645  * The effective transmit power is subject to regional and device limitations. If the specified transmit power exceeds the
646  * maximum supported value for that region, or if the specified transmit power exceeds the maximum supported value of the device,
647  * the transmission would occur at the maximum supported transmit power.
648  *
649  * @note
650  * There are three available configurations for join_tx_power: low, medium, and high, which correspond to the values 0, 1, and 2, respectively.
651  * Each configuration has a specified power level.
652  *     Low power (7 +/- 1) dBm
653  *     Medium power (10 +/- 1) dBm
654  *     High power (18 +/- 2) dBm
655  * An absolute power level can be set using the most significant bit (MSB) of an 8-bit value. This is achieved by setting the MSB to 128 (binary: 1000 0000).
656  * To configure the absolute transmission power, add the desired Tx power to 128.
657  * For example, setting the parameter to 148 (128 + 20) configures the transmission power to 20 dBm.
658  *
659  */
660 typedef struct {
661   uint8_t scan_tx_power; ///< Transmit power during scan. Valid input range: 1 dBm to 31 dBm
662   uint8_t join_tx_power; ///< Transmit power during join. Valid input range: 1 dBm to 31 dBm
663 } sl_wifi_max_tx_power_t;
664 
665 /**
666  * @struct sl_wifi_multicast_filter_info_t
667  * @brief Wi-Fi Multicast filter information structure.
668  */
669 typedef struct {
670   sl_wifi_multicast_filter_command_t
671     command_type; ///< Command type for multicast filter operation. Specifies the action to be taken (for example, add or remove a multicast filter). See @ref sl_wifi_multicast_filter_command_t for possible values.
672   sl_mac_address_t mac_address; ///< MAC address to which the filter has to be applied.
673 } sl_wifi_multicast_filter_info_t;
674 
675 /**
676  * @struct sl_wifi_tsf64_t
677  * @brief Wi-Fi station TSF (Timing Synchronization Function) structure.
678  *
679  * Contains the 64-bit TSF timer value for a Wi-Fi station.
680  */
681 typedef struct {
682   uint32_t tsf_l; ///< Lower 32 bits of the TSF timer. Used to store the Least Significant Bits (LSB) of the TSF
683   uint32_t tsf_m; ///< Upper 32 bits of the TSF timer. Used to store the Most Significant Bits (MSB) of the TSF.
684 } sl_wifi_tsf64_t;
685 
686 /**
687  * @struct sl_wifi_transceiver_tx_data_control_t
688  * @brief Control block structure used to hold metadata for the payload passed in @ref sl_wifi_send_transceiver_data.
689  *
690  * Contains control flags and other metadata for the payload.
691  * The control flags specify various options for the packet, such as whether it is a 4-address packet, a QoS packet, or if a fixed data rate should be used.
692  */
693 typedef struct {
694   /// Control flags bit description:
695   /// | Bit position | ctrl_flags bit description                                                                                                                     |
696   /// |--------------|------------------------------------------------------------------------------------------------------------------------------------------------|
697   /// | 0            | Should be set for 4-address packet or unset for 3-address packet. addr4 is ignored if set to 0.                                                 |
698   /// | 1            | Should be set for QoS packet. QoS control field shall not be present in the MAC header for non-QoS packet. priority is ignored if set to 0.     |
699   /// | 2            | Should be set to use the fixed data rate provided in the rate field. If set to 0, rate field is ignored and auto rate shall be used.            |
700   /// | 3            | Should be set to enable To DS bit in Frame Control. Valid only for 3-addr packet (bit 0 is unset).                                               |
701   /// | 4            | Should be set to enable From DS bit in Frame Control. Valid only for 3-addr packet (bit 0 is unset).                                             |
702   /// | 5            | Should be set if host requires TX data status report. Token is used for synchronization between data packets sent and reports received.         |
703   /// | 6:7          | Reserved.                                                                                                                                      |
704   /// @note If addr1 is multicast/broadcast, ctrl_flags bit 1 is ignored, and the frame is sent as a non-QoS frame, that is, QoS control field should not be present in the MAC header.
705   uint8_t ctrl_flags;
706   uint8_t reserved1; ///< Reserved
707   uint8_t reserved2; ///< Reserved
708   uint8_t
709     priority; ///< Data Packets are queued to respective queue based on priority. Best Effort - 0, Background - 1, Video - 2, Voice - 3
710   sl_wifi_data_rate_t
711     rate; ///< Rates shall be provided as per @ref sl_wifi_data_rate_t. Only 11b/g rates shall be supported
712   uint32_t
713     token; ///< Used for synchronization between data packets sent and reports received. Application shall provide token/identifier as per PPDU. MAC layer sends the same token/identifier in status report along with the status of the transmitted packet
714   uint8_t addr1[6]; ///< Receiver MAC address
715   uint8_t addr2[6]; ///< Transmitter MAC address
716   uint8_t addr3[6]; ///< Destination MAC address
717   uint8_t addr4[6]; ///< Source MAC address. Initialization of addr4 is optional
718 } sl_wifi_transceiver_tx_data_control_t;
719 
720 /**
721  * @struct sl_wifi_transceiver_cw_config_t
722  * @brief Wi-Fi transceiver contention window configuration structure.
723  *
724  * Specifies the configuration parameters for the contention window of the Wi-Fi transceiver.
725  */
726 typedef struct {
727   uint8_t
728     cwmin; ///< Minimum contention window size. Value is calculated from 2^N - 1 where exponent is provided as the input. Valid values for exponent N are 0 - 15
729   uint8_t
730     cwmax; ///< Maximum contention window size. Value is calculated from 2^N - 1 where exponent is provided as the input. Valid values for exponent N are 0 - 15
731   uint8_t aifsn;    ///< Arbitration Inter-Frame Space Number (AIFSN). Valid range is 0 to 15
732   uint8_t reserved; ///< Reserved
733 } sl_wifi_transceiver_cw_config_t;
734 
735 /**
736  * @struct sl_wifi_transceiver_parameters_t
737  * @brief Wi-Fi transceiver parameters structure.
738  *
739  * Specifies the configuration parameters for a Wi-Fi transceiver.
740  */
741 typedef struct {
742   uint8_t
743     set; ///< Set to 1 to configure the transceiver config params in MAC layer. Sets to 0 to query the transceiver config params from MAC layer
744   uint8_t
745     retransmit_count; ///< Retransmit count. Common across all peers and access categories and valid only for unicast data frames. Valid range is 1 to 15
746   uint16_t flags;     ///< Reserved
747   sl_wifi_transceiver_cw_config_t
748     cw_params[4]; ///< CW params for respective queues. AC index: Best Effort - 0, Background - 1, Video - 2, Voice - 3
749 } sl_wifi_transceiver_parameters_t;
750 
751 /**
752  * @struct sl_wifi_transceiver_set_channel_t
753  * @brief Wi-Fi transceiver channel information structure.
754  *
755  * Indicates the channel information for the Wi-Fi transceiver.
756  */
757 typedef struct {
758   sl_wifi_channel_t chan_info; ///< Channel information
759   uint8_t tx_power;            ///< Maximum transmission power
760 } sl_wifi_transceiver_set_channel_t;
761 
762 /**
763  * @struct sl_wifi_transceiver_peer_update_t
764  * @brief Wi-Fi transceiver peer update structure.
765  *
766  * Defines the configuration parameters for adding or deleting a peer in the Wi-Fi transceiver.
767  * The peer can be added or deleted based on the MAC address.
768  */
769 typedef struct {
770   /// | Bit position | Flags bit description                                                                                              |
771   /// |--------------|--------------------------------------------------------------------------------------------------------------------|
772   /// | 0            | Shall be set to add the peer, else reset to 0 to delete the peer.                                                  |
773   /// | 1            | Shall be set for auto-rate enable. To enable auto-rate, application needs to provide peer_supported_rate_bitmap    |
774   uint8_t flags;
775   /// MAC address of peer to be added or deleted.
776   uint8_t peer_mac_address[6];
777   /// Rate bitmap of peer station
778   /// | peer_supported_rate_bitmap | Data rate  |
779   /// | :--------------------------| :----------|
780   /// | BIT(0)                     | 1 Mbps     |
781   /// | BIT(1)                     | 2 Mbps     |
782   /// | BIT(2)                     | 5.5 Mbps   |
783   /// | BIT(3)                     | 11 Mbps    |
784   /// | BIT(4)                     | 6 Mbps     |
785   /// | BIT(5)                     | 9 Mbps     |
786   /// | BIT(6)                     | 12 Mbps    |
787   /// | BIT(7)                     | 18 Mbps    |
788   /// | BIT(8)                     | 24 Mbps    |
789   /// | BIT(9)                     | 36 Mbps    |
790   /// | BIT(10)                    | 48 Mbps    |
791   /// | BIT(11)                    | 54 Mbps    |
792   /// | BIT(12:31)                 | Reserved   |
793   uint32_t peer_supported_rate_bitmap;
794 } sl_wifi_transceiver_peer_update_t;
795 
796 /**
797  * @struct sl_wifi_transceiver_mcast_filter_t
798  * @brief Wi-Fi transceiver multicast filter structure.
799  *
800  * Defines the configuration parameters for enabling or disabling multicast filtering in the Wi-Fi transceiver.
801  */
802 typedef struct {
803   uint8_t
804     flags; ///< Bit 0 is set to 1 to enable filtering for the specified MAC addresses, else set to 0 to disable filtering
805   uint8_t
806     num_of_mcast_addr; ///< Number of multicast addresses. Valid values are 1, and 2. This field is ignored when filtering is disabled
807   uint8_t mac[2][6]; ///< List of multicast addresses. This field is ignored when filtering is disabled
808 } sl_wifi_transceiver_mcast_filter_t;
809 
810 /**
811  * @struct sl_wifi_transceiver_configuration_t
812  * @brief Wi-Fi transceiver interface configuration structure.
813  */
814 typedef struct {
815   sl_wifi_transceiver_set_channel_t
816     channel; ///< Channel information. See @ref sl_wifi_transceiver_set_channel_t for details on channel settings.
817   sl_mac_address_t dut_mac; ///< DUT MAC address
818   sl_wifi_transceiver_parameters_t
819     parameters; ///< Transceiver parameters. See @ref sl_wifi_transceiver_parameters_t for details on transceiver settings
820 } sl_wifi_transceiver_configuration_t;
821 
822 /**
823  * @struct sl_wifi_transceiver_tx_data_confirmation_t
824  * @brief Wi-Fi transceiver TX data confirmation structure.
825  *
826  * Indicates the status report for a transmitted data packet identified by a token.
827  */
828 typedef struct {
829   /// Status report for the data packet identified by token.
830   /// | Status                       | Description                                                                                                                         |
831   /// | :----------------------------| :-----------------------------------------------------------------------------------------------------------------------------------|
832   /// | SL_STATUS_OK (0x0)           | Received Ack                                                                                                                        |
833   /// | SL_STATUS_ACK_ERR (0x1)      | Ack error                                                                                                                           |
834   /// | SL_STATUS_CS_BUSY (0x2)      | Carrier sense busy                                                                                                                  |
835   /// | SL_STATUS_UNKNOWN_PEER (0x3) | If @ref sl_wifi_send_transceiver_data was called for a peer that was not added or was deleted before the data packet was sent out.  |
836   sl_status_t status;
837   /// Rate at which data packet has been sent. Rate is invalid if error is SL_STATUS_CS_BUSY or SL_STATUS_UNKNOWN_PEER.
838   uint32_t rate;
839   /// Priority used for the data packet from control->priority in the corresponding call to @ref sl_wifi_send_transceiver_data.
840   uint8_t priority;
841   /// Data packet identifier from control->token value passed in the corresponding call to @ref sl_wifi_send_transceiver_data.
842   uint32_t token;
843 } sl_wifi_transceiver_tx_data_confirmation_t;
844 
845 /**
846  * @struct sl_wifi_transceiver_rx_data_t
847  * @brief Structure for handling received Wi-Fi transceiver data.
848  *
849  * Contains information about the received Wi-Fi transceiver data, which includes status, RSSI, data rate, length, and the actual data buffer.
850  */
851 typedef struct {
852   /// Status code for the received RX packet.
853   /// | Status                       | Description                                                                                                                          |
854   /// | :----------------------------| :------------------------------------------------------------------------------------------------------------------------------------|
855   /// | SL_STATUS_OK (0x0)           | Success                                                                                                                              |
856   /// | SL_STATUS_UNKNOWN_PEER (0x3) | If SL_SI91X_FEAT_TRANSCEIVER_MAC_PEER_DS_SUPPORT feature is enabled and data packet is received from a peer not present in MAC layer |
857   sl_status_t status;
858   /// RSSI of the received 802.11 frame. This field is valid only if status is set to success.
859   int8_t rssi;
860   /// Rate of the received 802.11 frame as per @ref sl_wifi_data_rate_t. This field is valid only if status is set to success.
861   uint32_t rate;
862   /// Length of the buffer.
863   uint32_t length;
864   /// IEEE 802.11 frame received from firmware. `buffer` points to the beginning of the MAC header. Contents are not valid once the function returns. If the contents need to be accessed after return, it needs to be copied to the application buffer. If the status is not successful, buffer is set to NULL and shall not be accessed.
865   ///
866   /// *Format of IEEE 802.11 frame received from firmware in buffer*
867   /// | Field name | Frame Control  | Duration | Addr1 | Addr2 | Adddr3 | Seq Ctrl | Addr4                  | QoS ctrl              | Payload (LLC + Data)  |
868   /// |:-----------|:---------------|:---------|:------|:------|:-------|:---------|:-----------------------|:----------------------|:----------------------|
869   /// | Size(bytes)| 2              | 2        | 6     | 6     | 6      | 2        | 6 (Optionally present) | 2 (Optionally present)| Variable              |
870   /// @note All unicast data frames received where Address 1 (RA) matches the device MAC address are passed to the host application.
871   /// @note All broadcast data frames are sent to the host.
872   /// @note All multicast data frames are sent to the host unless filtering is enabled using @ref sl_wifi_set_transceiver_multicast_filter.
873   /// @note On chip duplicate detection is not supported and is expected to be handled by the application.
874   /// @note On chip MAC level decryption is not supported.
875   uint8_t *buffer;
876 } sl_wifi_transceiver_rx_data_t;
877 
878 /** @} */
879