htt_ppdu_stats.h 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700
  1. /*
  2. * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * @file htt_ppdu_stats.h
  20. *
  21. * @details the public header file of HTT STATS
  22. */
  23. #ifndef __HTT_PPDU_STATS_H__
  24. #define __HTT_PPDU_STATS_H__
  25. #include <htt.h>
  26. #include <htt_stats.h>
  27. #define HTT_BA_64_BIT_MAP_SIZE_DWORDS 2
  28. #define HTT_BA_256_BIT_MAP_SIZE_DWORDS 8
  29. enum htt_ppdu_stats_tlv_tag {
  30. HTT_PPDU_STATS_COMMON_TLV,
  31. HTT_PPDU_STATS_USR_COMMON_TLV,
  32. HTT_PPDU_STATS_USR_RATE_TLV,
  33. HTT_PPDU_STATS_USR_MPDU_ENQ_BITMAP_64_TLV,
  34. HTT_PPDU_STATS_USR_MPDU_ENQ_BITMAP_256_TLV,
  35. HTT_PPDU_STATS_SCH_CMD_STATUS_TLV,
  36. HTT_PPDU_STATS_USR_COMPLTN_COMMON_TLV,
  37. HTT_PPDU_STATS_USR_COMPLTN_BA_BITMAP_64_TLV,
  38. HTT_PPDU_STATS_USR_COMPLTN_BA_BITMAP_256_TLV,
  39. HTT_PPDU_STATS_USR_COMPLTN_ACK_BA_STATUS_TLV,
  40. HTT_PPDU_STATS_USR_COMPLTN_FLUSH_TLV,
  41. HTT_PPDU_STATS_USR_COMMON_ARRAY_TLV,
  42. HTT_PPDU_STATS_INFO_TLV,
  43. HTT_PPDU_STATS_TX_MGMTCTRL_PAYLOAD_TLV,
  44. /* New TLV's are added above to this line */
  45. HTT_PPDU_STATS_MAX_TAG,
  46. };
  47. typedef enum htt_ppdu_stats_tlv_tag htt_ppdu_stats_tlv_tag_t;
  48. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_M 0x000000ff
  49. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_S 0
  50. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_GET(_var) \
  51. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_M) >> \
  52. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_S)
  53. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_SET(_var, _val) \
  54. do { \
  55. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE, _val); \
  56. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RATE_S)); \
  57. } while (0)
  58. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_M 0x00000100
  59. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_S 8
  60. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_GET(_var) \
  61. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_M) >> \
  62. HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_S)
  63. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_SET(_var, _val) \
  64. do { \
  65. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU, _val); \
  66. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_IS_AMPDU_S)); \
  67. } while (0)
  68. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_M 0x00000600
  69. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_S 9
  70. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_GET(_var) \
  71. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_M) >> \
  72. HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_S)
  73. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_SET(_var, _val) \
  74. do { \
  75. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED, _val); \
  76. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_BA_ACK_FAILED_S)); \
  77. } while (0)
  78. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_M 0x00003800
  79. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_S 11
  80. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_GET(_var) \
  81. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_M) >> \
  82. HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_S)
  83. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_SET(_var, _val) \
  84. do { \
  85. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW, _val); \
  86. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_BW_S)); \
  87. } while (0)
  88. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_M 0x00004000
  89. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_S 14
  90. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_GET(_var) \
  91. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_M) >> \
  92. HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_S)
  93. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_SET(_var, _val) \
  94. do { \
  95. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI, _val); \
  96. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_SGI_S)); \
  97. } while (0)
  98. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_M 0x00008000
  99. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S 15
  100. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_GET(_var) \
  101. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_M) >> \
  102. HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S)
  103. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_SET(_var, _val) \
  104. do { \
  105. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR, _val); \
  106. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_SR_S)); \
  107. } while (0)
  108. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_M 0xffff0000
  109. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_S 16
  110. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_GET(_var) \
  111. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_M) >> \
  112. HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_S)
  113. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_SET(_var, _val) \
  114. do { \
  115. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID, _val); \
  116. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_PEERID_S)); \
  117. } while (0)
  118. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_M 0x0000ffff
  119. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_S 0
  120. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_GET(_var) \
  121. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_M) >> \
  122. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_S)
  123. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_SET(_var, _val) \
  124. do { \
  125. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS, _val); \
  126. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_SUCC_MSDUS_S)); \
  127. } while (0)
  128. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_M 0xffff0000
  129. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_S 16
  130. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_GET(_var) \
  131. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_M) >> \
  132. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_S)
  133. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_SET(_var, _val) \
  134. do { \
  135. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS, _val); \
  136. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_RETRY_MSDUS_S)); \
  137. } while (0)
  138. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_M 0x0000ffff
  139. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_S 0
  140. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_GET(_var) \
  141. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_M) >> \
  142. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_S)
  143. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_SET(_var, _val) \
  144. do { \
  145. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS, _val); \
  146. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_FAILED_MSDUS_S)); \
  147. } while (0)
  148. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_M 0xffff0000
  149. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_S 16
  150. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_GET(_var) \
  151. (((_var) & HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_M) >> \
  152. HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_S)
  153. #define HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_SET(_var, _val) \
  154. do { \
  155. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR, _val); \
  156. ((_var) |= ((_val) << HTT_PPDU_STATS_ARRAY_ITEM_TLV_TX_DUR_S)); \
  157. } while (0)
  158. PREPACK struct htt_tx_ppdu_stats_info {
  159. htt_tlv_hdr_t tlv_hdr;
  160. A_UINT32 tx_success_bytes;
  161. A_UINT32 tx_retry_bytes;
  162. A_UINT32 tx_failed_bytes;
  163. A_UINT32 tx_ratecode: 8,
  164. is_ampdu: 1,
  165. ba_ack_failed: 2,
  166. /* 0: 20 MHz
  167. 1: 40 MHz
  168. 2: 80 MHz
  169. 3: 160 MHz or 80+80 MHz */
  170. bw: 3,
  171. sgi: 1,
  172. skipped_rate_ctrl: 1,
  173. peer_id: 16;
  174. A_UINT32 tx_success_msdus: 16,
  175. tx_retry_msdus: 16;
  176. A_UINT32 tx_failed_msdus: 16,
  177. /* united in us */
  178. tx_duration: 16;
  179. /*
  180. * 1 in bit 0 of valid_bitmap represents that bitmap itself is valid.
  181. * If the bitmap is valid (i.e. bit 0 is set), then check the other bits
  182. * of bitmap to know which fields within htt_tx_ppdu_stats_info are valid.
  183. * If bit 1 is set, tx_success_bytes is valid
  184. * If bit 2 is set, tx_retry_bytes is valid
  185. * ...
  186. * If bit 14 is set, tx_duration is valid
  187. */
  188. A_UINT32 valid_bitmap;
  189. } POSTPACK;
  190. typedef struct {
  191. htt_tlv_hdr_t tlv_hdr;
  192. A_UINT32 number_of_ppdu_stats;
  193. /*
  194. * tx_ppdu_stats_info is filled by multiple struct htt_tx_ppdu_stats_info
  195. * elements.
  196. * tx_ppdu_stats_info is variable length, with length =
  197. * number_of_ppdu_stats * sizeof (struct htt_tx_ppdu_stats_info)
  198. */
  199. A_UINT32 tx_ppdu_stats_info[1/*number_of_ppdu_stats*/];
  200. } htt_ppdu_stats_usr_common_array_tlv_v;
  201. typedef struct {
  202. htt_tlv_hdr_t tlv_hdr;
  203. /* Refer bmi_msg.h */
  204. A_UINT32 target_type;
  205. A_UINT32 hw[1]; /* Variable length, refer to struct scheduler_cmd_status */
  206. } htt_ppdu_stats_sch_cmd_tlv_v;
  207. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_M 0x0000ffff
  208. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_S 0
  209. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_GET(_var) \
  210. (((_var) & HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_M) >> \
  211. HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_S)
  212. #define HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_SET(_var, _val) \
  213. do { \
  214. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID, _val); \
  215. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_SCH_CMDID_S)); \
  216. } while (0)
  217. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_M 0x00ff0000
  218. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_S 16
  219. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_GET(_var) \
  220. (((_var) & HTT_PPDU_STATS_COMMON_TLV_RING_ID_M) >> \
  221. HTT_PPDU_STATS_COMMON_TLV_RING_ID_S)
  222. #define HTT_PPDU_STATS_COMMON_TLV_RING_ID_SET(_var, _val) \
  223. do { \
  224. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_RING_ID, _val); \
  225. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_RING_ID_S)); \
  226. } while (0)
  227. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_M 0xff000000
  228. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_S 24
  229. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_GET(_var) \
  230. (((_var) & HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_M) >> \
  231. HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_S)
  232. #define HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_SET(_var, _val) \
  233. do { \
  234. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_NUM_USERS, _val); \
  235. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_NUM_USERS_S)); \
  236. } while (0)
  237. /* HW queue type */
  238. enum HTT_TX_QUEUE_TYPE {
  239. HTT_TX_QUEUE_INACTIVE,
  240. HTT_TX_QUEUE_DATA,
  241. HTT_TX_QUEUE_BEACON,
  242. HTT_TX_QUEUE_PSPOLL,
  243. HTT_TX_QUEUE_CAB,
  244. HTT_TX_QUEUE_HALPHY,
  245. HTT_TX_QUEUE_QBOOST_RESP,
  246. HTT_TX_QUEUE_NAN_BEACON,
  247. HTT_TX_QUEUE_NAN_MGMT,
  248. HTT_TX_QUEUE_UL_DATA,
  249. HTT_TX_QUEUE_UL_BSR_RESP,
  250. HTT_TX_QUEUE_MGMT,
  251. HTT_TX_QUEUE_MAX,
  252. };
  253. typedef enum HTT_TX_QUEUE_TYPE HTT_TX_QUEUE_TYPE;
  254. /* frame_type */
  255. enum HTT_STATS_FTYPE {
  256. HTT_STATS_FTYPE_SGEN_NDPA = 0,
  257. HTT_STATS_FTYPE_SGEN_NDP,
  258. HTT_STATS_FTYPE_SGEN_BRP,
  259. HTT_STATS_FTYPE_SGEN_BAR,
  260. HTT_STATS_FTYPE_SGEN_RTS,
  261. HTT_STATS_FTYPE_SGEN_CTS,
  262. HTT_STATS_FTYPE_SGEN_CFEND,
  263. HTT_STATS_FTYPE_SGEN_AX_NDPA,
  264. HTT_STATS_FTYPE_SGEN_AX_NDP,
  265. HTT_STATS_FTYPE_SGEN_MU_TRIG,
  266. HTT_STATS_FTYPE_SGEN_MU_BAR,
  267. HTT_STATS_FTYPE_SGEN_MU_BRP,
  268. HTT_STATS_FTYPE_SGEN_MU_RTS,
  269. HTT_STATS_FTYPE_SGEN_MU_BSR,
  270. HTT_STATS_FTYPE_SGEN_UL_BSR,
  271. HTT_STATS_FTYPE_SGEN_UL_BSR_TRIGGER = HTT_STATS_FTYPE_SGEN_UL_BSR, /*alias*/
  272. HTT_STATS_FTYPE_TIDQ_DATA_SU,
  273. HTT_STATS_FTYPE_TIDQ_DATA_MU,
  274. HTT_STATS_FTYPE_SGEN_UL_BSR_RESP,
  275. HTT_STATS_FTYPE_SGEN_QOS_NULL,
  276. HTT_STATS_FTYPE_MAX,
  277. };
  278. typedef enum HTT_STATS_FTYPE HTT_STATS_FTYPE;
  279. /* FRM_TYPE defined in HTT_STATS_FTYPE */
  280. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_M 0x000000ff
  281. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_S 0
  282. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_GET(_var) \
  283. (((_var) & HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_M) >> \
  284. HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_S)
  285. #define HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_SET(_var, _val) \
  286. do { \
  287. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE, _val); \
  288. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_FRM_TYPE_S)); \
  289. } while (0)
  290. /* QTYPE defined in HTT_TX_QUEUE_TYPE */
  291. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_M 0x0000ff00
  292. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_S 8
  293. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_GET(_var) \
  294. (((_var) & HTT_PPDU_STATS_COMMON_TLV_QTYPE_M) >> \
  295. HTT_PPDU_STATS_COMMON_TLV_QTYPE_S)
  296. #define HTT_PPDU_STATS_COMMON_TLV_QTYPE_SET(_var, _val) \
  297. do { \
  298. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_QTYPE, _val); \
  299. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_QTYPE_S)); \
  300. } while (0)
  301. enum HTT_PPDU_STATS_BW {
  302. HTT_PPDU_STATS_BANDWIDTH_5MHZ = 0,
  303. HTT_PPDU_STATS_BANDWIDTH_10MHZ = 1,
  304. HTT_PPDU_STATS_BANDWIDTH_20MHZ = 2,
  305. HTT_PPDU_STATS_BANDWIDTH_40MHZ = 3,
  306. HTT_PPDU_STATS_BANDWIDTH_80MHZ = 4,
  307. HTT_PPDU_STATS_BANDWIDTH_160MHZ = 5, /* includes 80+80 */
  308. HTT_PPDU_STATS_BANDWIDTH_DYN = 6,
  309. };
  310. typedef enum HTT_PPDU_STATS_BW HTT_PPDU_STATS_BW;
  311. enum HTT_PPDU_STATS_SEQ_TYPE {
  312. HTT_SEQTYPE_SU = 0,
  313. HTT_SEQTYPE_AC_MU_MIMO = 1,
  314. HTT_SEQTYPE_AX_MU_MIMO = 2,
  315. HTT_SEQTYPE_MU_OFDMA = 3,
  316. HTT_SEQTYPE_UL_TRIG = 4,
  317. HTT_SEQTYPE_BURST_BCN = 5,
  318. HTT_SEQTYPE_UL_BSR_RESP = 6,
  319. HTT_SEQTYPE_UL_BSR_TRIG = 7,
  320. HTT_SEQTYPE_UL_RESP = 8,
  321. };
  322. typedef enum HTT_PPDU_STATS_SEQ_TYPE HTT_PPDU_STATS_SEQ_TYPE;
  323. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_M 0x00ff0000
  324. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S 16
  325. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_GET(_var) \
  326. (((_var) & HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_M) >> \
  327. HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S)
  328. #define HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_SET(_var, _val) \
  329. do { \
  330. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE, _val); \
  331. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_PPDU_SEQ_TYPE_S)); \
  332. } while (0)
  333. #define HTT_PPDU_STATS_COMMON_TLV_BW_M 0x000f0000
  334. #define HTT_PPDU_STATS_COMMON_TLV_BW_S 16
  335. #define HTT_PPDU_STATS_COMMON_TLV_BW_GET(_var) \
  336. (((_var) & HTT_PPDU_STATS_COMMON_TLV_BW_M) >> \
  337. HTT_PPDU_STATS_COMMON_TLV_BW_S)
  338. #define HTT_PPDU_STATS_COMMON_TLV_BW_SET(_var, _val) \
  339. do { \
  340. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_BW, _val); \
  341. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_BW_S)); \
  342. } while (0)
  343. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_M 0x0000ffff
  344. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_S 0
  345. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_GET(_var) \
  346. (((_var) & HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_M) >> \
  347. HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_S)
  348. #define HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_SET(_var, _val) \
  349. do { \
  350. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_PHY_MODE, _val); \
  351. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_PHY_MODE_S)); \
  352. } while (0)
  353. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_M 0xffff0000
  354. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_S 16
  355. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_GET(_var) \
  356. (((_var) & HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_M) >> \
  357. HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_S)
  358. #define HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_SET(_var, _val) \
  359. do { \
  360. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ, _val); \
  361. ((_var) |= ((_val) << HTT_PPDU_STATS_COMMON_TLV_CHAN_MHZ_S)); \
  362. } while (0)
  363. typedef struct {
  364. htt_tlv_hdr_t tlv_hdr;
  365. A_UINT32 ppdu_id;
  366. /* BIT [ 15 : 0] :- sched_cmdid
  367. * BIT [ 23 : 16] :- ring_id
  368. * BIT [ 31 : 24] :- num_users
  369. */
  370. union {
  371. A_UINT32 ring_id__sched_cmdid;
  372. struct {
  373. A_UINT32 sched_cmdid: 16,
  374. ring_id: 8,
  375. num_users: 8;
  376. };
  377. };
  378. /* BIT [ 7 : 0] :- frame_type - HTT_STATS_FTYPE
  379. * BIT [ 15: 8] :- queue_type - HTT_TX_QUEUE_TYPE
  380. * BIT [ 19: 16] :- bw - HTT_PPDU_STATS_BW
  381. * BIT [ 27: 20] :- ppdu_seq_type - HTT_PPDU_STATS_SEQ_TYPE
  382. * BIT [ 31: 28] :- reserved
  383. */
  384. union {
  385. A_UINT32 bw__queue_type__frame_type;
  386. A_UINT32 ppdu_seq_type__bw__queue_type__frame_type;
  387. struct {
  388. A_UINT32 frame_type: 8,
  389. queue_type: 8,
  390. bw: 4,
  391. ppdu_seq_type: 8,
  392. reserved0: 4;
  393. };
  394. };
  395. A_UINT32 chain_mask;
  396. A_UINT32 fes_duration_us; /* frame exchange sequence */
  397. A_UINT32 ppdu_sch_eval_start_tstmp_us;
  398. A_UINT32 ppdu_sch_end_tstmp_us;
  399. A_UINT32 ppdu_start_tstmp_us;
  400. /* BIT [15 : 0] - phy mode (WLAN_PHY_MODE) with which ppdu was transmitted
  401. * BIT [31 : 16] - bandwidth (in MHz) with which ppdu was transmitted
  402. */
  403. union {
  404. A_UINT32 chan_mhz__phy_mode;
  405. struct {
  406. A_UINT32 phy_mode: 16,
  407. chan_mhz: 16;
  408. };
  409. };
  410. /*
  411. * The cca_delta_time_us reports the time the tx PPDU in question
  412. * was waiting in the HW tx queue for the clear channel assessment
  413. * to indicate that the transmission could start.
  414. * If this CCA delta time is zero or small, this indicates that the
  415. * air interface was unused prior to the transmission, and thus it's
  416. * improbable that there was a collision with some other transceiver's
  417. * transmission.
  418. * In contrast, a large CCA delta time means that this transceiver had
  419. * to wait a long time for the air interface to be available; it's
  420. * possible that other transceivers were also waiting for the air
  421. * interface to become available, and if the other waiting transceiver's
  422. * CW backoff aligned with this one, to have a transmit collision.
  423. */
  424. A_UINT32 cca_delta_time_us;
  425. /*
  426. * The rxfrm_delta_time_us reports the time the tx PPDU in question
  427. * was waiting in the HW tx queue while there was an ongoing rx,
  428. * either because the rx was already ongoing at the time the tx PPDU
  429. * was enqueued, or because the rx (i.e. the peer's tx) won the air
  430. * interface contention over the local vdev's tx.
  431. */
  432. A_UINT32 rxfrm_delta_time_us;
  433. /*
  434. * The txfrm_delta_time_us reports the time from when the tx PPDU
  435. * in question was enqueued into the HW tx queue until the time the
  436. * tx completion interrupt for the PPDU occurred.
  437. * Thus, the txfrm_delta_time_us incorporates any time the tx PPDU
  438. * had to wait for the air interface to become available, the PPDU
  439. * duration, the block ack reception, and the tx completion interrupt
  440. * latency.
  441. */
  442. A_UINT32 txfrm_delta_time_us;
  443. } htt_ppdu_stats_common_tlv;
  444. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_M 0x000000ff
  445. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_S 0
  446. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_GET(_var) \
  447. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_M) >> \
  448. HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_S)
  449. #define HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_SET(_var, _val) \
  450. do { \
  451. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM, _val); \
  452. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_TID_NUM_S)); \
  453. } while (0)
  454. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_M 0x0000ff00
  455. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_S 8
  456. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_GET(_var) \
  457. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_M) >> \
  458. HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_S)
  459. #define HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_SET(_var, _val) \
  460. do { \
  461. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID, _val); \
  462. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_VAP_ID_S)); \
  463. } while (0)
  464. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_M 0xffff0000
  465. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_S 16
  466. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_GET(_var) \
  467. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_M) >> \
  468. HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_S)
  469. #define HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_SET(_var, _val) \
  470. do { \
  471. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID, _val); \
  472. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_SW_PEER_ID_S)); \
  473. } while (0)
  474. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_M 0x00000001
  475. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_S 0
  476. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_GET(_var) \
  477. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_M) >> \
  478. HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_S)
  479. #define HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_SET(_var, _val) \
  480. do { \
  481. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_MCAST, _val); \
  482. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_MCAST_S)); \
  483. } while (0)
  484. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_M 0x000003fe
  485. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_S 1
  486. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_GET(_var) \
  487. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_M) >> \
  488. HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_S)
  489. #define HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_SET(_var, _val) \
  490. do { \
  491. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED, _val); \
  492. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_MPDUS_TRIED_S)); \
  493. } while (0)
  494. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_M 0x00003c00
  495. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_S 10
  496. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_GET(_var) \
  497. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_BW_M) >> \
  498. HTT_PPDU_STATS_USER_COMMON_TLV_BW_S)
  499. #define HTT_PPDU_STATS_USER_COMMON_TLV_BW_SET(_var, _val) \
  500. do { \
  501. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_BW, _val); \
  502. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_BW_S)); \
  503. } while (0)
  504. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_M 0x00004000
  505. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_S 14
  506. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_GET(_var) \
  507. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_M) >> \
  508. HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_S)
  509. #define HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_SET(_var, _val) \
  510. do { \
  511. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA, _val); \
  512. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_DELAYED_BA_S)); \
  513. } while (0)
  514. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_M 0x0000ffff
  515. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_S 0
  516. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_GET(_var) \
  517. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_M) >> \
  518. HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_S)
  519. #define HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_SET(_var, _val) \
  520. do { \
  521. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL, _val); \
  522. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_FRAME_CTRL_S)); \
  523. } while (0)
  524. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_M 0xffff0000
  525. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_S 16
  526. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_GET(_var) \
  527. (((_var) & HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_M) >> \
  528. HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_S)
  529. #define HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_SET(_var, _val) \
  530. do { \
  531. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL, _val); \
  532. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_COMMON_TLV_QOS_CTRL_S)); \
  533. } while (0)
  534. typedef struct {
  535. htt_tlv_hdr_t tlv_hdr;
  536. /* BIT [ 7 : 0] :- tid_num
  537. * BIT [ 15: 8] :- vap_id
  538. * BIT [ 31: 16] :- sw_peer_id
  539. */
  540. union {
  541. A_UINT32 sw_peer_id__vapid__tid_num;
  542. struct {
  543. A_UINT32 tid_num: 8,
  544. vap_id: 8,
  545. sw_peer_id: 16;
  546. };
  547. };
  548. /* BIT [ 0 : 0] :- mcast
  549. * BIT [ 9 : 1] :- mpdus_tried
  550. * BIT [ 13: 10] :- bw - HTT_PPDU_STATS_BW
  551. * BIT [ 14: 14] : - delayed_ba
  552. * BIT [ 31: 15] :- rsvd
  553. */
  554. union {
  555. A_UINT32 bw__mpdus_tried__mcast;
  556. struct {
  557. A_UINT32 mcast: 1,
  558. mpdus_tried: 9,
  559. bw: 4,
  560. delayed_ba: 1,
  561. reserved0: 17;
  562. };
  563. };
  564. /* BIT [ 15: 0] :- frame_ctrl
  565. * BIT [ 31: 16] :- qos_ctrl
  566. */
  567. union {
  568. A_UINT32 qos_ctrl_frame_ctrl;
  569. struct {
  570. A_UINT32 frame_ctrl: 16,
  571. qos_ctrl: 16;
  572. };
  573. };
  574. } htt_ppdu_stats_user_common_tlv;
  575. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_M 0x000000ff
  576. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_S 0
  577. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_GET(_var) \
  578. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_M) >> \
  579. HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_S)
  580. #define HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_SET(_var, _val) \
  581. do { \
  582. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM, _val); \
  583. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_TID_NUM_S)); \
  584. } while (0)
  585. #define HTT_PPDU_STATS_USER_RATE_TLV_RESERVED_M 0x0000ff00
  586. #define HTT_PPDU_STATS_USER_RATE_TLV_RESERVED_S 8
  587. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_M 0xffff0000
  588. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_S 16
  589. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_GET(_var) \
  590. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_M) >> \
  591. HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_S)
  592. #define HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_SET(_var, _val) \
  593. do { \
  594. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID, _val); \
  595. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_SW_PEER_ID_S)); \
  596. } while (0)
  597. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_M 0x0000000f
  598. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_S 0
  599. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_GET(_var) \
  600. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_M) >> \
  601. HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_S)
  602. #define HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_SET(_var, _val) \
  603. do { \
  604. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_USER_POS, _val); \
  605. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_USER_POS_S)); \
  606. } while (0)
  607. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_M 0x00000ff0
  608. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_S 4
  609. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_GET(_var) \
  610. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_M) >> \
  611. HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_S)
  612. #define HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_SET(_var, _val) \
  613. do { \
  614. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID, _val); \
  615. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_MU_GROUPID_S)); \
  616. } while (0)
  617. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_M 0x0000ffff
  618. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S 0
  619. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_GET(_var) \
  620. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_END_M) >> \
  621. HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S)
  622. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_END_SET(_var, _val) \
  623. do { \
  624. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_END, _val); \
  625. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_END_S)); \
  626. } while (0)
  627. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_M 0xffff0000
  628. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S 16
  629. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_GET(_var) \
  630. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RU_START_M) >> \
  631. HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S)
  632. #define HTT_PPDU_STATS_USER_RATE_TLV_RU_START_SET(_var, _val) \
  633. do { \
  634. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RU_START, _val); \
  635. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RU_START_S)); \
  636. } while (0)
  637. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_M 0x00000001
  638. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_S 0
  639. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_GET(_var) \
  640. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_M) >> \
  641. HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_S)
  642. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_SET(_var, _val) \
  643. do { \
  644. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID, _val); \
  645. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_TYPE_VALID_S)); \
  646. } while (0)
  647. enum HTT_PPDU_STATS_PPDU_TYPE {
  648. HTT_PPDU_STATS_PPDU_TYPE_SU,
  649. HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO,
  650. HTT_PPDU_STATS_PPDU_TYPE_MU_OFDMA,
  651. HTT_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA,
  652. HTT_PPDU_STATS_PPDU_TYPE_UL_TRIG,
  653. HTT_PPDU_STATS_PPDU_TYPE_BURST_BCN,
  654. HTT_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP,
  655. HTT_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG,
  656. HTT_PPDU_STATS_PPDU_TYPE_UL_RESP,
  657. HTT_PPDU_STATS_PPDU_TYPE_UNKNOWN = 0x1F,
  658. };
  659. typedef enum HTT_PPDU_STATS_PPDU_TYPE HTT_PPDU_STATS_PPDU_TYPE;
  660. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_M 0x0000003E
  661. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_S 1
  662. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_GET(_var) \
  663. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_M) >> \
  664. HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_S)
  665. #define HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_SET(_var, _val) \
  666. do { \
  667. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE, _val); \
  668. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_PPDU_TYPE_S)); \
  669. } while (0)
  670. enum HTT_PPDU_STATS_TXBF_TYPE {
  671. HTT_PPDU_STATS_TXBF_OPEN_LOOP,
  672. HTT_PPDU_STATS_TXBF_IMPLICIT,
  673. HTT_PPDU_STATS_TXBF_EXPLICIT,
  674. HTT_PPDU_STATS_TXBF_MAX,
  675. };
  676. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_M 0x00000003
  677. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_S 0
  678. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_GET(_var) \
  679. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_M) >> \
  680. HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_S)
  681. #define HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_SET(_var, _val) \
  682. do { \
  683. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE, _val); \
  684. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_LTF_SIZE_S)); \
  685. } while (0)
  686. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_M 0x00000004
  687. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_S 2
  688. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_GET(_var) \
  689. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_STBC_M) >> \
  690. HTT_PPDU_STATS_USER_RATE_TLV_STBC_S)
  691. #define HTT_PPDU_STATS_USER_RATE_TLV_STBC_SET(_var, _val) \
  692. do { \
  693. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_STBC, _val); \
  694. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_STBC_S)); \
  695. } while (0)
  696. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_M 0x00000008
  697. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_S 3
  698. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_GET(_var) \
  699. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_M) >> \
  700. HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_S)
  701. #define HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_SET(_var, _val) \
  702. do { \
  703. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_HE_RE, _val); \
  704. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_HE_RE_S)); \
  705. } while (0)
  706. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_M 0x000000f0
  707. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_S 4
  708. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_GET(_var) \
  709. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_TXBF_M) >> \
  710. HTT_PPDU_STATS_USER_RATE_TLV_TXBF_S)
  711. #define HTT_PPDU_STATS_USER_RATE_TLV_TXBF_SET(_var, _val) \
  712. do { \
  713. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_TXBF, _val); \
  714. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_TXBF_S)); \
  715. } while (0)
  716. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_M 0x00000f00
  717. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_S 8
  718. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_GET(_var) \
  719. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_BW_M) >> \
  720. HTT_PPDU_STATS_USER_RATE_TLV_BW_S)
  721. #define HTT_PPDU_STATS_USER_RATE_TLV_BW_SET(_var, _val) \
  722. do { \
  723. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_BW, _val); \
  724. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_BW_S)); \
  725. } while (0)
  726. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_M 0x0000f000
  727. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_S 12
  728. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_GET(_var) \
  729. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_NSS_M) >> \
  730. HTT_PPDU_STATS_USER_RATE_TLV_NSS_S)
  731. #define HTT_PPDU_STATS_USER_RATE_TLV_NSS_SET(_var, _val) \
  732. do { \
  733. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_NSS, _val); \
  734. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_NSS_S)); \
  735. } while (0)
  736. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_M 0x000f0000
  737. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_S 16
  738. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_GET(_var) \
  739. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_MCS_M) >> \
  740. HTT_PPDU_STATS_USER_RATE_TLV_MCS_S)
  741. #define HTT_PPDU_STATS_USER_RATE_TLV_MCS_SET(_var, _val) \
  742. do { \
  743. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_MCS, _val); \
  744. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_MCS_S)); \
  745. } while (0)
  746. /* Refer HTT_STATS_PREAM_TYPE */
  747. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_M 0x00f00000
  748. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_S 20
  749. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_GET(_var) \
  750. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_M) >> \
  751. HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_S)
  752. #define HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_SET(_var, _val) \
  753. do { \
  754. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE, _val); \
  755. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_PREAMBLE_S)); \
  756. } while (0)
  757. /* Guard Intervals */
  758. enum HTT_PPDU_STATS_GI {
  759. HTT_PPDU_STATS_GI_800,
  760. HTT_PPDU_STATS_GI_400,
  761. HTT_PPDU_STATS_GI_1600,
  762. HTT_PPDU_STATS_GI_3200,
  763. HTT_PPDU_STATS_GI_CNT,
  764. };
  765. typedef enum HTT_PPDU_STATS_GI HTT_PPDU_STATS_GI;
  766. /* Refer HTT_PPDU_STATS_GI */
  767. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_M 0x0f000000
  768. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_S 24
  769. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_GET(_var) \
  770. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_GI_M) >> \
  771. HTT_PPDU_STATS_USER_RATE_TLV_GI_S)
  772. #define HTT_PPDU_STATS_USER_RATE_TLV_GI_SET(_var, _val) \
  773. do { \
  774. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_GI, _val); \
  775. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_GI_S)); \
  776. } while (0)
  777. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_M 0x10000000
  778. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_S 28
  779. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_GET(_var) \
  780. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_DCM_M) >> \
  781. HTT_PPDU_STATS_USER_RATE_TLV_DCM_S)
  782. #define HTT_PPDU_STATS_USER_RATE_TLV_DCM_SET(_var, _val) \
  783. do { \
  784. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_DCM, _val); \
  785. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_DCM_S)); \
  786. } while (0)
  787. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_M 0x20000000
  788. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_S 29
  789. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_GET(_var) \
  790. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_LDPC_M) >> \
  791. HTT_PPDU_STATS_USER_RATE_TLV_LDPC_S)
  792. #define HTT_PPDU_STATS_USER_RATE_TLV_LDPC_SET(_var, _val) \
  793. do { \
  794. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_LDPC, _val); \
  795. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_LDPC_S)); \
  796. } while (0)
  797. enum HTT_PPDU_STATS_RESP_PPDU_TYPE {
  798. HTT_PPDU_STATS_RESP_PPDU_TYPE_MU_MIMO_UL,
  799. HTT_PPDU_STATS_RESP_PPDU_TYPE_MU_OFDMA_UL,
  800. };
  801. typedef enum HTT_PPDU_STATS_RESP_PPDU_TYPE HTT_PPDU_STATS_RESP_PPDU_TYPE;
  802. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_M 0xC0000000
  803. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_S 30
  804. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_GET(_var) \
  805. (((_var) & HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_M) >> \
  806. HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_S)
  807. #define HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_SET(_var, _val) \
  808. do { \
  809. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE, _val); \
  810. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_RATE_TLV_RESP_PPDU_TYPE_S)); \
  811. } while (0)
  812. typedef struct {
  813. htt_tlv_hdr_t tlv_hdr;
  814. /* BIT [ 7 : 0] :- tid_num
  815. * BIT [ 15: 8] :- reserved0
  816. * BIT [ 31: 16] :- sw_peer_id
  817. */
  818. union {
  819. A_UINT32 sw_peer_id__tid_num;
  820. struct {
  821. A_UINT32 tid_num: 8,
  822. reserved0: 8,
  823. sw_peer_id: 16;
  824. };
  825. };
  826. /* BIT [ 3 : 0] :- user_pos
  827. * BIT [ 11: 4] :- mu_group_id
  828. * BIT [ 31: 12] :- reserved1
  829. */
  830. union {
  831. A_UINT32 mu_group_id__user_pos;
  832. struct {
  833. A_UINT32 user_pos: 4,
  834. mu_group_id: 8,
  835. reserved1: 20;
  836. };
  837. };
  838. /* BIT [ 15 : 0] :- ru_end
  839. * BIT [ 31 : 16] :- ru_start
  840. */
  841. union {
  842. A_UINT32 ru_start__ru_end;
  843. struct {
  844. A_UINT32 ru_end: 16,
  845. ru_start: 16;
  846. };
  847. };
  848. /* BIT [ 15 : 0] :- ru_end
  849. * BIT [ 31 : 16] :- ru_start
  850. */
  851. union {
  852. A_UINT32 resp_ru_start__ru_end;
  853. struct {
  854. A_UINT32 resp_ru_end: 16,
  855. resp_ru_start: 16;
  856. };
  857. };
  858. /* BIT [ 0 : 0 ] :- resp_type_valid
  859. * BIT [ 5 : 1 ] :- ppdu_type - HTT_PPDU_STAT_PPDU_TYPE
  860. * BIT [ 31: 6 ] :- reserved2
  861. */
  862. union {
  863. A_UINT32 resp_type_vld_ppdu_type;
  864. struct {
  865. A_UINT32 resp_type_vld: 1,
  866. ppdu_type: 5,
  867. reserved2: 26;
  868. };
  869. };
  870. /* BIT [ 1 : 0 ] :- ltf_size
  871. * BIT [ 2 : 2 ] :- stbc
  872. * BIT [ 3 : 3 ] :- he_re (range extension)
  873. * BIT [ 7 : 4 ] :- txbf
  874. * BIT [ 11: 8 ] :- bw
  875. * BIT [ 15: 12] :- nss NSS 1,2, ...8
  876. * BIT [ 19: 16] :- mcs
  877. * BIT [ 23: 20] :- preamble
  878. * BIT [ 27: 24] :- gi - HTT_PPDU_STATS_GI
  879. * BIT [ 28: 28] :- dcm
  880. * BIT [ 29: 29] :- ldpc
  881. * BIT [ 31: 30] :- reserved4
  882. */
  883. union {
  884. A_UINT32 rate_info;
  885. struct {
  886. A_UINT32 ltf_size: 2,
  887. stbc: 1,
  888. he_re: 1,
  889. txbf: 4,
  890. bw: 4,
  891. nss: 4,
  892. mcs: 4,
  893. preamble: 4,
  894. gi: 4,
  895. dcm: 1,
  896. ldpc: 1,
  897. reserved4: 2;
  898. };
  899. };
  900. /* Note: resp_rate_info is only valid for if resp_type is UL
  901. * BIT [ 1 : 0 ] :- ltf_size
  902. * BIT [ 2 : 2 ] :- stbc
  903. * BIT [ 3 : 3 ] :- he_re (range extension)
  904. * BIT [ 7 : 4 ] :- reserved3
  905. * BIT [ 11: 8 ] :- bw
  906. * BIT [ 15: 12] :- nss NSS 1,2, ...8
  907. * BIT [ 19: 16] :- mcs
  908. * BIT [ 23: 20] :- preamble
  909. * BIT [ 27: 24] :- gi
  910. * BIT [ 28: 28] :- dcm
  911. * BIT [ 29: 29] :- ldpc
  912. * BIT [ 31: 30] :- resp_ppdu_type - HTT_PPDU_STATS_RESP_PPDU_TYPE
  913. */
  914. union {
  915. A_UINT32 resp_rate_info;
  916. struct {
  917. A_UINT32 resp_ltf_size: 2,
  918. resp_stbc: 1,
  919. resp_he_re: 1,
  920. reserved3: 4,
  921. resp_bw: 4,
  922. resp_nss: 4,
  923. resp_mcs: 4,
  924. resp_preamble: 4,
  925. resp_gi: 4,
  926. resp_dcm: 1,
  927. resp_ldpc: 1,
  928. resp_ppdu_type: 2;
  929. };
  930. };
  931. } htt_ppdu_stats_user_rate_tlv;
  932. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_M 0x000000ff
  933. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_S 0
  934. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_GET(_var) \
  935. (((_var) & HTT_PPDU_STATS_EMQ_MPDU_BITMAP_TLV_TID_NUM_M) >> \
  936. HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_S)
  937. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_SET(_var, _val) \
  938. do { \
  939. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM, _val); \
  940. ((_var) |= ((_val) << HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_TID_NUM_S)); \
  941. } while (0)
  942. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_RESERVED_M 0x0000ff00
  943. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_RESERVED_S 8
  944. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_M 0xffff0000
  945. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_S 16
  946. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_GET(_var) \
  947. (((_var) & HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_M) >> \
  948. HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_S)
  949. #define HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_SET(_var, _val) \
  950. do { \
  951. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID, _val); \
  952. ((_var) |= ((_val) << HTT_PPDU_STATS_ENQ_MPDU_BITMAP_TLV_SW_PEER_ID_S)); \
  953. } while (0)
  954. typedef struct {
  955. htt_tlv_hdr_t tlv_hdr;
  956. /* BIT [ 7 : 0] :- tid_num
  957. * BIT [ 15: 8] :- reserved0
  958. * BIT [ 31: 16] :- sw_peer_id
  959. */
  960. union {
  961. A_UINT32 sw_peer_id__tid_num;
  962. struct {
  963. A_UINT32 tid_num: 8,
  964. reserved0: 8,
  965. sw_peer_id: 16;
  966. };
  967. };
  968. A_UINT32 start_seq;
  969. A_UINT32 enq_bitmap[HTT_BA_64_BIT_MAP_SIZE_DWORDS];
  970. } htt_ppdu_stats_enq_mpdu_bitmap_64_tlv;
  971. typedef struct {
  972. htt_tlv_hdr_t tlv_hdr;
  973. /* BIT [ 7 : 0] :- tid_num
  974. * BIT [ 15: 8] :- reserved0
  975. * BIT [ 31: 16] :- sw_peer_id
  976. */
  977. union {
  978. A_UINT32 sw_peer_id__tid_num;
  979. struct {
  980. A_UINT32 tid_num: 8,
  981. reserved0: 8,
  982. sw_peer_id: 16;
  983. };
  984. };
  985. A_UINT32 start_seq;
  986. A_UINT32 enq_bitmap[HTT_BA_256_BIT_MAP_SIZE_DWORDS];
  987. } htt_ppdu_stats_enq_mpdu_bitmap_256_tlv;
  988. /* COMPLETION_STATUS defined in HTT_PPDU_STATS_USER_COMPLETION_STATUS */
  989. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_M 0x000000ff
  990. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_S 0
  991. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_GET(_var) \
  992. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_M) >> \
  993. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_S)
  994. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_SET(_var, _val) \
  995. do { \
  996. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS, _val); \
  997. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_COMPLETION_STATUS_S)); \
  998. } while (0)
  999. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_M 0x0000ff00
  1000. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_S 8
  1001. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_GET(_var) \
  1002. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_M) >> \
  1003. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_S)
  1004. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_SET(_var, _val) \
  1005. do { \
  1006. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM, _val); \
  1007. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_TID_NUM_S)); \
  1008. } while (0)
  1009. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_M 0xffff0000
  1010. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_S 16
  1011. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_GET(_var) \
  1012. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_M) >> \
  1013. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_S)
  1014. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_SET(_var, _val) \
  1015. do { \
  1016. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID, _val); \
  1017. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SW_PEER_ID_S)); \
  1018. } while (0)
  1019. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_M 0x0000ffff
  1020. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_S 0
  1021. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_GET(_var) \
  1022. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_M) >> \
  1023. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_S)
  1024. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_SET(_var, _val) \
  1025. do { \
  1026. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED, _val); \
  1027. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_TRIED_S)); \
  1028. } while (0)
  1029. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_M 0xffff0000
  1030. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_S 16
  1031. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_GET(_var) \
  1032. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_M) >> \
  1033. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_S)
  1034. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_SET(_var, _val) \
  1035. do { \
  1036. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS, _val); \
  1037. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MPDU_SUCCESS_S)); \
  1038. } while (0)
  1039. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_M 0x0000000f
  1040. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_S 0
  1041. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_GET(_var) \
  1042. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_M) >> \
  1043. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_S)
  1044. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_SET(_var, _val) \
  1045. do { \
  1046. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY, _val); \
  1047. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_LONG_RETRY_S)); \
  1048. } while (0)
  1049. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_M 0x000000f0
  1050. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_S 4
  1051. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_GET(_var) \
  1052. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_M) >> \
  1053. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_S)
  1054. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_SET(_var, _val) \
  1055. do { \
  1056. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY, _val); \
  1057. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_SHORT_RETRY_S)); \
  1058. } while (0)
  1059. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_M 0x00000100
  1060. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_S 8
  1061. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_GET(_var) \
  1062. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_M) >> \
  1063. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_S)
  1064. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_SET(_var, _val) \
  1065. do { \
  1066. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU, _val); \
  1067. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_IS_AMPDU_S)); \
  1068. } while (0)
  1069. enum HTT_PPDU_STATS_RESP_TYPE {
  1070. HTT_PPDU_STATS_NO_RESPONSE_EXPECTED_E = 0,
  1071. HTT_PPDU_STATS_ACK_EXPECTED_E = 1,
  1072. HTT_PPDU_STATS_BA_BITMAP_EXPECTED_E = 2,
  1073. HTT_PPDU_STATS_UL_MU_BA_EXPECTED_E = 3,
  1074. HTT_PPDU_STATS_UL_MU_BA_AND_DATA_EXPECTED_E = 4,
  1075. HTT_PPDU_STATS_CTS_EXPECTED_E = 5,
  1076. HTT_PPDU_STATS_MU_CBF_EXPECTED_E = 6,
  1077. };
  1078. typedef enum HTT_PPDU_STATS_RESP_TYPE HTT_PPDU_STATS_RESP_TYPE;
  1079. /* Refer HTT_PPDU_STATS_RESP_TYPE */
  1080. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_M 0x00001e00
  1081. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_S 9
  1082. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_GET(_var) \
  1083. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_M) >> \
  1084. HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_S)
  1085. #define HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_SET(_var, _val) \
  1086. do { \
  1087. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE, _val); \
  1088. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_RESP_TYPE_S)); \
  1089. } while (0)
  1090. enum HTT_PPDU_STATS_USER_COMPLETION_STATUS {
  1091. HTT_PPDU_STATS_USER_STATUS_OK,
  1092. HTT_PPDU_STATS_USER_STATUS_FILTERED,
  1093. HTT_PPDU_STATS_USER_STATUS_RESP_TIMEOUT,
  1094. HTT_PPDU_STATS_USER_STATUS_RESP_MISMATCH,
  1095. HTT_PPDU_STATS_USER_STATUS_ABORT,
  1096. };
  1097. typedef enum HTT_PPDU_STATS_USER_COMPLETION_STATUS HTT_PPDU_STATS_USER_COMPLETION_STATUS;
  1098. typedef struct {
  1099. htt_tlv_hdr_t tlv_hdr;
  1100. /* BIT [ 7 : 0] :- completion_status
  1101. * BIT [ 15: 8] :- tid_num
  1102. * BIT [ 31: 16] :- sw_peer_id
  1103. */
  1104. union {
  1105. A_UINT32 sw_peer_id__tid_num__completion_status;
  1106. struct {
  1107. A_UINT32 completion_status: 8,
  1108. tid_num: 8,
  1109. sw_peer_id: 16;
  1110. };
  1111. };
  1112. /* RSSI value of last ack packet (units = dB above noise floor) */
  1113. A_UINT32 ack_rssi;
  1114. /* BIT [ 15 : 0] :- mpdu_tried
  1115. * BIT [ 31 : 16] :- mpdu_success
  1116. */
  1117. union {
  1118. A_UINT32 mpdu_tried__mpdu_success;
  1119. struct {
  1120. A_UINT32 mpdu_tried: 16,
  1121. mpdu_success: 16;
  1122. };
  1123. };
  1124. /* BIT [ 3 : 0] :- long_retries
  1125. * BIT [ 7 : 4] :- short_retries
  1126. * BIT [ 8 : 8] :- is_ampdu
  1127. * BIT [ 12: 9] :- resp_type
  1128. * BIT [ 31: 13] :- reserved0
  1129. */
  1130. union {
  1131. A_UINT32 resp_type_is_ampdu__short_retry__long_retry;
  1132. struct {
  1133. A_UINT32 long_retries: 4,
  1134. short_retries: 4,
  1135. is_ampdu: 1,
  1136. resp_type: 4,
  1137. reserved0: 19;
  1138. };
  1139. };
  1140. } htt_ppdu_stats_user_cmpltn_common_tlv;
  1141. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_M 0x000000ff
  1142. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_S 0
  1143. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_GET(_var) \
  1144. (((_var) & HTT_PPDU_STATS_EMQ_MPDU_BITMAP_TLV_TID_NUM_M) >> \
  1145. HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_S)
  1146. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_SET(_var, _val) \
  1147. do { \
  1148. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM, _val); \
  1149. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_TID_NUM_S)); \
  1150. } while (0)
  1151. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_RESERVED_M 0x0000ff00
  1152. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_RESERVED_S 8
  1153. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_M 0xffff0000
  1154. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_S 16
  1155. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_GET(_var) \
  1156. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_M) >> \
  1157. HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_S)
  1158. #define HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_SET(_var, _val) \
  1159. do { \
  1160. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID, _val); \
  1161. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_BA_BITMAP_TLV_SW_PEER_ID_S)); \
  1162. } while (0)
  1163. typedef struct {
  1164. htt_tlv_hdr_t tlv_hdr;
  1165. /* BIT [ 7 : 0] :- tid_num
  1166. * BIT [ 15: 8] :- reserved0
  1167. * BIT [ 31: 16] :- sw_peer_id
  1168. */
  1169. union {
  1170. A_UINT32 sw_peer_id__tid_num;
  1171. struct {
  1172. A_UINT32 tid_num: 8,
  1173. reserved0: 8,
  1174. sw_peer_id: 16;
  1175. };
  1176. };
  1177. A_UINT32 ba_seq_no;
  1178. A_UINT32 ba_bitmap[HTT_BA_64_BIT_MAP_SIZE_DWORDS];
  1179. } htt_ppdu_stats_user_compltn_ba_bitmap_64_tlv;
  1180. typedef struct {
  1181. htt_tlv_hdr_t tlv_hdr;
  1182. /* BIT [ 7 : 0] :- tid_num
  1183. * BIT [ 15: 8] :- reserved0
  1184. * BIT [ 31: 16] :- sw_peer_id
  1185. */
  1186. union {
  1187. A_UINT32 sw_peer_id__tid_num;
  1188. struct {
  1189. A_UINT32 tid_num: 8,
  1190. reserved0: 8,
  1191. sw_peer_id: 16;
  1192. };
  1193. };
  1194. A_UINT32 ba_seq_no;
  1195. A_UINT32 ba_bitmap[HTT_BA_256_BIT_MAP_SIZE_DWORDS];
  1196. } htt_ppdu_stats_user_compltn_ba_bitmap_256_tlv;
  1197. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_M 0x0000ffff
  1198. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_S 0
  1199. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_GET(_var) \
  1200. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_M) >> \
  1201. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_S)
  1202. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_SET(_var, _val) \
  1203. do { \
  1204. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID, _val); \
  1205. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_SW_PEER_ID_S)); \
  1206. } while (0)
  1207. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_M 0x000001ff
  1208. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_S 0
  1209. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_GET(_var) \
  1210. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_M) >> \
  1211. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_S)
  1212. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_SET(_var, _val) \
  1213. do { \
  1214. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU, _val); \
  1215. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MPDU_S)); \
  1216. } while (0)
  1217. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_M 0x01fffe00
  1218. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_S 9
  1219. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_GET(_var) \
  1220. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_M) >> \
  1221. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_S)
  1222. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_SET(_var, _val) \
  1223. do { \
  1224. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU, _val); \
  1225. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_NUM_MSDU_S)); \
  1226. } while (0)
  1227. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_M 0xfe000000
  1228. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_S 25
  1229. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_GET(_var) \
  1230. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_M) >> \
  1231. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_S)
  1232. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_SET(_var, _val) \
  1233. do { \
  1234. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM, _val); \
  1235. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_TID_NUM_S)); \
  1236. } while (0)
  1237. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_M 0x0000ffff
  1238. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_S 0
  1239. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_GET(_var) \
  1240. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_M) >> \
  1241. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_S)
  1242. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_SET(_var, _val) \
  1243. do { \
  1244. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ, _val); \
  1245. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_CUR_SEQ_S)); \
  1246. } while (0)
  1247. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_M 0xffff0000
  1248. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_S 16
  1249. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_GET(_var) \
  1250. (((_var) & HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_M) >> \
  1251. HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_S)
  1252. #define HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_SET(_var, _val) \
  1253. do { \
  1254. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ, _val); \
  1255. ((_var) |= ((_val) << HTT_PPDU_STATS_USER_CMPLTN_ACK_BA_STATUS_TLV_START_SEQ_S)); \
  1256. } while (0)
  1257. typedef struct {
  1258. htt_tlv_hdr_t tlv_hdr;
  1259. A_UINT32 ppdu_id;
  1260. /* BIT [ 15 : 0] :- sw_peer_id
  1261. * BIT [ 31 : 16] :- reserved0
  1262. */
  1263. union {
  1264. A_UINT32 rsvd_sw_peer_id;
  1265. struct {
  1266. A_UINT32 sw_peer_id: 16,
  1267. reserved0: 16;
  1268. };
  1269. };
  1270. /* BIT [ 8 : 0] :- num_mpdu
  1271. * BIT [ 24 : 9] :- num_msdu
  1272. * BIT [ 31 : 25] :- tid_num
  1273. */
  1274. union {
  1275. A_UINT32 tid_num__num_msdu__num_mpdu;
  1276. struct {
  1277. A_UINT32 num_mpdu: 9,
  1278. num_msdu: 16,
  1279. tid_num: 7;
  1280. };
  1281. };
  1282. /* BIT [ 15 : 0] :- current_seq
  1283. * BIT [ 31 : 16] :- start_seq
  1284. */
  1285. union {
  1286. A_UINT32 start_seq__current_seq;
  1287. struct {
  1288. A_UINT32 current_seq: 16,
  1289. start_seq: 16;
  1290. };
  1291. };
  1292. A_UINT32 success_bytes;
  1293. } htt_ppdu_stats_user_compltn_ack_ba_status_tlv;
  1294. /* FLOW_TYPE defined in HTT_TX_FLOW_TYPE */
  1295. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_M 0x000000ff
  1296. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_S 0
  1297. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_GET(_var) \
  1298. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_M) >> \
  1299. HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_S)
  1300. #define HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_SET(_var, _val) \
  1301. do { \
  1302. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE, _val); \
  1303. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_FLOW_TYPE_S)); \
  1304. } while (0)
  1305. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_M 0x0001ff00
  1306. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_S 8
  1307. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_GET(_var) \
  1308. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_M) >> \
  1309. HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_S)
  1310. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_SET(_var, _val) \
  1311. do { \
  1312. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU, _val); \
  1313. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_NUM_MPDU_S)); \
  1314. } while (0)
  1315. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_M 0x7ffe0000
  1316. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_S 17
  1317. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_GET(_var) \
  1318. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_M) >> \
  1319. HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_S)
  1320. #define HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_SET(_var, _val) \
  1321. do { \
  1322. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU, _val); \
  1323. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_NUM_MSDU_S)); \
  1324. } while (0)
  1325. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_M 0x000000ff
  1326. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_S 0
  1327. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_GET(_var) \
  1328. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_M) >> \
  1329. HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_S)
  1330. #define HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_SET(_var, _val) \
  1331. do { \
  1332. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_TID_NUM, _val); \
  1333. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_TID_NUM_S)); \
  1334. } while (0)
  1335. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_M 0x0000ff00
  1336. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_S 8
  1337. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_GET(_var) \
  1338. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_M) >> \
  1339. HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_S)
  1340. #define HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_SET(_var, _val) \
  1341. do { \
  1342. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE, _val); \
  1343. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_QUEUE_TYPE_S)); \
  1344. } while (0)
  1345. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_M 0xffff0000
  1346. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_S 16
  1347. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_GET(_var) \
  1348. (((_var) & HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_M) >> \
  1349. HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_S)
  1350. #define HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_SET(_var, _val) \
  1351. do { \
  1352. HTT_CHECK_SET_VAL(HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID, _val); \
  1353. ((_var) |= ((_val) << HTT_PPDU_STATS_FLUSH_TLV_SW_PEER_ID_S)); \
  1354. } while (0)
  1355. enum HTT_TX_FLOW_TYPE {
  1356. HTT_TX_TID_FRAMEQ,
  1357. HTT_TX_TQM_MSDUQ,
  1358. HTT_TQM_MPDUQ,
  1359. };
  1360. enum HTT_FLUSH_STATUS_DROP_REASON {
  1361. HTT_FLUSH_PEER_DELETE,
  1362. HTT_FLUSH_TID_DELETE,
  1363. HTT_FLUSH_TTL_EXCEEDED,
  1364. HTT_FLUSH_EXCESS_RETRIES,
  1365. HTT_FLUSH_REINJECT,
  1366. };
  1367. typedef struct {
  1368. htt_tlv_hdr_t tlv_hdr;
  1369. A_UINT32 drop_reason;
  1370. /* BIT [ 7 : 0] :- flow_type
  1371. * BIT [ 16: 8] :- num_mpdu
  1372. * BIT [ 30: 17] :- num_msdu
  1373. * BIT [ 31: 31] :- reserved0
  1374. */
  1375. union {
  1376. A_UINT32 num_msdu__num_mpdu__flow_type;
  1377. struct {
  1378. A_UINT32 flow_type: 8,
  1379. num_mpdu: 9,
  1380. num_msdu: 14,
  1381. reserved0: 1;
  1382. };
  1383. };
  1384. /* BIT [ 7 : 0] :- tid_num
  1385. * BIT [ 15 : 8] :- queue_type
  1386. * BIT [ 31 : 16] :- sw_peer_id
  1387. */
  1388. union {
  1389. A_UINT32 sw_peer_id__queue_type__tid_num;
  1390. struct {
  1391. A_UINT32 tid_num: 8,
  1392. queue_type: 8,
  1393. sw_peer_id: 16;
  1394. };
  1395. };
  1396. } htt_ppdu_stats_flush_tlv;
  1397. typedef struct {
  1398. htt_tlv_hdr_t tlv_hdr;
  1399. /* Future purpose */
  1400. A_UINT32 reserved1; /* set to 0x0 */
  1401. A_UINT32 reserved2; /* set to 0x0 */
  1402. A_UINT32 reserved3; /* set to 0x0 */
  1403. /* mgmt/ctrl frame payload
  1404. * The size of payload (in bytes) can be derived from the length in
  1405. * tlv parametes, minus the 12 bytes of the above fields.
  1406. */
  1407. A_UINT32 payload[1];
  1408. } htt_ppdu_stats_tx_mgmtctrl_payload_tlv;
  1409. #endif //__HTT_PPDU_STATS_H__