protocol.h 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182
  1. /*
  2. * protocol.h - CC31xx/CC32xx Host Driver Implementation
  3. *
  4. * Copyright (C) 2014 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. * FILE NAME: protocol.h
  39. *
  40. * DESCRIPTION: Constant and data structure definitions and function
  41. * prototypes for the SL protocol module, which implements
  42. * processing of SimpleLink Commands.
  43. *
  44. * AUTHOR:
  45. *
  46. \*******************************************************************************/
  47. #ifndef _SL_PROTOCOL_TYPES_H_
  48. #define _SL_PROTOCOL_TYPES_H_
  49. /****************************************************************************
  50. **
  51. ** User I/F pools definitions
  52. **
  53. ****************************************************************************/
  54. /****************************************************************************
  55. **
  56. ** Definitions for SimpleLink Commands
  57. **
  58. ****************************************************************************/
  59. /* pattern for LE 8/16/32 or BE*/
  60. #define H2N_SYNC_PATTERN {0xBBDDEEFF,0x4321,0x34,0x12}
  61. #define H2N_CNYS_PATTERN {0xBBDDEEFF,0x8765,0x78,0x56}
  62. #define H2N_DUMMY_PATTERN (_u32)0xFFFFFFFF
  63. #define N2H_SYNC_PATTERN (_u32)0xABCDDCBA
  64. #define SYNC_PATTERN_LEN (_u32)sizeof(_u32)
  65. #define UART_SET_MODE_MAGIC_CODE (_u32)0xAA55AA55
  66. #define SPI_16BITS_BUG(pattern) (_u32)((_u32)pattern & (_u32)0xFFFF7FFF)
  67. #define SPI_8BITS_BUG(pattern) (_u32)((_u32)pattern & (_u32)0xFFFFFF7F)
  68. typedef struct
  69. {
  70. _u16 Opcode;
  71. _u16 Len;
  72. }_SlGenericHeader_t;
  73. typedef struct
  74. {
  75. _u32 Long;
  76. _u16 Short;
  77. _u8 Byte1;
  78. _u8 Byte2;
  79. }_SlSyncPattern_t;
  80. typedef _SlGenericHeader_t _SlCommandHeader_t;
  81. typedef struct
  82. {
  83. _SlGenericHeader_t GenHeader;
  84. _u8 TxPoolCnt;
  85. _u8 DevStatus;
  86. _u8 SocketTXFailure;
  87. _u8 SocketNonBlocking;
  88. }_SlResponseHeader_t;
  89. #define _SL_RESP_SPEC_HDR_SIZE (sizeof(_SlResponseHeader_t) - sizeof(_SlGenericHeader_t))
  90. #define _SL_RESP_HDR_SIZE sizeof(_SlResponseHeader_t)
  91. #define _SL_CMD_HDR_SIZE sizeof(_SlCommandHeader_t)
  92. #define _SL_RESP_ARGS_START(_pMsg) (((_SlResponseHeader_t *)(_pMsg)) + 1)
  93. /* Used only in NWP! */
  94. typedef struct
  95. {
  96. _SlCommandHeader_t sl_hdr;
  97. _u8 func_args_start;
  98. } T_SCMD;
  99. #define WLAN_CONN_STATUS_BIT 0x01
  100. #define EVENTS_Q_STATUS_BIT 0x02
  101. #define PENDING_RCV_CMD_BIT 0x04
  102. #define FW_BUSY_PACKETS_BIT 0x08
  103. #define INIT_STA_OK 0x11111111
  104. #define INIT_STA_ERR 0x22222222
  105. #define INIT_AP_OK 0x33333333
  106. #define INIT_AP_ERR 0x44444444
  107. #define INIT_P2P_OK 0x55555555
  108. #define INIT_P2P_ERR 0x66666666
  109. /****************************************************************************
  110. ** OPCODES
  111. ****************************************************************************/
  112. #define SL_IPV4_IPV6_OFFSET ( 9 )
  113. #define SL_OPCODE_IPV4 ( 0x0 << SL_IPV4_IPV6_OFFSET )
  114. #define SL_OPCODE_IPV6 ( 0x1 << SL_IPV4_IPV6_OFFSET )
  115. #define SL_SYNC_ASYNC_OFFSET ( 10 )
  116. #define SL_OPCODE_SYNC (0x1 << SL_SYNC_ASYNC_OFFSET )
  117. #define SL_OPCODE_SILO_OFFSET ( 11 )
  118. #define SL_OPCODE_SILO_MASK ( 0xF << SL_OPCODE_SILO_OFFSET )
  119. #define SL_OPCODE_SILO_DEVICE ( 0x0 << SL_OPCODE_SILO_OFFSET )
  120. #define SL_OPCODE_SILO_WLAN ( 0x1 << SL_OPCODE_SILO_OFFSET )
  121. #define SL_OPCODE_SILO_SOCKET ( 0x2 << SL_OPCODE_SILO_OFFSET )
  122. #define SL_OPCODE_SILO_NETAPP ( 0x3 << SL_OPCODE_SILO_OFFSET )
  123. #define SL_OPCODE_SILO_NVMEM ( 0x4 << SL_OPCODE_SILO_OFFSET )
  124. #define SL_OPCODE_SILO_NETCFG ( 0x5 << SL_OPCODE_SILO_OFFSET )
  125. #define SL_FAMILY_SHIFT (0x4)
  126. #define SL_FLAGS_MASK (0xF)
  127. #define SL_OPCODE_DEVICE_INITCOMPLETE 0x0008
  128. #define SL_OPCODE_DEVICE_ABORT 0x000C
  129. #define SL_OPCODE_DEVICE_STOP_COMMAND 0x8473
  130. #define SL_OPCODE_DEVICE_STOP_RESPONSE 0x0473
  131. #define SL_OPCODE_DEVICE_STOP_ASYNC_RESPONSE 0x0073
  132. #define SL_OPCODE_DEVICE_DEVICEASYNCDUMMY 0x0063
  133. #define SL_OPCODE_DEVICE_VERSIONREADCOMMAND 0x8470
  134. #define SL_OPCODE_DEVICE_VERSIONREADRESPONSE 0x0470
  135. #define SL_OPCODE_DEVICE_DEVICEASYNCFATALERROR 0x0078
  136. #define SL_OPCODE_WLAN_WLANCONNECTCOMMAND 0x8C80
  137. #define SL_OPCODE_WLAN_WLANCONNECTRESPONSE 0x0C80
  138. #define SL_OPCODE_WLAN_WLANASYNCCONNECTEDRESPONSE 0x0880
  139. #define SL_OPCODE_WLAN_P2P_DEV_FOUND 0x0830
  140. #define SL_OPCODE_WLAN_CONNECTION_FAILED 0x0831
  141. #define SL_OPCODE_WLAN_P2P_NEG_REQ_RECEIVED 0x0832
  142. #define SL_OPCODE_WLAN_WLANDISCONNECTCOMMAND 0x8C81
  143. #define SL_OPCODE_WLAN_WLANDISCONNECTRESPONSE 0x0C81
  144. #define SL_OPCODE_WLAN_WLANASYNCDISCONNECTEDRESPONSE 0x0881
  145. #define SL_OPCODE_WLAN_WLANCONNECTEAPCOMMAND 0x8C82
  146. #define SL_OPCODE_WLAN_WLANCONNECTEAPCRESPONSE 0x0C82
  147. #define SL_OPCODE_WLAN_PROFILEADDCOMMAND 0x8C83
  148. #define SL_OPCODE_WLAN_PROFILEADDRESPONSE 0x0C83
  149. #define SL_OPCODE_WLAN_PROFILEGETCOMMAND 0x8C84
  150. #define SL_OPCODE_WLAN_PROFILEGETRESPONSE 0x0C84
  151. #define SL_OPCODE_WLAN_PROFILEDELCOMMAND 0x8C85
  152. #define SL_OPCODE_WLAN_PROFILEDELRESPONSE 0x0C85
  153. #define SL_OPCODE_WLAN_POLICYSETCOMMAND 0x8C86
  154. #define SL_OPCODE_WLAN_POLICYSETRESPONSE 0x0C86
  155. #define SL_OPCODE_WLAN_POLICYGETCOMMAND 0x8C87
  156. #define SL_OPCODE_WLAN_POLICYGETRESPONSE 0x0C87
  157. #define SL_OPCODE_WLAN_FILTERADD 0x8C88
  158. #define SL_OPCODE_WLAN_FILTERADDRESPONSE 0x0C88
  159. #define SL_OPCODE_WLAN_FILTERGET 0x8C89
  160. #define SL_OPCODE_WLAN_FILTERGETRESPONSE 0x0C89
  161. #define SL_OPCODE_WLAN_FILTERDELETE 0x8C8A
  162. #define SL_OPCODE_WLAN_FILTERDELETERESPOSNE 0x0C8A
  163. #define SL_OPCODE_WLAN_WLANGETSTATUSCOMMAND 0x8C8F
  164. #define SL_OPCODE_WLAN_WLANGETSTATUSRESPONSE 0x0C8F
  165. #define SL_OPCODE_WLAN_STARTTXCONTINUESCOMMAND 0x8CAA
  166. #define SL_OPCODE_WLAN_STARTTXCONTINUESRESPONSE 0x0CAA
  167. #define SL_OPCODE_WLAN_STOPTXCONTINUESCOMMAND 0x8CAB
  168. #define SL_OPCODE_WLAN_STOPTXCONTINUESRESPONSE 0x0CAB
  169. #define SL_OPCODE_WLAN_STARTRXSTATCOMMAND 0x8CAC
  170. #define SL_OPCODE_WLAN_STARTRXSTATRESPONSE 0x0CAC
  171. #define SL_OPCODE_WLAN_STOPRXSTATCOMMAND 0x8CAD
  172. #define SL_OPCODE_WLAN_STOPRXSTATRESPONSE 0x0CAD
  173. #define SL_OPCODE_WLAN_GETRXSTATCOMMAND 0x8CAF
  174. #define SL_OPCODE_WLAN_GETRXSTATRESPONSE 0x0CAF
  175. #define SL_OPCODE_WLAN_POLICYSETCOMMANDNEW 0x8CB0
  176. #define SL_OPCODE_WLAN_POLICYSETRESPONSENEW 0x0CB0
  177. #define SL_OPCODE_WLAN_POLICYGETCOMMANDNEW 0x8CB1
  178. #define SL_OPCODE_WLAN_POLICYGETRESPONSENEW 0x0CB1
  179. #define SL_OPCODE_WLAN_SMART_CONFIG_START_COMMAND 0x8CB2
  180. #define SL_OPCODE_WLAN_SMART_CONFIG_START_RESPONSE 0x0CB2
  181. #define SL_OPCODE_WLAN_SMART_CONFIG_START_ASYNC_RESPONSE 0x08B2
  182. #define SL_OPCODE_WLAN_SMART_CONFIG_STOP_COMMAND 0x8CB3
  183. #define SL_OPCODE_WLAN_SMART_CONFIG_STOP_RESPONSE 0x0CB3
  184. #define SL_OPCODE_WLAN_SMART_CONFIG_STOP_ASYNC_RESPONSE 0x08B3
  185. #define SL_OPCODE_WLAN_SET_MODE 0x8CB4
  186. #define SL_OPCODE_WLAN_SET_MODE_RESPONSE 0x0CB4
  187. #define SL_OPCODE_WLAN_CFG_SET 0x8CB5
  188. #define SL_OPCODE_WLAN_CFG_SET_RESPONSE 0x0CB5
  189. #define SL_OPCODE_WLAN_CFG_GET 0x8CB6
  190. #define SL_OPCODE_WLAN_CFG_GET_RESPONSE 0x0CB6
  191. #define SL_OPCODE_WLAN_STA_CONNECTED 0x082E
  192. #define SL_OPCODE_WLAN_STA_DISCONNECTED 0x082F
  193. #define SL_OPCODE_WLAN_EAP_PROFILEADDCOMMAND 0x8C67
  194. #define SL_OPCODE_WLAN_EAP_PROFILEADDCOMMAND_RESPONSE 0x0C67
  195. #define SL_OPCODE_SOCKET_SOCKET 0x9401
  196. #define SL_OPCODE_SOCKET_SOCKETRESPONSE 0x1401
  197. #define SL_OPCODE_SOCKET_CLOSE 0x9402
  198. #define SL_OPCODE_SOCKET_CLOSERESPONSE 0x1402
  199. #define SL_OPCODE_SOCKET_ACCEPT 0x9403
  200. #define SL_OPCODE_SOCKET_ACCEPTRESPONSE 0x1403
  201. #define SL_OPCODE_SOCKET_ACCEPTASYNCRESPONSE 0x1003
  202. #define SL_OPCODE_SOCKET_ACCEPTASYNCRESPONSE_V6 0x1203
  203. #define SL_OPCODE_SOCKET_BIND 0x9404
  204. #define SL_OPCODE_SOCKET_BIND_V6 0x9604
  205. #define SL_OPCODE_SOCKET_BINDRESPONSE 0x1404
  206. #define SL_OPCODE_SOCKET_LISTEN 0x9405
  207. #define SL_OPCODE_SOCKET_LISTENRESPONSE 0x1405
  208. #define SL_OPCODE_SOCKET_CONNECT 0x9406
  209. #define SL_OPCODE_SOCKET_CONNECT_V6 0x9606
  210. #define SL_OPCODE_SOCKET_CONNECTRESPONSE 0x1406
  211. #define SL_OPCODE_SOCKET_CONNECTASYNCRESPONSE 0x1006
  212. #define SL_OPCODE_SOCKET_SELECT 0x9407
  213. #define SL_OPCODE_SOCKET_SELECTRESPONSE 0x1407
  214. #define SL_OPCODE_SOCKET_SELECTASYNCRESPONSE 0x1007
  215. #define SL_OPCODE_SOCKET_SETSOCKOPT 0x9408
  216. #define SL_OPCODE_SOCKET_SETSOCKOPTRESPONSE 0x1408
  217. #define SL_OPCODE_SOCKET_GETSOCKOPT 0x9409
  218. #define SL_OPCODE_SOCKET_GETSOCKOPTRESPONSE 0x1409
  219. #define SL_OPCODE_SOCKET_RECV 0x940A
  220. #define SL_OPCODE_SOCKET_RECVASYNCRESPONSE 0x100A
  221. #define SL_OPCODE_SOCKET_RECVFROM 0x940B
  222. #define SL_OPCODE_SOCKET_RECVFROMASYNCRESPONSE 0x100B
  223. #define SL_OPCODE_SOCKET_RECVFROMASYNCRESPONSE_V6 0x120B
  224. #define SL_OPCODE_SOCKET_SEND 0x940C
  225. #define SL_OPCODE_SOCKET_SENDTO 0x940D
  226. #define SL_OPCODE_SOCKET_SENDTO_V6 0x960D
  227. #define SL_OPCODE_SOCKET_TXFAILEDASYNCRESPONSE 0x100E
  228. #define SL_OPCODE_SOCKET_SOCKETASYNCEVENT 0x100F
  229. #define SL_OPCODE_NETAPP_START_COMMAND 0x9C0A
  230. #define SL_OPCODE_NETAPP_START_RESPONSE 0x1C0A
  231. #define SL_OPCODE_NETAPP_NETAPPSTARTRESPONSE 0x1C0A
  232. #define SL_OPCODE_NETAPP_STOP_COMMAND 0x9C61
  233. #define SL_OPCODE_NETAPP_STOP_RESPONSE 0x1C61
  234. #define SL_OPCODE_NETAPP_NETAPPSET 0x9C0B
  235. #define SL_OPCODE_NETAPP_NETAPPSETRESPONSE 0x1C0B
  236. #define SL_OPCODE_NETAPP_NETAPPGET 0x9C27
  237. #define SL_OPCODE_NETAPP_NETAPPGETRESPONSE 0x1C27
  238. #define SL_OPCODE_NETAPP_DNSGETHOSTBYNAME 0x9C20
  239. #define SL_OPCODE_NETAPP_DNSGETHOSTBYNAMERESPONSE 0x1C20
  240. #define SL_OPCODE_NETAPP_DNSGETHOSTBYNAMEASYNCRESPONSE 0x1820
  241. #define SL_OPCODE_NETAPP_DNSGETHOSTBYNAMEASYNCRESPONSE_V6 0x1A20
  242. #define SL_OPCODE_NETAPP_NETAPP_MDNS_LOOKUP_SERVICE 0x9C71
  243. #define SL_OPCODE_NETAPP_NETAPP_MDNS_LOOKUP_SERVICE_RESPONSE 0x1C72
  244. #define SL_OPCODE_NETAPP_MDNSREGISTERSERVICE 0x9C34
  245. #define SL_OPCODE_NETAPP_MDNSREGISTERSERVICERESPONSE 0x1C34
  246. #define SL_OPCODE_NETAPP_MDNSGETHOSTBYSERVICE 0x9C35
  247. #define SL_OPCODE_NETAPP_MDNSGETHOSTBYSERVICERESPONSE 0x1C35
  248. #define SL_OPCODE_NETAPP_MDNSGETHOSTBYSERVICEASYNCRESPONSE 0x1835
  249. #define SL_OPCODE_NETAPP_MDNSGETHOSTBYSERVICEASYNCRESPONSE_V6 0x1A35
  250. #define SL_OPCODE_NETAPP_DNSGETHOSTBYADDR 0x9C26
  251. #define SL_OPCODE_NETAPP_DNSGETHOSTBYADDR_V6 0x9E26
  252. #define SL_OPCODE_NETAPP_DNSGETHOSTBYADDRRESPONSE 0x1C26
  253. #define SL_OPCODE_NETAPP_DNSGETHOSTBYADDRASYNCRESPONSE 0x1826
  254. #define SL_OPCODE_NETAPP_PINGSTART 0x9C21
  255. #define SL_OPCODE_NETAPP_PINGSTART_V6 0x9E21
  256. #define SL_OPCODE_NETAPP_PINGSTARTRESPONSE 0x1C21
  257. #define SL_OPCODE_NETAPP_PINGREPORTREQUEST 0x9C22
  258. #define SL_OPCODE_NETAPP_PINGREPORTREQUESTRESPONSE 0x1822
  259. #define SL_OPCODE_NETAPP_PINGSTOP 0x9C23
  260. #define SL_OPCODE_NETAPP_PINGSTOPRESPONSE 0x1C23
  261. #define SL_OPCODE_NETAPP_ARPFLUSH 0x9C24
  262. #define SL_OPCODE_NETAPP_ARPFLUSHRESPONSE 0x1C24
  263. #define SL_OPCODE_NETAPP_IPACQUIRED 0x1825
  264. #define SL_OPCODE_NETAPP_IPV4_LOST 0x1832
  265. #define SL_OPCODE_NETAPP_DHCP_IPV4_ACQUIRE_TIMEOUT 0x1833
  266. #define SL_OPCODE_NETAPP_IPACQUIRED_V6 0x1A25
  267. #define SL_OPCODE_NETAPP_IPERFSTARTCOMMAND 0x9C28
  268. #define SL_OPCODE_NETAPP_IPERFSTARTRESPONSE 0x1C28
  269. #define SL_OPCODE_NETAPP_IPERFSTOPCOMMAND 0x9C29
  270. #define SL_OPCODE_NETAPP_IPERFSTOPRESPONSE 0x1C29
  271. #define SL_OPCODE_NETAPP_CTESTSTARTCOMMAND 0x9C2A
  272. #define SL_OPCODE_NETAPP_CTESTSTARTRESPONSE 0x1C2A
  273. #define SL_OPCODE_NETAPP_CTESTASYNCRESPONSE 0x182A
  274. #define SL_OPCODE_NETAPP_CTESTSTOPCOMMAND 0x9C2B
  275. #define SL_OPCODE_NETAPP_CTESTSTOPRESPONSE 0x1C2B
  276. #define SL_OPCODE_NETAPP_IP_LEASED 0x182C
  277. #define SL_OPCODE_NETAPP_IP_RELEASED 0x182D
  278. #define SL_OPCODE_NETAPP_HTTPGETTOKENVALUE 0x182E
  279. #define SL_OPCODE_NETAPP_HTTPSENDTOKENVALUE 0x9C2F
  280. #define SL_OPCODE_NETAPP_HTTPPOSTTOKENVALUE 0x1830
  281. #define SL_OPCODE_NVMEM_FILEOPEN 0xA43C
  282. #define SL_OPCODE_NVMEM_FILEOPENRESPONSE 0x243C
  283. #define SL_OPCODE_NVMEM_FILECLOSE 0xA43D
  284. #define SL_OPCODE_NVMEM_FILECLOSERESPONSE 0x243D
  285. #define SL_OPCODE_NVMEM_FILEREADCOMMAND 0xA440
  286. #define SL_OPCODE_NVMEM_FILEREADRESPONSE 0x2440
  287. #define SL_OPCODE_NVMEM_FILEWRITECOMMAND 0xA441
  288. #define SL_OPCODE_NVMEM_FILEWRITERESPONSE 0x2441
  289. #define SL_OPCODE_NVMEM_FILEGETINFOCOMMAND 0xA442
  290. #define SL_OPCODE_NVMEM_FILEGETINFORESPONSE 0x2442
  291. #define SL_OPCODE_NVMEM_FILEDELCOMMAND 0xA443
  292. #define SL_OPCODE_NVMEM_FILEDELRESPONSE 0x2443
  293. #define SL_OPCODE_NVMEM_NVMEMFORMATCOMMAND 0xA444
  294. #define SL_OPCODE_NVMEM_NVMEMFORMATRESPONSE 0x2444
  295. #define SL_OPCODE_DEVICE_SETDEBUGLEVELCOMMAND 0x846A
  296. #define SL_OPCODE_DEVICE_SETDEBUGLEVELRESPONSE 0x046A
  297. #define SL_OPCODE_DEVICE_NETCFG_SET_COMMAND 0x8432
  298. #define SL_OPCODE_DEVICE_NETCFG_SET_RESPONSE 0x0432
  299. #define SL_OPCODE_DEVICE_NETCFG_GET_COMMAND 0x8433
  300. #define SL_OPCODE_DEVICE_NETCFG_GET_RESPONSE 0x0433
  301. /* */
  302. #define SL_OPCODE_DEVICE_SETUARTMODECOMMAND 0x846B
  303. #define SL_OPCODE_DEVICE_SETUARTMODERESPONSE 0x046B
  304. #define SL_OPCODE_DEVICE_SSISIZESETCOMMAND 0x846B
  305. #define SL_OPCODE_DEVICE_SSISIZESETRESPONSE 0x046B
  306. /* */
  307. #define SL_OPCODE_DEVICE_EVENTMASKSET 0x8464
  308. #define SL_OPCODE_DEVICE_EVENTMASKSETRESPONSE 0x0464
  309. #define SL_OPCODE_DEVICE_EVENTMASKGET 0x8465
  310. #define SL_OPCODE_DEVICE_EVENTMASKGETRESPONSE 0x0465
  311. #define SL_OPCODE_DEVICE_DEVICEGET 0x8466
  312. #define SL_OPCODE_DEVICE_DEVICEGETRESPONSE 0x0466
  313. #define SL_OPCODE_DEVICE_DEVICESET 0x84B7
  314. #define SL_OPCODE_DEVICE_DEVICESETRESPONSE 0x04B7
  315. #define SL_OPCODE_WLAN_SCANRESULTSGETCOMMAND 0x8C8C
  316. #define SL_OPCODE_WLAN_SCANRESULTSGETRESPONSE 0x0C8C
  317. #define SL_OPCODE_WLAN_SMARTCONFIGOPTSET 0x8C8D
  318. #define SL_OPCODE_WLAN_SMARTCONFIGOPTSETRESPONSE 0x0C8D
  319. #define SL_OPCODE_WLAN_SMARTCONFIGOPTGET 0x8C8E
  320. #define SL_OPCODE_WLAN_SMARTCONFIGOPTGETRESPONSE 0x0C8E
  321. /* Rx Filters opcodes */
  322. #define SL_OPCODE_WLAN_WLANRXFILTERADDCOMMAND 0x8C6C
  323. #define SL_OPCODE_WLAN_WLANRXFILTERADDRESPONSE 0x0C6C
  324. #define SL_OPCODE_WLAN_WLANRXFILTERSETCOMMAND 0x8C6D
  325. #define SL_OPCODE_WLAN_WLANRXFILTERSETRESPONSE 0x0C6D
  326. #define SL_OPCODE_WLAN_WLANRXFILTERGETSTATISTICSINFOCOMMAND 0x8C6E
  327. #define SL_OPCODE_WLAN_WLANRXFILTERGETSTATISTICSINFORESPONSE 0x0C6E
  328. #define SL_OPCODE_WLAN_WLANRXFILTERGETCOMMAND 0x8C6F
  329. #define SL_OPCODE_WLAN_WLANRXFILTERGETRESPONSE 0x0C6F
  330. #define SL_OPCODE_WLAN_WLANRXFILTERGETINFO 0x8C70
  331. #define SL_OPCODE_WLAN_WLANRXFILTERGETINFORESPONSE 0x0C70
  332. /******************************************************************************************/
  333. /* Device structs */
  334. /******************************************************************************************/
  335. typedef _u32 InitStatus_t;
  336. typedef struct
  337. {
  338. _i32 Status;
  339. }InitComplete_t;
  340. typedef struct
  341. {
  342. _i16 status;
  343. _u16 padding;
  344. }_BasicResponse_t;
  345. typedef struct
  346. {
  347. _u16 Timeout;
  348. _u16 padding;
  349. }_DevStopCommand_t;
  350. typedef struct
  351. {
  352. _u32 group;
  353. _u32 mask;
  354. }_DevMaskEventSetCommand_t;
  355. typedef _BasicResponse_t _DevMaskEventSetResponse_t;
  356. typedef struct
  357. {
  358. _u32 group;
  359. }_DevMaskEventGetCommand_t;
  360. typedef struct
  361. {
  362. _u32 group;
  363. _u32 mask;
  364. }_DevMaskEventGetResponse_t;
  365. typedef struct
  366. {
  367. _u32 group;
  368. }_DevStatusGetCommand_t;
  369. typedef struct
  370. {
  371. _u32 group;
  372. _u32 status;
  373. }_DevStatusGetResponse_t;
  374. typedef struct
  375. {
  376. _u32 ChipId;
  377. _u32 FwVersion[4];
  378. _u8 PhyVersion[4];
  379. }_Device_VersionReadResponsePart_t;
  380. typedef struct
  381. {
  382. _Device_VersionReadResponsePart_t part;
  383. _u32 NwpVersion[4];
  384. _u16 RomVersion;
  385. _u16 Padding;
  386. }_Device_VersionReadResponseFull_t;
  387. typedef struct
  388. {
  389. _u32 BaudRate;
  390. _u8 FlowControlEnable;
  391. }_DevUartSetModeCommand_t;
  392. typedef _BasicResponse_t _DevUartSetModeResponse_t;
  393. /******************************************************/
  394. typedef struct
  395. {
  396. _u8 SsiSizeInBytes;
  397. _u8 Padding[3];
  398. }_StellarisSsiSizeSet_t;
  399. /*****************************************************************************************/
  400. /* WLAN structs */
  401. /*****************************************************************************************/
  402. #define MAXIMAL_PASSWORD_LENGTH (64)
  403. typedef struct{
  404. _u8 SecType;
  405. _u8 SsidLen;
  406. _u8 Bssid[6];
  407. _u8 PasswordLen;
  408. }_WlanConnectCommon_t;
  409. #define SSID_STRING(pCmd) (_i8 *)((_WlanConnectCommon_t *)(pCmd) + 1)
  410. #define PASSWORD_STRING(pCmd) (SSID_STRING(pCmd) + ((_WlanConnectCommon_t *)(pCmd))->SsidLen)
  411. typedef struct{
  412. _WlanConnectCommon_t Common;
  413. _u8 UserLen;
  414. _u8 AnonUserLen;
  415. _u8 CertIndex;
  416. _u32 EapBitmask;
  417. }_WlanConnectEapCommand_t;
  418. #define EAP_SSID_STRING(pCmd) (_i8 *)((_WlanConnectEapCommand_t *)(pCmd) + 1)
  419. #define EAP_PASSWORD_STRING(pCmd) (EAP_SSID_STRING(pCmd) + ((_WlanConnectEapCommand_t *)(pCmd))->Common.SsidLen)
  420. #define EAP_USER_STRING(pCmd) (EAP_PASSWORD_STRING(pCmd) + ((_WlanConnectEapCommand_t *)(pCmd))->Common.PasswordLen)
  421. #define EAP_ANON_USER_STRING(pCmd) (EAP_USER_STRING(pCmd) + ((_WlanConnectEapCommand_t *)(pCmd))->UserLen)
  422. typedef struct
  423. {
  424. _u8 PolicyType;
  425. _u8 Padding;
  426. _u8 PolicyOption;
  427. _u8 PolicyOptionLen;
  428. }_WlanPoliciySetGet_t;
  429. typedef struct{
  430. _u32 minDwellTime;
  431. _u32 maxDwellTime;
  432. _u32 numProbeResponse;
  433. _u32 G_Channels_mask;
  434. _i32 rssiThershold;
  435. _i32 snrThershold;
  436. _i32 defaultTXPower;
  437. _u16 intervalList[16];
  438. }_WlanScanParamSetCommand_t;
  439. typedef struct{
  440. _i8 SecType;
  441. _u8 SsidLen;
  442. _u8 Priority;
  443. _u8 Bssid[6];
  444. _u8 PasswordLen;
  445. _u8 WepKeyId;
  446. }_WlanAddGetProfile_t;
  447. typedef struct{
  448. _WlanAddGetProfile_t Common;
  449. _u8 UserLen;
  450. _u8 AnonUserLen;
  451. _u8 CertIndex;
  452. _u16 padding;
  453. _u32 EapBitmask;
  454. }_WlanAddGetEapProfile_t;
  455. #define PROFILE_SSID_STRING(pCmd) ((_i8 *)((_WlanAddGetProfile_t *)(pCmd) + 1))
  456. #define PROFILE_PASSWORD_STRING(pCmd) (PROFILE_SSID_STRING(pCmd) + ((_WlanAddGetProfile_t *)(pCmd))->SsidLen)
  457. #define EAP_PROFILE_SSID_STRING(pCmd) (_i8 *)((_WlanAddGetEapProfile_t *)(pCmd) + 1)
  458. #define EAP_PROFILE_PASSWORD_STRING(pCmd) (EAP_PROFILE_SSID_STRING(pCmd) + ((_WlanAddGetEapProfile_t *)(pCmd))->Common.SsidLen)
  459. #define EAP_PROFILE_USER_STRING(pCmd) (EAP_PROFILE_PASSWORD_STRING(pCmd) + ((_WlanAddGetEapProfile_t *)(pCmd))->Common.PasswordLen)
  460. #define EAP_PROFILE_ANON_USER_STRING(pCmd) (EAP_PROFILE_USER_STRING(pCmd) + ((_WlanAddGetEapProfile_t *)(pCmd))->UserLen)
  461. typedef struct
  462. {
  463. _u8 index;
  464. _u8 padding[3];
  465. }_WlanProfileDelGetCommand_t;
  466. typedef _BasicResponse_t _WlanGetNetworkListResponse_t;
  467. typedef struct
  468. {
  469. _u8 index;
  470. _u8 count;
  471. _i8 padding[2];
  472. }_WlanGetNetworkListCommand_t;
  473. typedef struct
  474. {
  475. _u32 groupIdBitmask;
  476. _u8 cipher;
  477. _u8 publicKeyLen;
  478. _u8 group1KeyLen;
  479. _u8 group2KeyLen;
  480. }_WlanSmartConfigStartCommand_t;
  481. #define SMART_CONFIG_START_PUBLIC_KEY_STRING(pCmd) ((_i8 *)((_WlanSmartConfigStartCommand_t *)(pCmd) + 1))
  482. #define SMART_CONFIG_START_GROUP1_KEY_STRING(pCmd) ((_i8 *) (SMART_CONFIG_START_PUBLIC_KEY_STRING(pCmd) + ((_WlanSmartConfigStartCommand_t *)(pCmd))->publicKeyLen))
  483. #define SMART_CONFIG_START_GROUP2_KEY_STRING(pCmd) ((_i8 *) (SMART_CONFIG_START_GROUP1_KEY_STRING(pCmd) + ((_WlanSmartConfigStartCommand_t *)(pCmd))->group1KeyLen))
  484. typedef struct
  485. {
  486. _u8 mode;
  487. _u8 padding[3];
  488. }_WlanSetMode_t;
  489. typedef struct
  490. {
  491. _u16 Status;
  492. _u16 ConfigId;
  493. _u16 ConfigOpt;
  494. _u16 ConfigLen;
  495. }_WlanCfgSetGet_t;
  496. /* ******************************************************************************/
  497. /* RX filters - Start */
  498. /* ******************************************************************************/
  499. /* -- 80 bytes */
  500. typedef struct _WlanRxFilterAddCommand_t
  501. {
  502. /* -- 1 byte */
  503. SlrxFilterRuleType_t RuleType;
  504. /* -- 1 byte */
  505. SlrxFilterFlags_t FilterFlags;
  506. /* -- 1 byte */
  507. SlrxFilterID_t FilterId;
  508. /* -- 1 byte */
  509. _u8 Padding;
  510. /* -- 56 byte */
  511. SlrxFilterRule_t Rule;
  512. /* -- 12 byte ( 3 padding ) */
  513. SlrxFilterTrigger_t Trigger;
  514. /* -- 8 byte */
  515. SlrxFilterAction_t Action;
  516. }_WlanRxFilterAddCommand_t;
  517. /* -- 4 bytes */
  518. typedef struct l_WlanRxFilterAddCommandReponse_t
  519. {
  520. /* -- 1 byte */
  521. SlrxFilterID_t FilterId;
  522. /* -- 1 Byte */
  523. _u8 Status;
  524. /* -- 2 byte */
  525. _u8 Padding[2];
  526. }_WlanRxFilterAddCommandReponse_t;
  527. /*
  528. * \struct _WlanRxFilterSetCommand_t
  529. */
  530. typedef struct _WlanRxFilterSetCommand_t
  531. {
  532. _u16 InputBufferLength;
  533. /* 1 byte */
  534. SLrxFilterOperation_t RxFilterOperation;
  535. _u8 Padding[1];
  536. }_WlanRxFilterSetCommand_t;
  537. /**
  538. * \struct _WlanRxFilterSetCommandReponse_t
  539. */
  540. typedef struct _WlanRxFilterSetCommandReponse_t
  541. {
  542. /* 1 byte */
  543. _u8 Status;
  544. /* 3 bytes */
  545. _u8 Padding[3];
  546. }_WlanRxFilterSetCommandReponse_t;
  547. /**
  548. * \struct _WlanRxFilterGetCommand_t
  549. */
  550. typedef struct _WlanRxFilterGetCommand_t
  551. {
  552. _u16 OutputBufferLength;
  553. /* 1 byte */
  554. SLrxFilterOperation_t RxFilterOperation;
  555. _u8 Padding[1];
  556. }_WlanRxFilterGetCommand_t;
  557. /**
  558. * \struct _WlanRxFilterGetCommandReponse_t
  559. */
  560. typedef struct _WlanRxFilterGetCommandReponse_t
  561. {
  562. /* 1 byte */
  563. _u8 Status;
  564. /* 1 bytes */
  565. _u8 Padding;
  566. /* 2 byte */
  567. _u16 OutputBufferLength;
  568. }_WlanRxFilterGetCommandReponse_t;
  569. /* ******************************************************************************/
  570. /* RX filters -- End */
  571. /* ******************************************************************************/
  572. typedef struct
  573. {
  574. _u16 status;
  575. _u8 WlanRole; /* 0 = station, 2 = AP */
  576. _u8 Ipv6Enabled;
  577. _u8 Ipv6DhcpEnabled;
  578. _u32 ipV6Global[4];
  579. _u32 ipV6Local[4];
  580. _u32 ipV6DnsServer[4];
  581. _u8 Ipv6DhcpState;
  582. }_NetappIpV6configRetArgs_t;
  583. typedef struct
  584. {
  585. _u8 ipV4[4];
  586. _u8 ipV4Mask[4];
  587. _u8 ipV4Gateway[4];
  588. _u8 ipV4DnsServer[4];
  589. _u8 ipV4Start[4];
  590. _u8 ipV4End[4];
  591. }_NetCfgIpV4AP_Args_t;
  592. typedef struct
  593. {
  594. _u16 status;
  595. _u8 MacAddr[6];
  596. } _MAC_Address_SetGet_t;
  597. typedef struct
  598. {
  599. _u16 Status;
  600. _u16 ConfigId;
  601. _u16 ConfigOpt;
  602. _u16 ConfigLen;
  603. }_NetCfgSetGet_t;
  604. typedef struct
  605. {
  606. _u16 Status;
  607. _u16 DeviceSetId;
  608. _u16 Option;
  609. _u16 ConfigLen;
  610. }_DeviceSetGet_t;
  611. /******************************************************************************************/
  612. /* Socket structs */
  613. /******************************************************************************************/
  614. typedef struct
  615. {
  616. _u8 Domain;
  617. _u8 Type;
  618. _u8 Protocol;
  619. _u8 Padding;
  620. }_SocketCommand_t;
  621. typedef struct
  622. {
  623. _i16 statusOrLen;
  624. _u8 sd;
  625. _u8 padding;
  626. }_SocketResponse_t;
  627. typedef struct
  628. {
  629. _u8 sd;
  630. _u8 family;
  631. _u8 padding1;
  632. _u8 padding2;
  633. }_AcceptCommand_t;
  634. typedef struct
  635. {
  636. _i16 statusOrLen;
  637. _u8 sd;
  638. _u8 family;
  639. _u16 port;
  640. _u16 paddingOrAddr;
  641. _u32 address;
  642. }_SocketAddrAsyncIPv4Response_t;
  643. typedef struct
  644. {
  645. _i16 statusOrLen;
  646. _u8 sd;
  647. _u8 family;
  648. _u16 port;
  649. _u8 address[6];
  650. }_SocketAddrAsyncIPv6EUI48Response_t;
  651. typedef struct
  652. {
  653. _i16 statusOrLen;
  654. _u8 sd;
  655. _u8 family;
  656. _u16 port;
  657. _u16 paddingOrAddr;
  658. _u32 address[4];
  659. }_SocketAddrAsyncIPv6Response_t;
  660. typedef struct
  661. {
  662. _i16 lenOrPadding;
  663. _u8 sd;
  664. _u8 FamilyAndFlags;
  665. _u16 port;
  666. _u16 paddingOrAddr;
  667. _u32 address;
  668. }_SocketAddrIPv4Command_t;
  669. typedef struct
  670. {
  671. _i16 lenOrPadding;
  672. _u8 sd;
  673. _u8 FamilyAndFlags;
  674. _u16 port;
  675. _u8 address[6];
  676. }_SocketAddrIPv6EUI48Command_t;
  677. typedef struct
  678. {
  679. _i16 lenOrPadding;
  680. _u8 sd;
  681. _u8 FamilyAndFlags;
  682. _u16 port;
  683. _u16 paddingOrAddr;
  684. _u32 address[4];
  685. }_SocketAddrIPv6Command_t;
  686. typedef union {
  687. _SocketAddrIPv4Command_t IpV4;
  688. _SocketAddrIPv6EUI48Command_t IpV6EUI48;
  689. #ifdef SL_SUPPORT_IPV6
  690. _SocketAddrIPv6Command_t IpV6;
  691. #endif
  692. } _SocketAddrCommand_u;
  693. typedef union {
  694. _SocketAddrAsyncIPv4Response_t IpV4;
  695. _SocketAddrAsyncIPv6EUI48Response_t IpV6EUI48;
  696. #ifdef SL_SUPPORT_IPV6
  697. _SocketAddrAsyncIPv6Response_t IpV6;
  698. #endif
  699. } _SocketAddrResponse_u;
  700. typedef struct
  701. {
  702. _u8 sd;
  703. _u8 backlog;
  704. _u8 padding1;
  705. _u8 padding2;
  706. }_ListenCommand_t;
  707. typedef struct
  708. {
  709. _u8 sd;
  710. _u8 padding0;
  711. _u8 padding1;
  712. _u8 padding2;
  713. }_CloseCommand_t;
  714. typedef struct
  715. {
  716. _u8 nfds;
  717. _u8 readFdsCount;
  718. _u8 writeFdsCount;
  719. _u8 padding;
  720. _u16 readFds;
  721. _u16 writeFds;
  722. _u16 tv_usec;
  723. _u16 tv_sec;
  724. }_SelectCommand_t;
  725. typedef struct
  726. {
  727. _u16 status;
  728. _u8 readFdsCount;
  729. _u8 writeFdsCount;
  730. _u16 readFds;
  731. _u16 writeFds;
  732. }_SelectAsyncResponse_t;
  733. typedef struct
  734. {
  735. _u8 sd;
  736. _u8 level;
  737. _u8 optionName;
  738. _u8 optionLen;
  739. }_setSockOptCommand_t;
  740. typedef struct
  741. {
  742. _u8 sd;
  743. _u8 level;
  744. _u8 optionName;
  745. _u8 optionLen;
  746. }_getSockOptCommand_t;
  747. typedef struct
  748. {
  749. _i16 status;
  750. _u8 sd;
  751. _u8 optionLen;
  752. }_getSockOptResponse_t;
  753. typedef struct
  754. {
  755. _u16 StatusOrLen;
  756. _u8 sd;
  757. _u8 FamilyAndFlags;
  758. }_sendRecvCommand_t;
  759. /*****************************************************************************************
  760. * NETAPP structs
  761. ******************************************************************************************/
  762. typedef _BasicResponse_t _NetAppStartStopResponse_t;
  763. typedef struct
  764. {
  765. _u32 appId;
  766. }_NetAppStartStopCommand_t;
  767. typedef struct
  768. {
  769. _u16 Status;
  770. _u16 AppId;
  771. _u16 ConfigOpt;
  772. _u16 ConfigLen;
  773. }_NetAppSetGet_t;
  774. typedef struct
  775. {
  776. _u16 port_number;
  777. } _NetAppHttpServerGetSet_port_num_t;
  778. typedef struct
  779. {
  780. _u8 auth_enable;
  781. }_NetAppHttpServerGetSet_auth_enable_t;
  782. typedef struct _sl_NetAppHttpServerGetToken_t
  783. {
  784. _u8 token_name_len;
  785. _u8 padd1;
  786. _u16 padd2;
  787. }sl_NetAppHttpServerGetToken_t;
  788. typedef struct _sl_NetAppHttpServerSendToken_t
  789. {
  790. _u8 token_value_len;
  791. _u8 token_name_len;
  792. _u8 token_name[MAX_TOKEN_NAME_LEN];
  793. _u16 padd;
  794. }sl_NetAppHttpServerSendToken_t;
  795. typedef struct _sl_NetAppHttpServerPostToken_t
  796. {
  797. _u8 post_action_len;
  798. _u8 token_name_len;
  799. _u8 token_value_len;
  800. _u8 padding;
  801. }sl_NetAppHttpServerPostToken_t;
  802. typedef struct
  803. {
  804. _u16 Len;
  805. _u8 family;
  806. _u8 padding;
  807. }_GetHostByNameCommand_t;
  808. typedef struct
  809. {
  810. _u16 status;
  811. _u16 padding;
  812. _u32 ip0;
  813. _u32 ip1;
  814. _u32 ip2;
  815. _u32 ip3;
  816. }_GetHostByNameIPv6AsyncResponse_t;
  817. typedef struct
  818. {
  819. _u16 status;
  820. _u8 padding1;
  821. _u8 padding2;
  822. _u32 ip0;
  823. }_GetHostByNameIPv4AsyncResponse_t;
  824. typedef enum
  825. {
  826. CTST_BSD_UDP_TX,
  827. CTST_BSD_UDP_RX,
  828. CTST_BSD_TCP_TX,
  829. CTST_BSD_TCP_RX,
  830. CTST_BSD_TCP_SERVER_BI_DIR,
  831. CTST_BSD_TCP_CLIENT_BI_DIR,
  832. CTST_BSD_UDP_BI_DIR,
  833. CTST_BSD_RAW_TX,
  834. CTST_BSD_RAW_RX,
  835. CTST_BSD_RAW_BI_DIR,
  836. CTST_BSD_SECURED_TCP_TX,
  837. CTST_BSD_SECURED_TCP_RX,
  838. CTST_BSD_SECURED_TCP_SERVER_BI_DIR,
  839. CTST_BSD_SECURED_TCP_CLIENT_BI_DIR
  840. }CommTest_e;
  841. typedef struct _sl_protocol_CtestStartCommand_t
  842. {
  843. _u32 Test;
  844. _u16 DestPort;
  845. _u16 SrcPort;
  846. _u32 DestAddr[4];
  847. _u32 PayloadSize;
  848. _u32 timeout;
  849. _u32 csEnabled;
  850. _u32 secure;
  851. _u32 rawProtocol;
  852. _u8 reserved1[4];
  853. }_CtestStartCommand_t;
  854. typedef struct
  855. {
  856. _u8 test;
  857. _u8 socket;
  858. _i16 status;
  859. _u32 startTime;
  860. _u32 endTime;
  861. _u16 txKbitsSec;
  862. _u16 rxKbitsSec;
  863. _u32 outOfOrderPackets;
  864. _u32 missedPackets;
  865. _i16 token;
  866. }_CtestAsyncResponse_t;
  867. typedef struct
  868. {
  869. _u32 pingIntervalTime;
  870. _u16 PingSize;
  871. _u16 pingRequestTimeout;
  872. _u32 totalNumberOfAttempts;
  873. _u32 flags;
  874. _u32 ip0;
  875. _u32 ip1OrPaadding;
  876. _u32 ip2OrPaadding;
  877. _u32 ip3OrPaadding;
  878. }_PingStartCommand_t;
  879. typedef struct
  880. {
  881. _u16 status;
  882. _u16 rttMin;
  883. _u16 rttMax;
  884. _u16 rttAvg;
  885. _u32 numSuccsessPings;
  886. _u32 numSendsPings;
  887. _u32 testTime;
  888. }_PingReportResponse_t;
  889. typedef struct
  890. {
  891. _u32 ip;
  892. _u32 gateway;
  893. _u32 dns;
  894. }_IpV4AcquiredAsync_t;
  895. typedef enum
  896. {
  897. ACQUIRED_IPV6_LOCAL = 1,
  898. ACQUIRED_IPV6_GLOBAL
  899. }IpV6AcquiredType_e;
  900. typedef struct
  901. {
  902. _u32 type;
  903. _u32 ip[4];
  904. _u32 gateway[4];
  905. _u32 dns[4];
  906. }_IpV6AcquiredAsync_t;
  907. typedef union
  908. {
  909. _SocketCommand_t EventMask;
  910. _sendRecvCommand_t DeviceInit;
  911. }_device_commands_t;
  912. /*****************************************************************************************
  913. * FS structs
  914. ******************************************************************************************/
  915. typedef struct
  916. {
  917. _u32 FileHandle;
  918. _u32 Offset;
  919. _u16 Len;
  920. _u16 Padding;
  921. }_FsReadCommand_t;
  922. typedef struct
  923. {
  924. _u32 Mode;
  925. _u32 Token;
  926. }_FsOpenCommand_t;
  927. typedef struct
  928. {
  929. _u32 FileHandle;
  930. _u32 Token;
  931. }_FsOpenResponse_t;
  932. typedef struct
  933. {
  934. _u32 FileHandle;
  935. _u32 CertificFileNameLength;
  936. _u32 SignatureLen;
  937. }_FsCloseCommand_t;
  938. typedef _BasicResponse_t _FsReadResponse_t;
  939. typedef _BasicResponse_t _FsDeleteResponse_t;
  940. typedef _BasicResponse_t _FsCloseResponse_t;
  941. typedef struct
  942. {
  943. _u16 Status;
  944. _u16 flags;
  945. _u32 FileLen;
  946. _u32 AllocatedLen;
  947. _u32 Token[4];
  948. }_FsGetInfoResponse_t;
  949. typedef struct
  950. {
  951. _u8 DeviceID;
  952. _u8 Padding[3];
  953. }_FsFormatCommand_t;
  954. typedef _BasicResponse_t _FsFormatResponse_t;
  955. typedef struct
  956. {
  957. _u32 Token;
  958. }_FsDeleteCommand_t;
  959. typedef _FsDeleteCommand_t _FsGetInfoCommand_t;
  960. typedef struct
  961. {
  962. _u32 FileHandle;
  963. _u32 Offset;
  964. _u16 Len;
  965. _u16 Padding;
  966. }_FsWriteCommand_t;
  967. typedef _BasicResponse_t _FsWriteResponse_t;
  968. /* TODO: Set MAx Async Payload length depending on flavor (Tiny, Small, etc.) */
  969. #ifdef SL_TINY_EXT
  970. #define SL_ASYNC_MAX_PAYLOAD_LEN 120 /* size must be aligned to 4 */
  971. #else
  972. #define SL_ASYNC_MAX_PAYLOAD_LEN 160 /* size must be aligned to 4 */
  973. #endif
  974. #define SL_ASYNC_MAX_MSG_LEN (_SL_RESP_HDR_SIZE + SL_ASYNC_MAX_PAYLOAD_LEN)
  975. #define RECV_ARGS_SIZE (sizeof(_SocketResponse_t))
  976. #define RECVFROM_IPV4_ARGS_SIZE (sizeof(_SocketAddrAsyncIPv4Response_t))
  977. #define RECVFROM_IPV6_ARGS_SIZE (sizeof(_SocketAddrAsyncIPv6Response_t))
  978. #define SL_IPV4_ADDRESS_SIZE (sizeof(_u32))
  979. #define SL_IPV6_ADDRESS_SIZE (4 * sizeof(_u32))
  980. #endif /* _SL_PROTOCOL_TYPES_H_ */