wlan.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _WLAN_H_
  13. #define _WLAN_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define REG_WLAN_BASE (0x14008000)
  17. typedef volatile struct
  18. {
  19. uint32_t __0[1]; // 0x00000000
  20. uint32_t bank_addr; // 0x00000004
  21. uint32_t offset_addr; // 0x00000008
  22. uint32_t regwdata; // 0x0000000c
  23. uint32_t regrdata; // 0x00000010
  24. uint32_t protocol_version; // 0x00000014
  25. uint32_t type; // 0x00000018
  26. uint32_t subtype; // 0x0000001c
  27. uint32_t desaddr_l; // 0x00000020
  28. uint32_t desaddr_h; // 0x00000024
  29. uint32_t srcaddr_l; // 0x00000028
  30. uint32_t srcaddr_h; // 0x0000002c
  31. uint32_t bssidaddr_l; // 0x00000030
  32. uint32_t bssidaddr_h; // 0x00000034
  33. uint32_t seqcontl; // 0x00000038
  34. uint32_t rssival; // 0x0000003c
  35. uint32_t __64[16]; // 0x00000040
  36. uint32_t apb_config; // 0x00000080
  37. uint32_t datardyinterrupt; // 0x00000084
  38. uint32_t __136[9]; // 0x00000088
  39. uint32_t framectrl; // 0x000000ac
  40. uint32_t duration; // 0x000000b0
  41. uint32_t ht_ctrl; // 0x000000b4
  42. uint32_t tstamp_l; // 0x000000b8
  43. uint32_t tstamp_h; // 0x000000bc
  44. uint32_t bcnintvl; // 0x000000c0
  45. uint32_t capinfo; // 0x000000c4
  46. uint32_t elmtid; // 0x000000c8
  47. uint32_t ssidlen; // 0x000000cc
  48. uint32_t ssidbyte1; // 0x000000d0
  49. uint32_t ssidbyte2; // 0x000000d4
  50. uint32_t ssidbyte3; // 0x000000d8
  51. uint32_t ssidbyte4; // 0x000000dc
  52. uint32_t ssidbyte5; // 0x000000e0
  53. uint32_t ssidbyte6; // 0x000000e4
  54. uint32_t ssidbyte7; // 0x000000e8
  55. uint32_t ssidbyte8; // 0x000000ec
  56. uint32_t out_fcsval; // 0x000000f0
  57. } HWP_WLAN_T;
  58. #define hwp_wlan ((HWP_WLAN_T *)REG_ACCESS_ADDRESS(REG_WLAN_BASE))
  59. // protocol_version
  60. typedef union {
  61. uint32_t v;
  62. struct
  63. {
  64. uint32_t protocol_version : 2; // [1:0], read only
  65. uint32_t __31_2 : 30; // [31:2]
  66. } b;
  67. } REG_WLAN_PROTOCOL_VERSION_T;
  68. // type
  69. typedef union {
  70. uint32_t v;
  71. struct
  72. {
  73. uint32_t type : 2; // [1:0], read only
  74. uint32_t __31_2 : 30; // [31:2]
  75. } b;
  76. } REG_WLAN_TYPE_T;
  77. // subtype
  78. typedef union {
  79. uint32_t v;
  80. struct
  81. {
  82. uint32_t subtype : 4; // [3:0], read only
  83. uint32_t __31_4 : 28; // [31:4]
  84. } b;
  85. } REG_WLAN_SUBTYPE_T;
  86. // desaddr_h
  87. typedef union {
  88. uint32_t v;
  89. struct
  90. {
  91. uint32_t desaddr_h : 16; // [15:0], read only
  92. uint32_t __31_16 : 16; // [31:16]
  93. } b;
  94. } REG_WLAN_DESADDR_H_T;
  95. // srcaddr_h
  96. typedef union {
  97. uint32_t v;
  98. struct
  99. {
  100. uint32_t srcaddr_h : 16; // [15:0], read only
  101. uint32_t __31_16 : 16; // [31:16]
  102. } b;
  103. } REG_WLAN_SRCADDR_H_T;
  104. // bssidaddr_h
  105. typedef union {
  106. uint32_t v;
  107. struct
  108. {
  109. uint32_t bssidaddr_h : 16; // [15:0], read only
  110. uint32_t __31_16 : 16; // [31:16]
  111. } b;
  112. } REG_WLAN_BSSIDADDR_H_T;
  113. // seqcontl
  114. typedef union {
  115. uint32_t v;
  116. struct
  117. {
  118. uint32_t seqcontl : 16; // [15:0], read only
  119. uint32_t __31_16 : 16; // [31:16]
  120. } b;
  121. } REG_WLAN_SEQCONTL_T;
  122. // rssival
  123. typedef union {
  124. uint32_t v;
  125. struct
  126. {
  127. uint32_t rssival : 8; // [7:0], read only
  128. uint32_t __31_8 : 24; // [31:8]
  129. } b;
  130. } REG_WLAN_RSSIVAL_T;
  131. // apb_config
  132. typedef union {
  133. uint32_t v;
  134. struct
  135. {
  136. uint32_t apb_clear : 1; // [0]
  137. uint32_t apb_hold : 1; // [1]
  138. uint32_t __7_2 : 6; // [7:2]
  139. uint32_t subtype : 4; // [11:8]
  140. uint32_t type : 2; // [13:12]
  141. uint32_t __15_14 : 2; // [15:14]
  142. uint32_t phyrxenn : 1; // [16]
  143. uint32_t __31_17 : 15; // [31:17]
  144. } b;
  145. } REG_WLAN_APB_CONFIG_T;
  146. // datardyinterrupt
  147. typedef union {
  148. uint32_t v;
  149. struct
  150. {
  151. uint32_t datardyinterrupt : 1; // [0], read only
  152. uint32_t __31_1 : 31; // [31:1]
  153. } b;
  154. } REG_WLAN_DATARDYINTERRUPT_T;
  155. // framectrl
  156. typedef union {
  157. uint32_t v;
  158. struct
  159. {
  160. uint32_t framectrl : 8; // [7:0], read only
  161. uint32_t __31_8 : 24; // [31:8]
  162. } b;
  163. } REG_WLAN_FRAMECTRL_T;
  164. // duration
  165. typedef union {
  166. uint32_t v;
  167. struct
  168. {
  169. uint32_t duration : 16; // [15:0], read only
  170. uint32_t __31_16 : 16; // [31:16]
  171. } b;
  172. } REG_WLAN_DURATION_T;
  173. // bcnintvl
  174. typedef union {
  175. uint32_t v;
  176. struct
  177. {
  178. uint32_t bcnintvl : 16; // [15:0], read only
  179. uint32_t __31_16 : 16; // [31:16]
  180. } b;
  181. } REG_WLAN_BCNINTVL_T;
  182. // capinfo
  183. typedef union {
  184. uint32_t v;
  185. struct
  186. {
  187. uint32_t capinfo : 16; // [15:0], read only
  188. uint32_t __31_16 : 16; // [31:16]
  189. } b;
  190. } REG_WLAN_CAPINFO_T;
  191. // elmtid
  192. typedef union {
  193. uint32_t v;
  194. struct
  195. {
  196. uint32_t elmtid : 8; // [7:0], read only
  197. uint32_t __31_8 : 24; // [31:8]
  198. } b;
  199. } REG_WLAN_ELMTID_T;
  200. // ssidlen
  201. typedef union {
  202. uint32_t v;
  203. struct
  204. {
  205. uint32_t ssidlen : 8; // [7:0], read only
  206. uint32_t __31_8 : 24; // [31:8]
  207. } b;
  208. } REG_WLAN_SSIDLEN_T;
  209. // protocol_version
  210. #define WLAN_PROTOCOL_VERSION(n) (((n)&0x3) << 0)
  211. // type
  212. #define WLAN_TYPE_TYPE(n) (((n)&0x3) << 0)
  213. // subtype
  214. #define WLAN_SUBTYPE_SUBTYPE(n) (((n)&0xf) << 0)
  215. // desaddr_h
  216. #define WLAN_DESADDR_H(n) (((n)&0xffff) << 0)
  217. // srcaddr_h
  218. #define WLAN_SRCADDR_H(n) (((n)&0xffff) << 0)
  219. // bssidaddr_h
  220. #define WLAN_BSSIDADDR_H(n) (((n)&0xffff) << 0)
  221. // seqcontl
  222. #define WLAN_SEQCONTL(n) (((n)&0xffff) << 0)
  223. // rssival
  224. #define WLAN_RSSIVAL(n) (((n)&0xff) << 0)
  225. // apb_config
  226. #define WLAN_APB_CLEAR (1 << 0)
  227. #define WLAN_APB_HOLD (1 << 1)
  228. #define WLAN_APB_CONFIG_SUBTYPE(n) (((n)&0xf) << 8)
  229. #define WLAN_APB_CONFIG_TYPE(n) (((n)&0x3) << 12)
  230. #define WLAN_PHYRXENN (1 << 16)
  231. // datardyinterrupt
  232. #define WLAN_DATARDYINTERRUPT (1 << 0)
  233. // framectrl
  234. #define WLAN_FRAMECTRL(n) (((n)&0xff) << 0)
  235. // duration
  236. #define WLAN_DURATION(n) (((n)&0xffff) << 0)
  237. // bcnintvl
  238. #define WLAN_BCNINTVL(n) (((n)&0xffff) << 0)
  239. // capinfo
  240. #define WLAN_CAPINFO(n) (((n)&0xffff) << 0)
  241. // elmtid
  242. #define WLAN_ELMTID(n) (((n)&0xff) << 0)
  243. // ssidlen
  244. #define WLAN_SSIDLEN(n) (((n)&0xff) << 0)
  245. #endif // _WLAN_H_