cdp_txrx_cmn_struct.h 95 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /**
  20. * DOC: cdp_txrx_cmn_struct.h
  21. * Define the host data path converged API functions
  22. * called by the host control SW and the OS interface module
  23. */
  24. #ifndef _CDP_TXRX_CMN_STRUCT_H_
  25. #define _CDP_TXRX_CMN_STRUCT_H_
  26. /*
  27. * For WIN legacy header compilation
  28. * Temporary add dummy definitions
  29. * should be removed properly WIN legacy code handle
  30. */
  31. #include "htc_api.h"
  32. #include "qdf_types.h"
  33. #include "qdf_nbuf.h"
  34. #include "qdf_atomic.h"
  35. #ifdef DP_MOB_DEFS
  36. #include <cdp_txrx_mob_def.h>
  37. #endif
  38. #include <cdp_txrx_handle.h>
  39. #include <cdp_txrx_stats_struct.h>
  40. #ifdef WLAN_RX_PKT_CAPTURE_ENH
  41. #include "cdp_txrx_extd_struct.h"
  42. #endif
  43. #ifdef WLAN_MAX_CLIENTS_ALLOWED
  44. #define OL_TXRX_NUM_LOCAL_PEER_IDS (WLAN_MAX_CLIENTS_ALLOWED + 1 + 1 + 1)
  45. #endif
  46. #ifndef OL_TXRX_NUM_LOCAL_PEER_IDS
  47. /*
  48. * Each AP will occupy one ID, so it will occupy two IDs for AP-AP mode.
  49. * Clients will be assigned max 32 IDs.
  50. * STA(associated)/P2P DEV(self-PEER) will get one ID.
  51. */
  52. #define OL_TXRX_NUM_LOCAL_PEER_IDS (32 + 1 + 1 + 1)
  53. #endif
  54. #define CDP_BA_256_BIT_MAP_SIZE_DWORDS 8
  55. #define CDP_BA_64_BIT_MAP_SIZE_DWORDS 2
  56. #define CDP_RSSI_CHAIN_LEN 8
  57. #define OL_TXRX_INVALID_PDEV_ID 0xff
  58. #define OL_TXRX_INVALID_LOCAL_PEER_ID 0xffff
  59. #define CDP_INVALID_VDEV_ID 0xff
  60. /* Max vdev_stats_id(48) is as per the max vdevs supported by HW */
  61. #define CDP_MAX_VDEV_STATS_ID 0x30
  62. /* Invalid vdev_stats_id */
  63. #define CDP_INVALID_VDEV_STATS_ID 0xFF
  64. /* Options for Dump Statistics */
  65. #define CDP_HDD_STATS 0
  66. #define CDP_TXRX_PATH_STATS 1
  67. #define CDP_TXRX_HIST_STATS 2
  68. #define CDP_TXRX_TSO_STATS 3
  69. #define CDP_HDD_NETIF_OPER_HISTORY 4
  70. #define CDP_DUMP_TX_FLOW_POOL_INFO 5
  71. #define CDP_TXRX_DESC_STATS 6
  72. #define CDP_HIF_STATS 7
  73. #define CDP_LRO_STATS 8
  74. #define CDP_NAPI_STATS 9
  75. #define CDP_WLAN_RX_BUF_DEBUG_STATS 10
  76. #define CDP_RX_RING_STATS 11
  77. #define CDP_DP_NAPI_STATS 12
  78. #define CDP_DP_RX_THREAD_STATS 13
  79. #define CDP_SCHEDULER_STATS 21
  80. #define CDP_TX_QUEUE_STATS 22
  81. #define CDP_BUNDLE_STATS 23
  82. #define CDP_CREDIT_STATS 24
  83. #define CDP_DISCONNECT_STATS 25
  84. #define CDP_DP_RX_FISA_STATS 26
  85. #define CDP_DP_SWLM_STATS 27
  86. #define CDP_DP_TX_HW_LATENCY_STATS 28
  87. #define WME_AC_TO_TID(_ac) ( \
  88. ((_ac) == WME_AC_VO) ? 6 : \
  89. ((_ac) == WME_AC_VI) ? 5 : \
  90. ((_ac) == WME_AC_BK) ? 1 : \
  91. 0)
  92. #define TID_TO_WME_AC(_tid) ( \
  93. (((_tid) == 0) || ((_tid) == 3)) ? WME_AC_BE : \
  94. (((_tid) == 1) || ((_tid) == 2)) ? WME_AC_BK : \
  95. (((_tid) == 4) || ((_tid) == 5)) ? WME_AC_VI : \
  96. WME_AC_VO)
  97. #define CDP_MU_MAX_USERS 37
  98. #define CDP_MU_MAX_USER_INDEX (CDP_MU_MAX_USERS - 1)
  99. #define CDP_INVALID_PEER 0xffff
  100. #define CDP_INVALID_TID 31
  101. #define CDP_INVALID_TX_ENCAP_TYPE 6
  102. #define CDP_INVALID_SEC_TYPE 12
  103. #define CDP_DATA_TID_MAX 8
  104. #define CDP_DATA_NON_QOS_TID 16
  105. #define CDP_NUM_SA_BW 4
  106. #define CDP_PERCENT_MACRO 100
  107. #define CDP_NUM_KB_IN_MB 1000
  108. /*
  109. * advance rx monitor filter
  110. */
  111. #define MON_FILTER_PASS 0x0001
  112. #define MON_FILTER_OTHER 0x0002
  113. #define MON_FILTER_ALL 0x0003
  114. #define FILTER_MGMT_ALL 0xFFFF
  115. #define FILTER_MGMT_ASSOC_REQ 0x0001
  116. #define FILTER_MGMT_ASSOC_RES 0x0002
  117. #define FILTER_MGMT_REASSOC_REQ 0x0004
  118. #define FILTER_MGMT_REASSOC_RES 0x0008
  119. #define FILTER_MGMT_PROBE_REQ 0x0010
  120. #define FILTER_MGMT_PROBE_RES 0x0020
  121. #define FILTER_MGMT_TIM_ADVT 0x0040
  122. #define FILTER_MGMT_RESERVED_7 0x0080
  123. #define FILTER_MGMT_BEACON 0x0100
  124. #define FILTER_MGMT_ATIM 0x0200
  125. #define FILTER_MGMT_DISASSOC 0x0400
  126. #define FILTER_MGMT_AUTH 0x0800
  127. #define FILTER_MGMT_DEAUTH 0x1000
  128. #define FILTER_MGMT_ACTION 0x2000
  129. #define FILTER_MGMT_ACT_NO_ACK 0x4000
  130. #define FILTER_MGMT_RESERVED_15 0x8000
  131. #define FILTER_CTRL_ALL 0xFFFF
  132. #define FILTER_CTRL_RESERVED_1 0x0001
  133. #define FILTER_CTRL_RESERVED_2 0x0002
  134. #define FILTER_CTRL_TRIGGER 0x0004
  135. #define FILTER_CTRL_RESERVED_4 0x0008
  136. #define FILTER_CTRL_BF_REP_POLL 0x0010
  137. #define FILTER_CTRL_VHT_NDP 0x0020
  138. #define FILTER_CTRL_FRAME_EXT 0x0040
  139. #define FILTER_CTRL_CTRLWRAP 0x0080
  140. #define FILTER_CTRL_BA_REQ 0x0100
  141. #define FILTER_CTRL_BA 0x0200
  142. #define FILTER_CTRL_PSPOLL 0x0400
  143. #define FILTER_CTRL_RTS 0x0800
  144. #define FILTER_CTRL_CTS 0x1000
  145. #define FILTER_CTRL_ACK 0x2000
  146. #define FILTER_CTRL_CFEND 0x4000
  147. #define FILTER_CTRL_CFEND_CFACK 0x8000
  148. #define FILTER_DATA_ALL 0xFFFF
  149. #define FILTER_DATA_MCAST 0x4000
  150. #define FILTER_DATA_UCAST 0x8000
  151. #define FILTER_DATA_DATA 0x0001
  152. #define FILTER_DATA_NULL 0x0008
  153. /*
  154. * Multiply rate by 2 to avoid float point
  155. * and get rate in units of 500kbps
  156. */
  157. #define CDP_11B_RATE_0MCS (11 * 2)
  158. #define CDP_11B_RATE_1MCS (5.5 * 2)
  159. #define CDP_11B_RATE_2MCS (2 * 2)
  160. #define CDP_11B_RATE_3MCS (1 * 2)
  161. #define CDP_11B_RATE_4MCS (11 * 2)
  162. #define CDP_11B_RATE_5MCS (5.5 * 2)
  163. #define CDP_11B_RATE_6MCS (2 * 2)
  164. #define CDP_11A_RATE_0MCS (48 * 2)
  165. #define CDP_11A_RATE_1MCS (24 * 2)
  166. #define CDP_11A_RATE_2MCS (12 * 2)
  167. #define CDP_11A_RATE_3MCS (6 * 2)
  168. #define CDP_11A_RATE_4MCS (54 * 2)
  169. #define CDP_11A_RATE_5MCS (36 * 2)
  170. #define CDP_11A_RATE_6MCS (18 * 2)
  171. #define CDP_11A_RATE_7MCS (9 * 2)
  172. #define CDP_LEGACY_MCS0 0
  173. #define CDP_LEGACY_MCS1 1
  174. #define CDP_LEGACY_MCS2 2
  175. #define CDP_LEGACY_MCS3 3
  176. #define CDP_LEGACY_MCS4 4
  177. #define CDP_LEGACY_MCS5 5
  178. #define CDP_LEGACY_MCS6 6
  179. #define CDP_LEGACY_MCS7 7
  180. QDF_DECLARE_EWMA(tx_lag, 1024, 8)
  181. struct cdp_stats_cookie;
  182. /**
  183. * enum cdp_cfg_param_type - DP configuration parameters
  184. * @CDP_CFG_MAX_PEER_ID: Maximum peer id
  185. * @CDP_CFG_CCE_DISABLE: CCE disable
  186. * @CDP_CFG_NUM_PARAMS: Total number of params
  187. */
  188. enum cdp_cfg_param_type {
  189. CDP_CFG_MAX_PEER_ID,
  190. CDP_CFG_CCE_DISABLE,
  191. CDP_CFG_NUM_PARAMS
  192. };
  193. /**
  194. * enum CDP_PPDU_STATS_PPDU_TYPE - PPDU TYPE from FW
  195. * @CDP_PPDU_STATS_PPDU_TYPE_SU: single user type
  196. * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO: multi user mu-mimo
  197. * @CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA: multi user ofdma
  198. * @CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA: multi user mu-mimo ofdma
  199. * @CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG: ul trigger ppdu
  200. * @CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN: burst beacon
  201. * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP: bsr respond
  202. * @CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG: bsr trigger
  203. * @CDP_PPDU_STATS_PPDU_TYPE_UL_RESP: ul response
  204. * @CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN: unknown
  205. */
  206. enum CDP_PPDU_STATS_PPDU_TYPE {
  207. CDP_PPDU_STATS_PPDU_TYPE_SU = 0,
  208. CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO = 1,
  209. CDP_PPDU_STATS_PPDU_TYPE_MU_OFDMA = 2,
  210. CDP_PPDU_STATS_PPDU_TYPE_MU_MIMO_OFDMA = 4,
  211. CDP_PPDU_STATS_PPDU_TYPE_UL_TRIG = 5,
  212. CDP_PPDU_STATS_PPDU_TYPE_BURST_BCN = 6,
  213. CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_RESP = 7,
  214. CDP_PPDU_STATS_PPDU_TYPE_UL_BSR_TRIG = 8,
  215. CDP_PPDU_STATS_PPDU_TYPE_UL_RESP = 9,
  216. CDP_PPDU_STATS_PPDU_TYPE_UNKNOWN = 0x1F,
  217. };
  218. /**
  219. * enum htt_cmn_dbg_stats_type -
  220. * bit positions for each stats type within a stats type bitmask
  221. * The bitmask contains 24 bits.
  222. * @HTT_DBG_CMN_STATS_WAL_PDEV_TXRX:
  223. * @HTT_DBG_CMN_STATS_RX_REORDER:
  224. * @HTT_DBG_CMN_STATS_RX_RATE_INFO:
  225. * @HTT_DBG_CMN_STATS_TX_PPDU_LOG:
  226. * @HTT_DBG_CMN_STATS_TX_RATE_INFO:
  227. * @HTT_DBG_CMN_STATS_TIDQ:
  228. * @HTT_DBG_CMN_STATS_TXBF_INFO:
  229. * @HTT_DBG_CMN_STATS_SND_INFO:
  230. * @HTT_DBG_CMN_STATS_ERROR_INFO:
  231. * @HTT_DBG_CMN_STATS_TX_SELFGEN_INFO:
  232. * @HTT_DBG_CMN_STATS_TX_MU_INFO:
  233. * @HTT_DBG_CMN_STATS_SIFS_RESP_INFO:
  234. * @HTT_DBG_CMN_STATS_RESET_INFO:
  235. * @HTT_DBG_CMN_STATS_MAC_WDOG_INFO:
  236. * @HTT_DBG_CMN_STATS_TX_DESC_INFO:
  237. * @HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO:
  238. * @HTT_DBG_CMN_STATS_TX_PFSCHED_INFO:
  239. * @HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO:
  240. * @HTT_DBG_CMN_NUM_STATS:
  241. * @HTT_DBG_CMN_NUM_STATS_INVALID:
  242. */
  243. enum htt_cmn_dbg_stats_type {
  244. HTT_DBG_CMN_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  245. HTT_DBG_CMN_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  246. HTT_DBG_CMN_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  247. HTT_DBG_CMN_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  248. HTT_DBG_CMN_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  249. HTT_DBG_CMN_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  250. HTT_DBG_CMN_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  251. HTT_DBG_CMN_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  252. HTT_DBG_CMN_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  253. HTT_DBG_CMN_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  254. HTT_DBG_CMN_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  255. HTT_DBG_CMN_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  256. HTT_DBG_CMN_STATS_RESET_INFO = 12, /* bit 12 -> 0x1000 */
  257. HTT_DBG_CMN_STATS_MAC_WDOG_INFO = 13, /* bit 13 -> 0x2000 */
  258. HTT_DBG_CMN_STATS_TX_DESC_INFO = 14, /* bit 14 -> 0x4000 */
  259. HTT_DBG_CMN_STATS_TX_FETCH_MGR_INFO = 15, /* bit 15 -> 0x8000 */
  260. HTT_DBG_CMN_STATS_TX_PFSCHED_INFO = 16, /* bit 16 -> 0x10000 */
  261. HTT_DBG_CMN_STATS_TX_PATH_STATS_INFO = 17, /* bit 17 -> 0x20000 */
  262. /* bits 18-23 currently reserved */
  263. /* keep this last */
  264. HTT_DBG_CMN_NUM_STATS,
  265. HTT_DBG_CMN_NUM_STATS_INVALID = 31, /* bit 31 -> 0x80000000 */
  266. };
  267. /**
  268. * enum cdp_host_txrx_stats - Different types of host stats
  269. * @TXRX_HOST_STATS_INVALID: Invalid option
  270. * @TXRX_CLEAR_STATS: clear all host stats
  271. * @TXRX_RX_RATE_STATS: Rx rate info
  272. * @TXRX_TX_RATE_STATS: Tx rate info
  273. * @TXRX_TX_HOST_STATS: Print Tx stats
  274. * @TXRX_RX_HOST_STATS: Print host Rx stats
  275. * @TXRX_AST_STATS:
  276. * @TXRX_SRNG_PTR_STATS: Print SRNG pointer stats
  277. * @TXRX_RX_MON_STATS: Print monitor mode stats
  278. * @TXRX_REO_QUEUE_STATS: Print Per peer REO Queue Stats
  279. * @TXRX_SOC_CFG_PARAMS: Print soc cfg params info
  280. * @TXRX_PDEV_CFG_PARAMS: Print pdev cfg params info
  281. * @TXRX_NAPI_STATS: Print NAPI scheduling statistics
  282. * @TXRX_SOC_INTERRUPT_STATS: Print soc interrupt stats
  283. * @TXRX_SOC_FSE_STATS:
  284. * @TXRX_HAL_REG_WRITE_STATS: Hal Reg Write stats
  285. * @TXRX_SOC_REO_HW_DESC_DUMP: HW REO queue desc dump
  286. * @TXRX_SOC_WBM_IDLE_HPTP_DUMP: WBM idle link desc SRNG HP/TP dump
  287. * @TXRX_SRNG_USAGE_WM_STATS: SRNG usage watermark stats
  288. * @TXRX_HOST_STATS_MAX:
  289. */
  290. enum cdp_host_txrx_stats {
  291. TXRX_HOST_STATS_INVALID = -1,
  292. TXRX_CLEAR_STATS = 0,
  293. TXRX_RX_RATE_STATS = 1,
  294. TXRX_TX_RATE_STATS = 2,
  295. TXRX_TX_HOST_STATS = 3,
  296. TXRX_RX_HOST_STATS = 4,
  297. TXRX_AST_STATS = 5,
  298. TXRX_SRNG_PTR_STATS = 6,
  299. TXRX_RX_MON_STATS = 7,
  300. TXRX_REO_QUEUE_STATS = 8,
  301. TXRX_SOC_CFG_PARAMS = 9,
  302. TXRX_PDEV_CFG_PARAMS = 10,
  303. TXRX_NAPI_STATS = 11,
  304. TXRX_SOC_INTERRUPT_STATS = 12,
  305. TXRX_SOC_FSE_STATS = 13,
  306. TXRX_HAL_REG_WRITE_STATS = 14,
  307. TXRX_SOC_REO_HW_DESC_DUMP = 15,
  308. TXRX_SOC_WBM_IDLE_HPTP_DUMP = 16,
  309. TXRX_SRNG_USAGE_WM_STATS = 17,
  310. TXRX_HOST_STATS_MAX,
  311. };
  312. /**
  313. * enum cdp_ppdu_ftype - PPDU Frame Type
  314. * @CDP_PPDU_FTYPE_DATA: SU or MU Data Frame
  315. * @CDP_PPDU_FTYPE_CTRL: Control/Management Frames
  316. * @CDP_PPDU_FTYPE_BAR: SU or MU BAR frames
  317. * @CDP_PPDU_FTYPE_MAX: Max value
  318. */
  319. enum cdp_ppdu_ftype {
  320. CDP_PPDU_FTYPE_CTRL,
  321. CDP_PPDU_FTYPE_DATA,
  322. CDP_PPDU_FTYPE_BAR,
  323. CDP_PPDU_FTYPE_MAX
  324. };
  325. /**
  326. * enum htt_cmn_pkt_type - General specification of the tx frame contents
  327. * @htt_cmn_pkt_type_raw: raw
  328. * @htt_cmn_pkt_type_native_wifi: native wifi
  329. * @htt_cmn_pkt_type_ethernet: ethernet
  330. * @htt_cmn_pkt_type_mgmt: management
  331. * @htt_cmn_pkt_type_eth2: ethernet2
  332. * @htt_cmn_pkt_num_types: number of packet types
  333. *
  334. * for efficiency, the HTT packet type values correspond
  335. * to the bit positions of the WAL packet type values, so the
  336. * translation is a simple shift operation.
  337. */
  338. enum htt_cmn_pkt_type {
  339. htt_cmn_pkt_type_raw = 0,
  340. htt_cmn_pkt_type_native_wifi = 1,
  341. htt_cmn_pkt_type_ethernet = 2,
  342. htt_cmn_pkt_type_mgmt = 3,
  343. htt_cmn_pkt_type_eth2 = 4,
  344. /* keep this last */
  345. htt_cmn_pkt_num_types
  346. };
  347. /**
  348. * enum htt_cmn_rx_status - description of HTT received packets status
  349. * @htt_cmn_rx_status_unknown:
  350. * @htt_cmn_rx_status_ok:
  351. * @htt_cmn_rx_status_err_fcs:
  352. * @htt_cmn_rx_status_err_dup:
  353. * @htt_cmn_rx_status_err_replay:
  354. * @htt_cmn_rx_status_inv_peer:
  355. * @htt_cmn_rx_status_ctrl_mgmt_null:
  356. * @htt_cmn_rx_status_tkip_mic_err:
  357. * @htt_cmn_rx_status_decrypt_err:
  358. * @htt_cmn_rx_status_mpdu_length_err:
  359. * @htt_cmn_rx_status_err_misc:
  360. *
  361. * It is similar to htt_rx_status enum
  362. * but is added as a cdp enum can be freely used in OL_IF layer
  363. */
  364. enum htt_cmn_rx_status {
  365. htt_cmn_rx_status_unknown = 0x0,
  366. htt_cmn_rx_status_ok,
  367. htt_cmn_rx_status_err_fcs,
  368. htt_cmn_rx_status_err_dup,
  369. htt_cmn_rx_status_err_replay,
  370. htt_cmn_rx_status_inv_peer,
  371. htt_cmn_rx_status_ctrl_mgmt_null = 0x08,
  372. htt_cmn_rx_status_tkip_mic_err = 0x09,
  373. htt_cmn_rx_status_decrypt_err = 0x0A,
  374. htt_cmn_rx_status_mpdu_length_err = 0x0B,
  375. htt_cmn_rx_status_err_misc = 0xFF
  376. };
  377. enum cdp_host_reo_dest_ring {
  378. cdp_host_reo_dest_ring_unknown = 0,
  379. cdp_host_reo_dest_ring_1 = 1,
  380. cdp_host_reo_dest_ring_2 = 2,
  381. cdp_host_reo_dest_ring_3 = 3,
  382. cdp_host_reo_dest_ring_4 = 4,
  383. };
  384. enum htt_cmn_t2h_en_stats_type {
  385. /* keep this always first */
  386. HTT_CMN_T2H_EN_STATS_TYPE_START = 0,
  387. /** ppdu_common_stats is the payload */
  388. HTT_CMN_T2H_EN_STATS_TYPE_COMMON = 1,
  389. /** ppdu_sant_stats is the payload */
  390. HTT_CMN_T2H_EN_STATS_TYPE_SANT = 2,
  391. /** ppdu_common_stats_v2 is the payload */
  392. HTT_CMN_T2H_EN_STATS_TYPE_COMMON_V2 = 3,
  393. /* Keep this last */
  394. HTT_CMN_T2H_EN_STATS_TYPE_END = 0x1f,
  395. };
  396. enum htt_cmn_t2h_en_stats_status {
  397. /* Keep this first always */
  398. HTT_CMN_T2H_EN_STATS_STATUS_PARTIAL = 0,
  399. HTT_CMN_T2H_EN_STATS_STATUS_PRESENT = 1,
  400. HTT_CMN_T2H_EN_STATS_STATUS_ERROR = 2,
  401. HTT_CMN_T2H_EN_STATS_STATUS_INVALID = 3,
  402. /* keep this always last */
  403. HTT_CMN_T2H_EN_STATS_STATUS_SERIES_DONE = 7,
  404. };
  405. /**
  406. * enum cdp_peer_type - Peer type
  407. * @CDP_INVALID_PEER_TYPE: invalid peer type
  408. * @CDP_LINK_PEER_TYPE: legacy peer or link peer for MLO connection
  409. * @CDP_MLD_PEER_TYPE: MLD peer for MLO connection
  410. * @CDP_WILD_PEER_TYPE: used to set peer type for same mld/link mac addr
  411. */
  412. enum cdp_peer_type {
  413. CDP_INVALID_PEER_TYPE,
  414. CDP_LINK_PEER_TYPE,
  415. CDP_MLD_PEER_TYPE,
  416. CDP_WILD_PEER_TYPE,
  417. };
  418. /**
  419. * struct cdp_peer_setup_info - MLO connection info for cdp_peer_setup()
  420. * @mld_peer_mac: mld peer mac address pointer
  421. * @is_first_link: set true for first MLO link peer
  422. * @is_primary_link: set true for MLO primary link peer
  423. * @primary_umac_id: primary umac_id
  424. * @num_links: number of links in MLO
  425. */
  426. struct cdp_peer_setup_info {
  427. uint8_t *mld_peer_mac;
  428. uint8_t is_first_link:1,
  429. is_primary_link:1;
  430. uint8_t primary_umac_id;
  431. uint8_t num_links;
  432. };
  433. /**
  434. * struct cdp_peer_info - peer info for dp hash find
  435. * @vdev_id: Vdev ID
  436. * @mac_addr: peer mac address to search
  437. * @mac_addr_is_aligned: true only if mac_addr type is
  438. * "union dp_align_mac_addr", otherwise set false always.
  439. * @peer_type: link or MLD peer type
  440. */
  441. struct cdp_peer_info {
  442. uint8_t vdev_id;
  443. uint8_t *mac_addr;
  444. bool mac_addr_is_aligned;
  445. enum cdp_peer_type peer_type;
  446. };
  447. /**
  448. * enum ol_txrx_peer_state - Peer state information
  449. * @OL_TXRX_PEER_STATE_INVALID: Invalid
  450. * @OL_TXRX_PEER_STATE_DISC: disconnected (initial state)
  451. * @OL_TXRX_PEER_STATE_CONN: authentication in progress
  452. * @OL_TXRX_PEER_STATE_AUTH: authentication successful
  453. */
  454. enum ol_txrx_peer_state {
  455. OL_TXRX_PEER_STATE_INVALID,
  456. OL_TXRX_PEER_STATE_DISC,
  457. OL_TXRX_PEER_STATE_CONN,
  458. OL_TXRX_PEER_STATE_AUTH,
  459. };
  460. /**
  461. * enum cdp_txrx_ast_entry_type - AST entry type information
  462. * @CDP_TXRX_AST_TYPE_NONE: static ast entry for connected peer
  463. * @CDP_TXRX_AST_TYPE_STATIC: static ast entry for connected peer
  464. * @CDP_TXRX_AST_TYPE_SELF: static ast entry for self peer (STA mode)
  465. * @CDP_TXRX_AST_TYPE_WDS: WDS peer ast entry type
  466. * @CDP_TXRX_AST_TYPE_WDS_HM: HM WDS entry
  467. * @CDP_TXRX_AST_TYPE_STA_BSS: BSS entry(STA mode)
  468. * @CDP_TXRX_AST_TYPE_DA: AST entry based on Destination address
  469. * @CDP_TXRX_AST_TYPE_WDS_HM_SEC: HM WDS entry for secondary radio
  470. * @CDP_TXRX_AST_TYPE_MLD: AST entry type for MLD peer
  471. * @CDP_TXRX_AST_TYPE_MAX:
  472. */
  473. enum cdp_txrx_ast_entry_type {
  474. CDP_TXRX_AST_TYPE_NONE,
  475. CDP_TXRX_AST_TYPE_STATIC,
  476. CDP_TXRX_AST_TYPE_SELF,
  477. CDP_TXRX_AST_TYPE_WDS,
  478. CDP_TXRX_AST_TYPE_WDS_HM,
  479. CDP_TXRX_AST_TYPE_STA_BSS,
  480. CDP_TXRX_AST_TYPE_DA,
  481. CDP_TXRX_AST_TYPE_WDS_HM_SEC,
  482. CDP_TXRX_AST_TYPE_MLD,
  483. CDP_TXRX_AST_TYPE_MAX
  484. };
  485. /**
  486. * enum cdp_ast_free_status - status passed to callback function before
  487. * freeing ast
  488. * @CDP_TXRX_AST_DELETED: AST is deleted from FW and delete response received
  489. * @CDP_TXRX_AST_DELETE_IN_PROGRESS: AST delete command sent to FW and host
  490. * is waiting for FW response
  491. */
  492. enum cdp_ast_free_status {
  493. CDP_TXRX_AST_DELETED,
  494. CDP_TXRX_AST_DELETE_IN_PROGRESS,
  495. };
  496. /**
  497. * typedef txrx_ast_free_cb() - callback registered for ast free
  498. * @ctrl_soc: control path soc context
  499. * @cdp_soc: DP soc context
  500. * @cookie: cookie
  501. * @cdp_ast_free_status: ast free status
  502. */
  503. typedef void (*txrx_ast_free_cb)(struct cdp_ctrl_objmgr_psoc *ctrl_soc,
  504. struct cdp_soc *cdp_soc,
  505. void *cookie,
  506. enum cdp_ast_free_status);
  507. /**
  508. * struct cdp_ast_entry_info - AST entry information
  509. * @peer_mac_addr: mac address of peer on which AST entry is added
  510. * @type: ast entry type
  511. * @vdev_id: vdev_id
  512. * @pdev_id: pdev_id
  513. * @peer_id: peer_id
  514. *
  515. * This structure holds the ast entry information
  516. *
  517. */
  518. struct cdp_ast_entry_info {
  519. uint8_t peer_mac_addr[QDF_MAC_ADDR_SIZE];
  520. enum cdp_txrx_ast_entry_type type;
  521. uint8_t vdev_id;
  522. uint8_t pdev_id;
  523. uint16_t peer_id;
  524. };
  525. #define MIC_SEQ_CTR_SIZE 6
  526. enum cdp_rx_frame_type {
  527. cdp_rx_frame_type_802_11,
  528. cdp_rx_frame_type_802_3,
  529. };
  530. /**
  531. * struct cdp_rx_mic_err_info - rx mic error information
  532. * @frame_type: frame type - 0 - 802.11 frame
  533. * - 1 - 802.3 frame
  534. * @data: 802.11 frame
  535. * @ta_mac_addr: transmitter mac address
  536. * @da_mac_addr: destination mac address
  537. * @tsc: sequence number
  538. * @key_id: Key ID
  539. * @multicast: flag for multicast
  540. * @vdev_id: vdev ID
  541. *
  542. * This structure holds rx mic error information
  543. *
  544. */
  545. struct cdp_rx_mic_err_info {
  546. uint8_t frame_type;
  547. uint8_t *data;
  548. struct qdf_mac_addr ta_mac_addr;
  549. struct qdf_mac_addr da_mac_addr;
  550. uint8_t tsc[MIC_SEQ_CTR_SIZE];
  551. uint8_t key_id;
  552. bool multicast;
  553. uint16_t vdev_id;
  554. };
  555. #ifdef WLAN_SUPPORT_MSCS
  556. /**
  557. * struct cdp_mscs_params - MSCS parameters obtained
  558. * from handshake
  559. * @user_pri_bitmap: User priority bitmap
  560. * @user_pri_limit: User priority limit
  561. * @classifier_type: TCLAS Classifier type
  562. * @classifier_mask: TCLAS Classifier mask
  563. */
  564. struct cdp_mscs_params {
  565. uint8_t user_pri_bitmap;
  566. uint8_t user_pri_limit;
  567. uint8_t classifier_type;
  568. uint8_t classifier_mask;
  569. };
  570. #endif
  571. /**
  572. * enum cdp_sec_type - security type information
  573. * @cdp_sec_type_none:
  574. * @cdp_sec_type_wep128:
  575. * @cdp_sec_type_wep104:
  576. * @cdp_sec_type_wep40:
  577. * @cdp_sec_type_tkip:
  578. * @cdp_sec_type_tkip_nomic:
  579. * @cdp_sec_type_aes_ccmp:
  580. * @cdp_sec_type_wapi:
  581. * @cdp_sec_type_aes_ccmp_256:
  582. * @cdp_sec_type_aes_gcmp:
  583. * @cdp_sec_type_aes_gcmp_256:
  584. * @cdp_num_sec_types:
  585. */
  586. enum cdp_sec_type {
  587. cdp_sec_type_none,
  588. cdp_sec_type_wep128,
  589. cdp_sec_type_wep104,
  590. cdp_sec_type_wep40,
  591. cdp_sec_type_tkip,
  592. cdp_sec_type_tkip_nomic,
  593. cdp_sec_type_aes_ccmp,
  594. cdp_sec_type_wapi,
  595. cdp_sec_type_aes_ccmp_256,
  596. cdp_sec_type_aes_gcmp,
  597. cdp_sec_type_aes_gcmp_256,
  598. /* keep this last! */
  599. cdp_num_sec_types
  600. };
  601. /**
  602. * struct cdp_tx_exception_metadata - Exception path parameters
  603. * @peer_id: Peer id of the peer
  604. * @tid: Transmit Identifier
  605. * @tx_encap_type: Transmit encap type (i.e. Raw, Native Wi-Fi, Ethernet)
  606. * @sec_type: sec_type to be passed to HAL
  607. * @is_tx_sniffer: Indicates if the packet has to be sniffed
  608. * @is_intrabss_fwd:
  609. * @ppdu_cookie: 16-bit ppdu cookie that has to be replayed back in completions
  610. * @is_wds_extended:
  611. * @is_mlo_mcast: Indicates if mlo_mcast enable or not
  612. *
  613. * This structure holds the parameters needed in the exception path of tx
  614. *
  615. */
  616. struct cdp_tx_exception_metadata {
  617. uint16_t peer_id;
  618. uint8_t tid;
  619. uint16_t tx_encap_type;
  620. enum cdp_sec_type sec_type;
  621. uint8_t is_tx_sniffer :1,
  622. is_intrabss_fwd :1;
  623. uint16_t ppdu_cookie;
  624. #ifdef QCA_SUPPORT_WDS_EXTENDED
  625. uint8_t is_wds_extended;
  626. #endif
  627. #ifdef WLAN_MCAST_MLO
  628. uint8_t is_mlo_mcast;
  629. #endif
  630. };
  631. /**
  632. * enum wlan_op_mode - Virtual device operation mode
  633. * @wlan_op_mode_unknown: Unknown mode
  634. * @wlan_op_mode_ap: AP mode
  635. * @wlan_op_mode_ibss: IBSS mode
  636. * @wlan_op_mode_sta: STA (client) mode
  637. * @wlan_op_mode_monitor: Monitor mode
  638. * @wlan_op_mode_ocb: OCB mode
  639. * @wlan_op_mode_ndi: NDI mode
  640. */
  641. enum wlan_op_mode {
  642. wlan_op_mode_unknown,
  643. wlan_op_mode_ap,
  644. wlan_op_mode_ibss,
  645. wlan_op_mode_sta,
  646. wlan_op_mode_monitor,
  647. wlan_op_mode_ocb,
  648. wlan_op_mode_ndi,
  649. };
  650. /**
  651. * enum wlan_op_subtype - Virtual device subtype
  652. * @wlan_op_subtype_none: Subtype not applicable
  653. * @wlan_op_subtype_p2p_device: P2P device
  654. * @wlan_op_subtype_p2p_cli: P2P Client
  655. * @wlan_op_subtype_p2p_go: P2P GO
  656. *
  657. * This enum lists the subtypes of a particular virtual
  658. * device.
  659. */
  660. enum wlan_op_subtype {
  661. wlan_op_subtype_none,
  662. wlan_op_subtype_p2p_device,
  663. wlan_op_subtype_p2p_cli,
  664. wlan_op_subtype_p2p_go,
  665. };
  666. /**
  667. * struct cdp_vdev_info - Vdev information
  668. * @vdev_mac_addr: mac address of the vdev
  669. * @vdev_id: ID of the vdev
  670. * @vdev_stats_id: Stats ID of the vdev
  671. * @op_mode: Operation mode of the vdev
  672. * @subtype: subtype of the vdev
  673. * @mld_mac_addr: MLD mac addr of the current vdev.
  674. */
  675. struct cdp_vdev_info {
  676. uint8_t *vdev_mac_addr;
  677. uint8_t vdev_id;
  678. uint8_t vdev_stats_id;
  679. enum wlan_op_mode op_mode;
  680. enum wlan_op_subtype subtype;
  681. #ifdef WLAN_FEATURE_11BE_MLO
  682. uint8_t *mld_mac_addr;
  683. #endif
  684. };
  685. typedef struct cdp_soc_t *ol_txrx_soc_handle;
  686. /**
  687. * typedef ol_txrx_vdev_delete_cb ()- callback registered during vdev detach
  688. * @context:
  689. */
  690. typedef void (*ol_txrx_vdev_delete_cb)(void *context);
  691. /**
  692. * typedef ol_txrx_peer_unmap_sync_cb() - callback registered during peer
  693. * detach sync
  694. * @vdev_id:
  695. * @peer_id_cnt:
  696. * @peer_id_list:
  697. */
  698. typedef QDF_STATUS(*ol_txrx_peer_unmap_sync_cb)(uint8_t vdev_id,
  699. uint32_t peer_id_cnt,
  700. uint16_t *peer_id_list);
  701. /**
  702. * enum txrx_direction - Packet Direction
  703. * @rx_direction: rx path packet
  704. * @tx_direction: tx path packet
  705. */
  706. enum txrx_direction {
  707. rx_direction = 1,
  708. tx_direction = 0,
  709. };
  710. /**
  711. * enum cdp_capabilities- DP capabilities
  712. * @CDP_CFG_DP_TSO: TSO capability
  713. * @CDP_CFG_DP_LRO: LRO capability
  714. * @CDP_CFG_DP_SG: Scatter Gather capability
  715. * @CDP_CFG_DP_GRO: GRO capability
  716. * @CDP_CFG_DP_OL_TX_CSUM: Hardware based TX checksum capability
  717. * @CDP_CFG_DP_OL_RX_CSUM: Hardware based RX checksum capability
  718. * @CDP_CFG_DP_RAWMODE: RAW mode capability
  719. * @CDP_CFG_DP_PEER_FLOW_CTRL: Peer flow-control capability
  720. * @CDP_CFG_DP_MARK_NOTIFY_FRAME_SUPPORT: mark notify frames capability
  721. */
  722. enum cdp_capabilities {
  723. CDP_CFG_DP_TSO,
  724. CDP_CFG_DP_LRO,
  725. CDP_CFG_DP_SG,
  726. CDP_CFG_DP_GRO,
  727. CDP_CFG_DP_OL_TX_CSUM,
  728. CDP_CFG_DP_OL_RX_CSUM,
  729. CDP_CFG_DP_RAWMODE,
  730. CDP_CFG_DP_PEER_FLOW_CTRL,
  731. CDP_CFG_DP_MARK_NOTIFY_FRAME_SUPPORT,
  732. };
  733. /**
  734. * struct ol_txrx_nbuf_classify - Packet classification object
  735. * @peer_id: unique peer identifier from fw
  736. * @tid: traffic identifier(could be overridden)
  737. * @pkt_tid: traffic identifier(cannot be overridden)
  738. * @pkt_tos: ip header tos value
  739. * @pkt_dscp: ip header dscp value
  740. * @tos: index value in map
  741. * @dscp: DSCP_TID map index
  742. * @is_mcast: multicast pkt check
  743. * @is_eap: eapol pkt check
  744. * @is_arp: arp pkt check
  745. * @is_tcp: tcp pkt check
  746. * @is_dhcp: dhcp pkt check
  747. * @is_igmp: igmp pkt check
  748. * @is_ipv4: ip version 4 pkt check
  749. * @is_ipv6: ip version 6 pkt check
  750. */
  751. struct ol_txrx_nbuf_classify {
  752. uint16_t peer_id;
  753. uint8_t tid;
  754. uint8_t pkt_tid;
  755. uint8_t pkt_tos;
  756. uint8_t pkt_dscp;
  757. uint8_t tos;
  758. uint8_t dscp;
  759. uint8_t is_mcast;
  760. uint8_t is_eap;
  761. uint8_t is_arp;
  762. uint8_t is_tcp;
  763. uint8_t is_dhcp;
  764. uint8_t is_igmp;
  765. uint8_t is_ipv4;
  766. uint8_t is_ipv6;
  767. };
  768. /*
  769. * typedef ol_osif_vdev_handle - opaque handle for OS shim virtual
  770. * device object
  771. */
  772. struct ol_osif_vdev_t;
  773. typedef struct ol_osif_vdev_t *ol_osif_vdev_handle;
  774. #ifdef QCA_SUPPORT_WDS_EXTENDED
  775. struct ol_osif_peer_t;
  776. typedef struct ol_osif_peer_t *ol_osif_peer_handle;
  777. #endif
  778. /**
  779. * enum connectivity_stats_pkt_status - data pkt type
  780. * @PKT_TYPE_REQ: Request packet
  781. * @PKT_TYPE_RSP: Response packet
  782. * @PKT_TYPE_TX_DROPPED: TX packet dropped
  783. * @PKT_TYPE_RX_DROPPED: RX packet dropped
  784. * @PKT_TYPE_RX_DELIVERED: RX packet delivered
  785. * @PKT_TYPE_RX_REFUSED: RX packet refused
  786. * @PKT_TYPE_TX_HOST_FW_SENT: TX packet FW sent
  787. * @PKT_TYPE_TX_ACK_CNT:TC packet acked
  788. * @PKT_TYPE_NONE: Invalid packet
  789. */
  790. enum connectivity_stats_pkt_status {
  791. PKT_TYPE_REQ,
  792. PKT_TYPE_RSP,
  793. PKT_TYPE_TX_DROPPED,
  794. PKT_TYPE_RX_DROPPED,
  795. PKT_TYPE_RX_DELIVERED,
  796. PKT_TYPE_RX_REFUSED,
  797. PKT_TYPE_TX_HOST_FW_SENT,
  798. PKT_TYPE_TX_ACK_CNT,
  799. PKT_TYPE_NONE,
  800. };
  801. /**
  802. * typedef ol_txrx_mgmt_tx_cb() - tx management delivery notification
  803. * callback function
  804. * @ctxt:
  805. * @tx_mgmt_frm:
  806. * @had_error:
  807. */
  808. typedef void
  809. (*ol_txrx_mgmt_tx_cb)(void *ctxt, qdf_nbuf_t tx_mgmt_frm, int had_error);
  810. /**
  811. * typedef ol_txrx_data_tx_cb() - Function registered with the data path
  812. * that is called when tx frames marked as "no free" are
  813. * done being transmitted
  814. * @ctxt:
  815. * @tx_frm:
  816. * @had_error:
  817. */
  818. typedef void
  819. (*ol_txrx_data_tx_cb)(void *ctxt, qdf_nbuf_t tx_frm, int had_error);
  820. /**
  821. * typedef ol_txrx_tx_fp() - top-level transmit function
  822. * @soc: dp soc handle
  823. * @vdev_id: handle to the virtual device object
  824. * @msdu_list: list of network buffers
  825. */
  826. typedef qdf_nbuf_t (*ol_txrx_tx_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
  827. qdf_nbuf_t msdu_list);
  828. /**
  829. * typedef ol_txrx_tx_fast_fp() - top-level fast transmit function
  830. * @soc: dp soc handle
  831. * @vdev_id: handle to the virtual device object
  832. * @msdu_list: list of network buffers
  833. */
  834. typedef qdf_nbuf_t (*ol_txrx_tx_fast_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
  835. qdf_nbuf_t msdu_list);
  836. /**
  837. * typedef ol_txrx_tx_exc_fp() - top-level transmit function on exception path
  838. * @soc: dp soc handle
  839. * @vdev_id: handle to the virtual device object
  840. * @msdu_list: list of network buffers
  841. * @tx_exc_metadata: structure that holds parameters to exception path
  842. */
  843. typedef qdf_nbuf_t (*ol_txrx_tx_exc_fp)(struct cdp_soc_t *soc, uint8_t vdev_id,
  844. qdf_nbuf_t msdu_list,
  845. struct cdp_tx_exception_metadata
  846. *tx_exc_metadata);
  847. /**
  848. * typedef ol_txrx_completion_fp() - top-level transmit function
  849. * for tx completion
  850. * @skb: skb data
  851. * @osif_dev: the virtual device's OS shim object
  852. * @flag: flag
  853. */
  854. typedef void (*ol_txrx_completion_fp)(qdf_nbuf_t skb,
  855. void *osif_dev, uint16_t flag);
  856. /**
  857. * typedef ol_txrx_classify_critical_pkt_fp() - classification cb for critical
  858. * frames
  859. * @osif_dev: the virtual device's OS shim object
  860. * @skb: skb data
  861. */
  862. typedef void (*ol_txrx_classify_critical_pkt_fp)(void *osif_dev,
  863. qdf_nbuf_t skb);
  864. /**
  865. * typedef ol_txrx_tx_flow_control_fp() - tx flow control notification
  866. * function from txrx to OS shim
  867. * @osif_dev: the virtual device's OS shim object
  868. * @tx_resume: tx os q should be resumed or not
  869. */
  870. typedef void (*ol_txrx_tx_flow_control_fp)(void *osif_dev,
  871. bool tx_resume);
  872. /**
  873. * typedef ol_txrx_tx_flow_control_is_pause_fp() - is tx paused by flow control
  874. * function from txrx to OS shim
  875. * @osif_dev: the virtual device's OS shim object
  876. *
  877. * Return: true if tx is paused by flow control
  878. */
  879. typedef bool (*ol_txrx_tx_flow_control_is_pause_fp)(void *osif_dev);
  880. /**
  881. * typedef ol_txrx_rx_fp() - receive function to hand batches of data
  882. * frames from txrx to OS shim
  883. * @osif_dev: handle to the OSIF virtual device object
  884. * @msdu_list: list of network buffers
  885. */
  886. typedef QDF_STATUS(*ol_txrx_rx_fp)(void *osif_dev, qdf_nbuf_t msdu_list);
  887. typedef QDF_STATUS(*ol_txrx_fisa_rx_fp)(void *soc,
  888. void *dp_vdev,
  889. qdf_nbuf_t msdu_list);
  890. typedef QDF_STATUS(*ol_txrx_fisa_flush_fp)(void *soc, int ring_num);
  891. /**
  892. * typedef ol_txrx_rx_flush_fp() - receive function to hand batches of
  893. * data frames from txrx to OS shim
  894. * @osif_dev: handle to the OSIF virtual device object
  895. * @vdev_id: vdev_if of the packets to be flushed
  896. */
  897. typedef QDF_STATUS(*ol_txrx_rx_flush_fp)(void *osif_dev, uint8_t vdev_id);
  898. /**
  899. * typedef ol_txrx_rx_gro_flush_ind_fp() - function to send GRO flush
  900. * indication to stack for a given
  901. * RX Context Id.
  902. * @osif_dev: handle to the OSIF virtual device object
  903. * @rx_ctx_id: Rx context Id for which gro flush should happen
  904. */
  905. typedef QDF_STATUS(*ol_txrx_rx_gro_flush_ind_fp)(void *osif_dev,
  906. int rx_ctx_id);
  907. /**
  908. * typedef ol_txrx_stats_rx_fp() - receive function to hand batches of
  909. * data frames from txrx to OS shim
  910. * @skb: skb data
  911. * @osif_dev: the virtual device's OS shim object
  912. * @action: data packet type
  913. * @pkt_type: packet data type
  914. */
  915. typedef void (*ol_txrx_stats_rx_fp)(struct sk_buff *skb,
  916. void *osif_dev, enum connectivity_stats_pkt_status action,
  917. uint8_t *pkt_type);
  918. /**
  919. * typedef ol_txrx_get_key_fp() - function to gey key based on keyix
  920. * and peer mac address
  921. * @osif_dev: the virtual device's OS shim object
  922. * @key_buf: pointer to store key
  923. * @mac_addr: pointer to mac address
  924. * @keyix: key id
  925. */
  926. typedef QDF_STATUS(*ol_txrx_get_key_fp)(void *osif_dev, uint8_t *key_buf,
  927. uint8_t *mac_addr, uint8_t keyix);
  928. /**
  929. * typedef ol_txrx_rsim_rx_decap_fp() - raw mode simulation function
  930. * to decap the packets in
  931. * receive path.
  932. * @osif_dev: the virtual device's OS shim object
  933. * @list_head: pointer to head of receive packet queue to decap
  934. * @list_tail: pointer to tail of receive packet queue to decap
  935. * @peer_mac: mac address of peer handler
  936. */
  937. typedef QDF_STATUS(*ol_txrx_rsim_rx_decap_fp)(void *osif_dev,
  938. qdf_nbuf_t *list_head,
  939. qdf_nbuf_t *list_tail);
  940. /**
  941. * typedef ol_txrx_tx_free_ext_fp() - external tx free function to
  942. * read per packet stats and free
  943. * tx buffer externally
  944. * @netbuf: tx network buffer
  945. */
  946. typedef void (*ol_txrx_tx_free_ext_fp)(qdf_nbuf_t netbuf);
  947. /**
  948. * typedef ol_txrx_rx_check_wai_fp() - OSIF WAPI receive function
  949. * @vdev:
  950. * @mpdu_head:
  951. * @mpdu_tail:
  952. */
  953. typedef bool (*ol_txrx_rx_check_wai_fp)(ol_osif_vdev_handle vdev,
  954. qdf_nbuf_t mpdu_head,
  955. qdf_nbuf_t mpdu_tail);
  956. /**
  957. * typedef ol_txrx_rx_mon_fp() - OSIF monitor mode receive function for single
  958. * MPDU (802.11 format)
  959. * @vdev:
  960. * @mpdu:
  961. * @rx_status:
  962. */
  963. typedef void (*ol_txrx_rx_mon_fp)(ol_osif_vdev_handle vdev,
  964. qdf_nbuf_t mpdu,
  965. void *rx_status);
  966. /**
  967. * typedef ol_txrx_proxy_arp_fp() - proxy arp function pointer
  968. * @vdev:
  969. * @netbuf:
  970. */
  971. typedef int (*ol_txrx_proxy_arp_fp)(ol_osif_vdev_handle vdev,
  972. qdf_nbuf_t netbuf);
  973. /**
  974. * typedef ol_txrx_mcast_me_fp() - function pointer for multicast enhancement
  975. * @vdev:
  976. * @netbuf:
  977. */
  978. typedef int (*ol_txrx_mcast_me_fp)(ol_osif_vdev_handle vdev,
  979. qdf_nbuf_t netbuf);
  980. /**
  981. * typedef ol_txrx_stats_callback() - statistics notify callback
  982. * @ctxt:
  983. * @type:
  984. * @buf:
  985. * @bytes:
  986. */
  987. typedef void (*ol_txrx_stats_callback)(void *ctxt,
  988. enum htt_cmn_dbg_stats_type type,
  989. uint8_t *buf, int bytes);
  990. /**
  991. * typedef ol_txrx_pktdump_cb() - callback for packet dump feature
  992. * @soc:
  993. * @pdev_id:
  994. * @vdev_id:
  995. * @netbuf:
  996. * @status:
  997. * @type:
  998. */
  999. typedef void (*ol_txrx_pktdump_cb)(ol_txrx_soc_handle soc,
  1000. uint8_t pdev_id,
  1001. uint8_t vdev_id,
  1002. qdf_nbuf_t netbuf,
  1003. enum qdf_dp_tx_rx_status status,
  1004. enum qdf_pkt_type type);
  1005. /**
  1006. * typedef ol_txrx_get_tsf_time() - callback to get tsf time
  1007. * @osif_dev:
  1008. * @input_time:
  1009. * @tsf_time:
  1010. */
  1011. typedef QDF_STATUS(*ol_txrx_get_tsf_time)(void *osif_dev, uint64_t input_time,
  1012. uint64_t *tsf_time);
  1013. /**
  1014. * struct ol_txrx_ops - (pointers to) the functions used for tx and rx
  1015. * data xfer
  1016. *
  1017. * There are two portions of these txrx operations.
  1018. * The rx portion is filled in by OSIF SW before calling
  1019. * ol_txrx_osif_vdev_register; inside the ol_txrx_osif_vdev_register
  1020. * the txrx SW stores a copy of these rx function pointers, to use
  1021. * as it delivers rx data frames to the OSIF SW.
  1022. * The tx portion is filled in by the txrx SW inside
  1023. * ol_txrx_osif_vdev_register; when the function call returns,
  1024. * the OSIF SW stores a copy of these tx functions to use as it
  1025. * delivers tx data frames to the txrx SW.
  1026. *
  1027. * @tx: tx function pointers - specified by txrx, stored by OS shim
  1028. * @tx.std: the tx function pointer for standard data
  1029. * frames This function pointer is set by the txrx SW
  1030. * perform host-side transmit operations based on
  1031. * whether a HL or LL host/target interface is in use.
  1032. * @tx.flow_control_cb: the transmit flow control
  1033. * function that is registered by the
  1034. * OSIF which is called from txrx to
  1035. * indicate whether the transmit OS
  1036. * queues should be paused/resumed
  1037. * @rx: rx function pointers - specified by OS shim, stored by txrx
  1038. * @rx.rx: the OS shim rx function to deliver rx data
  1039. * frames to. This can have different values for
  1040. * different virtual devices, e.g. so one virtual
  1041. * device's OS shim directly hands rx frames to the OS,
  1042. * but another virtual device's OS shim filters out P2P
  1043. * messages before sending the rx frames to the OS. The
  1044. * netbufs delivered to the osif_rx function are in the
  1045. * format specified by the OS to use for tx and rx
  1046. * frames (either 802.3 or native WiFi). In case RX Threads are enabled, pkts
  1047. * are given to the thread, instead of the stack via this pointer.
  1048. * @rx.rx_eapol: This rx function pointer used to receive only eapol frames
  1049. * @rx.stack: function to give packets to the stack. Differs from @rx.rx.
  1050. * In case RX Threads are enabled, this pointer holds the callback to give
  1051. * packets to the stack.
  1052. * @rx.rx_gro_flush: GRO flush indication to stack for a given RX CTX ID
  1053. * @rx.wai_check: the tx function pointer for WAPI frames
  1054. * @rx.mon: the OS shim rx monitor function to deliver
  1055. * monitor data to Though in practice, it is probable
  1056. * that the same function will be used for delivering
  1057. * rx monitor data for all virtual devices, in theory
  1058. * each different virtual device can have a different
  1059. * OS shim function for accepting rx monitor data. The
  1060. * netbufs delivered to the osif_rx_mon function are in
  1061. * 802.11 format. Each netbuf holds a 802.11 MPDU, not
  1062. * an 802.11 MSDU. Depending on compile-time
  1063. * configuration, each netbuf may also have a
  1064. * monitor-mode encapsulation header such as a radiotap
  1065. * header added before the MPDU contents.
  1066. * @rx.std: the OS shim rx function to deliver rx data
  1067. * @proxy_arp: proxy arp function pointer - specified by
  1068. * OS shim, stored by txrx
  1069. * @me_convert:
  1070. * @get_key: function pointer to get key of the peer with
  1071. * specific key index
  1072. * @get_tsf_time: function pointer to get TSF
  1073. */
  1074. struct ol_txrx_ops {
  1075. struct {
  1076. ol_txrx_tx_fp tx;
  1077. ol_txrx_tx_fast_fp tx_fast;
  1078. ol_txrx_tx_exc_fp tx_exception;
  1079. ol_txrx_tx_free_ext_fp tx_free_ext;
  1080. ol_txrx_completion_fp tx_comp;
  1081. ol_txrx_classify_critical_pkt_fp tx_classify_critical_pkt_cb;
  1082. } tx;
  1083. struct {
  1084. ol_txrx_rx_fp rx;
  1085. #ifdef QCA_SUPPORT_EAPOL_OVER_CONTROL_PORT
  1086. ol_txrx_rx_fp rx_eapol;
  1087. #endif
  1088. ol_txrx_rx_fp rx_stack;
  1089. ol_txrx_rx_flush_fp rx_flush;
  1090. ol_txrx_rx_gro_flush_ind_fp rx_gro_flush;
  1091. ol_txrx_rx_check_wai_fp wai_check;
  1092. ol_txrx_rx_mon_fp mon;
  1093. ol_txrx_stats_rx_fp stats_rx;
  1094. ol_txrx_rsim_rx_decap_fp rsim_rx_decap;
  1095. ol_txrx_fisa_rx_fp osif_fisa_rx;
  1096. ol_txrx_fisa_flush_fp osif_fisa_flush;
  1097. } rx;
  1098. /* proxy arp function pointer - specified by OS shim, stored by txrx */
  1099. ol_txrx_proxy_arp_fp proxy_arp;
  1100. ol_txrx_mcast_me_fp me_convert;
  1101. ol_txrx_get_key_fp get_key;
  1102. ol_txrx_get_tsf_time get_tsf_time;
  1103. };
  1104. /**
  1105. * struct ol_txrx_hardtart_ctxt - handlers for dp tx path
  1106. * @tx: normal tx function
  1107. * @tx_fast: fast tx function
  1108. * @tx_exception: exception tx function
  1109. */
  1110. struct ol_txrx_hardtart_ctxt {
  1111. ol_txrx_tx_fp tx;
  1112. ol_txrx_tx_fast_fp tx_fast;
  1113. ol_txrx_tx_exc_fp tx_exception;
  1114. };
  1115. /**
  1116. * struct ol_txrx_stats_req - specifications of the requested
  1117. * statistics
  1118. * @stats_type_upload_mask: which stats to upload
  1119. * @stats_type_reset_mask: which stats to reset
  1120. * @print: control to print uploaded stats. stats will be printed if
  1121. * either print element is set
  1122. * @print.verbose: verbose stats printout
  1123. * @print.concise: concise stats printout (takes precedence)
  1124. * @callback: callback context
  1125. * @callback.fp: function pointer to call. stats notify callback will
  1126. * be invoked if fp is non-NULL
  1127. * @callback.ctxt: opaque context to pass to callback function
  1128. * @copy: copy context
  1129. * @copy.buf: stats will be copied into the specified buffer if buf is
  1130. * non-NULL
  1131. * @byte_limit: don't copy more than this
  1132. * @wait: wait context
  1133. * @wait.blocking: If true, the caller will take the specified
  1134. * semaphore to wait for the stats to be uploaded, and
  1135. * the driver will release the semaphore when the
  1136. * stats are done being uploaded.
  1137. * @wait.sem_ptr: Semaphore to use for blocking
  1138. */
  1139. struct ol_txrx_stats_req {
  1140. uint32_t stats_type_upload_mask;
  1141. uint32_t stats_type_reset_mask;
  1142. struct {
  1143. int verbose;
  1144. int concise;
  1145. } print;
  1146. struct {
  1147. ol_txrx_stats_callback fp;
  1148. void *ctxt;
  1149. } callback;
  1150. struct {
  1151. uint8_t *buf;
  1152. int byte_limit;
  1153. } copy;
  1154. struct {
  1155. int blocking;
  1156. qdf_semaphore_t *sem_ptr;
  1157. } wait;
  1158. };
  1159. /* DP soc struct definition */
  1160. struct cdp_soc_t {
  1161. struct cdp_ops *ops;
  1162. struct ol_if_ops *ol_ops;
  1163. };
  1164. /**
  1165. * enum cdp_peer_param_type - different types of parameters
  1166. * to set values in peer
  1167. * @CDP_CONFIG_NAWDS: Enable nawds mode
  1168. * @CDP_CONFIG_NAC: Enable nac
  1169. * @CDP_CONFIG_ISOLATION: Enable isolation
  1170. * @CDP_CONFIG_IN_TWT: In TWT session or not
  1171. */
  1172. enum cdp_peer_param_type {
  1173. CDP_CONFIG_NAWDS,
  1174. CDP_CONFIG_NAC,
  1175. CDP_CONFIG_ISOLATION,
  1176. CDP_CONFIG_IN_TWT,
  1177. };
  1178. /**
  1179. * enum cdp_pdev_param_type - different types of parameters
  1180. * to set values in pdev
  1181. * @CDP_CONFIG_DEBUG_SNIFFER: Enable debug sniffer feature
  1182. * @CDP_CONFIG_BPR_ENABLE: Enable bcast probe feature
  1183. * @CDP_CONFIG_PRIMARY_RADIO: Configure radio as primary
  1184. * @CDP_CONFIG_ENABLE_PERPKT_TXSTATS: Enable per packet statistics
  1185. * @CDP_CONFIG_IGMPMLD_OVERRIDE: Override IGMP/MLD
  1186. * @CDP_CONFIG_IGMPMLD_TID: Configurable TID value when igmmld_override is set
  1187. * @CDP_CONFIG_ARP_DBG_CONF: Enable ARP debug
  1188. * @CDP_CONFIG_CAPTURE_LATENCY: Capture time latency
  1189. * @CDP_INGRESS_STATS: Accumulate ingress statistics
  1190. * @CDP_OSIF_DROP: Accumulate drops in OSIF layer
  1191. * @CDP_CONFIG_ENH_RX_CAPTURE: Enable enhanced RX capture
  1192. * @CDP_CONFIG_ENH_TX_CAPTURE: Enable enhanced TX capture
  1193. * @CDP_CONFIG_HMMC_TID_OVERRIDE: Enable hmmc tid override
  1194. * @CDP_CONFIG_HMMC_TID_VALUE: set hmmc tid value
  1195. * @CDP_CONFIG_TX_CAPTURE: set tx capture
  1196. * @CDP_CHAN_NOISE_FLOOR: set channel noise floor
  1197. * @CDP_CONFIG_VOW: set/get vow config
  1198. * @CDP_TIDQ_OVERRIDE: set/get tid queue override
  1199. * @CDP_TIDMAP_PRTY: set/get tid map prty
  1200. * @CDP_TX_PENDING: get tx pending
  1201. * @CDP_FILTER_NEIGH_PEERS: filter neighbour peers
  1202. * @CDP_FILTER_UCAST_DATA: filter unicast data
  1203. * @CDP_FILTER_MCAST_DATA: filter multicast data
  1204. * @CDP_FILTER_NO_DATA: filter no data
  1205. * @CDP_MONITOR_CHANNEL: monitor channel
  1206. * @CDP_MONITOR_FREQUENCY: monitor frequency
  1207. * @CDP_CONFIG_BSS_COLOR: configure bss color
  1208. * @CDP_SET_ATF_STATS_ENABLE: set ATF stats flag
  1209. * @CDP_CONFIG_SPECIAL_VAP: Configure Special vap
  1210. * @CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE: Enable scan spcl vap stats reset
  1211. * @CDP_CONFIG_ENHANCED_STATS_ENABLE:
  1212. * @CDP_ISOLATION: set isolation flag
  1213. * @CDP_CONFIG_UNDECODED_METADATA_CAPTURE_ENABLE: Undecoded metadata capture
  1214. */
  1215. enum cdp_pdev_param_type {
  1216. CDP_CONFIG_DEBUG_SNIFFER,
  1217. CDP_CONFIG_BPR_ENABLE,
  1218. CDP_CONFIG_PRIMARY_RADIO,
  1219. CDP_CONFIG_ENABLE_PERPKT_TXSTATS,
  1220. CDP_CONFIG_IGMPMLD_OVERRIDE,
  1221. CDP_CONFIG_IGMPMLD_TID,
  1222. CDP_CONFIG_ARP_DBG_CONF,
  1223. CDP_CONFIG_CAPTURE_LATENCY,
  1224. CDP_INGRESS_STATS,
  1225. CDP_OSIF_DROP,
  1226. CDP_CONFIG_ENH_RX_CAPTURE,
  1227. CDP_CONFIG_ENH_TX_CAPTURE,
  1228. CDP_CONFIG_HMMC_TID_OVERRIDE,
  1229. CDP_CONFIG_HMMC_TID_VALUE,
  1230. CDP_CONFIG_TX_CAPTURE,
  1231. CDP_CHAN_NOISE_FLOOR,
  1232. CDP_CONFIG_VOW,
  1233. CDP_TIDQ_OVERRIDE,
  1234. CDP_TIDMAP_PRTY,
  1235. CDP_TX_PENDING,
  1236. CDP_FILTER_NEIGH_PEERS,
  1237. CDP_FILTER_UCAST_DATA,
  1238. CDP_FILTER_MCAST_DATA,
  1239. CDP_FILTER_NO_DATA,
  1240. CDP_MONITOR_CHANNEL,
  1241. CDP_MONITOR_FREQUENCY,
  1242. CDP_CONFIG_BSS_COLOR,
  1243. CDP_SET_ATF_STATS_ENABLE,
  1244. CDP_CONFIG_SPECIAL_VAP,
  1245. CDP_RESET_SCAN_SPCL_VAP_STATS_ENABLE,
  1246. CDP_CONFIG_ENHANCED_STATS_ENABLE,
  1247. CDP_ISOLATION,
  1248. CDP_CONFIG_UNDECODED_METADATA_CAPTURE_ENABLE,
  1249. };
  1250. /**
  1251. * typedef cdp_config_param_type - union of different types of parameters
  1252. * to set values into dp handles.
  1253. *
  1254. * @cdp_peer_param_nawds: Enable nawds mode
  1255. * @cdp_peer_param_isolation: Enable isolation
  1256. * @cdp_peer_param_in_twt: in TWT session or not
  1257. * @cdp_peer_param_nac: Enable nac
  1258. *
  1259. * @cdp_vdev_param_nawds: set nawds enable/disable
  1260. * @cdp_vdev_param_mcast_en: enable/disable multicast enhancement
  1261. * @cdp_vdev_param_wds: wds sta
  1262. * @cdp_vdev_param_mec: MEC enable flags
  1263. * @cdp_vdev_param_proxysta: proxy sta
  1264. * @cdp_vdev_param_tdls_flags: tdls link flags
  1265. * @cdp_vdev_param_ap_brdg_en: set ap_bridging enable/disable
  1266. * @cdp_vdev_param_cipher_en: set cipher type based on security
  1267. * @cdp_vdev_param_qwrap_isolation: qwrap isolation mode
  1268. * @cdp_vdev_param_tx_encap: tx encap type
  1269. * @cdp_vdev_param_rx_decap: rx decap type
  1270. * @cdp_vdev_param_mesh_rx_filter: set mesh rx filter
  1271. * @cdp_vdev_param_tidmap_prty: set tid vdev prty
  1272. * @cdp_vdev_param_tidmap_tbl_id: set tidmap table id
  1273. * @cdp_vdev_param_mesh_mode: set mesh mode
  1274. * @cdp_vdev_param_safe_mode: set safe mode
  1275. * @cdp_vdev_param_drop_unenc: set drop unencrypted flag
  1276. * @cdp_vdev_param_hlos_tid_override: set hlos tid override
  1277. * @cdp_vdev_param_peer_authorize: set peer authorize
  1278. * @cdp_vdev_param_peer_tid_latency_enable: set peer tid latency enable flag
  1279. * @cdp_vdev_param_mesh_tid: config tatency tid on vdev
  1280. * @cdp_vdev_param_dscp_tid_map_id: set dscp to tid map id
  1281. * @cdp_vdev_param_mcast_vdev: set mcast vdev params
  1282. * @cdp_vdev_param_wrap: qwrap ap vap
  1283. *
  1284. * @cdp_pdev_param_dbg_snf: Enable debug sniffer feature
  1285. * @cdp_pdev_param_bpr_enable: Enable bcast probe feature
  1286. * @cdp_pdev_param_primary_radio: Configure radio as primary
  1287. * @cdp_pdev_param_en_perpkt_txstats: Enable per packet statistics
  1288. * @cdp_pdev_param_igmpmld_override: Override IGMP/MLD
  1289. * @cdp_pdev_param_igmpmld_tid: TID value when igmmld_override is set
  1290. * @cdp_pdev_param_arp_dbg_conf: Enable ARP debug
  1291. * @cdp_pdev_param_cptr_latcy: Capture time latency
  1292. * @cdp_pdev_param_ingrs_stats: Accumulate ingress statistics
  1293. * @cdp_pdev_param_osif_drop: Accumulate drops in OSIF layer
  1294. * @cdp_pdev_param_en_rx_cap: Enable enhanced RX capture
  1295. * @cdp_pdev_param_en_tx_cap: Enable enhanced TX capture
  1296. * @cdp_pdev_param_hmmc_tid_ovrd: Enable hmmc tid override
  1297. * @cdp_pdev_param_hmmc_tid: set hmmc tid value
  1298. * @cdp_pdev_param_tx_capture: set tx capture
  1299. * @cdp_pdev_param_chn_noise_flr: set channel noise floor
  1300. * @cdp_pdev_param_cfg_vow: set/get vow config
  1301. * @cdp_pdev_param_tidq_override: set/get tid queue override
  1302. * @cdp_pdev_param_mon_freq: set monitor frequency
  1303. * @cdp_pdev_param_bss_color: configure bss color
  1304. * @cdp_pdev_param_tidmap_prty: set/get tid map prty
  1305. * @cdp_pdev_param_tx_pending: get tx pending
  1306. * @cdp_pdev_param_fltr_neigh_peers: filter neighbour peers
  1307. * @cdp_pdev_param_fltr_ucast: filter unicast data
  1308. * @cdp_pdev_param_fltr_mcast: filter multicast data
  1309. * @cdp_pdev_param_fltr_none: filter no data
  1310. * @cdp_pdev_param_monitor_chan: monitor channel
  1311. * @cdp_pdev_param_atf_stats_enable: ATF stats enable
  1312. * @cdp_pdev_param_config_special_vap: Configure Special vap
  1313. * @cdp_pdev_param_isolation : set isolation mode
  1314. *
  1315. * @cdp_psoc_param_en_rate_stats: set rate stats enable/disable
  1316. * @cdp_psoc_param_en_nss_cfg: set nss cfg
  1317. * @cdp_psoc_param_ppeds_enabled: PPE-DS feature enable
  1318. * @cdp_ipa_enabled : set ipa mode
  1319. * @cdp_psoc_param_vdev_stats_hw_offload: Configure HW vdev stats offload
  1320. * @cdp_pdev_param_undecoded_metadata_enable: Undecoded metadata capture enable
  1321. * @cdp_sawf_enabled: SAWF enable/disable
  1322. * @cdp_sawf_stats: SAWF stats config
  1323. * @cdp_vdev_param_traffic_end_ind: Traffic end indication enable/disable
  1324. * @cdp_skel_enable : Enable/Disable skeleton code for Umac reset debug
  1325. * @cdp_drop_tx_mcast: Enable/Disable tx mcast drop
  1326. * @cdp_vdev_tx_to_fw: Set to_fw bit for all tx packets for the vdev
  1327. */
  1328. typedef union cdp_config_param_t {
  1329. /* peer params */
  1330. bool cdp_peer_param_nawds;
  1331. bool cdp_peer_param_isolation;
  1332. uint8_t cdp_peer_param_nac;
  1333. bool cdp_peer_param_in_twt;
  1334. /* vdev params */
  1335. bool cdp_vdev_param_wds;
  1336. bool cdp_vdev_param_mec;
  1337. bool cdp_vdev_param_nawds;
  1338. bool cdp_vdev_param_proxysta;
  1339. bool cdp_vdev_param_tdls_flags;
  1340. bool cdp_vdev_param_ap_brdg_en;
  1341. bool cdp_vdev_param_qwrap_isolation;
  1342. bool cdp_vdev_param_update_multipass;
  1343. uint8_t cdp_vdev_param_da_war;
  1344. uint8_t cdp_vdev_param_mcast_en;
  1345. uint8_t cdp_vdev_param_igmp_mcast_en;
  1346. uint8_t cdp_vdev_param_tidmap_prty;
  1347. uint8_t cdp_vdev_param_tidmap_tbl_id;
  1348. uint32_t cdp_vdev_param_aging_tmr;
  1349. uint32_t cdp_vdev_param_cipher_en;
  1350. uint32_t cdp_vdev_param_tx_encap;
  1351. uint32_t cdp_vdev_param_rx_decap;
  1352. uint32_t cdp_vdev_param_mesh_rx_filter;
  1353. uint32_t cdp_vdev_param_mesh_mode;
  1354. uint32_t cdp_vdev_param_safe_mode;
  1355. uint32_t cdp_vdev_param_drop_unenc;
  1356. uint8_t cdp_vdev_param_hlos_tid_override;
  1357. bool cdp_vdev_param_wds_ext;
  1358. uint8_t cdp_vdev_param_peer_authorize;
  1359. uint8_t cdp_vdev_param_peer_tid_latency_enable;
  1360. uint8_t cdp_vdev_param_mesh_tid;
  1361. uint8_t cdp_vdev_param_dscp_tid_map_id;
  1362. bool cdp_vdev_param_mcast_vdev;
  1363. bool cdp_vdev_param_wrap;
  1364. /* pdev params */
  1365. bool cdp_pdev_param_cptr_latcy;
  1366. bool cdp_pdev_param_hmmc_tid_ovrd;
  1367. bool cdp_pdev_param_fltr_neigh_peers;
  1368. bool cdp_pdev_param_cfg_vow;
  1369. bool cdp_pdev_param_fltr_mcast;
  1370. bool cdp_pdev_param_fltr_none;
  1371. bool cdp_pdev_param_fltr_ucast;
  1372. uint8_t cdp_pdev_param_primary_radio;
  1373. uint8_t cdp_pdev_param_en_rx_cap;
  1374. uint8_t cdp_pdev_param_en_tx_cap;
  1375. uint8_t cdp_pdev_param_tx_capture;
  1376. uint8_t cdp_pdev_param_hmmc_tid;
  1377. uint8_t cdp_pdev_param_tidmap_prty;
  1378. uint8_t cdp_pdev_param_igmpmld_override;
  1379. uint8_t cdp_pdev_param_igmpmld_tid;
  1380. uint8_t cdp_pdev_param_arp_dbg_conf;
  1381. uint8_t cdp_pdev_param_tidq_override;
  1382. uint8_t cdp_pdev_param_bss_color;
  1383. uint16_t cdp_pdev_param_chn_noise_flr;
  1384. qdf_freq_t cdp_pdev_param_mon_freq;
  1385. int cdp_pdev_param_dbg_snf;
  1386. int cdp_pdev_param_bpr_enable;
  1387. int cdp_pdev_param_monitor_chan;
  1388. uint32_t cdp_pdev_param_ingrs_stats;
  1389. uint32_t cdp_pdev_param_osif_drop;
  1390. uint32_t cdp_pdev_param_en_perpkt_txstats;
  1391. uint32_t cdp_pdev_param_tx_pending;
  1392. bool cdp_pdev_param_atf_stats_enable;
  1393. bool cdp_pdev_param_config_special_vap;
  1394. bool cdp_pdev_param_reset_scan_spcl_vap_stats_enable;
  1395. bool cdp_pdev_param_enhanced_stats_enable;
  1396. bool cdp_pdev_param_isolation;
  1397. /* psoc params */
  1398. bool cdp_psoc_param_en_rate_stats;
  1399. int cdp_psoc_param_en_nss_cfg;
  1400. int cdp_psoc_param_preferred_hw_mode;
  1401. bool cdp_psoc_param_pext_stats;
  1402. bool cdp_psoc_param_ppeds_enabled;
  1403. bool cdp_skip_bar_update;
  1404. bool cdp_ipa_enabled;
  1405. bool cdp_psoc_param_vdev_stats_hw_offload;
  1406. bool cdp_pdev_param_undecoded_metadata_enable;
  1407. bool cdp_sawf_enabled;
  1408. uint8_t cdp_sawf_stats;
  1409. bool cdp_drop_3addr_mcast;
  1410. bool cdp_vdev_param_traffic_end_ind;
  1411. bool cdp_umac_rst_skel;
  1412. bool cdp_drop_tx_mcast;
  1413. bool cdp_vdev_tx_to_fw;
  1414. } cdp_config_param_type;
  1415. /**
  1416. * enum cdp_rx_enh_capture_mode - Rx enhanced capture modes
  1417. * @CDP_RX_ENH_CAPTURE_DISABLED: Disable Rx enhance capture
  1418. * @CDP_RX_ENH_CAPTURE_MPDU: Enable capture of 128 bytes of each MPDU
  1419. * @CDP_RX_ENH_CAPTURE_MPDU_MSDU: Enable capture of 128 bytes of each MSDU
  1420. */
  1421. enum cdp_rx_enh_capture_mode {
  1422. CDP_RX_ENH_CAPTURE_DISABLED = 0,
  1423. CDP_RX_ENH_CAPTURE_MPDU,
  1424. CDP_RX_ENH_CAPTURE_MPDU_MSDU,
  1425. };
  1426. /**
  1427. * enum cdp_rx_enh_capture_peer - Rx enhanced capture peer filtering
  1428. * @CDP_RX_ENH_CAPTURE_PEER_DISABLED: Disable Rx ENH capture peer filtering
  1429. * @CDP_RX_ENH_CAPTURE_PEER_ENABLED: Enable Rx ENH capture peer filtering
  1430. */
  1431. enum cdp_rx_enh_capture_peer {
  1432. CDP_RX_ENH_CAPTURE_PEER_DISABLED = 0,
  1433. CDP_RX_ENH_CAPTURE_PEER_ENABLED,
  1434. };
  1435. /**
  1436. * enum cdp_tx_enh_capture_mode - Tx enhanced capture modes
  1437. * @CDP_TX_ENH_CAPTURE_DISABLED: Disable Tx enhance capture for all peers
  1438. * @CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS: Enable tx capture for all peers
  1439. * @CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER: Enable/disable per peer as necessary
  1440. * @CDP_TX_ENH_CAPTURE_MAX: Max value
  1441. */
  1442. enum cdp_tx_enh_capture_mode {
  1443. CDP_TX_ENH_CAPTURE_DISABLED = 0,
  1444. CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS,
  1445. CDP_TX_ENH_CAPTURE_ENDIS_PER_PEER,
  1446. CDP_TX_ENH_CAPTURE_MAX,
  1447. };
  1448. /**
  1449. * enum cdp_pdev_bpr_param - different types of parameters
  1450. * to set value in pdev
  1451. * @CDP_BPR_DISABLE: Set bpr to disable state
  1452. * @CDP_BPR_ENABLE: set bpr to enable state
  1453. *
  1454. * Enum indicating bpr state to enable/disable.
  1455. */
  1456. enum cdp_pdev_bpr_param {
  1457. CDP_BPR_DISABLE,
  1458. CDP_BPR_ENABLE,
  1459. };
  1460. /**
  1461. * enum cdp_vdev_param_type - different types of parameters
  1462. * to set values in vdev
  1463. * @CDP_ENABLE_NAWDS: set nawds enable/disable
  1464. * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
  1465. * @CDP_ENABLE_WDS: wds sta
  1466. * @CDP_ENABLE_MEC: MEC enable flags
  1467. * @CDP_ENABLE_DA_WAR:
  1468. * @CDP_ENABLE_PROXYSTA: proxy sta
  1469. * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
  1470. * @CDP_CFG_WDS_AGING_TIMER: modify/stop wds aging timer
  1471. * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
  1472. * @CDP_ENABLE_CIPHER: set cipher type based on security
  1473. * @CDP_ENABLE_QWRAP_ISOLATION: qwrap isolation mode
  1474. * @CDP_UPDATE_MULTIPASS: enable/disable multipass
  1475. * @CDP_TX_ENCAP_TYPE: tx encap type
  1476. * @CDP_RX_DECAP_TYPE: rx decap type
  1477. * @CDP_MESH_RX_FILTER: set mesh rx filter
  1478. * @CDP_TID_VDEV_PRTY: set tid vdev prty
  1479. * @CDP_TIDMAP_TBL_ID: set tidmap table id
  1480. * @CDP_MESH_MODE: set mesh mode
  1481. * @CDP_SAFEMODE: set safe mode
  1482. * @CDP_DROP_UNENC: set drop unencrypted flag
  1483. * @CDP_ENABLE_IGMP_MCAST_EN: enable/disable igmp multicast enhancement
  1484. * @CDP_ENABLE_HLOS_TID_OVERRIDE: set hlos tid override flag
  1485. * @CDP_CFG_WDS_EXT: enable/disable wds ext feature
  1486. * @CDP_DROP_TX_MCAST: enable/disable tx mcast drop
  1487. * @CDP_ENABLE_PEER_AUTHORIZE: enable peer authorize flag
  1488. * @CDP_ENABLE_PEER_TID_LATENCY: set peer tid latency enable flag
  1489. * @CDP_SET_VAP_MESH_TID: Set latency tid in vap
  1490. * @CDP_SKIP_BAR_UPDATE_AP: enable/disable bar
  1491. * @CDP_UPDATE_DSCP_TO_TID_MAP: Set DSCP to TID map id
  1492. * @CDP_SET_MCAST_VDEV: Set primary mcast vdev
  1493. * @CDP_RESET_MLO_MCAST_VDEV: Reset mlo mcast vdev settings
  1494. * @CDP_SET_MCAST_VDEV_HW_UPDATE: Not in use
  1495. * @CDP_DROP_3ADDR_MCAST: enable/disable drop 3addr multicast flag
  1496. * @CDP_ENABLE_WRAP: qwrap ap
  1497. * @CDP_ENABLE_TRAFFIC_END_INDICATION: enable/disable traffic end indication
  1498. * @CDP_VDEV_TX_TO_FW: Set to_fw bit for tx packets for the vdev
  1499. */
  1500. enum cdp_vdev_param_type {
  1501. CDP_ENABLE_NAWDS,
  1502. CDP_ENABLE_MCAST_EN,
  1503. CDP_ENABLE_WDS,
  1504. CDP_ENABLE_MEC,
  1505. CDP_ENABLE_DA_WAR,
  1506. CDP_ENABLE_PROXYSTA,
  1507. CDP_UPDATE_TDLS_FLAGS,
  1508. CDP_CFG_WDS_AGING_TIMER,
  1509. CDP_ENABLE_AP_BRIDGE,
  1510. CDP_ENABLE_CIPHER,
  1511. CDP_ENABLE_QWRAP_ISOLATION,
  1512. CDP_UPDATE_MULTIPASS,
  1513. CDP_TX_ENCAP_TYPE,
  1514. CDP_RX_DECAP_TYPE,
  1515. CDP_MESH_RX_FILTER,
  1516. CDP_TID_VDEV_PRTY,
  1517. CDP_TIDMAP_TBL_ID,
  1518. #ifdef MESH_MODE_SUPPORT
  1519. CDP_MESH_MODE,
  1520. #endif
  1521. CDP_SAFEMODE,
  1522. CDP_DROP_UNENC,
  1523. CDP_ENABLE_IGMP_MCAST_EN,
  1524. CDP_ENABLE_HLOS_TID_OVERRIDE,
  1525. #ifdef QCA_SUPPORT_WDS_EXTENDED
  1526. CDP_CFG_WDS_EXT,
  1527. CDP_DROP_TX_MCAST,
  1528. #endif /* QCA_SUPPORT_WDS_EXTENDED */
  1529. CDP_ENABLE_PEER_AUTHORIZE,
  1530. #ifdef WLAN_SUPPORT_MESH_LATENCY
  1531. CDP_ENABLE_PEER_TID_LATENCY,
  1532. CDP_SET_VAP_MESH_TID,
  1533. #endif
  1534. #ifdef WLAN_VENDOR_SPECIFIC_BAR_UPDATE
  1535. CDP_SKIP_BAR_UPDATE_AP,
  1536. #endif
  1537. CDP_UPDATE_DSCP_TO_TID_MAP,
  1538. CDP_SET_MCAST_VDEV,
  1539. CDP_RESET_MLO_MCAST_VDEV,
  1540. CDP_SET_MCAST_VDEV_HW_UPDATE,
  1541. CDP_DROP_3ADDR_MCAST,
  1542. CDP_ENABLE_WRAP,
  1543. #ifdef DP_TRAFFIC_END_INDICATION
  1544. CDP_ENABLE_TRAFFIC_END_INDICATION,
  1545. #endif
  1546. #ifdef FEATURE_DIRECT_LINK
  1547. CDP_VDEV_TX_TO_FW,
  1548. #endif
  1549. };
  1550. /**
  1551. * enum cdp_psoc_param_type - different types of parameters
  1552. * to set values in psoc
  1553. * @CDP_ENABLE_RATE_STATS: set rate stats enable/disable
  1554. * @CDP_SET_NSS_CFG: set nss cfg
  1555. * @CDP_SET_PREFERRED_HW_MODE: set preferred hw mode
  1556. * @CDP_CFG_PEER_EXT_STATS: Peer extended stats mode.
  1557. * @CDP_IPA_ENABLE : set IPA enable mode.
  1558. * @CDP_CFG_VDEV_STATS_HW_OFFLOAD: HW Vdev stats config
  1559. * @CDP_SAWF_ENABLE:
  1560. * @CDP_UMAC_RST_SKEL_ENABLE: Enable Umac reset skeleton code for debug
  1561. * @CDP_PPEDS_ENABLE: PPEDS is enabled or not
  1562. * @CDP_SAWF_STATS: set SAWF stats config
  1563. */
  1564. enum cdp_psoc_param_type {
  1565. CDP_ENABLE_RATE_STATS,
  1566. CDP_SET_NSS_CFG,
  1567. CDP_SET_PREFERRED_HW_MODE,
  1568. CDP_CFG_PEER_EXT_STATS,
  1569. CDP_IPA_ENABLE,
  1570. CDP_CFG_VDEV_STATS_HW_OFFLOAD,
  1571. CDP_SAWF_ENABLE,
  1572. CDP_UMAC_RST_SKEL_ENABLE,
  1573. CDP_PPEDS_ENABLE,
  1574. CDP_SAWF_STATS,
  1575. };
  1576. #define TXRX_FW_STATS_TXSTATS 1
  1577. #define TXRX_FW_STATS_RXSTATS 2
  1578. #define TXRX_FW_STATS_RX_RATE_INFO 3
  1579. #define TXRX_FW_STATS_PHYSTATS 4
  1580. #define TXRX_FW_STATS_PHYSTATS_CONCISE 5
  1581. #define TXRX_FW_STATS_TX_RATE_INFO 6
  1582. #define TXRX_FW_STATS_TID_STATE 7
  1583. #define TXRX_FW_STATS_HOST_STATS 8
  1584. #define TXRX_FW_STATS_CLEAR_HOST_STATS 9
  1585. #define TXRX_FW_STATS_CE_STATS 10
  1586. #define TXRX_FW_STATS_VOW_UMAC_COUNTER 11
  1587. #define TXRX_FW_STATS_ME_STATS 12
  1588. #define TXRX_FW_STATS_TXBF_INFO 13
  1589. #define TXRX_FW_STATS_SND_INFO 14
  1590. #define TXRX_FW_STATS_ERROR_INFO 15
  1591. #define TXRX_FW_STATS_TX_SELFGEN_INFO 16
  1592. #define TXRX_FW_STATS_TX_MU_INFO 17
  1593. #define TXRX_FW_SIFS_RESP_INFO 18
  1594. #define TXRX_FW_RESET_STATS 19
  1595. #define TXRX_FW_MAC_WDOG_STATS 20
  1596. #define TXRX_FW_MAC_DESC_STATS 21
  1597. #define TXRX_FW_MAC_FETCH_MGR_STATS 22
  1598. #define TXRX_FW_MAC_PREFETCH_MGR_STATS 23
  1599. #define TXRX_FW_STATS_DURATION_INFO 24
  1600. #define TXRX_FW_STATS_DURATION_INFO_RESET 25
  1601. #define TXRX_FW_HALPHY_STATS 26
  1602. #define TXRX_FW_COEX_STATS 27
  1603. #define PER_RADIO_FW_STATS_REQUEST 0
  1604. #define PER_VDEV_FW_STATS_REQUEST 1
  1605. /**
  1606. * enum data_stall_log_event_indicator - Module triggering data stall
  1607. * @DATA_STALL_LOG_INDICATOR_UNUSED: Unused
  1608. * @DATA_STALL_LOG_INDICATOR_HOST_DRIVER: Host driver indicates data stall
  1609. * @DATA_STALL_LOG_INDICATOR_FIRMWARE: FW indicates data stall
  1610. * @DATA_STALL_LOG_INDICATOR_FRAMEWORK: Framework indicates data stall
  1611. *
  1612. * Enum indicating the module that indicates data stall event
  1613. */
  1614. enum data_stall_log_event_indicator {
  1615. DATA_STALL_LOG_INDICATOR_UNUSED,
  1616. DATA_STALL_LOG_INDICATOR_HOST_DRIVER,
  1617. DATA_STALL_LOG_INDICATOR_FIRMWARE,
  1618. DATA_STALL_LOG_INDICATOR_FRAMEWORK,
  1619. };
  1620. /**
  1621. * enum data_stall_log_event_type - data stall event type
  1622. * @DATA_STALL_LOG_NONE:
  1623. * @DATA_STALL_LOG_FW_VDEV_PAUSE:
  1624. * @DATA_STALL_LOG_HWSCHED_CMD_FILTER:
  1625. * @DATA_STALL_LOG_HWSCHED_CMD_FLUSH:
  1626. * @DATA_STALL_LOG_FW_RX_REFILL_FAILED:
  1627. * @DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR:
  1628. * @DATA_STALL_LOG_FW_WDOG_ERRORS:
  1629. * @DATA_STALL_LOG_BB_WDOG_ERROR:
  1630. * @DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR:
  1631. * @DATA_STALL_LOG_HOST_STA_TX_TIMEOUT:
  1632. * @DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT:
  1633. * @DATA_STALL_LOG_NUD_FAILURE:
  1634. *
  1635. * Enum indicating data stall event type
  1636. */
  1637. enum data_stall_log_event_type {
  1638. DATA_STALL_LOG_NONE,
  1639. DATA_STALL_LOG_FW_VDEV_PAUSE,
  1640. DATA_STALL_LOG_HWSCHED_CMD_FILTER,
  1641. DATA_STALL_LOG_HWSCHED_CMD_FLUSH,
  1642. DATA_STALL_LOG_FW_RX_REFILL_FAILED,
  1643. DATA_STALL_LOG_FW_RX_FCS_LEN_ERROR,
  1644. DATA_STALL_LOG_FW_WDOG_ERRORS,
  1645. DATA_STALL_LOG_BB_WDOG_ERROR,
  1646. DATA_STALL_LOG_POST_TIM_NO_TXRX_ERROR,
  1647. /* Stall events triggered by host/framework start from 0x100 onwards. */
  1648. DATA_STALL_LOG_HOST_STA_TX_TIMEOUT = 0x100,
  1649. DATA_STALL_LOG_HOST_SOFTAP_TX_TIMEOUT,
  1650. DATA_STALL_LOG_NUD_FAILURE,
  1651. };
  1652. /**
  1653. * enum data_stall_log_recovery_type - data stall recovery type
  1654. * @DATA_STALL_LOG_RECOVERY_NONE:
  1655. * @DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT:
  1656. * @DATA_STALL_LOG_RECOVERY_TRIGGER_PDR:
  1657. *
  1658. * Enum indicating data stall recovery type
  1659. */
  1660. enum data_stall_log_recovery_type {
  1661. DATA_STALL_LOG_RECOVERY_NONE = 0,
  1662. DATA_STALL_LOG_RECOVERY_CONNECT_DISCONNECT,
  1663. DATA_STALL_LOG_RECOVERY_TRIGGER_PDR,
  1664. };
  1665. /**
  1666. * struct data_stall_event_info - data stall info
  1667. * @indicator: Module triggering data stall
  1668. * @data_stall_type: data stall event type
  1669. * @vdev_id_bitmap: vdev_id_bitmap
  1670. * @pdev_id: pdev id
  1671. * @recovery_type: data stall recovery type
  1672. */
  1673. struct data_stall_event_info {
  1674. uint32_t indicator;
  1675. uint32_t data_stall_type;
  1676. uint32_t vdev_id_bitmap;
  1677. uint32_t pdev_id;
  1678. uint32_t recovery_type;
  1679. };
  1680. typedef void (*data_stall_detect_cb)(struct data_stall_event_info *);
  1681. /**
  1682. * enum cdp_stats - options for host and firmware statistics
  1683. * @CDP_TXRX_STATS_0:
  1684. * @CDP_TXRX_STATS_1: HTT Pdev tx stats
  1685. * @CDP_TXRX_STATS_2: HTT Pdev rx stats
  1686. * @CDP_TXRX_STATS_3: HTT Pdev Tx HW Queue stats
  1687. * @CDP_TXRX_STATS_4: HTT Pdev Tx HW Sched stats
  1688. * @CDP_TXRX_STATS_5: HTT Pdev error stats
  1689. * @CDP_TXRX_STATS_6: HTT TQM stats
  1690. * @CDP_TXRX_STATS_7: HTT TQM CMDQ stats
  1691. * @CDP_TXRX_STATS_8: HTT Tx_de_cmn thread stats
  1692. * @CDP_TXRX_STATS_9: HTT Pdev Tx rate stats
  1693. * @CDP_TXRX_STATS_10: HTT Pdev Rx rate stats
  1694. * @CDP_TXRX_STATS_11: HTT Peer stats
  1695. * @CDP_TXRX_STATS_12: HTT Tx Self Gen Info
  1696. * @CDP_TXRX_STATS_13: HTT Tx MU HWQ stats
  1697. * @CDP_TXRX_STATS_14: HTT Ring interface info stats
  1698. * @CDP_TXRX_STATS_15: HTT SRNG info stats
  1699. * @CDP_TXRX_STATS_16: HTT SFM info stats
  1700. * @CDP_TXRX_STATS_17: HTT Pdev tx mu mimo sched info
  1701. * @CDP_TXRX_STATS_18: HTT Peer list details
  1702. * @CDP_TXRX_STATS_19: Reserved
  1703. * @CDP_TXRX_STATS_20: Reset Host stats
  1704. * @CDP_TXRX_STATS_21: Host Rx rate stats
  1705. * @CDP_TXRX_STATS_22: Host Tx rate stats
  1706. * @CDP_TXRX_STATS_23: Host Tx stats
  1707. * @CDP_TXRX_STATS_24: Host Rx stats
  1708. * @CDP_TXRX_STATS_25: Host Ast stats
  1709. * @CDP_TXRX_STATS_26: Host Head/Tail Pointer stats
  1710. * @CDP_TXRX_STATS_27: Host Monitor mode stats
  1711. * @CDP_TXRX_STATS_28: Host Peer entry stats
  1712. * @CDP_TXRX_STATS_29: Host Soc config params info
  1713. * @CDP_TXRX_STATS_30: Host Pdev config params info
  1714. * @CDP_TXRX_STATS_31: Host DP Interrupt Stats
  1715. * @CDP_TXRX_STATS_HTT_MAX:
  1716. * @CDP_TXRX_MAX_STATS:
  1717. */
  1718. enum cdp_stats {
  1719. CDP_TXRX_STATS_0 = 0,
  1720. CDP_TXRX_STATS_1,
  1721. CDP_TXRX_STATS_2,
  1722. CDP_TXRX_STATS_3,
  1723. CDP_TXRX_STATS_4,
  1724. CDP_TXRX_STATS_5,
  1725. CDP_TXRX_STATS_6,
  1726. CDP_TXRX_STATS_7,
  1727. CDP_TXRX_STATS_8,
  1728. CDP_TXRX_STATS_9,
  1729. CDP_TXRX_STATS_10,
  1730. CDP_TXRX_STATS_11,
  1731. CDP_TXRX_STATS_12,
  1732. CDP_TXRX_STATS_13,
  1733. CDP_TXRX_STATS_14,
  1734. CDP_TXRX_STATS_15,
  1735. CDP_TXRX_STATS_16,
  1736. CDP_TXRX_STATS_17,
  1737. CDP_TXRX_STATS_18,
  1738. CDP_TXRX_STATS_19,
  1739. CDP_TXRX_STATS_20,
  1740. CDP_TXRX_STATS_21,
  1741. CDP_TXRX_STATS_22,
  1742. CDP_TXRX_STATS_23,
  1743. CDP_TXRX_STATS_24,
  1744. CDP_TXRX_STATS_25,
  1745. CDP_TXRX_STATS_26,
  1746. CDP_TXRX_STATS_27,
  1747. CDP_TXRX_STATS_28,
  1748. CDP_TXRX_STATS_29,
  1749. CDP_TXRX_STATS_30,
  1750. CDP_TXRX_STATS_31,
  1751. CDP_TXRX_STATS_HTT_MAX = 256,
  1752. CDP_TXRX_MAX_STATS = 265,
  1753. };
  1754. /**
  1755. * enum cdp_stat_update_type - Different Stat update types sent to
  1756. * OL_IF
  1757. * @UPDATE_PEER_STATS: update peer stats
  1758. * @UPDATE_VDEV_STATS: update vdev stats
  1759. * @UPDATE_PDEV_STATS: Update pdev stats
  1760. */
  1761. enum cdp_stat_update_type {
  1762. UPDATE_PEER_STATS = 0,
  1763. UPDATE_VDEV_STATS = 1,
  1764. UPDATE_PDEV_STATS = 2,
  1765. };
  1766. /**
  1767. * struct cdp_tx_sojourn_stats - Tx sojourn stats
  1768. * @ppdu_seq_id: ppdu_seq_id from tx completion
  1769. * @avg_sojourn_msdu: average sojourn msdu time
  1770. * @sum_sojourn_msdu: sum sojourn msdu time
  1771. * @num_msdus: number of msdus per ppdu
  1772. * @cookie: cookie to be used by upper layer
  1773. */
  1774. struct cdp_tx_sojourn_stats {
  1775. uint32_t ppdu_seq_id;
  1776. qdf_ewma_tx_lag avg_sojourn_msdu[CDP_DATA_TID_MAX];
  1777. uint32_t sum_sojourn_msdu[CDP_DATA_TID_MAX];
  1778. uint32_t num_msdus[CDP_DATA_TID_MAX];
  1779. struct cdp_stats_cookie *cookie;
  1780. };
  1781. /**
  1782. * struct cdp_delayed_tx_completion_ppdu_user - Delayed Tx PPDU completion
  1783. * per-user information
  1784. * @frame_ctrl: frame control field in 802.11 header
  1785. * @qos_ctrl: QoS control field in 802.11 header
  1786. * @mpdu_tried_ucast: number of unicast mpdus tried
  1787. * @mpdu_tried_mcast: number of multicastmpdus tried
  1788. * @ltf_size: ltf_size
  1789. * @stbc: stbc
  1790. * @he_re: he_re (range extension)
  1791. * @txbf: txbf
  1792. * @bw: Transmission bandwidth
  1793. * <enum 2 transmit_bw_20_MHz>
  1794. * <enum 3 transmit_bw_40_MHz>
  1795. * <enum 4 transmit_bw_80_MHz>
  1796. * <enum 5 transmit_bw_160_MHz>
  1797. * @nss: NSS 1,2, ...8
  1798. * @mcs: MCS index
  1799. * @preamble: preamble
  1800. * @gi: guard interval 800/400/1600/3200 ns
  1801. * @dcm: dcm
  1802. * @ldpc: ldpc
  1803. * @delayed_ba:
  1804. * @ru_start: RU start index
  1805. * @ru_tones: RU tones length
  1806. * @is_mcast: MCAST or UCAST
  1807. * @user_pos: user position
  1808. * @mu_group_id: mu group id
  1809. * @ppdu_start_timestamp: 64 bits ppdu start timestamp
  1810. * @ppdu_end_timestamp: 64 bits ppdu end timestamp
  1811. */
  1812. struct cdp_delayed_tx_completion_ppdu_user {
  1813. uint32_t frame_ctrl:16,
  1814. qos_ctrl:16;
  1815. uint32_t mpdu_tried_ucast:16,
  1816. mpdu_tried_mcast:16;
  1817. uint32_t ltf_size:2,
  1818. stbc:1,
  1819. he_re:1,
  1820. txbf:4,
  1821. bw:4,
  1822. nss:4,
  1823. mcs:4,
  1824. preamble:4,
  1825. gi:4,
  1826. dcm:1,
  1827. ldpc:1,
  1828. delayed_ba:1;
  1829. uint16_t ru_start;
  1830. uint16_t ru_tones;
  1831. bool is_mcast;
  1832. uint32_t user_pos;
  1833. uint32_t mu_group_id;
  1834. uint64_t ppdu_start_timestamp;
  1835. uint64_t ppdu_end_timestamp;
  1836. };
  1837. /**
  1838. * struct cdp_tx_completion_ppdu_user - Tx PPDU completion per-user information
  1839. * @completion_status: completion status - OK/Filter/Abort/Timeout
  1840. * @tid: TID number
  1841. * @peer_id: Peer ID
  1842. * @mac_addr:
  1843. * @ba_size: Block-Ack size
  1844. * @frame_ctrl: frame control field in 802.11 header
  1845. * @qos_ctrl: QoS control field in 802.11 header
  1846. * @mpdu_tried_ucast: number of unicast mpdus tried
  1847. * @mpdu_tried_mcast: number of multicast mpdus tried
  1848. * @mpdu_success: number of mpdus successfully transmitted
  1849. * @mpdu_failed:
  1850. * @long_retries: long retries
  1851. * @short_retries: short retries
  1852. * @tx_ratecode:
  1853. * @is_ampdu: mpdu aggregate or non-aggregate?
  1854. * @ppdu_type:
  1855. * @pream_punct:
  1856. * @is_seq_num_valid:
  1857. * @success_bytes: bytes successfully transmitted
  1858. * @retry_bytes: bytes retried
  1859. * @failed_bytes:
  1860. * @success_msdus: MSDUs successfully transmitted
  1861. * @retry_msdus: MSDUs retried
  1862. * @retry_mpdus: MPDUs retried
  1863. * @failed_msdus: MSDUs failed transmission
  1864. * @duration: user duration in ppdu
  1865. * @ltf_size: ltf_size
  1866. * @stbc: stbc
  1867. * @he_re: he_re (range extension)
  1868. * @txbf: txbf
  1869. * @bw: Transmission bandwidth
  1870. * <enum 2 transmit_bw_20_MHz>
  1871. * <enum 3 transmit_bw_40_MHz>
  1872. * <enum 4 transmit_bw_80_MHz>
  1873. * <enum 5 transmit_bw_160_MHz>
  1874. * @nss: NSS 1,2, ...8
  1875. * @mcs: MCS index
  1876. * @preamble: preamble
  1877. * @gi: guard interval 800/400/1600/3200 ns
  1878. * @dcm: dcm
  1879. * @ldpc: ldpc
  1880. * @delayed_ba: delayed ba bit
  1881. * @ack_ba_tlv: ack ba recv tlv bit
  1882. * @ba_seq_no: Block Ack sequence number
  1883. * @ba_bitmap: Block Ack bitmap
  1884. * @start_seq: Sequence number of first MPDU
  1885. * @enq_bitmap: Enqueue MPDU bitmap
  1886. * @failed_bitmap:
  1887. * @num_mpdu:
  1888. * @num_msdu:
  1889. * @tx_duration:
  1890. * @ru_start: RU start index
  1891. * @ru_tones: RU tones length
  1892. * @is_mcast: MCAST or UCAST
  1893. * @tx_rate: Transmission Rate
  1894. * @tx_ratekbps:
  1895. * @ack_rssi: ack rssi for separate chains
  1896. * @ack_rssi_valid:
  1897. * @usr_ack_rssi:
  1898. * @user_pos: user position
  1899. * @mu_group_id: mu group id
  1900. * @rix: rate index
  1901. * @is_ppdu_cookie_valid : Indicates that ppdu_cookie is valid
  1902. * @ppdu_cookie: 16-bit ppdu_cookie
  1903. * @sa_is_training: smart antenna training packets indication
  1904. * @rssi_chain: rssi chain per bandwidth
  1905. * @sa_tx_antenna: antenna in which packet is transmitted
  1906. * @sa_max_rates: smart antenna tx feedback info max rates
  1907. * @sa_goodput: smart antenna tx feedback info goodput
  1908. * @current_rate_per: Moving average per
  1909. * @last_enq_seq: last equeue sequence number
  1910. * @is_bss_peer: is bss peer check
  1911. * @mpdu_q: queue of mpdu in a ppdu
  1912. * @mpdus: MPDU list based on enqueue sequence bitmap
  1913. * @pending_retries: pending MPDUs (retries)
  1914. * @tlv_bitmap: per user tlv bitmap
  1915. * @skip: tx capture skip flag
  1916. * @mon_procd: to indicate user processed in ppdu of the sched cmd
  1917. * @debug_copied: flag to indicate bar frame copied
  1918. * @peer_last_delayed_ba: flag to indicate peer last delayed ba
  1919. * @phy_tx_time_us: Phy TX duration for the User
  1920. * @mpdu_bytes: accumulated bytes per mpdu for mem limit feature
  1921. * @punc_mode: puncutured mode to indicate punctured bw
  1922. * @punc_pattern_bitmap: bitmap indicating punctured pattern
  1923. * @mprot_type: medium protection type
  1924. * @msduq_bitmap: msduq bitmap
  1925. * @rts_success: rts success
  1926. * @rts_failure: rts failure
  1927. */
  1928. struct cdp_tx_completion_ppdu_user {
  1929. uint32_t completion_status:8,
  1930. tid:8,
  1931. peer_id:16;
  1932. uint8_t mac_addr[6];
  1933. uint16_t ba_size;
  1934. uint32_t frame_ctrl:16,
  1935. qos_ctrl:16;
  1936. uint32_t mpdu_tried_ucast:16,
  1937. mpdu_tried_mcast:16;
  1938. uint16_t mpdu_success:16;
  1939. uint16_t mpdu_failed:16;
  1940. uint32_t long_retries:4,
  1941. short_retries:4,
  1942. tx_ratecode:16,
  1943. is_ampdu:1,
  1944. ppdu_type:5,
  1945. pream_punct:1,
  1946. is_seq_num_valid:1;
  1947. uint32_t success_bytes;
  1948. uint32_t retry_bytes;
  1949. uint32_t failed_bytes;
  1950. uint32_t success_msdus:16,
  1951. retry_msdus:16;
  1952. uint32_t retry_mpdus;
  1953. uint32_t failed_msdus:16,
  1954. duration:16;
  1955. uint32_t ltf_size:2,
  1956. stbc:1,
  1957. he_re:1,
  1958. txbf:4,
  1959. bw:4,
  1960. nss:4,
  1961. mcs:4,
  1962. preamble:4,
  1963. gi:4,
  1964. dcm:1,
  1965. ldpc:1,
  1966. delayed_ba:1,
  1967. ack_ba_tlv:1;
  1968. uint32_t ba_seq_no;
  1969. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1970. uint32_t start_seq;
  1971. uint32_t enq_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1972. uint32_t failed_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  1973. uint32_t num_mpdu:9,
  1974. num_msdu:16;
  1975. uint32_t tx_duration;
  1976. uint16_t ru_start;
  1977. uint16_t ru_tones;
  1978. bool is_mcast;
  1979. uint32_t tx_rate;
  1980. uint32_t tx_ratekbps;
  1981. uint32_t ack_rssi[CDP_RSSI_CHAIN_LEN];
  1982. bool ack_rssi_valid;
  1983. uint32_t usr_ack_rssi;
  1984. uint32_t user_pos;
  1985. uint32_t mu_group_id;
  1986. uint32_t rix;
  1987. uint8_t is_ppdu_cookie_valid;
  1988. uint16_t ppdu_cookie;
  1989. uint8_t sa_is_training;
  1990. uint32_t rssi_chain[CDP_RSSI_CHAIN_LEN];
  1991. uint32_t sa_tx_antenna;
  1992. /*Max rates for BW: 20MHZ, 40MHZ and 80MHZ and 160MHZ
  1993. * |---------------------------------------|
  1994. * | 16 bits | 16 bits | 16 bits | 16 bits |
  1995. * | BW-1 | BW-2 | BW-3 | BW-4 |
  1996. * | /\ \ |
  1997. * | / \ \ |
  1998. * | / \ \ |
  1999. * | / \ \ |
  2000. * | / \ \ |
  2001. * | / \ \ |
  2002. * |/ \ \ |
  2003. * |[11|8] [5|8] \ |
  2004. * | BW1 PADDED \ |
  2005. * |---------------------------------------|
  2006. */
  2007. uint16_t sa_max_rates[CDP_NUM_SA_BW];
  2008. uint32_t sa_goodput;
  2009. /* below field is used to calculate goodput in non-training period
  2010. * Note: As host is exposing goodput and hence current_rate_per is
  2011. * of no use. It is just for Host computation.
  2012. */
  2013. uint32_t current_rate_per;
  2014. uint32_t last_enq_seq;
  2015. uint8_t is_bss_peer;
  2016. qdf_nbuf_queue_t mpdu_q;
  2017. qdf_nbuf_t *mpdus;
  2018. uint32_t pending_retries;
  2019. uint32_t tlv_bitmap;
  2020. bool skip;
  2021. bool mon_procd;
  2022. bool debug_copied;
  2023. bool peer_last_delayed_ba;
  2024. uint16_t phy_tx_time_us;
  2025. uint32_t mpdu_bytes;
  2026. uint8_t punc_mode;
  2027. uint16_t punc_pattern_bitmap;
  2028. uint32_t msduq_bitmap;
  2029. uint8_t mprot_type:3,
  2030. rts_success:1,
  2031. rts_failure:1;
  2032. };
  2033. /**
  2034. * struct cdp_tx_indication_mpdu_info - Tx MPDU completion information
  2035. * @ppdu_id: PPDU id
  2036. * @tx_duration: user duration in ppdu
  2037. * @frame_type: frame type MGMT/CTRL/DATA/BAR
  2038. * @frame_ctrl: frame control field in 802.11 header
  2039. * @qos_ctrl: QoS control field in 802.11 header
  2040. * @tid: TID number
  2041. * @num_msdu: number of msdu in MPDU
  2042. * @seq_no: Sequence number of first MPDU
  2043. * @ltf_size: ltf_size
  2044. * @he_re: he_re (range extension)
  2045. * @txbf: txbf
  2046. * @bw: Transmission bandwidth
  2047. * <enum 2 transmit_bw_20_MHz>
  2048. * <enum 3 transmit_bw_40_MHz>
  2049. * <enum 4 transmit_bw_80_MHz>
  2050. * <enum 5 transmit_bw_160_MHz>
  2051. * @nss: NSS 1,2, ...8
  2052. * @mcs: MCS index
  2053. * @preamble: preamble
  2054. * @gi: guard interval 800/400/1600/3200 ns
  2055. * @channel: frequency
  2056. * @channel_num: channel number
  2057. * @ack_rssi: ack rssi
  2058. * @ldpc: ldpc
  2059. * @tx_rate: Transmission Rate
  2060. * @mac_address: peer mac address
  2061. * @bss_mac_address: bss mac address
  2062. * @ppdu_start_timestamp: TSF at PPDU start
  2063. * @ppdu_end_timestamp: TSF at PPDU end
  2064. * @ba_start_seq: Block Ack sequence number
  2065. * @ba_bitmap: Block Ack bitmap
  2066. * @ppdu_cookie: 16-bit ppdu_cookie
  2067. * @long_retries: long retries
  2068. * @short_retries: short retries
  2069. * @completion_status: completion status - OK/Filter/Abort/Timeout
  2070. * @resp_type: response type
  2071. * @mprot_type: medium protection type
  2072. * @rts_success: rts success
  2073. * @rts_failure: rts failure
  2074. * @usr_idx: user index
  2075. */
  2076. struct cdp_tx_indication_mpdu_info {
  2077. uint32_t ppdu_id;
  2078. uint32_t tx_duration;
  2079. uint16_t frame_type;
  2080. uint16_t frame_ctrl;
  2081. uint16_t qos_ctrl;
  2082. uint8_t tid;
  2083. uint32_t num_msdu;
  2084. uint32_t seq_no;
  2085. uint32_t ltf_size:2,
  2086. he_re:1,
  2087. txbf:4,
  2088. bw:4,
  2089. nss:4,
  2090. mcs:4,
  2091. preamble:4,
  2092. gi:4;
  2093. uint32_t channel;
  2094. uint8_t channel_num;
  2095. uint32_t ack_rssi;
  2096. uint32_t ldpc;
  2097. uint32_t tx_rate;
  2098. uint8_t mac_address[QDF_MAC_ADDR_SIZE];
  2099. uint8_t bss_mac_address[QDF_MAC_ADDR_SIZE];
  2100. uint64_t ppdu_start_timestamp;
  2101. uint64_t ppdu_end_timestamp;
  2102. uint32_t ba_start_seq;
  2103. uint32_t ba_bitmap[CDP_BA_256_BIT_MAP_SIZE_DWORDS];
  2104. uint16_t ppdu_cookie;
  2105. uint16_t long_retries:4,
  2106. short_retries:4,
  2107. completion_status:8;
  2108. uint16_t resp_type:4,
  2109. mprot_type:3,
  2110. rts_success:1,
  2111. rts_failure:1;
  2112. uint8_t usr_idx;
  2113. };
  2114. /**
  2115. * struct cdp_tx_indication_info - Tx capture information
  2116. * @radiotap_done: Flag to say radiotap already done or not
  2117. * 0 - radiotap not updated
  2118. * 1 - radiotap header updated
  2119. * @mpdu_info: Tx MPDU completion information
  2120. * @mpdu_nbuf: reconstructed mpdu packet
  2121. * @ppdu_desc: tx completion ppdu
  2122. * @osif_vdev: OS IF vdev handle
  2123. */
  2124. struct cdp_tx_indication_info {
  2125. bool radiotap_done;
  2126. struct cdp_tx_indication_mpdu_info mpdu_info;
  2127. qdf_nbuf_t mpdu_nbuf;
  2128. struct cdp_tx_completion_ppdu *ppdu_desc;
  2129. #ifdef QCA_SUPPORT_LITE_MONITOR
  2130. ol_osif_vdev_handle osif_vdev;
  2131. #endif
  2132. };
  2133. /**
  2134. * struct cdp_tx_mgmt_comp_info - Tx mgmt comp info
  2135. * @ppdu_id: ppdu_id
  2136. * @is_sgen_pkt: payload received from wmi or htt path
  2137. * @retries_count: retries count
  2138. * @tx_tsf: 64 bit timestamp
  2139. */
  2140. struct cdp_tx_mgmt_comp_info {
  2141. uint32_t ppdu_id;
  2142. bool is_sgen_pkt;
  2143. uint16_t retries_count;
  2144. uint64_t tx_tsf;
  2145. };
  2146. /**
  2147. * struct cdp_tx_completion_ppdu - Tx PPDU completion information
  2148. * @completion_status: completion status - OK/Filter/Abort/Timeout
  2149. * @ppdu_id: PPDU Id
  2150. * @ppdu_seq_id: ppdu sequence id for sojourn stats
  2151. * @vdev_id: VAP Id
  2152. * @bar_num_users: BA response user count, based on completion common TLV
  2153. * @num_users: Number of users
  2154. * @max_users: Number of users from USR_INFO TLV
  2155. * @last_usr_index:
  2156. * @drop_reason: drop reason from flush status
  2157. * @is_flush: is_flush is set based on flush tlv
  2158. * @flow_type: tx flow type from flush status
  2159. * @queue_type: queue type from flush status
  2160. * @num_mpdu: Number of MPDUs in PPDU
  2161. * @num_msdu: Number of MSDUs in PPDU
  2162. * @frame_type: frame SU or MU
  2163. * @htt_frame_type: frame type from htt
  2164. * @frame_ctrl: frame control of 80211 header
  2165. * @channel: Channel informartion
  2166. * @resp_type: response type
  2167. * @mprot_type: medium protection type
  2168. * @rts_success: rts success
  2169. * @rts_failure: rts failure
  2170. * @phy_mode: phy mode
  2171. * @ack_rssi: RSSI value of last ack packet (units=dB above noise floor)
  2172. * @tx_duration: PPDU airtime
  2173. * @ppdu_start_timestamp: TSF at PPDU start
  2174. * @ppdu_end_timestamp: TSF at PPDU end
  2175. * @ack_timestamp: TSF at the reception of ACK
  2176. * @delayed_ba: Delayed ba flag
  2177. * @beam_change: beam change bit in ppdu for he-information
  2178. * @bss_color: 6 bit value for full bss color
  2179. * @doppler: value for doppler (will be 0 most of the times)
  2180. * @spatial_reuse: value for spatial reuse used in radiotap HE header
  2181. * @usr_nss_sum: Sum of user nss
  2182. * @usr_ru_tones_sum: Sum of user ru_tones
  2183. * @bar_ppdu_id: BAR ppdu_id
  2184. * @bar_tx_duration: BAR tx duration
  2185. * @bar_ppdu_start_timestamp: BAR start timestamp
  2186. * @bar_ppdu_end_timestamp: BAR end timestamp
  2187. * @tlv_bitmap: tlv_bitmap for the PPDU
  2188. * @sched_cmdid: schedule command id
  2189. * @phy_ppdu_tx_time_us: Phy per PPDU TX duration
  2190. * @ppdu_bytes: accumulated bytes per ppdu for mem limit feature
  2191. * @htt_seq_type: Seq type
  2192. * @txmode_type: tx mode type UL/DL
  2193. * @txmode: tx mode
  2194. * @num_ul_users: Number of UL expected users
  2195. * @ch_access_delay: Channel access delay
  2196. * @backoff_ac_valid: Backoff AC valid
  2197. * @backoff_ac: Backoff AC
  2198. * @num_ul_user_resp_valid: Number of UL users response valid
  2199. * @num_ul_user_resp: Number of UL users response
  2200. * @user: per-User stats (array of per-user structures)
  2201. */
  2202. struct cdp_tx_completion_ppdu {
  2203. uint32_t ppdu_id;
  2204. uint32_t ppdu_seq_id;
  2205. uint16_t vdev_id;
  2206. uint16_t bar_num_users;
  2207. uint32_t num_users;
  2208. uint8_t max_users;
  2209. uint8_t last_usr_index;
  2210. uint32_t drop_reason;
  2211. uint32_t is_flush:1,
  2212. flow_type:8,
  2213. queue_type:8;
  2214. uint32_t num_mpdu:9,
  2215. num_msdu:16;
  2216. uint16_t frame_type;
  2217. uint16_t htt_frame_type;
  2218. uint16_t frame_ctrl;
  2219. uint16_t channel;
  2220. uint16_t resp_type:4,
  2221. mprot_type:3,
  2222. rts_success:1,
  2223. rts_failure:1;
  2224. uint16_t phy_mode;
  2225. uint32_t ack_rssi;
  2226. uint32_t tx_duration;
  2227. uint64_t ppdu_start_timestamp;
  2228. uint64_t ppdu_end_timestamp;
  2229. uint64_t ack_timestamp;
  2230. bool delayed_ba;
  2231. uint8_t beam_change;
  2232. uint8_t bss_color;
  2233. uint8_t doppler;
  2234. uint8_t spatial_reuse;
  2235. uint8_t usr_nss_sum;
  2236. uint32_t usr_ru_tones_sum;
  2237. uint32_t bar_ppdu_id;
  2238. uint32_t bar_tx_duration;
  2239. uint64_t bar_ppdu_start_timestamp;
  2240. uint64_t bar_ppdu_end_timestamp;
  2241. uint32_t tlv_bitmap;
  2242. uint16_t sched_cmdid;
  2243. uint16_t phy_ppdu_tx_time_us;
  2244. uint32_t ppdu_bytes;
  2245. uint8_t htt_seq_type;
  2246. uint8_t txmode_type;
  2247. uint8_t txmode;
  2248. uint32_t num_ul_users;
  2249. uint32_t ch_access_delay;
  2250. uint32_t backoff_ac_valid;
  2251. uint32_t backoff_ac;
  2252. uint32_t num_ul_user_resp_valid;
  2253. uint32_t num_ul_user_resp;
  2254. struct cdp_tx_completion_ppdu_user user[];
  2255. };
  2256. /**
  2257. * struct cdp_dev_stats - Network device stats structure
  2258. * @tx_packets: Tx total packets transmitted
  2259. * @tx_errors : Tx error due to FW tx failure, Ring failure DMA etc
  2260. * @tx_dropped: Tx dropped is same as tx errors as above
  2261. * @rx_packets: Rx total packets transmitted
  2262. * @rx_errors : Rx errors
  2263. * @rx_dropped: Rx dropped stats
  2264. * @tx_bytes : Tx total bytes transmitted
  2265. * @rx_bytes : Rx total bytes transmitted
  2266. */
  2267. struct cdp_dev_stats {
  2268. uint32_t tx_packets;
  2269. uint32_t tx_errors;
  2270. uint32_t tx_dropped;
  2271. uint32_t rx_packets;
  2272. uint32_t rx_errors;
  2273. uint32_t rx_dropped;
  2274. uint64_t tx_bytes;
  2275. uint64_t rx_bytes;
  2276. };
  2277. /**
  2278. * struct cdp_rate_stats - Tx/Rx Rate statistics
  2279. * @rate_stats_info_valid: set if the stats are valid
  2280. * @bw: Indicates the BW of the upcoming transmission -
  2281. * <enum 2 transmit_bw_20_MHz>
  2282. * <enum 3 transmit_bw_40_MHz>
  2283. * <enum 4 transmit_bw_80_MHz>
  2284. * <enum 5 transmit_bw_160_MHz>
  2285. * @pkt_type: Transmit Packet Type
  2286. * @stbc: When set, STBC transmission rate was used
  2287. * @ldpc: When set, use LDPC transmission rates
  2288. * @sgi: <enum 0 0_8_us_sgi > Legacy normal GI
  2289. * <enum 1 0_4_us_sgi > Legacy short GI
  2290. * <enum 2 1_6_us_sgi > HE related GI
  2291. * <enum 3 3_2_us_sgi > HE
  2292. * @mcs: Transmit MCS Rate
  2293. * @ofdma: Set when the transmission was an OFDMA transmission
  2294. * @tones_in_ru: The number of tones in the RU used.
  2295. * @resvd0: reserved bits
  2296. * @tsf: Lower 32 bits of the TSF (timestamp when ppdu transmission finished)
  2297. * @peer_id: Peer ID of the flow or MPDU queue
  2298. * @tid: TID of the flow or MPDU queue
  2299. */
  2300. struct cdp_rate_stats {
  2301. uint32_t rate_stats_info_valid:1,
  2302. bw:2,
  2303. pkt_type:4,
  2304. stbc:1,
  2305. ldpc:1,
  2306. sgi:2,
  2307. mcs:4,
  2308. ofdma:1,
  2309. tones_in_ru:12,
  2310. resvd0:4;
  2311. uint32_t tsf;
  2312. uint16_t peer_id;
  2313. uint8_t tid;
  2314. };
  2315. /**
  2316. * struct cdp_tx_completion_msdu - Tx MSDU completion descriptor
  2317. * @ppdu_id: PPDU to which this MSDU belongs
  2318. * @transmit_cnt: Number of times this frame has been transmitted
  2319. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  2320. * @resvd0: reserved bit
  2321. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  2322. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  2323. * @msdu_part_of_amsdu : Indicates this MSDU was part of an A-MSDU in MPDU
  2324. * @extd: Extended structure containing rate statistics
  2325. * @resvd1: reserved bits
  2326. */
  2327. struct cdp_tx_completion_msdu {
  2328. uint32_t ppdu_id;
  2329. uint8_t transmit_cnt;
  2330. uint32_t ack_frame_rssi:8,
  2331. resvd0:1,
  2332. first_msdu:1,
  2333. last_msdu:1,
  2334. msdu_part_of_amsdu:1,
  2335. resvd1:20;
  2336. struct cdp_rate_stats extd;
  2337. };
  2338. /**
  2339. * struct cdp_rx_stats_ppdu_user -- per user RX stats
  2340. * @peer_id: Peer ID
  2341. * @vdev_id: VAP ID
  2342. * @is_ampdu: mpdu aggregate or non-aggregate?
  2343. * @mu_ul_info_valid: MU UL info valid
  2344. * @ofdma_ru_start_index: RU index number(0-73)
  2345. * @ofdma_ru_width: size of RU in units of 1(26tone)RU
  2346. * @nss: NSS 1,2, ...8
  2347. * @mcs: MCS index
  2348. * @user_index: user ID in multi-user case
  2349. * @is_bss_peer: is bss peer check
  2350. * @ast_index: ast index in multi-user case
  2351. * @tid: TID number
  2352. * @num_msdu: Number of MSDUs in PPDU
  2353. * @tcp_msdu_count: Number of TCP MSDUs in PPDU
  2354. * @udp_msdu_count: Number of UDP MSDUs in PPDU
  2355. * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
  2356. * @frame_control: frame control field
  2357. * @frame_control_info_valid: frame_control valid
  2358. * @qos_control: qos control field
  2359. * @qos_control_info_valid: qos_control valid
  2360. * @data_sequence_control_info_valid: data_sequence_control_info valid
  2361. * @first_data_seq_ctrl: Sequence control field of first data frame
  2362. * @preamble_type: preamble
  2363. * @ht_flags: HT flags
  2364. * @vht_flags: VHT flags
  2365. * @he_flags: HE flags
  2366. * @mac_addr: Peer MAC Address
  2367. * @mpdu_cnt_fcs_ok: Number of MPDUs in PPDU with fcs ok
  2368. * @mpdu_cnt_fcs_err: Number of MPDUs in PPDU with fcs err
  2369. * @mpdu_fcs_ok_bitmap: MPDU with fcs ok bitmap
  2370. * @mpdu_ok_byte_count:
  2371. * @mpdu_err_byte_count:
  2372. * @retries: number of retries
  2373. * @rx_ratekbps: rx rate in kbps
  2374. * @rix: rate index
  2375. * @mpdu_retries: retries of mpdu in rx
  2376. * @rx_time_us: Rx duration
  2377. */
  2378. struct cdp_rx_stats_ppdu_user {
  2379. uint16_t peer_id;
  2380. uint8_t vdev_id;
  2381. bool is_ampdu;
  2382. uint32_t mu_ul_info_valid:1,
  2383. ofdma_ru_start_index:7,
  2384. ofdma_ru_width:7,
  2385. nss:4,
  2386. mcs:4;
  2387. /* user id */
  2388. uint8_t user_index;
  2389. uint8_t is_bss_peer;
  2390. uint32_t ast_index;
  2391. uint32_t tid;
  2392. uint32_t num_msdu;
  2393. uint16_t tcp_msdu_count;
  2394. uint16_t udp_msdu_count;
  2395. uint16_t other_msdu_count;
  2396. uint16_t frame_control;
  2397. uint8_t frame_control_info_valid;
  2398. uint16_t qos_control;
  2399. uint8_t qos_control_info_valid;
  2400. uint8_t data_sequence_control_info_valid;
  2401. uint16_t first_data_seq_ctrl;
  2402. uint32_t preamble_type;
  2403. uint16_t ht_flags;
  2404. uint16_t vht_flags;
  2405. uint16_t he_flags;
  2406. uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
  2407. uint32_t mpdu_cnt_fcs_ok;
  2408. uint32_t mpdu_cnt_fcs_err;
  2409. uint32_t mpdu_fcs_ok_bitmap[QDF_MON_STATUS_MPDU_FCS_BMAP_NWORDS];
  2410. uint32_t mpdu_ok_byte_count;
  2411. uint32_t mpdu_err_byte_count;
  2412. uint32_t retries;
  2413. uint32_t rx_ratekbps;
  2414. uint32_t rix;
  2415. uint32_t mpdu_retries;
  2416. uint16_t rx_time_us;
  2417. };
  2418. /**
  2419. * struct cdp_rx_indication_ppdu - Rx PPDU indication structure
  2420. * @ppdu_id: PPDU Id
  2421. * @is_ampdu: mpdu aggregate or non-aggregate?
  2422. * @num_mpdu: Number of MPDUs in PPDU
  2423. * @reserved: Reserved bits for future use
  2424. * @num_msdu: Number of MSDUs in PPDU
  2425. * @num_bytes: Number of bytes
  2426. * @udp_msdu_count: Number of UDP MSDUs in PPDU
  2427. * @tcp_msdu_count: Number of TCP MSDUs in PPDU
  2428. * @other_msdu_count: Number of MSDUs other than UDP and TCP MSDUs in PPDU
  2429. * @duration: PPDU duration
  2430. * @tid: TID number
  2431. * @peer_id: Peer ID
  2432. * @vdev_id: VAP ID
  2433. * @mac_addr: Peer MAC Address
  2434. * @first_data_seq_ctrl: Sequence control field of first data frame
  2435. * @u: union of rate information representations
  2436. * @rate_info: consolidated rate fields
  2437. * @ltf_size: ltf_size
  2438. * @stbc: When set, STBC rate was used
  2439. * @he_re: he_re (range extension)
  2440. * @bw: Bandwidth
  2441. * <enum 0 bw_20_MHz>
  2442. * <enum 1 bw_40_MHz>
  2443. * <enum 2 bw_80_MHz>
  2444. * <enum 3 bw_160_MHz>
  2445. * @nss: NSS 1,2, ...8
  2446. * @mcs: MCS index
  2447. * @preamble: preamble
  2448. * @gi: <enum 0 0_8_us_sgi > Legacy normal GI
  2449. * <enum 1 0_4_us_sgi > Legacy short GI
  2450. * <enum 2 1_6_us_sgi > HE related GI
  2451. * <enum 3 3_2_us_sgi > HE
  2452. * @dcm: dcm
  2453. * @ldpc: ldpc
  2454. * @ppdu_type: SU/MU_MIMO/MU_OFDMA/MU_MIMO_OFDMA/UL_TRIG/BURST_BCN/UL_BSR_RESP/
  2455. * UL_BSR_TRIG/UNKNOWN
  2456. * @rix: rate index
  2457. * @lsig_a: L-SIG in 802.11 PHY header
  2458. * @rssi: RSSI value (units = dB above noise floor)
  2459. * @timestamp: TSF at the reception of PPDU
  2460. * @length: PPDU length
  2461. * @channel: Channel information
  2462. * @beamformed:
  2463. * @rx_ratekbps:
  2464. * @ppdu_rx_rate:
  2465. * @retries:
  2466. * @rx_byte_count:
  2467. * @rx_ratecode:
  2468. * @fcs_error_mpdus:
  2469. * @frame_ctrl: frame control field
  2470. * @rssi_chain: rssi chain per nss per bw
  2471. * @evm_info:
  2472. * @rx_antenna:
  2473. * @num_users:
  2474. * @nf: noise floor
  2475. * @per_chain_rssi: rssi per antenna
  2476. * @is_mcast_bcast:
  2477. * @cfr_info:
  2478. * @punc_bw: punctured bw
  2479. * @phyrx_abort: rx aborted undecoded frame indication
  2480. * @phyrx_abort_reason: abort reason defined in phyrx_abort_request_info
  2481. * @l_sig_length: L SIG A length
  2482. * @l_sig_a_parity: L SIG A parity
  2483. * @l_sig_a_pkt_type: L SIG A info pkt type
  2484. * @l_sig_a_implicit_sounding: L SIG A info captured implicit sounding
  2485. * @vht_crc: Indicate vht crc
  2486. * @group_id:
  2487. * @ht_length: num of bytes in PSDU
  2488. * @ht_smoothing: Indicate ht_smoothing
  2489. * @ht_not_sounding: Indicate ht not sounding
  2490. * @ht_aggregation: Indicate ht aggregation
  2491. * @ht_stbc: Indicate ht stbc
  2492. * @ht_crc: Indicate ht crc
  2493. * @vht_no_txop_ps: Indicate TXOP power save mode
  2494. * @bss_color_id: Indicate BSS color ID
  2495. * @beam_change: Indicates whether spatial mapping is changed
  2496. * @dl_ul_flag: Differentiates between DL and UL transmission
  2497. * @transmit_mcs: Indicates the data MCS
  2498. * @ldpc_extra_sym: LDPC extra symbol
  2499. * @special_reuse: Spatial reuse
  2500. * @ltf_sym: Indictaes HE NSTS
  2501. * @txbf: Indicates whether beamforming is applied
  2502. * @pe_disambiguity: packet extension disambiguity
  2503. * @pre_fec_pad: packet extension a factor
  2504. * @dopplar: Doppler support
  2505. * @txop_duration: Indicates the remaining time in the current TXOP
  2506. * @sig_b_mcs: MCS of HE-SIG-B
  2507. * @sig_b_dcm: DCM of HE-SIG-B
  2508. * @sig_b_sym: Number of symbols of HE-SIG-B
  2509. * @sig_b_comp: Compression mode of HE-SIG-B
  2510. * @he_crc: CRC for HE-SIG contents
  2511. * @usr_nss_sum: Sum of user nss
  2512. * @usr_ru_tones_sum: Sum of user ru_tones
  2513. * @user: per user stats in MU-user case
  2514. */
  2515. struct cdp_rx_indication_ppdu {
  2516. uint32_t ppdu_id;
  2517. uint16_t is_ampdu:1,
  2518. num_mpdu:9,
  2519. reserved:6;
  2520. uint32_t num_msdu;
  2521. uint32_t num_bytes;
  2522. uint16_t udp_msdu_count;
  2523. uint16_t tcp_msdu_count;
  2524. uint16_t other_msdu_count;
  2525. uint16_t duration;
  2526. uint32_t tid:8,
  2527. peer_id:16;
  2528. uint8_t vdev_id;
  2529. uint8_t mac_addr[6];
  2530. uint16_t first_data_seq_ctrl;
  2531. union {
  2532. uint32_t rate_info;
  2533. struct {
  2534. uint32_t ltf_size:2,
  2535. stbc:1,
  2536. he_re:1,
  2537. bw:4,
  2538. nss:4,
  2539. mcs:4,
  2540. preamble:4,
  2541. gi:4,
  2542. dcm:1,
  2543. ldpc:1,
  2544. ppdu_type:5;
  2545. };
  2546. } u;
  2547. uint32_t rix;
  2548. uint32_t lsig_a;
  2549. uint32_t rssi;
  2550. uint64_t timestamp;
  2551. uint32_t length;
  2552. uint8_t channel;
  2553. uint8_t beamformed;
  2554. uint32_t rx_ratekbps;
  2555. uint32_t ppdu_rx_rate;
  2556. uint32_t retries;
  2557. uint32_t rx_byte_count;
  2558. uint16_t rx_ratecode;
  2559. uint8_t fcs_error_mpdus;
  2560. uint16_t frame_ctrl;
  2561. int8_t rssi_chain[SS_COUNT][MAX_BW];
  2562. struct cdp_rx_su_evm_info evm_info;
  2563. uint32_t rx_antenna;
  2564. uint8_t num_users;
  2565. uint32_t nf;
  2566. uint8_t per_chain_rssi[MAX_CHAIN];
  2567. uint8_t is_mcast_bcast;
  2568. #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
  2569. struct cdp_rx_ppdu_cfr_info cfr_info;
  2570. #endif
  2571. uint8_t punc_bw;
  2572. #ifdef QCA_UNDECODED_METADATA_SUPPORT
  2573. bool phyrx_abort;
  2574. uint8_t phyrx_abort_reason;
  2575. uint32_t l_sig_length:12,
  2576. l_sig_a_parity:1,
  2577. l_sig_a_pkt_type:4,
  2578. l_sig_a_implicit_sounding:1,
  2579. vht_crc:8,
  2580. group_id:6;
  2581. uint32_t ht_length:16,
  2582. ht_smoothing:1,
  2583. ht_not_sounding:1,
  2584. ht_aggregation:1,
  2585. ht_stbc:2,
  2586. ht_crc:8,
  2587. vht_no_txop_ps:1;
  2588. uint32_t bss_color_id:6,
  2589. beam_change:1,
  2590. dl_ul_flag:1,
  2591. transmit_mcs:4,
  2592. ldpc_extra_sym:1,
  2593. special_reuse:4,
  2594. ltf_sym:3,
  2595. txbf:1,
  2596. pe_disambiguity:1,
  2597. pre_fec_pad:4,
  2598. dopplar:1;
  2599. uint32_t txop_duration:7,
  2600. sig_b_mcs:3,
  2601. sig_b_dcm:1,
  2602. sig_b_sym:4,
  2603. sig_b_comp:1,
  2604. he_crc:4;
  2605. #endif
  2606. uint8_t usr_nss_sum;
  2607. uint32_t usr_ru_tones_sum;
  2608. struct cdp_rx_stats_ppdu_user user[];
  2609. };
  2610. /**
  2611. * struct cdp_rx_indication_msdu - Rx MSDU info
  2612. * @ppdu_id: PPDU to which the MSDU belongs
  2613. * @msdu_len: Length of MSDU in bytes
  2614. * @ack_frame_rssi: RSSI of the received ACK or BA frame
  2615. * @resvd0: reserved bit
  2616. * @first_msdu: Indicates this MSDU is the first MSDU in AMSDU
  2617. * @last_msdu: Indicates this MSDU is the last MSDU in AMSDU
  2618. * @msdu_part_of_amsdu: Indicates this MSDU was part of an A-MSDU in MPDU
  2619. * @msdu_part_of_ampdu:
  2620. * @resvd1: reserved bit
  2621. * @extd: Extended structure containing rate statistics
  2622. */
  2623. struct cdp_rx_indication_msdu {
  2624. uint32_t ppdu_id;
  2625. uint16_t msdu_len;
  2626. uint32_t ack_frame_rssi:8,
  2627. resvd0:1,
  2628. first_msdu:1,
  2629. last_msdu:1,
  2630. msdu_part_of_amsdu:1,
  2631. msdu_part_of_ampdu:1,
  2632. resvd1:19;
  2633. struct cdp_rate_stats extd;
  2634. };
  2635. /**
  2636. * struct cdp_config_params - Propagate configuration parameters to datapath
  2637. * @tso_enable: Enable/Disable TSO
  2638. * @lro_enable: Enable/Disable LRO
  2639. * @gro_enable: Enable/Disable GRO
  2640. * @flow_steering_enable: Enable/Disable Rx Hash based flow steering
  2641. * @p2p_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for P2P
  2642. * @nan_tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload for NAN
  2643. * @tcp_udp_checksumoffload: Enable/Disable TCP/UDP Checksum Offload
  2644. * @legacy_mode_checksumoffload_disable: Disable TCP/UDP Checksum Offload for
  2645. * legacy modes.
  2646. * @napi_enable: Enable/Disable Napi
  2647. * @ipa_enable: Flag indicating if IPA is enabled or not
  2648. * @tx_flow_stop_queue_threshold: Value to Pause tx queues
  2649. * @tx_flow_start_queue_offset: Available Tx descriptors to unpause
  2650. * tx queue
  2651. * @tx_comp_loop_pkt_limit: Max # of packets to be processed in 1 tx comp loop
  2652. * @rx_reap_loop_pkt_limit: Max # of packets to be processed in 1 rx reap loop
  2653. * @rx_hp_oos_update_limit: Max # of HP OOS (out of sync) updates
  2654. */
  2655. struct cdp_config_params {
  2656. unsigned int tso_enable:1;
  2657. unsigned int lro_enable:1;
  2658. unsigned int gro_enable:1;
  2659. unsigned int flow_steering_enable:1;
  2660. unsigned int p2p_tcp_udp_checksumoffload:1;
  2661. unsigned int nan_tcp_udp_checksumoffload:1;
  2662. unsigned int tcp_udp_checksumoffload:1;
  2663. unsigned int legacy_mode_checksumoffload_disable:1;
  2664. unsigned int napi_enable:1;
  2665. unsigned int ipa_enable:1;
  2666. /* Set when QCA_LL_TX_FLOW_CONTROL_V2 is enabled */
  2667. uint8_t tx_flow_stop_queue_threshold;
  2668. uint8_t tx_flow_start_queue_offset;
  2669. uint32_t tx_comp_loop_pkt_limit;
  2670. uint32_t rx_reap_loop_pkt_limit;
  2671. uint32_t rx_hp_oos_update_limit;
  2672. };
  2673. /**
  2674. * struct cdp_txrx_stats_req - stats request wrapper
  2675. * used to pass request information to cdp layer
  2676. * @stats: type of stats requested
  2677. * @param0: opaque argument 0 to be passed to htt
  2678. * @param1: opaque argument 1 to be passed to htt
  2679. * @param2: opaque argument 2 to be passed to htt
  2680. * @param3: opaque argument 3 to be passed to htt
  2681. * @cookie_val: cookie
  2682. * @mac_id: mac id
  2683. * @peer_addr: peer address
  2684. */
  2685. struct cdp_txrx_stats_req {
  2686. enum cdp_stats stats;
  2687. uint32_t param0;
  2688. uint32_t param1;
  2689. uint32_t param2;
  2690. uint32_t param3;
  2691. uint32_t cookie_val;
  2692. uint8_t mac_id;
  2693. char *peer_addr;
  2694. };
  2695. /**
  2696. * struct cdp_monitor_filter - monitor filter info
  2697. * @mode: set filter mode
  2698. * @fp_mgmt: set Filter Pass MGMT Configuration
  2699. * @fp_ctrl: set Filter Pass CTRL Configuration
  2700. * @fp_data: set Filter Pass DATA Configuration
  2701. * @mo_mgmt: set Monitor Other MGMT Configuration
  2702. * @mo_ctrl: set Monitor Other CTRL Configuration
  2703. * @mo_data: set Monitor other DATA Configuration
  2704. *
  2705. */
  2706. struct cdp_monitor_filter {
  2707. uint16_t mode;
  2708. uint16_t fp_mgmt;
  2709. uint16_t fp_ctrl;
  2710. uint16_t fp_data;
  2711. uint16_t mo_mgmt;
  2712. uint16_t mo_ctrl;
  2713. uint16_t mo_data;
  2714. };
  2715. /**
  2716. * enum cdp_dp_cfg - CDP ENUMs to get to DP configation
  2717. * @cfg_dp_enable_data_stall: context passed to be used by consumer
  2718. * @cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload: get P2P checksum config
  2719. * @cfg_dp_enable_nan_ip_tcp_udp_checksum_offload: get NAN TX checksum config
  2720. * @cfg_dp_enable_ip_tcp_udp_checksum_offload: get TX checksum config for others
  2721. * @cfg_dp_disable_legacy_mode_csum_offload: Disable checksum offload for
  2722. * legacy modes
  2723. * @cfg_dp_tso_enable: get TSO enable config
  2724. * @cfg_dp_lro_enable: get LRO enable config
  2725. * @cfg_dp_gro_enable: get GRO enable config
  2726. * @cfg_dp_tc_based_dyn_gro_enable: get TC based dynamic gro enable config
  2727. * @cfg_dp_tc_ingress_prio: priority value to be checked for tc filters
  2728. * @cfg_dp_sg_enable:
  2729. * @cfg_dp_tx_flow_start_queue_offset: get DP TX flow start queue offset
  2730. * @cfg_dp_tx_flow_stop_queue_threshold: get DP TX flow stop queue threshold
  2731. * @cfg_dp_ipa_uc_tx_buf_size: get IPA TX buf size config
  2732. * @cfg_dp_ipa_uc_tx_partition_base: get IPA UC TX partition base config
  2733. * @cfg_dp_ipa_uc_rx_ind_ring_count: get IPA rx indication ring count config
  2734. * @cfg_dp_enable_flow_steering: get flow steerint enable config
  2735. * @cfg_dp_reorder_offload_supported: get reorder offload support config
  2736. * @cfg_dp_ce_classify_enable: get CE classify enable config
  2737. * @cfg_dp_disable_intra_bss_fwd: get intra bss fwd config
  2738. * @cfg_dp_pktlog_buffer_size: get packet log buffer size config
  2739. * @cfg_dp_wow_check_rx_pending: get wow rx pending frame check config
  2740. */
  2741. enum cdp_dp_cfg {
  2742. cfg_dp_enable_data_stall,
  2743. cfg_dp_enable_p2p_ip_tcp_udp_checksum_offload,
  2744. cfg_dp_enable_nan_ip_tcp_udp_checksum_offload,
  2745. cfg_dp_enable_ip_tcp_udp_checksum_offload,
  2746. cfg_dp_disable_legacy_mode_csum_offload,
  2747. cfg_dp_tso_enable,
  2748. cfg_dp_lro_enable,
  2749. cfg_dp_gro_enable,
  2750. cfg_dp_tc_based_dyn_gro_enable,
  2751. cfg_dp_tc_ingress_prio,
  2752. cfg_dp_sg_enable,
  2753. cfg_dp_tx_flow_start_queue_offset,
  2754. cfg_dp_tx_flow_stop_queue_threshold,
  2755. cfg_dp_ipa_uc_tx_buf_size,
  2756. cfg_dp_ipa_uc_tx_partition_base,
  2757. cfg_dp_ipa_uc_rx_ind_ring_count,
  2758. cfg_dp_enable_flow_steering,
  2759. cfg_dp_reorder_offload_supported,
  2760. cfg_dp_ce_classify_enable,
  2761. cfg_dp_disable_intra_bss_fwd,
  2762. cfg_dp_pktlog_buffer_size,
  2763. cfg_dp_wow_check_rx_pending,
  2764. };
  2765. /**
  2766. * struct cdp_peer_cookie - cookie used when creating peer
  2767. * @ctx: context passed to be used by consumer
  2768. * @mac_addr: MAC address of peer
  2769. * @peer_id: peer id
  2770. * @pdev_id: pdev_id
  2771. * @cookie: cookie to be used by consumer
  2772. */
  2773. struct cdp_peer_cookie {
  2774. struct cdp_stats_cookie *ctx;
  2775. uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
  2776. uint8_t peer_id;
  2777. uint8_t pdev_id;
  2778. uint8_t cookie;
  2779. };
  2780. #ifdef WLAN_SUPPORT_RX_FISA
  2781. struct cdp_flow_stats {
  2782. uint32_t aggr_count;
  2783. uint32_t curr_aggr_count;
  2784. uint32_t flush_count;
  2785. uint32_t bytes_aggregated;
  2786. };
  2787. #else
  2788. /**
  2789. * struct cdp_flow_stats - Per-Flow (5-tuple) statistics
  2790. * @msdu_count: number of rx msdus matching this flow
  2791. * @mon_msdu_count: number of msdus matching this flow in mon path
  2792. *
  2793. * HW also includes msdu_byte_count and timestamp, which
  2794. * are not currently tracked in SW.
  2795. */
  2796. struct cdp_flow_stats {
  2797. uint32_t msdu_count;
  2798. uint32_t mon_msdu_count;
  2799. };
  2800. #endif
  2801. /**
  2802. * enum cdp_flow_fst_operation - RX FST operations allowed
  2803. * @CDP_FLOW_FST_ENTRY_ADD: Add entry
  2804. * @CDP_FLOW_FST_ENTRY_DEL: Delete entry
  2805. * @CDP_FLOW_FST_RX_BYPASS_ENABLE: RX bypass enable
  2806. * @CDP_FLOW_FST_RX_BYPASS_DISABLE: RX bypass disable
  2807. */
  2808. enum cdp_flow_fst_operation {
  2809. CDP_FLOW_FST_ENTRY_ADD,
  2810. CDP_FLOW_FST_ENTRY_DEL,
  2811. CDP_FLOW_FST_RX_BYPASS_ENABLE,
  2812. CDP_FLOW_FST_RX_BYPASS_DISABLE
  2813. };
  2814. /**
  2815. * enum cdp_flow_protocol_type - RX FST supported protocol types,
  2816. * mapped to HW spec
  2817. * @CDP_FLOW_PROTOCOL_TYPE_TCP: TCP
  2818. * @CDP_FLOW_PROTOCOL_TYPE_UDP: UDP
  2819. */
  2820. enum cdp_flow_protocol_type {
  2821. CDP_FLOW_PROTOCOL_TYPE_TCP = 6,
  2822. CDP_FLOW_PROTOCOL_TYPE_UDP = 17,
  2823. };
  2824. /**
  2825. * struct cdp_rx_flow_tuple_info - RX flow tuple info used for addition/deletion
  2826. * @tuple_populated:
  2827. * @is_exception: Flows which are added to flow table but not aggregated.
  2828. * @bypass_fisa: Flow which are not added to flow table.
  2829. * @dest_ip_127_96: destination IP address bit fields 96-127
  2830. * @dest_ip_95_64: destination IP address bit fields 64-95
  2831. * @dest_ip_63_32: destination IP address bit fields 32-63
  2832. * @dest_ip_31_0: destination IP address bit fields 0-31
  2833. * @src_ip_127_96: source IP address bit fields 96-127
  2834. * @src_ip_95_64: source IP address bit fields 64-95
  2835. * @src_ip_63_32: source IP address bit fields 32-63
  2836. * @src_ip_31_0: source IP address bit fields 0-31
  2837. * @dest_port: destination port of flow
  2838. * @src_port: source port of flow
  2839. * @l4_protocol: protocol type in flow (TCP/UDP)
  2840. */
  2841. struct cdp_rx_flow_tuple_info {
  2842. #ifdef WLAN_SUPPORT_RX_FISA
  2843. uint8_t tuple_populated;
  2844. uint8_t is_exception;
  2845. bool bypass_fisa;
  2846. #endif
  2847. uint32_t dest_ip_127_96;
  2848. uint32_t dest_ip_95_64;
  2849. uint32_t dest_ip_63_32;
  2850. uint32_t dest_ip_31_0;
  2851. uint32_t src_ip_127_96;
  2852. uint32_t src_ip_95_64;
  2853. uint32_t src_ip_63_32;
  2854. uint32_t src_ip_31_0;
  2855. uint16_t dest_port;
  2856. uint16_t src_port;
  2857. uint16_t l4_protocol;
  2858. };
  2859. /**
  2860. * struct cdp_rx_flow_info - RX flow info used for addition/deletion
  2861. * @is_addr_ipv4: indicates whether given IP address is IPv4/IPv6
  2862. * @op_code: add/delete/enable/disable operation requested
  2863. * @flow_tuple_info: structure containing tuple info
  2864. * @fse_metadata: metadata to be set in RX flow
  2865. * @use_ppe_ds: use DS mode
  2866. * @priority_vld: is priority valid
  2867. * @service_code: service code for DS
  2868. */
  2869. struct cdp_rx_flow_info {
  2870. bool is_addr_ipv4;
  2871. enum cdp_flow_fst_operation op_code;
  2872. struct cdp_rx_flow_tuple_info flow_tuple_info;
  2873. uint16_t fse_metadata;
  2874. uint8_t use_ppe_ds;
  2875. uint8_t priority_vld;
  2876. uint16_t service_code;
  2877. };
  2878. #ifdef QCA_SUPPORT_SCAN_SPCL_VAP_STATS
  2879. /**
  2880. * struct cdp_scan_spcl_vap_stats - Special vap statistics info
  2881. * @rx_ok_pkts: rx fcs ok pkts count
  2882. * @rx_ok_bytes: rx fcs ok bytes count
  2883. * @rx_err_pkts: rx fcs err pkts count
  2884. * @rx_err_bytes: rx fcs err bytes count
  2885. * @rx_mgmt_pkts: rx mgmt pkts count
  2886. * @rx_ctrl_pkts: rx ctrl pkts count
  2887. * @rx_data_pkts: rx data pkts count
  2888. */
  2889. struct cdp_scan_spcl_vap_stats {
  2890. uint64_t rx_ok_pkts;
  2891. uint64_t rx_ok_bytes;
  2892. uint64_t rx_err_pkts;
  2893. uint64_t rx_err_bytes;
  2894. uint64_t rx_mgmt_pkts;
  2895. uint64_t rx_ctrl_pkts;
  2896. uint64_t rx_data_pkts;
  2897. };
  2898. #endif
  2899. /**
  2900. * struct cdp_soc_attach_params
  2901. *
  2902. * @hif_handle: Opaque HIF handle
  2903. * @htc_handle: Opaque HTC handle
  2904. * @qdf_osdev: QDF device
  2905. * @ol_ops: Offload Operations
  2906. * @device_id: Device ID
  2907. * @ml_context: DP ML object context
  2908. * @mlo_chip_id: MLO chip id, for legacy SOCs chip_id need to 0
  2909. * @mlo_enabled: MLO enable bit
  2910. */
  2911. struct cdp_soc_attach_params {
  2912. struct hif_opaque_softc *hif_handle;
  2913. HTC_HANDLE htc_handle;
  2914. qdf_device_t qdf_osdev;
  2915. struct ol_if_ops *ol_ops;
  2916. uint16_t device_id;
  2917. struct cdp_mlo_ctxt *ml_context;
  2918. uint8_t mlo_chip_id;
  2919. uint8_t mlo_enabled;
  2920. };
  2921. /**
  2922. * struct cdp_pdev_attach_params - params for pdev attach
  2923. *
  2924. * @htc_handle: HTC handle for host-target interface
  2925. * @qdf_osdev: QDF OS device
  2926. * @pdev_id: PDEV ID
  2927. * @mlo_link_id: ML link id
  2928. */
  2929. struct cdp_pdev_attach_params {
  2930. HTC_HANDLE htc_handle;
  2931. qdf_device_t qdf_osdev;
  2932. uint8_t pdev_id;
  2933. uint32_t mlo_link_id;
  2934. };
  2935. /*
  2936. * cdp_txrx_peer_params_update
  2937. *
  2938. * @osif_vdev: Handle for OS shim virtual device
  2939. * @peer_mac: Peer mac address
  2940. * @chip_id: CHIP ID
  2941. * @pdev_id: PDEV ID
  2942. */
  2943. struct cdp_txrx_peer_params_update {
  2944. void *osif_vdev;
  2945. uint8_t *peer_mac;
  2946. uint8_t chip_id;
  2947. uint8_t pdev_id;
  2948. };
  2949. #endif