htt_ppdu_stats.h 58 KB

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