SimpleLink CC3120/CC3220 Host Driver  Version 2.0.1.15
Simplifies the implementation of Internet connectivity
wlan.h
1 /*
2  * Copyright (C) 2016 Texas Instruments Incorporated
3  *
4  * All rights reserved. Property of Texas Instruments Incorporated.
5  * Restricted rights to use, duplicate or disclose this code are
6  * granted through contract.
7  *
8  * The program may not be used without the written permission of
9  * Texas Instruments Incorporated or against the terms and conditions
10  * stipulated in the agreement under which this program has been supplied,
11  * and under no circumstances can it be used with non-TI connectivity device.
12  *
13  */
14 
15 
16 /*****************************************************************************/
17 /* Include files */
18 /*****************************************************************************/
19 #include <ti/drivers/net/wifi/simplelink.h>
20 
21 #ifndef __WLAN_H__
22 #define __WLAN_H__
23 
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
30 /*****************************************************************************/
31 /* Macro declarations */
32 /*****************************************************************************/
48 #define SL_WLAN_BSSID_LENGTH (6)
49 #define SL_WLAN_SSID_MAX_LENGTH (32)
50 
51 #define SL_WLAN_NUM_OF_RATE_INDEXES (20)
52 #define SL_WLAN_SIZE_OF_RSSI_HISTOGRAM (6)
53 #define SL_WLAN_SMART_CONFIG_KEY_LENGTH (16)
54 #define SL_WLAN_SMART_CONFIG_DEFAULT_CIPHER (1)
55 #define SL_WLAN_SMART_CONFIG_DEFAULT_GROUP (0)
56 
57 #define SL_WLAN_MAX_PROFILES (7)
58 #define SL_WLAN_DEL_ALL_PROFILES (255)
59 
60 typedef enum
61 {
62  SL_WLAN_P2P_WPS_METHOD_DEFAULT,
63  SL_WLAN_P2P_WPS_METHOD_PIN_USER,
64  SL_WLAN_P2P_WPS_METHOD_PIN_MACHINE,
65  SL_WLAN_P2P_WPS_METHOD_REKEY,
66  SL_WLAN_P2P_WPS_METHOD_PBC,
67  SL_WLAN_P2P_WPS_METHOD_REGISTRAR
68 } SlWlanP2PWpsMethod_e;
69 
70 /* WLAN user events */
71 typedef enum
72 {
73  SL_WLAN_EVENT_CONNECT = 1,
74  SL_WLAN_EVENT_DISCONNECT,
75  SL_WLAN_EVENT_STA_ADDED,
76  SL_WLAN_EVENT_STA_REMOVED,
77 
78  SL_WLAN_EVENT_P2P_CONNECT,
79  SL_WLAN_EVENT_P2P_DISCONNECT,
80  SL_WLAN_EVENT_P2P_CLIENT_ADDED,
81  SL_WLAN_EVENT_P2P_CLIENT_REMOVED,
82  SL_WLAN_EVENT_P2P_DEVFOUND,
83  SL_WLAN_EVENT_P2P_REQUEST,
84  SL_WLAN_EVENT_P2P_CONNECTFAIL,
85 
86  SL_WLAN_EVENT_RXFILTER,
87  SL_WLAN_EVENT_PROVISIONING_STATUS,
88  SL_WLAN_EVENT_PROVISIONING_PROFILE_ADDED,
89  SL_WLAN_EVENT_MAX
90 
91 } SlWlanEventId_e;
92 
93 
94 /* WLAN Disconnect Reason Codes */
95 #define SL_WLAN_DISCONNECT_UNSPECIFIED (1)
96 #define SL_WLAN_DISCONNECT_AUTH_NO_LONGER_VALID (2)
97 #define SL_WLAN_DISCONNECT_DEAUTH_SENDING_STA_LEAVING (3)
98 #define SL_WLAN_DISCONNECT_INACTIVITY (4)
99 #define SL_WLAN_DISCONNECT_TOO_MANY_STA (5)
100 #define SL_WLAN_DISCONNECT_FRAME_FROM_NONAUTH_STA (6)
101 #define SL_WLAN_DISCONNECT_FRAME_FROM_NONASSOC_STA (7)
102 #define SL_WLAN_DISCONNECT_DISS_SENDING_STA_LEAVING (8)
103 #define SL_WLAN_DISCONNECT_STA_NOT_AUTH (9)
104 #define SL_WLAN_DISCONNECT_POWER_CAPABILITY_INVALID (10)
105 #define SL_WLAN_DISCONNECT_SUPPORTED_CHANNELS_INVALID (11)
106 #define SL_WLAN_DISCONNECT_INVALID_IE (13)
107 #define SL_WLAN_DISCONNECT_MIC_FAILURE (14)
108 #define SL_WLAN_DISCONNECT_FOURWAY_HANDSHAKE_TIMEOUT (15)
109 #define SL_WLAN_DISCONNECT_GROUPKEY_HANDSHAKE_TIMEOUT (16)
110 #define SL_WLAN_DISCONNECT_REASSOC_INVALID_IE (17)
111 #define SL_WLAN_DISCONNECT_INVALID_GROUP_CIPHER (18)
112 #define SL_WLAN_DISCONNECT_INVALID_PAIRWISE_CIPHER (19)
113 #define SL_WLAN_DISCONNECT_INVALID_AKMP (20)
114 #define SL_WLAN_DISCONNECT_UNSUPPORTED_RSN_VERSION (21)
115 #define SL_WLAN_DISCONNECT_INVALID_RSN_CAPABILITIES (22)
116 #define SL_WLAN_DISCONNECT_IEEE_802_1X_AUTHENTICATION_FAILED (23)
117 #define SL_WLAN_DISCONNECT_CIPHER_SUITE_REJECTED (24)
118 #define SL_WLAN_DISCONNECT_DISASSOC_QOS (32)
119 #define SL_WLAN_DISCONNECT_DISASSOC_QOS_BANDWIDTH (33)
120 #define SL_WLAN_DISCONNECT_DISASSOC_EXCESSIVE_ACK_PENDING (34)
121 #define SL_WLAN_DISCONNECT_DISASSOC_TXOP_LIMIT (35)
122 #define SL_WLAN_DISCONNECT_STA_LEAVING (36)
123 #define SL_WLAN_DISCONNECT_STA_DECLINED (37)
124 #define SL_WLAN_DISCONNECT_STA_UNKNOWN_BA (38)
125 #define SL_WLAN_DISCONNECT_STA_TIMEOUT (39)
126 #define SL_WLAN_DISCONNECT_STA_UNSUPPORTED_CIPHER_SUITE (40)
127 #define SL_WLAN_DISCONNECT_USER_INITIATED (200)
128 #define SL_WLAN_DISCONNECT_AUTH_TIMEOUT (202)
129 #define SL_WLAN_DISCONNECT_ASSOC_TIMEOUT (203)
130 #define SL_WLAN_DISCONNECT_SECURITY_FAILURE (204)
131 #define SL_WLAN_DISCONNECT_WHILE_CONNNECTING (208)
132 #define SL_WLAN_DISCONNECT_MISSING_CERT (209)
133 #define SL_WLAN_DISCONNECT_CERTIFICATE_EXPIRED (210)
134 
135 
136 
137 #define SL_WLAN_STATUS_DISCONNECTED (0)
138 #define SL_WLAN_STATUS_SCANING (1)
139 #define SL_WLAN_STATUS_CONNECTING (2)
140 #define SL_WLAN_STATUS_CONNECTED (3)
141 
142 #define SL_WLAN_PROVISIONING_GENERAL_ERROR (0)
143 #define SL_WLAN_PROVISIONING_CONFIRMATION_STATUS_FAIL_NETWORK_NOT_FOUND (1)
144 #define SL_WLAN_PROVISIONING_CONFIRMATION_STATUS_FAIL_CONNECTION_FAILED (2)
145 #define SL_WLAN_PROVISIONING_CONFIRMATION_STATUS_CONNECTION_SUCCESS_IP_NOT_ACQUIRED (3)
146 #define SL_WLAN_PROVISIONING_CONFIRMATION_STATUS_SUCCESS_FEEDBACK_FAILED (4)
147 #define SL_WLAN_PROVISIONING_CONFIRMATION_STATUS_SUCCESS (5)
148 #define SL_WLAN_PROVISIONING_ERROR_ABORT (6)
149 #define SL_WLAN_PROVISIONING_ERROR_ABORT_INVALID_PARAM (7)
150 #define SL_WLAN_PROVISIONING_ERROR_ABORT_HTTP_SERVER_DISABLED (8)
151 #define SL_WLAN_PROVISIONING_ERROR_ABORT_PROFILE_LIST_FULL (9)
152 #define SL_WLAN_PROVISIONING_ERROR_ABORT_PROVISIONING_ALREADY_STARTED (10)
153 #define SL_WLAN_PROVISIONING_AUTO_STARTED (11)
154 #define SL_WLAN_PROVISIONING_STOPPED (12)
155 #define SL_WLAN_PROVISIONING_SMART_CONFIG_SYNCED (13)
156 #define SL_WLAN_PROVISIONING_SMART_CONFIG_SYNC_TIMEOUT (14)
157 #define SL_WLAN_PROVISIONING_CONFIRMATION_WLAN_CONNECT (15)
158 #define SL_WLAN_PROVISIONING_CONFIRMATION_IP_ACQUIRED (16)
159 #define SL_WLAN_PROVISIONING_EXTERNAL_CONFIGURATION_READY (17)
160 
161 
162 
163 #define SL_WLAN_SEC_TYPE_OPEN (0)
164 #define SL_WLAN_SEC_TYPE_WEP (1)
165 #define SL_WLAN_SEC_TYPE_WPA (2) /* deprecated */
166 #define SL_WLAN_SEC_TYPE_WPA_WPA2 (2)
167 #define SL_WLAN_SEC_TYPE_WPS_PBC (3)
168 #define SL_WLAN_SEC_TYPE_WPS_PIN (4)
169 #define SL_WLAN_SEC_TYPE_WPA_ENT (5)
170 #define SL_WLAN_SEC_TYPE_P2P_PBC (6)
171 #define SL_WLAN_SEC_TYPE_P2P_PIN_KEYPAD (7)
172 #define SL_WLAN_SEC_TYPE_P2P_PIN_DISPLAY (8)
173 #define SL_WLAN_SEC_TYPE_P2P_PIN_AUTO (9) /* NOT Supported yet */
174 #define SL_WLAN_SEC_TYPE_WEP_SHARED (10)
175 
176 
177 
178 #define TLS (0x1)
179 #define MSCHAP (0x0)
180 #define PSK (0x2)
181 #define TTLS (0x10)
182 #define PEAP0 (0x20)
183 #define PEAP1 (0x40)
184 #define FAST (0x80)
185 
186 
187 #define SL_WLAN_FAST_AUTH_PROVISIONING (0x02)
188 #define SL_WLAN_FAST_UNAUTH_PROVISIONING (0x01)
189 #define SL_WLAN_FAST_NO_PROVISIONING (0x00)
190 
191 #define SL_WLAN_PROVISIONING_CMD_START_MODE_AP (0)
192 #define SL_WLAN_PROVISIONING_CMD_START_MODE_SC (1)
193 #define SL_WLAN_PROVISIONING_CMD_START_MODE_APSC (2)
194 #define SL_WLAN_PROVISIONING_CMD_START_MODE_APSC_EXTERNAL_CONFIGURATION (3)
195 #define SL_WLAN_PROVISIONING_CMD_STOP (4)
196 #define SL_WLAN_PROVISIONING_CMD_ABORT_EXTERNAL_CONFIRMATION (5)
197 
198 /* Provisining API Flags */
199 #define SL_WLAN_PROVISIONING_CMD_FLAG_EXTERNAL_CONFIRMATION (0x00000001)
200 
201 /* to be used only in provisioning stop command */
202 #define SL_WLAN_PROVISIONING_REMAIN_IN_CURRENT_ROLE (0xFF)
203 
204 
205 #define SL_WLAN_EAPMETHOD_PHASE2_SHIFT (8)
206 #define SL_WLAN_EAPMETHOD_PAIRWISE_CIPHER_SHIFT (19)
207 #define SL_WLAN_EAPMETHOD_GROUP_CIPHER_SHIFT (27)
208 
209 #define SL_WLAN_WPA_CIPHER_CCMP (0x1)
210 #define SL_WLAN_WPA_CIPHER_TKIP (0x2)
211 #define SL_WLAN_CC31XX_DEFAULT_CIPHER (SL_WLAN_WPA_CIPHER_CCMP | SL_WLAN_WPA_CIPHER_TKIP)
212 
213 #define SL_WLAN_EAPMETHOD(phase1,phase2,pairwise_cipher,group_cipher) \
214  ((phase1) | \
215  ((phase2) << SL_WLAN_EAPMETHOD_PHASE2_SHIFT ) |\
216  ((_u32)(pairwise_cipher) << SL_WLAN_EAPMETHOD_PAIRWISE_CIPHER_SHIFT ) |\
217  ((_u32)(group_cipher) << SL_WLAN_EAPMETHOD_GROUP_CIPHER_SHIFT ))
218 
219 /* phase1 phase2 pairwise_cipher group_cipher */
220 #define SL_WLAN_ENT_EAP_METHOD_TLS SL_WLAN_EAPMETHOD(TLS , 0 , SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
221 #define SL_WLAN_ENT_EAP_METHOD_TTLS_TLS SL_WLAN_EAPMETHOD(TTLS , TLS , SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
222 #define SL_WLAN_ENT_EAP_METHOD_TTLS_MSCHAPv2 SL_WLAN_EAPMETHOD(TTLS , MSCHAP , SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
223 #define SL_WLAN_ENT_EAP_METHOD_TTLS_PSK SL_WLAN_EAPMETHOD(TTLS , PSK , SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
224 #define SL_WLAN_ENT_EAP_METHOD_PEAP0_TLS SL_WLAN_EAPMETHOD(PEAP0 , TLS , SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
225 #define SL_WLAN_ENT_EAP_METHOD_PEAP0_MSCHAPv2 SL_WLAN_EAPMETHOD(PEAP0 , MSCHAP , SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
226 #define SL_WLAN_ENT_EAP_METHOD_PEAP0_PSK SL_WLAN_EAPMETHOD(PEAP0 , PSK , SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
227 #define SL_WLAN_ENT_EAP_METHOD_PEAP1_TLS SL_WLAN_EAPMETHOD(PEAP1 , TLS , SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
228 #define SL_WLAN_ENT_EAP_METHOD_PEAP1_PSK SL_WLAN_EAPMETHOD(PEAP1 , PSK , SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
229 #define SL_WLAN_ENT_EAP_METHOD_FAST_AUTH_PROVISIONING SL_WLAN_EAPMETHOD(FAST , SL_WLAN_FAST_AUTH_PROVISIONING , SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
230 #define SL_WLAN_ENT_EAP_METHOD_FAST_UNAUTH_PROVISIONING SL_WLAN_EAPMETHOD(FAST , SL_WLAN_FAST_UNAUTH_PROVISIONING , SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
231 #define SL_WLAN_ENT_EAP_METHOD_FAST_NO_PROVISIONING SL_WLAN_EAPMETHOD(FAST , SL_WLAN_FAST_NO_PROVISIONING , SL_WLAN_CC31XX_DEFAULT_CIPHER , SL_WLAN_CC31XX_DEFAULT_CIPHER)
232 
233 #define SL_WLAN_LONG_PREAMBLE (0)
234 #define SL_WLAN_SHORT_PREAMBLE (1)
235 
236 #define SL_WLAN_RAW_RF_TX_PARAMS_CHANNEL_SHIFT (0)
237 #define SL_WLAN_RAW_RF_TX_PARAMS_RATE_SHIFT (6)
238 #define SL_WLAN_RAW_RF_TX_PARAMS_POWER_SHIFT (11)
239 #define SL_WLAN_RAW_RF_TX_PARAMS_PREAMBLE_SHIFT (15)
240 
241 #define SL_WLAN_RAW_RF_TX_PARAMS(chan,rate,power,preamble) \
242  ((chan << SL_WLAN_RAW_RF_TX_PARAMS_CHANNEL_SHIFT) | \
243  (rate << SL_WLAN_RAW_RF_TX_PARAMS_RATE_SHIFT) | \
244  (power << SL_WLAN_RAW_RF_TX_PARAMS_POWER_SHIFT) | \
245  (preamble << SL_WLAN_RAW_RF_TX_PARAMS_PREAMBLE_SHIFT))
246 
247 
248 /* wlan config application IDs */
249 #define SL_WLAN_CFG_AP_ID (0)
250 #define SL_WLAN_CFG_GENERAL_PARAM_ID (1)
251 #define SL_WLAN_CFG_P2P_PARAM_ID (2)
252 #define SL_WLAN_CFG_AP_ACCESS_LIST_ID (3)
253 #define SL_WLAN_RX_FILTERS_ID (4)
254 #define SL_WLAN_CONNECTION_INFO (5)
255 
256 /* wlan AP Config set/get options */
257 #define SL_WLAN_AP_OPT_SSID (0)
258 #define SL_WLAN_AP_OPT_CHANNEL (3)
259 #define SL_WLAN_AP_OPT_HIDDEN_SSID (4)
260 #define SL_WLAN_AP_OPT_SECURITY_TYPE (6)
261 #define SL_WLAN_AP_OPT_PASSWORD (7)
262 #define SL_WLAN_GENERAL_PARAM_OPT_COUNTRY_CODE (9)
263 #define SL_WLAN_GENERAL_PARAM_OPT_STA_TX_POWER (10)
264 #define SL_WLAN_GENERAL_PARAM_OPT_AP_TX_POWER (11)
265 #define SL_WLAN_GENERAL_PARAM_DISABLE_ENT_SERVER_AUTH (32)
266 #define SL_WLAN_GENERAL_PARAM_OPT_SUSPEND_PROFILES (33)
267 
268 #define SL_WLAN_P2P_OPT_DEV_NAME (12)
269 #define SL_WLAN_P2P_OPT_DEV_TYPE (13)
270 #define SL_WLAN_P2P_OPT_CHANNEL_N_REGS (14)
271 #define SL_WLAN_GENERAL_PARAM_OPT_INFO_ELEMENT (16)
272 #define SL_WLAN_GENERAL_PARAM_OPT_SCAN_PARAMS (18) /* change the scan channels and RSSI threshold using this configuration option */
273 #define SL_WLAN_AP_OPT_MAX_STATIONS (19)
274 #define SL_WLAN_AP_ACCESS_LIST_ADD_MAC (20)
275 #define SL_WLAN_AP_ACCESS_LIST_DEL_MAC (21)
276 #define SL_WLAN_AP_ACCESS_LIST_DEL_IDX (22)
277 #define SL_WLAN_AP_ACCESS_LIST_NUM_ENTRIES (24)
278 #define SL_WLAN_AP_ACCESS_LIST_MODE (25)
279 #define SL_WLAN_AP_OPT_MAX_STA_AGING (26)
280 
281 #define SL_WLAN_RX_FILTER_STATE (27)
282 #define SL_WLAN_RX_FILTER_REMOVE (28)
283 #define SL_WLAN_RX_FILTER_STORE (29)
284 #define SL_WLAN_RX_FILTER_UPDATE_ARGS (30)
285 #define SL_WLAN_RX_FILTER_SYS_STATE (31)
286 
287 /* SmartConfig CIPHER options */
288 #define SL_WLAN_SMART_CONFIG_CIPHER_SFLASH (0) /* password is not delivered by the application. The Simple Manager should
289  check if the keys are stored in the Flash. */
290 #define SL_WLAN_SMART_CONFIG_CIPHER_AES (1) /* AES (other types are not supported) */
291 #define SL_WLAN_SMART_CONFIG_CIPHER_NONE (0xFF) /* do not check in the flash */
292 
293 
294 #define SL_WLAN_POLICY_CONNECTION (0x10)
295 #define SL_WLAN_POLICY_SCAN (0x20)
296 #define SL_WLAN_POLICY_PM (0x30)
297 #define SL_WLAN_POLICY_P2P (0x40)
298 
299 #define SL_WLAN_VAL_2_MASK(position,value) ((1 & (value))<<(position))
300 #define SL_WLAN_MASK_2_VAL(position,mask) (((1 << position) & (mask)) >> (position))
301 
302 #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))
303 #define SL_WLAN_SCAN_POLICY_EN(policy) (SL_WLAN_MASK_2_VAL(0,policy))
304 #define SL_WLAN_SCAN_POLICY(Enable,Enable_Hidden) (SL_WLAN_VAL_2_MASK(0,Enable) | SL_WLAN_VAL_2_MASK(1,Enable_Hidden))
305 
306 
307 #define SL_WLAN_ENABLE_SCAN (1)
308 #define SL_WLAN_DISABLE_SCAN (0)
309 #define SL_WLAN_ALLOW_HIDDEN_SSID_RESULTS (1)
310 #define SL_WLAN_BLOCK_HIDDEN_SSID_RESULTS (0)
311 
312 #define SL_WLAN_NORMAL_POLICY (0)
313 #define SL_WLAN_LOW_LATENCY_POLICY (1)
314 #define SL_WLAN_LOW_POWER_POLICY (2)
315 #define SL_WLAN_ALWAYS_ON_POLICY (3)
316 #define SL_WLAN_LONG_SLEEP_INTERVAL_POLICY (4)
317 
318 #define SL_WLAN_P2P_ROLE_NEGOTIATE (3)
319 #define SL_WLAN_P2P_ROLE_GROUP_OWNER (15)
320 #define SL_WLAN_P2P_ROLE_CLIENT (0)
321 
322 #define SL_WLAN_P2P_NEG_INITIATOR_ACTIVE (0)
323 #define SL_WLAN_P2P_NEG_INITIATOR_PASSIVE (1)
324 #define SL_WLAN_P2P_NEG_INITIATOR_RAND_BACKOFF (2)
325 
326 #define SL_WLAN_POLICY_VAL_2_OPTIONS(position,mask,policy) ((mask & policy) << position )
327 
328 #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)) | \
329  SL_WLAN_POLICY_VAL_2_OPTIONS(4,0x1,(p2pNegType > SL_WLAN_P2P_ROLE_GROUP_OWNER ? 1:0)) | \
330  SL_WLAN_POLICY_VAL_2_OPTIONS(5,0x3, p2pNegInitiator))
331 
332 
333 /* Info elements */
334 #define SL_WLAN_INFO_ELEMENT_DEFAULT_ID (0) /* 221 will be used */
335 
336 /* info element size is up to 252 bytes (+ 3 bytes of OUI). */
337 #define SL_WLAN_INFO_ELEMENT_MAX_SIZE (252)
338 
339 /* For AP - the total length of all info elements is 300 bytes (for example - 4 info elements of 75 bytes each) */
340 #define SL_WLAN_INFO_ELEMENT_MAX_TOTAL_LENGTH_AP (300)
341 
342 /* For P2P - the total length of all info elements is 160 bytes (for example - 4 info elements of 40 bytes each) */
343 #define SL_WLAN_INFO_ELEMENT_MAX_TOTAL_LENGTH_P2P_GO (160)
344 
345 #define SL_WLAN_INFO_ELEMENT_AP_ROLE (0)
346 #define SL_WLAN_INFO_ELEMENT_P2P_GO_ROLE (1)
347 
348 /* we support up to 4 info elements per Role. */
349 #define SL_WLAN_MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED (4)
350 
351 #define SL_WLAN_INFO_ELEMENT_DEFAULT_OUI_0 (0x08)
352 #define SL_WLAN_INFO_ELEMENT_DEFAULT_OUI_1 (0x00)
353 #define SL_WLAN_INFO_ELEMENT_DEFAULT_OUI_2 (0x28)
354 
355 #define SL_WLAN_INFO_ELEMENT_DEFAULT_OUI (0x000000) /* 08, 00, 28 will be used */
356 
357 #define SL_WLAN_AP_ACCESS_LIST_MODE_DISABLED 0
358 #define SL_WLAN_AP_ACCESS_LIST_MODE_DENY_LIST 1
359 #define SL_WLAN_MAX_ACCESS_LIST_STATIONS 8
360 
361 
362 /* Scan results security information */
363 #define SL_WLAN_SCAN_RESULT_GROUP_CIPHER(SecurityInfo) (SecurityInfo & 0xF) /* Possible values: NONE,SL_WLAN_CIPHER_BITMAP_TKIP,SL_WLAN_CIPHER_BITMAP_CCMP */
364 #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*/
365 #define SL_WLAN_SCAN_RESULT_HIDDEN_SSID(SecurityInfo) (SecurityInfo & 0x2000 ) >> 13 /* Possible values: TRUE/FALSE */
366 #define SL_WLAN_SCAN_RESULT_KEY_MGMT_SUITES_BITMAP(SecurityInfo) (SecurityInfo & 0x1800 ) >> 11 /* Possible values: SL_WLAN_KEY_MGMT_SUITE_802_1_X, SL_WLAN_KEY_MGMT_SUITE_PSK */
367 #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, 0x6 (mix mode) SL_WLAN_SECURITY_TYPE_BITMAP_WPA | SL_WLAN_SECURITY_TYPE_BITMAP_WPA2 */
368 
369 #define SL_WLAN_SECURITY_TYPE_BITMAP_OPEN 0x0
370 #define SL_WLAN_SECURITY_TYPE_BITMAP_WEP 0x1
371 #define SL_WLAN_SECURITY_TYPE_BITMAP_WPA 0x2
372 #define SL_WLAN_SECURITY_TYPE_BITMAP_WPA2 0x4
373 
374 #define SL_WLAN_CIPHER_BITMAP_WEP40 0x1
375 #define SL_WLAN_CIPHER_BITMAP_WEP104 0x2
376 #define SL_WLAN_CIPHER_BITMAP_TKIP 0x4
377 #define SL_WLAN_CIPHER_BITMAP_CCMP 0x8
378 
379 #define SL_WLAN_KEY_MGMT_SUITE_802_1_X 1
380 #define SL_WLAN_KEY_MGMT_SUITE_PSK 2
381 
382 
383 
384 #define SL_WLAN_RX_FILTER_MAX_FILTERS (64) /* Max number of filters is 64 filters */
385 #define SL_WLAN_RX_FILTER_MAX_SYS_FILTERS_SETS (32) /* The Max number of system filters */
386 #define SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS (2)
387 #define SL_WLAN_RX_FILTER_NUM_OF_FILTER_PAYLOAD_ARGS (2)
388 #define SL_WLAN_RX_FILTER_RANGE_ARGS (2)
389 #define SL_WLAN_RX_FILTER_NUM_USER_EVENT_ID (64)
390 #define SL_WLAN_RX_FILTER_MAX_USER_EVENT_ID ( ( SL_WLAN_RX_FILTER_NUM_USER_EVENT_ID ) - 1 )
391 
392 /* Bit manipulation for 8 bit */
393 #define SL_WLAN_ISBITSET8(x,i) ((x[i>>3] & (0x80>>(i&7)))!=0) /* Is bit set, 8 bit unsigned numbers = x , location = i */
394 #define SL_WLAN_SETBIT8(x,i) x[i>>3]|=(0x80>>(i&7)); /* Set bit,8 bit unsigned numbers = x , location = i */
395 #define SL_WLAN_CLEARBIT8(x,i) x[i>>3]&=(0x80>>(i&7))^0xFF; /* Clear bit,8 bit unsigned numbers = x , location = i */
396 
397 
398 /*****************************************************************************/
399 /* Structure/Enum declarations */
400 /*****************************************************************************/
401 
402 typedef enum
403 {
404  SL_WLAN_RATE_1M = 1,
405  SL_WLAN_RATE_2M = 2,
406  SL_WLAN_RATE_5_5M = 3,
407  SL_WLAN_RATE_11M = 4,
408  SL_WLAN_RATE_6M = 6,
409  SL_WLAN_RATE_9M = 7,
410  SL_WLAN_RATE_12M = 8,
411  SL_WLAN_RATE_18M = 9,
412  SL_WLAN_RATE_24M = 10,
413  SL_WLAN_RATE_36M = 11,
414  SL_WLAN_RATE_48M = 12,
415  SL_WLAN_RATE_54M = 13,
416  SL_WLAN_RATE_MCS_0 = 14,
417  SL_WLAN_RATE_MCS_1 = 15,
418  SL_WLAN_RATE_MCS_2 = 16,
419  SL_WLAN_RATE_MCS_3 = 17,
420  SL_WLAN_RATE_MCS_4 = 18,
421  SL_WLAN_RATE_MCS_5 = 19,
422  SL_WLAN_RATE_MCS_6 = 20,
423  SL_WLAN_RATE_MCS_7 = 21,
424  SL_WLAN_MAX_NUM_RATES = 0xFF
425 }SlWlanRateIndex_e;
426 
427 typedef enum
428 {
429  SL_WLAN_DEV_PW_DEFAULT = 0,
430  SL_WLAN_DEV_PW_PIN_KEYPAD = 1,
431  SL_WLAN_DEV_PW_PUSH_BUTTON = 4,
432  SL_WLAN_DEV_PW_PIN_DISPLAY = 5
433 } SlWlanP2pDevPwdMethod_e;
434 
435 
436 typedef struct
437 {
438  _u32 Status;
439  _u32 SsidLen;
440  _u8 Ssid[32];
441  _u32 PrivateTokenLen;
442  _u8 PrivateToken[32];
444 
445 typedef struct
446 {
447  _u16 Status;
448  _u16 Padding;
450 
451 typedef struct
452 {
453  _u16 Status;
454  _u16 Padding;
456 
457 typedef struct
458 {
459  _u16 Status;
460  _u16 Padding;
462 
463 /* rx filter event struct
464  this event will be sent from the SL device
465  as a result of a passed rx filter
466  example:
467  suppose we have a filter with an action and we set the following:
468  SlWlanRxFilterAction_t Action;
469  Action.UserId = 2;
470  When the filter result is pass, an SlWlanEventRxFilterInfo_t event will be passed to the user as follows:
471  Type will be set to 0
472  bit 2 in UserActionIdBitmap will be set in this event, because 2 is the user input for the action arg above.
473  an SlWlanEventRxFilterInfo_t event may have several bits set as a result of several rx filters causing different
474  events to pass */
475 
476 typedef struct
477 {
478  _u8 Type; /* Currently only event type 0 is supported. */
479  _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. */
481 
482 
483 
484 typedef enum
485 {
486  ROLE_STA = 0,
487  ROLE_RESERVED = 1,
488  ROLE_AP = 2,
489  ROLE_P2P = 3
490 }SlWlanMode_e;
491 
492 typedef struct
493 {
494  _u8 SsidLen;
495  _u8 SsidName[32];
496  _u8 Bssid[6];
497  _u8 Padding;
499 
500 typedef struct
501 {
502  _u8 SsidLen;
503  _u8 SsidName[32];
504  _u8 Bssid[6];
505  _u8 ReasonCode;
507 
508 typedef struct
509 {
510  _u8 Mac[6];
511  _u8 Padding[2];
513 
514 
515 typedef struct
516 {
517  _u8 SsidLen;
518  _u8 SsidName[32];
519  _u8 Bssid[6];
520  _u8 Reserved;
521  _u8 GoDeviceNameLen;
522  _u8 GoDeviceName[32];
523  _u8 Padding[3];
525 
526 typedef struct
527 {
528  _u8 SsidLen;
529  _u8 SsidName[32];
530  _u8 Bssid[6];
531  _u8 ReasonCode;
532  _u8 GoDeviceNameLen;
533  _u8 GoDeviceName[32];
534  _u8 Padding[3];
536 
537 
538 
539 
540 typedef struct
541 {
542  _u8 Mac[6];
543  _u8 ClDeviceNameLen;
544  _u8 ClDeviceName[32];
545  _u8 OwnSsidLen;
546  _u8 OwnSsid[32];
548 
549 
550 typedef struct
551 {
552  _u8 GoDeviceNameLen;
553  _u8 GoDeviceName[32];
554  _u8 Mac[6];
555  _u8 WpsMethod;
557 
558 
559 /**************************************************/
560 typedef struct
561 {
562  _u16 Status;
563  _u16 Padding;
565 
566 
567 typedef struct
568 {
569  _u8 ProvisioningStatus;
570  _u8 Role;
571  _u8 WlanStatus;
572  _u8 Ssidlen;
573  _u8 Ssid[32];
574  _u32 Reserved;
576 
577 typedef struct
578 {
579  _u32 Status;
580  _u32 SsidLen;
581  _u8 Ssid[32];
582  _u32 ReservedLen;
583  _u8 Reserved[32];
585 
586 
587 typedef union
588 {
589  SlWlanEventConnect_t Connect; /* SL_WLAN_EVENT_CONNECT */
590  SlWlanEventDisconnect_t Disconnect; /* SL_WLAN_EVENT_DISCONNECT */
591  SlWlanEventSTAAdded_t STAAdded; /* SL_WLAN_EVENT_STA_ADDED */
592  SlWlanEventSTARemoved_t STARemoved; /* SL_WLAN_EVENT_STA_REMOVED */
593  SlWlanEventP2PConnect_t P2PConnect; /* SL_WLAN_EVENT_P2P_CONNECT */
594  SlWlanEventP2PDisconnect_t P2PDisconnect; /* SL_WLAN_EVENT_P2P_DISCONNECT */
595  SlWlanEventP2PClientAdded_t P2PClientAdded; /* SL_WLAN_EVENT_P2P_CLIENT_ADDED */
596  SlWlanEventP2PClientRemoved_t P2PClientRemoved; /* SL_WLAN_EVENT_P2P_CLIENT_REMOVED */
597  SlWlanEventP2PDevFound_t P2PDevFound; /* SL_WLAN_EVENT_P2P_DEVFOUND */
598  SlWlanEventP2PRequest_t P2PRequest; /* SL_WLAN_EVENT_P2P_REQUEST */
599  SlWlanEventP2PConnectFail_t P2PConnectFail; /* SL_WLAN_EVENT_P2P_CONNECTFAIL */
600  SlWlanEventRxFilterInfo_t RxFilterInfo; /* SL_WLAN_EVENT_RXFILTER */
601  SlWlanEventProvisioningStatus_t ProvisioningStatus; /* SL_WLAN_EVENT_PROVISIONING_STATUS */
602  SlWlanEventProvisioningProfileAdded_t ProvisioningProfileAdded; /* SL_WLAN_EVENT_PROVISIONING_PROFILE_ADDED */
603 
605 
606 
607 typedef struct
608 {
609  _u32 Id;
610  SlWlanEventData_u Data;
611 } SlWlanEvent_t;
612 
613 
614 typedef struct
615 {
616  _u32 ReceivedValidPacketsNumber; /* sum of the packets that been received OK (include filtered) */
617  _u32 ReceivedFcsErrorPacketsNumber; /* sum of the packets that been dropped due to FCS error */
618  _u32 ReceivedAddressMismatchPacketsNumber; /* sum of the packets that been received but filtered out by one of the HW filters */
619  _i16 AvarageDataCtrlRssi; /* average RSSI for all valid data packets received */
620  _i16 AvarageMgMntRssi; /* average RSSI for all valid management packets received */
621  _u16 RateHistogram[SL_WLAN_NUM_OF_RATE_INDEXES]; /* rate histogram for all valid packets received */
622  _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 */
623  _u32 StartTimeStamp; /* the time stamp started collecting the statistics in uSec */
624  _u32 GetTimeStamp; /* the time stamp called the get statistics command */
626 
627 
628 
629 
630 typedef struct
631 {
632  _u8 Ssid[SL_WLAN_SSID_MAX_LENGTH];
633  _u8 Bssid[SL_WLAN_BSSID_LENGTH];
634  _u8 SsidLen;
635  _i8 Rssi;
636  _i16 SecurityInfo;
637  _i8 Channel;
638  _i8 Reserved[1];
640 
641 typedef struct
642 {
643  _u8 Type;
644  _i8* Key;
645  _u8 KeyLen;
647 
648 typedef struct
649 {
650  _i8* User;
651  _u8 UserLen;
652  _i8* AnonUser;
653  _u8 AnonUserLen;
654  _u8 CertIndex; /* not supported */
655  _u32 EapMethod;
657 
658 typedef struct
659 {
660  _i8 User[32];
661  _u8 UserLen;
662  _i8 AnonUser[32];
663  _u8 AnonUserLen;
664  _u8 CertIndex; /* not supported */
665  _u32 EapMethod;
667 
668 
669 #define SL_WLAN_CONNECTION_PROTOCOL_STA 1
670 #define SL_WLAN_CONNECTION_PROTOCOL_P2PCL 2
671 
672 typedef union
673 {
674  SlWlanEventConnect_t StaConnect;
675  SlWlanEventP2PConnect_t P2PConnect;
677 
678 typedef enum
679 {
680  SL_WLAN_DISCONNECTED = 0,
681  SL_WLAN_CONNECTED_STA,
682  SL_WLAN_CONNECTED_P2PCL,
683  SL_WLAN_CONNECTED_P2PGO,
684  SL_WLAN_AP_CONNECTED_STATIONS
685 }SlWlanConnStatusFlags_e;
686 
687 typedef struct
688 {
689  _u8 Mode; /* ROLE_STA, ROLE_AP, ROLE_P2P */
690  _u8 ConnStatus; /* SlWlanConnStatusFlags_e */
691  _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_WPA_ENT, SL_WLAN_SEC_TYPE_WPS_PBC, SL_WLAN_SEC_TYPE_WPS_PIN */
692  _u8 Reserved;
693  SlWlanConnectionInfo_u ConnectionInfo;
695 
696 typedef struct
697 {
698  _u32 ChannelsMask;
699  _i32 RssiThershold;
701 
702 
703 typedef struct
704 {
705  _u8 Id;
706  _u8 Oui[3];
707  _u16 Length;
708  _u8 Data[252];
710 
711 typedef struct
712 {
713  _u8 Index; /* 0 - SL_WLAN_MAX_PRIVATE_INFO_ELEMENTS_SUPPROTED */
714  _u8 Role; /* bit0: AP = 0, GO = 1 */
717 
718 
719 typedef struct
720 {
721  _u16 Reserved;
722  _u16 Reserved2;
723  _u16 MaxSleepTimeMs; /* max sleep time in mSec For setting Long Sleep Interval policy use */
724  _u16 Reserved3;
726 
727 
728 
729 typedef _i8 SlWlanRxFilterID_t; /* Unique filter ID which is allocated by the system , negative number means error */
730 
731 /* Representation of filters Id as a bit field
732  The bit field is used to declare which filters are involved
733  in operation. Number of filter can be up to 128 filters.
734  i.e. 128 bits are needed. On the current release, up to 64 filters can be defined. */
735 typedef _u8 SlWlanRxFilterIdMask_t[128/8];
736 
737 
738 typedef _u8 SlWlanRxFilterSysFilters_t; /* Describes the supported system filter sets*/
739 /* possible values for SlWlanRxFilterSysFilters_t */
740 #define SL_WLAN_RX_FILTER_ARP_AUTO_REPLY_SYS_FILTERS (0)
741 #define SL_WLAN_RX_FILTER_MULTICASTSIPV4_SYS_FILTERS (1)
742 #define SL_WLAN_RX_FILTER_MULTICASTSIPV6_SYS_FILTERS (2)
743 #define SL_WLAN_RX_FILTER_MULTICASTSWIFI_SYS_FILTERS (3)
744 #define SL_WLAN_RX_FILTER_SELF_MAC_ADDR_DROP_SYS_FILTERS (4)
745 
746 
747 /* Describes the supported system filter sets, each bit represents different system filter set
748  The filter sets are defined at SlWlanRxFilterSysFilters_t */
749 typedef _u8 SlWlanRxFilterSysFiltersMask_t[SL_WLAN_RX_FILTER_MAX_SYS_FILTERS_SETS/8];
750 
751 typedef struct
752 {
753  _u16 Offset; /* Offset in payload - Where in the payload to search for the pattern */
754  _u8 Length; /* Pattern Length */
755  _u8 Reserved;
756  _u8 Value[16];/* Up to 16 bytes long (based on pattern length above) */
758 
759 
760 typedef _u8 SlWlanRxFilterRuleType_t; /* Different filter types */
761 /* possible values for SlWlanRxFilterRuleType_t */
762 #define SL_WLAN_RX_FILTER_HEADER (0)
763 #define SL_WLAN_RX_FILTER_COMBINATION (1)
764 
765 typedef _u8 SlWlanRxFilterFlags_u;
766 /* Possible values for SlWlanRxFilterFlags_u */
767 #define SL_WLAN_RX_FILTER_BINARY (0x1)
768 #define SL_WLAN_RX_FILTER_PERSISTENT (0x8)
769 #define SL_WLAN_RX_FILTER_ENABLE (0x10)
770 
771 /* Used as comparison function for the header type arguments */
772 typedef _u8 SlWlanRxFilterRuleHeaderCompareFunction_t;
773 /* Possible values for SlWlanRxFilterRuleHeaderCompareFunction_t */
774 #define SL_WLAN_RX_FILTER_CMP_FUNC_IN_BETWEEN (0)
775 #define SL_WLAN_RX_FILTER_CMP_FUNC_EQUAL (1)
776 #define SL_WLAN_RX_FILTER_CMP_FUNC_NOT_EQUAL_TO (2)
777 #define SL_WLAN_RX_FILTER_CMP_FUNC_NOT_IN_BETWEEN (3)
778 
779 
780 typedef _u8 SlWlanRxFilterTriggerCompareFunction_t;
781 /* Possible values for SlWlanRxFilterTriggerCompareFunction_t */
782 #define SL_WLAN_RX_FILTER_TRIGGER_CMP_FUNC_EQUAL (0)
783 #define SL_WLAN_RX_FILTER_TRIGGER_CMP_FUNC_NOT_EQUAL_TO (1) /* arg1 == protocolVal ,not supported in current release */
784 #define SL_WLAN_RX_FILTER_TRIGGER_CMP_FUNC_SMALLER_THAN (2) /* arg1 == protocolVal */
785 #define SL_WLAN_RX_FILTER_TRIGGER_CMP_FUNC_BIGGER_THAN (3) /* arg1 == protocolVal */
786 
787 
788 typedef _u8 SlWlanRxFilterRuleHeaderField_t; /* Provides list of possible header types which may be defined as part of the rule */
789 /* Possible values for SlWlanRxFilterRuleHeaderField_t */
790 #define SL_WLAN_RX_FILTER_HFIELD_NULL (0)
791 #define SL_WLAN_RX_FILTER_HFIELD_FRAME_TYPE (1) /* 802.11 control\data\management */
792 #define SL_WLAN_RX_FILTER_HFIELD_FRAME_SUBTYPE (2) /* 802.11 beacon\probe\.. */
793 #define SL_WLAN_RX_FILTER_HFIELD_BSSID (3) /* 802.11 bssid type */
794 #define SL_WLAN_RX_FILTER_HFIELD_MAC_SRC_ADDR (4)
795 #define SL_WLAN_RX_FILTER_HFIELD_MAC_DST_ADDR (5)
796 #define SL_WLAN_RX_FILTER_HFIELD_FRAME_LENGTH (6)
797 #define SL_WLAN_RX_FILTER_HFIELD_ETHER_TYPE (7)
798 #define SL_WLAN_RX_FILTER_HFIELD_IP_VERSION (8)
799 #define SL_WLAN_RX_FILTER_HFIELD_IP_PROTOCOL (9) /* TCP / UDP / ICMP / ICMPv6 / IGMP */
800 #define SL_WLAN_RX_FILTER_HFIELD_IPV4_SRC_ADDR (10)
801 #define SL_WLAN_RX_FILTER_HFIELD_IPV4_DST_ADDR (11)
802 #define SL_WLAN_RX_FILTER_HFIELD_IPV6_SRC_ADRR (12)
803 #define SL_WLAN_RX_FILTER_HFIELD_IPV6_DST_ADDR (13)
804 #define SL_WLAN_RX_FILTER_HFIELD_PORT_SRC (14)
805 #define SL_WLAN_RX_FILTER_HFIELD_PORT_DST (15)
806 #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) */
807 #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) */
808 #define SL_WLAN_RX_FILTER_HFIELD_MAX_FIELD (21) /* Definition */
809 
810 
811 /* Holds the header ARGS which are used in case of HDR rule */
812 typedef union
813 {
814  /* buffer for pattern matching in payload up to 16 bytes (Binary Values) */
816 
817  /* Buffer for ipv4 address filter. binary arguments, number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS*/
818  _u8 Ipv4[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][4]; /* Binary Values for comparison */
819 
820  /* 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*/
821  _u8 Ipv4Ascii[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][16]; /* Ascii Values for comparison */
822 
823  /* 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*/
824  _u8 Ipv6[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][16]; /* Binary Values for comparison */
825 
826  /* Buffer for mac address filter. binary arguments. number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS*/
827  _u8 Mac[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][6]; /* Binary Values for comparison */
828 
829  /* 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 */
830  _u8 MacAscii[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][18]; /* Ascii Values for comparison */
831 
832  /* Buffer for BSSID address filter. binary arguments. number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS*/
833  _u8 Bssid[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][6]; /* Binary Values for comparison */
834 
835  /* Buffer for frame length filter. number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS */
836  _u32 FrameLength[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS]; /* Binary Values for comparison */
837 
838  /* Buffer for port filter. number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS */
839  _u16 Port[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS]; /* Binary Values for comparison */
840 
841  /* Buffer for Ether filter. number of argument may be up to SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS (according to host endianity) */
842  _u32 EtherType[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS]; /* Binary Values for comparison */
843 
844  /* Buffer for ip version filter. Buffer for binary arguments. IP Version - 4 for IPV4 and 6 for IPV6 */
845  _u8 IpVersion;
846 
847  /* Buffer for frame type filter. Buffer for binary arguments. Frame Type (0 - management, 1 - Control, 2 - Data) */
848  _u8 Frametype[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS];
849 
850  /* 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. */
851  _u8 FrameSubtype[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS];
852 
853  /* 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 */
854  _u8 IpProtocol[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS];
855 
856  /* Buffer for ip version filter. Buffer for ASCII arguments. Use for IP version field comparison settings: "IPV4", "IPV6" */
857  _u8 IpVersionAscii[4];
858 
859  /* Buffer for frame type filter. Buffer for ASCII arguments. Use for Frame type field comparison settings: "MGMT", "CTRL", "DATA" */
860  _u8 FrametypeAscii[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][4];
861 
862  /* Buffer for protocol type filter. Buffer for ASCII arguments. Use for protocol field comparison settings: "ICMP", "IGMP", "TCP, "UDP", "ICMP6" */
863  /* 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) */
864  _u8 IpProtocolAscii[SL_WLAN_RX_FILTER_NUM_OF_FILTER_HEADER_ARGS][5];
865 
867 
868 
869 /* Defines the Header Args and mask */
870 typedef struct
871 {
872  SlWlanRxFilterHeaderArg_u Value; /* Argument for the comparison function */
873  _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 */
874 
876 
877 /* defines the Header rule. The header rule defines the compare function on the protocol header
878  For example destMacAddre is between ( 12:6::78:77, 12:6::78:90 ) */
879 typedef struct
880 {
881  SlWlanRxFilterRuleHeaderArgs_t Args; /* Filter arguemnts */
882  SlWlanRxFilterRuleHeaderField_t Field; /* Packet HDR field which will be compared to the argument */
883  SlWlanRxFilterRuleHeaderCompareFunction_t CompareFunc; /* type of the comparison function */
884  _u8 Padding[2];
886 
887 
888 /* Optional operators for the combination type filterID1 is located in the first arg , filterId2 is the second arg */
889 typedef _u8 SlWlanRxFilterRuleCombinationOperator_t;
890 /* Possible values for SlWlanRxFilterRuleCombinationOperator_t */
891 #define SL_WLAN_RX_FILTER_COMBINED_FUNC_NOT (0) /* filterID1 */
892 #define SL_WLAN_RX_FILTER_COMBINED_FUNC_AND (1) /* filterID1 && filterID2 */
893 #define SL_WLAN_RX_FILTER_COMBINED_FUNC_OR (2) /* filterID1 && filterID2 */
894 
895 
896 /* Defines the structure which define the combination type filter
897  The combined filter enable to make operation on one or two filter,
898  for example filterId1 or and(filterId2,filterId3). */
899 typedef struct
900 {
901  SlWlanRxFilterRuleCombinationOperator_t Operator; /* combination operator */
902  SlWlanRxFilterID_t CombinationFilterId[SL_WLAN_RX_FILTER_RANGE_ARGS]; /* filterID, may be one or two depends on the combination operator type */
903  _u8 Padding;
905 
906 
907 /* Rule structure composed of behavioral flags and the filter rule definitions */
908 typedef union
909 {
910  SlWlanRxFilterRuleHeader_t Header; /* Filter is from type Header */
911  SlWlanRxFilterRuleCombination_t Combination; /* Filter is from type Combination */
913 
914 
915 /* Bit field which represents the roleId possible values
916  In the current release only Station (with or without promiscuous modes) and AP roles are supported.
917  Activating filters before P2P negotiations (i.e. decision whether role is CL or GO) may result with
918  unexpected behaviour. After this stage, filters can be activated whereas STA role is the equivalent of P2P CL role
919  AP role is the equivalent of P2P GO role.
920  */
921 typedef _u8 SlWlanRxFilterTriggerRoles_t;
922 /* Possible values for SlWlanRxFilterTriggerRoles_t */
923 #define SL_WLAN_RX_FILTER_ROLE_AP (1)
924 #define SL_WLAN_RX_FILTER_ROLE_STA (2)
925 #define SL_WLAN_RX_FILTER_ROLE_TRANCIEVER (4)
926 #define SL_WLAN_RX_FILTER_ROLE_NULL (0)
927 
928 
929 typedef _u8 SlWlanRxFilterTriggerConnectionStates_t;
930 /* Possible values for SlWlanRxFilterTriggerConnectionStates_t */
931 #define SL_WLAN_RX_FILTER_STATE_STA_CONNECTED (0x1)
932 #define SL_WLAN_RX_FILTER_STATE_STA_NOT_CONNECTED (0x2)
933 #define SL_WLAN_RX_FILTER_STATE_STA_HAS_IP (0x4)
934 #define SL_WLAN_RX_FILTER_STATE_STA_HAS_NO_IP (0x8)
935 
936 
937 /* There are 8 possible counter. if no counter is needed set to NO_TRIGGER_COUNTER */
938 typedef _u8 SlWlanRxFilterCounterId_t;
939 /* Possible values for SlWlanRxFilterCounterId_t */
940 #define SL_WLAN_RX_FILTER_NO_TRIGGER_COUNTER (0)
941 #define SL_WLAN_RX_FILTER_COUNTER1 (1)
942 #define SL_WLAN_RX_FILTER_COUNTER2 (2)
943 #define SL_WLAN_RX_FILTER_COUNTER3 (3)
944 #define SL_WLAN_RX_FILTER_COUNTER4 (4)
945 #define SL_WLAN_RX_FILTER_COUNTER5 (5)
946 #define SL_WLAN_RX_FILTER_COUNTER6 (6)
947 #define SL_WLAN_RX_FILTER_COUNTER7 (7)
948 #define SL_WLAN_RX_FILTER_COUNTER8 (8)
949 #define SL_WLAN_RX_FILTER_MAX_COUNTER (9)
950 
951 
952 /* The filter trigger, determine when the filter is triggered,
953  The filter is triggered in the following condition :\n
954  1. The filter parent is triggered\n
955  2. The requested connection type exists, i.e. wlan_connect\n
956  3. The filter role is the same as the system role\n */
957 typedef struct
958 {
959  SlWlanRxFilterID_t ParentFilterID; /* The parent filter ID, this is the way to build filter tree. NULL value means tree root */
960  SlWlanRxFilterCounterId_t Counter; /* Trigger only when reach counter threshold */
961  SlWlanRxFilterTriggerConnectionStates_t ConnectionState; /* Trigger only with specific connection state */
962  SlWlanRxFilterTriggerRoles_t Role; /* Trigger only with specific role */
963  _u32 CounterVal; /* Value for the counter if set */
964  SlWlanRxFilterTriggerCompareFunction_t CompareFunction; /* The compare function reffers to the counter if set */
965  _u8 Padding[3];
967 
968 
969 /* The actions are executed only if the filter is matched,\n
970  * In case of false match the packet is transfered to the HOST. \n
971  * The action is composed of bit field structure, up to 2 actions can be defined per filter.\n */
972 typedef _u8 SlWlanRxFilterActionType_t;
973 /* Possible values for SlWlanRxFilterActionType_t */
974 #define SL_WLAN_RX_FILTER_ACTION_NULL (0x0) /* No action to execute*/
975 #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 */
976 #define SL_WLAN_RX_FILTER_ACTION_ON_REG_INCREASE (0x4) /* action increase counter registers */
977 #define SL_WLAN_RX_FILTER_ACTION_ON_REG_DECREASE (0x8) /* action decrease counter registers */
978 #define SL_WLAN_RX_FILTER_ACTION_ON_REG_RESET (0x10)/* action reset counter registers */
979 #define SL_WLAN_RX_FILTER_ACTION_SEND_TEMPLATE (0x20)/* unsupported */
980 #define SL_WLAN_RX_FILTER_ACTION_EVENT_TO_HOST (0x40)/* action can send events to host */
981 
982 
983 
984 /* Several actions can be defined The action is executed in case the filter rule is matched. */
985 typedef struct
986 {
987  SlWlanRxFilterActionType_t Type; /* Determine which actions are supported */
988  _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*/
989  _u16 Reserved; /* Must be set to zero */
990  _u8 UserId; /* In case action set to host event, user can set id which will return in the event arguments */
991  _u8 Padding[3];
992 
994 
995 /* The supported operation: SL_WLAN_RX_FILTER_STATE, SL_WLAN_RX_FILTER_REMOVE */
996 typedef struct
997 {
998  SlWlanRxFilterIdMask_t FilterBitmap;
999  _u8 Padding[4];
1000 
1002 
1003 /* The supported operation: SL_WLAN_RX_FILTER_UPDATE_ARGS */
1004 typedef struct
1005 {
1006  _u8 FilterId;
1007  _u8 BinaryOrAscii; /* Set 1 for Binary argument representation, 0 - for Ascii representation */
1008  _u8 Padding[2];
1010 
1011 
1013 
1014 
1015 /* Filters bitmap enable\disable status return value */
1016 typedef struct
1017 {
1018  SlWlanRxFilterIdMask_t FilterIdMask; /* The filter set bit map */
1019 
1021 
1022 /* Disbale/Enable system filters */
1023 typedef struct
1024 {
1025  SlWlanRxFilterSysFiltersMask_t FilterBitmap; /* The filter set bit map */
1026 
1028 
1029 /* System filters status return value */
1030 typedef struct
1031 {
1032  SlWlanRxFilterSysFiltersMask_t FilterBitmap; /* The filter get bit map */
1033 
1035 
1036 
1037 /*****************************************************************************/
1038 /* Function prototypes */
1039 /*****************************************************************************/
1040 
1041 
1079 #if _SL_INCLUDE_FUNC(sl_WlanConnect)
1080 _i16 sl_WlanConnect(const _i8* pName,const _i16 NameLen,const _u8 *pMacAddr,const SlWlanSecParams_t* pSecParams ,const SlWlanSecParamsExt_t* pSecExtParams);
1081 #endif
1082 
1094 #if _SL_INCLUDE_FUNC(sl_WlanDisconnect)
1095 _i16 sl_WlanDisconnect(void);
1096 #endif
1097 
1143 #if _SL_INCLUDE_FUNC(sl_WlanProfileAdd)
1144 _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);
1145 #endif
1146 
1178 #if _SL_INCLUDE_FUNC(sl_WlanProfileGet)
1179 _i16 sl_WlanProfileGet(const _i16 Index,_i8* pName, _i16 *pNameLen, _u8 *pMacAddr, SlWlanSecParams_t* pSecParams, SlWlanGetSecParamsExt_t* pSecExtParams, _u32 *pPriority);
1180 #endif
1181 
1197 #if _SL_INCLUDE_FUNC(sl_WlanProfileDel)
1198 _i16 sl_WlanProfileDel(const _i16 Index);
1199 #endif
1200 
1328 #if _SL_INCLUDE_FUNC(sl_WlanPolicySet)
1329 _i16 sl_WlanPolicySet(const _u8 Type , const _u8 Policy, _u8 *pVal,const _u8 ValLen);
1330 #endif
1331 
1419 #if _SL_INCLUDE_FUNC(sl_WlanPolicyGet)
1420 _i16 sl_WlanPolicyGet(const _u8 Type ,_u8 *pPolicy,_u8 *pVal,_u8 *pValLen);
1421 #endif
1422 
1463 #if _SL_INCLUDE_FUNC(sl_WlanGetNetworkList)
1464 _i16 sl_WlanGetNetworkList(const _u8 Index,const _u8 Count, SlWlanNetworkEntry_t *pEntries);
1465 #endif
1466 
1505 #if _SL_INCLUDE_FUNC(sl_WlanRxStatStart)
1506 _i16 sl_WlanRxStatStart(void);
1507 #endif
1508 
1520 #if _SL_INCLUDE_FUNC(sl_WlanRxStatStop)
1521 _i16 sl_WlanRxStatStop(void);
1522 #endif
1523 
1524 
1536 #if _SL_INCLUDE_FUNC(sl_WlanRxStatGet)
1537 _i16 sl_WlanRxStatGet(SlWlanGetRxStatResponse_t *pRxStat,const _u32 Flags);
1538 #endif
1539 
1540 
1596 #if _SL_INCLUDE_FUNC(sl_WlanProvisioning)
1597 _i16 sl_WlanProvisioning(_u8 ProvisioningCmd, _u8 RequestedRoleAfterSuccess, _u16 InactivityTimeoutSec, char *pSmartConfigKey, _u32 Flags);
1598 #endif
1599 
1600 
1601 
1627 #if _SL_INCLUDE_FUNC(sl_WlanSetMode)
1628 _i16 sl_WlanSetMode(const _u8 Mode);
1629 #endif
1630 
1631 
1943 #if _SL_INCLUDE_FUNC(sl_WlanSet)
1944 _i16 sl_WlanSet(const _u16 ConfigId ,const _u16 ConfigOpt,const _u16 ConfigLen,const _u8 *pValues);
1945 #endif
1946 
2234 #if _SL_INCLUDE_FUNC(sl_WlanGet)
2235 _i16 sl_WlanGet(const _u16 ConfigId, _u16 *pConfigOpt,_u16 *pConfigLen, _u8 *pValues);
2236 #endif
2237 
2263 #if _SL_INCLUDE_FUNC(sl_WlanRxFilterAdd)
2264 _i16 sl_WlanRxFilterAdd( SlWlanRxFilterRuleType_t RuleType,
2265  SlWlanRxFilterFlags_u Flags,
2266  const SlWlanRxFilterRule_u* const pRule,
2267  const SlWlanRxFilterTrigger_t* const pTrigger,
2268  const SlWlanRxFilterAction_t* const pAction,
2269  SlWlanRxFilterID_t* pFilterId);
2270 
2271 #endif
2272 
2273 
2274 
2275 
2284 #ifdef __cplusplus
2285 }
2286 #endif /* __cplusplus */
2287 
2288 #endif /* __WLAN_H__ */
2289 
_i16 sl_WlanSetMode(const _u8 Mode)
Wlan set mode.
Definition: wlan.c:853
_i16 sl_WlanRxFilterAdd(SlWlanRxFilterRuleType_t RuleType, SlWlanRxFilterFlags_u Flags, const SlWlanRxFilterRule_u *const pRule, const SlWlanRxFilterTrigger_t *const pTrigger, const SlWlanRxFilterAction_t *const pAction, SlWlanRxFilterID_t *pFilterId)
Adds new filter rule to the system.
Definition: wlan.c:676
_i16 sl_WlanConnect(const _i8 *pName, const _i16 NameLen, const _u8 *pMacAddr, const SlWlanSecParams_t *pSecParams, const SlWlanSecParamsExt_t *pSecExtParams)
Connect to wlan network as a station.
Definition: wlan.c:51
_i16 sl_WlanGet(const _u16 ConfigId, _u16 *pConfigOpt, _u16 *pConfigLen, _u8 *pValues)
Getting WLAN configurations.
Definition: wlan.c:933
_i16 sl_WlanProvisioning(_u8 ProvisioningCmd, _u8 RequestedRoleAfterSuccess, _u16 InactivityTimeoutSec, char *pSmartConfigKey, _u32 Flags)
The simpleLink will switch to the appropriate role according to the provisioning mode requested and w...
Definition: wlan.c:784
Definition: wlan.h:630
_i16 sl_WlanPolicySet(const _u8 Type, const _u8 Policy, _u8 *pVal, const _u8 ValLen)
Set policy values.
Definition: wlan.c:222
_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)
Add profile.
Definition: wlan.c:329
_i16 sl_WlanRxStatStop(void)
Stop collecting wlan RX statistic, (if previous called sl_WlanRxStatStart)
Definition: wlan.c:722
_i16 sl_WlanProfileGet(const _i16 Index, _i8 *pName, _i16 *pNameLen, _u8 *pMacAddr, SlWlanSecParams_t *pSecParams, SlWlanGetSecParamsExt_t *pSecExtParams, _u32 *pPriority)
Get profile.
Definition: wlan.c:515
_i16 sl_WlanSet(const _u16 ConfigId, const _u16 ConfigOpt, const _u16 ConfigLen, const _u8 *pValues)
Setting WLAN configurations.
Definition: wlan.c:891
_i16 sl_WlanProfileDel(const _i16 Index)
Delete WLAN profile.
Definition: wlan.c:582
_i16 sl_WlanDisconnect(void)
Wlan disconnect.
Definition: wlan.c:194
_i16 sl_WlanPolicyGet(const _u8 Type, _u8 *pPolicy, _u8 *pVal, _u8 *pValLen)
Get policy values.
Definition: wlan.c:266
_i16 sl_WlanRxStatStart(void)
Start collecting wlan RX statistics, for unlimited time.
Definition: wlan.c:711
_i16 sl_WlanRxStatGet(SlWlanGetRxStatResponse_t *pRxStat, const _u32 Flags)
Get wlan RX statistics. Upon calling this command, the statistics counters will be cleared...
Definition: wlan.c:733
_i16 sl_WlanGetNetworkList(const _u8 Index, const _u8 Count, SlWlanNetworkEntry_t *pEntries)
Gets the WLAN scan operation results.
Definition: wlan.c:618