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