SimpleLink CC31xx/CC32xx Host Driver  Version 3.0.1.46
Simplifies the implementation of Internet connectivity
protocol.h
1 /*
2  * protocol.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 * FILE NAME: protocol.h
41 *
42 * DESCRIPTION: Constant and data structure definitions and function
43 * prototypes for the SL protocol module, which implements
44 * processing of SimpleLink Commands.
45 *
46 * AUTHOR:
47 *
48 \*******************************************************************************/
49 
50 #ifndef _SL_PROTOCOL_TYPES_H_
51 #define _SL_PROTOCOL_TYPES_H_
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 /****************************************************************************
58 **
59 ** User I/F pools definitions
60 **
61 ****************************************************************************/
62 
63 /****************************************************************************
64 **
65 ** Definitions for SimpleLink Commands
66 **
67 ****************************************************************************/
68 
69 
70 /* pattern for LE 8/16/32 or BE*/
71 #define H2N_SYNC_PATTERN {0xBBDDEEFF,0x4321,0x34,0x12}
72 #define H2N_CNYS_PATTERN {0xBBDDEEFF,0x8765,0x78,0x56}
73 
74 #define H2N_DUMMY_PATTERN (_u32)0xFFFFFFFF
75 #define N2H_SYNC_PATTERN (_u32)0xABCDDCBA
76 #define SYNC_PATTERN_LEN (_u32)sizeof(_u32)
77 #define UART_SET_MODE_MAGIC_CODE (_u32)0xAA55AA55
78 #define SPI_16BITS_BUG(pattern) (_u32)((_u32)pattern & (_u32)0xFFFF7FFF)
79 #define SPI_8BITS_BUG(pattern) (_u32)((_u32)pattern & (_u32)0xFFFFFF7F)
80 
81 
82 typedef struct
83 {
84  _u16 Opcode;
85  _u16 Len;
87 
88 
89 typedef struct
90 {
91  _u32 Long;
92  _u16 Short;
93  _u8 Byte1;
94  _u8 Byte2;
96 
98 
99 typedef struct
100 {
101  _SlGenericHeader_t GenHeader;
102  _u8 TxPoolCnt;
103  _u8 DevStatus;
104  _u16 MinMaxPayload;
105  _u16 SocketTXFailure;
106  _u16 SocketNonBlocking;
108 
109 #define _SL_RESP_SPEC_HDR_SIZE (sizeof(_SlResponseHeader_t) - sizeof(_SlGenericHeader_t))
110 #define _SL_RESP_HDR_SIZE sizeof(_SlResponseHeader_t)
111 #define _SL_CMD_HDR_SIZE sizeof(_SlCommandHeader_t)
112 
113 #define _SL_RESP_ARGS_START(_pMsg) (((_SlResponseHeader_t *)(_pMsg)) + 1)
114 
115 /* Used only in NWP! */
116 typedef struct
117 {
118  _SlCommandHeader_t sl_hdr;
119  _u8 func_args_start;
120 } T_SCMD;
121 
122 /* _SlResponseHeader_t DevStatus bits */
123 #define _SL_DEV_STATUS_BIT_WLAN_CONN 0x01
124 #define _SL_DEV_STATUS_BIT_DROPPED_EVENTS 0x02
125 #define _SL_DEV_STATUS_BIT_LOCKED 0x04
126 #define _SL_DEV_STATUS_BIT_PROVISIONING_ACTIVE 0x08
127 #define _SL_DEV_STATUS_BIT_PROVISIONING_USER_INITIATED 0x10
128 #define _SL_DEV_STATUS_BIT_PRESERVATION 0x20
129 #define _SL_DEV_STATUS_BIT_PROVISIONING_ENABLE_API 0x40
130 
131 
132 /* Internal driver bits status (g_SlDeviceStatus) */
133 #define _SL_DRV_STATUS_BIT_RESTART_REQUIRED 0x100
134 #define _SL_DRV_STATUS_BIT_DEVICE_STARTED 0x200
135 #define _SL_DRV_STATUS_BIT_STOP_IN_PROGRESS 0x400
136 #define _SL_DRV_STATUS_BIT_START_IN_PROGRESS 0x800
137 #define _SL_DRV_STATUS_BIT_GLOBAL_LOCK_INIT 0x1000
138 /****************************************************************************
139 ** OPCODES
140 ****************************************************************************/
141 #define SL_IPV4_IPV6_OFFSET ( 9 )
142 #define SL_OPCODE_IPV4 ( 0x0 << SL_IPV4_IPV6_OFFSET )
143 #define SL_OPCODE_IPV6 ( 0x1 << SL_IPV4_IPV6_OFFSET )
144 
145 #define SL_SYNC_ASYNC_OFFSET ( 10 )
146 #define SL_OPCODE_SYNC (0x1 << SL_SYNC_ASYNC_OFFSET )
147 #define SL_OPCODE_SILO_OFFSET ( 11 )
148 #define SL_OPCODE_SILO_MASK ( 0xF << SL_OPCODE_SILO_OFFSET )
149 #define SL_OPCODE_SILO_DEVICE ( 0x0 << SL_OPCODE_SILO_OFFSET )
150 #define SL_OPCODE_SILO_WLAN ( 0x1 << SL_OPCODE_SILO_OFFSET )
151 #define SL_OPCODE_SILO_SOCKET ( 0x2 << SL_OPCODE_SILO_OFFSET )
152 #define SL_OPCODE_SILO_NETAPP ( 0x3 << SL_OPCODE_SILO_OFFSET )
153 #define SL_OPCODE_SILO_FS ( 0x4 << SL_OPCODE_SILO_OFFSET )
154 #define SL_OPCODE_SILO_NETCFG ( 0x5 << SL_OPCODE_SILO_OFFSET )
155 #define SL_OPCODE_SILO_NETUTIL ( 0x6 << SL_OPCODE_SILO_OFFSET )
156 
157 #define SL_FAMILY_SHIFT (0x4)
158 #define SL_FLAGS_MASK (0xF)
159 
160 #define SL_OPCODE_DEVICE_INITCOMPLETE 0x0008
161 #define SL_OPCODE_DEVICE_ABORT 0x000C
162 #define SL_OPCODE_DEVICE_STOP_COMMAND 0x8473
163 #define SL_OPCODE_DEVICE_STOP_RESPONSE 0x0473
164 #define SL_OPCODE_DEVICE_STOP_ASYNC_RESPONSE 0x0073
165 #define SL_OPCODE_DEVICE_DEVICEASYNCDUMMY 0x0063
166 
167 #define SL_OPCODE_DEVICE_VERSIONREADCOMMAND 0x8470
168 #define SL_OPCODE_DEVICE_VERSIONREADRESPONSE 0x0470
169 #define SL_OPCODE_DEVICE_DEVICE_ASYNC_GENERAL_ERROR 0x0078
170 #define SL_OPCODE_DEVICE_FLOW_CTRL_ASYNC_EVENT 0x0079
171 
172 #define SL_OPCODE_WLAN_WLANCONNECTCOMMAND 0x8C80
173 #define SL_OPCODE_WLAN_WLANCONNECTRESPONSE 0x0C80
174 #define SL_OPCODE_WLAN_STA_ASYNCCONNECTEDRESPONSE 0x0880
175 #define SL_OPCODE_WLAN_P2PCL_ASYNCCONNECTEDRESPONSE 0x0892
176 
177 #define SL_OPCODE_WLAN_WLANDISCONNECTCOMMAND 0x8C81
178 #define SL_OPCODE_WLAN_WLANDISCONNECTRESPONSE 0x0C81
179 #define SL_OPCODE_WLAN_STA_ASYNCDISCONNECTEDRESPONSE 0x0881
180 #define SL_OPCODE_WLAN_P2PCL_ASYNCDISCONNECTEDRESPONSE 0x0894
181 
182 #define SL_OPCODE_WLAN_ASYNC_STA_ADDED 0x082E
183 #define SL_OPCODE_WLAN_ASYNC_P2PCL_ADDED 0x0896
184 #define SL_OPCODE_WLAN_ASYNC_STA_REMOVED 0x082F
185 #define SL_OPCODE_WLAN_ASYNC_P2PCL_REMOVED 0x0898
186 
187 #define SL_OPCODE_WLAN_P2P_DEV_FOUND 0x0830
188 #define SL_OPCODE_WLAN_P2P_CONNECTION_FAILED 0x0831
189 #define SL_OPCODE_WLAN_P2P_NEG_REQ_RECEIVED 0x0832
190 
191 #define SL_OPCODE_WLAN_WLANCONNECTEAPCOMMAND 0x8C82
192 #define SL_OPCODE_WLAN_WLANCONNECTEAPCRESPONSE 0x0C82
193 #define SL_OPCODE_WLAN_PROFILEADDCOMMAND 0x8C83
194 #define SL_OPCODE_WLAN_PROFILEADDRESPONSE 0x0C83
195 #define SL_OPCODE_WLAN_PROFILEUPDATECOMMAND 0x8CC2
196 #define SL_OPCODE_WLAN_PROFILEUPDATERESPONSE 0x0CC2
197 #define SL_OPCODE_WLAN_PROFILEEAPUPDATECOMMAND 0x8CC3
198 #define SL_OPCODE_WLAN_PROFILEEAPUPDATERESPONSE 0x0CC0
199 #define SL_OPCODE_WLAN_PROFILEGETCOMMAND 0x8C84
200 #define SL_OPCODE_WLAN_PROFILEGETRESPONSE 0x0C84
201 #define SL_OPCODE_WLAN_PROFILEDELCOMMAND 0x8C85
202 #define SL_OPCODE_WLAN_PROFILEDELRESPONSE 0x0C85
203 #define SL_OPCODE_WLAN_POLICYSETCOMMAND 0x8C86
204 #define SL_OPCODE_WLAN_POLICYSETRESPONSE 0x0C86
205 #define SL_OPCODE_WLAN_POLICYGETCOMMAND 0x8C87
206 #define SL_OPCODE_WLAN_POLICYGETRESPONSE 0x0C87
207 #define SL_OPCODE_WLAN_FILTERADD 0x8C88
208 #define SL_OPCODE_WLAN_FILTERADDRESPONSE 0x0C88
209 #define SL_OPCODE_WLAN_FILTERGET 0x8C89
210 #define SL_OPCODE_WLAN_FILTERGETRESPONSE 0x0C89
211 #define SL_OPCODE_WLAN_FILTERDELETE 0x8C8A
212 #define SL_OPCODE_WLAN_FILTERDELETERESPOSNE 0x0C8A
213 #define SL_OPCODE_WLAN_WLANGETSTATUSCOMMAND 0x8C8F
214 #define SL_OPCODE_WLAN_WLANGETSTATUSRESPONSE 0x0C8F
215 #define SL_OPCODE_WLAN_STARTTXCONTINUESCOMMAND 0x8CAA
216 #define SL_OPCODE_WLAN_STARTTXCONTINUESRESPONSE 0x0CAA
217 #define SL_OPCODE_WLAN_STOPTXCONTINUESCOMMAND 0x8CAB
218 #define SL_OPCODE_WLAN_STOPTXCONTINUESRESPONSE 0x0CAB
219 #define SL_OPCODE_WLAN_STARTRXSTATCOMMAND 0x8CAC
220 #define SL_OPCODE_WLAN_STARTRXSTATRESPONSE 0x0CAC
221 #define SL_OPCODE_WLAN_STOPRXSTATCOMMAND 0x8CAD
222 #define SL_OPCODE_WLAN_STOPRXSTATRESPONSE 0x0CAD
223 #define SL_OPCODE_WLAN_GETRXSTATCOMMAND 0x8CAF
224 #define SL_OPCODE_WLAN_GETRXSTATRESPONSE 0x0CAF
225 #define SL_OPCODE_WLAN_POLICYSETCOMMANDNEW 0x8CB0
226 #define SL_OPCODE_WLAN_POLICYSETRESPONSENEW 0x0CB0
227 #define SL_OPCODE_WLAN_POLICYGETCOMMANDNEW 0x8CB1
228 #define SL_OPCODE_WLAN_POLICYGETRESPONSENEW 0x0CB1
229 
230 #define SL_OPCODE_WLAN_PROVISIONING_PROFILE_ADDED_ASYNC_RESPONSE 0x08B2
231 #define SL_OPCODE_WLAN_SET_MODE 0x8CB4
232 #define SL_OPCODE_WLAN_SET_MODE_RESPONSE 0x0CB4
233 #define SL_OPCODE_WLAN_CFG_SET 0x8CB5
234 #define SL_OPCODE_WLAN_CFG_SET_RESPONSE 0x0CB5
235 #define SL_OPCODE_WLAN_CFG_GET 0x8CB6
236 #define SL_OPCODE_WLAN_CFG_GET_RESPONSE 0x0CB6
237 #define SL_OPCODE_WLAN_EAP_PROFILEADDCOMMAND 0x8C67
238 #define SL_OPCODE_WLAN_EAP_PROFILEADDCOMMAND_RESPONSE 0x0C67
239 #define SL_OPCODE_WLAN_LINK_QUALITY_RESPONSE 0x08BA
240 
241 #define SL_OPCODE_SOCKET_SOCKET 0x9401
242 #define SL_OPCODE_SOCKET_SOCKETRESPONSE 0x1401
243 #define SL_OPCODE_SOCKET_CLOSE 0x9402
244 #define SL_OPCODE_SOCKET_CLOSERESPONSE 0x1402
245 #define SL_OPCODE_SOCKET_ACCEPT 0x9403
246 #define SL_OPCODE_SOCKET_ACCEPTRESPONSE 0x1403
247 #define SL_OPCODE_SOCKET_ACCEPTASYNCRESPONSE 0x1003
248 #define SL_OPCODE_SOCKET_ACCEPTASYNCRESPONSE_V6 0x1203
249 #define SL_OPCODE_SOCKET_BIND 0x9404
250 #define SL_OPCODE_SOCKET_BIND_V6 0x9604
251 #define SL_OPCODE_SOCKET_BINDRESPONSE 0x1404
252 #define SL_OPCODE_SOCKET_LISTEN 0x9405
253 #define SL_OPCODE_SOCKET_LISTENRESPONSE 0x1405
254 #define SL_OPCODE_SOCKET_CONNECT 0x9406
255 #define SL_OPCODE_SOCKET_CONNECT_V6 0x9606
256 #define SL_OPCODE_SOCKET_CONNECTRESPONSE 0x1406
257 #define SL_OPCODE_SOCKET_CONNECTASYNCRESPONSE 0x1006
258 #define SL_OPCODE_SOCKET_SELECT 0x9407
259 #define SL_OPCODE_SOCKET_SELECTRESPONSE 0x1407
260 #define SL_OPCODE_SOCKET_SELECTASYNCRESPONSE 0x1007
261 #define SL_OPCODE_SOCKET_SETSOCKOPT 0x9408
262 #define SL_OPCODE_SOCKET_SETSOCKOPTRESPONSE 0x1408
263 #define SL_OPCODE_SOCKET_GETSOCKOPT 0x9409
264 #define SL_OPCODE_SOCKET_GETSOCKOPTRESPONSE 0x1409
265 #define SL_OPCODE_SOCKET_RECV 0x940A
266 #define SL_OPCODE_SOCKET_RECVASYNCRESPONSE 0x100A
267 #define SL_OPCODE_SOCKET_RECVFROM 0x940B
268 #define SL_OPCODE_SOCKET_RECVFROMASYNCRESPONSE 0x100B
269 #define SL_OPCODE_SOCKET_RECVFROMASYNCRESPONSE_V6 0x120B
270 #define SL_OPCODE_SOCKET_SEND 0x940C
271 #define SL_OPCODE_SOCKET_SENDTO 0x940D
272 #define SL_OPCODE_SOCKET_SENDTO_V6 0x960D
273 #define SL_OPCODE_SOCKET_TXFAILEDASYNCRESPONSE 0x100E
274 #define SL_OPCODE_SOCKET_SOCKETASYNCEVENT 0x100F
275 #define SL_OPCODE_SOCKET_SOCKETCLOSEASYNCEVENT 0x1010
276 #define SL_OPCODE_NETAPP_START_COMMAND 0x9C0A
277 #define SL_OPCODE_NETAPP_START_RESPONSE 0x1C0A
278 #define SL_OPCODE_NETAPP_NETAPPSTARTRESPONSE 0x1C0A
279 #define SL_OPCODE_NETAPP_STOP_COMMAND 0x9C61
280 #define SL_OPCODE_NETAPP_STOP_RESPONSE 0x1C61
281 #define SL_OPCODE_NETAPP_NETAPPSET 0x9C0B
282 #define SL_OPCODE_NETAPP_NETAPPSETRESPONSE 0x1C0B
283 #define SL_OPCODE_NETAPP_NETAPPGET 0x9C27
284 #define SL_OPCODE_NETAPP_NETAPPGETRESPONSE 0x1C27
285 #define SL_OPCODE_NETAPP_DNSGETHOSTBYNAME 0x9C20
286 #define SL_OPCODE_NETAPP_DNSGETHOSTBYNAMERESPONSE 0x1C20
287 #define SL_OPCODE_NETAPP_DNSGETHOSTBYNAMEASYNCRESPONSE 0x1820
288 #define SL_OPCODE_NETAPP_DNSGETHOSTBYNAMEASYNCRESPONSE_V6 0x1A20
289 #define SL_OPCODE_NETAPP_NETAPP_MDNS_LOOKUP_SERVICE 0x9C71
290 #define SL_OPCODE_NETAPP_NETAPP_MDNS_LOOKUP_SERVICE_RESPONSE 0x1C72
291 #define SL_OPCODE_NETAPP_MDNSREGISTERSERVICE 0x9C34
292 #define SL_OPCODE_NETAPP_MDNSREGISTERSERVICERESPONSE 0x1C34
293 #define SL_OPCODE_NETAPP_MDNSGETHOSTBYSERVICE 0x9C35
294 #define SL_OPCODE_NETAPP_MDNSGETHOSTBYSERVICERESPONSE 0x1C35
295 #define SL_OPCODE_NETAPP_MDNSGETHOSTBYSERVICEASYNCRESPONSE 0x1835
296 #define SL_OPCODE_NETAPP_MDNSGETHOSTBYSERVICEASYNCRESPONSE_V6 0x1A35
297 #define SL_OPCODE_NETAPP_DNSGETHOSTBYADDR 0x9C26
298 #define SL_OPCODE_NETAPP_DNSGETHOSTBYADDR_V6 0x9E26
299 #define SL_OPCODE_NETAPP_DNSGETHOSTBYADDRRESPONSE 0x1C26
300 #define SL_OPCODE_NETAPP_DNSGETHOSTBYADDRASYNCRESPONSE 0x1826
301 #define SL_OPCODE_NETAPP_PINGSTART 0x9C21
302 #define SL_OPCODE_NETAPP_PINGSTART_V6 0x9E21
303 #define SL_OPCODE_NETAPP_PINGSTARTRESPONSE 0x1C21
304 #define SL_OPCODE_NETAPP_PINGREPORTREQUEST 0x9C22
305 #define SL_OPCODE_NETAPP_PINGREPORTREQUESTRESPONSE 0x1822
306 #define SL_OPCODE_NETAPP_ARPFLUSH 0x9C24
307 #define SL_OPCODE_NETAPP_ARPFLUSHRESPONSE 0x1C24
308 #define SL_OPCODE_NETAPP_NDFLUSH_V6 0x9EC2
309 #define SL_OPCODE_NETAPP_NDFLUSHHRESPONSE_V6 0x1EC3
310 #define SL_OPCODE_NETAPP_IPACQUIRED 0x1825
311 #define SL_OPCODE_NETAPP_IPV4_LOST 0x1832
312 #define SL_OPCODE_NETAPP_DHCP_IPV4_ACQUIRE_TIMEOUT 0x1833
313 #define SL_OPCODE_LINK_QUALITY_EVENT 0x1834
314 #define SL_OPCODE_NETAPP_IPACQUIRED_V6 0x1A25
315 #define SL_OPCODE_NETAPP_IPV6_LOST_V6 0x1A32
316 #define SL_OPCODE_NETAPP_IPERFSTARTCOMMAND 0x9C28
317 #define SL_OPCODE_NETAPP_IPERFSTARTRESPONSE 0x1C28
318 #define SL_OPCODE_NETAPP_IPERFSTOPCOMMAND 0x9C29
319 #define SL_OPCODE_NETAPP_IPERFSTOPRESPONSE 0x1C29
320 #define SL_OPCODE_NETAPP_CTESTSTARTCOMMAND 0x9C2A
321 #define SL_OPCODE_NETAPP_CTESTSTARTRESPONSE 0x1C2A
322 #define SL_OPCODE_NETAPP_CTESTASYNCRESPONSE 0x182A
323 #define SL_OPCODE_NETAPP_CTESTSTOPCOMMAND 0x9C2B
324 #define SL_OPCODE_NETAPP_CTESTSTOPRESPONSE 0x1C2B
325 #define SL_OPCODE_NETAPP_IP_LEASED 0x182C
326 #define SL_OPCODE_NETAPP_IP_RELEASED 0x182D
327 #define SL_OPCODE_NETAPP_HTTPGETTOKENVALUE 0x182E
328 #define SL_OPCODE_NETAPP_HTTPSENDTOKENVALUE 0x9C2F
329 #define SL_OPCODE_NETAPP_HTTPPOSTTOKENVALUE 0x1830
330 #define SL_OPCODE_NETAPP_IP_COLLISION 0x1831
331 #define SL_OPCODE_NETAPP_NO_IP_COLLISION_DETECTED 0x18C4
332 #define SL_OPCODE_NETAPP_NO_LOCAL_IP_COLLISION_DETECTED_V6 0x1AC5
333 #define SL_OPCODE_NETAPP_NO_GLOBAL_IP_COLLISION_DETECTED_V6 0x1AC6
334 
335 #define SL_OPCODE_NETAPP_REQUEST 0x1878
336 #define SL_OPCODE_NETAPP_RESPONSE 0x9C78
337 #define SL_OPCODE_NETAPP_SEND 0x9C79
338 #define SL_OPCODE_NETAPP_SENDRESPONSE 0x1C79
339 #define SL_OPCODE_NETAPP_RECEIVEREQUEST 0x9C7A
340 #define SL_OPCODE_NETAPP_RECEIVE 0x187B
341 
342 #define SL_OPCODE_NVMEM_FILEOPEN 0xA43C
343 #define SL_OPCODE_NVMEM_FILEOPENRESPONSE 0x243C
344 #define SL_OPCODE_NVMEM_FILECLOSE 0xA43D
345 #define SL_OPCODE_NVMEM_FILECLOSERESPONSE 0x243D
346 #define SL_OPCODE_NVMEM_FILEREADCOMMAND 0xA440
347 #define SL_OPCODE_NVMEM_FILEREADRESPONSE 0x2440
348 #define SL_OPCODE_NVMEM_FILEWRITECOMMAND 0xA441
349 #define SL_OPCODE_NVMEM_FILEWRITERESPONSE 0x2441
350 #define SL_OPCODE_NVMEM_FILEGETINFOCOMMAND 0xA442
351 #define SL_OPCODE_NVMEM_FILEGETINFORESPONSE 0x2442
352 #define SL_OPCODE_NVMEM_FILEDELCOMMAND 0xA443
353 #define SL_OPCODE_NVMEM_FILEDELRESPONSE 0x2443
354 #define SL_OPCODE_NVMEM_NVMEMFORMATCOMMAND 0xA444
355 #define SL_OPCODE_NVMEM_NVMEMFORMATRESPONSE 0x2444
356 #define SL_OPCODE_NVMEM_NVMEMGETFILELISTCOMMAND 0xA448
357 #define SL_OPCODE_NVMEM_NVMEMGETFILELISTRESPONSE 0x2448
358 
359 #define SL_OPCODE_NVMEM_NVMEMFSPROGRAMMINGCOMMAND 0xA44A
360 #define SL_OPCODE_NVMEM_NVMEMFSPROGRAMMINGRESPONSE 0x244A
361 #define SL_OPCODE_NVMEM_NVMEMFILESYSTEMCONTROLCOMMAND 0xA44B
362 #define SL_OPCODE_NVMEM_NVMEMFILESYSTEMCONTROLRESPONSE 0x244B
363 #define SL_OPCODE_NVMEM_NVMEMBUNDLECONTROLCOMMAND 0xA44C
364 #define SL_OPCODE_NVMEM_NVMEMBUNDLECONTROLRESPONSE 0x244C
365 
366 
367 #define SL_OPCODE_DEVICE_SETDEBUGLEVELCOMMAND 0x846A
368 #define SL_OPCODE_DEVICE_SETDEBUGLEVELRESPONSE 0x046A
369 
370 #define SL_OPCODE_DEVICE_NETCFG_SET_COMMAND 0x8432
371 #define SL_OPCODE_DEVICE_NETCFG_SET_RESPONSE 0x0432
372 #define SL_OPCODE_DEVICE_NETCFG_GET_COMMAND 0x8433
373 #define SL_OPCODE_DEVICE_NETCFG_GET_RESPONSE 0x0433
374 /* */
375 #define SL_OPCODE_DEVICE_SETUARTMODECOMMAND 0x846B
376 #define SL_OPCODE_DEVICE_SETUARTMODERESPONSE 0x046B
377 #define SL_OPCODE_DEVICE_SSISIZESETCOMMAND 0x846B
378 #define SL_OPCODE_DEVICE_SSISIZESETRESPONSE 0x046B
379 
380 /* */
381 #define SL_OPCODE_DEVICE_EVENTMASKSET 0x8464
382 #define SL_OPCODE_DEVICE_EVENTMASKSETRESPONSE 0x0464
383 #define SL_OPCODE_DEVICE_EVENTMASKGET 0x8465
384 #define SL_OPCODE_DEVICE_EVENTMASKGETRESPONSE 0x0465
385 
386 #define SL_OPCODE_DEVICE_DEVICEGET 0x8466
387 #define SL_OPCODE_DEVICE_DEVICEGETRESPONSE 0x0466
388 #define SL_OPCODE_DEVICE_DEVICESET 0x84B7
389 #define SL_OPCODE_DEVICE_DEVICESETRESPONSE 0x04B7
390 
391 #define SL_OPCODE_WLAN_SCANRESULTSGETCOMMAND 0x8C8C
392 #define SL_OPCODE_WLAN_SCANRESULTSGETRESPONSE 0x0C8C
393 #define SL_OPCODE_WLAN_EXTSCANRESULTSGETCOMMAND 0x8C8D
394 #define SL_OPCODE_WLAN_EXTSCANRESULTSGETRESPONSE 0x0C8D
395 #define SL_OPCODE_WLAN_SMARTCONFIGOPTGET 0x8C8E
396 #define SL_OPCODE_WLAN_SMARTCONFIGOPTGETRESPONSE 0x0C8E
397 
398 #define SL_OPCODE_WLAN_PROVISIONING_COMMAND 0x8C98
399 #define SL_OPCODE_WLAN_PROVISIONING_RESPONSE 0x0C98
400 #define SL_OPCODE_DEVICE_RESET_REQUEST_ASYNC_EVENT 0x0099
401 #define SL_OPCODE_WLAN_PROVISIONING_STATUS_ASYNC_EVENT 0x089A
402 
403 #define SL_OPCODE_FREE_BSD_RECV_BUFFER 0xCCCB
404 #define SL_OPCODE_FREE_NON_BSD_READ_BUFFER 0xCCCD
405 
406 
407 /* Rx Filters opcodes */
408 #define SL_OPCODE_WLAN_WLANRXFILTERADDCOMMAND 0x8C6C
409 #define SL_OPCODE_WLAN_WLANRXFILTERADDRESPONSE 0x0C6C
410 #define SL_OPCODE_WLAN_WLANRXFILTERGETSTATISTICSINFOCOMMAND 0x8C6E
411 #define SL_OPCODE_WLAN_WLANRXFILTERGETSTATISTICSINFORESPONSE 0x0C6E
412 #define SL_OPCODE_WLAN_WLANRXFILTERGETINFO 0x8C70
413 #define SL_OPCODE_WLAN_WLANRXFILTERGETINFORESPONSE 0x0C70
414 #define SL_OPCODE_WLAN_RX_FILTER_ASYNC_RESPONSE 0x089D
415 
416 /* Utils */
417 #define SL_OPCODE_NETUTIL_SET 0xB4BE
418 #define SL_OPCODE_NETUTIL_SETRESPONSE 0x34BE
419 #define SL_OPCODE_NETUTIL_GET 0xB4C0
420 #define SL_OPCODE_NETUTIL_GETRESPONSE 0x34C0
421 #define SL_OPCODE_NETUTIL_COMMAND 0xB4C1
422 #define SL_OPCODE_NETUTIL_COMMANDRESPONSE 0x34C1
423 #define SL_OPCODE_NETUTIL_COMMANDASYNCRESPONSE 0x30C1
424 
425 /******************************************************************************************/
426 /* Device structs */
427 /******************************************************************************************/
428 typedef _u32 InitStatus_t;
429 
430 typedef struct
431 {
432  _i32 Status;
433  _i32 ChipId;
434  _i32 MoreData;
436 
437 typedef struct
438 {
439  _i16 status;
440  _u16 sender;
442 
443 typedef struct
444 {
445  _u32 SessionNumber;
446  _u16 Caller;
447  _u16 Padding;
449 
450 typedef struct
451 {
452  _u16 Timeout;
453  _u16 Padding;
455 
456 typedef struct
457 {
458  _u32 Group;
459  _u32 Mask;
461 
463 
464 typedef struct
465 {
466  _u32 Group;
468 
469 typedef struct
470 {
471  _u32 Group;
472  _u32 Mask;
474 
475 typedef struct
476 {
477  _u32 Group;
479 
480 typedef struct
481 {
482  _u32 Group;
483  _u32 Status;
485 
486 typedef struct
487 {
488  _u32 ChipId;
489  _u32 FwVersion[4];
490  _u8 PhyVersion[4];
492 
493 typedef struct
494 {
496  _u32 NwpVersion[4];
497  _u16 RomVersion;
498  _u16 Padding;
500 
501 typedef struct
502 {
503  _u16 MinTxPayloadSize;
504  _u8 padding[6];
506 
507 typedef struct
508 {
509  _u32 BaudRate;
510  _u8 FlowControlEnable;
512 
514 
515 /******************************************************/
516 
517 typedef struct
518 {
519  _u8 SsiSizeInBytes;
520  _u8 Padding[3];
522 
523 /*****************************************************************************************/
524 /* WLAN structs */
525 /*****************************************************************************************/
526 #define MAXIMAL_PASSWORD_LENGTH (64)
527 
528 typedef struct
529 {
530  _u8 ProvisioningCmd;
531  _u8 RequestedRoleAfterSuccess;
532  _u16 InactivityTimeoutSec;
533  _u32 Flags;
535 
536 typedef struct{
537  _u8 SecType;
538  _u8 SsidLen;
539  _u8 Bssid[6];
540  _u8 PasswordLen;
542 
543 #define SSID_STRING(pCmd) (_i8 *)((SlWlanConnectCommon_t *)(pCmd) + 1)
544 #define PASSWORD_STRING(pCmd) (SSID_STRING(pCmd) + ((SlWlanConnectCommon_t *)(pCmd))->SsidLen)
545 
546 typedef struct{
547  SlWlanConnectCommon_t Common;
548  _u8 UserLen;
549  _u8 AnonUserLen;
550  _u8 CertIndex;
551  _u32 EapBitmask;
553 
554 #define EAP_SSID_STRING(pCmd) (_i8 *)((SlWlanConnectEapCommand_t *)(pCmd) + 1)
555 #define EAP_PASSWORD_STRING(pCmd) (EAP_SSID_STRING(pCmd) + ((SlWlanConnectEapCommand_t *)(pCmd))->Common.SsidLen)
556 #define EAP_USER_STRING(pCmd) (EAP_PASSWORD_STRING(pCmd) + ((SlWlanConnectEapCommand_t *)(pCmd))->Common.PasswordLen)
557 #define EAP_ANON_USER_STRING(pCmd) (EAP_USER_STRING(pCmd) + ((SlWlanConnectEapCommand_t *)(pCmd))->UserLen)
558 
559 typedef struct
560 {
561  _u8 PolicyType;
562  _u8 Padding;
563  _u8 PolicyOption;
564  _u8 PolicyOptionLen;
566 
567 typedef struct{
568  _u32 MinDwellTime;
569  _u32 MaxDwellTime;
570  _u32 NumProbeResponse;
571  _u32 G_Channels_mask;
572  _i32 RssiThershold;
573  _i32 SnrThershold;
574  _i32 DefaultTXPower;
575  _u16 IntervalList[16];
577 
578 typedef struct{
579  _i16 SecType;
580  _u8 SsidLen;
581  _u8 Priority;
582  _u8 Bssid[6];
583  _u8 PasswordLen;
584  _u8 WepKeyId;
586 
587 typedef struct{
588  SlWlanAddGetProfile_t Common;
589  _u8 UserLen;
590  _u8 AnonUserLen;
591  _u8 CertIndex;
592  _u8 padding;
593  _u32 EapBitmask;
595 
596 
597 typedef struct{
598  _i16 SecType;
599  _u8 SsidLen;
600  _u8 Priority;
601  _u8 Bssid[6];
602  _u8 PasswordLen;
603  _u8 WepKeyId;
604  _u32 Index;
605  _u8 UserLen;
606  _u8 AnonUserLen;
607  _u8 CertIndex;
608  _u8 padding;
609  _u32 EapBitmask;
611 
612 #define PROFILE_SSID_STRING(pCmd) ((_i8 *)((SlWlanAddGetProfile_t *)(pCmd) + 1))
613 #define PROFILE_PASSWORD_STRING(pCmd) (PROFILE_SSID_STRING(pCmd) + ((SlWlanAddGetProfile_t *)(pCmd))->SsidLen)
614 
615 #define EAP_PROFILE_SSID_STRING(pCmd) (_i8 *)((SlWlanAddGetEapProfile_t *)(pCmd) + 1)
616 #define EAP_PROFILE_PASSWORD_STRING(pCmd) (EAP_PROFILE_SSID_STRING(pCmd) + ((SlWlanAddGetEapProfile_t *)(pCmd))->Common.SsidLen)
617 #define EAP_PROFILE_USER_STRING(pCmd) (EAP_PROFILE_PASSWORD_STRING(pCmd) + ((SlWlanAddGetEapProfile_t *)(pCmd))->Common.PasswordLen)
618 #define EAP_PROFILE_ANON_USER_STRING(pCmd) (EAP_PROFILE_USER_STRING(pCmd) + ((SlWlanAddGetEapProfile_t *)(pCmd))->UserLen)
619 
620 #define PROFILE_SSID_STRING(pCmd) ((_i8 *)((SlWlanAddGetProfile_t *)(pCmd) + 1))
621 #define PROFILE_PASSWORD_STRING(pCmd) (PROFILE_SSID_STRING(pCmd) + ((SlWlanAddGetProfile_t *)(pCmd))->SsidLen)
622 
623 #define UPDATE_PROFILE_SSID_STRING(pCmd) (_i8 *)((SlWlanUpdateProfile_t *)(pCmd) + 1)
624 #define UPDATE_PROFILE_PASSWORD_STRING(pCmd) (UPDATE_PROFILE_SSID_STRING(pCmd) + ((SlWlanUpdateProfile_t *)(pCmd))->SsidLen)
625 #define UPDATE_PROFILE_USER_STRING(pCmd) (UPDATE_PROFILE_PASSWORD_STRING(pCmd) + ((SlWlanUpdateProfile_t *)(pCmd))->PasswordLen)
626 #define UPDATE_PROFILE_ANON_USER_STRING(pCmd) (UPDATE_PROFILE_USER_STRING(pCmd) + ((SlWlanUpdateProfile_t *)(pCmd))->UserLen)
627 
628 
629 typedef struct
630 {
631  _u8 Index;
632  _u8 Padding[3];
634 
636 
637 typedef struct
638 {
639  _u8 Index;
640  _u8 Count;
641  _i8 padding[2];
643 
645 
646 typedef struct
647 {
648  _u8 Index;
649  _u8 Count;
650  _i8 padding[2];
652 
653 typedef struct
654 {
655  _u32 GroupIdBitmask;
656  _u8 Cipher;
657  _u8 PublicKeyLen;
658  _u8 Padding[2];
660 
661 #define SMART_CONFIG_START_PUBLIC_KEY_STRING(pCmd) ((_i8 *)((SlWlanSmartConfigParams_t *)(pCmd) + 1))
662 
663 typedef struct
664 {
665  _u8 Mode;
666  _u8 Padding[3];
668 
669 typedef struct
670 {
671  _u16 Status;
672  _u16 ConfigId;
673  _u16 ConfigOpt;
674  _u16 ConfigLen;
676 
677 
678 /* ******************************************************************************/
679 /* RX filters - Start */
680 /* ******************************************************************************/
681 
682 typedef struct
683 {
684  SlWlanRxFilterRuleType_t RuleType;
685  SlWlanRxFilterFlags_u Flags;
686  SlWlanRxFilterID_t FilterId;
687  _u8 Padding;
689  SlWlanRxFilterTrigger_t Trigger;
690  SlWlanRxFilterAction_t Action;
692 
693 typedef struct
694 {
695  SlWlanRxFilterID_t FilterId;
696  _i16 Status;
697  _u8 Padding[1];
699 
700 typedef struct
701 {
702  _i16 Status;
703  _u8 Padding[2];
705 
706 typedef struct
707 {
708  _i16 Status;
709  _u16 OutputBufferLength;
710 
712 
713 
714 /* ******************************************************************************/
715 /* RX filters -- End */
716 /* ******************************************************************************/
717 
718 typedef struct
719 {
720  _u16 Status;
721  _u8 WlanRole; /* 0 = station, 2 = AP */
722  _u8 Ipv6Enabled;
723  _u8 DhcpEnabled;
724 
725  _u32 Global[4];
726  _u32 Local[4];
727  _u32 DnsServer[4];
728  _u8 DhcpState;
730 
731 typedef struct
732 {
733  _u8 Ip[4];
734  _u8 IpMask[4];
735  _u8 IpGateway[4];
736  _u8 IpDnsServer[4];
737  _u8 IpStart[4];
738  _u8 IpEnd[4];
740 
741 typedef struct
742 {
743  _u16 Status;
744  _u8 MacAddr[6];
746 
747 typedef struct
748 {
749  _u16 Status;
750  _u16 ConfigId;
751  _u16 ConfigOpt;
752  _u16 ConfigLen;
754 
755 typedef struct
756 {
757  _u16 Status;
758  _u16 DeviceSetId;
759  _u16 Option;
760  _u16 ConfigLen;
762 
763 
764 /******************************************************************************************/
765 /* Socket structs */
766 /******************************************************************************************/
767 
768 typedef struct
769 {
770  _u8 Domain;
771  _u8 Type;
772  _u8 Protocol;
773  _u8 Padding;
775 
776 typedef struct
777 {
778  _i16 StatusOrLen;
779  _u8 Sd;
780  _u8 Padding;
782 
783 typedef struct
784 {
785  _u8 Sd;
786  _u8 Family;
787  _u8 Padding1;
788  _u8 Padding2;
790 
791 typedef struct
792 {
793  _i16 StatusOrLen;
794  _u8 Sd;
795  _u8 Family;
796  _u16 Port;
797  _u16 PaddingOrAddr;
798  _u32 Address;
800 
801 typedef struct
802 {
803  _i16 StatusOrLen;
804  _u8 Sd;
805  _u8 Family;
806  _u16 Port;
807  _u8 Address[6];
809 
810 typedef struct
811 {
812  _i16 StatusOrLen;
813  _u8 Sd;
814  _u8 Family;
815  _u16 Port;
816  _u16 PaddingOrAddr;
817  _u32 Address[4];
819 
820 typedef struct
821 {
822  _i16 LenOrPadding;
823  _u8 Sd;
824  _u8 FamilyAndFlags;
825  _u16 Port;
826  _u16 PaddingOrAddr;
827  _u32 Address;
829 
830 typedef struct
831 {
832  _i16 LenOrPadding;
833  _u8 Sd;
834  _u8 FamilyAndFlags;
835  _u16 Port;
836  _u8 Address[6];
838 
839 typedef struct
840 {
841  _i16 LenOrPadding;
842  _u8 Sd;
843  _u8 FamilyAndFlags;
844  _u16 Port;
845  _u16 PaddingOrAddr;
846  _u32 Address[4];
848 
849 typedef union {
852 #ifdef SL_SUPPORT_IPV6
854 #endif
856 
857 typedef union {
860 #ifdef SL_SUPPORT_IPV6
862 #endif
864 
865 typedef struct
866 {
867  _u8 Sd;
868  _u8 Backlog;
869  _u8 Padding1;
870  _u8 Padding2;
872 
873 typedef struct
874 {
875  _u8 Sd;
876  _u8 Padding0;
877  _u8 Padding1;
878  _u8 Padding2;
880 
881 typedef struct
882 {
883  _u8 Nfds;
884  _u8 ReadFdsCount;
885  _u8 WriteFdsCount;
886  _u8 Padding;
887  _u16 ReadFds;
888  _u16 WriteFds;
889  _u16 tv_usec;
890  _u16 tv_sec;
892 
893 typedef struct
894 {
895  _u16 Status;
896  _u8 ReadFdsCount;
897  _u8 WriteFdsCount;
898  _u16 ReadFds;
899  _u16 WriteFds;
901 
902 typedef struct
903 {
904  _u8 Sd;
905  _u8 Level;
906  _u8 OptionName;
907  _u8 OptionLen;
909 
910 typedef struct
911 {
912  _u8 Sd;
913  _u8 Level;
914  _u8 OptionName;
915  _u8 OptionLen;
917 
918 typedef struct
919 {
920  _i16 Status;
921  _u8 Sd;
922  _u8 OptionLen;
924 
925 typedef struct
926 {
927  _u16 StatusOrLen;
928  _u8 Sd;
929  _u8 FamilyAndFlags;
931 
932 /*****************************************************************************************
933 * NETAPP structs
934 ******************************************************************************************/
935 
937 
938 typedef struct
939 {
940  _u32 AppId;
942 
943 typedef struct
944 {
945  _u16 Status;
946  _u16 AppId;
947  _u16 ConfigOpt;
948  _u16 ConfigLen;
950 typedef struct
951 {
952  _u16 PortNumber;
954 
955 typedef struct
956 {
957  _u8 AuthEnable;
959 
961 {
962  _u8 TokenNameLen;
963  _u8 Padd1;
964  _u16 Padd2;
966 
968 {
969  _u8 TokenValueLen;
970  _u8 TokenNameLen;
971  _u8 TokenName[SL_NETAPP_MAX_TOKEN_NAME_LEN];
972  _u16 Padd;
974 
976 {
977  _u8 PostActionLen;
978  _u8 TokenNameLen;
979  _u8 TokenValueLen;
980  _u8 padding;
982 
983 /*****************************************************************************************
984 * NETAPP Request/Response/Send/Receive
985 ******************************************************************************************/
987 {
988  _u8 AppId;
989  _u8 RequestType;
990  _u16 Handle;
991  _u16 MetadataLen;
992  _u16 PayloadLen;
993  _u32 Flags;
995 
997 {
998  _u16 Handle;
999  _u16 status;
1000  _u16 MetadataLen;
1001  _u16 PayloadLen;
1002  _u32 Flags;
1004 
1006 {
1007  _u16 Handle;
1008  _u16 DataLen; /* can be data payload or metadata, depends on bit 1 in flags */
1009  _u32 Flags;
1011 
1013 {
1014  _u16 Handle;
1015  _u16 MaxBufferLen;
1016  _u32 Flags;
1018 
1020 {
1021  _u16 Handle;
1022  _u16 PayloadLen;
1023  _u32 Flags;
1025 
1026 typedef struct
1027 {
1028  _u16 Len;
1029  _u8 Family;
1030  _u8 Padding;
1032 
1033 typedef struct
1034 {
1035  _u16 Status;
1036  _u16 Padding;
1037  _u32 Ip0;
1038  _u32 Ip1;
1039  _u32 Ip2;
1040  _u32 Ip3;
1042 
1043 typedef struct
1044 {
1045  _u16 Status;
1046  _u8 Padding1;
1047  _u8 Padding2;
1048  _u32 Ip0;
1050 
1051 typedef enum
1052 {
1053  CTST_BSD_UDP_TX,
1054  CTST_BSD_UDP_RX,
1055  CTST_BSD_TCP_TX,
1056  CTST_BSD_TCP_RX,
1057  CTST_BSD_TCP_SERVER_BI_DIR,
1058  CTST_BSD_TCP_CLIENT_BI_DIR,
1059  CTST_BSD_UDP_BI_DIR,
1060  CTST_BSD_RAW_TX,
1061  CTST_BSD_RAW_RX,
1062  CTST_BSD_RAW_BI_DIR,
1063  CTST_BSD_SECURED_TCP_TX,
1064  CTST_BSD_SECURED_TCP_RX,
1065  CTST_BSD_SECURED_TCP_SERVER_BI_DIR,
1066  CTST_BSD_SECURED_TCP_CLIENT_BI_DIR,
1067  CTST_BSD_UDP_TX_IPV6,
1068  CTST_BSD_UDP_RX_IPV6,
1069  CTST_BSD_TCP_TX_IPV6,
1070  CTST_BSD_TCP_RX_IPV6,
1071  CTST_BSD_TCP_SERVER_BI_DIR_IPV6,
1072  CTST_BSD_TCP_CLIENT_BI_DIR_IPV6,
1073  CTST_BSD_UDP_BI_DIR_IPV6,
1074  CTST_BSD_RAW_TX_IPV6,
1075  CTST_BSD_RAW_RX_IPV6,
1076  CTST_BSD_RAW_BI_DIR_IPV6,
1077  CTST_BSD_SECURED_TCP_TX_IPV6,
1078  CTST_BSD_SECURED_TCP_RX_IPV6,
1079  CTST_BSD_SECURED_TCP_SERVER_BI_DIR_IPV6,
1080  CTST_BSD_SECURED_TCP_CLIENT_BI_DIR_IPV6,
1081  CTST_RAW_TX,
1082  CTST_RAW_RX
1083  }CommTest_e;
1084 
1086 {
1087  _u32 Test;
1088  _u16 DestPort;
1089  _u16 SrcPort;
1090  _u32 DestAddr[4];
1091  _u32 PayloadSize;
1092  _u32 Timeout;
1093  _u32 CsEnabled;
1094  _u32 Secure;
1095  _u32 RawProtocol;
1096  _u8 Reserved1[4];
1098 
1099 typedef struct
1100 {
1101  _u8 Test;
1102  _u8 Socket;
1103  _i16 Status;
1104  _u32 StartTime;
1105  _u32 EndTime;
1106  _u16 TxKbitsSec;
1107  _u16 RxKbitsSec;
1108  _u32 OutOfOrderPackets;
1109  _u32 MissedPackets;
1110  _i16 Token;
1112 
1113 typedef struct
1114 {
1115  _u16 Status;
1116  _u16 RttMin;
1117  _u16 RttMax;
1118  _u16 RttAvg;
1119  _u32 NumSuccsessPings;
1120  _u32 NumSendsPings;
1121  _u32 TestTime;
1123 
1124 typedef struct
1125 {
1126  _u32 Ip;
1127  _u32 Gateway;
1128  _u32 Dns;
1130 
1131 typedef enum
1132 {
1133  ACQUIRED_IPV6_LOCAL = 1,
1134  ACQUIRED_IPV6_GLOBAL
1135 }IpV6AcquiredType_e;
1136 
1137 typedef struct
1138 {
1139  _u32 Type;
1140  _u32 Ip[4];
1141  _u32 Gateway[4];
1142  _u32 Dns[4];
1144 
1145 typedef union
1146 {
1147  SlSocketCommand_t EventMask;
1148  SlSendRecvCommand_t DeviceInit;
1150 
1151 /*****************************************************************************************
1152 * FS structs
1153 ******************************************************************************************/
1154 
1155 typedef struct
1156 {
1157  _u32 FileHandle;
1158  _u32 Offset;
1159  _u16 Len;
1160  _u16 Padding;
1162 
1163 typedef struct
1164 {
1165  _u32 Mode;
1166  _u32 Token;
1168 
1169 typedef struct
1170 {
1171  _u32 FileHandle;
1172  _u32 Token;
1174 
1175 
1176 typedef struct
1177 {
1178  _u32 FileHandle;
1179  _u32 CertificFileNameLength;
1180  _u32 SignatureLen;
1182 
1186 
1187 typedef struct
1188 {
1189  _u16 Status;
1190  _u16 Flags;
1191  _u32 FileLen;
1192  _u32 AllocatedLen;
1193  _u32 Token[4];
1194  _u32 FileStorageSize; /* The total size that the file required on the storage */
1195  _u32 FileWriteCounter; /* number of times in which the file have been written successfully */
1197 
1198 typedef struct
1199 {
1200  _u8 DeviceID;
1201  _u8 Padding[3];
1203 
1205 
1206 typedef struct
1207 {
1208  _u32 Token;
1210 
1212 
1213 typedef struct
1214 {
1215  _u32 FileHandle;
1216  _u32 Offset;
1217  _u16 Len;
1218  _u16 Padding;
1220 
1222 
1223 typedef struct
1224 {
1225  _u32 Token;
1226  _u8 Operation;
1227  _u8 Padding[3];
1228  _u32 FileNameLength;
1229  _u32 BufferLength;
1231 
1232 typedef struct
1233 {
1234  _i32 Status;
1235  _u32 Token;
1236  _u32 Len;
1238 
1239 typedef struct
1240 {
1241  _u16 IncludeFileFilters;
1242  _u8 Operation;
1243  _u8 Padding;
1245 
1246 typedef struct
1247 {
1248  _i32 Status;
1249  _u8 BundleState;
1250  _u8 Padding[3];
1252 
1253 typedef struct
1254 {
1255  _u16 KeyLen;
1256  _u16 ChunkLen;
1257  _u32 Flags;
1259 
1260 typedef struct
1261 {
1262  _i32 Status;
1264 
1265 typedef struct
1266 {
1267  _i32 Index; /* start point is -1 */
1268  _u8 Count;
1269  _u8 MaxEntryLen;
1270  _u8 Flags;
1271  _u8 Padding;
1273 
1274 typedef struct
1275 {
1276  _i32 NumOfEntriesOrError;
1277  _i32 Index; /* -1 , nothing was read */
1278  _u32 OutputBufferLength;
1280 
1281 /* TODO: Set MAx Async Payload length depending on flavor (Tiny, Small, etc.) */
1282 
1283 #define SL_ASYNC_HTTP_SRV_EVENT_LEN 1600 /* size must be aligned to 4 */
1284 
1285 #if defined(slcb_NetAppRequestHdlr) || defined(EXT_LIB_REGISTERED_NETAPP_REQUEST_EVENTS)
1286 #define SL_ASYNC_MAX_PAYLOAD_LEN SL_ASYNC_HTTP_SRV_EVENT_LEN
1287 #else
1288 #define SL_ASYNC_MAX_PAYLOAD_LEN 220 /* size must be aligned to 4 */
1289 #endif
1290 
1291 #define SL_ASYNC_MAX_MSG_LEN (_SL_RESP_HDR_SIZE + SL_ASYNC_MAX_PAYLOAD_LEN)
1292 
1293 #define RECV_ARGS_SIZE (sizeof(SlSocketResponse_t))
1294 #define RECVFROM_IPV4_ARGS_SIZE (sizeof(SlSocketAddrAsyncIPv4Response_t))
1295 #define RECVFROM_IPV6_ARGS_SIZE (sizeof(SlSocketAddrAsyncIPv6Response_t))
1296 
1297 #define SL_IPV4_ADDRESS_SIZE (sizeof(_u32))
1298 #define SL_IPV6_ADDRESS_SIZE (4 * sizeof(_u32))
1299 
1300 
1301 /*****************************************************************************************
1302 * NetUtil structures
1303 ******************************************************************************************/
1304 /* Utils Set Get Header */
1305 typedef struct
1306 {
1307  _u32 ObjId;
1308  _i16 Status;
1309  _u16 Option;
1310  _u16 ValueLen;
1311  _u8 Padding[2];
1313 
1314 
1315 /* NetUtil Command Header */
1316 typedef struct
1317 {
1318  _u16 Cmd;
1319  _u16 AttribLen;
1320  _u16 InputLen;
1321  _u16 OutputLen;
1322 } SlNetUtilCmd_t;
1323 
1324 /* NetUtil Command Response Header */
1325 typedef struct
1326 {
1327  _u32 ObjId;
1328  _i16 Status;
1329  _u16 Cmd;
1330  _u16 OutputLen;
1331  _u8 Padding[2];
1333 
1334 #ifdef __cplusplus
1335 }
1336 #endif /* __cplusplus */
1337 
1338 #endif /* _SL_PROTOCOL_TYPES_H_ */
Definition: protocol.h:975