1 /*
2  * wlan.h - CC31xx/CC32xx Host Driver Implementation
3  *
4  * Copyright (C) 2017 Texas Instruments Incorporated - http://www.ti.com/
5  *
6  *
7  *  Redistribution and use in source and binary forms, with or without
8  *  modification, are permitted provided that the following conditions
9  *  are met:
10  *
11  *    Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  *
14  *    Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the
17  *    distribution.
18  *
19  *    Neither the name of Texas Instruments Incorporated nor the names of
20  *    its contributors may be used to endorse or promote products derived
21  *    from this software without specific prior written permission.
22  *
23  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26  *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27  *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28  *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31  *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  *
35 */
36 
37 
38 
39 /*****************************************************************************/
40 /* Include files                                                             */
41 /*****************************************************************************/
42 #include <ti/drivers/net/wifi/simplelink.h>
43 
44 #ifndef __WLAN_H__
45 #define __WLAN_H__
46 
47 
48 #ifdef    __cplusplus
49 extern "C" {
50 #endif
51 
52 
53 /*****************************************************************************/
54 /* Macro declarations                                                        */
55 /*****************************************************************************/
56 /*!
57     \defgroup Wlan
58     \short Controls the use of the WiFi WLAN module
59 
60 */
61 /*!
62 
63     \addtogroup Wlan
64     - Connection features, such as: profiles, policies, SmartConfig(tm)
65     - Advanced WLAN features, such as: scans, rx filters and rx statistics collection
66 
67     @{
68 
69 */
70 
71 #define SL_WLAN_BSSID_LENGTH                    (6)
72 #define SL_WLAN_SSID_MAX_LENGTH                 (32)
73 
74 #define SL_WLAN_NUM_OF_RATE_INDEXES             (20)
75 #define SL_WLAN_SIZE_OF_RSSI_HISTOGRAM          (6)
76 #define SL_WLAN_SMART_CONFIG_KEY_LENGTH         (16)
77 #define SL_WLAN_SMART_CONFIG_DEFAULT_CIPHER     (1)
78 #define SL_WLAN_SMART_CONFIG_DEFAULT_GROUP      (0)
79 
80 #define SL_WLAN_MAX_PROFILES                    (7)
81 #define SL_WLAN_DEL_ALL_PROFILES                (255)
82 
83 typedef enum
84 {
85     SL_WLAN_P2P_WPS_METHOD_DEFAULT,
86     SL_WLAN_P2P_WPS_METHOD_PIN_USER,
87     SL_WLAN_P2P_WPS_METHOD_PIN_MACHINE,
88     SL_WLAN_P2P_WPS_METHOD_REKEY,
89     SL_WLAN_P2P_WPS_METHOD_PBC,
90     SL_WLAN_P2P_WPS_METHOD_REGISTRAR
91 } SlWlanP2PWpsMethod_e;
92 
93 /* WLAN user events */
94 typedef enum
95 {
96     SL_WLAN_EVENT_CONNECT = 1,
97     SL_WLAN_EVENT_DISCONNECT,
98     SL_WLAN_EVENT_STA_ADDED,
99     SL_WLAN_EVENT_STA_REMOVED,
100 
101     SL_WLAN_EVENT_P2P_CONNECT,
102     SL_WLAN_EVENT_P2P_DISCONNECT,
103     SL_WLAN_EVENT_P2P_CLIENT_ADDED,
104     SL_WLAN_EVENT_P2P_CLIENT_REMOVED,
105     SL_WLAN_EVENT_P2P_DEVFOUND,
106     SL_WLAN_EVENT_P2P_REQUEST,
107     SL_WLAN_EVENT_P2P_CONNECTFAIL,
108 
109     SL_WLAN_EVENT_RXFILTER,
110     SL_WLAN_EVENT_PROVISIONING_STATUS,
111     SL_WLAN_EVENT_PROVISIONING_PROFILE_ADDED,
112     SL_WLAN_EVENT_LINK_QUALITY_TRIGGER,
113     SL_WLAN_EVENT_MAX
114 
115 } SlWlanEventId_e;
116 
117 
118 /* WLAN Disconnect Reason Codes */
119 #define  SL_WLAN_DISCONNECT_UNSPECIFIED                                         (1)
120 #define  SL_WLAN_DISCONNECT_AUTH_NO_LONGER_VALID                                (2)
121 #define  SL_WLAN_DISCONNECT_DEAUTH_SENDING_STA_LEAVING                          (3)
122 #define  SL_WLAN_DISCONNECT_INACTIVITY                                          (4)
123 #define  SL_WLAN_DISCONNECT_TOO_MANY_STA                                        (5)
124 #define  SL_WLAN_DISCONNECT_FRAME_FROM_NONAUTH_STA                              (6)
125 #define  SL_WLAN_DISCONNECT_FRAME_FROM_NONASSOC_STA                             (7)
126 #define  SL_WLAN_DISCONNECT_DISS_SENDING_STA_LEAVING                            (8)
127 #define  SL_WLAN_DISCONNECT_STA_NOT_AUTH                                        (9)
128 #define  SL_WLAN_DISCONNECT_POWER_CAPABILITY_INVALID                            (10)
129 #define  SL_WLAN_DISCONNECT_SUPPORTED_CHANNELS_INVALID                          (11)
130 #define  SL_WLAN_DISCONNECT_INVALID_IE                                          (13)
131 #define  SL_WLAN_DISCONNECT_MIC_FAILURE                                         (14)
132 #define  SL_WLAN_DISCONNECT_FOURWAY_HANDSHAKE_TIMEOUT                           (15)
133 #define  SL_WLAN_DISCONNECT_GROUPKEY_HANDSHAKE_TIMEOUT                          (16)
134 #define  SL_WLAN_DISCONNECT_REASSOC_INVALID_IE                                  (17)
135 #define  SL_WLAN_DISCONNECT_INVALID_GROUP_CIPHER                                (18)
136 #define  SL_WLAN_DISCONNECT_INVALID_PAIRWISE_CIPHER                             (19)
137 #define  SL_WLAN_DISCONNECT_INVALID_AKMP                                        (20)
138 #define  SL_WLAN_DISCONNECT_UNSUPPORTED_RSN_VERSION                             (21)
139 #define  SL_WLAN_DISCONNECT_INVALID_RSN_CAPABILITIES                            (22)
140 #define  SL_WLAN_DISCONNECT_IEEE_802_1X_AUTHENTICATION_FAILED                   (23)
141 #define  SL_WLAN_DISCONNECT_CIPHER_SUITE_REJECTED                               (24)
142 #define  SL_WLAN_DISCONNECT_DISASSOC_QOS                                        (32)
143 #define  SL_WLAN_DISCONNECT_DISASSOC_QOS_BANDWIDTH                              (33)
144 #define  SL_WLAN_DISCONNECT_DISASSOC_EXCESSIVE_ACK_PENDING                      (34)
145 #define  SL_WLAN_DISCONNECT_DISASSOC_TXOP_LIMIT                                 (35)
146 #define  SL_WLAN_DISCONNECT_STA_LEAVING                                         (36)
147 #define  SL_WLAN_DISCONNECT_STA_DECLINED                                        (37)
148 #define  SL_WLAN_DISCONNECT_STA_UNKNOWN_BA                                      (38)
149 #define  SL_WLAN_DISCONNECT_STA_TIMEOUT                                         (39)
150 #define  SL_WLAN_DISCONNECT_STA_UNSUPPORTED_CIPHER_SUITE                        (40)
151 #define  SL_WLAN_DISCONNECT_ROAMING_TRIGGER_NONE                                (100)
152 #define  SL_WLAN_DISCONNECT_ROAMING_TRIGGER_LOW_TX_RATE                         (104)
153 #define  SL_WLAN_DISCONNECT_ROAMING_TRIGGER_LOW_SNR                             (105)
154 #define  SL_WLAN_DISCONNECT_ROAMING_TRIGGER_LOW_QUALITY                         (106)
155 #define  SL_WLAN_DISCONNECT_ROAMING_TRIGGER_TSPEC_REJECTED                      (107)
156 #define  SL_WLAN_DISCONNECT_ROAMING_TRIGGER_MAX_TX_RETRIES                      (108)
157 #define  SL_WLAN_DISCONNECT_ROAMING_TRIGGER_BSS_LOSS                            (109)
158 #define  SL_WLAN_DISCONNECT_ROAMING_TRIGGER_BSS_LOSS_DUE_TO_MAX_TX_RETRY        (110)
159 #define  SL_WLAN_DISCONNECT_ROAMING_TRIGGER_SWITCH_CHANNEL                      (111)
160 #define  SL_WLAN_DISCONNECT_ROAMING_TRIGGER_AP_DISCONNECT                       (112)
161 #define  SL_WLAN_DISCONNECT_ROAMING_TRIGGER_SECURITY_ATTACK                     (113)
162 #define  SL_WLAN_DISCONNECT_USER_INITIATED                                      (200)
163 #define  SL_WLAN_DISCONNECT_AUTH_TIMEOUT                                        (202)
164 #define  SL_WLAN_DISCONNECT_ASSOC_TIMEOUT                                       (203)
165 #define  SL_WLAN_DISCONNECT_SECURITY_FAILURE                                    (204)
166 #define  SL_WLAN_DISCONNECT_WHILE_CONNNECTING                                   (208)
167 #define  SL_WLAN_DISCONNECT_MISSING_CERT                                        (209)
168 #define  SL_WLAN_DISCONNECT_CERTIFICATE_EXPIRED                                 (210)
169 
170 
171 
172 #define  SL_WLAN_STATUS_DISCONNECTED    (0)
173 #define  SL_WLAN_STATUS_SCANING         (1)
174 #define  SL_WLAN_STATUS_CONNECTING      (2)
175 #define  SL_WLAN_STATUS_CONNECTED       (3)
176 
177 #define SL_WLAN_PROVISIONING_GENERAL_ERROR                                           (0)
178 #define SL_WLAN_PROVISIONING_CONFIRMATION_STATUS_FAIL_NETWORK_NOT_FOUND              (1)
179 #define SL_WLAN_PROVISIONING_CONFIRMATION_STATUS_FAIL_CONNECTION_FAILED              (2)
180 #define SL_WLAN_PROVISIONING_CONFIRMATION_STATUS_CONNECTION_SUCCESS_IP_NOT_ACQUIRED  (3)
181 #define SL_WLAN_PROVISIONING_CONFIRMATION_STATUS_SUCCESS_FEEDBACK_FAILED             (4)
182 #define SL_WLAN_PROVISIONING_CONFIRMATION_STATUS_SUCCESS                             (5)
183 #define SL_WLAN_PROVISIONING_ERROR_ABORT                                             (6)
184 #define SL_WLAN_PROVISIONING_ERROR_ABORT_INVALID_PARAM                               (7)
185 #define SL_WLAN_PROVISIONING_ERROR_ABORT_HTTP_SERVER_DISABLED                        (8)
186 #define SL_WLAN_PROVISIONING_ERROR_ABORT_PROFILE_LIST_FULL                           (9)
187 #define SL_WLAN_PROVISIONING_ERROR_ABORT_PROVISIONING_ALREADY_STARTED                (10)
188 #define SL_WLAN_PROVISIONING_AUTO_STARTED                                            (11)
189 #define SL_WLAN_PROVISIONING_STOPPED                                                 (12)
190 #define SL_WLAN_PROVISIONING_SMART_CONFIG_SYNCED                                     (13)
191 #define SL_WLAN_PROVISIONING_SMART_CONFIG_SYNC_TIMEOUT                               (14)
192 #define SL_WLAN_PROVISIONING_CONFIRMATION_WLAN_CONNECT                               (15)
193 #define SL_WLAN_PROVISIONING_CONFIRMATION_IP_ACQUIRED                                (16)
194 #define SL_WLAN_PROVISIONING_EXTERNAL_CONFIGURATION_READY                            (17)
195 
196 #define SL_WLAN_SEC_TYPE_OPEN                                                        (0)
197 #define SL_WLAN_SEC_TYPE_WEP                                                         (1)
198 #define SL_WLAN_SEC_TYPE_WPA                                                         (2) /* deprecated */
199 #define SL_WLAN_SEC_TYPE_WPA_WPA2                                                    (2)
200 #define SL_WLAN_SEC_TYPE_WPS_PBC                                                     (3)
201 #define SL_WLAN_SEC_TYPE_WPS_PIN                                                     (4)
202 #define SL_WLAN_SEC_TYPE_WPA_ENT                                                     (5)
203 #define SL_WLAN_SEC_TYPE_P2P_PBC                                                     (6)
204 #define SL_WLAN_SEC_TYPE_P2P_PIN_KEYPAD                                              (7)
205 #define SL_WLAN_SEC_TYPE_P2P_PIN_DISPLAY                                             (8)
206 #define SL_WLAN_SEC_TYPE_P2P_PIN_AUTO                                                (9) /* NOT Supported yet */
207 #define SL_WLAN_SEC_TYPE_WEP_SHARED                                                  (10)
208 #define SL_WLAN_SEC_TYPE_WPA2_PLUS                                                   (11) /* Support to WPA3\WPA2\WPA2+PMF (Protected Managmant Frame) networks */
209 #define SL_WLAN_SEC_TYPE_WPA3                                                        (12) /* Support WPA3 only networks */
210 #define SL_WLAN_SEC_TYPE_WPA_PMK                                                     (15)
211 
212 #define SL_TLS                                                                       (0x1)
213 #define SL_MSCHAP                                                                    (0x0)
214 #define SL_PSK                                                                       (0x2)
215 #define SL_TTLS                                                                      (0x10)
216 #define SL_PEAP0                                                                     (0x20)
217 #define SL_PEAP1                                                                     (0x40)
218 #define SL_FAST                                                                      (0x80)
219 
220 #define SL_WLAN_FAST_AUTH_PROVISIONING                                               (0x02)
221 #define SL_WLAN_FAST_UNAUTH_PROVISIONING                                             (0x01)
222 #define SL_WLAN_FAST_NO_PROVISIONING                                                 (0x00)
223 
224 #define SL_WLAN_PROVISIONING_CMD_START_MODE_AP                                       (0)
225 #define SL_WLAN_PROVISIONING_CMD_START_MODE_SC                                       (1)
226 #define SL_WLAN_PROVISIONING_CMD_START_MODE_APSC                                     (2)
227 #define SL_WLAN_PROVISIONING_CMD_START_MODE_APSC_EXTERNAL_CONFIGURATION              (3)
228 #define SL_WLAN_PROVISIONING_CMD_STOP                                                (4)
229 #define SL_WLAN_PROVISIONING_CMD_ABORT_EXTERNAL_CONFIRMATION                         (5)
230 
231 /* Provisioning API Flags */
232 #define SL_WLAN_PROVISIONING_CMD_FLAG_EXTERNAL_CONFIRMATION                          (0x00000001)
233 
234 /* to be used only in provisioning stop command */
235 #define SL_WLAN_PROVISIONING_REMAIN_IN_CURRENT_ROLE                                  (0xFF)
236 
237 
238 #define SL_WLAN_EAPMETHOD_PHASE2_SHIFT                                               (8)
239 #define SL_WLAN_EAPMETHOD_PAIRWISE_CIPHER_SHIFT                                      (19)
240 #define SL_WLAN_EAPMETHOD_GROUP_CIPHER_SHIFT                                         (27)
241 
242 #define SL_WLAN_WPA_CIPHER_CCMP                                                      (0x1)
243 #define SL_WLAN_WPA_CIPHER_TKIP                                                      (0x2)
244 #define SL_WLAN_CC31XX_DEFAULT_CIPHER                                                (SL_WLAN_WPA_CIPHER_CCMP | SL_WLAN_WPA_CIPHER_TKIP)
245 
246 #define SL_WLAN_EAPMETHOD(phase1,phase2,pairwise_cipher,group_cipher)      \
247                                                     ((phase1) | \
248                                                     ((phase2) << SL_WLAN_EAPMETHOD_PHASE2_SHIFT ) |\
249                                                     ((_u32)(pairwise_cipher) << SL_WLAN_EAPMETHOD_PAIRWISE_CIPHER_SHIFT ) |\
250                                                     ((_u32)(group_cipher) << SL_WLAN_EAPMETHOD_GROUP_CIPHER_SHIFT ))
251 
252 /*                                                                         phase1    phase2                                     pairwise_cipher               group_cipher         */
253 #define SL_WLAN_ENT_EAP_METHOD_TLS                       SL_WLAN_EAPMETHOD(SL_TLS,   0,                                 SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
254 #define SL_WLAN_ENT_EAP_METHOD_TTLS_TLS                  SL_WLAN_EAPMETHOD(SL_TTLS,  SL_TLS,                            SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
255 #define SL_WLAN_ENT_EAP_METHOD_TTLS_MSCHAPv2             SL_WLAN_EAPMETHOD(SL_TTLS,  SL_MSCHAP,                         SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
256 #define SL_WLAN_ENT_EAP_METHOD_TTLS_PSK                  SL_WLAN_EAPMETHOD(SL_TTLS,  SL_PSK,                            SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
257 #define SL_WLAN_ENT_EAP_METHOD_PEAP0_TLS                 SL_WLAN_EAPMETHOD(SL_PEAP0, SL_TLS,                            SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
258 #define SL_WLAN_ENT_EAP_METHOD_PEAP0_MSCHAPv2            SL_WLAN_EAPMETHOD(SL_PEAP0, SL_MSCHAP,                         SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
259 #define SL_WLAN_ENT_EAP_METHOD_PEAP0_PSK                 SL_WLAN_EAPMETHOD(SL_PEAP0, SL_PSK,                            SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
260 #define SL_WLAN_ENT_EAP_METHOD_PEAP1_TLS                 SL_WLAN_EAPMETHOD(SL_PEAP1, SL_TLS,                            SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
261 #define SL_WLAN_ENT_EAP_METHOD_PEAP1_PSK                 SL_WLAN_EAPMETHOD(SL_PEAP1, SL_PSK,                            SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
262 #define SL_WLAN_ENT_EAP_METHOD_FAST_AUTH_PROVISIONING    SL_WLAN_EAPMETHOD(SL_FAST,  SL_WLAN_FAST_AUTH_PROVISIONING,    SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
263 #define SL_WLAN_ENT_EAP_METHOD_FAST_UNAUTH_PROVISIONING  SL_WLAN_EAPMETHOD(SL_FAST,  SL_WLAN_FAST_UNAUTH_PROVISIONING,  SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
264 #define SL_WLAN_ENT_EAP_METHOD_FAST_NO_PROVISIONING      SL_WLAN_EAPMETHOD(SL_FAST,  SL_WLAN_FAST_NO_PROVISIONING,      SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
265 
266 #define SL_WLAN_LONG_PREAMBLE                         (0)
267 #define SL_WLAN_SHORT_PREAMBLE                        (1)
268 
269 /* 2.4G - 1 bit band = 0 , 5 remaining bits for channel (1..14) */
270 #define SL_WLAN_RAW_RF_TX_PARAMS_CHANNEL_SHIFT        (0)
271 #define SL_WLAN_RAW_RF_TX_PARAMS_BAND_SHIFT           (5)
272 #define SL_WLAN_RAW_RF_TX_PARAMS_RATE_SHIFT           (6)
273 #define SL_WLAN_RAW_RF_TX_PARAMS_POWER_SHIFT          (11)
274 #define SL_WLAN_RAW_RF_TX_PARAMS_PREAMBLE_SHIFT       (15)
275 
276 /* 5.0G � 1 bit band = 1, split the 5G 8 bit channel into 2 places LO, HI */
277 #define SL_WLAN_RAW_RF_TX_PARAMS_5G_RATE_SHIFT        (9)
278 #define SL_WLAN_RAW_RF_TX_PARAMS_5G_CHANNEL_SHIFT_HI  (12)
279 #define SL_WLAN_RAW_RF_TX_PARAMS_5G_POWER_SHIFT       (14)
280 #define SL_WLAN_RAW_RF_TX_PARAMS_5G_PREAMBLE_SHIFT    (15)
281 
282 /* 5.0 G - 8bit channel */
283 #define CHANNEL_DECODE_MASK_LO                        (0x1f)     /* 5 LSB of 5G channel */
284 #define CHANNEL_DECODE_SHIFT_HI                       (5)        /* 5 LSB of 5G channel */
285 #define CHANNEL_DECODE_MASK_HI                        (0xe0)     /* 3 MSB of 5G channel */
286 #define POWER_DECODE_MASK_LO                          (0x01)     /* 1 bit of 5G power */
287 #define MAX_2_4G_CHANNEL_NUMBER                       (14)
288 #define BAND_2_4G                                     (0)
289 #define BAND_5_0G                                     (1)
290 
291 #define SL_WLAN_RAW_RF_TX_PARAMS(chan,rate,power,preamble) \
292                                                 ((unsigned char)(chan) <= MAX_2_4G_CHANNEL_NUMBER) ? ( \
293                                                     (chan     << SL_WLAN_RAW_RF_TX_PARAMS_CHANNEL_SHIFT) | \
294                                                     (BAND_2_4G<< SL_WLAN_RAW_RF_TX_PARAMS_BAND_SHIFT)    | \
295                                                     (rate << SL_WLAN_RAW_RF_TX_PARAMS_RATE_SHIFT) | \
296                                                     (power << SL_WLAN_RAW_RF_TX_PARAMS_POWER_SHIFT) | \
297                                                     (preamble << SL_WLAN_RAW_RF_TX_PARAMS_PREAMBLE_SHIFT) \
298                                                 ) : ( \
299                                                     ( (chan & CHANNEL_DECODE_MASK_LO) << SL_WLAN_RAW_RF_TX_PARAMS_CHANNEL_SHIFT) | \
300                                                     (BAND_5_0G<< SL_WLAN_RAW_RF_TX_PARAMS_BAND_SHIFT)    | \
301                                                     (rate     << SL_WLAN_RAW_RF_TX_PARAMS_RATE_SHIFT)    | \
302                                                     (((chan & CHANNEL_DECODE_MASK_HI) >> CHANNEL_DECODE_SHIFT_HI)  << SL_WLAN_RAW_RF_TX_PARAMS_5G_CHANNEL_SHIFT_HI) | \
303                                                     ((power & POWER_DECODE_MASK_LO) << SL_WLAN_RAW_RF_TX_PARAMS_POWER_SHIFT)   | \
304                                                     (preamble << SL_WLAN_RAW_RF_TX_PARAMS_PREAMBLE_SHIFT) \
305                                                 )
306 
307 /* Open 5G transceiver socket parameters */
308 #define TRANSCEIVER_5G_LOW_POWER_LOW_RATE    0x01  /* bit 0*/
309 #define SL_WLAN_RAW_RF_SOCKET_CHANNEL(channel, flags)   (channel&0xFF | (flags&0xFF)<<8)
310 
311 /* wlan config application IDs */
312 #define SL_WLAN_CFG_AP_ID                             (0)
313 #define SL_WLAN_CFG_GENERAL_PARAM_ID                  (1)
314 #define SL_WLAN_CFG_P2P_PARAM_ID                      (2)
315 #define SL_WLAN_CFG_AP_ACCESS_LIST_ID                 (3)
316 #define SL_WLAN_RX_FILTERS_ID                         (4)
317 #define SL_WLAN_CONNECTION_INFO                       (5)
318 
319 /* wlan AP Config set/get options */
320 #define SL_WLAN_AP_OPT_SSID                           (0)
321 #define SL_WLAN_AP_OPT_CHANNEL                        (3)
322 #define SL_WLAN_AP_OPT_HIDDEN_SSID                    (4)
323 #define SL_WLAN_AP_OPT_SECURITY_TYPE                  (6)
324 #define SL_WLAN_AP_OPT_PASSWORD                       (7)
325 #define SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE        (9)
326 #define SL_WLAN_GENERAL_PARAM_OPT_STA_TX_POWER        (10)
327 #define SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER         (11)
328 
329 
330 
331 #define SL_WLAN_P2P_OPT_DEV_NAME                      (12)
332 #define SL_WLAN_P2P_OPT_DEV_TYPE                      (13)
333 #define SL_WLAN_P2P_OPT_CHANNEL_N_REGS                (14)
334 #define SL_WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT        (16)
335 #define SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS         (18)  /* change the scan channels and RSSI threshold using this configuration option */
336 #define SL_WLAN_AP_OPT_MAX_STATIONS                   (19)
337 #define SL_WLAN_AP_ACCESS_LIST_ADD_MAC                (20)
338 #define SL_WLAN_AP_ACCESS_LIST_DEL_MAC                (21)
339 #define SL_WLAN_AP_ACCESS_LIST_DEL_IDX                (22)
340 #define SL_WLAN_AP_ACCESS_LIST_NUM_ENTRIES            (24)
341 #define SL_WLAN_AP_ACCESS_LIST_MODE                   (25)
342 #define SL_WLAN_AP_OPT_MAX_STA_AGING                  (26)
343 
344 #define SL_WLAN_RX_FILTER_STATE                           (27)
345 #define SL_WLAN_RX_FILTER_REMOVE                          (28)
346 #define SL_WLAN_RX_FILTER_STORE                           (29)
347 #define SL_WLAN_RX_FILTER_UPDATE_ARGS                     (30)
348 #define SL_WLAN_RX_FILTER_SYS_STATE                       (31)
349 #define SL_WLAN_GENERAL_PARAM_DISABLE_ENT_SERVER_AUTH     (32)
350 #define SL_WLAN_GENERAL_PARAM_OPT_SUSPEND_PROFILES        (33)
351 #define SL_WLAN_GENERAL_PARAM_OPT_ENABLE_5G               (34)
352 #define SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS_5G          (35)
353 #define SL_WLAN_GENERAL_PARAM_OPT_USER_COUNTRY_ATTRIB     (36)
354 #define SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_ATTRIB          (37)
355 #define SL_WLAN_GENERAL_PARAM_REGISTER_LINK_QUALITY_EVENT (38)
356 #define SL_WLAN_GENERAL_PARAM_COEX_CONFIG                 (39)
357 #define SL_WLAN_GENERAL_PARAM_ANT_SELECTION_CONFIG        (40)
358 #define SL_WLAN_GENERAL_PARAM_ANT_SELECTION_SET           (41)
359 #define SL_WLAN_GENERAL_PARAM_ANT_SELECTION_GET           (42)
360 #define SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE         (43)
361 #define SL_WLAN_GENERAL_PARAM_EXT_CONNECTION_INFO         (44)
362 
363 
364 /* SmartConfig CIPHER options */
365 #define SL_WLAN_SMART_CONFIG_CIPHER_SFLASH            (0)      /* password is not delivered by the application. The Simple Manager should
366                                                                   check if the keys are stored in the Flash. */
367 #define SL_WLAN_SMART_CONFIG_CIPHER_AES               (1)      /* AES (other types are not supported) */
368 #define SL_WLAN_SMART_CONFIG_CIPHER_NONE              (0xFF)   /* do not check in the flash */
369 
370 
371 #define SL_WLAN_POLICY_CONNECTION                     (0x10)
372 #define SL_WLAN_POLICY_SCAN                           (0x20)
373 #define SL_WLAN_POLICY_PM                             (0x30)
374 #define SL_WLAN_POLICY_P2P                            (0x40)
375 
376 #define SL_WLAN_VAL_2_MASK(position,value)            ((1 & (value))<<(position))
377 #define SL_WLAN_MASK_2_VAL(position,mask)             (((1 << position) & (mask)) >> (position))
378 
379 #define SL_WLAN_CONNECTION_POLICY(Auto,Fast,anyP2P,autoProvisioning)         (SL_WLAN_VAL_2_MASK(0,Auto) | SL_WLAN_VAL_2_MASK(1,Fast) | SL_WLAN_VAL_2_MASK(2,0) | SL_WLAN_VAL_2_MASK(3,anyP2P) | SL_WLAN_VAL_2_MASK(4,0) | SL_WLAN_VAL_2_MASK(5,autoProvisioning))
380 #define SL_WLAN_SCAN_POLICY_EN(policy)                (SL_WLAN_MASK_2_VAL(0,policy))
381 #define SL_WLAN_SCAN_POLICY(Enable,Enable_Hidden)     (SL_WLAN_VAL_2_MASK(0,Enable) | SL_WLAN_VAL_2_MASK(1,Enable_Hidden))
382 
383 
384 #define SL_WLAN_ENABLE_SCAN                           (1)
385 #define SL_WLAN_DISABLE_SCAN                          (0)
386 #define SL_WLAN_ALLOW_HIDDEN_SSID_RESULTS             (1)
387 #define SL_WLAN_BLOCK_HIDDEN_SSID_RESULTS             (0)
388 
389 #define SL_WLAN_NORMAL_POLICY                         (0)
390 #define SL_WLAN_LOW_LATENCY_POLICY                    (1)
391 #define SL_WLAN_LOW_POWER_POLICY                      (2)
392 #define SL_WLAN_ALWAYS_ON_POLICY                      (3)
393 #define SL_WLAN_LONG_SLEEP_INTERVAL_POLICY            (4)
394 #define SL_WLAN_IOT_LOW_POWER_POLICY                  (6)
395 
396 #define SL_WLAN_P2P_ROLE_NEGOTIATE                    (3)
397 #define SL_WLAN_P2P_ROLE_GROUP_OWNER                  (15)
398 #define SL_WLAN_P2P_ROLE_CLIENT                       (0)
399 
400 #define SL_WLAN_P2P_NEG_INITIATOR_ACTIVE              (0)
401 #define SL_WLAN_P2P_NEG_INITIATOR_PASSIVE             (1)
402 #define SL_WLAN_P2P_NEG_INITIATOR_RAND_BACKOFF        (2)
403 
404 #define SL_WLAN_POLICY_VAL_2_OPTIONS(position,mask,policy)    ((mask & policy) << position )
405 
406 #define SL_WLAN_P2P_POLICY(p2pNegType,p2pNegInitiator)   (SL_WLAN_POLICY_VAL_2_OPTIONS(0,0xF,(p2pNegType > SL_WLAN_P2P_ROLE_GROUP_OWNER ? SL_WLAN_P2P_ROLE_GROUP_OWNER : p2pNegType)) | \
407                                                      SL_WLAN_POLICY_VAL_2_OPTIONS(4,0x1,(p2pNegType > SL_WLAN_P2P_ROLE_GROUP_OWNER ? 1:0)) | \
408                                                      SL_WLAN_POLICY_VAL_2_OPTIONS(5,0x3, p2pNegInitiator))
409 
410 
411 /* Info elements */
412 #define SL_WLAN_INFO_ELEMENT_DEFAULT_ID               (0) /* 221 will be used */
413 
414 /* info element size is up to 252 bytes (+ 3 bytes of OUI). */
415 #define SL_WLAN_INFO_ELEMENT_MAX_SIZE                 (252)
416 
417 /* For AP - the total length of all info elements is 300 bytes (for example - 4 info elements of 75 bytes each) */
418 #define SL_WLAN_INFO_ELEMENT_MAX_TOTAL_LENGTH_AP      (300)
419 
420 /* For P2P - the total length of all info elements is 160 bytes (for example - 4 info elements of 40 bytes each) */
421 #define SL_WLAN_INFO_ELEMENT_MAX_TOTAL_LENGTH_P2P_GO  (160)
422 
423 #define SL_WLAN_INFO_ELEMENT_AP_ROLE                  (0)
424 #define SL_WLAN_INFO_ELEMENT_P2P_GO_ROLE              (1)
425 
426 /* we support up to 4 info elements per Role. */
427 #define SL_WLAN_MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED   (4)
428 
429 #define SL_WLAN_INFO_ELEMENT_DEFAULT_OUI_0            (0x08)
430 #define SL_WLAN_INFO_ELEMENT_DEFAULT_OUI_1            (0x00)
431 #define SL_WLAN_INFO_ELEMENT_DEFAULT_OUI_2            (0x28)
432 
433 #define SL_WLAN_INFO_ELEMENT_DEFAULT_OUI              (0x000000)  /* 08, 00, 28 will be used */
434 
435 #define SL_WLAN_AP_ACCESS_LIST_MODE_DISABLED          0
436 #define SL_WLAN_AP_ACCESS_LIST_MODE_DENY_LIST         1
437 #define SL_WLAN_MAX_ACCESS_LIST_STATIONS              8
438 
439 #define SL_WLAN_IOTLP_BITMAP_FORCE_DMS               0X40
440 #define SL_WLAN_IOTLP_BITMAP_FORCE_PROXY_ARP         0X80
441 
442 /* Scan results security information */
443 #define SL_WLAN_SCAN_RESULT_GROUP_CIPHER(SecurityInfo)                      (SecurityInfo & 0xF)   /* Possible values: NONE,SL_WLAN_CIPHER_BITMAP_TKIP,SL_WLAN_CIPHER_BITMAP_CCMP */
444 #define SL_WLAN_SCAN_RESULT_UNICAST_CIPHER_BITMAP(SecurityInfo)             ((SecurityInfo & 0xF0) >> 4 ) /* Possible values: NONE,SL_WLAN_CIPHER_BITMAP_WEP40,SL_WLAN_CIPHER_BITMAP_WEP104,SL_WLAN_CIPHER_BITMAP_TKIP,SL_WLAN_CIPHER_BITMAP_CCMP*/
445 #define SL_WLAN_SCAN_RESULT_HIDDEN_SSID(SecurityInfo)                       ((SecurityInfo & 0x2000 ) >> 13) /* Possible values: TRUE/FALSE */
446 #define SL_WLAN_SCAN_RESULT_KEY_MGMT_SUITES_BITMAP(SecurityInfo)            ((SL_WLAN_SCAN_RESULT_SEC_TYPE_BITMAP(SecurityInfo) == 0 | SL_WLAN_SCAN_RESULT_SEC_TYPE_BITMAP(SecurityInfo) == 1) ? 0: (((SecurityInfo & 0x1800) >> 11) == 0 ? SL_WLAN_KEY_MGMT_SUITE_PSK256 : ((SecurityInfo & 0x1800) >> 11)))  /* Possible values: SL_WLAN_KEY_MGMT_SUITE_802_1_X, SL_WLAN_KEY_MGMT_SUITE_PSK, SL_WLAN_KEY_MGMT_SUITE_PSK256, SL_WLAN_KEY_MGMT_SUITE_PSK_SAE */
447 #define SL_WLAN_SCAN_RESULT_SEC_TYPE_BITMAP(SecurityInfo)                   ((SecurityInfo & 0x700   ) >> 8)  /* Possible values: SL_WLAN_SECURITY_TYPE_BITMAP_OPEN, SL_WLAN_SECURITY_TYPE_BITMAP_WEP, SL_WLAN_SECURITY_TYPE_BITMAP_WPA, SL_WLAN_SECURITY_TYPE_BITMAP_WPA2, SL_WLAN_SECURITY_TYPE_BITMAP_WPA3, 0x6 (mix mode) SL_WLAN_SECURITY_TYPE_BITMAP_WPA | SL_WLAN_SECURITY_TYPE_BITMAP_WPA2 */
448 #define SL_WLAN_SCAN_RESULT_PMF_ENABLE(SecurityInfo)                        ((SecurityInfo & 0x4000  ) >> 14)  /* Possible values: TRUE/FALSE */
449 #define SL_WLAN_SCAN_RESULT_PMF_REQUIRED(SecurityInfo)                      ((SecurityInfo & 0x8000  ) >> 15)  /* Possible values: TRUE/FALSE */
450 
451 
452 #define SL_WLAN_SECURITY_TYPE_BITMAP_OPEN                     0x0
453 #define SL_WLAN_SECURITY_TYPE_BITMAP_WEP                      0x1
454 #define SL_WLAN_SECURITY_TYPE_BITMAP_WPA                      0x2
455 #define SL_WLAN_SECURITY_TYPE_BITMAP_WPA2                     0x4
456 #define SL_WLAN_SECURITY_TYPE_BITMAP_WPA3                     0x5
457 #define SL_WLAN_SECURITY_TYPE_BITMAP_MIX_WPA_WPA2             0x6
458 
459 #define SL_WLAN_CIPHER_BITMAP_WEP40                   0x1
460 #define SL_WLAN_CIPHER_BITMAP_WEP104                  0x2
461 #define SL_WLAN_CIPHER_BITMAP_TKIP                    0x4
462 #define SL_WLAN_CIPHER_BITMAP_CCMP                    0x8
463 
464 
465 #define SL_WLAN_KEY_MGMT_SUITE_802_1_X                1
466 #define SL_WLAN_KEY_MGMT_SUITE_PSK                    2
467 #define SL_WLAN_KEY_MGMT_SUITE_PSK_SAE                3
468 #define SL_WLAN_KEY_MGMT_SUITE_PSK256                 4
469 
470 
471 #define SL_WLAN_RX_FILTER_MAX_FILTERS                 (64)    /* Max number of filters is 64 filters */
472 #define SL_WLAN_RX_FILTER_MAX_SYS_FILTERS_SETS        (32)    /* The Max number of system filters */
473 #define SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS   (2)
474 #define SL_WLAN_RX_FILTER_NUM_OF_FILTER_PAYLOAD_ARGS  (2)
475 #define SL_WLAN_RX_FILTER_RANGE_ARGS                  (2)
476 #define SL_WLAN_RX_FILTER_NUM_USER_EVENT_ID           (64)
477 #define SL_WLAN_RX_FILTER_MAX_USER_EVENT_ID           ( ( SL_WLAN_RX_FILTER_NUM_USER_EVENT_ID ) - 1 )
478 
479 /*  Bit manipulation for 8 bit */
480 #define SL_WLAN_ISBITSET8(x,i)      ((x[i>>3] & (0x80>>(i&7)))!=0)  /* Is bit set, 8 bit unsigned numbers = x , location = i */
481 #define SL_WLAN_SETBIT8(x,i)        x[i>>3]|=(0x80>>(i&7));         /* Set bit,8 bit unsigned numbers = x , location = i */
482 #define SL_WLAN_CLEARBIT8(x,i)      x[i>>3]&=(0x80>>(i&7))^0xFF;    /* Clear bit,8 bit unsigned numbers = x , location = i */
483 
484 #define SL_WLAN_DONT_UPDATE    (0x1F)
485 /*****************************************************************************/
486 /* Structure/Enum declarations                                               */
487 /*****************************************************************************/
488 
489 typedef enum
490 {
491     SL_WLAN_RATE_1M         = 1,
492     SL_WLAN_RATE_2M         = 2,
493     SL_WLAN_RATE_5_5M       = 3,
494     SL_WLAN_RATE_11M        = 4,
495     SL_WLAN_RATE_6M         = 6,
496     SL_WLAN_RATE_9M         = 7,
497     SL_WLAN_RATE_12M        = 8,
498     SL_WLAN_RATE_18M        = 9,
499     SL_WLAN_RATE_24M        = 10,
500     SL_WLAN_RATE_36M        = 11,
501     SL_WLAN_RATE_48M        = 12,
502     SL_WLAN_RATE_54M        = 13,
503     SL_WLAN_RATE_MCS_0      = 14,
504     SL_WLAN_RATE_MCS_1      = 15,
505     SL_WLAN_RATE_MCS_2      = 16,
506     SL_WLAN_RATE_MCS_3      = 17,
507     SL_WLAN_RATE_MCS_4      = 18,
508     SL_WLAN_RATE_MCS_5      = 19,
509     SL_WLAN_RATE_MCS_6      = 20,
510     SL_WLAN_RATE_MCS_7      = 21,
511     SL_WLAN_MAX_NUM_RATES   = 0xFF
512 }SlWlanRateIndex_e;
513 
514 typedef enum
515 {
516     SL_WLAN_DEV_PW_DEFAULT      = 0,
517     SL_WLAN_DEV_PW_PIN_KEYPAD   = 1,
518     SL_WLAN_DEV_PW_PUSH_BUTTON  = 4,
519     SL_WLAN_DEV_PW_PIN_DISPLAY  = 5
520 } SlWlanP2pDevPwdMethod_e;
521 
522 typedef struct
523 {
524     _u32    Status;
525     _u32    SsidLen;
526     _u8     Ssid[32];
527     _u32    PrivateTokenLen;
528     _u8     PrivateToken[32];
529 }SlWlanSmartConfigStartAsyncResponse_t;
530 
531 typedef struct
532 {
533     _u16    Status;
534     _u16    Padding;
535 }SlWlanSmartConfigStopAsyncResponse_t;
536 
537 typedef struct
538 {
539     _u16    Status;
540     _u16    Padding;
541 }SlWlanConnFailureAsyncResponse_t;
542 
543 typedef struct
544 {
545     _u16    Status;
546     _u16    Padding;
547 }SlWlanProvisioningStatusAsyncResponse_t;
548 
549 /* rx filter event struct
550   this event will be sent from the SL device
551   as a result of a passed rx filter
552   example:
553   suppose we have a filter with an action and we set the following:
554   SlWlanRxFilterAction_t Action;
555   Action.UserId = 2;
556   When the filter result is pass, an SlWlanEventRxFilterInfo_t event will be passed to the user as follows:
557   Type will be set to 0
558   bit 2 in UserActionIdBitmap will be set in this event, because 2 is the user input for the action arg above.
559   an SlWlanEventRxFilterInfo_t event may have several bits set as a result of several rx filters causing different
560   events to pass */
561 
562 typedef struct
563 {
564     _u8     Type;                                                          /* Currently only event type 0 is supported. */
565     _u8     UserActionIdBitmap[SL_WLAN_RX_FILTER_NUM_USER_EVENT_ID / 8];   /* Bit X is set indicates that the filter with event action arg X passed. */
566 }SlWlanEventRxFilterInfo_t;
567 
568 typedef enum
569 {
570     ROLE_STA      = 0,
571     ROLE_RESERVED = 1,
572     ROLE_AP       = 2,
573     ROLE_P2P      = 3,
574     ROLE_TAG      = 4
575 }SlWlanMode_e;
576 
577 typedef struct
578 {
579     _u8     SsidLen;
580     _u8     SsidName[32];
581     _u8     Bssid[6];
582     _u8     Padding;
583 } SlWlanEventConnect_t;
584 
585 typedef struct
586 {
587     _u8     SsidLen;
588     _u8     SsidName[32];
589     _u8     Bssid[6];
590     _u8     ReasonCode;
591 } SlWlanEventDisconnect_t;
592 
593 typedef struct
594 {
595     _u8   Mac[6];
596     _u8   Padding[2];
597 }SlWlanEventSTAAdded_t, SlWlanEventSTARemoved_t;
598 
599 
600 typedef struct
601 {
602     _u8     SsidLen;
603     _u8     SsidName[32];
604     _u8     Bssid[6];
605     _u8     Reserved;
606     _u8     GoDeviceNameLen;
607     _u8     GoDeviceName[32];
608     _u8     Padding[3];
609 } SlWlanEventP2PConnect_t;
610 
611 typedef struct
612 {
613     _u8     SsidLen;
614     _u8     SsidName[32];
615     _u8     Bssid[6];
616     _u8     ReasonCode;
617     _u8     GoDeviceNameLen;
618     _u8     GoDeviceName[32];
619     _u8     Padding[3];
620 } SlWlanEventP2PDisconnect_t;
621 
622 typedef struct
623 {
624     _u8     Mac[6];
625     _u8     ClDeviceNameLen;
626     _u8     ClDeviceName[32];
627     _u8     OwnSsidLen;
628     _u8     OwnSsid[32];
629 }SlWlanEventP2PClientAdded_t, SlWlanEventP2PClientRemoved_t;
630 
631 typedef struct
632 {
633     _u8     GoDeviceNameLen;
634     _u8     GoDeviceName[32];
635     _u8     Mac[6];
636     _u8     WpsMethod;
637 }SlWlanEventP2PDevFound_t, SlWlanEventP2PRequest_t;
638 
639 /**************************************************/
640 typedef struct
641 {
642     _u16    Status;
643     _u16    Padding;
644 }SlWlanEventP2PConnectFail_t;
645 
646 typedef struct
647 {
648     _u8  ProvisioningStatus;
649     _u8  Role;
650     _u8  WlanStatus;
651     _u8  Ssidlen;
652     _u8  Ssid[32];
653     _u32 Reserved;
654 }SlWlanEventProvisioningStatus_t;
655 
656 typedef struct
657 {
658     _u32    Status;
659     _u32    SsidLen;
660     _u8     Ssid[32];
661     _u32    ReservedLen;
662     _u8     Reserved[32];
663 } SlWlanEventProvisioningProfileAdded_t;
664 
665 typedef struct
666 {
667     _u8  Data;            /* The values which cause the trigger */
668     _u8  TriggerId;       /* Trigger index (0 .. 1)   */
669     _u8  Padding[2];
670 }SlWlanLinkQualityAsyncEvent_t;
671 
672 typedef union
673 {
674     SlWlanEventConnect_t                         Connect;                    /* SL_WLAN_EVENT_CONNECT */
675     SlWlanEventDisconnect_t                      Disconnect;                 /* SL_WLAN_EVENT_DISCONNECT */
676     SlWlanEventSTAAdded_t                        STAAdded;                   /* SL_WLAN_EVENT_STA_ADDED */
677     SlWlanEventSTARemoved_t                      STARemoved;                 /* SL_WLAN_EVENT_STA_REMOVED */
678     SlWlanEventP2PConnect_t                      P2PConnect;                 /* SL_WLAN_EVENT_P2P_CONNECT */
679     SlWlanEventP2PDisconnect_t                   P2PDisconnect;              /* SL_WLAN_EVENT_P2P_DISCONNECT */
680     SlWlanEventP2PClientAdded_t                  P2PClientAdded;             /* SL_WLAN_EVENT_P2P_CLIENT_ADDED */
681     SlWlanEventP2PClientRemoved_t                P2PClientRemoved;           /* SL_WLAN_EVENT_P2P_CLIENT_REMOVED */
682     SlWlanEventP2PDevFound_t                     P2PDevFound;                /* SL_WLAN_EVENT_P2P_DEVFOUND */
683     SlWlanEventP2PRequest_t                      P2PRequest;                 /* SL_WLAN_EVENT_P2P_REQUEST */
684     SlWlanEventP2PConnectFail_t                  P2PConnectFail;             /* SL_WLAN_EVENT_P2P_CONNECTFAIL */
685     SlWlanEventRxFilterInfo_t                    RxFilterInfo;               /* SL_WLAN_EVENT_RXFILTER */
686     SlWlanEventProvisioningStatus_t              ProvisioningStatus;         /* SL_WLAN_EVENT_PROVISIONING_STATUS */
687     SlWlanEventProvisioningProfileAdded_t        ProvisioningProfileAdded;   /* SL_WLAN_EVENT_PROVISIONING_PROFILE_ADDED */
688     SlWlanLinkQualityAsyncEvent_t                LinkQualityTrigger;         /* SL_WLAN_EVENT_LINK_QUALITY_TRIGGER */
689 } SlWlanEventData_u;
690 
691 typedef struct
692 {
693    _u32                 Id;
694    SlWlanEventData_u    Data;
695 } SlWlanEvent_t;
696 
697 typedef struct
698 {
699     _u32  ReceivedValidPacketsNumber;                    /* sum of the packets that been received OK (include filtered) */
700     _u32  ReceivedFcsErrorPacketsNumber;                 /* sum of the packets that been dropped due to FCS error */
701     _u32  ReceivedAddressMismatchPacketsNumber;          /* sum of the packets that been received but filtered out by one of the HW filters */
702     _i16  AvarageDataCtrlRssi;                           /* average RSSI for all valid data packets received */
703     _i16  AvarageMgMntRssi;                              /* average RSSI for all valid management packets received */
704     _u16  RateHistogram[SL_WLAN_NUM_OF_RATE_INDEXES];    /* rate histogram for all valid packets received */
705     _u16  RssiHistogram[SL_WLAN_SIZE_OF_RSSI_HISTOGRAM]; /* RSSI histogram from -40 until -87 (all below and above\n RSSI will appear in the first and last cells */
706     _u32  StartTimeStamp;                                /* the time stamp started collecting the statistics in uSec */
707     _u32  GetTimeStamp;                                  /* the time stamp called the get statistics command */
708 }SlWlanGetRxStatResponse_t;
709 
710 typedef struct
711 {
712     _u8 Ssid[SL_WLAN_SSID_MAX_LENGTH];
713     _u8 Bssid[SL_WLAN_BSSID_LENGTH];
714     _u8 SsidLen;
715     _i8 Rssi;
716     _i16 SecurityInfo;
717     _u8 Channel;
718     _i8 Reserved[1];
719 }SlWlanNetworkEntry_t;
720 
721 typedef struct
722 {
723     _u8 Ssid[SL_WLAN_SSID_MAX_LENGTH];
724     _u8 Bssid[SL_WLAN_BSSID_LENGTH];
725     _u8 SsidLen;
726     _i8 Rssi;
727     _i16 SecurityInfo;
728     _u8 Channel;
729     _i8 Reserved[1];
730     /* country info extended area */
731     _u8  CountryStr[2];
732     _u16 Supported_2_4G_Channels;
733     _u32 Supported_5_0G_Channels;
734 }SlWlanExtNetworkEntry_t;
735 
736 typedef struct
737 {
738     _u8   Type;
739     _i8*  Key;
740     _u8   KeyLen;
741 }SlWlanSecParams_t;
742 
743 typedef struct
744 {
745     _i8*  User;
746     _u8   UserLen;
747     _i8*  AnonUser;
748     _u8   AnonUserLen;
749     _u8   CertIndex;  /* not supported */
750     _u32  EapMethod;
751 }SlWlanSecParamsExt_t;
752 
753 typedef struct
754 {
755     _i8   User[64];
756     _u8   UserLen;
757     _i8   AnonUser[64];
758     _u8   AnonUserLen;
759     _u8   CertIndex;  /* not supported */
760     _u32  EapMethod;
761 }SlWlanGetSecParamsExt_t;
762 
763 #define SL_WLAN_CONNECTION_PROTOCOL_STA     1
764 #define SL_WLAN_CONNECTION_PROTOCOL_P2PCL   2
765 
766 typedef union
767 {
768     SlWlanEventConnect_t       StaConnect;
769     SlWlanEventP2PConnect_t    P2PConnect;
770 } SlWlanConnectionInfo_u;
771 
772 typedef enum
773 {
774     SL_WLAN_DISCONNECTED = 0,
775     SL_WLAN_CONNECTED_STA,
776     SL_WLAN_CONNECTED_P2PCL,
777     SL_WLAN_CONNECTED_P2PGO,
778     SL_WLAN_AP_CONNECTED_STATIONS
779 }SlWlanConnStatusFlags_e;
780 
781 typedef struct
782 {
783     _u8 Mode;       /* ROLE_STA, ROLE_AP, ROLE_P2P */
784     _u8 ConnStatus; /* SlWlanConnStatusFlags_e */
785     _u8 SecType;    /* Current connection security type - (0 in case of disconnect or AP mode) SL_WLAN_SEC_TYPE_OPEN, SL_WLAN_SEC_TYPE_WEP, SL_WLAN_SEC_TYPE_WPA_WPA2, SL_WLAN_SEC_TYPE_WPA2_PLUS, SL_WLAN_SEC_TYPE_WPA3, SL_WLAN_SEC_TYPE_WPA_ENT, SL_WLAN_SEC_TYPE_WPS_PBC, SL_WLAN_SEC_TYPE_WPS_PIN */
786     _u8 Reserved;
787     SlWlanConnectionInfo_u ConnectionInfo;
788 }SlWlanConnStatusParam_t;
789 
790 typedef struct
791 {
792     _u32   ChannelsMask;
793     _i32   RssiThreshold;
794 }SlWlanScanParamCommand_t;
795 
796 typedef struct
797 {
798     _u32   ChannelsMask;
799     _i32   RssiThreshold;
800 }SlWlanScanParam2GCommand_t;
801 
802 typedef struct
803 {
804     _u32   ChannelsMask;
805     _i32   RssiThreshold;
806 }SlWlanScanParam5GCommand_t;
807 
808 typedef enum {
809     REGION_FCC = 0,
810     REGION_ETSI,
811     REGION_JP,
812     REGION_WW,
813     REGION_NO_LIMIT
814 } Region_e;
815 
816 typedef struct{
817     _u8  Region;                  /* (0-FCC, 1-ETSI, 2-JP) */
818     _u8  Padding[3];
819     _u32 Active_2_4G_Channels;
820     _u32 Active_5_0G_Channels;
821     _u32 Dfs_5_0G_Channels;
822 }SlWlanUserCountryAttrib_t;
823 
824 typedef struct
825 {
826     _u8   Id;
827     _u8   Oui[3];
828     _u16  Length;
829     _u8   Data[252];
830 } SlWlanInfoElement_t;
831 
832 typedef struct
833 {
834     _u8          Index;  /* 0 - SL_WLAN_MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED */
835     _u8          Role;   /* bit0: AP = 0, GO = 1                    */
836     SlWlanInfoElement_t   IE;
837 } SlWlanSetInfoElement_t;
838 
839 typedef struct
840 {
841     _u8         PowerMgtBitMask; /* Allows the user to activate the IoT LP feature only if several features are supported by the AP */
842                                  /* SL_WLAN_IOTLP_BITMAP_FORCE_DMS, SL_WLAN_IOTLP_BITMAP_FORCE_PROXY_ARP */
843     _u8         Reserved;
844     _u16        Reserved2;
845     _u16        MaxSleepTimeMs;   /* max sleep time in mSec For setting Long Sleep Interval policy use */
846     _u16        Reserved3;
847 } SlWlanPmPolicyParams_t;
848 
849 typedef enum
850 {
851     SL_WLAN_METRIC_EVENT_RSSI_BEACON  = 0,
852     SL_WLAN_METRIC_EVENT_RSSI_DATA    = 1
853 } SlWlanMetricEvent_e;
854 
855 typedef enum
856 {
857     SL_WLAN_RX_QUALITY_EVENT_LEVEL = 0,  /* The event is a "Level" indication which keeps */
858                                          /* triggering as long as the average RSSI is below*/
859                                          /* the threshold.*/
860 
861     SL_WLAN_RX_QUALITY_EVENT_EDGE  = 1   /* The event is an "Edge" indication which triggers*/
862                                          /* only when the RSSI threshold is crossed from above.*/
863 } SlWlanRxQualityEventType_e;
864 
865 typedef enum
866 {
867     SL_WLAN_RSSI_EVENT_DIR_LOW   = 0,
868     SL_WLAN_RSSI_EVENT_DIR_HIGH  = 1,
869     SL_WLAN_RSSI_EVENT_DIR_BIDIR = 2,
870     SL_WLAN_RSSI_EVENT_SHIFT     = 3
871 } SlWlanRssiEventDir_e;
872 
873 typedef struct
874 {
875     _i16 Threshold;       /* Input event Threshold. Units: dBm / dB ; Range: (-100 .. 100)                        */
876     _u16 Pacing;          /* Minimum delay between consecutive events. Units: milliseconds ; Range:  (0 .. 60000) */
877     _u8  Metric;          /* 0 - RSSI Beacon, 1 - RSSI Packet. Applicable only for CC3x35 SL devices                     */
878     _u8  Type;            /* 0 - Level, 1 - Edge. Applicable only for CC3x35 SL devices                                          */
879     _u8  Direction;       /* 0 - Low, 1 - High, 2 - Bidirectional. Applicable only for CC3x35 SL devices                  */
880     _u8  Hysteresis;      /* Hysteresis range around the threshold value. Units: dB ; Threshold range: (0 .. 255) */
881     _u8  TriggerId;       /* Trigger index (0 .. 1). Applicable only for CC3x35 SL devices                                    */
882     _u8  Enable;          /* Event Enable. 0 - Disable, 1 - Enable                                           */
883     _u8  Padding[2];
884 } SlWlanRegisterLinkQualityEvents_t;
885 
886 typedef enum
887 {
888     SL_WLAN_COEX_MODE_DISABLED,
889     SL_WLAN_COEX_BASIC_SINGLE_ANTENNA                                                 /*BLE coex with shared antenna (switch)*/
890 }SlWlanCoexMode_e;
891 
892 typedef struct
893 {
894     _u8 Mode;                                                                           /* see SlWlanCoexMode_e */
895     _u8 InputPad;                                                                       /* Input pad from external syncing device */
896     _u8 OutputPad;                                                                      /* Output pad to external synced device (or switch)*/
897     _u8 Reserved;
898     _u32 Options;                                                                       /* Set to zero - not supported */
899 }SlWlanCoexConfig_t;
900 
901 typedef struct
902 {
903     _u8  Enable;          /* Enable no ps poll mode - 1, Disable 0 Read documentation in sl_WlanSet*/
904     _u8  Reserved;        /* Reserved for future use   */
905     _u8  Padding[2];      /* Padding */
906 } SlWlanNoPSPollMode_t;
907 
908 typedef enum
909 {
910     SL_WLAN_ANT_SELECTION_DISABLED,         /* Antenna selection disabled */
911     SL_WLAN_ANT_SELECTION_ANT1,             /* Antenna selection - use only antenna 1 */
912     SL_WLAN_ANT_SELECTION_ANT2,             /* Antenna selection - use only antenna 2 */
913     SL_WLAN_ANT_SELECTION_AUTO,             /* Antenna selection - automatic antenna selection during connection. Applicable only for CC3x35 SL devices */
914     SL_WLAN_ANT_SELECTION_MANUAL            /* Antenna selection - manual antenna selection while connected. Applicable only for CC3x20 SL devices */
915 }SlWlanAntSelectionMode_e;
916 
917 typedef struct
918 {
919     _u8  Mode;                                                                           /* see SlWlanAntSelectionMode_e */
920     _u8  Ant1Pad;                                                                        /* Antenna selection pad (not pin!) */
921     _u8  Ant2Pad;                                                                        /* Antenna selection pad (not pin!) */
922     _u8  Reserved;
923     _u32 Options;                                                                       /* Set to zero - not supported */
924 }SlWlanAntSelectionConfig_t;
925 
926 typedef enum
927 {
928     SL_WLAN_ANT_IDX_1 = 1,        /* Antenna index 1 */
929     SL_WLAN_ANT_IDX_2,            /* Antenna index 2 */
930     SL_WLAN_ANT_TOGGLE,            /* Antenna toggle */
931     SL_WLAN_ANT_NUM_OF_IDXS
932 }SlWlanAntIndex_e;
933 
934 typedef struct SetAntennaCmd
935 {
936     SlWlanAntIndex_e                 AntIndex;                        /* antenna index - 1, 2 or toggle*/
937 }SetAntennaIndex_t;
938 
939 typedef struct
940 {
941     _u16 BeaconInterval; // Represented in Time Units (TU), where 1 TU equal to 1.024 msec. Range: [15-65535]
942     _u8  DTIMPeriod;     // Range: [1-255]
943     _u8  reserved[17];   // For future use
944 }SlWlanExtConnectionInfo_t;
945 
946 
947 typedef  _i8    SlWlanRxFilterID_t; /* Unique filter ID which is allocated by the system , negative number means error */
948 
949 /*  Representation of filters Id as a bit field
950     The bit field is used to declare which filters are involved
951     in operation. Number of filter can be up to 128 filters.
952     i.e. 128 bits are needed. On the current release, up to 64 filters can be defined. */
953 typedef _u8   SlWlanRxFilterIdMask_t[128/8];
954 
955 typedef _u8  SlWlanRxFilterSysFilters_t; /* Describes the supported system filter sets*/
956 /* possible values for SlWlanRxFilterSysFilters_t */
957 #define SL_WLAN_RX_FILTER_ARP_AUTO_REPLY_SYS_FILTERS       (0)
958 #define SL_WLAN_RX_FILTER_MULTICASTSIPV4_SYS_FILTERS       (1)
959 #define SL_WLAN_RX_FILTER_MULTICASTSIPV6_SYS_FILTERS       (2)
960 #define SL_WLAN_RX_FILTER_MULTICASTSWIFI_SYS_FILTERS       (3)
961 #define SL_WLAN_RX_FILTER_SELF_MAC_ADDR_DROP_SYS_FILTERS   (4)
962 
963 /*  Describes the supported system filter sets, each bit represents different system filter set
964     The filter sets are defined at SlWlanRxFilterSysFilters_t  */
965 typedef _u8   SlWlanRxFilterSysFiltersMask_t[SL_WLAN_RX_FILTER_MAX_SYS_FILTERS_SETS/8];
966 
967 typedef struct
968 {
969     _u16    Offset;     /*  Offset in payload - Where in the payload to search for the pattern */
970     _u8     Length;     /* Pattern Length */
971     _u8     Reserved;
972     _u8     Value[16];  /* Up to 16 bytes long (based on pattern length above) */
973 }SlWlanRxFilterPatternArg_t;
974 
975 typedef _u8 SlWlanRxFilterRuleType_t; /* Different filter types */
976 /* possible values for SlWlanRxFilterRuleType_t */
977 #define SL_WLAN_RX_FILTER_HEADER                    (0)
978 #define SL_WLAN_RX_FILTER_COMBINATION               (1)
979 
980 typedef _u8 SlWlanRxFilterFlags_u;
981 /* Possible values for SlWlanRxFilterFlags_u */
982 #define SL_WLAN_RX_FILTER_BINARY                    (0x1)
983 #define SL_WLAN_RX_FILTER_PERSISTENT                (0x8)
984 #define SL_WLAN_RX_FILTER_ENABLE                    (0x10)
985 
986 /* Used as comparison function for the header type arguments */
987 typedef _u8 SlWlanRxFilterRuleHeaderCompareFunction_t;
988 /* Possible values for SlWlanRxFilterRuleHeaderCompareFunction_t */
989 #define SL_WLAN_RX_FILTER_CMP_FUNC_IN_BETWEEN       (0)
990 #define SL_WLAN_RX_FILTER_CMP_FUNC_EQUAL            (1)
991 #define SL_WLAN_RX_FILTER_CMP_FUNC_NOT_EQUAL_TO     (2)
992 #define SL_WLAN_RX_FILTER_CMP_FUNC_NOT_IN_BETWEEN   (3)
993 
994 typedef _u8 SlWlanRxFilterTriggerCompareFunction_t;
995 /* Possible values for SlWlanRxFilterTriggerCompareFunction_t */
996 #define SL_WLAN_RX_FILTER_TRIGGER_CMP_FUNC_EQUAL                        (0)
997 #define SL_WLAN_RX_FILTER_TRIGGER_CMP_FUNC_NOT_EQUAL_TO                 (1) /*   arg1 == protocolVal ,not supported in current release */
998 #define SL_WLAN_RX_FILTER_TRIGGER_CMP_FUNC_SMALLER_THAN                 (2) /*   arg1 == protocolVal */
999 #define SL_WLAN_RX_FILTER_TRIGGER_CMP_FUNC_BIGGER_THAN                  (3) /*   arg1 == protocolVal */
1000 
1001 typedef _u8 SlWlanRxFilterRuleHeaderField_t; /* Provides list of possible header types which may be defined as part of the rule */
1002 /* Possible values for SlWlanRxFilterRuleHeaderField_t */
1003 #define SL_WLAN_RX_FILTER_HFIELD_NULL                     (0)
1004 #define SL_WLAN_RX_FILTER_HFIELD_FRAME_TYPE               (1) /* 802.11 control\data\management */
1005 #define SL_WLAN_RX_FILTER_HFIELD_FRAME_SUBTYPE            (2) /*  802.11 beacon\probe\.. */
1006 #define SL_WLAN_RX_FILTER_HFIELD_BSSID                    (3)  /*  802.11 bssid type */
1007 #define SL_WLAN_RX_FILTER_HFIELD_MAC_SRC_ADDR             (4)
1008 #define SL_WLAN_RX_FILTER_HFIELD_MAC_DST_ADDR             (5)
1009 #define SL_WLAN_RX_FILTER_HFIELD_FRAME_LENGTH             (6)
1010 #define SL_WLAN_RX_FILTER_HFIELD_ETHER_TYPE               (7)
1011 #define SL_WLAN_RX_FILTER_HFIELD_IP_VERSION               (8)
1012 #define SL_WLAN_RX_FILTER_HFIELD_IP_PROTOCOL              (9)  /* TCP / UDP / ICMP / ICMPv6 / IGMP */
1013 #define SL_WLAN_RX_FILTER_HFIELD_IPV4_SRC_ADDR            (10)
1014 #define SL_WLAN_RX_FILTER_HFIELD_IPV4_DST_ADDR            (11)
1015 #define SL_WLAN_RX_FILTER_HFIELD_IPV6_SRC_ADRR            (12)
1016 #define SL_WLAN_RX_FILTER_HFIELD_IPV6_DST_ADDR            (13)
1017 #define SL_WLAN_RX_FILTER_HFIELD_PORT_SRC                 (14)
1018 #define SL_WLAN_RX_FILTER_HFIELD_PORT_DST                 (15)
1019 #define SL_WLAN_RX_FILTER_HFIELD_L4_PAYLOAD_PATTERN       (19) /* use to look for patterns on the TCP and UDP payloads (after TCP/UDP header) */
1020 #define SL_WLAN_RX_FILTER_HFIELD_L1_PAYLOAD_PATTERN       (20) /* use to look for patterns on the PHY payload (i.e. beginning of WLAN MAC header) */
1021 #define SL_WLAN_RX_FILTER_HFIELD_MAX_FIELD                (21) /* Definition */
1022 
1023 /* Holds the header ARGS which are used in case of HDR rule */
1024 typedef union
1025 {
1026     /* buffer for pattern matching in payload up to 16 bytes (Binary Values) */
1027     SlWlanRxFilterPatternArg_t  Pattern;
1028 
1029     /* Buffer for ipv4 address filter. binary arguments, number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS*/
1030     _u8 Ipv4[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][4]; /*  Binary Values for comparison */
1031 
1032     /* Buffer for ipv4 address filter. Ascii arguments - IPv4 address: 4 bytes: ddd.ddd.ddd.ddd - 15 chars. Number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS*/
1033     _u8 Ipv4Ascii[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][16]; /*  Ascii Values for comparison */
1034 
1035     /* Buffer for ipv6 address filter. binary arguments, Ascii format is not supported. number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS*/
1036     _u8 Ipv6[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][16]; /*  Binary Values for comparison */
1037 
1038     /* Buffer for mac address filter. binary arguments.  number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS*/
1039     _u8 Mac[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][6]; /*  Binary Values for comparison */
1040 
1041     /* Buffer for mac address filter. Ascii arguments - MAC address:  6 bytes: xx:xx:xx:xx:xx:xx - 17 chars.  number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS */
1042     _u8 MacAscii[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][18]; /*  Ascii Values for comparison */
1043 
1044     /* Buffer for BSSID address filter. binary arguments.  number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS*/
1045     _u8 Bssid[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][6]; /*  Binary Values for comparison */
1046 
1047     /* Buffer for frame length filter. number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS */
1048     _u32 FrameLength[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS]; /*  Binary Values for comparison */
1049 
1050     /* Buffer for port filter. number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS */
1051     _u32 Port[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS]; /*  Binary Values for comparison */
1052 
1053     /* Buffer for Ether filter. number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS (according to host endianity) */
1054     _u32 EtherType[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS]; /*  Binary Values for comparison */
1055 
1056     /* Buffer for ip version filter. Buffer for binary arguments. IP Version - 4 for IPV4 and 6 for IPV6  */
1057     _u8 IpVersion;
1058 
1059     /* Buffer for frame type filter. Buffer for binary arguments. Frame Type (0 - management, 1 - Control, 2 - Data)  */
1060     _u8 Frametype[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS];
1061 
1062     /* Buffer for frame subtype filter. Buffer for binary arguments. Frame Sub Type (checkout the full list in the 802.11 spec). e.g. Beacon=0x80, Data=0x08, Qos-Data=0x04, ACK=0xD4, etc. */
1063     _u8 FrameSubtype[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS];
1064 
1065     /* Buffer for protocol type filter. Buffer for binary arguments. e.g. 1 � ICMP (IPV4 only), 2 - IGMP (IPV4 only), 6 � TCP. 17 � UDP, 58 � ICMPV6 */
1066     _u8 IpProtocol[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS];
1067 
1068     /* Buffer for ip version filter. Buffer for ASCII arguments. Use for IP version field comparison settings: "IPV4", "IPV6"  */
1069     _u8 IpVersionAscii[4];
1070 
1071     /* Buffer for frame type filter. Buffer for ASCII arguments. Use for Frame type field comparison settings: "MGMT", "CTRL", "DATA"  */
1072     _u8 FrametypeAscii[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][4];
1073 
1074     /* Buffer for protocol type filter. Buffer for ASCII arguments. Use for protocol field comparison settings: "ICMP", "IGMP", "TCP, "UDP", "ICMP6"  */
1075     /* Note: Use memcpy with these strings instead of strcpy (no \0 should be at the end, as the array is 5 bytes long and ICMP6 is already 5 bytes long without the \0) */
1076     _u8 IpProtocolAscii[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][5];
1077 
1078 }SlWlanRxFilterHeaderArg_u;
1079 
1080 /* Defines the Header Args and mask */
1081 typedef struct
1082 {
1083     SlWlanRxFilterHeaderArg_u                   Value; /* Argument for the comparison function */
1084     _u8                                         Mask[16];  /* the mask is used in order to enable partial comparison (bit level), Use the 0xFFFFFFFF in case you don't want to use mask */
1085 
1086 }SlWlanRxFilterRuleHeaderArgs_t;
1087 
1088 /* defines the Header rule. The header rule defines the compare function on the protocol header
1089    For example destMacAddre is between ( 12:6::78:77,  12:6::78:90 ) */
1090 typedef struct
1091 {
1092     SlWlanRxFilterRuleHeaderArgs_t              Args; /* Filter arguments */
1093     SlWlanRxFilterRuleHeaderField_t             Field; /* Packet HDR field which will be compared to the argument */
1094     SlWlanRxFilterRuleHeaderCompareFunction_t   CompareFunc; /*  type of the comparison function */
1095     _u8                                         Padding[2];
1096 }SlWlanRxFilterRuleHeader_t;
1097 
1098 /* Optional operators for the combination type filterID1 is located in the first arg , filterId2 is the second arg */
1099 typedef _u8 SlWlanRxFilterRuleCombinationOperator_t;
1100 /* Possible values for SlWlanRxFilterRuleCombinationOperator_t */
1101 #define SL_WLAN_RX_FILTER_COMBINED_FUNC_NOT     (0) /* filterID1 */
1102 #define SL_WLAN_RX_FILTER_COMBINED_FUNC_AND     (1) /* filterID1 && filterID2 */
1103 #define SL_WLAN_RX_FILTER_COMBINED_FUNC_OR      (2) /* filterID1 && filterID2 */
1104 
1105 /* Defines the structure which define the combination type filter
1106    The combined filter enable to make operation on one or two filter,
1107    for example filterId1 or and(filterId2,filterId3). */
1108 typedef struct
1109 {
1110     SlWlanRxFilterRuleCombinationOperator_t     Operator; /* combination operator */
1111     SlWlanRxFilterID_t                          CombinationFilterId[SL_WLAN_RX_FILTER_RANGE_ARGS]; /* filterID, may be one or two depends on the combination operator type */
1112     _u8                                         Padding;
1113 }SlWlanRxFilterRuleCombination_t;
1114 
1115 /* Rule structure composed of behavioral flags and the filter rule definitions */
1116 typedef union
1117 {
1118     SlWlanRxFilterRuleHeader_t                  Header; /* Filter is from type Header */
1119     SlWlanRxFilterRuleCombination_t             Combination; /*  Filter is from type Combination */
1120 }SlWlanRxFilterRule_u;
1121 
1122 /* Bit field which represents the roleId possible values
1123    In the current release only Station (with or without promiscuous modes) and AP roles are supported.
1124    Activating filters before P2P negotiations (i.e. decision whether role is CL or GO) may result with
1125    unexpected behaviour. After this stage, filters can be activated whereas STA role is the equivalent of P2P CL role
1126    AP role is the equivalent of P2P GO role.
1127  */
1128 typedef _u8 SlWlanRxFilterTriggerRoles_t;
1129 /* Possible values for SlWlanRxFilterTriggerRoles_t */
1130 #define SL_WLAN_RX_FILTER_ROLE_AP                            (1)
1131 #define SL_WLAN_RX_FILTER_ROLE_STA                           (2)
1132 #define SL_WLAN_RX_FILTER_ROLE_TRANCIEVER                    (4)
1133 #define SL_WLAN_RX_FILTER_ROLE_NULL                          (0)
1134 
1135 typedef _u8 SlWlanRxFilterTriggerConnectionStates_t;
1136 /* Possible values for SlWlanRxFilterTriggerConnectionStates_t */
1137 #define SL_WLAN_RX_FILTER_STATE_STA_CONNECTED     (0x1)
1138 #define SL_WLAN_RX_FILTER_STATE_STA_NOT_CONNECTED (0x2)
1139 #define SL_WLAN_RX_FILTER_STATE_STA_HAS_IP        (0x4)
1140 #define SL_WLAN_RX_FILTER_STATE_STA_HAS_NO_IP     (0x8)
1141 
1142 /* There are 8 possible counter. if no counter is needed set to NO_TRIGGER_COUNTER */
1143 typedef _u8 SlWlanRxFilterCounterId_t;
1144 /* Possible values for SlWlanRxFilterCounterId_t */
1145 #define SL_WLAN_RX_FILTER_NO_TRIGGER_COUNTER                (0)
1146 #define SL_WLAN_RX_FILTER_COUNTER1                          (1)
1147 #define SL_WLAN_RX_FILTER_COUNTER2                          (2)
1148 #define SL_WLAN_RX_FILTER_COUNTER3                          (3)
1149 #define SL_WLAN_RX_FILTER_COUNTER4                          (4)
1150 #define SL_WLAN_RX_FILTER_COUNTER5                          (5)
1151 #define SL_WLAN_RX_FILTER_COUNTER6                          (6)
1152 #define SL_WLAN_RX_FILTER_COUNTER7                          (7)
1153 #define SL_WLAN_RX_FILTER_COUNTER8                          (8)
1154 #define SL_WLAN_RX_FILTER_MAX_COUNTER                       (9)
1155 
1156 /* The filter trigger, determine when the filter is triggered,
1157    The filter is triggered in the following condition :\n
1158    1. The filter parent is triggered\n
1159    2. The requested connection type exists, i.e. wlan_connect\n
1160    3. The filter role is the same as the system role\n */
1161 typedef struct
1162 {
1163     SlWlanRxFilterID_t                      ParentFilterID; /* The parent filter ID, this is the way to build filter tree.  NULL value means tree root */
1164     SlWlanRxFilterCounterId_t               Counter; /* Trigger only when reach counter threshold */
1165     SlWlanRxFilterTriggerConnectionStates_t ConnectionState; /* Trigger only with specific connection state */
1166     SlWlanRxFilterTriggerRoles_t            Role; /* Trigger only with specific role */
1167     _u32                                    CounterVal;  /* Value for the counter if set */
1168     SlWlanRxFilterTriggerCompareFunction_t  CompareFunction; /* The compare function refers to the counter if set */
1169     _u8                                     Padding[3];
1170 } SlWlanRxFilterTrigger_t;
1171 
1172 /* The actions are executed only if the filter is matched,\n
1173  *  In case of false match the packet is transferred to the HOST. \n
1174  *  The action is composed of bit field structure, up to 2 actions can be defined per filter.\n  */
1175 typedef _u8 SlWlanRxFilterActionType_t;
1176 /* Possible values for SlWlanRxFilterActionType_t */
1177 #define SL_WLAN_RX_FILTER_ACTION_NULL               (0x0) /* No action to execute*/
1178 #define SL_WLAN_RX_FILTER_ACTION_DROP               (0x1) /* If not dropped ,The packet is passed to the next filter or in case it is the last filter to the host */
1179 #define SL_WLAN_RX_FILTER_ACTION_ON_REG_INCREASE    (0x4) /* action increase counter registers */
1180 #define SL_WLAN_RX_FILTER_ACTION_ON_REG_DECREASE    (0x8) /* action decrease counter registers */
1181 #define SL_WLAN_RX_FILTER_ACTION_ON_REG_RESET       (0x10)/* action reset counter registers */
1182 #define SL_WLAN_RX_FILTER_ACTION_SEND_TEMPLATE      (0x20)/* unsupported */
1183 #define SL_WLAN_RX_FILTER_ACTION_EVENT_TO_HOST      (0x40)/* action can send events to host */
1184 
1185 /* Several actions can be defined The action is executed in case the filter rule is matched. */
1186 typedef struct
1187 {
1188     SlWlanRxFilterActionType_t Type; /* Determine which actions are supported */
1189     _u8    Counter;    /* The counter in use. In case the action is of type increase\decrease\reset this arg will contain the counter number, The counter number values are as in  ::SlWlanRxFilterCounterId_t.\n*/
1190     _u16   Reserved;   /* Must be set to zero */
1191     _u8    UserId;     /* In case action set to host event, user can set id which will return in the event arguments */
1192     _u8    Padding[3];
1193 
1194 } SlWlanRxFilterAction_t;
1195 
1196 /* The supported operation: SL_WLAN_RX_FILTER_STATE, SL_WLAN_RX_FILTER_REMOVE */
1197 typedef struct
1198 {
1199     SlWlanRxFilterIdMask_t FilterBitmap;
1200     _u8 Padding[4];
1201 
1202 } SlWlanRxFilterOperationCommandBuff_t;
1203 
1204 /* The supported operation: SL_WLAN_RX_FILTER_UPDATE_ARGS */
1205 typedef struct
1206 {
1207     _u8  FilterId;
1208     _u8  BinaryOrAscii; /* Set 1 for Binary argument representation, 0 - for Ascii representation */
1209     _u8 Padding[2];
1210     SlWlanRxFilterRuleHeaderArgs_t Args;
1211 
1212 
1213 } SlWlanRxFilterUpdateArgsCommandBuff_t;
1214 
1215 /* Filters bitmap enable\disable status return value */
1216 typedef struct
1217 {
1218     SlWlanRxFilterIdMask_t FilterIdMask; /* The filter set bit map */
1219 
1220 }SlWlanRxFilterRetrieveStateBuff_t;
1221 
1222 /* Disbale/Enable system filters */
1223 typedef struct
1224 {
1225     SlWlanRxFilterSysFiltersMask_t  FilterBitmap; /* The filter set bit map */
1226 
1227 } SlWlanRxFilterSysFiltersSetStateBuff_t;
1228 
1229 /* System filters status return value */
1230 typedef struct
1231 {
1232     SlWlanRxFilterSysFiltersMask_t  FilterBitmap; /* The filter get bit map */
1233 
1234 } SlWlanRxFilterSysFiltersRetrieveStateBuff_t;
1235 
1236 /*****************************************************************************/
1237 /* Function prototypes                                                                       */
1238 /*****************************************************************************/
1239 
1240 
1241 /*!
1242     \brief Connect to wlan network as a station
1243 
1244     \param[in]      pName       Up to 32 bytes in case of STA the name is the SSID of the Access Point
1245     \param[in]      NameLen     Name length
1246     \param[in]      pMacAddr    6 bytes for MAC address
1247     \param[in]      pSecParams  Security parameters (use NULL key for SL_WLAN_SEC_TYPE_OPEN)\n
1248                                 security types options:
1249                                 - SL_WLAN_SEC_TYPE_OPEN
1250                                 - SL_WLAN_SEC_TYPE_WEP
1251                                 - SL_WLAN_SEC_TYPE_WEP_SHARED
1252                                 - SL_WLAN_SEC_TYPE_WPA_WPA2
1253                                 - SL_WLAN_SEC_TYPE_WPA2_PLUS
1254                                 - SL_WLAN_SEC_TYPE_WPA3
1255                                 - SL_WLAN_SEC_TYPE_WPA_ENT
1256                                 - SL_WLAN_SEC_TYPE_WPS_PBC
1257                                 - SL_WLAN_SEC_TYPE_WPS_PIN
1258                                 - SL_WLAN_SEC_TYPE_WPA_PMK - insert preprocessed PMK as key
1259 
1260     \param[in]      pSecExtParams  Enterprise parameters (set NULL in case Enterprise parameters is not in use)
1261 
1262     \return         Zero on success, or negative error code on failure
1263 
1264 
1265     \sa             sl_WlanDisconnect
1266     \note           Belongs to \ref ext_api
1267     \warning        -In this version only single enterprise mode could be used\n
1268                     -SL_WLAN_SEC_TYPE_WPA is a deprecated definition, the new definition is SL_WLAN_SEC_TYPE_WPA_WPA2
1269                     -SL_WLAN_SEC_TYPE_WPA2_PLUS enable to connect to WPA2, WPA2+PMF and WPA3 only networks
1270     \par Example
1271 
1272     - Connect without security:
1273     \code
1274             SlWlanSecParams_t secParams;
1275             secParams.Key = "";
1276             secParams.KeyLen = 0;
1277             secParams.Type = SL_WLAN_SEC_TYPE_OPEN;
1278             sl_WlanConnect("ssid_name", strlen("ssid_name"),0,&secParams,0);
1279     \endcode
1280 */
1281 #if _SL_INCLUDE_FUNC(sl_WlanConnect)
1282 _i16 sl_WlanConnect(const _i8*  pName,const  _i16 NameLen,const _u8 *pMacAddr,const SlWlanSecParams_t* pSecParams ,const SlWlanSecParamsExt_t* pSecExtParams);
1283 #endif
1284 
1285 /*!
1286     \brief Wlan disconnect
1287 
1288     Disconnect connection
1289 
1290     \return         Zero disconnected done successfully, other already disconnected
1291 
1292     \sa             sl_WlanConnect
1293     \note           belongs to \ref ext_api
1294     \warning
1295 */
1296 #if _SL_INCLUDE_FUNC(sl_WlanDisconnect)
1297 _i16 sl_WlanDisconnect(void);
1298 #endif
1299 
1300 /*!
1301     \brief Add profile
1302 
1303     When auto start is enabled, the device connects to a
1304     station from the profiles table. Up to 7 profiles (SL_WLAN_MAX_PROFILES) are
1305     supported.\n If several profiles configured the device chose
1306     the highest priority profile, within each priority group,
1307     device will chose profile based on security policy, signal
1308     strength, etc parameters.
1309 
1310     \param[in]      pName          Up to 32 bytes in case of STA the name is the
1311                                    SSID of the Access Point.\n
1312                                    In case of P2P the name is the remote device name.
1313     \param[in]      NameLen     Name length
1314     \param[in]      pMacAddr    6 bytes for MAC address
1315     \param[in]      pSecParams  Security parameters (use NULL key for SL_WLAN_SEC_TYPE_OPEN)\n
1316                                 Security types options:
1317                                 - SL_WLAN_SEC_TYPE_OPEN
1318                                 - SL_WLAN_SEC_TYPE_WEP
1319                                 - SL_WLAN_SEC_TYPE_WEP_SHARED
1320                                 - SL_WLAN_SEC_TYPE_WPA_WPA2
1321                                 - SL_WLAN_SEC_TYPE_WPA2_PLUS
1322                                 - SL_WLAN_SEC_TYPE_WPA3
1323                                 - SL_WLAN_SEC_TYPE_WPA_ENT
1324                                 - SL_WLAN_SEC_TYPE_WPS_PBC
1325                                 - SL_WLAN_SEC_TYPE_WPS_PIN
1326                                 - SL_WLAN_SEC_TYPE_WPA_PMK - insert preprocessed PMK as key
1327 
1328     \param[in]      pSecExtParams  Enterprise parameters - identity, identity length,
1329                                    Anonymous, Anonymous length, CertIndex (not supported,
1330                                    certificates need to be placed in a specific file ID),
1331                                    EapMethod.\n Use NULL in case Enterprise parameters is not in use
1332 
1333     \param[in]      Priority    Profile priority. Lowest priority: 0, Highest priority: 15.
1334     \param[in]      Options     Not supported
1335 
1336     \return         Profile stored index on success, or negative error code on failure.
1337     \par Persistent
1338                     Profiles are <b>Persistent</b>
1339     \sa             sl_WlanProfileGet , sl_WlanProfileDel
1340     \note           belongs to \ref ext_api
1341     \warning        -Only one Enterprise profile is supported.\n
1342                     -Please Note that in case of adding an existing profile (compared by pName,pMACAddr and security type)
1343                      the old profile will be deleted and the same index will be returned.\n
1344                     -SL_WLAN_SEC_TYPE_WPA is a deprecated definition, the new definition is SL_WLAN_SEC_TYPE_WPA_WPA2
1345                     -SL_WLAN_SEC_TYPE_WPA2_PLUS enable to connect to WPA2, WPA2+PMF and WPA3 only networks
1346 
1347 */
1348 #if _SL_INCLUDE_FUNC(sl_WlanProfileAdd)
1349 _i16 sl_WlanProfileAdd(const _i8*  pName,const  _i16 NameLen,const _u8 *pMacAddr,const SlWlanSecParams_t* pSecParams ,const SlWlanSecParamsExt_t* pSecExtParams,const _u32 Priority,const _u32  Options);
1350 #endif
1351 
1352 /*!
1353     \brief Profile Update
1354 
1355     Update one or more of the existing profile parameters: SSID, BSSID, priority, security parameters
1356 
1357     \param[in]      Index          Profile index to update
1358     \param[in]      pName          Up to 32 bytes in case of STA the name is the
1359                                    SSID of the Access Point.  In case of P2P the name is the remote device name.
1360                                    NULL in case update is not needed\n
1361 
1362     \param[in]      NameLen        Name length. zero in case update is not needed\n
1363     \param[in]      pMacAddr       6 bytes for MAC address, NULL in case update is not needed\n
1364     \param[in]      pSecParams     Security parameters (use NULL key for SL_WLAN_SEC_TYPE_OPEN)\n
1365                    Security types options:
1366                        - SL_WLAN_SEC_TYPE_OPEN
1367                        - SL_WLAN_SEC_TYPE_WEP
1368                        - SL_WLAN_SEC_TYPE_WEP_SHARED
1369                        - SL_WLAN_SEC_TYPE_WPA_WPA2
1370                        - SL_WLAN_SEC_TYPE_WPA2_PLUS
1371                        - SL_WLAN_SEC_TYPE_WPA3
1372                        - SL_WLAN_SEC_TYPE_WPA_ENT
1373                        - SL_WLAN_SEC_TYPE_WPS_PBC
1374                        - SL_WLAN_SEC_TYPE_WPS_PIN \n
1375 
1376                     In case update is not needed, set to SL_WLAN_DONT_UPDATE
1377 
1378     \param[in]      pSecExtParams  Enterprise parameters - identity, identity length,
1379                                    Anonymous, Anonymous length, CertIndex (not supported,
1380                                    certificates need to be placed in a specific file ID),
1381                                    EapMethod.\n Use NULL in case Enterprise parameters is not in use or does not need to be updated
1382 
1383     \param[in]      Priority    Profile priority. Lowest priority: 0, Highest priority: 15. In case update is not needed, set to SL_WLAN_DONT_UPDATE
1384 
1385     \return         Zero on success or a negative error code on failure
1386     \par Persistent
1387                     Profiles are <b>Persistent</b>
1388     \sa             sl_WlanProfileGet , sl_WlanProfileDel, sl_WlanProfileAdd
1389     \note           belongs to \ref ext_api
1390     \warning        In order to keep original security or priority values, set value to SL_WLAN_DONT_UPDATE
1391                     Note: If WPA profile SSID is being updated, security parameters including the password must be supplied as well.
1392     \par    Example
1393     <b>Update priority in profile index 0: </b><br>
1394     \code
1395         SlWlanSecParams_t SecParams;
1396         _u32 Priority;
1397         _u32 index;
1398 
1399         SecParams.Key = "";
1400         SecParams.KeyLen = 0;
1401         SecParams.Type = SL_WLAN_DONT_UPDATE;
1402         Priority  = 4;
1403         index = 0;
1404 
1405         RetVal = sl_WlanProfileUpdate(index, NULL,0,NULL,&SecParams ,NULL,Priority);
1406     \endcode
1407 */
1408 
1409 #if _SL_INCLUDE_FUNC(sl_WlanProfileUpdate)
1410 _i16 sl_WlanProfileUpdate(const _u32  Index, const _i8*  pName,const  _i16 NameLen,const  _u8 *pMacAddr,const  SlWlanSecParams_t* pSecParams ,const SlWlanSecParamsExt_t* pSecExtParams,const _u32  Priority);
1411 #endif
1412 /*!
1413     \brief Get profile
1414 
1415     Read profile from the device
1416 
1417     \param[in]      Index          Profile stored index, if index does not exists error is return
1418     \param[out]     pName          Up to 32 bytes, in case of sta mode the name of the Access Point\n
1419                                    In case of p2p mode the name of the Remote Device
1420     \param[out]     pNameLen       Name length
1421     \param[out]     pMacAddr       6 bytes for MAC address
1422     \param[out]     pSecParams     Security parameters. Security types options:
1423                                     - SL_WLAN_SEC_TYPE_OPEN
1424                                     - SL_WLAN_SEC_TYPE_WEP
1425                                     - SL_WLAN_SEC_TYPE_WEP_SHARED
1426                                     - SL_WLAN_SEC_TYPE_WPA_WPA2
1427                                     - SL_WLAN_SEC_TYPE_WPA2_PLUS
1428                                     - SL_WLAN_SEC_TYPE_WPA3
1429                                     - SL_WLAN_SEC_TYPE_WPA_ENT
1430                                     - SL_WLAN_SEC_TYPE_WPS_PBC
1431                                     - SL_WLAN_SEC_TYPE_WPS_PIN
1432                                    Key and key length are not return. In case of p2p security type pin the key refers to pin code
1433                                    return due to security reasons.
1434     \param[out]     pSecExtParams  Enterprise parameters - identity, identity
1435                                    length, Anonymous, Anonymous length
1436                                    CertIndex (not supported), EapMethod.
1437     \param[out]     pPriority      Profile priority
1438 
1439     \return         Profile security type is returned (0 or positive number) on success, or negative error code on failure
1440                     SL_ERROR_WLAN_GET_PROFILE_INVALID_INDEX is return is profile index does not exist
1441 
1442     \sa             sl_WlanProfileAdd , sl_WlanProfileDel
1443     \note           belongs to \ref ext_api
1444     \warning
1445 */
1446 #if _SL_INCLUDE_FUNC(sl_WlanProfileGet)
1447 _i16 sl_WlanProfileGet(const _i16 Index,_i8*  pName, _i16 *pNameLen, _u8 *pMacAddr, SlWlanSecParams_t* pSecParams, SlWlanGetSecParamsExt_t* pSecExtParams, _u32 *pPriority);
1448 #endif
1449 
1450 /*!
1451     \brief Delete WLAN profile
1452 
1453     Delete WLAN profile
1454 
1455     \param[in]   Index  number of profile to delete. Possible values are 0 to 6.\n
1456                  Index value SL_WLAN_DEL_ALL_PROFILES will delete all saved profiles
1457 
1458     \return  Zero on success or a negative error code on failure
1459     \par Persistent
1460             Profile deletion is  <b>Persistent</b>
1461     \sa   sl_WlanProfileAdd , sl_WlanProfileGet
1462     \note           belongs to \ref ext_api
1463     \warning
1464 */
1465 #if _SL_INCLUDE_FUNC(sl_WlanProfileDel)
1466 _i16 sl_WlanProfileDel(const _i16 Index);
1467 #endif
1468 
1469 /*!
1470     \brief Set policy values
1471 
1472     \param[in]      Type      Type of policy to be modified. The Options are:
1473                               - SL_WLAN_POLICY_CONNECTION
1474                               - SL_WLAN_POLICY_SCAN
1475                               - SL_WLAN_POLICY_PM
1476                               - SL_WLAN_POLICY_P2P
1477     \param[in]      Policy    The option value which depends on action type
1478     \param[in]      pVal      An optional value pointer
1479     \param[in]      ValLen    An optional value length, in bytes
1480     \return         Zero on success or negative error code on failure.
1481     \par Persistent
1482             All parameters are <b>System Persistent</b>\n
1483             Note that for SL_WLAN_POLICY_SCAN - Interval and Policy will be System persistent, but the hidden SSID option will not be persistent
1484 
1485     \sa             sl_WlanPolicyGet
1486     \note           belongs to \ref ext_api
1487     \warning
1488     \par    Example
1489 
1490       <b>SL_WLAN_POLICY_CONNECTION: </b><br> defines options available to connect the CC31xx device to the AP:
1491       The options below could be combined to a single action, if more than one action is required.
1492 
1493     - Auto Connect: If is set, the CC31xx device tries to automatically reconnect to one of its stored profiles,
1494       each time the connection fails or the device is rebooted. To set this option, use:
1495     \code
1496         sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION,SL_WLAN_CONNECTION_POLICY(1,0,0,0),NULL,0);
1497     \endcode
1498     <br>
1499 
1500 
1501     - Fast Connect: If  is set, the CC31xx device tries to establish a fast connection to AP.
1502       To set this option, use:
1503     \code
1504         sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION,SL_WLAN_CONNECTION_POLICY(0,1,0,0),NULL,0)
1505     \endcode
1506     <br>
1507 
1508     - P2P: If is set (relevant for P2P mode only),  CC31xx/CC32xx device tries to automatically
1509       connect to the first P2P device available, supporting push button only. To set this option, use:
1510     \code
1511         sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION,SL_WLAN_CONNECTION_POLICY(0,0,1,0),NULL,0)
1512     \endcode
1513     <br>
1514 
1515     - Auto Provisioning - If is set, the CC31xx device will automatically start the provisioning process
1516       after a long period of disconnection when profiles exist to set this option, use:
1517     \code
1518         sl_WlanPolicySet(SL_WLAN_POLICY_CONNECTION,SL_WLAN_CONNECTION_POLICY(0,0,0,1),NULL,0)
1519     \endcode \n
1520 
1521 
1522     <b>SL_WLAN_POLICY_SCAN:</b><br> defines system scan time interval. \nDefault interval is 10 minutes.
1523     After settings scan interval, an immediate scan is activated.\n The next scan will be based on the interval settings.
1524     For AP scan, minimum interval is 10 seconds.
1525 
1526     -  With hidden SSID: For example, setting scan interval to 1 minute interval use including hidden ssid:
1527     \code
1528         _u32 intervalInSeconds = 60;
1529         sl_WlanPolicySet(SL_WLAN_POLICY_SCAN,SL_WLAN_SCAN_POLICY(1,1), (_u8 *)&intervalInSeconds,sizeof(intervalInSeconds));
1530     \endcode
1531     <br>
1532 
1533     -  No hidden SSID: setting scan interval to 1 minute interval use, not including hidden ssid:
1534     \code
1535         _u32 intervalInSeconds = 60;
1536         sl_WlanPolicySet(SL_WLAN_POLICY_SCAN,SL_WLAN_SCAN_POLICY(1,0), (_u8 *)&intervalInSeconds,sizeof(intervalInSeconds));
1537     \endcode
1538     <br>
1539 
1540     -  Disable scan:
1541     \code
1542         #define SL_WLAN_DISABLE_SCAN 0
1543         _u32 intervalInSeconds = 0;
1544         sl_WlanPolicySet(SL_WLAN_POLICY_SCAN,SL_WLAN_DISABLE_SCAN,(_u8 *)&intervalInSeconds,sizeof(intervalInSeconds));
1545     \endcode
1546     <br>
1547 
1548     <b>SL_WLAN_POLICY_PM: </b><br> defines a power management policy for Station mode only:
1549     -  Normal power management (default) policy use:
1550     \code
1551         sl_WlanPolicySet(SL_WLAN_POLICY_PM , SL_WLAN_NORMAL_POLICY, NULL,0)
1552     \endcode
1553     <br>
1554 
1555     - Low latency power management policy use:
1556     \code
1557         sl_WlanPolicySet(SL_WLAN_POLICY_PM , SL_WLAN_LOW_LATENCY_POLICY, NULL,0)
1558     \endcode
1559     <br>
1560 
1561     - Low power management policy use:
1562     \code
1563         sl_WlanPolicySet(SL_WLAN_POLICY_PM , SL_WLAN_LOW_POWER_POLICY, NULL,0)
1564     \endcode
1565     <br>
1566 
1567     - Always on power management policy use:
1568     \code
1569         sl_WlanPolicySet(SL_WLAN_POLICY_PM , SL_WLAN_ALWAYS_ON_POLICY, NULL,0)
1570     \endcode
1571     <br>
1572 
1573     - Long Sleep Interval policy use:
1574     \code
1575     SlWlanPmPolicyParams_t PmPolicyParams;
1576     memset(&PmPolicyParams,0,sizeof(SlWlanPmPolicyParams_t));
1577     PmPolicyParams.MaxSleepTimeMs = 800;  //max sleep time in mSec
1578     sl_WlanPolicySet(SL_WLAN_POLICY_PM , SL_WLAN_LONG_SLEEP_INTERVAL_POLICY, (_u8*)&PmPolicyParams,sizeof(PmPolicyParams));
1579     \endcode
1580     <br>
1581 
1582     - IOT low power policy use:
1583     \code
1584         SlWlanPmPolicyParams_t PmPolicyParams;
1585         memset(&PmPolicyParams,0,sizeof(SlWlanPmPolicyParams_t));
1586         PmPolicyParams.MaxSleepTimeMs = IOTLP_MIN_DURATION_IN_MSEC; //min sleep duration in mSec
1587         sl_WlanPolicySet(SL_WLAN_POLICY_PM , SL_WLAN_IOT_LOW_POWER_POLICY, (uint8_t *)&PmPolicyParams, sizeof(PmPolicyParams));
1588     \endcode
1589     <br>
1590 
1591     <b>SL_WLAN_POLICY_P2P: </b><br> defines p2p negotiation policy parameters for P2P role:
1592     - To set intent negotiation value, set on of the following:\n
1593         SL_WLAN_P2P_ROLE_NEGOTIATE   - intent 3 \n
1594         SL_WLAN_P2P_ROLE_GROUP_OWNER - intent 15 \n
1595         SL_WLAN_P2P_ROLE_CLIENT      - intent 0 \n
1596     <br>
1597     - To set negotiation initiator value (initiator policy of first negotiation action frame), set on of the following: \n
1598         SL_WLAN_P2P_NEG_INITIATOR_ACTIVE \n
1599         SL_WLAN_P2P_NEG_INITIATOR_PASSIVE \n
1600         SL_WLAN_P2P_NEG_INITIATOR_RAND_BACKOFF \n
1601     \code
1602         sl_WlanPolicySet(SL_WLAN_POLICY_P2P, SL_WLAN_P2P_POLICY(SL_WLAN_P2P_ROLE_NEGOTIATE,SL_WLAN_P2P_NEG_INITIATOR_RAND_BACKOFF),NULL,0);
1603     \endcode
1604 */
1605 #if _SL_INCLUDE_FUNC(sl_WlanPolicySet)
1606 _i16 sl_WlanPolicySet(const _u8 Type , const _u8 Policy, _u8 *pVal,const _u8 ValLen);
1607 #endif
1608 /*!
1609     \brief Get policy values
1610 
1611     \param[in]      Type
1612                         - SL_WLAN_POLICY_CONNECTION
1613                         - SL_WLAN_POLICY_SCAN
1614                         - SL_WLAN_POLICY_PM, SL_WLAN_POLICY_P2P
1615     \param[out]     pPolicy       argument may be set to any value
1616     \param[out]     pVal         The returned values, depends on each policy type, will be stored in the allocated buffer pointed by pVal
1617                     with a maximum buffer length set by the calling function and pointed to by argument *pValLen
1618     \param[out]     pValLen        actual value length
1619     \return         Zero on success, or negative error code on failure
1620 
1621     \sa             sl_WlanPolicySet
1622 
1623     \note           belongs to \ref ext_api
1624 
1625     \warning        The value pointed by the argument *pValLen should be set to a value different from 0 and
1626                     greater than the buffer length returned from the SL device. Otherwise, an error will be returned.
1627 
1628     \par Example
1629 
1630     - SL_WLAN_POLICY_CONNECTION - Get connection policy:
1631     \code
1632     _u8 Policy = 0;
1633     int length = sizeof(PolicyOption);
1634     int ret;
1635     ret = sl_WlanPolicyGet(SL_WLAN_POLICY_CONNECTION ,&Policy,0,(_u8*)&length);
1636 
1637     if (Policy & SL_WLAN_CONNECTION_POLICY(1, 1 , 0 , 0 ))
1638     {
1639         printf("Connection Policy is set to Auto + Fast");
1640     }
1641     \endcode
1642     <br>
1643 
1644     - SL_WLAN_POLICY_SCAN - Get scan policy:
1645     \code
1646     int ScanInterval = 0;  //default value is 600 seconds
1647     _u8 Policy = 0;       //default value is 0 (disabled)
1648     int ret;
1649     length = sizeof(ScanInterval);
1650     ret = sl_WlanPolicyGet(SL_WLAN_POLICY_SCAN ,&Policy,(_u8*)&ScanInterval,(_u8*)&length);
1651 
1652     if (Policy & SL_WLAN_SCAN_POLICY(0 ,1))
1653     {
1654         printf("Scan Policy is set to Scan visible ssid ");
1655     }
1656     if (Policy & SL_WLAN_SCAN_POLICY(1, 0))
1657     {
1658         printf("Scan Policy is set to Scan hidden ssid ");
1659     }
1660     \endcode
1661     <br>
1662 
1663     - SL_WLAN_POLICY_PM - Get power management policy:
1664     \code
1665     _u8 Policy = 0;
1666     int ret;
1667     SlWlanPmPolicyParams_t PmPolicyParams;
1668     length = sizeof(PmPolicyParams);
1669     ret = sl_WlanPolicyGet(SL_POLICY_PM ,&Policy,&PmPolicyParams,(_u8*)&length);
1670     if (Policy ==  SL_WLAN_LONG_SLEEP_INTERVAL_POLICY )
1671     {
1672         printf("Connection Policy is set to LONG SLEEP INTERVAL POLICY with interval = %d ",PmPolicyParams.MaxSleepTimeMs);
1673     }
1674     \endcode
1675     <br>
1676 
1677     -  SL_WLAN_POLICY_P2P - Get P2P policy:
1678     \code
1679     _u8 Policy = 0;
1680     int ret;
1681     length = sizeof(Policy);
1682     ret = sl_WlanPolicyGet(SL_WLAN_POLICY_P2P ,&Policy,0,(_u8*)&length);
1683     //SL_WLAN_P2P_POLICY(p2pNegType, p2pNegInitiator)
1684     if (Policy &  SL_WLAN_P2P_POLICY(0,SL_WLAN_P2P_NEG_INITIATOR_RAND_BACKOFF))
1685     {
1686         printf("P2P Policy is set to Rand backoff");
1687     }
1688     if (Policy &  SL_WLAN_P2P_POLICY(SL_WLAN_P2P_ROLE_NEGOTIATE,0))
1689     {
1690         printf("P2P Policy is set to Role Negotiate");
1691     }
1692     \endcode
1693     <br>
1694 
1695 */
1696 #if _SL_INCLUDE_FUNC(sl_WlanPolicyGet)
1697 _i16 sl_WlanPolicyGet(const _u8 Type ,_u8 *pPolicy,_u8 *pVal,_u8 *pValLen);
1698 #endif
1699 /*!
1700     \brief Gets the WLAN scan operation results
1701 
1702     Gets scan results , gets entry from scan result table
1703 
1704     \param[in]   Index      Starting index identifier (range 0-29) for getting scan results
1705     \param[in]   Count      How many entries to fetch. Max is (30-"Index").
1706     \param[out]  pEntries      Pointer to an allocated SlWlanNetworkEntry_t.
1707                             The number of array items should match "Count" \n
1708                             sec_type:
1709                                 - SL_WLAN_SCAN_SEC_TYPE_OPEN
1710                                 - SL_WLAN_SCAN_SEC_TYPE_WEP
1711                                 - SL_WLAN_SCAN_SEC_TYPE_WPA
1712                                 - SL_WLAN_SCAN_SEC_TYPE_WPA2
1713 
1714     \return  Number of valid networks list items
1715     \sa
1716     \note       belongs to \ref ext_api
1717     \warning    This command do not initiate any active scanning action
1718     \par        Example
1719 
1720     - Fetching max 10 results:
1721     \code
1722     SlWlanNetworkEntry_t netEntries[10];
1723     _u8 i;
1724     _i16 resultsCount = sl_WlanGetNetworkList(0,10,&netEntries[0]);
1725     for(i=0; i< resultsCount; i++)
1726     {
1727         printf("%d. ", i + 1);
1728         printf("SSID: %.32s        ", Entries[i].Ssid);
1729         printf("BSSID: %x:%x:%x:%x:%x:%x    ", Entries[i].Bssid[0], Entries[i].Bssid[1], Entries[i].Bssid[2], Entries[i].Bssid[3], Entries[i].Bssid[4], Entries[i].Bssid[5]);
1730         printf("Channel: %d    ", Entries[i].Channel);
1731         printf("RSSI: %d    ", Entries[i].Rssi);
1732         printf("Security type: %d    ", SL_WLAN_SCAN_RESULT_SEC_TYPE_BITMAP(Entries[i].SecurityInfo));
1733         printf("Group Cipher: %d    ", SL_WLAN_SCAN_RESULT_GROUP_CIPHER(Entries[i].SecurityInfo));
1734         printf("Unicast Cipher bitmap: %d    ", SL_WLAN_SCAN_RESULT_UNICAST_CIPHER_BITMAP(Entries[i].SecurityInfo));
1735         printf("Key Mgmt suites bitmap: %d    ", SL_WLAN_SCAN_RESULT_KEY_MGMT_SUITES_BITMAP(Entries[i].SecurityInfo));
1736         printf("Hidden SSID: %d    ", SL_WLAN_SCAN_RESULT_HIDDEN_SSID(Entries[i].SecurityInfo));
1737         printf("PMF Enable: %d    ", SL_WLAN_SCAN_RESULT_PMF_ENABLE(Entries[i].SecurityInfo));
1738         printf("PMF Required: %d\r\n", SL_WLAN_SCAN_RESULT_PMF_REQUIRED(Entries[i].SecurityInfo));
1739     }
1740     \endcode
1741 */
1742 #if _SL_INCLUDE_FUNC(sl_WlanGetNetworkList)
1743 _i16 sl_WlanGetNetworkList(const _u8 Index,const  _u8 Count, SlWlanNetworkEntry_t *pEntries);
1744 #endif
1745 
1746 /*!
1747     \brief Gets the WLAN scan operation results
1748 
1749     Gets scan results with extended information (Country info), gets entry from scan result table
1750 
1751     \param[in]   Index      Starting index identifier (range 0-29) for getting scan results
1752     \param[in]   Count      How many entries to fetch. Max is (30-"Index").
1753     \param[out]  pEntries   Pointer to an allocated SlWlanExtNetworkEntry_t.
1754                             The number of array items should match "Count" \n
1755                             sec_type:
1756                                 - SL_WLAN_SCAN_SEC_TYPE_OPEN
1757                                 - SL_WLAN_SCAN_SEC_TYPE_WEP
1758                                 - SL_WLAN_SCAN_SEC_TYPE_WPA
1759                                 - SL_WLAN_SCAN_SEC_TYPE_WPA2
1760 
1761     \return  Number of valid networks list items
1762     \sa
1763     \note       belongs to \ref ext_api
1764     \warning    This command do not initiate any active scanning action
1765     \par        Example
1766 
1767     - Fetching max 10 results:
1768     \code
1769     SlWlanExtNetworkEntry_t netEntries[10];
1770     _u8 i;
1771     _i16 resultsCount = sl_WlanGetExtNetworkList(0,10,&netEntries[0]);
1772     for(i=0; i< resultsCount; i++)
1773     {
1774         printf("%d. ",i+1);
1775         printf("SSID: %.32s        ",netEntries[i].Ssid);
1776         printf("BSSID: %x:%x:%x:%x:%x:%x    ",netEntries[i].Bssid[0],netEntries[i].Bssid[1],netEntries[i].Bssid[2],netEntries[i].Bssid[3],netEntries[i].Bssid[4],netEntries[i].Bssid[5]);
1777         printf("Channel: %d    ",netEntries[i].Channel);
1778         printf("RSSI: %d    ",netEntries[i].Rssi);
1779         printf("Security type: %d    ",SL_WLAN_SCAN_RESULT_SEC_TYPE_BITMAP(netEntries[i].SecurityInfo));
1780         printf("Group Cipher: %d    ",SL_WLAN_SCAN_RESULT_GROUP_CIPHER(netEntries[i].SecurityInfo));
1781         printf("Unicast Cipher bitmap: %d    ",SL_WLAN_SCAN_RESULT_UNICAST_CIPHER_BITMAP(netEntries[i].SecurityInfo));
1782         printf("Key Mgmt suites bitmap: %d    ",SL_WLAN_SCAN_RESULT_KEY_MGMT_SUITES_BITMAP(netEntries[i].SecurityInfo));
1783         printf("Hidden SSID: %d\r\n",SL_WLAN_SCAN_RESULT_HIDDEN_SSID(netEntries[i].SecurityInfo));
1784         // extended area
1785         printf("CountryStr=%c%c\r\n", netEntries[i].CountryStr[0], netEntries[i].CountryStr[1]);
1786         printf("0x%04x \r\n", netEntries[i].Supported_2_4G_Channels);
1787         printf("0x%08x  \r\n", netEntries[i].Supported_5_0G_Channels);
1788     }
1789     \endcode
1790 */
1791 #if _SL_INCLUDE_FUNC(sl_WlanGetExtNetworkList)
1792 _i16 sl_WlanGetExtNetworkList(const _u8 Index,const  _u8 Count, SlWlanExtNetworkEntry_t *pEntries);
1793 #endif
1794 
1795 
1796 /*!
1797     \brief   Start collecting wlan RX statistics, for unlimited time.
1798 
1799     \par Parameters
1800         None
1801     \return  Zero on success, or negative error code on failure
1802 
1803     \sa      sl_WlanRxStatStop      sl_WlanRxStatGet
1804     \note    Belongs to \ref ext_api
1805     \warning
1806     \par     Example
1807 
1808     - Getting wlan RX statistics:
1809     \code
1810     void RxStatCollectTwice()
1811     {
1812         SlWlanGetRxStatResponse_t rxStat;
1813         _i16 rawSocket;
1814         _i8 DataFrame[200];
1815         struct SlTimeval_t timeval;
1816         timeval.tv_sec =  0;             // Seconds
1817         timeval.tv_usec = 20000;         // Microseconds. 10000 microseconds resolution
1818 
1819         sl_WlanRxStatStart();  // set statistics mode
1820 
1821         rawSocket = sl_Socket(SL_AF_RF, SL_SOCK_RAW, eChannel);
1822         // set timeout - in case we have no activity for the specified channel
1823         sl_SetSockOpt(rawSocket,SL_SOL_SOCKET,SL_SO_RCVTIMEO, &timeval, sizeof(timeval));    // Enable receive timeout
1824         status = sl_Recv(rawSocket, DataFrame, sizeof(DataFrame), 0);
1825 
1826         sleep(1); // sleep for 1 sec
1827         sl_WlanRxStatGet(&rxStat,0); // statistics has been cleared upon read
1828         sleep(1); // sleep for 1 sec
1829         sl_WlanRxStatGet(&rxStat,0);
1830     }
1831     \endcode
1832 */
1833 #if _SL_INCLUDE_FUNC(sl_WlanRxStatStart)
1834 _i16 sl_WlanRxStatStart(void);
1835 #endif
1836 
1837 
1838 
1839 /*!
1840     \brief Get wlan RX statistics. Upon calling this command, the statistics counters will be cleared.
1841 
1842     \param[in]  pRxStat       Pointer to SlWlanGetRxStatResponse_t filled with Rx statistics results
1843     \param[in]  Flags         Should be 0  ( not applicable right now, will be added the future )
1844     \return     Zero on success, or negative error code on failure
1845 
1846     \sa         sl_WlanRxStatStart  sl_WlanRxStatStop
1847     \note       Belongs to \ref ext_api
1848     \warning
1849 */
1850 #if _SL_INCLUDE_FUNC(sl_WlanRxStatGet)
1851 _i16 sl_WlanRxStatGet(SlWlanGetRxStatResponse_t *pRxStat,const _u32 Flags);
1852 #endif
1853 /*!
1854     \brief    Stop collecting wlan RX statistic, (if previous called sl_WlanRxStatStart)
1855 
1856     \par      Parameters
1857               None
1858     \return   Zero on success, or negative error code on failure
1859 
1860     \sa       sl_WlanRxStatStart      sl_WlanRxStatGet
1861     \note     Belongs to \ref ext_api
1862     \warning
1863 */
1864 #if _SL_INCLUDE_FUNC(sl_WlanRxStatStop)
1865 _i16 sl_WlanRxStatStop(void);
1866 #endif
1867 
1868 
1869 /*!
1870     \brief  The simpleLink will switch to the appropriate role according to the provisioning mode requested
1871             and will start the provisioning process.
1872 
1873     \param[in]  ProvisioningCmd
1874                                             - SL_WLAN_PROVISIONING_CMD_START_MODE_AP                          0: Start AP provisioning (AP role)
1875                                             - SL_WLAN_PROVISIONING_CMD_START_MODE_SC                          1: Start Smart Config provisioning (STA role)
1876                                             - SL_WLAN_PROVISIONING_CMD_START_MODE_APSC                        2: Start AP+Smart Config provisioning (AP role)
1877                                             - SL_WLAN_PROVISIONING_CMD_START_MODE_APSC_EXTERNAL_CONFIGURATION 3: Start AP + Smart Config + external provisioning (AP role)
1878                                             - SL_WLAN_PROVISIONING_CMD_STOP                                   4: Stop provisioning
1879                                             - SL_WLAN_PROVISIONING_CMD_ABORT_EXTERNAL_CONFIGURATIONC          5:
1880     \param[in]  RequestedRoleAfterSuccess   The role that the SimpleLink will switch to in case of a successful provisioning.
1881                                             0: STA
1882                                             2: AP
1883                                             0xFF: stay in current role (relevant only in provisioning_stop)
1884     \param[in]  InactivityTimeoutSec -      The period of time (in seconds) the system waits before it automatically
1885                                             stops the provisioning process when no activity is detected.
1886                                             set to 0 in order to stop provisioning. Minimum InactivityTimeoutSec is 30 seconds.
1887     \param[in]  pSmartConfigKey             Smart Config key: public key for smart config process - must be 16 chars (relevant for smart config only)
1888     \param[in]  Flags                       Can have the following values:
1889                                                    - SL_WLAN_PROVISIONING_CMD_FLAG_EXTERNAL_CONFIRMATION - Confirmation phase will be completed externally by host (e.g. via cloud assist)
1890 
1891 
1892     \return     Zero on success, or negative error code on failure
1893 
1894     \sa
1895     \warning
1896     \par       Example
1897 
1898     - Start Provisioning - start as STA after success with inactivity timeout of 10 minutes:
1899     \code
1900         sl_WlanProvisioning(SL_WLAN_PROVISIONING_CMD_START_MODE_APSC, ROLE_STA, 600, "Key0Key0Key0Key0", 0x0);
1901     \endcode
1902     <br>
1903 
1904     - Stop Provisioning:
1905     \code
1906         sl_WlanProvisioning(SL_WLAN_PROVISIONING_CMD_STOP,0xFF,0,NULL, 0x0);
1907     \endcode
1908     <br>
1909 
1910     - Start AP Provisioning with inactivity timeout of 10 minutes
1911     \code
1912         sl_WlanProvisioning(SL_WLAN_PROVISIONING_CMD_START_MODE_APSC,ROLE_AP,600,NULL, 0x0);
1913     \endcode
1914     <br>
1915 
1916     - Start AP Provisioning with inactivity timeout of 10 minutes and complete confirmation via user cloud assist
1917     \code
1918         sl_WlanProvisioning(SL_WLAN_PROVISIONING_CMD_START_MODE_APSC, ROLE_AP, 600, NULL, SL_WLAN_PROVISIONING_CMD_FLAG_EXTERNAL_CONFIRMATION);
1919     \endcode
1920     <br>
1921 
1922 */
1923 
1924 #if _SL_INCLUDE_FUNC(sl_WlanProvisioning)
1925 _i16 sl_WlanProvisioning(_u8 ProvisioningCmd, _u8 RequestedRoleAfterSuccess, _u16 InactivityTimeoutSec,  char *pSmartConfigKey, _u32 Flags);
1926 #endif
1927 
1928 
1929 
1930 /*!
1931     \brief Wlan set mode
1932 
1933     Setting WLAN mode
1934 
1935     \param[in] Mode  WLAN mode to start the CC31xx device. Possible options are
1936                     - ROLE_STA - for WLAN station mode
1937                     - ROLE_AP  - for WLAN AP mode
1938                     - ROLE_P2P  -for WLAN P2P mode
1939                     - ROLE_TAG  -for TAG mode - WLAN STA not connected
1940     \return   Zero on success, or negative error code on failure
1941     \par Persistent
1942           Mode is <b>Persistent</b>
1943     \sa        sl_Start sl_Stop
1944     \note      Belongs to \ref ext_api
1945     \warning   After setting the mode the system must be restarted for activating the new mode
1946     \par       Example
1947 
1948     - Switch from any role to STA:
1949     \code
1950         sl_WlanSetMode(ROLE_STA);
1951         sl_Stop(0);
1952         sl_Start(NULL,NULL,NULL);
1953     \endcode
1954 
1955 */
1956 #if _SL_INCLUDE_FUNC(sl_WlanSetMode)
1957 _i16 sl_WlanSetMode(const _u8  Mode);
1958 #endif
1959 
1960 
1961 /*!
1962     \brief     Setting WLAN configurations
1963 
1964     \param[in] ConfigId -  configuration id
1965                           - <b>SL_WLAN_CFG_AP_ID</b>
1966                           - <b>SL_WLAN_CFG_GENERAL_PARAM_ID</b>
1967                           - <b>SL_WLAN_CFG_P2P_PARAM_ID</b>
1968                           - <b>SL_WLAN_RX_FILTERS_ID</b>
1969 
1970     \param[in] ConfigOpt - configurations option
1971                           - <b>SL_WLAN_CFG_AP_ID</b>
1972                               - <b>SL_WLAN_AP_OPT_SSID</b> \n
1973                                       Set SSID for AP mode. \n
1974                                       This options takes <b>_u8</b> buffer as parameter
1975                               - <b>SL_WLAN_AP_OPT_CHANNEL</b> \n
1976                                       Set channel for AP mode. \n
1977                                       The channel is dependant on the country code which is set. i.e. for "US" the channel should be in the range of [1-11] \n
1978                                       This option takes <b>_u8</b> as a parameter
1979                               - <b>SL_WLAN_AP_OPT_HIDDEN_SSID</b> \n
1980                                       Set Hidden SSID Mode for AP mode.Hidden options: \n
1981                                          0: disabled \n
1982                                          1: Send empty (length=0) SSID in beacon and ignore probe request for broadcast SSID \n
1983                                          2: Clear SSID (ASCII 0), but keep the original length (this may be required with some \n
1984                                             clients that do not support empty SSID) and ignore probe requests for broadcast SSID \n
1985                                       This option takes <b>_u8</b> as a parameter
1986                               - <b>SL_WLAN_AP_OPT_SECURITY_TYPE</b> \n
1987                                       Set Security type for AP mode. Security options are:
1988                                       - Open security: SL_WLAN_SEC_TYPE_OPEN
1989                                       - WEP security:  SL_WLAN_SEC_TYPE_WEP
1990                                       - WPA security:  SL_WLAN_SEC_TYPE_WPA_WPA2  \n
1991                                       This option takes <b>_u8</b> pointer as a parameter
1992                               - <b>SL_WLAN_AP_OPT_PASSWORD</b> \n
1993                                       Set Password for for AP mode (for WEP or for WPA): \n
1994                                       Password - for WPA: 8 - 63 characters \n
1995                                       for WEP: 5 / 13 characters (ascii) \n
1996                                       This options takes <b>_u8</b> buffer as parameter
1997                               - <b>SL_WLAN_AP_OPT_MAX_STATIONS</b> \n
1998                                       Set Max AP stations - 1..4 - Note: can be less than the number of currently connected stations \n
1999                                       max_stations - 1 characters \n
2000                                       This options takes <b>_u8</b> buffer as parameter
2001                               - <b>SL_WLAN_AP_OPT_MAX_STA_AGING</b> \n
2002                                       Set Max station ageing time - default is 60 seconds \n
2003                                       max_stations - 2 characters \n
2004                                       This options takes <b>_u16</b> buffer as parameter
2005                               - <b>SL_WLAN_AP_ACCESS_LIST_MODE</b> \n
2006                                       Set AP access list mode - DISABLE, DENY_LIST \n
2007                                       mode - 1 characters \n
2008                                       This options takes <b>_u8</b> buffer as parameter
2009                               - <b>SL_WLAN_AP_ACCESS_LIST_ADD_MAC</b> \n
2010                                       Add MAC address to the AP access list: \n
2011                                       mac_addr - 6 characters \n
2012                                       This options takes <b>_u8</b> buffer as parameter
2013                               - <b>SL_WLAN_AP_ACCESS_LIST_DEL_MAC</b> \n
2014                                       Del MAC address from the AP access list: \n
2015                                       mac_addr - 6 characters \n
2016                                       This options takes <b>_u8</b> buffer as parameter
2017                               - <b>SL_WLAN_AP_ACCESS_LIST_DEL_IDX</b> \n
2018                                       Delete MAC address from index in the AP access list: \n
2019                                       index - 1 character \n
2020                                       This options takes <b>_u8</b> buffer as parameter
2021 
2022                           - <b>SL_WLAN_CFG_GENERAL_PARAM_ID</b>
2023                               - <b>SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE</b> \n
2024                                       Set Country Code for AP mode \n
2025                                       This options takes <b>_u8</b> 2 bytes buffer as parameter
2026                               - <b>SL_WLAN_GENERAL_PARAM_OPT_STA_TX_POWER</b> \n
2027                                       Set STA mode Tx power level \n
2028                                       Number between 0-15, as dB offset from max power (0 will set MAX power) \n
2029                                       This options takes <b>_u8</b> as parameter
2030                               - <b>SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER</b>
2031                                       Set AP mode Tx power level for 2.4GHz channels only \n
2032                                       Number between 0-15, as dB offset from max power (0 will set MAX power) \n
2033                                       This options takes <b>_u8</b> as parameter
2034                               - <b>SL_WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT</b>
2035                                       Set Info Element for AP mode. \n
2036                                       The Application can set up to SL_WLAN_MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED info elements per Role (AP / P2P GO).  \n
2037                                       To delete an info element use the relevant index and length = 0. \n
2038                                       For AP - no more than SL_WLAN_INFO_ELEMENT_MAX_TOTAL_LENGTH_AP bytes can be stored for all info elements. \n
2039                                       For P2P GO - no more than SL_WLAN_INFO_ELEMENT_MAX_TOTAL_LENGTH_P2P_GO bytes can be stored for all info elements.  \n
2040                                       This option takes SlWlanSetInfoElement_t as parameter
2041                               - <b>SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS</b>
2042                                       Set scan parameters: RSSI threshold and channel mask.
2043                               - <b>SL_WLAN_GENERAL_PARAM_OPT_SUSPEND_PROFILES</b>
2044                                       Set suspended profiles mask (set bits 2 and 4 to suspend profiles 2 and 4).
2045                               - <b>SL_WLAN_GENERAL_PARAM_REGISTER_LINK_QUALITY_EVENT</b>
2046                                       Register to receive events regarding the link quality
2047                               - <b>SL_WLAN_GENERAL_PARAM_COEX_CONFIG</b>
2048                                       Configure co-existing to work with both WIFI and BLE
2049                                       Enables the feature and define the GPIO to work with.
2050                               - <b>SL_WLAN_GENERAL_PARAM_ANT_SELECTION_CONFIG</b>
2051                                       Enable using 2 Antennas ,configure which pad to use for each antenna and the configuration mode.
2052                               - <b>SL_WLAN_GENERAL_PARAM_ANT_SELECTION_SET</b>
2053                                       Setting the desired antenna when antenna selection is set to manual mode. Applicable to CC3x20 devices only.
2054                               - <b>SL_WLAN_GENERAL_PARAM_DISABLE_ENT_SERVER_AUTH</b>
2055                                       This option enables to skip server authentication and is valid for one
2056                                       use, when manually connection to an enterprise network
2057                               - <b>SL_WLAN_GENERAL_PARAM_OPT_ENABLE_5G</b>
2058                                       This option allowes to enable or disable the 5Ghz functionallity
2059                               - <b>SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS_5G</b>
2060                                       Configure 5G scan parameters
2061                               - <b>SL_WLAN_GENERAL_PARAM_OPT_USER_COUNTRY_ATTRIB</b>
2062                                       Set user country region attributes
2063                               - <b>SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE</b>
2064                                       Disable no PS_Poll mode (default) - station sends PS-Poll ctrl frame to receive buffered
2065                                                                           frames from the AP when unicast traffic is indicated in the beacon
2066                                       Enable no PS_Poll mode - Stating transition from PS to Active whenever unicast traffic is indicated in
2067                                                                the beacon (this mode is for inter operability issues with access points that
2068                                                                doesn't fully support PS-Poll)
2069 
2070                           - <b>SL_WLAN_CFG_P2P_PARAM_ID</b>
2071                               - <b>SL_WLAN_P2P_OPT_DEV_TYPE</b> \n
2072                                       Set P2P Device type.Maximum length of 17 characters. Device type is published under P2P I.E, \n
2073                                       allows to make devices easier to recognize. \n
2074                                       In case no device type is set, the default type is "1-0050F204-1"  \n
2075                                       This options takes <b>_u8</b> buffer as parameter
2076                               - <b>SL_WLAN_P2P_OPT_CHANNEL_N_REGS</b> \n
2077                                      Set P2P Channels. \n
2078                                      listen channel (either 1/6/11 for 2.4GHz) \n
2079                                      listen regulatory class (81 for 2.4GHz)   \n
2080                                      oper channel (either 1/6/11 for 2.4GHz)   \n
2081                                      oper regulatory class (81 for 2.4GHz)     \n
2082                                      listen channel and regulatory class will determine the device listen channel during p2p find listen phase \n
2083                                      oper channel and regulatory class will determine the operating channel preferred by this device (in case it is group owner this will be the operating channel) \n
2084                                      channels should be one of the social channels (1/6/11). In case no listen/oper channel selected, a random 1/6/11 will be selected.
2085                                      This option takes pointer to <b>_u8[4]</b> as parameter
2086 
2087                           - <b>SL_WLAN_RX_FILTERS_ID</b>
2088                               - <b>SL_WLAN_RX_FILTER_STATE</b> \n
2089                                       Enable or disable filters. The buffer input is SlWlanRxFilterOperationCommandBuff_t\n
2090                               - <b>SL_WLAN_RX_FILTER_SYS_STATE</b> \n
2091                                       Enable or disable system filters. The buffer input is SlWlanRxFilterSysFiltersSetStateBuff_t\n
2092                               - <b>SL_WLAN_RX_FILTER_REMOVE</b> \n
2093                                       Remove filters. The buffer input is SlWlanRxFilterOperationCommandBuff_t\n
2094                               - <b>SL_WLAN_RX_FILTER_STORE</b> \n
2095                                       Save the filters as persistent. \n
2096                               - <b>SL_WLAN_RX_FILTER_UPDATE_ARGS</b> \n
2097                                       Update filter arguments. The buffer input is SlWlanRxFilterUpdateArgsCommandBuff_t\n
2098 
2099     \param[in] ConfigLen - configurations len
2100 
2101     \param[in] pValues -   configurations values
2102 
2103     \return    Zero on success, or negative error code on failure
2104 
2105     \par Persistent
2106                         <b>System Persistent</b>:
2107                               - SL_WLAN_CFG_GENERAL_PARAM_ID
2108                               - SL_WLAN_CFG_P2P_PARAM_ID
2109 
2110                         <b>Reset</b>:
2111                               - SL_WLAN_CFG_AP_ID
2112 
2113                         <b>Non- Persistent</b>:
2114                               - SL_WLAN_GENERAL_PARAM_DISABLE_ENT_SERVER_AUTH
2115     \sa
2116     \note
2117     \warning
2118     \par   Examples
2119 
2120     - SL_WLAN_AP_OPT_SSID:
2121     \code
2122         _u8  str[33];
2123         memset(str, 0, 33);
2124         memcpy(str, ssid, len);  // ssid string of 32 characters
2125         sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_SSID, strlen(ssid), str);
2126     \endcode
2127     <br>
2128 
2129     - SL_WLAN_AP_OPT_CHANNEL:
2130     \code
2131         _u8  val = channel;
2132         sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_CHANNEL, 1, (_u8 *)&val);
2133     \endcode
2134     <br>
2135 
2136     - SL_WLAN_AP_OPT_HIDDEN_SSID:
2137     \code
2138         _u8  val = hidden;
2139         sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_HIDDEN_SSID, 1, (_u8 *)&val);
2140     \endcode
2141     <br>
2142 
2143     - SL_WLAN_AP_OPT_SECURITY_TYPE:
2144     \code
2145         _u8  val = SL_WLAN_SEC_TYPE_WPA_WPA2;
2146         sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_SECURITY_TYPE, 1, (_u8 *)&val);
2147     \endcode
2148     <br>
2149 
2150     - SL_WLAN_AP_OPT_PASSWORD:
2151     \code
2152         _u8  str[65];
2153         _u16  len = strlen(password);
2154         memset(str, 0, 65);
2155         memcpy(str, password, len);
2156         sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_PASSWORD, len, (_u8 *)str);
2157     \endcode
2158     <br>
2159 
2160     - SL_WLAN_AP_OPT_MAX_STATIONS:
2161     \code
2162         _u8 max_ap_stations = 3;
2163         sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_MAX_STATIONS, sizeof(max_ap_stations), (_u8 *)&max_ap_stations);
2164     \endcode
2165     <br>
2166 
2167     - SL_WLAN_AP_OPT_MAX_STA_AGING:
2168     \code
2169         _u16 max_ap_sta_aging = 60;
2170         sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_OPT_MAX_STA_AGING, sizeof(max_ap_sta_aging), (_u8 *)&max_ap_sta_aging);
2171     \endcode
2172     <br>
2173 
2174     - SL_WLAN_AP_ACCESS_LIST_MODE:
2175     \code
2176         _u8  access list_mode = SL_WLAN_AP_ACCESS_LIST_MODE_DENY_LIST;
2177         sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_ACCESS_LIST_MODE, sizeof(access list_mode), (_u8 *)&access list_mode);
2178     \endcode
2179     <br>
2180 
2181     - SL_WLAN_AP_ACCESS_LIST_ADD_MAC:
2182     \code
2183         _u8  sta_mac[6] = { 0x00, 0x22, 0x33, 0x44, 0x55, 0x66 };
2184         sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_ACCESS_LIST_ADD_MAC, sizeof(sta_mac), (_u8 *)&sta_mac);
2185     \endcode
2186     <br>
2187 
2188     - SL_WLAN_AP_ACCESS_LIST_DEL_MAC:
2189     \code
2190         _u8  sta_mac[6] = { 0x00, 0x22, 0x33, 0x44, 0x55, 0x66 };
2191         sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_ACCESS_LIST_DEL_MAC, sizeof(sta_mac), (_u8 *)&sta_mac);
2192     \endcode
2193     <br>
2194 
2195     - SL_WLAN_AP_ACCESS_LIST_DEL_IDX:
2196     \code
2197         _u8  sta_index = 0;
2198         sl_WlanSet(SL_WLAN_CFG_AP_ID, SL_WLAN_AP_ACCESS_LIST_DEL_IDX, sizeof(sta_index), (_u8 *)&sta_index);
2199     \endcode
2200     <br>
2201 
2202     - SL_WLAN_GENERAL_PARAM_OPT_STA_TX_POWER:
2203     \code
2204         _u8  stapower=(_u8)power;
2205         sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_STA_TX_POWER,1,(_u8 *)&stapower);
2206     \endcode
2207     <br>
2208 
2209     - SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE:
2210     \code
2211         _u8*  str = (_u8 *) country;  // string of 2 characters. i.e. - "US"
2212         sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE, 2, str);
2213     \endcode
2214     <br>
2215 
2216     - SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER:
2217     \code
2218         _u8  appower=(_u8)power;
2219         sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER,1,(_u8 *)&appower);
2220     \endcode
2221     <br>
2222 
2223     - WLAN_GENERAL_PARAM_REGISTER_LINK_QUALITY_EVENT:
2224     \code
2225         SlWlanRegisterLinkQualityEvents_t  RegisterLinkQuality;
2226         sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, WLAN_GENERAL_PARAM_REGISTER_LINK_QUALITY_EVENT,sizeof(SlWlanRegisterLinkQualityEvents_t),(_u8 *)&RegisterLinkQuality);
2227     \endcode
2228     <br>
2229 
2230     - SL_WLAN_GENERAL_PARAM_OPT_SUSPEND_PROFILES
2231     \code
2232         _u32  suspendedProfilesMask=(_u32)mask;
2233         sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_SUSPEND_PROFILES,sizeof(suspendedProfilesMask),(_u32 *)&suspendedProfilesMask);
2234     \endcode
2235     <br>
2236 
2237     - SL_WLAN_P2P_OPT_DEV_TYPE:
2238     \code
2239         _u8   str[17];
2240         _u16  len = strlen(device_type);
2241         memset(str, 0, 17);
2242         memcpy(str, device_type, len);
2243         sl_WlanSet(SL_WLAN_CFG_P2P_PARAM_ID, SL_WLAN_P2P_OPT_DEV_TYPE, len, str);
2244     \endcode
2245     <br>
2246 
2247     - SL_WLAN_P2P_OPT_CHANNEL_N_REGS
2248     \code
2249         _u8  str[4];
2250         str[0] = (_u8)11;           // listen channel
2251         str[1] = (_u8)81;           // listen regulatory class
2252         str[2] = (_u8)6;            // oper channel
2253         str[3] = (_u8)81;           // oper regulatory class
2254         sl_WlanSet(SL_WLAN_CFG_P2P_PARAM_ID, SL_WLAN_P2P_OPT_CHANNEL_N_REGS, 4, str);
2255     \endcode
2256     <br>
2257 
2258     - SL_WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT:
2259      \code
2260         SlWlanSetInfoElement_t    infoele;
2261         infoele.Index     = Index;                  // Index of the info element. range: 0 - SL_WLAN_MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED
2262         infoele.Role      = Role;                   // SL_WLAN_INFO_ELEMENT_AP_ROLE (0) or SL_WLAN_INFO_ELEMENT_P2P_GO_ROLE (1)
2263         infoele.IE.Id     =  Id;                    // Info element ID. if SL_WLAN_INFO_ELEMENT_DEFAULT_ID (0) is set, ID will be set to 221.
2264         // Organization unique ID. If all 3 bytes are zero - it will be replaced with 08,00,28.
2265         infoele.IE.Oui[0] =  Oui0;                  // Organization unique ID first Byte
2266         infoele.IE.Oui[1] =  Oui1;                  // Organization unique ID second Byte
2267         infoele.IE.Oui[2] =  Oui2;                  // Organization unique ID third Byte
2268         infoele.IE.Length = Len;                    // Length of the info element. must be smaller than 253 bytes
2269         memset(infoele.IE.Data, 0, SL_WLAN_INFO_ELEMENT_MAX_SIZE);
2270         if ( Len <= SL_WLAN_INFO_ELEMENT_MAX_SIZE )
2271         {
2272             memcpy(infoele.IE.Data, IE, Len);           // Info element. length of the info element is [0-252]
2273             sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,SL_WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT,sizeof(SlWlanSetInfoElement_t),(_u8* ) &infoele);
2274         }
2275     \endcode
2276     <br>
2277 
2278     - SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS:
2279     \code
2280         SlWlanScanParamCommand_t ScanParamConfig;
2281         _u16 Option = SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS;
2282         _u16 OptionLen = sizeof(ScanParamConfig);
2283         // 2.4G channels bits order:  1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
2284 
2285         ScanParamConfig.RssiThreshold = -70;
2286         ScanParamConfig.ChannelsMask = 0x1FFF;
2287         sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, &Option, &OptionLen, (_u8 *)&ScanParamConfig);
2288     \endcode
2289     <br>
2290 
2291         - SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS_5G:
2292     \code
2293         SlWlanScanParam5GCommand_t ScanParamConfig5G;
2294         _u16 Option = SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS_5G;
2295         _u16 OptionLen = sizeof(SlWlanScanParam5GCommand_t);
2296         // 5.0G channels bits order: 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132,
2297         //                          136, 140, 144, 149, 153, 157, 161, 165, 169, 184, 188, 192, 196
2298 
2299         ScanParamConfig5G.ChannelsMask = 0x0000000F; // Select ChannelsMask for channels 36, 40, 44, 48
2300         ScanParamConfig5G.RssiThershold = -70;
2301         sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, &Option, &OptionLen, (_u8 *)&ScanParamConfig5G);
2302     \endcode
2303     <br>
2304 
2305     - SL_WLAN_GENERAL_PARAM_DISABLE_ENT_SERVER_AUTH:
2306     \code
2307         _u8 param = 1; // 1 means disable the server authentication
2308         sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,SL_WLAN_GENERAL_PARAM_DISABLE_ENT_SERVER_AUTH,1,&param);
2309     \endcode
2310     <br>
2311     - SL_WLAN_RX_FILTER_STORE:
2312     \code
2313          sl_WlanSet(SL_WLAN_RX_FILTERS_ID, SL_WLAN_RX_FILTER_STORE, 0, NULL);
2314     \endcode
2315 
2316      - SL_WLAN_GENERAL_PARAM_ANT_SELECTION_CONFIG:
2317       \code
2318          //The configuration will take place after soft reset of the networking subsystem( sl_stop(),sl_star())
2319          SlWlanAntSelectionConfig_t param;
2320          sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,WLAN_GENERAL_PARAM_ANT_SELECTION_CONFIG,sizeof(SlWlanAntSelectionConfig_t), (_u8* )&param);
2321       \endcode
2322       <br>
2323 
2324      - SL_WLAN_GENERAL_PARAM_ANT_SELECTION_SET:
2325       \code
2326          SetAntennaIndex_t param;
2327          sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,SL_WLAN_GENERAL_PARAM_ANT_SELECTION_SET,sizeof(SetAntennaIndex_t), (_u8* )&param);
2328       \endcode
2329       <br>
2330 
2331     - SL_WLAN_GENERAL_PARAM_COEX_CONFIG:
2332     \code
2333       //The configuration will take place after soft reset of the networking subsystem( sl_stop(),sl_star())
2334       SlWlanCoexConfig_t param;
2335       sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID,SL_WLAN_GENERAL_PARAM_COEX_CONFIG,sizeof(SlWlanCoexConfig_t),&param);
2336     \endcode
2337     <br>
2338 
2339     - SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE:
2340     \code
2341       //Disable no PS_Poll mode (default) - station sends PS-Poll ctrl frame to receive buffered frames from the AP when
2342                                             unicast traffic is indicated in the beacon
2343       //Enable no PS_Poll mode - Stating transition from PS to Active whenever unicast traffic is indicated in the beacon
2344                                  (this mode is for inter operability issues with access points that doesn't fully support
2345                                   PS-Poll)
2346       SlWlanNoPSPollMode_t NoPsPollMode;
2347       NoPsPollMode.Enable = 1; // enable no PS-Poll mode (work without PS-Poll frames)
2348       sl_WlanSet(SL_WLAN_CFG_GENERAL_PARAM_ID, SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE,sizeof(SlWlanNoPSPollMode_t),(_u8 *)& NoPsPollMode);
2349     \endcode
2350     <br>
2351 */
2352 #if _SL_INCLUDE_FUNC(sl_WlanSet)
2353 _i16 sl_WlanSet(const _u16 ConfigId ,const _u16 ConfigOpt,const _u16 ConfigLen,const  _u8 *pValues);
2354 #endif
2355 
2356 /*!
2357     \brief     Getting WLAN configurations
2358 
2359     \param[in] ConfigId -  configuration id
2360                           - <b>SL_WLAN_CFG_AP_ID</b>
2361                           - <b>SL_WLAN_CFG_GENERAL_PARAM_ID</b>
2362                           - <b>SL_WLAN_CFG_P2P_PARAM_ID</b>
2363                           - <b>SL_WLAN_CFG_AP_ACCESS_LIST_ID</b>
2364                           - <b>SL_WLAN_RX_FILTERS_ID</b>
2365 
2366     \param[out] pConfigOpt - get configurations option
2367                           - <b>SL_WLAN_CFG_AP_ID</b>
2368                               - <b>SL_WLAN_AP_OPT_SSID</b> \n
2369                                       Get SSID for AP mode. \n
2370                                       Get up to 32 characters of SSID \n
2371                                       This options takes <b>_u8</b> as parameter
2372                               - <b>SL_WLAN_AP_OPT_CHANNEL</b> \n
2373                                       Get channel for AP mode. \n
2374                                       This option takes <b>_u8</b> as a parameter
2375                               - <b>SL_WLAN_AP_OPT_HIDDEN_SSID</b> \n
2376                                       Get Hidden SSID Mode for AP mode.Hidden options: \n
2377                                          0: disabled \n
2378                                          1: Send empty (length=0) SSID in beacon and ignore probe request for broadcast SSID \n
2379                                          2: Clear SSID (ASCII 0), but keep the original length (this may be required with some \n
2380                                             clients that do not support empty SSID) and ignore probe requests for broadcast SSID \n
2381                                       This option takes <b>_u8</b> as a parameter
2382                               - <b>SL_WLAN_AP_OPT_SECURITY_TYPE</b> \n
2383                                       Get Security type for AP mode. Security options are:
2384                                       - Open security: SL_WLAN_SEC_TYPE_OPEN
2385                                       - WEP security:  SL_WLAN_SEC_TYPE_WEP
2386                                       - WPA security:  SL_WLAN_SEC_TYPE_WPA_WPA2  \n
2387                                       This option takes <b>_u8</b> as a parameter
2388                               - <b>SL_WLAN_AP_OPT_PASSWORD</b> \n
2389                                       Get Password for for AP mode (for WEP or for WPA): \n
2390                                       Returns password - string, fills up to 64 characters. \n
2391                                       This options takes <b>_u8</b> buffer as parameter
2392                               - <b>SL_WLAN_AP_OPT_MAX_STATIONS</b> \n
2393                                       Get Max AP allowed stations: \n
2394                                       This options takes <b>_u8</b> buffer as parameter
2395                               - <b>SL_WLAN_AP_OPT_MAX_STA_AGING</b> \n
2396                                       Get AP aging time in seconds: \n
2397                                       This options takes <b>_u16</b> buffer as parameter
2398                               - <b>SL_WLAN_AP_ACCESS_LIST_NUM_ENTRIES</b> \n
2399                                       Get AP access list number of entries: \n
2400                                       This options takes <b>_u8</b> buffer as parameter
2401                               - <b>SL_WLAN_CFG_AP_ACCESS_LIST_ID</b>
2402                                 -  The option is the start index in the access list \n
2403                                       Get the AP access list from start index, the number of entries in the list is extracted from the request length.
2404                           - <b>SL_WLAN_CFG_GENERAL_PARAM_ID</b>
2405                               - <b>SL_WLAN_GENERAL_PARAM_ANT_SELECTION_GET</b> \n
2406                                       Getting the desired antenna when antenna selection is set to manual mode. Applicable to CC3x20 devices only.
2407                               - <b> SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS </b> \n
2408                                       Get scan parameters.
2409                                       This option uses SlWlanScanParamCommand_t as parameter
2410                               - <b>SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE</b> \n
2411                                       Get Country Code for AP mode \n
2412                                       This options takes <b>_u8</b> buffer as parameter
2413                               - <b>SL_WLAN_GENERAL_PARAM_OPT_STA_TX_POWER</b> \n
2414                                       Get STA mode Tx power level \n
2415                                       Number between 0-15, as dB offset from max power (0 indicates MAX power) \n
2416                                       This options takes <b>_u8</b> as parameter
2417                               - <b>SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER</b>
2418                                       Get AP mode Tx power level \n
2419                                       Number between 0-15, as dB offset from max power (0 indicates MAX power) \n
2420                                       This options takes <b>_u8</b> as parameter
2421                               - <b>SL_WLAN_GENERAL_PARAM_OPT_ENABLE_5G</b>
2422                                       Get current state of 5G mode
2423                               - <b>SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS_5G</b>
2424                                       Get 5G user scan parameters
2425                               - <b>SL_WLAN_GENERAL_PARAM_OPT_USER_COUNTRY_ATTRIB</b>
2426                                       Get user user country attributes
2427                               - <b>SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_ATTRIB</b>
2428                                       Get current country attributes (No way to set country attributes, See also country list in Appendix C)
2429                               - <b>SL_WLAN_GENERAL_PARAM_EXT_CONNECTION_INFO</b>
2430                                       Get Beacon Interval and DTIM Period.
2431                               - <b>SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE</b>
2432                                       Get the mode of polling frames from the AP in power save
2433                                       0 (default) - Using PS_Poll frames
2434                                       1 - Not using PS_Poll frames
2435                                       For more information read the sl_WlanSet for this option
2436                           - <b>SL_WLAN_CFG_P2P_PARAM_ID</b>
2437                               - <b>SL_WLAN_P2P_OPT_CHANNEL_N_REGS</b> \n
2438                                      Get P2P Channels. \n
2439                                      listen channel (either 1/6/11 for 2.4GHz) \n
2440                                      listen regulatory class (81 for 2.4GHz)   \n
2441                                      oper channel (either 1/6/11 for 2.4GHz)   \n
2442                                      oper regulatory class (81 for 2.4GHz)     \n
2443                                      listen channel and regulatory class will determine the device listen channel during p2p find listen phase \n
2444                                      oper channel and regulatory class will determine the operating channel preferred by this device (in case it is group owner this will be the operating channel) \n
2445                                      channels should be one of the social channels (1/6/11). In case no listen/oper channel selected, a random 1/6/11 will be selected. \n
2446                                      This option takes pointer to <b>_u8[4]</b> as parameter
2447                           - <b>SL_WLAN_RX_FILTERS_ID</b>
2448                                 - <b>SL_WLAN_RX_FILTER_STATE</b> \n
2449                                     Retrieves the filters enable/disable status. The buffer input is SlWlanRxFilterRetrieveStateBuff_t \n
2450                                 - <b>SL_WLAN_RX_FILTER_SYS_STATE</b> \n
2451                                     Retrieves the system filters enable/disable status. The buffer input is SlWlanRxFilterSysFiltersRetrieveStateBuff_t:
2452 
2453     \param[out] pConfigLen - The length of the allocated memory as input, when the
2454                                         function complete, the value of this parameter would be
2455                                         the len that actually read from the device.
2456                                         If the device return length that is longer from the input
2457                                         value, the function will cut the end of the returned structure
2458                                         and will return SL_ESMALLBUF.
2459 
2460 
2461     \param[out] pValues - get configurations values
2462     \return    Zero on success, or negative error code on failure
2463     \sa   sl_WlanSet
2464     \note
2465             In case the device was started as AP mode, but no SSID was set, the Get SSID will return "mysimplelink" and not "mysimplelink-xxyyzz"
2466     \warning
2467     \par    Examples
2468 
2469     - SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS:
2470     \code
2471         SlWlanScanParamCommand_t ScanParamConfig;
2472         _u16 Option = SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS;
2473         _u16 OptionLen = sizeof(SlWlanScanParamCommand_t);
2474         sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(_u8 *)&ScanParamConfig);
2475     \endcode
2476     <br>
2477 
2478         - WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS_5G:
2479     \code
2480         SlWlanScanParamCommand_t ScanParamConfig;
2481         _u16 Option = SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS;
2482         _u16 OptionLen = sizeof(SlWlanScanParamCommand_t);
2483         sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(_u8 *)&ScanParamConfig);
2484     \endcode
2485     <br>
2486 
2487         - SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS:
2488     \code
2489         SlWlanScanParamCommand_t ScanParamConfig;
2490         _u16 Option = SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS;
2491         _u16 OptionLen = sizeof(SlWlanScanParamCommand_t);
2492         sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(_u8 *)&ScanParamConfig);
2493     \endcode
2494     <br>
2495 
2496     - SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER:
2497     \code
2498         _i32 TXPower = 0;
2499         _u16 Option = SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER;
2500         _u16 OptionLen = sizeof(TXPower);
2501         sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(_u8 *)&TXPower);
2502     \endcode
2503     <br>
2504 
2505     - SL_WLAN_GENERAL_PARAM_OPTSTA_TX_POWER:
2506     \code
2507         _i32 TXPower = 0;
2508         _u16 Option = SL_WLAN_GENERAL_PARAM_OPT_STA_TX_POWER;
2509         _u16 OptionLen = sizeof(TXPower);
2510         sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID ,&Option,&OptionLen,(_u8 *)&TXPower);
2511     \endcode
2512     <br>
2513 
2514     - SL_WLAN_P2P_OPT_DEV_TYPE:
2515     \code
2516         _i8 device_type[18];
2517         _u16 len = 18;
2518         _u16 config_opt = SL_WLAN_P2P_OPT_DEV_TYPE;
2519         sl_WlanGet(SL_WLAN_CFG_P2P_PARAM_ID, &config_opt , &len, (_u8* )device_type);
2520     \endcode
2521     <br>
2522 
2523     - SL_WLAN_AP_OPT_SSID:
2524     \code
2525         _i8 ssid[33];
2526         _u16 len = 33;
2527         sl_Memset(ssid,0,33);
2528         _u16  config_opt = SL_WLAN_AP_OPT_SSID;
2529         sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt , &len, (_u8* )ssid);
2530     \endcode
2531     <br>
2532 
2533     - SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE:
2534     \code
2535         _i8 country[3];
2536         _u16 len = 3;
2537         _u16  config_opt = SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE;
2538         sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID, &config_opt, &len, (_u8* )country);
2539     \endcode
2540     <br>
2541 
2542     - SL_WLAN_AP_OPT_CHANNEL:
2543     \code
2544         _i8 channel;
2545         _u16 len = 1;
2546         _u16  config_opt = SL_WLAN_AP_OPT_CHANNEL;
2547         sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8* )&channel);
2548     \endcode
2549     <br>
2550 
2551     - SL_WLAN_AP_OPT_HIDDEN_SSID:
2552     \code
2553         _u8 hidden;
2554         _u16 len = 1;
2555         _u16  config_opt = SL_WLAN_AP_OPT_HIDDEN_SSID;
2556         sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8* )&hidden);
2557     \endcode
2558     <br>
2559 
2560     - SL_WLAN_AP_OPT_SECURITY_TYPE:
2561     \code
2562         _u8 sec_type;
2563         _u16 len = 1;
2564         _u16  config_opt = SL_WLAN_AP_OPT_SECURITY_TYPE;
2565         sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8* )&sec_type);
2566     \endcode
2567     <br>
2568 
2569     - SL_WLAN_AP_OPT_PASSWORD:
2570     \code
2571         _u8 password[64];
2572         _u16 len = 64;
2573         sl_Memset(password,0,64);
2574         _u16 config_opt = SL_WLAN_AP_OPT_PASSWORD;
2575         sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8* )password);
2576     \endcode
2577     <br>
2578 
2579     - SL_WLAN_AP_OPT_MAX_STATIONS:
2580     \code
2581         _u8 max_ap_stations
2582         _u16 len = 1;
2583         _u16  config_opt = SL_WLAN_AP_OPT_MAX_STATIONS;
2584         sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8 *)&max_ap_stations);
2585     \endcode
2586     <br>
2587 
2588     - SL_WLAN_AP_OPT_MAX_STA_AGING:
2589     \code
2590         _u16 ap_sta_aging;
2591         _u16 len = 2;
2592         _u16  config_opt = SL_WLAN_AP_OPT_MAX_STA_AGING;
2593         sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8 *)&ap_sta_aging);
2594     \endcode
2595     <br>
2596 
2597     - SL_WLAN_AP_ACCESS_LIST_NUM_ENTRIES:
2598     \code
2599         _u8 aclist_num_entries;
2600         _u16 config_opt = SL_WLAN_AP_ACCESS_LIST_NUM_ENTRIES;
2601         _u16 len = sizeof(aclist_num_entries);
2602         sl_WlanGet(SL_WLAN_CFG_AP_ID, &config_opt, &len, (_u8 *)&aclist_num_entries);
2603     \endcode
2604     <br>
2605 
2606     - SL_WLAN_CFG_AP_ACCESS_LIST_ID:
2607     \code
2608         _u8 aclist_mac[SL_WLAN_MAX_ACCESS_LIST_STATIONS][MAC_LEN];
2609         unsigned char aclist_num_entries;
2610         unsigned short config_opt;
2611         unsigned short len;
2612         int actual_aclist_num_entries;
2613         unsigned short start_aclist_index;
2614         unsigned short aclist_info_len;
2615         int i;
2616 
2617         start_aclist_index = 0;
2618         aclist_info_len = 2*MAC_LEN;
2619         sl_WlanGet(SL_WLAN_CFG_AP_ACCESS_LIST_ID, &start_aclist_index, &aclist_info_len, (_u8 *)&aclist_mac[start_aclist_index]);
2620 
2621         actual_aclist_num_entries = aclist_info_len / MAC_LEN;
2622         printf("-Print AP Deny list, num stations = %d\n", actual_aclist_num_entries);
2623         for (i=0; i<actual_aclist_num_entries; i++)
2624         {
2625                 _u8 *pMac = aclist_mac[i+start_aclist_index];
2626                 printf("    MAC %d:  %02x:%02x:%02x:%02x:%02x:%02x\n", i, pMac[0], pMac[1], pMac[2], pMac[3], pMac[4], pMac[5]);
2627         }
2628     \endcode
2629     <br>
2630 
2631     - SL_WLAN_P2P_OPT_CHANNEL_N_REGS:
2632     \code
2633         _u16 listen_channel,listen_reg,oper_channel,oper_reg;
2634         _u16 len = 4;
2635         _u16  config_opt = SL_WLAN_P2P_OPT_CHANNEL_N_REGS;
2636         _u8 channel_n_regs[4];
2637         sl_WlanGet(SL_WLAN_CFG_P2P_PARAM_ID, &config_opt, &len, (_u8* )channel_n_regs);
2638         listen_channel = channel_n_regs[0];
2639         listen_reg = channel_n_regs[1];
2640         oper_channel = channel_n_regs[2];
2641         oper_reg = channel_n_regs[3];
2642     \endcode
2643     <br>
2644 
2645     - SL_WLAN_RX_FILTER_STATE:
2646     \code
2647         int ret = 0;
2648         SlWlanRxFilterIdMask_t  FilterIdMask;
2649         _u16 len = sizeof(SlWlanRxFilterIdMask_t);;
2650         _u16  config_opt = SL_WLAN_RX_FILTER_STATE;
2651         memset(FilterIdMask,0,sizeof(FilterIdMask));
2652         ret = sl_WlanGet(SL_WLAN_RX_FILTERS_ID, &config_opt , &len, (_u8* )FilterIdMask);
2653     \endcode
2654     <br>
2655 
2656     - SL_WLAN_RX_FILTER_SYS_STATE:
2657     \code
2658         int ret = 0;
2659         SlWlanRxFilterSysFiltersMask_t  FilterSysIdMask;
2660         _u16 len = sizeof(SlWlanRxFilterSysFiltersMask_t);;
2661         _u16  config_opt = SL_WLAN_RX_FILTER_SYS_STATE;
2662         memset(FilterSysIdMask,0,sizeof(FilterSysIdMask));
2663         ret = sl_WlanGet(SL_WLAN_RX_FILTERS_ID, &config_opt , &len, (_u8* )FilterSysIdMask);
2664     \endcode
2665     <br>
2666 
2667     - SL_WLAN_CONNECTION_INFO:
2668     \code
2669         _i16 RetVal = 0 ;
2670         _u16 Len = sizeof(SlWlanConnStatusParam_t) ;
2671         SlWlanConnStatusParam_t WlanConnectInfo ;
2672         RetVal = sl_WlanGet(SL_WLAN_CONNECTION_INFO, NULL, &Len, (_u8* )&WlanConnectInfo);
2673    \endcode
2674     <br>
2675 
2676     - SL_WLAN_GENERAL_PARAM_ANT_SELECTION_GET:
2677       \code
2678          _i16 RetVal = 0 ;
2679          _u16  config_opt = SL_WLAN_GENERAL_PARAM_ANT_SELECTION_GET;
2680          _u16 len = sizeof(SetAntennaIndex_t);
2681          SetAntennaIndex_t SetAntennaParams;
2682          RetVal = sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID, &config_opt, &len, (_u8* )&SetAntennaParams);
2683       \endcode
2684       <br>
2685     - SL_WLAN_GENERAL_PARAM_EXT_CONNECTION_INFO:
2686      \code
2687          int8_t ret = 0;
2688          SlWlanExtConnectionInfo_t ExtConnectionInfo;
2689          _u16   config_opt = SL_WLAN_GENERAL_PARAM_EXT_CONNECTION_INFO;
2690          _u16   Len = sizeof(SlWlanExtConnectionInfo_t);
2691          ret =  sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID, &config_opt, &Len, (_u8* )&ExtConnectionInfo);
2692       \endcode
2693       <br>
2694     - SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE
2695      \code
2696          int8_t ret = 0;
2697          SlWlanNoPSPollMode_t NoPsPollMode;
2698          _u16   config_opt = SL_WLAN_GENERAL_PARAM_OPT_NO_PS_POLL_MODE;
2699          _u16   Len = sizeof(SlWlanNoPSPollMode_t);
2700          ret =  sl_WlanGet(SL_WLAN_CFG_GENERAL_PARAM_ID, &config_opt, &Len, (_u8* )&NoPsPollMode);
2701       \endcode
2702       <br>
2703 */
2704 
2705 #if _SL_INCLUDE_FUNC(sl_WlanGet)
2706 _i16 sl_WlanGet(const _u16 ConfigId, _u16 *pConfigOpt,_u16 *pConfigLen, _u8 *pValues);
2707 #endif
2708 
2709 /*!
2710   \brief Adds new filter rule to the system
2711 
2712   \param[in]    RuleType    The rule type
2713                                 - SL_WLAN_RX_FILTER_HEADER
2714                                 - SL_WLAN_RX_FILTER_COMBINATION
2715 
2716   \param[in]    Flags       Flags which set the type of header rule Args and sets the persistent flag
2717                                 - SL_WLAN_RX_FILTER_BINARY
2718                                 - SL_WLAN_RX_FILTER_PERSISTENT
2719                                 - SL_WLAN_RX_FILTER_ENABLE
2720 
2721   \param[in]    pRule       Determine the filter rule logic
2722   \param[in]    pTrigger    Determine when the rule is triggered also sets rule parent.
2723   \param[in]    pAction     Sets the action to be executed in case the match functions pass
2724   \param[out]   pFilterId   The filterId which was created
2725 
2726   \par          Persistent  Save the filters for persistent can be done by calling  with SL_WLAN_RX_FILTER_STORE
2727 
2728   \return       Zero on success, or negative error code on failure
2729   \sa
2730   \note
2731   \warning
2732  */
2733 #if _SL_INCLUDE_FUNC(sl_WlanRxFilterAdd)
2734 _i16 sl_WlanRxFilterAdd(    SlWlanRxFilterRuleType_t                RuleType,
2735                             SlWlanRxFilterFlags_u                   Flags,
2736                             const SlWlanRxFilterRule_u* const       pRule,
2737                             const SlWlanRxFilterTrigger_t* const    pTrigger,
2738                             const SlWlanRxFilterAction_t* const     pAction,
2739                             SlWlanRxFilterID_t*                     pFilterId);
2740 
2741 #endif
2742 
2743 /*!
2744 
2745  Close the Doxygen group.
2746  @}
2747 
2748  */
2749 
2750 #ifdef  __cplusplus
2751 }
2752 #endif /*  __cplusplus */
2753 
2754 #endif    /*  __WLAN_H__ */
2755 
2756