cdp_txrx_cmn_struct.h 96 KB

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