cdp_txrx_cmn_struct.h 104 KB

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