wlan_defs.h 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622
  1. /*
  2. * Copyright (c) 2013-2016, 2018-2021 The Linux Foundation. All rights reserved.*
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. #ifndef __WLAN_DEFS_H__
  27. #define __WLAN_DEFS_H__
  28. #include <a_osapi.h> /* A_COMPILE_TIME_ASSERT */
  29. /*
  30. * This file contains WLAN definitions that may be used across both
  31. * Host and Target software.
  32. */
  33. /*
  34. * MAX_SPATIAL_STREAM should be defined in a fwconfig_xxx.h file,
  35. * but for now provide a default value here in case it's not defined
  36. * in the fwconfig_xxx.h file.
  37. */
  38. #ifndef MAX_SPATIAL_STREAM
  39. #define MAX_SPATIAL_STREAM 3
  40. #endif
  41. /*
  42. * NOTE: The CONFIG_160MHZ_SUPPORT is not used consistently - some code
  43. * uses "#ifdef CONFIG_160MHZ_SUPPORT" while other code uses
  44. * "#if CONFIG_160MHZ_SUPPORT".
  45. * This use is being standardized in the recent versions of code to use
  46. * #ifdef, but is being left as is in the legacy code branches.
  47. * To minimize impact to legacy code branches, this file internally
  48. * converts CONFIG_160MHZ_SUPPORT=0 to having CONFIG_160MHZ_SUPPORT
  49. * undefined.
  50. * For builds that explicitly set CONFIG_160MHZ_SUPPORT=0, the bottom of
  51. * this file restores CONFIG_160MHZ_SUPPORT from being undefined to being 0.
  52. */
  53. // OLD:
  54. //#ifndef CONFIG_160MHZ_SUPPORT
  55. //#define CONFIG_160MHZ_SUPPORT 0 /* default: 160 MHz channels not supported */
  56. //#endif
  57. // NEW:
  58. #ifdef CONFIG_160MHZ_SUPPORT
  59. /* CONFIG_160MHZ_SUPPORT is explicitly enabled or explicitly disabled */
  60. #if !CONFIG_160MHZ_SUPPORT
  61. /* CONFIG_160MHZ_SUPPORT is explicitly disabled */
  62. /* Change from CONFIG_160MHZ_SUPPORT=0 to CONFIG_160MHZ_SUPPORT=<undef> */
  63. #undef CONFIG_160MHZ_SUPPORT
  64. /*
  65. * Set a flag to indicate this CONFIG_160MHZ_SUPPORT = 0 --> undef
  66. * change has been done, so we can undo the change at the bottom
  67. * of the file.
  68. */
  69. #define CONFIG_160MHZ_SUPPORT_UNDEF_WAR
  70. #endif
  71. #else
  72. /*
  73. * For backwards compatibility, if CONFIG_160MHZ_SUPPORT is not defined,
  74. * default it to 0, if this is either a host build or a Rome target build.
  75. * This maintains the prior behavior for the host and Rome target builds.
  76. */
  77. #if defined(AR6320) || !defined(ATH_TARGET)
  78. /*
  79. * Set a flag to indicate that at the end of the file,
  80. * CONFIG_160MHZ_SUPPORT should be set to 0.
  81. */
  82. #define CONFIG_160MHZ_SUPPORT_UNDEF_WAR
  83. #endif
  84. #endif
  85. #ifndef SUPPORT_11AX
  86. #define SUPPORT_11AX 0 /* 11ax not supported by default */
  87. #endif
  88. /*
  89. * MAX_SPATIAL_STREAM_ANY -
  90. * what is the largest number of spatial streams that any target supports
  91. */
  92. #define MAX_SPATIAL_STREAM_ANY_V2 4 /* pre-hawkeye */
  93. #define MAX_SPATIAL_STREAM_ANY_V3 8 /* includes hawkeye */
  94. /*
  95. * (temporarily) leave the old MAX_SPATIAL_STREAM_ANY name in place as an alias,
  96. * and in case some old code is using it
  97. */
  98. #define MAX_SPATIAL_STREAM_ANY MAX_SPATIAL_STREAM_ANY_V2 /* DEPRECATED */
  99. /* defines to set Packet extension values whic can be 0 us, 8 usec or 16 usec */
  100. /* NOTE: Below values cannot be changed without breaking WMI Compatibility */
  101. #define MAX_HE_NSS 8
  102. #define MAX_HE_MODULATION 8
  103. #define MAX_HE_RU 4
  104. #define HE_MODULATION_NONE 7
  105. #define HE_PET_0_USEC 0
  106. #define HE_PET_8_USEC 1
  107. #define HE_PET_16_USEC 2
  108. #define DEFAULT_OFDMA_RU26_COUNT 0
  109. typedef enum {
  110. MODE_11A = 0, /* 11a Mode */
  111. MODE_11G = 1, /* 11b/g Mode */
  112. MODE_11B = 2, /* 11b Mode */
  113. MODE_11GONLY = 3, /* 11g only Mode */
  114. MODE_11NA_HT20 = 4, /* 11a HT20 mode */
  115. MODE_11NG_HT20 = 5, /* 11g HT20 mode */
  116. MODE_11NA_HT40 = 6, /* 11a HT40 mode */
  117. MODE_11NG_HT40 = 7, /* 11g HT40 mode */
  118. MODE_11AC_VHT20 = 8,
  119. MODE_11AC_VHT40 = 9,
  120. MODE_11AC_VHT80 = 10,
  121. MODE_11AC_VHT20_2G = 11,
  122. MODE_11AC_VHT40_2G = 12,
  123. MODE_11AC_VHT80_2G = 13,
  124. #ifdef CONFIG_160MHZ_SUPPORT
  125. MODE_11AC_VHT80_80 = 14,
  126. MODE_11AC_VHT160 = 15,
  127. #endif
  128. #if SUPPORT_11AX
  129. MODE_11AX_HE20 = 16,
  130. MODE_11AX_HE40 = 17,
  131. MODE_11AX_HE80 = 18,
  132. MODE_11AX_HE80_80 = 19,
  133. MODE_11AX_HE160 = 20,
  134. MODE_11AX_HE20_2G = 21,
  135. MODE_11AX_HE40_2G = 22,
  136. MODE_11AX_HE80_2G = 23,
  137. #endif
  138. #if defined(SUPPORT_11BE) && SUPPORT_11BE
  139. MODE_11BE_EHT20 = 24,
  140. MODE_11BE_EHT40 = 25,
  141. MODE_11BE_EHT80 = 26,
  142. MODE_11BE_EHT80_80 = 27,
  143. MODE_11BE_EHT160 = 28,
  144. MODE_11BE_EHT160_160 = 29,
  145. MODE_11BE_EHT320 = 30,
  146. MODE_11BE_EHT20_2G = 31, /* For WIN */
  147. MODE_11BE_EHT40_2G = 32, /* For WIN */
  148. #endif
  149. /*
  150. * MODE_UNKNOWN should not be used within the host / target interface.
  151. * Thus, it is permissible for MODE_UNKNOWN to be conditionally-defined,
  152. * taking different values when compiling for different targets.
  153. */
  154. MODE_UNKNOWN,
  155. MODE_UNKNOWN_NO_160MHZ_SUPPORT = 14, /* not needed? */
  156. MODE_UNKNOWN_160MHZ_SUPPORT = MODE_UNKNOWN, /* not needed? */
  157. #ifdef ATHR_WIN_NWF
  158. PHY_MODE_MAX = MODE_UNKNOWN,
  159. PHY_MODE_MAX_NO_160_MHZ_SUPPORT = MODE_UNKNOWN_NO_160MHZ_SUPPORT,
  160. PHY_MODE_MAX_160_MHZ_SUPPORT = MODE_UNKNOWN_160MHZ_SUPPORT,
  161. #else
  162. MODE_MAX = MODE_UNKNOWN,
  163. MODE_MAX_NO_160_MHZ_SUPPORT = MODE_UNKNOWN_NO_160MHZ_SUPPORT,
  164. MODE_MAX_160_MHZ_SUPPORT = MODE_UNKNOWN_160MHZ_SUPPORT,
  165. #endif
  166. } WLAN_PHY_MODE;
  167. #if (!defined(CONFIG_160MHZ_SUPPORT)) && (!defined(SUPPORT_11AX))
  168. A_COMPILE_TIME_ASSERT(
  169. mode_unknown_value_consistency_Check,
  170. MODE_UNKNOWN == MODE_UNKNOWN_NO_160MHZ_SUPPORT);
  171. #else
  172. /*
  173. * If SUPPORT_11AX is defined but CONFIG_160MHZ_SUPPORT is not defined,
  174. * there will be a gap in the mode values, with 14 and 15 being unused.
  175. * But MODE_UNKNOWN_NO_160MHZ_SUPPORT will have an invalid value, since
  176. * mode values 16 through 23 will be used for 11AX modes.
  177. * Thus, MODE_UNKNOWN would still be MODE_UNKNOWN_160MHZ_SUPPORT, for
  178. * cases where 160 MHz is not supported by 11AX is supported.
  179. * (Ideally, MODE_UNKNOWN_160MHZ_SUPPORT and NO_160MHZ_SUPPORT should be
  180. * renamed to cover the 4 permutations of support or no support for
  181. * 11AX and 160 MHZ, but that is impractical, due to backwards
  182. * compatibility concerns.)
  183. */
  184. A_COMPILE_TIME_ASSERT(
  185. mode_unknown_value_consistency_Check,
  186. MODE_UNKNOWN == MODE_UNKNOWN_160MHZ_SUPPORT);
  187. #endif
  188. typedef enum {
  189. VHT_MODE_NONE = 0, /* NON VHT Mode, e.g., HT, DSSS, CCK */
  190. VHT_MODE_20M = 1,
  191. VHT_MODE_40M = 2,
  192. VHT_MODE_80M = 3,
  193. VHT_MODE_160M = 4
  194. } VHT_OPER_MODE;
  195. typedef enum {
  196. WLAN_11A_CAPABILITY = 1,
  197. WLAN_11G_CAPABILITY = 2,
  198. WLAN_11AG_CAPABILITY = 3,
  199. } WLAN_CAPABILITY;
  200. #ifdef CONFIG_160MHZ_SUPPORT
  201. #define IS_MODE_VHT(mode) (((mode) == MODE_11AC_VHT20) || \
  202. ((mode) == MODE_11AC_VHT40) || \
  203. ((mode) == MODE_11AC_VHT80) || \
  204. ((mode) == MODE_11AC_VHT80_80) || \
  205. ((mode) == MODE_11AC_VHT160))
  206. #else
  207. #define IS_MODE_VHT(mode) (((mode) == MODE_11AC_VHT20) || \
  208. ((mode) == MODE_11AC_VHT40) || \
  209. ((mode) == MODE_11AC_VHT80))
  210. #endif
  211. #if SUPPORT_11AX
  212. #define IS_MODE_HE(mode) (((mode) == MODE_11AX_HE20) || \
  213. ((mode) == MODE_11AX_HE40) || \
  214. ((mode) == MODE_11AX_HE80) || \
  215. ((mode) == MODE_11AX_HE80_80) || \
  216. ((mode) == MODE_11AX_HE160) || \
  217. ((mode) == MODE_11AX_HE20_2G) || \
  218. ((mode) == MODE_11AX_HE40_2G) || \
  219. ((mode) == MODE_11AX_HE80_2G))
  220. #define IS_MODE_HE_5G_6G(mode) (((mode) == MODE_11AX_HE20) || \
  221. ((mode) == MODE_11AX_HE40) || \
  222. ((mode) == MODE_11AX_HE80) || \
  223. ((mode) == MODE_11AX_HE80_80) || \
  224. ((mode) == MODE_11AX_HE160))
  225. #define IS_MODE_HE_2G(mode) (((mode) == MODE_11AX_HE20_2G) || \
  226. ((mode) == MODE_11AX_HE40_2G) || \
  227. ((mode) == MODE_11AX_HE80_2G))
  228. #endif /* SUPPORT_11AX */
  229. #if defined(SUPPORT_11BE) && SUPPORT_11BE
  230. #define IS_MODE_EHT(mode) (((mode) == MODE_11BE_EHT20) || \
  231. ((mode) == MODE_11BE_EHT40) || \
  232. ((mode) == MODE_11BE_EHT80) || \
  233. ((mode) == MODE_11BE_EHT80_80) || \
  234. ((mode) == MODE_11BE_EHT160) || \
  235. ((mode) == MODE_11BE_EHT160_160)|| \
  236. ((mode) == MODE_11BE_EHT320) || \
  237. ((mode) == MODE_11BE_EHT20_2G) || \
  238. ((mode) == MODE_11BE_EHT40_2G))
  239. #define IS_MODE_EHT_2G(mode) (((mode) == MODE_11BE_EHT20_2G) || \
  240. ((mode) == MODE_11BE_EHT40_2G))
  241. #endif /* SUPPORT_11BE */
  242. #define IS_MODE_VHT_2G(mode) (((mode) == MODE_11AC_VHT20_2G) || \
  243. ((mode) == MODE_11AC_VHT40_2G) || \
  244. ((mode) == MODE_11AC_VHT80_2G))
  245. #define IS_MODE_11A(mode) (((mode) == MODE_11A) || \
  246. ((mode) == MODE_11NA_HT20) || \
  247. ((mode) == MODE_11NA_HT40) || \
  248. (IS_MODE_VHT(mode)))
  249. #define IS_MODE_11B(mode) ((mode) == MODE_11B)
  250. #define IS_MODE_11G(mode) (((mode) == MODE_11G) || \
  251. ((mode) == MODE_11GONLY) || \
  252. ((mode) == MODE_11NG_HT20) || \
  253. ((mode) == MODE_11NG_HT40) || \
  254. (IS_MODE_VHT_2G(mode)))
  255. #define IS_MODE_11GN(mode) (((mode) == MODE_11NG_HT20) || \
  256. ((mode) == MODE_11NG_HT40))
  257. #define IS_MODE_11GONLY(mode) ((mode) == MODE_11GONLY)
  258. #define IS_MODE_LEGACY(phymode) ((phymode == MODE_11A) || \
  259. (phymode == MODE_11G) || \
  260. (phymode == MODE_11B) || \
  261. (phymode == MODE_11GONLY))
  262. #define IS_MODE_11N(phymode) ((phymode >= MODE_11NA_HT20) && \
  263. (phymode <= MODE_11NG_HT40))
  264. #ifdef CONFIG_160MHZ_SUPPORT
  265. #define IS_MODE_11AC(phymode) ((phymode >= MODE_11AC_VHT20) && \
  266. (phymode <= MODE_11AC_VHT160))
  267. #define IS_MODE_11AC_5G(phymode) ((phymode == MODE_11AC_VHT20) || \
  268. (phymode == MODE_11AC_VHT40) || \
  269. (phymode == MODE_11AC_VHT80) || \
  270. (phymode == MODE_11AC_VHT80_80) || \
  271. (phymode == MODE_11AC_VHT160))
  272. #else
  273. #define IS_MODE_11AC(phymode) ((phymode >= MODE_11AC_VHT20) && \
  274. (phymode <= MODE_11AC_VHT80_2G))
  275. #define IS_MODE_11AC_5G(phymode) ((phymode == MODE_11AC_VHT20) || \
  276. (phymode == MODE_11AC_VHT40) || \
  277. (phymode == MODE_11AC_VHT80))
  278. #endif /* CONFIG_160MHZ_SUPPORT */
  279. #if SUPPORT_11AX
  280. #define IS_MODE_80MHZ(phymode) ((phymode == MODE_11AC_VHT80_2G) || \
  281. (phymode == MODE_11AC_VHT80) || \
  282. (phymode == MODE_11AX_HE80) || \
  283. (phymode == MODE_11AX_HE80_2G))
  284. #define IS_MODE_40MHZ(phymode) ((phymode == MODE_11AC_VHT40_2G) || \
  285. (phymode == MODE_11AC_VHT40) || \
  286. (phymode == MODE_11NG_HT40) || \
  287. (phymode == MODE_11NA_HT40) || \
  288. (phymode == MODE_11AX_HE40) || \
  289. (phymode == MODE_11AX_HE40_2G))
  290. #else
  291. #define IS_MODE_80MHZ(phymode) ((phymode == MODE_11AC_VHT80_2G) || \
  292. (phymode == MODE_11AC_VHT80))
  293. #define IS_MODE_40MHZ(phymode) ((phymode == MODE_11AC_VHT40_2G) || \
  294. (phymode == MODE_11AC_VHT40) || \
  295. (phymode == MODE_11NG_HT40) || \
  296. (phymode == MODE_11NA_HT40))
  297. #endif /* SUPPORT_11AX */
  298. enum {
  299. REGDMN_MODE_11A_BIT = 0, /* 11a channels */
  300. REGDMN_MODE_TURBO_BIT = 1, /* 11a turbo-only channels */
  301. REGDMN_MODE_11B_BIT = 2, /* 11b channels */
  302. REGDMN_MODE_PUREG_BIT = 3, /* 11g channels (OFDM only) */
  303. REGDMN_MODE_11G_BIT = 3, /* XXX historical */
  304. /* bit 4 is reserved */
  305. REGDMN_MODE_108G_BIT = 5, /* 11g+Turbo channels */
  306. REGDMN_MODE_108A_BIT = 6, /* 11a+Turbo channels */
  307. /* bit 7 is reserved */
  308. REGDMN_MODE_XR_BIT = 8, /* XR channels */
  309. REGDMN_MODE_11A_HALF_RATE_BIT = 9, /* 11A half rate channels */
  310. REGDMN_MODE_11A_QUARTER_RATE_BIT = 10, /* 11A quarter rate channels */
  311. REGDMN_MODE_11NG_HT20_BIT = 11, /* 11N-G HT20 channels */
  312. REGDMN_MODE_11NA_HT20_BIT = 12, /* 11N-A HT20 channels */
  313. REGDMN_MODE_11NG_HT40PLUS_BIT = 13, /* 11N-G HT40 + channels */
  314. REGDMN_MODE_11NG_HT40MINUS_BIT = 14, /* 11N-G HT40 - channels */
  315. REGDMN_MODE_11NA_HT40PLUS_BIT = 15, /* 11N-A HT40 + channels */
  316. REGDMN_MODE_11NA_HT40MINUS_BIT = 16, /* 11N-A HT40 - channels */
  317. REGDMN_MODE_11AC_VHT20_BIT = 17, /* 5Ghz, VHT20 */
  318. REGDMN_MODE_11AC_VHT40PLUS_BIT = 18, /* 5Ghz, VHT40 + channels */
  319. REGDMN_MODE_11AC_VHT40MINUS_BIT = 19, /* 5Ghz VHT40 - channels */
  320. REGDMN_MODE_11AC_VHT80_BIT = 20, /* 5Ghz, VHT80 channels */
  321. REGDMN_MODE_11AC_VHT20_2G_BIT = 21, /* 2Ghz, VHT20 */
  322. REGDMN_MODE_11AC_VHT40_2G_BIT = 22, /* 2Ghz, VHT40 */
  323. REGDMN_MODE_11AC_VHT80_2G_BIT = 23, /* 2Ghz, VHT80 */
  324. REGDMN_MODE_11AC_VHT160_BIT = 24, /* 5Ghz, VHT160 */
  325. REGDMN_MODE_11AC_VHT40_2GPLUS_BIT = 25, /* 2Ghz, VHT40+ */
  326. REGDMN_MODE_11AC_VHT40_2GMINUS_BIT = 26, /* 2Ghz, VHT40- */
  327. REGDMN_MODE_11AC_VHT80_80_BIT = 27, /* 5GHz, VHT80+80 */
  328. /* bits 28 to 31 are reserved */
  329. REGDMN_MODE_11AXG_HE20_BIT = 32, /* 2Ghz, HE20 */
  330. REGDMN_MODE_11AXA_HE20_BIT = 33, /* 5Ghz, HE20 */
  331. REGDMN_MODE_11AXG_HE40PLUS_BIT = 34, /* 2Ghz, HE40+ */
  332. REGDMN_MODE_11AXG_HE40MINUS_BIT = 35, /* 2Ghz, HE40- */
  333. REGDMN_MODE_11AXA_HE40PLUS_BIT = 36, /* 5Ghz, HE40+ */
  334. REGDMN_MODE_11AXA_HE40MINUS_BIT = 37, /* 5Ghz, HE40- */
  335. REGDMN_MODE_11AXA_HE80_BIT = 38, /* 5Ghz, HE80 */
  336. REGDMN_MODE_11AXA_HE160_BIT = 39, /* 5Ghz, HE160 */
  337. REGDMN_MODE_11AXA_HE80_80_BIT = 40, /* 5Ghz, HE80+80 */
  338. REGDMN_MODE_11BEG_EHT20_BIT = 41, /* 2Ghz, EHT20 */
  339. REGDMN_MODE_11BEA_EHT20_BIT = 42, /* 5Ghz, EHT20 */
  340. REGDMN_MODE_11BEG_EHT40PLUS_BIT = 43, /* 2Ghz, EHT40+ */
  341. REGDMN_MODE_11BEG_EHT40MINUS_BIT = 44, /* 2Ghz, EHT40- */
  342. REGDMN_MODE_11BEA_EHT40PLUS_BIT = 45, /* 5Ghz, EHT40+ */
  343. REGDMN_MODE_11BEA_EHT40MINUS_BIT = 46, /* 5Ghz, EHT40- */
  344. REGDMN_MODE_11BEA_EHT80_BIT = 47, /* 5Ghz, EHT80 */
  345. REGDMN_MODE_11BEA_EHT160_BIT = 48, /* 5Ghz, EHT160 */
  346. REGDMN_MODE_11BEA_EHT320_BIT = 49, /* 5Ghz, EHT320 */
  347. };
  348. enum {
  349. REGDMN_MODE_11A = 1 << REGDMN_MODE_11A_BIT, /* 11a channels */
  350. REGDMN_MODE_TURBO = 1 << REGDMN_MODE_TURBO_BIT, /* 11a turbo-only channels */
  351. REGDMN_MODE_11B = 1 << REGDMN_MODE_11B_BIT, /* 11b channels */
  352. REGDMN_MODE_PUREG = 1 << REGDMN_MODE_PUREG_BIT, /* 11g channels (OFDM only) */
  353. REGDMN_MODE_11G = 1 << REGDMN_MODE_11G_BIT, /* XXX historical */
  354. REGDMN_MODE_108G = 1 << REGDMN_MODE_108G_BIT, /* 11g+Turbo channels */
  355. REGDMN_MODE_108A = 1 << REGDMN_MODE_108A_BIT, /* 11a+Turbo channels */
  356. REGDMN_MODE_XR = 1 << REGDMN_MODE_XR_BIT, /* XR channels */
  357. REGDMN_MODE_11A_HALF_RATE = 1 << REGDMN_MODE_11A_HALF_RATE_BIT, /* 11A half rate channels */
  358. REGDMN_MODE_11A_QUARTER_RATE = 1 << REGDMN_MODE_11A_QUARTER_RATE_BIT, /* 11A quarter rate channels */
  359. REGDMN_MODE_11NG_HT20 = 1 << REGDMN_MODE_11NG_HT20_BIT, /* 11N-G HT20 channels */
  360. REGDMN_MODE_11NA_HT20 = 1 << REGDMN_MODE_11NA_HT20_BIT, /* 11N-A HT20 channels */
  361. REGDMN_MODE_11NG_HT40PLUS = 1 << REGDMN_MODE_11NG_HT40PLUS_BIT, /* 11N-G HT40 + channels */
  362. REGDMN_MODE_11NG_HT40MINUS = 1 << REGDMN_MODE_11NG_HT40MINUS_BIT, /* 11N-G HT40 - channels */
  363. REGDMN_MODE_11NA_HT40PLUS = 1 << REGDMN_MODE_11NA_HT40PLUS_BIT, /* 11N-A HT40 + channels */
  364. REGDMN_MODE_11NA_HT40MINUS = 1 << REGDMN_MODE_11NA_HT40MINUS_BIT, /* 11N-A HT40 - channels */
  365. REGDMN_MODE_11AC_VHT20 = 1 << REGDMN_MODE_11AC_VHT20_BIT, /* 5Ghz, VHT20 */
  366. REGDMN_MODE_11AC_VHT40PLUS = 1 << REGDMN_MODE_11AC_VHT40PLUS_BIT, /* 5Ghz, VHT40 + channels */
  367. REGDMN_MODE_11AC_VHT40MINUS = 1 << REGDMN_MODE_11AC_VHT40MINUS_BIT, /* 5Ghz VHT40 - channels */
  368. REGDMN_MODE_11AC_VHT80 = 1 << REGDMN_MODE_11AC_VHT80_BIT, /* 5Ghz, VHT80 channels */
  369. REGDMN_MODE_11AC_VHT20_2G = 1 << REGDMN_MODE_11AC_VHT20_2G_BIT, /* 2Ghz, VHT20 */
  370. REGDMN_MODE_11AC_VHT40_2G = 1 << REGDMN_MODE_11AC_VHT40_2G_BIT, /* 2Ghz, VHT40 */
  371. REGDMN_MODE_11AC_VHT80_2G = 1 << REGDMN_MODE_11AC_VHT80_2G_BIT, /* 2Ghz, VHT80 */
  372. REGDMN_MODE_11AC_VHT160 = 1 << REGDMN_MODE_11AC_VHT160_BIT, /* 5Ghz, VHT160 */
  373. REGDMN_MODE_11AC_VHT40_2GPLUS = 1 << REGDMN_MODE_11AC_VHT40_2GPLUS_BIT, /* 2Ghz, VHT40+ */
  374. REGDMN_MODE_11AC_VHT40_2GMINUS = 1 << REGDMN_MODE_11AC_VHT40_2GMINUS_BIT, /* 2Ghz, VHT40- */
  375. REGDMN_MODE_11AC_VHT80_80 = 1 << REGDMN_MODE_11AC_VHT80_80_BIT, /* 5GHz, VHT80+80 */
  376. };
  377. enum {
  378. REGDMN_MODE_U32_11AXG_HE20 = 1 << (REGDMN_MODE_11AXG_HE20_BIT - 32),
  379. REGDMN_MODE_U32_11AXA_HE20 = 1 << (REGDMN_MODE_11AXA_HE20_BIT - 32),
  380. REGDMN_MODE_U32_11AXG_HE40PLUS = 1 << (REGDMN_MODE_11AXG_HE40PLUS_BIT - 32),
  381. REGDMN_MODE_U32_11AXG_HE40MINUS = 1 << (REGDMN_MODE_11AXG_HE40MINUS_BIT - 32),
  382. REGDMN_MODE_U32_11AXA_HE40PLUS = 1 << (REGDMN_MODE_11AXA_HE40PLUS_BIT - 32),
  383. REGDMN_MODE_U32_11AXA_HE40MINUS = 1 << (REGDMN_MODE_11AXA_HE40MINUS_BIT - 32),
  384. REGDMN_MODE_U32_11AXA_HE80 = 1 << (REGDMN_MODE_11AXA_HE80_BIT - 32),
  385. REGDMN_MODE_U32_11AXA_HE160 = 1 << (REGDMN_MODE_11AXA_HE160_BIT - 32),
  386. REGDMN_MODE_U32_11AXA_HE80_80 = 1 << (REGDMN_MODE_11AXA_HE80_80_BIT - 32),
  387. REGDMN_MODE_U32_11BEG_EHT20 = 1 << (REGDMN_MODE_11BEG_EHT20_BIT - 32),
  388. REGDMN_MODE_U32_11BEA_EHT20 = 1 << (REGDMN_MODE_11BEA_EHT20_BIT - 32),
  389. REGDMN_MODE_U32_11BEG_EHT40PLUS = 1 << (REGDMN_MODE_11BEG_EHT40PLUS_BIT - 32),
  390. REGDMN_MODE_U32_11BEG_EHT40MINUS = 1 << (REGDMN_MODE_11BEG_EHT40MINUS_BIT - 32),
  391. REGDMN_MODE_U32_11BEA_EHT40PLUS = 1 << (REGDMN_MODE_11BEA_EHT40PLUS_BIT - 32),
  392. REGDMN_MODE_U32_11BEA_EHT40MINUS = 1 << (REGDMN_MODE_11BEA_EHT40MINUS_BIT - 32),
  393. REGDMN_MODE_U32_11BEA_EHT80 = 1 << (REGDMN_MODE_11BEA_EHT80_BIT - 32),
  394. REGDMN_MODE_U32_11BEA_EHT160 = 1 << (REGDMN_MODE_11BEA_EHT160_BIT - 32),
  395. REGDMN_MODE_U32_11BEA_EHT320 = 1 << (REGDMN_MODE_11BEA_EHT320_BIT - 32),
  396. };
  397. #define REGDMN_MODE_ALL (0xFFFFFFFF) /* REGDMN_MODE_ALL is defined out of the enum
  398. * to prevent the ARM compile "warning #66:
  399. * enumeration value is out of int range"
  400. * Anyway, this is a BIT-OR of all possible values.
  401. */
  402. #define REGDMN_CAP1_CHAN_HALF_RATE 0x00000001
  403. #define REGDMN_CAP1_CHAN_QUARTER_RATE 0x00000002
  404. #define REGDMN_CAP1_CHAN_HAL49GHZ 0x00000004
  405. /* regulatory capabilities */
  406. #define REGDMN_EEPROM_EEREGCAP_EN_FCC_MIDBAND 0x0040
  407. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_EVEN 0x0080
  408. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U2 0x0100
  409. #define REGDMN_EEPROM_EEREGCAP_EN_KK_MIDBAND 0x0200
  410. #define REGDMN_EEPROM_EEREGCAP_EN_KK_U1_ODD 0x0400
  411. #define REGDMN_EEPROM_EEREGCAP_EN_KK_NEW_11A 0x0800
  412. typedef struct {
  413. A_UINT32 tlv_header; /* TLV tag and len; tag equals WMI_TLVTAG_STRUC_HAL_REG_CAPABILITIES */
  414. A_UINT32 eeprom_rd; /* regdomain value specified in EEPROM */
  415. A_UINT32 eeprom_rd_ext; /* regdomain */
  416. A_UINT32 regcap1; /* CAP1 capabilities bit map. */
  417. A_UINT32 regcap2; /* REGDMN EEPROM CAP. */
  418. A_UINT32 wireless_modes; /* REGDMN MODE */
  419. A_UINT32 low_2ghz_chan;
  420. A_UINT32 high_2ghz_chan;
  421. A_UINT32 low_5ghz_chan;
  422. A_UINT32 high_5ghz_chan;
  423. A_UINT32 wireless_modes_ext; /* REGDMN MODE ext */
  424. } HAL_REG_CAPABILITIES;
  425. #ifdef NUM_SPATIAL_STREAM
  426. /*
  427. * The rate control definitions below are only used in the target.
  428. * (Host-based rate control is no longer applicable.)
  429. * Maintain the defs in wlanfw_cmn for the sake of existing Rome / Helium
  430. * targets, but for Lithium targets remove them from wlanfw_cmn and define
  431. * them in a target-only location instead.
  432. * SUPPORT_11AX is essentially used as a condition to identify Lithium targets.
  433. * Some host drivers would also have SUPPORT_11AX defined, and thus would lose
  434. * the definition of RATE_CODE, RC_TX_DONE_PARAMS, and related macros, but
  435. * that's okay because the host should have no references to these
  436. * target-only data structures.
  437. */
  438. #if !((NUM_SPATIAL_STREAM > 4) || SUPPORT_11AX) /* following N/A for Lithium */
  439. /*
  440. * Used to update rate-control logic with the status of the tx-completion.
  441. * In host-based implementation of the rate-control feature, this struture is used to
  442. * create the payload for HTT message/s from target to host.
  443. */
  444. #ifndef CONFIG_MOVE_RC_STRUCT_TO_MACCORE
  445. #if (NUM_SPATIAL_STREAM > 3)
  446. #define A_RATEMASK A_UINT64
  447. #else
  448. #define A_RATEMASK A_UINT32
  449. #endif
  450. #endif /* CONFIG_MOVE_RC_STRUCT_TO_MACCORE */
  451. typedef A_UINT8 A_RATE;
  452. typedef A_UINT8 A_RATECODE;
  453. #define A_RATEMASK_NUM_OCTET (sizeof (A_RATEMASK))
  454. #define A_RATEMASK_NUM_BITS ((sizeof (A_RATEMASK)) << 3)
  455. typedef struct {
  456. A_RATECODE rateCode;
  457. A_UINT8 flags;
  458. } RATE_CODE;
  459. typedef struct {
  460. RATE_CODE ptx_rc; /* rate code, bw, chain mask sgi */
  461. A_UINT8 reserved[2];
  462. A_UINT32 flags; /* Encodes information such as excessive
  463. retransmission, aggregate, some info
  464. from .11 frame control,
  465. STBC, LDPC, (SGI and Tx Chain Mask
  466. are encoded in ptx_rc->flags field),
  467. AMPDU truncation (BT/time based etc.),
  468. RTS/CTS attempt */
  469. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  470. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  471. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  472. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  473. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  474. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  475. A_UINT32 ba_win_size; /* b'7..b0, block Ack Window size, b'31..b8 Resvd */
  476. A_UINT32 failed_ba_bmap_0_31; /* failed BA bitmap 0..31 */
  477. A_UINT32 failed_ba_bmap_32_63; /* failed BA bitmap 32..63 */
  478. A_UINT32 bmap_tried_0_31; /* enqued bitmap 0..31 */
  479. A_UINT32 bmap_tried_32_63; /* enqued bitmap 32..63 */
  480. } RC_TX_DONE_PARAMS;
  481. #define RC_SET_TX_DONE_INFO(_dst, _rc, _f, _nq, _nr, _nf, _rssi, _ts) \
  482. do { \
  483. (_dst).ptx_rc.rateCode = (_rc).rateCode; \
  484. (_dst).ptx_rc.flags = (_rc).flags; \
  485. (_dst).flags = (_f); \
  486. (_dst).num_enqued = (_nq); \
  487. (_dst).num_retries = (_nr); \
  488. (_dst).num_failed = (_nf); \
  489. (_dst).ack_rssi = (_rssi); \
  490. (_dst).time_stamp = (_ts); \
  491. } while (0)
  492. #define RC_SET_TXBF_DONE_INFO(_dst, _f) \
  493. do { \
  494. (_dst).flags |= (_f); \
  495. } while (0)
  496. /*
  497. * NOTE: NUM_SCHED_ENTRIES is not used in the host/target interface, but for
  498. * historical reasons has been defined in the host/target interface files.
  499. * The NUM_SCHED_ENTRIES definition is being moved into a target-only
  500. * header file for newer (Lithium) targets, but is being left here for
  501. * non-Lithium cases, to avoid having to rework legacy targets to move
  502. * the NUM_SCHED_ENTRIES definition into a target-only header file.
  503. * Moving the NUM_SCHED_ENTRIES definition into a non-Lithium conditional
  504. * block should have no impact on the host, since the host does not use
  505. * NUM_SCHED_ENTRIES.
  506. */
  507. #define NUM_SCHED_ENTRIES 2
  508. #endif /* !((NUM_SPATIAL_STREAM > 4) || SUPPORT_11AX) */ /* above N/A for Lithium */
  509. #endif /* NUM_SPATIAL_STREAM */
  510. /* NOTE: NUM_DYN_BW cannot be changed without breaking WMI Compatibility */
  511. #define NUM_DYN_BW_MAX 4
  512. /* Some products only use 20/40/80; some use 20/40/80/160 */
  513. #ifndef NUM_DYN_BW
  514. #define NUM_DYN_BW 3 /* default: support up through 80 MHz */
  515. #endif
  516. #define NUM_DYN_BW_MASK 0x3
  517. #define PROD_SCHED_BW_ENTRIES (NUM_SCHED_ENTRIES * NUM_DYN_BW)
  518. #if NUM_DYN_BW > 5
  519. /* Extend rate table module first */
  520. #error "Extend rate table module first"
  521. #endif
  522. #define MAX_IBSS_PEERS 32
  523. #ifdef NUM_SPATIAL_STREAM
  524. /*
  525. * RC_TX_RATE_SCHEDULE and RC_TX_RATE_INFO defs are used only in the target.
  526. * (Host-based rate control is no longer applicable.)
  527. * Maintain the defs in wlanfw_cmn for the sake of existing Rome / Helium
  528. * targets, but for Lithium targets remove them from wlanfw_cmn and define
  529. * them in a target-only location instead.
  530. * SUPPORT_11AX is essentially used as a condition to identify Lithium targets.
  531. * Some host drivers would also have SUPPORT_11AX defined, and thus would lose
  532. * the definition of RC_TX_RATE_SCHEDULE and RC_TX_RATE_INFO, but that's okay
  533. * because the host should have no references to these target-only data
  534. * structures.
  535. */
  536. #ifndef CONFIG_MOVE_RC_STRUCT_TO_MACCORE
  537. #if !((NUM_SPATIAL_STREAM > 4) || SUPPORT_11AX)
  538. #if defined(CONFIG_AR900B_SUPPORT) || defined(AR900B)
  539. typedef struct{
  540. A_UINT32 psdu_len[NUM_DYN_BW * NUM_SCHED_ENTRIES];
  541. A_UINT16 flags[NUM_SCHED_ENTRIES][NUM_DYN_BW];
  542. A_RATE rix[NUM_SCHED_ENTRIES][NUM_DYN_BW];
  543. A_UINT8 tpc[NUM_SCHED_ENTRIES][NUM_DYN_BW];
  544. A_UINT32 antmask[NUM_SCHED_ENTRIES];
  545. A_UINT8 num_mpdus[NUM_DYN_BW * NUM_SCHED_ENTRIES];
  546. A_UINT16 txbf_cv_len;
  547. A_UINT32 txbf_cv_ptr;
  548. A_UINT16 txbf_flags;
  549. A_UINT16 txbf_cv_size;
  550. A_UINT8 txbf_nc_idx;
  551. A_UINT8 tries[NUM_SCHED_ENTRIES];
  552. A_UINT8 bw_mask[NUM_SCHED_ENTRIES];
  553. A_UINT8 max_bw[NUM_SCHED_ENTRIES];
  554. A_UINT8 num_sched_entries;
  555. A_UINT8 paprd_mask;
  556. A_RATE rts_rix;
  557. A_UINT8 sh_pream;
  558. A_UINT8 min_spacing_1_4_us;
  559. A_UINT8 fixed_delims;
  560. A_UINT8 bw_in_service;
  561. A_RATE probe_rix;
  562. A_UINT8 num_valid_rates;
  563. A_UINT8 rtscts_tpc;
  564. A_UINT8 dd_profile;
  565. } RC_TX_RATE_SCHEDULE;
  566. #else
  567. typedef struct{
  568. A_UINT32 psdu_len[NUM_DYN_BW * NUM_SCHED_ENTRIES];
  569. A_UINT16 flags[NUM_DYN_BW * NUM_SCHED_ENTRIES];
  570. A_RATE rix[NUM_DYN_BW * NUM_SCHED_ENTRIES];
  571. A_UINT8 tpc[NUM_DYN_BW * NUM_SCHED_ENTRIES];
  572. A_UINT8 num_mpdus[NUM_DYN_BW * NUM_SCHED_ENTRIES];
  573. A_UINT32 antmask[NUM_SCHED_ENTRIES];
  574. A_UINT32 txbf_cv_ptr;
  575. A_UINT16 txbf_cv_len;
  576. A_UINT8 tries[NUM_SCHED_ENTRIES];
  577. A_UINT8 num_valid_rates;
  578. A_UINT8 paprd_mask;
  579. A_RATE rts_rix;
  580. A_UINT8 sh_pream;
  581. A_UINT8 min_spacing_1_4_us;
  582. A_UINT8 fixed_delims;
  583. A_UINT8 bw_in_service;
  584. A_RATE probe_rix;
  585. } RC_TX_RATE_SCHEDULE;
  586. #endif
  587. typedef struct{
  588. A_UINT16 flags[NUM_DYN_BW * NUM_SCHED_ENTRIES];
  589. A_RATE rix[NUM_DYN_BW * NUM_SCHED_ENTRIES];
  590. #ifdef DYN_TPC_ENABLE
  591. A_UINT8 tpc[NUM_DYN_BW * NUM_SCHED_ENTRIES];
  592. #endif
  593. #ifdef SECTORED_ANTENNA
  594. A_UINT32 antmask[NUM_SCHED_ENTRIES];
  595. #endif
  596. A_UINT8 tries[NUM_SCHED_ENTRIES];
  597. A_UINT8 num_valid_rates;
  598. A_RATE rts_rix;
  599. A_UINT8 sh_pream;
  600. A_UINT8 bw_in_service;
  601. A_RATE probe_rix;
  602. A_UINT8 dd_profile;
  603. } RC_TX_RATE_INFO;
  604. #endif /* !((NUM_SPATIAL_STREAM > 4) || SUPPORT_11AX) */
  605. #endif /* CONFIG_MOVE_RC_STRUCT_TO_MACCORE */
  606. #endif
  607. /*
  608. * Temporarily continue to provide the WHAL_RC_INIT_RC_MASKS def in wlan_defs.h
  609. * for older targets.
  610. * The WHAL_RX_INIT_RC_MASKS macro def needs to be moved into ratectrl_11ac.h
  611. * for all targets, but until this is complete, the WHAL_RC_INIT_RC_MASKS def
  612. * will be maintained here in its old location.
  613. */
  614. #ifndef CONFIG_160MHZ_SUPPORT
  615. #define WHAL_RC_INIT_RC_MASKS(_rm) do { \
  616. _rm[WHAL_RC_MASK_IDX_NON_HT] = A_RATEMASK_OFDM_CCK; \
  617. _rm[WHAL_RC_MASK_IDX_HT_20] = A_RATEMASK_HT_20; \
  618. _rm[WHAL_RC_MASK_IDX_HT_40] = A_RATEMASK_HT_40; \
  619. _rm[WHAL_RC_MASK_IDX_VHT_20] = A_RATEMASK_VHT_20; \
  620. _rm[WHAL_RC_MASK_IDX_VHT_40] = A_RATEMASK_VHT_40; \
  621. _rm[WHAL_RC_MASK_IDX_VHT_80] = A_RATEMASK_VHT_80; \
  622. } while (0)
  623. #endif
  624. /**
  625. * strucutre describing host memory chunk.
  626. */
  627. typedef struct {
  628. A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wlan_host_memory_chunk */
  629. /** id of the request that is passed up in service ready */
  630. A_UINT32 req_id;
  631. /** the physical address the memory chunk */
  632. A_UINT32 ptr;
  633. /** size of the chunk */
  634. A_UINT32 size;
  635. /** ptr_high
  636. * most significant bits of physical address of the memory chunk
  637. * Only applicable for addressing more than 32 bit.
  638. * This will only be non-zero if the target has set
  639. * WMI_SERVICE_SUPPORT_EXTEND_ADDRESS flag.
  640. */
  641. A_UINT32 ptr_high;
  642. } wlan_host_memory_chunk;
  643. #define NUM_UNITS_IS_NUM_VDEVS 0x1
  644. #define NUM_UNITS_IS_NUM_PEERS 0x2
  645. #define NUM_UNITS_IS_NUM_ACTIVE_PEERS 0x4
  646. /* request host to allocate memory contiguously */
  647. #define REQ_TO_HOST_FOR_CONT_MEMORY 0x8
  648. /**
  649. * structure used by FW for requesting host memory
  650. */
  651. typedef struct {
  652. A_UINT32 tlv_header; /* TLV tag and len; tag equals WMI_TLVTAG_STRUC_wlan_host_mem_req */
  653. /** ID of the request */
  654. A_UINT32 req_id;
  655. /** size of the of each unit */
  656. A_UINT32 unit_size;
  657. /**
  658. * flags to indicate that
  659. * the number units is dependent
  660. * on number of resources(num vdevs num peers .. etc)
  661. */
  662. A_UINT32 num_unit_info;
  663. /*
  664. * actual number of units to allocate . if flags in the num_unit_info
  665. * indicate that number of units is tied to number of a particular
  666. * resource to allocate then num_units filed is set to 0 and host
  667. * will derive the number units from number of the resources it is
  668. * requesting.
  669. */
  670. A_UINT32 num_units;
  671. } wlan_host_mem_req;
  672. typedef enum {
  673. IGNORE_DTIM = 0x01,
  674. NORMAL_DTIM = 0x02,
  675. STICK_DTIM = 0x03,
  676. AUTO_DTIM = 0x04,
  677. } BEACON_DTIM_POLICY;
  678. /* During test it is observed that 6 * 400 = 2400 can
  679. * be alloced in addition to CFG_TGT_NUM_MSDU_DESC.
  680. * If there is any change memory requirement, this number
  681. * needs to be revisited. */
  682. #define TOTAL_VOW_ALLOCABLE 2400
  683. #define VOW_DESC_GRAB_MAX 800
  684. #define VOW_GET_NUM_VI_STA(vow_config) (((vow_config) & 0xffff0000) >> 16)
  685. #define VOW_GET_DESC_PER_VI_STA(vow_config) ((vow_config) & 0x0000ffff)
  686. /***TODO!!! Get these values dynamically in WMI_READY event and use it to calculate the mem req*/
  687. /* size in bytes required for msdu descriptor. If it changes, this should be updated. LARGE_AP
  688. * case is not considered. LARGE_AP is disabled when VoW is enabled.*/
  689. #define MSDU_DESC_SIZE 20
  690. /* size in bytes required to support a peer in target.
  691. * This obtained by considering Two tids per peer.
  692. * peer structure = 168 bytes
  693. * tid = 96 bytes (per sta 2 means we need 192 bytes)
  694. * peer_cb = 16 * 2
  695. * key = 52 * 2
  696. * AST = 12 * 2
  697. * rate, reorder.. = 384
  698. * smart antenna = 50
  699. */
  700. #define MEMORY_REQ_FOR_PEER 800
  701. /*
  702. * NB: it is important to keep all the fields in the structure dword long
  703. * so that it is easy to handle the statistics in BE host.
  704. */
  705. /*
  706. * wlan_dbg_tx_stats_v1, _v2:
  707. * differing versions of the wlan_dbg_tx_stats struct used by different
  708. * targets
  709. */
  710. struct wlan_dbg_tx_stats_v1 {
  711. /* Num HTT cookies queued to dispatch list */
  712. A_INT32 comp_queued;
  713. /* Num HTT cookies dispatched */
  714. A_INT32 comp_delivered;
  715. /* Num MSDU queued to WAL */
  716. A_INT32 msdu_enqued;
  717. /* Num MPDU queue to WAL */
  718. A_INT32 mpdu_enqued;
  719. /* Num MSDUs dropped by WMM limit */
  720. A_INT32 wmm_drop;
  721. /* Num Local frames queued */
  722. A_INT32 local_enqued;
  723. /* Num Local frames done */
  724. A_INT32 local_freed;
  725. /* Num queued to HW */
  726. A_INT32 hw_queued;
  727. /* Num PPDU reaped from HW */
  728. A_INT32 hw_reaped;
  729. /* Num underruns */
  730. A_INT32 underrun;
  731. /* Num PPDUs cleaned up in TX abort */
  732. A_INT32 tx_abort;
  733. /* Num MPDUs requed by SW */
  734. A_INT32 mpdus_requed;
  735. /* excessive retries */
  736. A_UINT32 tx_ko;
  737. /* data hw rate code */
  738. A_UINT32 data_rc;
  739. /* Scheduler self triggers */
  740. A_UINT32 self_triggers;
  741. /* frames dropped due to excessive sw retries */
  742. A_UINT32 sw_retry_failure;
  743. /* illegal rate phy errors */
  744. A_UINT32 illgl_rate_phy_err;
  745. /* wal pdev continous xretry */
  746. A_UINT32 pdev_cont_xretry;
  747. /* wal pdev continous xretry */
  748. A_UINT32 pdev_tx_timeout;
  749. /* wal pdev resets */
  750. A_UINT32 pdev_resets;
  751. /* frames dropped due to non-availability of stateless TIDs */
  752. A_UINT32 stateless_tid_alloc_failure;
  753. /* PhY/BB underrun */
  754. A_UINT32 phy_underrun;
  755. /* MPDU is more than txop limit */
  756. A_UINT32 txop_ovf;
  757. };
  758. struct wlan_dbg_tx_stats_v2 {
  759. /* Num HTT cookies queued to dispatch list */
  760. A_INT32 comp_queued;
  761. /* Num HTT cookies dispatched */
  762. A_INT32 comp_delivered;
  763. /* Num MSDU queued to WAL */
  764. A_INT32 msdu_enqued;
  765. /* Num MPDU queue to WAL */
  766. A_INT32 mpdu_enqued;
  767. /* Num MSDUs dropped by WMM limit */
  768. A_INT32 wmm_drop;
  769. /* Num Local frames queued */
  770. A_INT32 local_enqued;
  771. /* Num Local frames done */
  772. A_INT32 local_freed;
  773. /* Num queued to HW */
  774. A_INT32 hw_queued;
  775. /* Num PPDU reaped from HW */
  776. A_INT32 hw_reaped;
  777. /* Num underruns */
  778. A_INT32 underrun;
  779. /* HW Paused. */
  780. A_UINT32 hw_paused;
  781. /* Num PPDUs cleaned up in TX abort */
  782. A_INT32 tx_abort;
  783. /* Num MPDUs requed by SW */
  784. A_INT32 mpdus_requed;
  785. /* excessive retries */
  786. A_UINT32 tx_ko;
  787. A_UINT32 tx_xretry;
  788. /* data hw rate code */
  789. A_UINT32 data_rc;
  790. /* Scheduler self triggers */
  791. A_UINT32 self_triggers;
  792. /* frames dropped due to excessive sw retries */
  793. A_UINT32 sw_retry_failure;
  794. /* illegal rate phy errors */
  795. A_UINT32 illgl_rate_phy_err;
  796. /* wal pdev continous xretry */
  797. A_UINT32 pdev_cont_xretry;
  798. /* wal pdev continous xretry */
  799. A_UINT32 pdev_tx_timeout;
  800. /* wal pdev resets */
  801. A_UINT32 pdev_resets;
  802. /* frames dropped due to non-availability of stateless TIDs */
  803. A_UINT32 stateless_tid_alloc_failure;
  804. /* PhY/BB underrun */
  805. A_UINT32 phy_underrun;
  806. /* MPDU is more than txop limit */
  807. A_UINT32 txop_ovf;
  808. /* Number of Sequences posted */
  809. A_UINT32 seq_posted;
  810. /* Number of Sequences failed queueing */
  811. A_UINT32 seq_failed_queueing;
  812. /* Number of Sequences completed */
  813. A_UINT32 seq_completed;
  814. /* Number of Sequences restarted */
  815. A_UINT32 seq_restarted;
  816. /* Number of MU Sequences posted */
  817. A_UINT32 mu_seq_posted;
  818. /* Num MPDUs flushed by SW, HWPAUSED, SW TXABORT (Reset,channel change) */
  819. A_INT32 mpdus_sw_flush;
  820. /* Num MPDUs filtered by HW, all filter condition (TTL expired) */
  821. A_INT32 mpdus_hw_filter;
  822. /* Num MPDUs truncated by PDG (TXOP, TBTT, PPDU_duration based on rate, dyn_bw) */
  823. A_INT32 mpdus_truncated;
  824. /* Num MPDUs that was tried but didn't receive ACK or BA */
  825. A_INT32 mpdus_ack_failed;
  826. /* Num MPDUs that was dropped du to expiry. */
  827. A_INT32 mpdus_expired;
  828. };
  829. #if defined(AR900B)
  830. #define wlan_dbg_tx_stats wlan_dbg_tx_stats_v2
  831. #else
  832. #define wlan_dbg_tx_stats wlan_dbg_tx_stats_v1
  833. #endif
  834. /*
  835. * wlan_dbg_rx_stats_v1, _v2:
  836. * differing versions of the wlan_dbg_rx_stats struct used by different
  837. * targets
  838. */
  839. struct wlan_dbg_rx_stats_v1 {
  840. /* Cnts any change in ring routing mid-ppdu */
  841. A_INT32 mid_ppdu_route_change;
  842. /* Total number of statuses processed */
  843. A_INT32 status_rcvd;
  844. /* Extra frags on rings 0-3 */
  845. A_INT32 r0_frags;
  846. A_INT32 r1_frags;
  847. A_INT32 r2_frags;
  848. A_INT32 r3_frags;
  849. /* MSDUs / MPDUs delivered to HTT */
  850. A_INT32 htt_msdus;
  851. A_INT32 htt_mpdus;
  852. /* MSDUs / MPDUs delivered to local stack */
  853. A_INT32 loc_msdus;
  854. A_INT32 loc_mpdus;
  855. /* AMSDUs that have more MSDUs than the status ring size */
  856. A_INT32 oversize_amsdu;
  857. /* Number of PHY errors */
  858. A_INT32 phy_errs;
  859. /* Number of PHY errors drops */
  860. A_INT32 phy_err_drop;
  861. /* Number of mpdu errors - FCS, MIC, ENC etc. */
  862. A_INT32 mpdu_errs;
  863. };
  864. struct wlan_dbg_rx_stats_v2 {
  865. /* Cnts any change in ring routing mid-ppdu */
  866. A_INT32 mid_ppdu_route_change;
  867. /* Total number of statuses processed */
  868. A_INT32 status_rcvd;
  869. /* Extra frags on rings 0-3 */
  870. A_INT32 r0_frags;
  871. A_INT32 r1_frags;
  872. A_INT32 r2_frags;
  873. A_INT32 r3_frags;
  874. /* MSDUs / MPDUs delivered to HTT */
  875. A_INT32 htt_msdus;
  876. A_INT32 htt_mpdus;
  877. /* MSDUs / MPDUs delivered to local stack */
  878. A_INT32 loc_msdus;
  879. A_INT32 loc_mpdus;
  880. /* AMSDUs that have more MSDUs than the status ring size */
  881. A_INT32 oversize_amsdu;
  882. /* Number of PHY errors */
  883. A_INT32 phy_errs;
  884. /* Number of PHY errors drops */
  885. A_INT32 phy_err_drop;
  886. /* Number of mpdu errors - FCS, MIC, ENC etc. */
  887. A_INT32 mpdu_errs;
  888. /* Number of rx overflow errors. */
  889. A_INT32 rx_ovfl_errs;
  890. };
  891. #if defined(AR900B)
  892. #define wlan_dbg_rx_stats wlan_dbg_rx_stats_v2
  893. #else
  894. #define wlan_dbg_rx_stats wlan_dbg_rx_stats_v1
  895. #endif
  896. struct wlan_dbg_mem_stats {
  897. A_UINT32 iram_free_size;
  898. A_UINT32 dram_free_size;
  899. };
  900. struct wlan_dbg_peer_stats {
  901. A_INT32 dummy; /* REMOVE THIS ONCE REAL PEER STAT COUNTERS ARE ADDED */
  902. };
  903. /*
  904. * wlan_dbg_rx_rate_info_v1a_t, _v1b_t:
  905. * differing versions of the wlan_dbg_rx_rate_info struct used by different
  906. * targets
  907. */
  908. typedef struct {
  909. A_UINT32 mcs[10];
  910. A_UINT32 sgi[10];
  911. A_UINT32 nss[4];
  912. A_UINT32 nsts;
  913. A_UINT32 stbc[10];
  914. A_UINT32 bw[3];
  915. A_UINT32 pream[6];
  916. A_UINT32 ldpc;
  917. A_UINT32 txbf;
  918. A_UINT32 mgmt_rssi;
  919. A_UINT32 data_rssi;
  920. A_UINT32 rssi_chain0;
  921. A_UINT32 rssi_chain1;
  922. A_UINT32 rssi_chain2;
  923. } wlan_dbg_rx_rate_info_v1a_t;
  924. typedef struct {
  925. A_UINT32 mcs[10];
  926. A_UINT32 sgi[10];
  927. A_UINT32 nss[4];
  928. A_UINT32 nsts;
  929. A_UINT32 stbc[10];
  930. A_UINT32 bw[3];
  931. A_UINT32 pream[6];
  932. A_UINT32 ldpc;
  933. A_UINT32 txbf;
  934. A_UINT32 mgmt_rssi;
  935. A_UINT32 data_rssi;
  936. A_UINT32 rssi_chain0;
  937. A_UINT32 rssi_chain1;
  938. A_UINT32 rssi_chain2;
  939. /*
  940. * TEMPORARY: leave rssi_chain3 in place for AR900B builds until code using
  941. * rssi_chain3 has been converted to use wlan_dbg_rx_rate_info_v2_t.
  942. */
  943. A_UINT32 rssi_chain3;
  944. } wlan_dbg_rx_rate_info_v1b_t;
  945. #if defined(AR900B)
  946. #define wlan_dbg_rx_rate_info_t wlan_dbg_rx_rate_info_v1b_t
  947. #else
  948. #define wlan_dbg_rx_rate_info_t wlan_dbg_rx_rate_info_v1a_t
  949. #endif
  950. typedef struct {
  951. A_UINT32 mcs[10];
  952. A_UINT32 sgi[10];
  953. /*
  954. * TEMPORARY: leave nss conditionally defined, until all code that
  955. * requires nss[4] is converted to use wlan_dbg_tx_rate_info_v2_t.
  956. * At that time, this nss array will be made length = 3 unconditionally.
  957. */
  958. #if defined(CONFIG_AR900B_SUPPORT) || defined(AR900B)
  959. A_UINT32 nss[4];
  960. #else
  961. A_UINT32 nss[3];
  962. #endif
  963. A_UINT32 stbc[10];
  964. A_UINT32 bw[3];
  965. A_UINT32 pream[4];
  966. A_UINT32 ldpc;
  967. A_UINT32 rts_cnt;
  968. A_UINT32 ack_rssi;
  969. } wlan_dbg_tx_rate_info_t ;
  970. #define WLAN_MAX_MCS 10
  971. typedef struct {
  972. A_UINT32 mcs[WLAN_MAX_MCS];
  973. A_UINT32 sgi[WLAN_MAX_MCS];
  974. A_UINT32 nss[MAX_SPATIAL_STREAM_ANY_V2];
  975. A_UINT32 nsts;
  976. A_UINT32 stbc[WLAN_MAX_MCS];
  977. A_UINT32 bw[NUM_DYN_BW_MAX];
  978. A_UINT32 pream[6];
  979. A_UINT32 ldpc;
  980. A_UINT32 txbf;
  981. A_UINT32 mgmt_rssi;
  982. A_UINT32 data_rssi;
  983. A_UINT32 rssi_chain0;
  984. A_UINT32 rssi_chain1;
  985. A_UINT32 rssi_chain2;
  986. A_UINT32 rssi_chain3;
  987. A_UINT32 reserved[8];
  988. } wlan_dbg_rx_rate_info_v2_t;
  989. typedef struct {
  990. A_UINT32 mcs[WLAN_MAX_MCS];
  991. A_UINT32 sgi[WLAN_MAX_MCS];
  992. A_UINT32 nss[MAX_SPATIAL_STREAM_ANY_V2];
  993. A_UINT32 stbc[WLAN_MAX_MCS];
  994. A_UINT32 bw[NUM_DYN_BW_MAX];
  995. A_UINT32 pream[4];
  996. A_UINT32 ldpc;
  997. A_UINT32 rts_cnt;
  998. A_UINT32 ack_rssi;
  999. A_UINT32 reserved[8];
  1000. } wlan_dbg_tx_rate_info_v2_t;
  1001. typedef struct {
  1002. A_UINT32 mcs[WLAN_MAX_MCS];
  1003. A_UINT32 sgi[WLAN_MAX_MCS];
  1004. A_UINT32 nss[MAX_SPATIAL_STREAM_ANY_V3];
  1005. A_UINT32 nsts;
  1006. A_UINT32 stbc[WLAN_MAX_MCS];
  1007. A_UINT32 bw[NUM_DYN_BW_MAX];
  1008. A_UINT32 pream[6];
  1009. A_UINT32 ldpc;
  1010. A_UINT32 txbf;
  1011. A_UINT32 mgmt_rssi;
  1012. A_UINT32 data_rssi;
  1013. A_UINT32 rssi_chain0;
  1014. A_UINT32 rssi_chain1;
  1015. A_UINT32 rssi_chain2;
  1016. A_UINT32 rssi_chain3;
  1017. A_UINT32 reserved[8];
  1018. } wlan_dbg_rx_rate_info_v3_t;
  1019. typedef struct {
  1020. A_UINT32 mcs[WLAN_MAX_MCS];
  1021. A_UINT32 sgi[WLAN_MAX_MCS];
  1022. A_UINT32 nss[MAX_SPATIAL_STREAM_ANY_V3];
  1023. A_UINT32 stbc[WLAN_MAX_MCS];
  1024. A_UINT32 bw[NUM_DYN_BW_MAX];
  1025. A_UINT32 pream[4];
  1026. A_UINT32 ldpc;
  1027. A_UINT32 rts_cnt;
  1028. A_UINT32 ack_rssi;
  1029. A_UINT32 reserved[8];
  1030. } wlan_dbg_tx_rate_info_v3_t;
  1031. #define WHAL_DBG_PHY_ERR_MAXCNT 18
  1032. #define WHAL_DBG_SIFS_STATUS_MAXCNT 8
  1033. #define WHAL_DBG_SIFS_ERR_MAXCNT 8
  1034. #define WHAL_DBG_CMD_RESULT_MAXCNT 11
  1035. #define WHAL_DBG_CMD_STALL_ERR_MAXCNT 4
  1036. #define WHAL_DBG_FLUSH_REASON_MAXCNT 40
  1037. typedef enum {
  1038. WIFI_URRN_STATS_FIRST_PKT,
  1039. WIFI_URRN_STATS_BETWEEN_MPDU,
  1040. WIFI_URRN_STATS_WITHIN_MPDU,
  1041. WHAL_MAX_URRN_STATS
  1042. } wifi_urrn_type_t;
  1043. typedef struct wlan_dbg_txbf_snd_stats {
  1044. A_UINT32 cbf_20[4];
  1045. A_UINT32 cbf_40[4];
  1046. A_UINT32 cbf_80[4];
  1047. A_UINT32 sounding[9];
  1048. A_UINT32 cbf_160[4];
  1049. } wlan_dbg_txbf_snd_stats_t;
  1050. typedef struct wlan_dbg_wifi2_error_stats {
  1051. A_UINT32 urrn_stats[WHAL_MAX_URRN_STATS];
  1052. A_UINT32 flush_errs[WHAL_DBG_FLUSH_REASON_MAXCNT];
  1053. A_UINT32 schd_stall_errs[WHAL_DBG_CMD_STALL_ERR_MAXCNT];
  1054. A_UINT32 schd_cmd_result[WHAL_DBG_CMD_RESULT_MAXCNT];
  1055. A_UINT32 sifs_status[WHAL_DBG_SIFS_STATUS_MAXCNT];
  1056. A_UINT8 phy_errs[WHAL_DBG_PHY_ERR_MAXCNT];
  1057. A_UINT32 rx_rate_inval;
  1058. } wlan_dbg_wifi2_error_stats_t;
  1059. typedef struct wlan_dbg_wifi2_error2_stats {
  1060. A_UINT32 schd_errs[WHAL_DBG_CMD_STALL_ERR_MAXCNT];
  1061. A_UINT32 sifs_errs[WHAL_DBG_SIFS_ERR_MAXCNT];
  1062. } wlan_dbg_wifi2_error2_stats_t;
  1063. #define WLAN_DBG_STATS_SIZE_TXBF_VHT 10
  1064. #define WLAN_DBG_STATS_SIZE_TXBF_HT 8
  1065. #define WLAN_DBG_STATS_SIZE_TXBF_OFDM 8
  1066. #define WLAN_DBG_STATS_SIZE_TXBF_CCK 7
  1067. typedef struct wlan_dbg_txbf_data_stats {
  1068. A_UINT32 tx_txbf_vht[WLAN_DBG_STATS_SIZE_TXBF_VHT];
  1069. A_UINT32 rx_txbf_vht[WLAN_DBG_STATS_SIZE_TXBF_VHT];
  1070. A_UINT32 tx_txbf_ht[WLAN_DBG_STATS_SIZE_TXBF_HT];
  1071. A_UINT32 tx_txbf_ofdm[WLAN_DBG_STATS_SIZE_TXBF_OFDM];
  1072. A_UINT32 tx_txbf_cck[WLAN_DBG_STATS_SIZE_TXBF_CCK];
  1073. } wlan_dbg_txbf_data_stats_t;
  1074. struct wlan_dbg_tx_mu_stats {
  1075. A_UINT32 mu_sch_nusers_2;
  1076. A_UINT32 mu_sch_nusers_3;
  1077. A_UINT32 mu_mpdus_queued_usr[4];
  1078. A_UINT32 mu_mpdus_tried_usr[4];
  1079. A_UINT32 mu_mpdus_failed_usr[4];
  1080. A_UINT32 mu_mpdus_requeued_usr[4];
  1081. A_UINT32 mu_err_no_ba_usr[4];
  1082. A_UINT32 mu_mpdu_underrun_usr[4];
  1083. A_UINT32 mu_ampdu_underrun_usr[4];
  1084. };
  1085. struct wlan_dbg_tx_selfgen_stats {
  1086. A_UINT32 su_ndpa;
  1087. A_UINT32 su_ndp;
  1088. A_UINT32 mu_ndpa;
  1089. A_UINT32 mu_ndp;
  1090. A_UINT32 mu_brpoll_1;
  1091. A_UINT32 mu_brpoll_2;
  1092. A_UINT32 mu_bar_1;
  1093. A_UINT32 mu_bar_2;
  1094. A_UINT32 cts_burst;
  1095. A_UINT32 su_ndp_err;
  1096. A_UINT32 su_ndpa_err;
  1097. A_UINT32 mu_ndp_err;
  1098. A_UINT32 mu_brp1_err;
  1099. A_UINT32 mu_brp2_err;
  1100. };
  1101. typedef struct wlan_dbg_sifs_resp_stats {
  1102. A_UINT32 ps_poll_trigger; /* num ps-poll trigger frames */
  1103. A_UINT32 uapsd_trigger; /* num uapsd trigger frames */
  1104. A_UINT32 qb_data_trigger[2]; /* num data trigger frames; idx 0: explicit and idx 1: implicit */
  1105. A_UINT32 qb_bar_trigger[2]; /* num bar trigger frames; idx 0: explicit and idx 1: implicit */
  1106. A_UINT32 sifs_resp_data; /* num ppdus transmitted at SIFS interval */
  1107. A_UINT32 sifs_resp_err; /* num ppdus failed to meet SIFS resp timing */
  1108. } wlan_dgb_sifs_resp_stats_t;
  1109. /** wlan_dbg_wifi2_error_stats_t is not grouped with the
  1110. * following structure as it is allocated differently and only
  1111. * belongs to whal
  1112. */
  1113. typedef struct wlan_dbg_stats_wifi2 {
  1114. wlan_dbg_txbf_snd_stats_t txbf_snd_info;
  1115. wlan_dbg_txbf_data_stats_t txbf_data_info;
  1116. struct wlan_dbg_tx_selfgen_stats tx_selfgen;
  1117. struct wlan_dbg_tx_mu_stats tx_mu;
  1118. wlan_dgb_sifs_resp_stats_t sifs_resp_info;
  1119. } wlan_dbg_wifi2_stats_t;
  1120. /*
  1121. * wlan_dbg_rx_rate_info_v1a, _v1b:
  1122. * differing versions of the wlan_dbg_rx_rate_info struct used by different
  1123. * targets
  1124. */
  1125. typedef struct {
  1126. wlan_dbg_rx_rate_info_v1a_t rx_phy_info;
  1127. wlan_dbg_tx_rate_info_t tx_rate_info;
  1128. } wlan_dbg_rate_info_v1a_t;
  1129. typedef struct {
  1130. wlan_dbg_rx_rate_info_v1b_t rx_phy_info;
  1131. wlan_dbg_tx_rate_info_t tx_rate_info;
  1132. } wlan_dbg_rate_info_v1b_t;
  1133. #if defined(AR900B)
  1134. #define wlan_dbg_rate_info_t wlan_dbg_rate_info_v1b_t
  1135. #else
  1136. #define wlan_dbg_rate_info_t wlan_dbg_rate_info_v1a_t
  1137. #endif
  1138. typedef struct {
  1139. wlan_dbg_rx_rate_info_v2_t rx_phy_info;
  1140. wlan_dbg_tx_rate_info_v2_t tx_rate_info;
  1141. } wlan_dbg_rate_info_v2_t;
  1142. /*
  1143. * wlan_dbg_stats_v1, _v2:
  1144. * differing versions of the wlan_dbg_stats struct used by different
  1145. * targets
  1146. */
  1147. struct wlan_dbg_stats_v1 {
  1148. struct wlan_dbg_tx_stats_v1 tx;
  1149. struct wlan_dbg_rx_stats_v1 rx;
  1150. struct wlan_dbg_peer_stats peer;
  1151. };
  1152. struct wlan_dbg_stats_v2 {
  1153. struct wlan_dbg_tx_stats_v2 tx;
  1154. struct wlan_dbg_rx_stats_v2 rx;
  1155. struct wlan_dbg_mem_stats mem;
  1156. struct wlan_dbg_peer_stats peer;
  1157. };
  1158. #if defined(AR900B)
  1159. #define wlan_dbg_stats wlan_dbg_stats_v2
  1160. #else
  1161. #define wlan_dbg_stats wlan_dbg_stats_v1
  1162. #endif
  1163. #define DBG_STATS_MAX_HWQ_NUM 10
  1164. #define DBG_STATS_MAX_TID_NUM 20
  1165. #define DBG_STATS_MAX_CONG_NUM 16
  1166. struct wlan_dbg_txq_stats {
  1167. A_UINT16 num_pkts_queued[DBG_STATS_MAX_HWQ_NUM];
  1168. A_UINT16 tid_hw_qdepth[DBG_STATS_MAX_TID_NUM]; /* WAL_MAX_TID is 20 */
  1169. A_UINT16 tid_sw_qdepth[DBG_STATS_MAX_TID_NUM]; /* WAL_MAX_TID is 20 */
  1170. };
  1171. struct wlan_dbg_tidq_stats {
  1172. A_UINT32 wlan_dbg_tid_txq_status;
  1173. struct wlan_dbg_txq_stats txq_st;
  1174. };
  1175. typedef enum {
  1176. WLAN_DBG_DATA_STALL_NONE = 0,
  1177. WLAN_DBG_DATA_STALL_VDEV_PAUSE = 1,
  1178. WLAN_DBG_DATA_STALL_HWSCHED_CMD_FILTER = 2,
  1179. WLAN_DBG_DATA_STALL_HWSCHED_CMD_FLUSH = 3,
  1180. WLAN_DBG_DATA_STALL_RX_REFILL_FAILED = 4,
  1181. WLAN_DBG_DATA_STALL_RX_FCS_LEN_ERROR = 5,
  1182. WLAN_DBG_DATA_STALL_MAC_WDOG_ERRORS = 6, /* Mac watch dog */
  1183. WLAN_DBG_DATA_STALL_PHY_BB_WDOG_ERROR = 7, /* PHY watch dog */
  1184. WLAN_DBG_DATA_STALL_POST_TIM_NO_TXRX_ERROR = 8,
  1185. WLAN_DBG_DATA_STALL_CONSECUTIVE_NON_FLUSH = 9,
  1186. WLAN_DBG_DATA_STALL_CONSECUTIVE_NOACK = 10,
  1187. WLAN_DBG_DATA_STALL_CONSECUTIVE_LT_EXPIRY = 11,
  1188. WLAN_DBG_DATA_STALL_MAX,
  1189. } wlan_dbg_data_stall_type_e;
  1190. typedef enum {
  1191. WLAN_DBG_DATA_STALL_RECOVERY_NONE = 0,
  1192. WLAN_DBG_DATA_STALL_RECOVERY_CONNECT_DISCONNECT,
  1193. WLAN_DBG_DATA_STALL_RECOVERY_CONNECT_MAC_PHY_RESET,
  1194. WLAN_DBG_DATA_STALL_RECOVERY_CONNECT_PDR,
  1195. WLAN_DBG_DATA_STALL_RECOVERY_CONNECT_SSR,
  1196. } wlan_dbg_data_stall_recovery_type_e;
  1197. /*
  1198. * NOTE: If necessary, restore the explicit disabling of CONFIG_160MHZ_SUPPORT
  1199. * See the corresponding comment + pre-processor block at the top of the file.
  1200. */
  1201. #ifdef CONFIG_160MHZ_SUPPORT_UNDEF_WAR
  1202. #define CONFIG_160MHZ_SUPPORT 0
  1203. #undef CONFIG_160MHZ_SUPPORT_UNDEF_WAR
  1204. #endif
  1205. /** MGMT RX REO Changes */
  1206. /* Macros for having versioning info for compatibility check between host and firmware */
  1207. #define MLO_SHMEM_MAJOR_VERSION 1
  1208. #define MLO_SHMEM_MINOR_VERSION 1
  1209. /** Helper Macros for tlv header of the given tlv buffer */
  1210. /* Size of the TLV Header which is the Tag and Length fields */
  1211. #define MLO_SHMEM_TLV_HDR_SIZE (1 * sizeof(A_UINT32))
  1212. /* TLV Helper macro to get the TLV Header given the pointer to the TLV buffer. */
  1213. #define MLO_SHMEMTLV_GET_HDR(tlv_buf) (((A_UINT32 *) (tlv_buf))[0])
  1214. /* TLV Helper macro to set the TLV Header given the pointer to the TLV buffer. */
  1215. #define MLO_SHMEMTLV_SET_HDR(tlv_buf, tag, len) \
  1216. (((A_UINT32 *)(tlv_buf))[0]) = ((tag << 16) | (len & 0x0000FFFF))
  1217. /* TLV Helper macro to get the TLV Tag given the TLV header. */
  1218. #define MLO_SHMEMTLV_GET_TLVTAG(tlv_header) ((A_UINT32)((tlv_header) >> 16))
  1219. /*
  1220. * TLV Helper macro to get the TLV Buffer Length (minus TLV header size)
  1221. * given the TLV header.
  1222. */
  1223. #define MLO_SHMEMTLV_GET_TLVLEN(tlv_header) \
  1224. ((A_UINT32)((tlv_header) & 0x0000FFFF))
  1225. /*
  1226. * TLV Helper macro to get the TLV length from TLV structure size
  1227. * by removing TLV header size.
  1228. */
  1229. #define MLO_SHMEMTLV_GET_STRUCT_TLVLEN(tlv_struct) \
  1230. ((A_UINT32)(sizeof(tlv_struct)-MLO_SHMEM_TLV_HDR_SIZE))
  1231. /**
  1232. * Helper Macros for getting and setting the required number of bits
  1233. * from the TLV params.
  1234. */
  1235. #define MLO_SHMEM_GET_BITS(_val,_index,_num_bits) \
  1236. (((_val) >> (_index)) & ((1 << (_num_bits)) - 1))
  1237. #define MLO_SHMEM_SET_BITS(_var,_index,_num_bits,_val) \
  1238. do { \
  1239. (_var) &= ~(((1 << (_num_bits)) - 1) << (_index)); \
  1240. (_var) |= (((_val) & ((1 << (_num_bits)) - 1)) << (_index)); \
  1241. } while (0)
  1242. /** Definition of the GLB_H_SHMEM arena tlv structures */
  1243. typedef enum {
  1244. MLO_SHMEM_TLV_STRUCT_MGMT_RX_REO_SNAPSHOT,
  1245. MLO_SHMEM_TLV_STRUCT_MLO_GLB_RX_REO_PER_LINK_SNAPSHOT_INFO,
  1246. MLO_SHMEM_TLV_STRUCT_MLO_GLB_RX_REO_SNAPSHOT_INFO,
  1247. MLO_SHMEM_TLV_STRUCT_MLO_GLB_LINK,
  1248. MLO_SHMEM_TLV_STRUCT_MLO_GLB_LINK_INFO,
  1249. MLO_SHMEM_TLV_STRUCT_MLO_GLB_H_SHMEM,
  1250. MLO_SHMEM_TLV_STRUCT_MLO_GLB_CHIP_CRASH_INFO,
  1251. MLO_SHMEM_TLV_STRUCT_MLO_GLB_PER_CHIP_CRASH_INFO,
  1252. } MLO_SHMEM_TLV_TAG_ID;
  1253. /** Helper macro for params GET/SET of mgmt_rx_reo_snapshot */
  1254. #define MLO_SHMEM_MGMT_RX_REO_SNAPSHOT_PARAM_VALID_GET(mgmt_rx_reo_snapshot_low) MLO_SHMEM_GET_BITS(mgmt_rx_reo_snapshot_low, 0, 1)
  1255. #define MLO_SHMEM_MGMT_RX_REO_SNAPSHOT_PARAM_VALID_SET(mgmt_rx_reo_snapshot_low, value) MLO_SHMEM_SET_BITS(mgmt_rx_reo_snapshot_low, 0, 1, value)
  1256. #define MLO_SHMEM_MGMT_RX_REO_SNAPSHOT_PARAM_MGMT_PKT_CTR_GET(mgmt_rx_reo_snapshot_low) MLO_SHMEM_GET_BITS(mgmt_rx_reo_snapshot_low, 1, 16)
  1257. #define MLO_SHMEM_MGMT_RX_REO_SNAPSHOT_PARAM_MGMT_PKT_CTR_SET(mgmt_rx_reo_snapshot_low, value) MLO_SHMEM_SET_BITS(mgmt_rx_reo_snapshot_low, 1, 16, value)
  1258. #define MLO_SHMEM_MGMT_RX_REO_SNAPSHOT_PARAM_GLOBAL_TIMESTAMP_GET(mgmt_rx_reo_snapshot) \
  1259. (MLO_SHMEM_GET_BITS(mgmt_rx_reo_snapshot->mgmt_rx_reo_snapshot_high, 0, 17) << 15) | \
  1260. MLO_SHMEM_GET_BITS(mgmt_rx_reo_snapshot->mgmt_rx_reo_snapshot_low, 17, 15)
  1261. #define MLO_SHMEM_MGMT_RX_REO_SNAPSHOT_PARAM_GLOBAL_TIMESTAMP_SET(mgmt_rx_reo_snapshot, value) \
  1262. do { \
  1263. MLO_SHMEM_SET_BITS(mgmt_rx_reo_snapshot->mgmt_rx_reo_snapshot_high, 0, 17, ((value) >> 15)); \
  1264. MLO_SHMEM_SET_BITS(mgmt_rx_reo_snapshot->mgmt_rx_reo_snapshot_low, 17, 15, ((value) & 0x7fff)); \
  1265. } while (0)
  1266. #define MLO_SHMEM_MGMT_RX_REO_SNAPSHOT_PARAM_MGMT_PKT_CTR_REDUNDANT_GET(mgmt_rx_reo_snapshot_high) MLO_SHMEM_GET_BITS(mgmt_rx_reo_snapshot_high, 17, 15)
  1267. #define MLO_SHMEM_MGMT_RX_REO_SNAPSHOT_PARAM_MGMT_PKT_CTR_REDUNDANT_SET(mgmt_rx_reo_snapshot_high, value) MLO_SHMEM_SET_BITS(mgmt_rx_reo_snapshot_high, 17, 15, value)
  1268. #define MLO_SHMEM_MGMT_RX_REO_SNAPSHOT_IS_CONSISTENT(mgmt_pkt_ctr, mgmt_pkt_ctr_redundant) \
  1269. (MLO_SHMEM_GET_BITS(mgmt_pkt_ctr, 0, 15) == MLO_SHMEM_GET_BITS(mgmt_pkt_ctr_redundant, 0, 15))
  1270. #define MLO_SHMEM_MGMT_RX_REO_SNAPSHOT_PARAM_GLOBAL_TIMESTAMP_GET_FROM_DWORDS(mgmt_rx_reo_snapshot_low,mgmt_rx_reo_snapshot_high) \
  1271. (MLO_SHMEM_GET_BITS((mgmt_rx_reo_snapshot_high), 0, 17) << 15) | \
  1272. MLO_SHMEM_GET_BITS((mgmt_rx_reo_snapshot_low), 17, 15)
  1273. #define MLO_SHMEM_MGMT_RX_REO_SNAPSHOT_GET_ADRESS(mgmt_rx_reo_snapshot) \
  1274. (&mgmt_rx_reo_snapshot->mgmt_rx_reo_snapshot_low)
  1275. /* REO snapshot structure */
  1276. typedef struct {
  1277. /* TLV tag and len; tag equals MLO_SHMEM_TLV_STRUCT_MGMT_RX_REO_SNAPSHOT */
  1278. A_UINT32 tlv_header;
  1279. A_UINT32 reserved_alignment_padding;
  1280. /**
  1281. * mgmt_rx_reo_snapshot_low
  1282. *
  1283. * [0]: valid
  1284. * [16:1]: mgmt_pkt_ctr
  1285. * [31:17]: global_timestamp_low
  1286. */
  1287. A_UINT32 mgmt_rx_reo_snapshot_low;
  1288. /**
  1289. * mgmt_rx_reo_snapshot_high
  1290. *
  1291. * [16:0]: global_timestamp_high
  1292. * [31:17]: mgmt_pkt_ctr_redundant
  1293. */
  1294. A_UINT32 mgmt_rx_reo_snapshot_high;
  1295. } mgmt_rx_reo_snapshot;
  1296. A_COMPILE_TIME_ASSERT(check_mgmt_rx_reo_snapshot_8byte_size_quantum,
  1297. (((sizeof(mgmt_rx_reo_snapshot) % sizeof(A_UINT64) == 0x0))));
  1298. A_COMPILE_TIME_ASSERT(verify_mgmt_rx_reo_snapshot_low_offset,
  1299. (A_OFFSETOF(mgmt_rx_reo_snapshot, mgmt_rx_reo_snapshot_low) % sizeof(A_UINT64) == 0));
  1300. typedef struct {
  1301. /* TLV tag and len; tag equals MLO_SHMEM_TLV_STRUCT_MLO_GLB_RX_REO_PER_LINK_SNAPSHOT_INFO */
  1302. A_UINT32 tlv_header;
  1303. A_UINT32 reserved_alignment_padding;
  1304. mgmt_rx_reo_snapshot fw_consumed;
  1305. mgmt_rx_reo_snapshot fw_forwarded;
  1306. mgmt_rx_reo_snapshot hw_forwarded;
  1307. } mlo_glb_rx_reo_per_link_snapshot_info;
  1308. A_COMPILE_TIME_ASSERT(check_mlo_glb_rx_reo_per_link_snapshot_info_8byte_size_quantum,
  1309. (((sizeof(mlo_glb_rx_reo_per_link_snapshot_info) % sizeof(A_UINT64) == 0x0))));
  1310. A_COMPILE_TIME_ASSERT(verify_mlo_glb_rx_reo_per_link_snapshot_fw_consumed_offset,
  1311. (A_OFFSETOF(mlo_glb_rx_reo_per_link_snapshot_info, fw_consumed) % sizeof(A_UINT64) == 0));
  1312. /** Helper macro for params GET/SET of mlo_glb_rx_reo_snapshot_info */
  1313. #define MLO_SHMEM_GLB_RX_REO_SNAPSHOT_PARAM_NO_OF_LINKS_GET(link_info) MLO_SHMEM_GET_BITS(link_info, 0, 4)
  1314. #define MLO_SHMEM_GLB_RX_REO_SNAPSHOT_PARAM_NO_OF_LINKS_SET(link_info, value) MLO_SHMEM_SET_BITS(link_info, 0, 4, value)
  1315. #define MLO_SHMEM_GLB_RX_REO_SNAPSHOT_PARAM_VALID_LINK_BMAP_GET(link_info) MLO_SHMEM_GET_BITS(link_info, 4, 16)
  1316. #define MLO_SHMEM_GLB_RX_REO_SNAPSHOT_PARAM_VALID_LINK_BMAP_SET(link_info, value) MLO_SHMEM_SET_BITS(link_info, 4, 16, value)
  1317. /* Definition of the complete REO snapshot info */
  1318. typedef struct {
  1319. /* TLV tag and len; tag equals MLO_SHMEM_TLV_STRUCT_MLO_GLB_RX_REO_SNAPSHOT_INFO */
  1320. A_UINT32 tlv_header;
  1321. /**
  1322. * link_info
  1323. *
  1324. * [3:0]: no_of_links
  1325. * [19:4]: valid_link_bmap
  1326. * [31:20]: reserved
  1327. */
  1328. A_UINT32 link_info;
  1329. /* This TLV is followed by array of mlo_glb_rx_reo_per_link_snapshot_info:
  1330. * mlo_glb_rx_reo_per_link_snapshot_info will have multiple instances
  1331. * equal to num of hw links received by no_of_link
  1332. * mlo_glb_rx_reo_per_link_snapshot_info per_link_info[];
  1333. */
  1334. } mlo_glb_rx_reo_snapshot_info;
  1335. A_COMPILE_TIME_ASSERT(check_mlo_glb_rx_reo_snapshot_info_8byte_size_quantum,
  1336. (((sizeof(mlo_glb_rx_reo_snapshot_info) % sizeof(A_UINT64) == 0x0))));
  1337. /** Helper macro for params GET/SET of mlo_glb_link */
  1338. #define MLO_SHMEM_GLB_LINK_PARAM_LINK_STATUS_GET(link_status) MLO_SHMEM_GET_BITS(link_status, 0, 8)
  1339. #define MLO_SHMEM_GLB_LINK_PARAM_LINK_STATUS_SET(link_status, value) MLO_SHMEM_SET_BITS(link_status, 0, 8, value)
  1340. /*glb link info structures used for scratchpad memory (crash and recovery) */
  1341. typedef struct {
  1342. /* TLV tag and len; tag equals MLO_SHMEM_TLV_STRUCT_MLO_GLB_LINK */
  1343. A_UINT32 tlv_header;
  1344. /**
  1345. * link_status
  1346. *
  1347. * [7:0]: link_status
  1348. * [31:8]: reserved
  1349. */
  1350. A_UINT32 link_status;
  1351. /*
  1352. * Based on MLO timestamp, which is global across chips -
  1353. * this will be first updated when MLO sync is completed.
  1354. */
  1355. A_UINT32 boot_timestamp_low_us;
  1356. A_UINT32 boot_timestamp_high_us;
  1357. /*
  1358. * Based on MLO timestamp, will be updated with a configurable
  1359. * periodicity (default 1 sec)
  1360. */
  1361. A_UINT32 health_check_timestamp_low_us;
  1362. A_UINT32 health_check_timestamp_high_us;
  1363. } mlo_glb_link;
  1364. A_COMPILE_TIME_ASSERT(check_mlo_glb_link_8byte_size_quantum,
  1365. (((sizeof(mlo_glb_link) % sizeof(A_UINT64) == 0x0))));
  1366. A_COMPILE_TIME_ASSERT(verify_mlo_glb_link_boot_timestamp_low_offset,
  1367. (A_OFFSETOF(mlo_glb_link, boot_timestamp_low_us) % sizeof(A_UINT64) == 0));
  1368. A_COMPILE_TIME_ASSERT(verify_mlo_glb_link_health_check_timestamp_low_offset,
  1369. (A_OFFSETOF(mlo_glb_link, health_check_timestamp_low_us) % sizeof(A_UINT64) == 0));
  1370. /** Helper macro for params GET/SET of mlo_glb_link_info */
  1371. #define MLO_SHMEM_GLB_LINK_INFO_PARAM_NO_OF_LINKS_GET(link_info) MLO_SHMEM_GET_BITS(link_info, 0, 4)
  1372. #define MLO_SHMEM_GLB_LINK_INFO_PARAM_NO_OF_LINKS_SET(link_info, value) MLO_SHMEM_SET_BITS(link_info, 0, 4, value)
  1373. #define MLO_SHMEM_GLB_LINK_INFO_PARAM_VALID_LINK_BMAP_GET(link_info) MLO_SHMEM_GET_BITS(link_info, 4, 16)
  1374. #define MLO_SHMEM_GLB_LINK_INFO_PARAM_VALID_LINK_BMAP_SET(link_info, value) MLO_SHMEM_SET_BITS(link_info, 4, 16, value)
  1375. typedef struct {
  1376. /* TLV tag and len; tag equals MLO_SHMEM_TLV_STRUCT_MLO_GLB_LINK_INFO */
  1377. A_UINT32 tlv_header;
  1378. /**
  1379. * link_info
  1380. *
  1381. * [3:0]: no_of_links
  1382. * [19:4]: valid_link_bmap
  1383. * [31:20]: reserved
  1384. */
  1385. A_UINT32 link_info;
  1386. /* This TLV is followed by array of mlo_glb_link:
  1387. * mlo_glb_link will have mutiple instances equal to num of hw links
  1388. * received by no_of_link
  1389. * mlo_glb_link glb_link_info[];
  1390. */
  1391. } mlo_glb_link_info;
  1392. A_COMPILE_TIME_ASSERT(check_mlo_glb_link_info_8byte_size_quantum,
  1393. (((sizeof(mlo_glb_link_info) % sizeof(A_UINT64) == 0x0))));
  1394. typedef enum {
  1395. MLO_SHMEM_CRASH_PARTNER_CHIPS = 1,
  1396. } MLO_SHMEM_CHIP_CRASH_REASON;
  1397. /* glb link info structures used for scratchpad memory (crash and recovery) */
  1398. typedef struct {
  1399. /* TLV tag and len; tag equals MLO_SHMEM_TLV_STRUCT_MLO_GLB_PER_CHIP_CRASH_INFO */
  1400. A_UINT32 tlv_header;
  1401. /**
  1402. * crash reason, takes value in enum MLO_SHMEM_CHIP_CRASH_REASON
  1403. */
  1404. A_UINT32 crash_reason;
  1405. } mlo_glb_per_chip_crash_info;
  1406. A_COMPILE_TIME_ASSERT(check_mlo_glb_per_chip_crash_info,
  1407. (((sizeof(mlo_glb_per_chip_crash_info) % sizeof(A_UINT64) == 0x0))));
  1408. /** Helper macro for params GET/SET of mlo_glb_chip_crash_info */
  1409. #define MLO_SHMEM_CHIP_CRASH_INFO_PARAM_NO_OF_CHIPS_GET(chip_info) MLO_SHMEM_GET_BITS(chip_info, 0, 2)
  1410. #define MLO_SHMEM_CHIP_CRASH_INFO_PARAM_NO_OF_CHIPS_SET(chip_info, value) MLO_SHMEM_SET_BITS(chip_info, 0, 2, value)
  1411. #define MLO_SHMEM_CHIP_CRASH_INFO_PARAM_VALID_CHIP_BMAP_GET(chip_info) MLO_SHMEM_GET_BITS(chip_info, 2, 3)
  1412. #define MLO_SHMEM_CHIP_CRASH_INFO_PARAM_VALID_CHIP_BMAP_SET(chip_info, value) MLO_SHMEM_SET_BITS(chip_info, 2, 3, value)
  1413. typedef struct {
  1414. /* TLV tag and len; tag equals MLO_SHMEM_TLV_STRUCT_MLO_GLB_CHIP_CRASH_INFO */
  1415. A_UINT32 tlv_header;
  1416. /**
  1417. * chip_info
  1418. *
  1419. * [1:0]: no_of_chips
  1420. * [4:2]: valid_chip_bmap
  1421. * [31:6]: reserved
  1422. */
  1423. A_UINT32 chip_info;
  1424. /* This TLV is followed by array of mlo_glb_per_chip_crash_info:
  1425. * mlo_glb_per_chip_crash_info will have mutiple instances equal to num of partner chips
  1426. * received by no_of_chips
  1427. * mlo_glb_per_chip_crash_info per_chip_crash_info[];
  1428. */
  1429. } mlo_glb_chip_crash_info;
  1430. A_COMPILE_TIME_ASSERT(check_mlo_glb_chip_crash_info,
  1431. (((sizeof(mlo_glb_chip_crash_info) % sizeof(A_UINT64) == 0x0))));
  1432. /** Helper macro for params GET/SET of mlo_glb_h_shmem */
  1433. #define MLO_SHMEM_GLB_H_SHMEM_PARAM_MINOR_VERSION_GET(major_minor_version) MLO_SHMEM_GET_BITS(major_minor_version, 0, 16)
  1434. #define MLO_SHMEM_GLB_H_SHMEM_PARAM_MINOR_VERSION_SET(major_minor_version, value) MLO_SHMEM_SET_BITS(major_minor_version, 0, 16, value)
  1435. #define MLO_SHMEM_GLB_H_SHMEM_PARAM_MAJOR_VERSION_GET(major_minor_version) MLO_SHMEM_GET_BITS(major_minor_version, 16, 16)
  1436. #define MLO_SHMEM_GLB_H_SHMEM_PARAM_MAJOR_VERSION_SET(major_minor_version, value) MLO_SHMEM_SET_BITS(major_minor_version, 16, 16, value)
  1437. /* Definition of Global H SHMEM Arena */
  1438. typedef struct {
  1439. /* TLV tag and len; tag equals MLO_SHMEM_TLV_STRUCT_MLO_GLB_H_SHMEM */
  1440. A_UINT32 tlv_header;
  1441. /**
  1442. * major_minor_version
  1443. *
  1444. * [15:0]: minor version
  1445. * [31:16]: major version
  1446. */
  1447. A_UINT32 major_minor_version;
  1448. /* This TLV is followed by TLVs
  1449. * mlo_glb_rx_reo_snapshot_info reo_snapshot;
  1450. * mlo_glb_link_info glb_info;
  1451. * mlo_glb_chip_crash_info crash_info;
  1452. */
  1453. } mlo_glb_h_shmem;
  1454. A_COMPILE_TIME_ASSERT(check_mlo_glb_h_shmem_8byte_size_quantum,
  1455. (((sizeof(mlo_glb_h_shmem) % sizeof(A_UINT64) == 0x0))));
  1456. #endif /* __WLANDEFS_H__ */