htt_stats.h 215 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471
  1. /*
  2. * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * @file htt_stats.h
  20. *
  21. * @details the public header file of HTT STATS
  22. */
  23. #ifndef __HTT_STATS_H__
  24. #define __HTT_STATS_H__
  25. #include <htt_deps.h> /* A_UINT32 */
  26. #include <htt_common.h>
  27. /*
  28. * htt_dbg_ext_stats_type -
  29. * The base structure for each of the stats_type is only for reference
  30. * Host should use this information to know the type of TLVs to expect
  31. * for a particular stats type.
  32. *
  33. * Max supported stats :- 256.
  34. */
  35. enum htt_dbg_ext_stats_type {
  36. /* HTT_DBG_EXT_STATS_RESET
  37. * PARAM:
  38. * - config_param0 : start_offset (stats type)
  39. * - config_param1 : stats bmask from start offset
  40. * - config_param2 : stats bmask from start offset + 32
  41. * - config_param3 : stats bmask from start offset + 64
  42. * RESP MSG:
  43. * - No response sent.
  44. */
  45. HTT_DBG_EXT_STATS_RESET = 0,
  46. /* HTT_DBG_EXT_STATS_PDEV_TX
  47. * PARAMS:
  48. * - No Params
  49. * RESP MSG:
  50. * - htt_tx_pdev_stats_t
  51. */
  52. HTT_DBG_EXT_STATS_PDEV_TX = 1,
  53. /* HTT_DBG_EXT_STATS_PDEV_RX
  54. * PARAMS:
  55. * - No Params
  56. * RESP MSG:
  57. * - htt_rx_pdev_stats_t
  58. */
  59. HTT_DBG_EXT_STATS_PDEV_RX = 2,
  60. /* HTT_DBG_EXT_STATS_PDEV_TX_HWQ
  61. * PARAMS:
  62. * - config_param0: [Bit31: Bit0] HWQ mask
  63. * RESP MSG:
  64. * - htt_tx_hwq_stats_t
  65. */
  66. HTT_DBG_EXT_STATS_PDEV_TX_HWQ = 3,
  67. /* HTT_DBG_EXT_STATS_PDEV_TX_SCHED
  68. * PARAMS:
  69. * - config_param0: [Bit31: Bit0] TXQ mask
  70. * RESP MSG:
  71. * - htt_stats_tx_sched_t
  72. */
  73. HTT_DBG_EXT_STATS_PDEV_TX_SCHED = 4,
  74. /* HTT_DBG_EXT_STATS_PDEV_ERROR
  75. * PARAMS:
  76. * - No Params
  77. * RESP MSG:
  78. * - htt_hw_err_stats_t
  79. */
  80. HTT_DBG_EXT_STATS_PDEV_ERROR = 5,
  81. /* HTT_DBG_EXT_STATS_PDEV_TQM
  82. * PARAMS:
  83. * - No Params
  84. * RESP MSG:
  85. * - htt_tx_tqm_pdev_stats_t
  86. */
  87. HTT_DBG_EXT_STATS_PDEV_TQM = 6,
  88. /* HTT_DBG_EXT_STATS_TQM_CMDQ
  89. * PARAMS:
  90. * - config_param0:
  91. * [Bit15: Bit0 ] cmdq id :if 0xFFFF print all cmdq's
  92. * [Bit31: Bit16] reserved
  93. * RESP MSG:
  94. * - htt_tx_tqm_cmdq_stats_t
  95. */
  96. HTT_DBG_EXT_STATS_TQM_CMDQ = 7,
  97. /* HTT_DBG_EXT_STATS_TX_DE_INFO
  98. * PARAMS:
  99. * - No Params
  100. * RESP MSG:
  101. * - htt_tx_de_stats_t
  102. */
  103. HTT_DBG_EXT_STATS_TX_DE_INFO = 8,
  104. /* HTT_DBG_EXT_STATS_PDEV_TX_RATE
  105. * PARAMS:
  106. * - No Params
  107. * RESP MSG:
  108. * - htt_tx_pdev_rate_stats_t
  109. */
  110. HTT_DBG_EXT_STATS_PDEV_TX_RATE = 9,
  111. /* HTT_DBG_EXT_STATS_PDEV_RX_RATE
  112. * PARAMS:
  113. * - No Params
  114. * RESP MSG:
  115. * - htt_rx_pdev_rate_stats_t
  116. */
  117. HTT_DBG_EXT_STATS_PDEV_RX_RATE = 10,
  118. /* HTT_DBG_EXT_STATS_PEER_INFO
  119. * PARAMS:
  120. * - config_param0:
  121. * [Bit0] - [0] for sw_peer_id, [1] for mac_addr based request
  122. * [Bit15 : Bit 1] htt_peer_stats_req_mode_t
  123. * [Bit31 : Bit16] sw_peer_id
  124. * config_param1:
  125. * peer_stats_req_type_mask:32 (enum htt_peer_stats_tlv_enum)
  126. * 0 bit htt_peer_stats_cmn_tlv
  127. * 1 bit htt_peer_details_tlv
  128. * 2 bit htt_tx_peer_rate_stats_tlv
  129. * 3 bit htt_rx_peer_rate_stats_tlv
  130. * 4 bit htt_tx_tid_stats_tlv/htt_tx_tid_stats_v1_tlv
  131. * 5 bit htt_rx_tid_stats_tlv
  132. * 6 bit htt_msdu_flow_stats_tlv
  133. * 7 bit htt_peer_sched_stats_tlv
  134. * - config_param2: [Bit31 : Bit0] mac_addr31to0
  135. * - config_param3: [Bit15 : Bit0] mac_addr47to32
  136. * [Bit 16] If this bit is set, reset per peer stats
  137. * of corresponding tlv indicated by config
  138. * param 1.
  139. * HTT_DBG_EXT_PEER_STATS_RESET_GET will be
  140. * used to get this bit position.
  141. * WMI_SERVICE_PER_PEER_HTT_STATS_RESET
  142. * indicates that FW supports per peer HTT
  143. * stats reset.
  144. * [Bit31 : Bit17] reserved
  145. * RESP MSG:
  146. * - htt_peer_stats_t
  147. */
  148. HTT_DBG_EXT_STATS_PEER_INFO = 11,
  149. /* HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  150. * PARAMS:
  151. * - No Params
  152. * RESP MSG:
  153. * - htt_tx_pdev_selfgen_stats_t
  154. */
  155. HTT_DBG_EXT_STATS_TX_SELFGEN_INFO = 12,
  156. /* HTT_DBG_EXT_STATS_TX_MU_HWQ
  157. * PARAMS:
  158. * - config_param0: [Bit31: Bit0] HWQ mask
  159. * RESP MSG:
  160. * - htt_tx_hwq_mu_mimo_stats_t
  161. */
  162. HTT_DBG_EXT_STATS_TX_MU_HWQ = 13,
  163. /* HTT_DBG_EXT_STATS_RING_IF_INFO
  164. * PARAMS:
  165. * - config_param0:
  166. * [Bit15: Bit0 ] ring id :if 0xFFFF print all rings
  167. * [Bit31: Bit16] reserved
  168. * RESP MSG:
  169. * - htt_ring_if_stats_t
  170. */
  171. HTT_DBG_EXT_STATS_RING_IF_INFO = 14,
  172. /* HTT_DBG_EXT_STATS_SRNG_INFO
  173. * PARAMS:
  174. * - config_param0:
  175. * [Bit15: Bit0 ] ring id :if 0xFFFF print all rings
  176. * [Bit31: Bit16] reserved
  177. * - No Params
  178. * RESP MSG:
  179. * - htt_sring_stats_t
  180. */
  181. HTT_DBG_EXT_STATS_SRNG_INFO = 15,
  182. /* HTT_DBG_EXT_STATS_SFM_INFO
  183. * PARAMS:
  184. * - No Params
  185. * RESP MSG:
  186. * - htt_sfm_stats_t
  187. */
  188. HTT_DBG_EXT_STATS_SFM_INFO = 16,
  189. /* HTT_DBG_EXT_STATS_PDEV_TX_MU
  190. * PARAMS:
  191. * - No Params
  192. * RESP MSG:
  193. * - htt_tx_pdev_mu_mimo_stats_t
  194. */
  195. HTT_DBG_EXT_STATS_PDEV_TX_MU = 17,
  196. /* HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST
  197. * PARAMS:
  198. * - config_param0:
  199. * [Bit7 : Bit0] vdev_id:8
  200. * note:0xFF to get all active peers based on pdev_mask.
  201. * [Bit31 : Bit8] rsvd:24
  202. * RESP MSG:
  203. * - htt_active_peer_details_list_t
  204. */
  205. HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST = 18,
  206. /* HTT_DBG_EXT_STATS_PDEV_CCA_STATS
  207. * PARAMS:
  208. * - config_param0:
  209. * [Bit0] - Clear bit0 to read 1sec,100ms & cumulative CCA stats.
  210. * Set bit0 to 1 to read 1sec interval histogram.
  211. * [Bit1] - 100ms interval histogram
  212. * [Bit3] - Cumulative CCA stats
  213. * RESP MSG:
  214. * - htt_pdev_cca_stats_t
  215. */
  216. HTT_DBG_EXT_STATS_PDEV_CCA_STATS = 19,
  217. /* HTT_DBG_EXT_STATS_TWT_SESSIONS
  218. * PARAMS:
  219. * - config_param0:
  220. * No params
  221. * RESP MSG:
  222. * - htt_pdev_twt_sessions_stats_t
  223. */
  224. HTT_DBG_EXT_STATS_TWT_SESSIONS = 20,
  225. /* HTT_DBG_EXT_STATS_REO_CNTS
  226. * PARAMS:
  227. * - config_param0:
  228. * No params
  229. * RESP MSG:
  230. * - htt_soc_reo_resource_stats_t
  231. */
  232. HTT_DBG_EXT_STATS_REO_RESOURCE_STATS = 21,
  233. /* HTT_DBG_EXT_STATS_TX_SOUNDING_INFO
  234. * PARAMS:
  235. * - config_param0:
  236. * [Bit0] vdev_id_set:1
  237. * set to 1 if vdev_id is set and vdev stats are requested.
  238. * set to 0 if pdev_stats sounding stats are requested.
  239. * [Bit8 : Bit1] vdev_id:8
  240. * note:0xFF to get all active vdevs based on pdev_mask.
  241. * [Bit31 : Bit9] rsvd:22
  242. *
  243. * RESP MSG:
  244. * - htt_tx_sounding_stats_t
  245. */
  246. HTT_DBG_EXT_STATS_TX_SOUNDING_INFO = 22,
  247. /* HTT_DBG_EXT_STATS_PDEV_OBSS_PD_STATS
  248. * PARAMS:
  249. * - config_param0:
  250. * No params
  251. * RESP MSG:
  252. * - htt_pdev_obss_pd_stats_t
  253. */
  254. HTT_DBG_EXT_STATS_PDEV_OBSS_PD_STATS = 23,
  255. /* HTT_DBG_EXT_STATS_RING_BACKPRESSURE_STATS
  256. * PARAMS:
  257. * - config_param0:
  258. * No params
  259. * RESP MSG:
  260. * - htt_stats_ring_backpressure_stats_t
  261. */
  262. HTT_DBG_EXT_STATS_RING_BACKPRESSURE_STATS = 24,
  263. /* HTT_DBG_EXT_STATS_LATENCY_PROF_STATS
  264. * PARAMS:
  265. *
  266. * RESP MSG:
  267. * - htt_soc_latency_prof_t
  268. */
  269. HTT_DBG_EXT_STATS_LATENCY_PROF_STATS = 25,
  270. /* HTT_DBG_EXT_STATS_PDEV_UL_TRIGGER
  271. * PARAMS:
  272. * - No Params
  273. * RESP MSG:
  274. * - htt_rx_pdev_ul_trig_stats_t
  275. */
  276. HTT_DBG_EXT_STATS_PDEV_UL_TRIG_STATS = 26,
  277. /* HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS = 27
  278. * PARAMS:
  279. * - No Params
  280. * RESP MSG:
  281. * - htt_rx_pdev_ul_mumimo_trig_stats_t
  282. */
  283. HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS = 27,
  284. /* HTT_DBG_EXT_STATS_FSE_RX
  285. * PARAMS:
  286. * - No Params
  287. * RESP MSG:
  288. * - htt_rx_fse_stats_t
  289. */
  290. HTT_DBG_EXT_STATS_FSE_RX = 28,
  291. /* HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS
  292. * PARAMS:
  293. * - config_param0: [Bit0] : [1] for mac_addr based request
  294. * - config_param1: [Bit31 : Bit0] mac_addr31to0
  295. * - config_param2: [Bit15 : Bit0] mac_addr47to32
  296. * RESP MSG:
  297. * - htt_ctrl_path_txrx_stats_t
  298. */
  299. HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS = 29,
  300. /* HTT_DBG_EXT_STATS_PDEV_RX_RATE_EXT
  301. * PARAMS:
  302. * - No Params
  303. * RESP MSG:
  304. * - htt_rx_pdev_rate_ext_stats_t
  305. */
  306. HTT_DBG_EXT_STATS_PDEV_RX_RATE_EXT = 30,
  307. /* HTT_DBG_EXT_STATS_PDEV_TX_RATE_TXBF
  308. * PARAMS:
  309. * - No Params
  310. * RESP MSG:
  311. * - htt_tx_pdev_rate_txbf_stats_t
  312. */
  313. HTT_DBG_EXT_STATS_PDEV_TX_RATE_TXBF = 31,
  314. /* HTT_DBG_EXT_STATS_TXBF_OFDMA
  315. */
  316. HTT_DBG_EXT_STATS_TXBF_OFDMA = 32,
  317. /* HTT_DBG_EXT_STA_11AX_UL_STATS
  318. * PARAMS:
  319. * - No Params
  320. * RESP MSG:
  321. * - htt_sta_11ax_ul_stats
  322. */
  323. HTT_DBG_EXT_STA_11AX_UL_STATS = 33,
  324. /* HTT_DBG_EXT_VDEV_RTT_RESP_STATS
  325. * PARAMS:
  326. * - config_param0:
  327. * [Bit7 : Bit0] vdev_id:8
  328. * [Bit31 : Bit8] rsvd:24
  329. * RESP MSG:
  330. * -
  331. */
  332. HTT_DBG_EXT_VDEV_RTT_RESP_STATS = 34,
  333. /* HTT_DBG_EXT_PKTLOG_AND_HTT_RING_STATS
  334. * PARAMS:
  335. * - No Params
  336. * RESP MSG:
  337. * - htt_pktlog_and_htt_ring_stats_t
  338. */
  339. HTT_DBG_EXT_PKTLOG_AND_HTT_RING_STATS = 35,
  340. /* HTT_DBG_EXT_STATS_DLPAGER_STATS
  341. * PARAMS:
  342. *
  343. * RESP MSG:
  344. * - htt_dlpager_stats_t
  345. */
  346. HTT_DBG_EXT_STATS_DLPAGER_STATS = 36,
  347. /* HTT_DBG_EXT_PHY_COUNTERS_AND_PHY_STATS
  348. * PARAMS:
  349. * - No Params
  350. * RESP MSG:
  351. * - htt_phy_counters_and_phy_stats_t
  352. */
  353. HTT_DBG_EXT_PHY_COUNTERS_AND_PHY_STATS = 37,
  354. /* keep this last */
  355. HTT_DBG_NUM_EXT_STATS = 256,
  356. };
  357. /*
  358. * Macros to get/set the bit field in config param[3] that indicates to
  359. * clear corresponding per peer stats specified by config param 1
  360. */
  361. #define HTT_DBG_EXT_PEER_STATS_RESET_M 0x00010000
  362. #define HTT_DBG_EXT_PEER_STATS_RESET_S 16
  363. #define HTT_DBG_EXT_PEER_STATS_RESET_GET(_var) \
  364. (((_var) & HTT_DBG_EXT_PEER_STATS_RESET_M) >> \
  365. HTT_DBG_EXT_PEER_STATS_RESET_S)
  366. #define HTT_DBG_EXT_PEER_STATS_RESET_SET(_var, _val) \
  367. do { \
  368. HTT_CHECK_SET_VAL(HTT_DBG_EXT_PEER_STATS_RESET, _val); \
  369. ((_var) |= ((_val) << HTT_DBG_EXT_PEER_STATS_RESET_S)); \
  370. } while (0)
  371. #define HTT_STATS_SUBTYPE_MAX 16
  372. typedef enum {
  373. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  374. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  375. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  376. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  377. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  378. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  379. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  380. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  381. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  382. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  383. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  384. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  385. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  386. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  387. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  388. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  389. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  390. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  391. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  392. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  393. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  394. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  395. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  396. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  397. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  398. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  399. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  400. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  401. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  402. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  403. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  404. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  405. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  406. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  407. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  408. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  409. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  410. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  411. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  412. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  413. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  414. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  415. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  416. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  417. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  418. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  419. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  420. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  421. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  422. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  423. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  424. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  425. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  426. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  427. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  428. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  429. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  430. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  431. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  432. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  433. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  434. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  435. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  436. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  437. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  438. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  439. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  440. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  441. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  442. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  443. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  444. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  445. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  446. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  447. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  448. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  449. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  450. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  451. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  452. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  453. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  454. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  455. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  456. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  457. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  458. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  459. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  460. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  461. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  462. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  463. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  464. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  465. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  466. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  467. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  468. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  469. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  470. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  471. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  472. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  473. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  474. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  475. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  476. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  477. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  478. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  479. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  480. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  481. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  482. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  483. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  484. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  485. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  486. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  487. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  488. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  489. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  490. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  491. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  492. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  493. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  494. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  495. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  496. HTT_STATS_MAX_TAG,
  497. } htt_tlv_tag_t;
  498. /* htt_mu_stats_upload_t
  499. * Enumerations for specifying whether to upload all MU stats in response to
  500. * HTT_DBG_EXT_STATS_PDEV_TX_MU, or if not all, then which subset.
  501. */
  502. typedef enum {
  503. /* HTT_UPLOAD_MU_STATS: upload all MU stats:
  504. * UL MU-MIMO + DL MU-MIMO + UL MU-OFDMA + DL MU-OFDMA
  505. */
  506. HTT_UPLOAD_MU_STATS,
  507. /* HTT_UPLOAD_MU_MIMO_STATS: upload UL MU-MIMO + DL MU-MIMO stats */
  508. HTT_UPLOAD_MU_MIMO_STATS,
  509. /* HTT_UPLOAD_MU_OFDMA_STATS: upload UL MU-OFDMA + DL MU-OFDMA stats */
  510. HTT_UPLOAD_MU_OFDMA_STATS,
  511. HTT_UPLOAD_DL_MU_MIMO_STATS,
  512. HTT_UPLOAD_UL_MU_MIMO_STATS,
  513. HTT_UPLOAD_DL_MU_OFDMA_STATS,
  514. HTT_UPLOAD_UL_MU_OFDMA_STATS,
  515. } htt_mu_stats_upload_t;
  516. #define HTT_STATS_TLV_TAG_M 0x00000fff
  517. #define HTT_STATS_TLV_TAG_S 0
  518. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  519. #define HTT_STATS_TLV_LENGTH_S 12
  520. #define HTT_STATS_TLV_TAG_GET(_var) \
  521. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  522. HTT_STATS_TLV_TAG_S)
  523. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  524. do { \
  525. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  526. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  527. } while (0)
  528. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  529. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  530. HTT_STATS_TLV_LENGTH_S)
  531. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  532. do { \
  533. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  534. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  535. } while (0)
  536. typedef struct {
  537. union {
  538. /* BIT [11 : 0] :- tag
  539. * BIT [23 : 12] :- length
  540. * BIT [31 : 24] :- reserved
  541. */
  542. A_UINT32 tag__length;
  543. /*
  544. * The following struct is not endian-portable.
  545. * It is suitable for use within the target, which is known to be
  546. * little-endian.
  547. * The host should use the above endian-portable macros to access
  548. * the tag and length bitfields in an endian-neutral manner.
  549. */
  550. struct {
  551. A_UINT32 tag : 12, /* BIT [11 : 0] */
  552. length : 12, /* BIT [23 : 12] */
  553. reserved : 8; /* BIT [31 : 24] */
  554. };
  555. };
  556. } htt_tlv_hdr_t;
  557. #define HTT_STATS_MAX_STRING_SZ32 4
  558. #define HTT_STATS_MACID_INVALID 0xff
  559. #define HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS 10
  560. #define HTT_TX_HWQ_MAX_CMD_RESULT_STATS 13
  561. #define HTT_TX_HWQ_MAX_CMD_STALL_STATS 5
  562. #define HTT_TX_HWQ_MAX_FES_RESULT_STATS 10
  563. typedef enum {
  564. HTT_STATS_TX_PDEV_NO_DATA_UNDERRUN = 0,
  565. HTT_STATS_TX_PDEV_DATA_UNDERRUN_BETWEEN_MPDU = 1,
  566. HTT_STATS_TX_PDEV_DATA_UNDERRUN_WITHIN_MPDU = 2,
  567. HTT_TX_PDEV_MAX_URRN_STATS = 3,
  568. } htt_tx_pdev_underrun_enum;
  569. #define HTT_TX_PDEV_MAX_FLUSH_REASON_STATS 71
  570. #define HTT_TX_PDEV_MAX_SIFS_BURST_STATS 9
  571. #define HTT_TX_PDEV_MAX_SIFS_BURST_HIST_STATS 10
  572. #define HTT_TX_PDEV_MAX_PHY_ERR_STATS 18
  573. /* HTT_TX_PDEV_SCHED_TX_MODE_MAX:
  574. * DEPRECATED - num sched tx mode max is 8
  575. */
  576. #define HTT_TX_PDEV_SCHED_TX_MODE_MAX 4
  577. #define HTT_TX_PDEV_NUM_SCHED_ORDER_LOG 20
  578. #define HTT_RX_STATS_REFILL_MAX_RING 4
  579. #define HTT_RX_STATS_RXDMA_MAX_ERR 16
  580. #define HTT_RX_STATS_FW_DROP_REASON_MAX 16
  581. /* Bytes stored in little endian order */
  582. /* Length should be multiple of DWORD */
  583. typedef struct {
  584. htt_tlv_hdr_t tlv_hdr;
  585. A_UINT32 data[1]; /* Can be variable length */
  586. } htt_stats_string_tlv;
  587. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_M 0x000000ff
  588. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_S 0
  589. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_GET(_var) \
  590. (((_var) & HTT_TX_PDEV_STATS_CMN_MAC_ID_M) >> \
  591. HTT_TX_PDEV_STATS_CMN_MAC_ID_S)
  592. #define HTT_TX_PDEV_STATS_CMN_MAC_ID_SET(_var, _val) \
  593. do { \
  594. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_CMN_MAC_ID, _val); \
  595. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_CMN_MAC_ID_S)); \
  596. } while (0)
  597. /* == TX PDEV STATS == */
  598. typedef struct {
  599. htt_tlv_hdr_t tlv_hdr;
  600. /* BIT [ 7 : 0] :- mac_id
  601. * BIT [31 : 8] :- reserved
  602. */
  603. A_UINT32 mac_id__word;
  604. /* Num queued to HW */
  605. A_UINT32 hw_queued;
  606. /* Num PPDU reaped from HW */
  607. A_UINT32 hw_reaped;
  608. /* Num underruns */
  609. A_UINT32 underrun;
  610. /* Num HW Paused counter. */
  611. A_UINT32 hw_paused;
  612. /* Num HW flush counter. */
  613. A_UINT32 hw_flush;
  614. /* Num HW filtered counter. */
  615. A_UINT32 hw_filt;
  616. /* Num PPDUs cleaned up in TX abort */
  617. A_UINT32 tx_abort;
  618. /* Num MPDUs requed by SW */
  619. A_UINT32 mpdu_requed;
  620. /* excessive retries */
  621. A_UINT32 tx_xretry;
  622. /* Last used data hw rate code */
  623. A_UINT32 data_rc;
  624. /* frames dropped due to excessive sw retries */
  625. A_UINT32 mpdu_dropped_xretry;
  626. /* illegal rate phy errors */
  627. A_UINT32 illgl_rate_phy_err;
  628. /* wal pdev continous xretry */
  629. A_UINT32 cont_xretry;
  630. /* wal pdev tx timeout */
  631. A_UINT32 tx_timeout;
  632. /* wal pdev resets */
  633. A_UINT32 pdev_resets;
  634. /* PhY/BB underrun */
  635. A_UINT32 phy_underrun;
  636. /* MPDU is more than txop limit */
  637. A_UINT32 txop_ovf;
  638. /* Number of Sequences posted */
  639. A_UINT32 seq_posted;
  640. /* Number of Sequences failed queueing */
  641. A_UINT32 seq_failed_queueing;
  642. /* Number of Sequences completed */
  643. A_UINT32 seq_completed;
  644. /* Number of Sequences restarted */
  645. A_UINT32 seq_restarted;
  646. /* Number of MU Sequences posted */
  647. A_UINT32 mu_seq_posted;
  648. /* Number of time HW ring is paused between seq switch within ISR */
  649. A_UINT32 seq_switch_hw_paused;
  650. /* Number of times seq continuation in DSR */
  651. A_UINT32 next_seq_posted_dsr;
  652. /* Number of times seq continuation in ISR */
  653. A_UINT32 seq_posted_isr;
  654. /* Number of seq_ctrl cached. */
  655. A_UINT32 seq_ctrl_cached;
  656. /* Number of MPDUs successfully transmitted */
  657. A_UINT32 mpdu_count_tqm;
  658. /* Number of MSDUs successfully transmitted */
  659. A_UINT32 msdu_count_tqm;
  660. /* Number of MPDUs dropped */
  661. A_UINT32 mpdu_removed_tqm;
  662. /* Number of MSDUs dropped */
  663. A_UINT32 msdu_removed_tqm;
  664. /* Num MPDUs flushed by SW, HWPAUSED, SW TXABORT (Reset,channel change) */
  665. A_UINT32 mpdus_sw_flush;
  666. /* Num MPDUs filtered by HW, all filter condition (TTL expired) */
  667. A_UINT32 mpdus_hw_filter;
  668. /* Num MPDUs truncated by PDG (TXOP, TBTT, PPDU_duration based on rate, dyn_bw) */
  669. A_UINT32 mpdus_truncated;
  670. /* Num MPDUs that was tried but didn't receive ACK or BA */
  671. A_UINT32 mpdus_ack_failed;
  672. /* Num MPDUs that was dropped due to expiry (MSDU TTL). */
  673. A_UINT32 mpdus_expired;
  674. /* Num MPDUs that was retried within seq_ctrl (MGMT/LEGACY) */
  675. A_UINT32 mpdus_seq_hw_retry;
  676. /* Num of TQM acked cmds processed */
  677. A_UINT32 ack_tlv_proc;
  678. /* coex_abort_mpdu_cnt valid. */
  679. A_UINT32 coex_abort_mpdu_cnt_valid;
  680. /* coex_abort_mpdu_cnt from TX FES stats. */
  681. A_UINT32 coex_abort_mpdu_cnt;
  682. /* Number of total PPDUs(DATA, MGMT, excludes selfgen) tried over the air (OTA) */
  683. A_UINT32 num_total_ppdus_tried_ota;
  684. /* Number of data PPDUs tried over the air (OTA) */
  685. A_UINT32 num_data_ppdus_tried_ota;
  686. /* Num Local control/mgmt frames (MSDUs) queued */
  687. A_UINT32 local_ctrl_mgmt_enqued;
  688. /* local_ctrl_mgmt_freed:
  689. * Num Local control/mgmt frames (MSDUs) done
  690. * It includes all local ctrl/mgmt completions
  691. * (acked, no ack, flush, TTL, etc)
  692. */
  693. A_UINT32 local_ctrl_mgmt_freed;
  694. /* Num Local data frames (MSDUs) queued */
  695. A_UINT32 local_data_enqued;
  696. /* local_data_freed:
  697. * Num Local data frames (MSDUs) done
  698. * It includes all local data completions
  699. * (acked, no ack, flush, TTL, etc)
  700. */
  701. A_UINT32 local_data_freed;
  702. /* Num MPDUs tried by SW */
  703. A_UINT32 mpdu_tried;
  704. /* Num of waiting seq posted in isr completion handler */
  705. A_UINT32 isr_wait_seq_posted;
  706. A_UINT32 tx_active_dur_us_low;
  707. A_UINT32 tx_active_dur_us_high;
  708. /* Number of MPDUs dropped after max retries */
  709. A_UINT32 remove_mpdus_max_retries;
  710. /* Num HTT cookies dispatched */
  711. A_UINT32 comp_delivered;
  712. /* successful ppdu transmissions */
  713. A_UINT32 ppdu_ok;
  714. /* Scheduler self triggers */
  715. A_UINT32 self_triggers;
  716. /* FES duration of last tx data PPDU in us (sch_eval_end - ppdu_start) */
  717. A_UINT32 tx_time_dur_data;
  718. /* Num of times sequence terminated due to ppdu duration < burst limit */
  719. A_UINT32 seq_qdepth_repost_stop;
  720. /* Num of times MU sequence terminated due to MSDUs reaching threshold */
  721. A_UINT32 mu_seq_min_msdu_repost_stop;
  722. /* Num of times SU sequence terminated due to MSDUs reaching threshold */
  723. A_UINT32 seq_min_msdu_repost_stop;
  724. /* Num of times sequence terminated due to no TXOP available */
  725. A_UINT32 seq_txop_repost_stop;
  726. /* Num of times the next sequence got cancelled */
  727. A_UINT32 next_seq_cancel;
  728. /* Num of times fes offset was misaligned */
  729. A_UINT32 fes_offsets_err_cnt;
  730. /* Num of times peer blacklisted for MU-MIMO transmission */
  731. A_UINT32 num_mu_peer_blacklisted;
  732. /* Num of times mu_ofdma seq posted */
  733. A_UINT32 mu_ofdma_seq_posted;
  734. /* Num of times UL MU MIMO seq posted */
  735. A_UINT32 ul_mumimo_seq_posted;
  736. /* Num of times UL OFDMA seq posted */
  737. A_UINT32 ul_ofdma_seq_posted;
  738. } htt_tx_pdev_stats_cmn_tlv;
  739. #define HTT_TX_PDEV_STATS_URRN_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  740. /* NOTE: Variable length TLV, use length spec to infer array size */
  741. typedef struct {
  742. htt_tlv_hdr_t tlv_hdr;
  743. A_UINT32 urrn_stats[1]; /* HTT_TX_PDEV_MAX_URRN_STATS */
  744. } htt_tx_pdev_stats_urrn_tlv_v;
  745. #define HTT_TX_PDEV_STATS_FLUSH_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  746. /* NOTE: Variable length TLV, use length spec to infer array size */
  747. typedef struct {
  748. htt_tlv_hdr_t tlv_hdr;
  749. A_UINT32 flush_errs[1]; /* HTT_TX_PDEV_MAX_FLUSH_REASON_STATS */
  750. } htt_tx_pdev_stats_flush_tlv_v;
  751. #define HTT_TX_PDEV_STATS_SIFS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  752. /* NOTE: Variable length TLV, use length spec to infer array size */
  753. typedef struct {
  754. htt_tlv_hdr_t tlv_hdr;
  755. A_UINT32 sifs_status[1]; /* HTT_TX_PDEV_MAX_SIFS_BURST_STATS */
  756. } htt_tx_pdev_stats_sifs_tlv_v;
  757. #define HTT_TX_PDEV_STATS_PHY_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  758. /* NOTE: Variable length TLV, use length spec to infer array size */
  759. typedef struct {
  760. htt_tlv_hdr_t tlv_hdr;
  761. A_UINT32 phy_errs[1]; /* HTT_TX_PDEV_MAX_PHY_ERR_STATS */
  762. } htt_tx_pdev_stats_phy_err_tlv_v;
  763. #define HTT_TX_PDEV_STATS_SIFS_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  764. /* NOTE: Variable length TLV, use length spec to infer array size */
  765. typedef struct {
  766. htt_tlv_hdr_t tlv_hdr;
  767. A_UINT32 sifs_hist_status[1]; /* HTT_TX_PDEV_SIFS_BURST_HIST_STATS */
  768. } htt_tx_pdev_stats_sifs_hist_tlv_v;
  769. typedef struct {
  770. htt_tlv_hdr_t tlv_hdr;
  771. A_UINT32 num_data_ppdus_legacy_su;
  772. A_UINT32 num_data_ppdus_ac_su;
  773. A_UINT32 num_data_ppdus_ax_su;
  774. A_UINT32 num_data_ppdus_ac_su_txbf;
  775. A_UINT32 num_data_ppdus_ax_su_txbf;
  776. } htt_tx_pdev_stats_tx_ppdu_stats_tlv_v;
  777. #define HTT_TX_PDEV_STATS_TRIED_MPDU_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  778. /* NOTE: Variable length TLV, use length spec to infer array size .
  779. *
  780. * Tried_mpdu_cnt_hist is the histogram of MPDUs tries per HWQ.
  781. * The tries here is the count of the MPDUS within a PPDU that the
  782. * HW had attempted to transmit on air, for the HWSCH Schedule
  783. * command submitted by FW.It is not the retry attempts.
  784. * The histogram bins are 0-29, 30-59, 60-89 and so on. The are
  785. * 10 bins in this histogram. They are defined in FW using the
  786. * following macros
  787. * #define WAL_MAX_TRIED_MPDU_CNT_HISTOGRAM 9
  788. * #define WAL_TRIED_MPDU_CNT_HISTOGRAM_INTERVAL 30
  789. *
  790. */
  791. typedef struct {
  792. htt_tlv_hdr_t tlv_hdr;
  793. A_UINT32 hist_bin_size;
  794. A_UINT32 tried_mpdu_cnt_hist[1]; /* HTT_TX_PDEV_TRIED_MPDU_CNT_HIST */
  795. } htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v;
  796. typedef struct {
  797. htt_tlv_hdr_t tlv_hdr;
  798. /* Num MGMT MPDU transmitted by the target */
  799. A_UINT32 fw_tx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  800. } htt_pdev_ctrl_path_tx_stats_tlv_v;
  801. /* STATS_TYPE: HTT_DBG_EXT_STATS_PDEV_TX
  802. * TLV_TAGS:
  803. * - HTT_STATS_TX_PDEV_CMN_TAG
  804. * - HTT_STATS_TX_PDEV_URRN_TAG
  805. * - HTT_STATS_TX_PDEV_SIFS_TAG
  806. * - HTT_STATS_TX_PDEV_FLUSH_TAG
  807. * - HTT_STATS_TX_PDEV_PHY_ERR_TAG
  808. * - HTT_STATS_TX_PDEV_SIFS_HIST_TAG
  809. * - HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG
  810. * - HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG
  811. * - HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG
  812. */
  813. /* NOTE:
  814. * This structure is for documentation, and cannot be safely used directly.
  815. * Instead, use the constituent TLV structures to fill/parse.
  816. */
  817. typedef struct _htt_tx_pdev_stats {
  818. htt_tx_pdev_stats_cmn_tlv cmn_tlv;
  819. htt_tx_pdev_stats_urrn_tlv_v underrun_tlv;
  820. htt_tx_pdev_stats_sifs_tlv_v sifs_tlv;
  821. htt_tx_pdev_stats_flush_tlv_v flush_tlv;
  822. htt_tx_pdev_stats_phy_err_tlv_v phy_err_tlv;
  823. htt_tx_pdev_stats_sifs_hist_tlv_v sifs_hist_tlv;
  824. htt_tx_pdev_stats_tx_ppdu_stats_tlv_v tx_su_tlv;
  825. htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v tried_mpdu_cnt_hist_tlv;
  826. htt_pdev_ctrl_path_tx_stats_tlv_v ctrl_path_tx_tlv;
  827. } htt_tx_pdev_stats_t;
  828. /* == SOC ERROR STATS == */
  829. /* =============== PDEV ERROR STATS ============== */
  830. #define HTT_STATS_MAX_HW_INTR_NAME_LEN 8
  831. typedef struct {
  832. htt_tlv_hdr_t tlv_hdr;
  833. /* Stored as little endian */
  834. A_UINT8 hw_intr_name[HTT_STATS_MAX_HW_INTR_NAME_LEN];
  835. A_UINT32 mask;
  836. A_UINT32 count;
  837. } htt_hw_stats_intr_misc_tlv;
  838. #define HTT_STATS_MAX_HW_MODULE_NAME_LEN 8
  839. typedef struct {
  840. htt_tlv_hdr_t tlv_hdr;
  841. /* Stored as little endian */
  842. A_UINT8 hw_module_name[HTT_STATS_MAX_HW_MODULE_NAME_LEN];
  843. A_UINT32 count;
  844. } htt_hw_stats_wd_timeout_tlv;
  845. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_M 0x000000ff
  846. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_S 0
  847. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_GET(_var) \
  848. (((_var) & HTT_HW_STATS_PDEV_ERRS_MAC_ID_M) >> \
  849. HTT_HW_STATS_PDEV_ERRS_MAC_ID_S)
  850. #define HTT_HW_STATS_PDEV_ERRS_MAC_ID_SET(_var, _val) \
  851. do { \
  852. HTT_CHECK_SET_VAL(HTT_HW_STATS_PDEV_ERRS_MAC_ID, _val); \
  853. ((_var) |= ((_val) << HTT_HW_STATS_PDEV_ERRS_MAC_ID_S)); \
  854. } while (0)
  855. typedef struct {
  856. htt_tlv_hdr_t tlv_hdr;
  857. /* BIT [ 7 : 0] :- mac_id
  858. * BIT [31 : 8] :- reserved
  859. */
  860. A_UINT32 mac_id__word;
  861. A_UINT32 tx_abort;
  862. A_UINT32 tx_abort_fail_count;
  863. A_UINT32 rx_abort;
  864. A_UINT32 rx_abort_fail_count;
  865. A_UINT32 warm_reset;
  866. A_UINT32 cold_reset;
  867. A_UINT32 tx_flush;
  868. A_UINT32 tx_glb_reset;
  869. A_UINT32 tx_txq_reset;
  870. A_UINT32 rx_timeout_reset;
  871. A_UINT32 mac_cold_reset_restore_cal;
  872. A_UINT32 mac_cold_reset;
  873. A_UINT32 mac_warm_reset;
  874. A_UINT32 mac_only_reset;
  875. A_UINT32 phy_warm_reset;
  876. A_UINT32 phy_warm_reset_ucode_trig;
  877. A_UINT32 mac_warm_reset_restore_cal;
  878. A_UINT32 mac_sfm_reset;
  879. A_UINT32 phy_warm_reset_m3_ssr;
  880. A_UINT32 phy_warm_reset_reason_phy_m3;
  881. A_UINT32 phy_warm_reset_reason_tx_hw_stuck;
  882. A_UINT32 phy_warm_reset_reason_num_cca_rx_frame_stuck;
  883. A_UINT32 phy_warm_reset_reason_wal_rx_recovery_rst_rx_busy;
  884. A_UINT32 phy_warm_reset_reason_wal_rx_recovery_rst_mac_hang;
  885. A_UINT32 phy_warm_reset_reason_mac_reset_converted_phy_reset;
  886. A_UINT32 wal_rx_recovery_rst_mac_hang_count;
  887. A_UINT32 wal_rx_recovery_rst_known_sig_count;
  888. A_UINT32 wal_rx_recovery_rst_no_rx_count;
  889. A_UINT32 wal_rx_recovery_rst_no_rx_consecutive_count;
  890. A_UINT32 wal_rx_recovery_rst_rx_busy_count;
  891. A_UINT32 wal_rx_recovery_rst_phy_mac_hang_count;
  892. A_UINT32 rx_flush_cnt; /* Num rx flush issued */
  893. A_UINT32 phy_warm_reset_reason_tx_lifetime_expiry_cca_stuck;
  894. A_UINT32 phy_warm_reset_reason_tx_consecutive_flush9_war;
  895. A_UINT32 phy_warm_reset_reason_tx_hwsch_reset_war;
  896. A_UINT32 phy_warm_reset_reason_hwsch_wdog_or_cca_wdog_war;
  897. A_UINT32 fw_rx_rings_reset;
  898. } htt_hw_stats_pdev_errs_tlv;
  899. typedef struct {
  900. htt_tlv_hdr_t tlv_hdr;
  901. /* BIT [ 7 : 0] :- mac_id
  902. * BIT [31 : 8] :- reserved
  903. */
  904. A_UINT32 mac_id__word;
  905. A_UINT32 last_unpause_ppdu_id;
  906. A_UINT32 hwsch_unpause_wait_tqm_write;
  907. A_UINT32 hwsch_dummy_tlv_skipped;
  908. A_UINT32 hwsch_misaligned_offset_received;
  909. A_UINT32 hwsch_reset_count;
  910. A_UINT32 hwsch_dev_reset_war;
  911. A_UINT32 hwsch_delayed_pause;
  912. A_UINT32 hwsch_long_delayed_pause;
  913. A_UINT32 sch_rx_ppdu_no_response;
  914. A_UINT32 sch_selfgen_response;
  915. A_UINT32 sch_rx_sifs_resp_trigger;
  916. } htt_hw_stats_whal_tx_tlv;
  917. typedef struct {
  918. htt_tlv_hdr_t tlv_hdr;
  919. /* BIT [ 7 : 0] :- mac_id
  920. * BIT [31 : 8] :- reserved
  921. */
  922. union {
  923. struct {
  924. A_UINT32 mac_id: 8,
  925. reserved: 24;
  926. };
  927. A_UINT32 mac_id__word;
  928. };
  929. /*
  930. * hw_wars is a variable-length array, with each element counting
  931. * the number of occurrences of the corresponding type of HW WAR.
  932. * That is, hw_wars[0] indicates how many times HW WAR 0 occurred,
  933. * hw_wars[1] indicates how many times HW WAR 1 occurred, etc.
  934. * The target has an internal HW WAR mapping that it uses to keep
  935. * track of which HW WAR is WAR 0, which HW WAR is WAR 1, etc.
  936. */
  937. A_UINT32 hw_wars[1/*or more*/];
  938. } htt_hw_war_stats_tlv;
  939. /* STATS_TYPE: HTT_DBG_EXT_STATS_PDEV_ERROR
  940. * TLV_TAGS:
  941. * - HTT_STATS_HW_PDEV_ERRS_TAG
  942. * - HTT_STATS_HW_INTR_MISC_TAG (multiple)
  943. * - HTT_STATS_HW_WD_TIMEOUT_TAG (multiple)
  944. * - HTT_STATS_WHAL_TX_TAG
  945. * - HTT_STATS_HW_WAR_TAG
  946. */
  947. /* NOTE:
  948. * This structure is for documentation, and cannot be safely used directly.
  949. * Instead, use the constituent TLV structures to fill/parse.
  950. */
  951. typedef struct _htt_pdev_err_stats {
  952. htt_hw_stats_pdev_errs_tlv pdev_errs;
  953. htt_hw_stats_intr_misc_tlv misc_stats[1];
  954. htt_hw_stats_wd_timeout_tlv wd_timeout[1];
  955. htt_hw_stats_whal_tx_tlv whal_tx_stats;
  956. htt_hw_war_stats_tlv hw_war;
  957. } htt_hw_err_stats_t;
  958. /* ============ PEER STATS ============ */
  959. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_M 0x0000ffff
  960. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S 0
  961. #define HTT_MSDU_FLOW_STATS_TID_NUM_M 0x000f0000
  962. #define HTT_MSDU_FLOW_STATS_TID_NUM_S 16
  963. #define HTT_MSDU_FLOW_STATS_DROP_M 0x00100000
  964. #define HTT_MSDU_FLOW_STATS_DROP_S 20
  965. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_GET(_var) \
  966. (((_var) & HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_M) >> \
  967. HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S)
  968. #define HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_SET(_var, _val) \
  969. do { \
  970. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_TX_FLOW_NUM, _val); \
  971. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_TX_FLOW_NUM_S)); \
  972. } while (0)
  973. #define HTT_MSDU_FLOW_STATS_TID_NUM_GET(_var) \
  974. (((_var) & HTT_MSDU_FLOW_STATS_TID_NUM_M) >> \
  975. HTT_MSDU_FLOW_STATS_TID_NUM_S)
  976. #define HTT_MSDU_FLOW_STATS_TID_NUM_SET(_var, _val) \
  977. do { \
  978. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_TID_NUM, _val); \
  979. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_TID_NUM_S)); \
  980. } while (0)
  981. #define HTT_MSDU_FLOW_STATS_DROP_GET(_var) \
  982. (((_var) & HTT_MSDU_FLOW_STATS_DROP_M) >> \
  983. HTT_MSDU_FLOW_STATS_DROP_S)
  984. #define HTT_MSDU_FLOW_STATS_DROP_SET(_var, _val) \
  985. do { \
  986. HTT_CHECK_SET_VAL(HTT_MSDU_FLOW_STATS_DROP, _val); \
  987. ((_var) |= ((_val) << HTT_MSDU_FLOW_STATS_DROP_S)); \
  988. } while (0)
  989. typedef struct _htt_msdu_flow_stats_tlv {
  990. htt_tlv_hdr_t tlv_hdr;
  991. A_UINT32 last_update_timestamp;
  992. A_UINT32 last_add_timestamp;
  993. A_UINT32 last_remove_timestamp;
  994. A_UINT32 total_processed_msdu_count;
  995. A_UINT32 cur_msdu_count_in_flowq;
  996. A_UINT32 sw_peer_id; /* This will help to find which peer_id is stuck state */
  997. /* BIT [15 : 0] :- tx_flow_number
  998. * BIT [19 : 16] :- tid_num
  999. * BIT [20 : 20] :- drop_rule
  1000. * BIT [31 : 21] :- reserved
  1001. */
  1002. A_UINT32 tx_flow_no__tid_num__drop_rule;
  1003. A_UINT32 last_cycle_enqueue_count;
  1004. A_UINT32 last_cycle_dequeue_count;
  1005. A_UINT32 last_cycle_drop_count;
  1006. /* BIT [15 : 0] :- current_drop_th
  1007. * BIT [31 : 16] :- reserved
  1008. */
  1009. A_UINT32 current_drop_th;
  1010. } htt_msdu_flow_stats_tlv;
  1011. #define MAX_HTT_TID_NAME 8
  1012. /* DWORD sw_peer_id__tid_num */
  1013. #define HTT_TX_TID_STATS_SW_PEER_ID_M 0x0000ffff
  1014. #define HTT_TX_TID_STATS_SW_PEER_ID_S 0
  1015. #define HTT_TX_TID_STATS_TID_NUM_M 0xffff0000
  1016. #define HTT_TX_TID_STATS_TID_NUM_S 16
  1017. #define HTT_TX_TID_STATS_SW_PEER_ID_GET(_var) \
  1018. (((_var) & HTT_TX_TID_STATS_SW_PEER_ID_M) >> \
  1019. HTT_TX_TID_STATS_SW_PEER_ID_S)
  1020. #define HTT_TX_TID_STATS_SW_PEER_ID_SET(_var, _val) \
  1021. do { \
  1022. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_SW_PEER_ID, _val); \
  1023. ((_var) |= ((_val) << HTT_TX_TID_STATS_SW_PEER_ID_S)); \
  1024. } while (0)
  1025. #define HTT_TX_TID_STATS_TID_NUM_GET(_var) \
  1026. (((_var) & HTT_TX_TID_STATS_TID_NUM_M) >> \
  1027. HTT_TX_TID_STATS_TID_NUM_S)
  1028. #define HTT_TX_TID_STATS_TID_NUM_SET(_var, _val) \
  1029. do { \
  1030. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_TID_NUM, _val); \
  1031. ((_var) |= ((_val) << HTT_TX_TID_STATS_TID_NUM_S)); \
  1032. } while (0)
  1033. /* DWORD num_sched_pending__num_ppdu_in_hwq */
  1034. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_M 0x000000ff
  1035. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_S 0
  1036. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_M 0x0000ff00
  1037. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S 8
  1038. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_GET(_var) \
  1039. (((_var) & HTT_TX_TID_STATS_NUM_SCHED_PENDING_M) >> \
  1040. HTT_TX_TID_STATS_NUM_SCHED_PENDING_S)
  1041. #define HTT_TX_TID_STATS_NUM_SCHED_PENDING_SET(_var, _val) \
  1042. do { \
  1043. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_NUM_SCHED_PENDING, _val); \
  1044. ((_var) |= ((_val) << HTT_TX_TID_STATS_NUM_SCHED_PENDING_S)); \
  1045. } while (0)
  1046. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_GET(_var) \
  1047. (((_var) & HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_M) >> \
  1048. HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S)
  1049. #define HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_SET(_var, _val) \
  1050. do { \
  1051. HTT_CHECK_SET_VAL(HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ, _val); \
  1052. ((_var) |= ((_val) << HTT_TX_TID_STATS_NUM_PPDU_IN_HWQ_S)); \
  1053. } while (0)
  1054. /* Tidq stats */
  1055. typedef struct _htt_tx_tid_stats_tlv {
  1056. htt_tlv_hdr_t tlv_hdr;
  1057. /* Stored as little endian */
  1058. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  1059. /* BIT [15 : 0] :- sw_peer_id
  1060. * BIT [31 : 16] :- tid_num
  1061. */
  1062. A_UINT32 sw_peer_id__tid_num;
  1063. /* BIT [ 7 : 0] :- num_sched_pending
  1064. * BIT [15 : 8] :- num_ppdu_in_hwq
  1065. * BIT [31 : 16] :- reserved
  1066. */
  1067. A_UINT32 num_sched_pending__num_ppdu_in_hwq;
  1068. A_UINT32 tid_flags;
  1069. /* per tid # of hw_queued ppdu.*/
  1070. A_UINT32 hw_queued;
  1071. /* number of per tid successful PPDU. */
  1072. A_UINT32 hw_reaped;
  1073. /* per tid Num MPDUs filtered by HW */
  1074. A_UINT32 mpdus_hw_filter;
  1075. A_UINT32 qdepth_bytes;
  1076. A_UINT32 qdepth_num_msdu;
  1077. A_UINT32 qdepth_num_mpdu;
  1078. A_UINT32 last_scheduled_tsmp;
  1079. A_UINT32 pause_module_id;
  1080. A_UINT32 block_module_id;
  1081. /* tid tx airtime in sec */
  1082. A_UINT32 tid_tx_airtime;
  1083. } htt_tx_tid_stats_tlv;
  1084. /* Tidq stats */
  1085. typedef struct _htt_tx_tid_stats_v1_tlv {
  1086. htt_tlv_hdr_t tlv_hdr;
  1087. /* Stored as little endian */
  1088. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  1089. /* BIT [15 : 0] :- sw_peer_id
  1090. * BIT [31 : 16] :- tid_num
  1091. */
  1092. A_UINT32 sw_peer_id__tid_num;
  1093. /* BIT [ 7 : 0] :- num_sched_pending
  1094. * BIT [15 : 8] :- num_ppdu_in_hwq
  1095. * BIT [31 : 16] :- reserved
  1096. */
  1097. A_UINT32 num_sched_pending__num_ppdu_in_hwq;
  1098. A_UINT32 tid_flags;
  1099. /* Max qdepth in bytes reached by this tid*/
  1100. A_UINT32 max_qdepth_bytes;
  1101. /* number of msdus qdepth reached max */
  1102. A_UINT32 max_qdepth_n_msdus;
  1103. /* Made reserved this field */
  1104. A_UINT32 rsvd;
  1105. A_UINT32 qdepth_bytes;
  1106. A_UINT32 qdepth_num_msdu;
  1107. A_UINT32 qdepth_num_mpdu;
  1108. A_UINT32 last_scheduled_tsmp;
  1109. A_UINT32 pause_module_id;
  1110. A_UINT32 block_module_id;
  1111. /* tid tx airtime in sec */
  1112. A_UINT32 tid_tx_airtime;
  1113. A_UINT32 allow_n_flags;
  1114. /* BIT [15 : 0] :- sendn_frms_allowed
  1115. * BIT [31 : 16] :- reserved
  1116. */
  1117. A_UINT32 sendn_frms_allowed;
  1118. } htt_tx_tid_stats_v1_tlv;
  1119. #define HTT_RX_TID_STATS_SW_PEER_ID_M 0x0000ffff
  1120. #define HTT_RX_TID_STATS_SW_PEER_ID_S 0
  1121. #define HTT_RX_TID_STATS_TID_NUM_M 0xffff0000
  1122. #define HTT_RX_TID_STATS_TID_NUM_S 16
  1123. #define HTT_RX_TID_STATS_SW_PEER_ID_GET(_var) \
  1124. (((_var) & HTT_RX_TID_STATS_SW_PEER_ID_M) >> \
  1125. HTT_RX_TID_STATS_SW_PEER_ID_S)
  1126. #define HTT_RX_TID_STATS_SW_PEER_ID_SET(_var, _val) \
  1127. do { \
  1128. HTT_CHECK_SET_VAL(HTT_RX_TID_STATS_SW_PEER_ID, _val); \
  1129. ((_var) |= ((_val) << HTT_RX_TID_STATS_SW_PEER_ID_S)); \
  1130. } while (0)
  1131. #define HTT_RX_TID_STATS_TID_NUM_GET(_var) \
  1132. (((_var) & HTT_RX_TID_STATS_TID_NUM_M) >> \
  1133. HTT_RX_TID_STATS_TID_NUM_S)
  1134. #define HTT_RX_TID_STATS_TID_NUM_SET(_var, _val) \
  1135. do { \
  1136. HTT_CHECK_SET_VAL(HTT_RX_TID_STATS_TID_NUM, _val); \
  1137. ((_var) |= ((_val) << HTT_RX_TID_STATS_TID_NUM_S)); \
  1138. } while (0)
  1139. typedef struct _htt_rx_tid_stats_tlv {
  1140. htt_tlv_hdr_t tlv_hdr;
  1141. /* BIT [15 : 0] : sw_peer_id
  1142. * BIT [31 : 16] : tid_num
  1143. */
  1144. A_UINT32 sw_peer_id__tid_num;
  1145. /* Stored as little endian */
  1146. A_UINT8 tid_name[MAX_HTT_TID_NAME];
  1147. /* dup_in_reorder not collected per tid for now,
  1148. as there is no wal_peer back ptr in data rx peer. */
  1149. A_UINT32 dup_in_reorder;
  1150. A_UINT32 dup_past_outside_window;
  1151. A_UINT32 dup_past_within_window;
  1152. /* Number of per tid MSDUs with flag of decrypt_err */
  1153. A_UINT32 rxdesc_err_decrypt;
  1154. /* tid rx airtime in sec */
  1155. A_UINT32 tid_rx_airtime;
  1156. } htt_rx_tid_stats_tlv;
  1157. #define HTT_MAX_COUNTER_NAME 8
  1158. typedef struct {
  1159. htt_tlv_hdr_t tlv_hdr;
  1160. /* Stored as little endian */
  1161. A_UINT8 counter_name[HTT_MAX_COUNTER_NAME];
  1162. A_UINT32 count;
  1163. } htt_counter_tlv;
  1164. typedef struct {
  1165. htt_tlv_hdr_t tlv_hdr;
  1166. /* Number of rx ppdu. */
  1167. A_UINT32 ppdu_cnt;
  1168. /* Number of rx mpdu. */
  1169. A_UINT32 mpdu_cnt;
  1170. /* Number of rx msdu */
  1171. A_UINT32 msdu_cnt;
  1172. /* Pause bitmap */
  1173. A_UINT32 pause_bitmap;
  1174. /* Block bitmap */
  1175. A_UINT32 block_bitmap;
  1176. /* Current timestamp */
  1177. A_UINT32 current_timestamp;
  1178. /* Peer cumulative tx airtime in sec */
  1179. A_UINT32 peer_tx_airtime;
  1180. /* Peer cumulative rx airtime in sec */
  1181. A_UINT32 peer_rx_airtime;
  1182. /* Peer current rssi in dBm */
  1183. A_INT32 rssi;
  1184. /* Total enqueued, dequeued and dropped msdu's for peer */
  1185. A_UINT32 peer_enqueued_count_low;
  1186. A_UINT32 peer_enqueued_count_high;
  1187. A_UINT32 peer_dequeued_count_low;
  1188. A_UINT32 peer_dequeued_count_high;
  1189. A_UINT32 peer_dropped_count_low;
  1190. A_UINT32 peer_dropped_count_high;
  1191. /* Total ppdu transmitted bytes for peer: includes MAC header overhead */
  1192. A_UINT32 ppdu_transmitted_bytes_low;
  1193. A_UINT32 ppdu_transmitted_bytes_high;
  1194. A_UINT32 peer_ttl_removed_count;
  1195. /* inactive_time
  1196. * Running duration of the time since last tx/rx activity by this peer,
  1197. * units = seconds.
  1198. * If the peer is currently active, this inactive_time will be 0x0.
  1199. */
  1200. A_UINT32 inactive_time;
  1201. /* Number of MPDUs dropped after max retries */
  1202. A_UINT32 remove_mpdus_max_retries;
  1203. } htt_peer_stats_cmn_tlv;
  1204. typedef struct {
  1205. htt_tlv_hdr_t tlv_hdr;
  1206. /* This enum type of HTT_PEER_TYPE */
  1207. A_UINT32 peer_type;
  1208. A_UINT32 sw_peer_id;
  1209. /* BIT [7 : 0] :- vdev_id
  1210. * BIT [15 : 8] :- pdev_id
  1211. * BIT [31 : 16] :- ast_indx
  1212. */
  1213. A_UINT32 vdev_pdev_ast_idx;
  1214. htt_mac_addr mac_addr;
  1215. A_UINT32 peer_flags;
  1216. A_UINT32 qpeer_flags;
  1217. } htt_peer_details_tlv;
  1218. typedef enum {
  1219. HTT_STATS_PREAM_OFDM,
  1220. HTT_STATS_PREAM_CCK,
  1221. HTT_STATS_PREAM_HT,
  1222. HTT_STATS_PREAM_VHT,
  1223. HTT_STATS_PREAM_HE,
  1224. HTT_STATS_PREAM_RSVD,
  1225. HTT_STATS_PREAM_RSVD1,
  1226. HTT_STATS_PREAM_COUNT,
  1227. } HTT_STATS_PREAM_TYPE;
  1228. #define HTT_TX_PEER_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  1229. #define HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  1230. /* HTT_TX_PEER_STATS_NUM_GI_COUNTERS:
  1231. * GI Index 0: WHAL_GI_800
  1232. * GI Index 1: WHAL_GI_400
  1233. * GI Index 2: WHAL_GI_1600
  1234. * GI Index 3: WHAL_GI_3200
  1235. */
  1236. #define HTT_TX_PEER_STATS_NUM_GI_COUNTERS 4
  1237. #define HTT_TX_PEER_STATS_NUM_DCM_COUNTERS 5
  1238. /* HTT_TX_PEER_STATS_NUM_BW_COUNTERS:
  1239. * bw index 0: rssi_pri20_chain0
  1240. * bw index 1: rssi_ext20_chain0
  1241. * bw index 2: rssi_ext40_low20_chain0
  1242. * bw index 3: rssi_ext40_high20_chain0
  1243. */
  1244. #define HTT_TX_PEER_STATS_NUM_BW_COUNTERS 4
  1245. /* HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS:
  1246. * bw index 4 (bw ext index 0): rssi_ext80_low20_chain0
  1247. * bw index 5 (bw ext index 1): rssi_ext80_low_high20_chain0
  1248. * bw index 6 (bw ext index 2): rssi_ext80_high_low20_chain0
  1249. * bw index 7 (bw ext index 3): rssi_ext80_high20_chain0
  1250. */
  1251. #define HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS 4
  1252. #define HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS 4
  1253. #define HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS 8
  1254. #define HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  1255. typedef struct _htt_tx_peer_rate_stats_tlv {
  1256. htt_tlv_hdr_t tlv_hdr;
  1257. /* Number of tx ldpc packets */
  1258. A_UINT32 tx_ldpc;
  1259. /* Number of tx rts packets */
  1260. A_UINT32 rts_cnt;
  1261. /* RSSI value of last ack packet (units = dB above noise floor) */
  1262. A_UINT32 ack_rssi;
  1263. A_UINT32 tx_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1264. A_UINT32 tx_su_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1265. A_UINT32 tx_mu_mcs[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1266. A_UINT32 tx_nss[HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  1267. A_UINT32 tx_bw[HTT_TX_PEER_STATS_NUM_BW_COUNTERS]; /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  1268. A_UINT32 tx_stbc[HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1269. A_UINT32 tx_pream[HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES];
  1270. /* Counters to track number of tx packets in each GI (400us, 800us, 1600us & 3200us) in each mcs (0-11) */
  1271. A_UINT32 tx_gi[HTT_TX_PEER_STATS_NUM_GI_COUNTERS][HTT_TX_PEER_STATS_NUM_MCS_COUNTERS];
  1272. /* Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  1273. A_UINT32 tx_dcm[HTT_TX_PEER_STATS_NUM_DCM_COUNTERS];
  1274. /* Stats for MCS 12/13 */
  1275. A_UINT32 tx_mcs_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1276. A_UINT32 tx_su_mcs_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1277. A_UINT32 tx_mu_mcs_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1278. A_UINT32 tx_stbc_ext[HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1279. A_UINT32 tx_gi_ext[HTT_TX_PEER_STATS_NUM_GI_COUNTERS][HTT_TX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1280. } htt_tx_peer_rate_stats_tlv;
  1281. #define HTT_RX_PEER_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  1282. #define HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  1283. #define HTT_RX_PEER_STATS_NUM_GI_COUNTERS 4
  1284. #define HTT_RX_PEER_STATS_NUM_DCM_COUNTERS 5
  1285. #define HTT_RX_PEER_STATS_NUM_BW_COUNTERS 4
  1286. #define HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS 8
  1287. #define HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  1288. typedef struct _htt_rx_peer_rate_stats_tlv {
  1289. htt_tlv_hdr_t tlv_hdr;
  1290. A_UINT32 nsts;
  1291. /* Number of rx ldpc packets */
  1292. A_UINT32 rx_ldpc;
  1293. /* Number of rx rts packets */
  1294. A_UINT32 rts_cnt;
  1295. A_UINT32 rssi_mgmt; /* units = dB above noise floor */
  1296. A_UINT32 rssi_data; /* units = dB above noise floor */
  1297. A_UINT32 rssi_comb; /* units = dB above noise floor */
  1298. A_UINT32 rx_mcs[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1299. A_UINT32 rx_nss[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  1300. A_UINT32 rx_dcm[HTT_RX_PEER_STATS_NUM_DCM_COUNTERS];
  1301. A_UINT32 rx_stbc[HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1302. A_UINT32 rx_bw[HTT_RX_PEER_STATS_NUM_BW_COUNTERS]; /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  1303. A_UINT32 rx_pream[HTT_RX_PEER_STATS_NUM_PREAMBLE_TYPES];
  1304. A_UINT8 rssi_chain[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_COUNTERS]; /* units = dB above noise floor */
  1305. /* Counters to track number of rx packets in each GI in each mcs (0-11) */
  1306. A_UINT32 rx_gi[HTT_RX_PEER_STATS_NUM_GI_COUNTERS][HTT_RX_PEER_STATS_NUM_MCS_COUNTERS];
  1307. A_UINT32 rx_ulofdma_non_data_ppdu; /* ppdu level */
  1308. A_UINT32 rx_ulofdma_data_ppdu; /* ppdu level */
  1309. A_UINT32 rx_ulofdma_mpdu_ok; /* mpdu level */
  1310. A_UINT32 rx_ulofdma_mpdu_fail; /* mpdu level */
  1311. A_INT8 rx_ul_fd_rssi[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS]; /* dBm unit */
  1312. /* per_chain_rssi_pkt_type:
  1313. * This field shows what type of rx frame the per-chain RSSI was computed
  1314. * on, by recording the frame type and sub-type as bit-fields within this
  1315. * field:
  1316. * BIT [3 : 0] :- IEEE80211_FC0_TYPE
  1317. * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE
  1318. * BIT [31 : 8] :- Reserved
  1319. */
  1320. A_UINT32 per_chain_rssi_pkt_type;
  1321. A_INT8 rx_per_chain_rssi_in_dbm[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_COUNTERS];
  1322. A_UINT32 rx_ulmumimo_non_data_ppdu; /* ppdu level */
  1323. A_UINT32 rx_ulmumimo_data_ppdu; /* ppdu level */
  1324. A_UINT32 rx_ulmumimo_mpdu_ok; /* mpdu level */
  1325. A_UINT32 rx_ulmumimo_mpdu_fail; /* mpdu level */
  1326. A_UINT8 rssi_chain_ext[HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS]; /* units = dB above noise floor */
  1327. /* Stats for MCS 12/13 */
  1328. A_UINT32 rx_mcs_ext[HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1329. A_UINT32 rx_stbc_ext[HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1330. A_UINT32 rx_gi_ext[HTT_RX_PEER_STATS_NUM_GI_COUNTERS][HTT_RX_PEER_STATS_NUM_EXTRA_MCS_COUNTERS];
  1331. } htt_rx_peer_rate_stats_tlv;
  1332. typedef enum {
  1333. HTT_PEER_STATS_REQ_MODE_NO_QUERY,
  1334. HTT_PEER_STATS_REQ_MODE_QUERY_TQM,
  1335. HTT_PEER_STATS_REQ_MODE_FLUSH_TQM,
  1336. } htt_peer_stats_req_mode_t;
  1337. typedef enum {
  1338. HTT_PEER_STATS_CMN_TLV = 0,
  1339. HTT_PEER_DETAILS_TLV = 1,
  1340. HTT_TX_PEER_RATE_STATS_TLV = 2,
  1341. HTT_RX_PEER_RATE_STATS_TLV = 3,
  1342. HTT_TX_TID_STATS_TLV = 4,
  1343. HTT_RX_TID_STATS_TLV = 5,
  1344. HTT_MSDU_FLOW_STATS_TLV = 6,
  1345. HTT_PEER_SCHED_STATS_TLV = 7,
  1346. HTT_PEER_STATS_MAX_TLV = 31,
  1347. } htt_peer_stats_tlv_enum;
  1348. typedef struct {
  1349. htt_tlv_hdr_t tlv_hdr;
  1350. A_UINT32 peer_id;
  1351. /* Num of DL schedules for peer */
  1352. A_UINT32 num_sched_dl;
  1353. /* Num od UL schedules for peer */
  1354. A_UINT32 num_sched_ul;
  1355. /* Peer TX time */
  1356. A_UINT32 peer_tx_active_dur_us_low;
  1357. A_UINT32 peer_tx_active_dur_us_high;
  1358. /* Peer RX time */
  1359. A_UINT32 peer_rx_active_dur_us_low;
  1360. A_UINT32 peer_rx_active_dur_us_high;
  1361. A_UINT32 peer_curr_rate_kbps;
  1362. } htt_peer_sched_stats_tlv;
  1363. /* config_param0 */
  1364. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_M 0x00000001
  1365. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_S 0
  1366. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_GET(_var) \
  1367. (((_var) & HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_M) >> \
  1368. HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_S)
  1369. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_SET(_var, _val) \
  1370. do { \
  1371. HTT_CHECK_SET_VAL(HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR, _val); \
  1372. ((_var) |= ((_val) << HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_S)); \
  1373. } while (0)
  1374. /* DEPRECATED
  1375. * The old IS_peer_MAC_ADDR_SET macro name is being retained for now,
  1376. * as an alias for the corrected macro name.
  1377. * If/when all references to the old name are removed, the definition of
  1378. * the old name will also be removed.
  1379. */
  1380. #define HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_peer_MAC_ADDR_SET HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS_IS_MAC_ADDR_SET
  1381. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_M 0x00000001
  1382. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S 0
  1383. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_M 0x0000FFFE
  1384. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_S 1
  1385. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_M 0xFFFF0000
  1386. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S 16
  1387. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_SET(_var, _val) \
  1388. do { \
  1389. HTT_CHECK_SET_VAL(HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR, _val); \
  1390. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S)); \
  1391. } while (0)
  1392. #define HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_GET(_var) \
  1393. (((_var) & HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_M) >> \
  1394. HTT_DBG_EXT_STATS_PEER_INFO_IS_MAC_ADDR_S)
  1395. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_GET(_var) \
  1396. (((_var) & HTT_DBG_EXT_STATS_PEER_REQ_MODE_M) >> \
  1397. HTT_DBG_EXT_STATS_PEER_REQ_MODE_S)
  1398. #define HTT_DBG_EXT_STATS_PEER_REQ_MODE_SET(_var, _val) \
  1399. do { \
  1400. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_REQ_MODE_S)); \
  1401. } while (0)
  1402. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_GET(_var) \
  1403. (((_var) & HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_M) >> \
  1404. HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S)
  1405. #define HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_SET(_var, _val) \
  1406. do { \
  1407. ((_var) |= ((_val) << HTT_DBG_EXT_STATS_PEER_INFO_SW_PEER_ID_S)); \
  1408. } while (0)
  1409. /* STATS_TYPE : HTT_DBG_EXT_STATS_PEER_INFO
  1410. * TLV_TAGS:
  1411. * - HTT_STATS_PEER_STATS_CMN_TAG
  1412. * - HTT_STATS_PEER_DETAILS_TAG
  1413. * - HTT_STATS_PEER_TX_RATE_STATS_TAG
  1414. * - HTT_STATS_PEER_RX_RATE_STATS_TAG
  1415. * - HTT_STATS_TX_TID_DETAILS_TAG (multiple) (deprecated, so 0 elements in updated systems)
  1416. * - HTT_STATS_RX_TID_DETAILS_TAG (multiple)
  1417. * - HTT_STATS_PEER_MSDU_FLOWQ_TAG (multiple)
  1418. * - HTT_STATS_TX_TID_DETAILS_V1_TAG (multiple)
  1419. * - HTT_STATS_PEER_SCHED_STATS_TAG
  1420. */
  1421. /* NOTE:
  1422. * This structure is for documentation, and cannot be safely used directly.
  1423. * Instead, use the constituent TLV structures to fill/parse.
  1424. */
  1425. typedef struct _htt_peer_stats {
  1426. htt_peer_stats_cmn_tlv cmn_tlv;
  1427. htt_peer_details_tlv peer_details;
  1428. /* from g_rate_info_stats */
  1429. htt_tx_peer_rate_stats_tlv tx_rate;
  1430. htt_rx_peer_rate_stats_tlv rx_rate;
  1431. htt_tx_tid_stats_tlv tx_tid_stats[1];
  1432. htt_rx_tid_stats_tlv rx_tid_stats[1];
  1433. htt_msdu_flow_stats_tlv msdu_flowq[1];
  1434. htt_tx_tid_stats_v1_tlv tx_tid_stats_v1[1];
  1435. htt_peer_sched_stats_tlv peer_sched_stats;
  1436. } htt_peer_stats_t;
  1437. /* =========== ACTIVE PEER LIST ========== */
  1438. /* STATS_TYPE: HTT_DBG_EXT_STATS_ACTIVE_PEERS_LIST
  1439. * TLV_TAGS:
  1440. * - HTT_STATS_PEER_DETAILS_TAG
  1441. */
  1442. /* NOTE:
  1443. * This structure is for documentation, and cannot be safely used directly.
  1444. * Instead, use the constituent TLV structures to fill/parse.
  1445. */
  1446. typedef struct {
  1447. htt_peer_details_tlv peer_details[1];
  1448. } htt_active_peer_details_list_t;
  1449. /* =========== MUMIMO HWQ stats =========== */
  1450. /* MU MIMO stats per hwQ */
  1451. typedef struct {
  1452. htt_tlv_hdr_t tlv_hdr;
  1453. A_UINT32 mu_mimo_sch_posted; /* number of MU MIMO schedules posted to HW */
  1454. A_UINT32 mu_mimo_sch_failed; /* number of MU MIMO schedules failed to post */
  1455. A_UINT32 mu_mimo_ppdu_posted; /* number of MU MIMO PPDUs posted to HW */
  1456. } htt_tx_hwq_mu_mimo_sch_stats_tlv;
  1457. typedef struct {
  1458. htt_tlv_hdr_t tlv_hdr;
  1459. A_UINT32 mu_mimo_mpdus_queued_usr; /* 11AC DL MU MIMO number of mpdus queued to HW, per user */
  1460. A_UINT32 mu_mimo_mpdus_tried_usr; /* 11AC DL MU MIMO number of mpdus tried over the air, per user */
  1461. A_UINT32 mu_mimo_mpdus_failed_usr; /* 11AC DL MU MIMO number of mpdus failed acknowledgement, per user */
  1462. A_UINT32 mu_mimo_mpdus_requeued_usr; /* 11AC DL MU MIMO number of mpdus re-queued to HW, per user */
  1463. A_UINT32 mu_mimo_err_no_ba_usr; /* 11AC DL MU MIMO BA not receieved, per user */
  1464. A_UINT32 mu_mimo_mpdu_underrun_usr; /* 11AC DL MU MIMO mpdu underrun encountered, per user */
  1465. A_UINT32 mu_mimo_ampdu_underrun_usr; /* 11AC DL MU MIMO ampdu underrun encountered, per user */
  1466. } htt_tx_hwq_mu_mimo_mpdu_stats_tlv;
  1467. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_M 0x000000ff
  1468. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S 0
  1469. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_M 0x0000ff00
  1470. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S 8
  1471. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_GET(_var) \
  1472. (((_var) & HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_M) >> \
  1473. HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S)
  1474. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_SET(_var, _val) \
  1475. do { \
  1476. HTT_CHECK_SET_VAL(HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID, _val); \
  1477. ((_var) |= ((_val) << HTT_TX_HWQ_MU_MIMO_CMN_STATS_MAC_ID_S)); \
  1478. } while (0)
  1479. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_GET(_var) \
  1480. (((_var) & HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_M) >> \
  1481. HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S)
  1482. #define HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_SET(_var, _val) \
  1483. do { \
  1484. HTT_CHECK_SET_VAL(HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID, _val); \
  1485. ((_var) |= ((_val) << HTT_TX_HWQ_MU_MIMO_CMN_STATS_HWQ_ID_S)); \
  1486. } while (0)
  1487. typedef struct {
  1488. htt_tlv_hdr_t tlv_hdr;
  1489. /* BIT [ 7 : 0] :- mac_id
  1490. * BIT [15 : 8] :- hwq_id
  1491. * BIT [31 : 16] :- reserved
  1492. */
  1493. A_UINT32 mac_id__hwq_id__word;
  1494. } htt_tx_hwq_mu_mimo_cmn_stats_tlv;
  1495. /* NOTE:
  1496. * This structure is for documentation, and cannot be safely used directly.
  1497. * Instead, use the constituent TLV structures to fill/parse.
  1498. */
  1499. typedef struct {
  1500. struct _hwq_mu_mimo_stats {
  1501. htt_tx_hwq_mu_mimo_cmn_stats_tlv cmn_tlv;
  1502. htt_tx_hwq_mu_mimo_sch_stats_tlv mu_mimo_sch_stats_tlv[1]; /* WAL_TX_STATS_MAX_GROUP_SIZE */
  1503. htt_tx_hwq_mu_mimo_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1]; /* WAL_TX_STATS_TX_MAX_NUM_USERS */
  1504. } hwq[1];
  1505. } htt_tx_hwq_mu_mimo_stats_t;
  1506. /* == TX HWQ STATS == */
  1507. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_M 0x000000ff
  1508. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_S 0
  1509. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_M 0x0000ff00
  1510. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_S 8
  1511. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_GET(_var) \
  1512. (((_var) & HTT_TX_HWQ_STATS_CMN_MAC_ID_M) >> \
  1513. HTT_TX_HWQ_STATS_CMN_MAC_ID_S)
  1514. #define HTT_TX_HWQ_STATS_CMN_MAC_ID_SET(_var, _val) \
  1515. do { \
  1516. HTT_CHECK_SET_VAL(HTT_TX_HWQ_STATS_CMN_MAC_ID, _val); \
  1517. ((_var) |= ((_val) << HTT_TX_HWQ_STATS_CMN_MAC_ID_S)); \
  1518. } while (0)
  1519. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_GET(_var) \
  1520. (((_var) & HTT_TX_HWQ_STATS_CMN_HWQ_ID_M) >> \
  1521. HTT_TX_HWQ_STATS_CMN_HWQ_ID_S)
  1522. #define HTT_TX_HWQ_STATS_CMN_HWQ_ID_SET(_var, _val) \
  1523. do { \
  1524. HTT_CHECK_SET_VAL(HTT_TX_HWQ_STATS_CMN_HWQ_ID, _val); \
  1525. ((_var) |= ((_val) << HTT_TX_HWQ_STATS_CMN_HWQ_ID_S)); \
  1526. } while (0)
  1527. typedef struct {
  1528. htt_tlv_hdr_t tlv_hdr;
  1529. /* BIT [ 7 : 0] :- mac_id
  1530. * BIT [15 : 8] :- hwq_id
  1531. * BIT [31 : 16] :- reserved
  1532. */
  1533. A_UINT32 mac_id__hwq_id__word;
  1534. /* PPDU level stats */
  1535. A_UINT32 xretry; /* Number of times ack is failed for the PPDU scheduled on this txQ */
  1536. A_UINT32 underrun_cnt; /* Number of times sched cmd status reported mpdu underrun */
  1537. A_UINT32 flush_cnt; /* Number of times sched cmd is flushed */
  1538. A_UINT32 filt_cnt; /* Number of times sched cmd is filtered */
  1539. A_UINT32 null_mpdu_bmap; /* Number of times HWSCH uploaded null mpdu bitmap */
  1540. A_UINT32 user_ack_failure; /* Number of time user ack or ba tlv is not seen on FES ring where it is expected to be */
  1541. A_UINT32 ack_tlv_proc; /* Number of times TQM processed ack tlv received from HWSCH */
  1542. A_UINT32 sched_id_proc; /* Cache latest processed scheduler ID received from ack ba tlv */
  1543. A_UINT32 null_mpdu_tx_count; /* Number of times TxPCU reported mpdus transmitted for a user is zero */
  1544. A_UINT32 mpdu_bmap_not_recvd; /* Number of times SW did not see any mpdu info bitmap tlv on FES status ring */
  1545. /* Selfgen stats per hwQ */
  1546. A_UINT32 num_bar; /* Number of SU/MU BAR frames posted to hwQ */
  1547. A_UINT32 rts; /* Number of RTS frames posted to hwQ */
  1548. A_UINT32 cts2self; /* Number of cts2self frames posted to hwQ */
  1549. A_UINT32 qos_null; /* Number of qos null frames posted to hwQ */
  1550. /* MPDU level stats */
  1551. A_UINT32 mpdu_tried_cnt; /* mpdus tried Tx by HWSCH/TQM */
  1552. A_UINT32 mpdu_queued_cnt; /* mpdus queued to HWSCH */
  1553. A_UINT32 mpdu_ack_fail_cnt; /* mpdus tried but ack was not received */
  1554. A_UINT32 mpdu_filt_cnt; /* This will include sched cmd flush and time based discard */
  1555. A_UINT32 false_mpdu_ack_count; /* Number of MPDUs for which ACK was sucessful but no Tx happened */
  1556. A_UINT32 txq_timeout; /* Number of times txq timeout happened */
  1557. } htt_tx_hwq_stats_cmn_tlv;
  1558. #define HTT_TX_HWQ_DIFS_LATENCY_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) + /* hist_intvl */ \
  1559. (sizeof(A_UINT32) * (_num_elems)))
  1560. /* NOTE: Variable length TLV, use length spec to infer array size */
  1561. typedef struct {
  1562. htt_tlv_hdr_t tlv_hdr;
  1563. A_UINT32 hist_intvl;
  1564. /* histogram of ppdu post to hwsch - > cmd status received */
  1565. A_UINT32 difs_latency_hist[1]; /* HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS */
  1566. } htt_tx_hwq_difs_latency_stats_tlv_v;
  1567. #define HTT_TX_HWQ_CMD_RESULT_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1568. /* NOTE: Variable length TLV, use length spec to infer array size */
  1569. typedef struct {
  1570. htt_tlv_hdr_t tlv_hdr;
  1571. /* Histogram of sched cmd result */
  1572. A_UINT32 cmd_result[1]; /* HTT_TX_HWQ_MAX_CMD_RESULT_STATS */
  1573. } htt_tx_hwq_cmd_result_stats_tlv_v;
  1574. #define HTT_TX_HWQ_CMD_STALL_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1575. /* NOTE: Variable length TLV, use length spec to infer array size */
  1576. typedef struct {
  1577. htt_tlv_hdr_t tlv_hdr;
  1578. /* Histogram of various pause conitions */
  1579. A_UINT32 cmd_stall_status[1]; /* HTT_TX_HWQ_MAX_CMD_STALL_STATS */
  1580. } htt_tx_hwq_cmd_stall_stats_tlv_v;
  1581. #define HTT_TX_HWQ_FES_RESULT_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1582. /* NOTE: Variable length TLV, use length spec to infer array size */
  1583. typedef struct {
  1584. htt_tlv_hdr_t tlv_hdr;
  1585. /* Histogram of number of user fes result */
  1586. A_UINT32 fes_result[1]; /* HTT_TX_HWQ_MAX_FES_RESULT_STATS */
  1587. } htt_tx_hwq_fes_result_stats_tlv_v;
  1588. #define HTT_TX_HWQ_TRIED_MPDU_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1589. /* NOTE: Variable length TLV, use length spec to infer array size
  1590. *
  1591. * The hwq_tried_mpdu_cnt_hist is a histogram of MPDUs tries per HWQ.
  1592. * The tries here is the count of the MPDUS within a PPDU that the HW
  1593. * had attempted to transmit on air, for the HWSCH Schedule command
  1594. * submitted by FW in this HWQ .It is not the retry attempts. The
  1595. * histogram bins are 0-29, 30-59, 60-89 and so on. The are 10 bins
  1596. * in this histogram.
  1597. * they are defined in FW using the following macros
  1598. * #define WAL_MAX_TRIED_MPDU_CNT_HISTOGRAM 9
  1599. * #define WAL_TRIED_MPDU_CNT_HISTOGRAM_INTERVAL 30
  1600. *
  1601. * */
  1602. typedef struct {
  1603. htt_tlv_hdr_t tlv_hdr;
  1604. A_UINT32 hist_bin_size;
  1605. /* Histogram of number of mpdus on tried mpdu */
  1606. A_UINT32 tried_mpdu_cnt_hist[1]; /* HTT_TX_HWQ_TRIED_MPDU_CNT_HIST */
  1607. } htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v;
  1608. #define HTT_TX_HWQ_TXOP_USED_CNT_HIST_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  1609. /* NOTE: Variable length TLV, use length spec to infer array size
  1610. *
  1611. * The txop_used_cnt_hist is the histogram of txop per burst. After
  1612. * completing the burst, we identify the txop used in the burst and
  1613. * incr the corresponding bin.
  1614. * Each bin represents 1ms & we have 10 bins in this histogram.
  1615. * they are deined in FW using the following macros
  1616. * #define WAL_MAX_TXOP_USED_CNT_HISTOGRAM 10
  1617. * #define WAL_TXOP_USED_HISTOGRAM_INTERVAL 1000 ( 1 ms )
  1618. *
  1619. * */
  1620. typedef struct {
  1621. htt_tlv_hdr_t tlv_hdr;
  1622. /* Histogram of txop used cnt */
  1623. A_UINT32 txop_used_cnt_hist[1]; /* HTT_TX_HWQ_TXOP_USED_CNT_HIST */
  1624. } htt_tx_hwq_txop_used_cnt_hist_tlv_v;
  1625. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_HWQ
  1626. * TLV_TAGS:
  1627. * - HTT_STATS_STRING_TAG
  1628. * - HTT_STATS_TX_HWQ_CMN_TAG
  1629. * - HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG
  1630. * - HTT_STATS_TX_HWQ_CMD_RESULT_TAG
  1631. * - HTT_STATS_TX_HWQ_CMD_STALL_TAG
  1632. * - HTT_STATS_TX_HWQ_FES_STATUS_TAG
  1633. * - HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG
  1634. * - HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG
  1635. */
  1636. /* NOTE:
  1637. * This structure is for documentation, and cannot be safely used directly.
  1638. * Instead, use the constituent TLV structures to fill/parse.
  1639. * General HWQ stats Mechanism:
  1640. * Once the host request for the stats, FW fill all the HWQ TAGS in a buffer
  1641. * for all the HWQ requested. & the FW send the buffer to host. In the
  1642. * buffer the HWQ ID is filled in mac_id__hwq_id, thus identifying each
  1643. * HWQ distinctly.
  1644. */
  1645. typedef struct _htt_tx_hwq_stats {
  1646. htt_stats_string_tlv hwq_str_tlv;
  1647. htt_tx_hwq_stats_cmn_tlv cmn_tlv;
  1648. htt_tx_hwq_difs_latency_stats_tlv_v difs_tlv;
  1649. htt_tx_hwq_cmd_result_stats_tlv_v cmd_result_tlv;
  1650. htt_tx_hwq_cmd_stall_stats_tlv_v cmd_stall_tlv;
  1651. htt_tx_hwq_fes_result_stats_tlv_v fes_stats_tlv;
  1652. htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v tried_mpdu_tlv;
  1653. htt_tx_hwq_txop_used_cnt_hist_tlv_v txop_used_tlv;
  1654. } htt_tx_hwq_stats_t;
  1655. /* == TX SELFGEN STATS == */
  1656. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_M 0x000000ff
  1657. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S 0
  1658. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_GET(_var) \
  1659. (((_var) & HTT_TX_SELFGEN_CMN_STATS_MAC_ID_M) >> \
  1660. HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S)
  1661. #define HTT_TX_SELFGEN_CMN_STATS_MAC_ID_SET(_var, _val) \
  1662. do { \
  1663. HTT_CHECK_SET_VAL(HTT_TX_SELFGEN_CMN_STATS_MAC_ID, _val); \
  1664. ((_var) |= ((_val) << HTT_TX_SELFGEN_CMN_STATS_MAC_ID_S)); \
  1665. } while (0)
  1666. typedef enum {
  1667. HTT_TXERR_NONE,
  1668. HTT_TXERR_RESP, /* response timeout, mismatch,
  1669. * BW mismatch, mimo ctrl mismatch,
  1670. * CRC error.. */
  1671. HTT_TXERR_FILT, /* blocked by tx filtering */
  1672. HTT_TXERR_FIFO, /* fifo, misc errors in HW */
  1673. HTT_TXERR_SWABORT, /* software initialted abort (TX_ABORT) */
  1674. HTT_TXERR_RESERVED1,
  1675. HTT_TXERR_RESERVED2,
  1676. HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS = 7,
  1677. HTT_TXERR_INVALID = 0xff,
  1678. } htt_tx_err_status_t;
  1679. /* Matching enum for htt_tx_selfgen_sch_tsflag_error_stats */
  1680. typedef enum {
  1681. HTT_TX_SELFGEN_SCH_TSFLAG_FLUSH_RCVD_ERR,
  1682. HTT_TX_SELFGEN_SCH_TSFLAG_FILT_SCHED_CMD_ERR,
  1683. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_MISMATCH_ERR,
  1684. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_MIMO_CTRL_MISMATCH_ERR,
  1685. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_BW_MISMATCH_ERR,
  1686. HTT_TX_SELFGEN_SCH_TSFLAG_RETRY_COUNT_FAIL_ERR,
  1687. HTT_TX_SELFGEN_SCH_TSFLAG_RESP_TOO_LATE_RECEIVED_ERR,
  1688. HTT_TX_SELFGEN_SCH_TSFLAG_SIFS_STALL_NO_NEXT_CMD_ERR,
  1689. HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS = 8,
  1690. HTT_TX_SELFGEN_SCH_TSFLAG_ERROR_STATS_VALID = 8
  1691. } htt_tx_selfgen_sch_tsflag_error_stats;
  1692. #define HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS 4
  1693. #define HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS 8
  1694. #define HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS 74
  1695. #define HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS 8
  1696. typedef struct {
  1697. htt_tlv_hdr_t tlv_hdr;
  1698. /* BIT [ 7 : 0] :- mac_id
  1699. * BIT [31 : 8] :- reserved
  1700. */
  1701. A_UINT32 mac_id__word;
  1702. A_UINT32 su_bar; /* BAR sent out for SU transmission */
  1703. A_UINT32 rts; /* SW generated RTS frame sent */
  1704. A_UINT32 cts2self; /* SW generated CTS-to-self frame sent */
  1705. A_UINT32 qos_null; /* SW generated QOS NULL frame sent */
  1706. A_UINT32 delayed_bar_1; /* BAR sent for MU user 1 */
  1707. A_UINT32 delayed_bar_2; /* BAR sent for MU user 2 */
  1708. A_UINT32 delayed_bar_3; /* BAR sent for MU user 3 */
  1709. A_UINT32 delayed_bar_4; /* BAR sent for MU user 4 */
  1710. A_UINT32 delayed_bar_5; /* BAR sent for MU user 5 */
  1711. A_UINT32 delayed_bar_6; /* BAR sent for MU user 6 */
  1712. A_UINT32 delayed_bar_7; /* BAR sent for MU user 7 */
  1713. A_UINT32 bar_with_tqm_head_seq_num;
  1714. A_UINT32 bar_with_tid_seq_num;
  1715. } htt_tx_selfgen_cmn_stats_tlv;
  1716. typedef struct {
  1717. htt_tlv_hdr_t tlv_hdr;
  1718. A_UINT32 ac_su_ndpa; /* 11AC VHT SU NDPA frame sent over the air */
  1719. A_UINT32 ac_su_ndp; /* 11AC VHT SU NDP frame sent over the air */
  1720. A_UINT32 ac_mu_mimo_ndpa; /* 11AC VHT MU MIMO NDPA frame sent over the air */
  1721. A_UINT32 ac_mu_mimo_ndp; /* 11AC VHT MU MIMO NDP frame sent over the air */
  1722. A_UINT32 ac_mu_mimo_brpoll_1; /* 11AC VHT MU MIMO BR-POLL for user 1 sent over the air */
  1723. A_UINT32 ac_mu_mimo_brpoll_2; /* 11AC VHT MU MIMO BR-POLL for user 2 sent over the air */
  1724. A_UINT32 ac_mu_mimo_brpoll_3; /* 11AC VHT MU MIMO BR-POLL for user 3 sent over the air */
  1725. A_UINT32 ac_su_ndpa_queued; /* 11AC VHT SU NDPA frame queued to the HW */
  1726. A_UINT32 ac_su_ndp_queued; /* 11AC VHT SU NDP frame queued to the HW */
  1727. A_UINT32 ac_mu_mimo_ndpa_queued; /* 11AC VHT MU MIMO NDPA frame queued to the HW */
  1728. A_UINT32 ac_mu_mimo_ndp_queued; /* 11AC VHT MU MIMO NDP frame queued to the HW */
  1729. A_UINT32 ac_mu_mimo_brpoll_1_queued; /* 11AC VHT MU MIMO BR-POLL for user 1 frame queued to the HW */
  1730. A_UINT32 ac_mu_mimo_brpoll_2_queued; /* 11AC VHT MU MIMO BR-POLL for user 2 frame queued to the HW */
  1731. A_UINT32 ac_mu_mimo_brpoll_3_queued; /* 11AC VHT MU MIMO BR-POLL for user 3 frame queued to the HW */
  1732. } htt_tx_selfgen_ac_stats_tlv;
  1733. typedef struct {
  1734. htt_tlv_hdr_t tlv_hdr;
  1735. A_UINT32 ax_su_ndpa; /* 11AX HE SU NDPA frame sent over the air */
  1736. A_UINT32 ax_su_ndp; /* 11AX HE NDP frame sent over the air */
  1737. A_UINT32 ax_mu_mimo_ndpa; /* 11AX HE MU MIMO NDPA frame sent over the air */
  1738. A_UINT32 ax_mu_mimo_ndp; /* 11AX HE MU MIMO NDP frame sent over the air */
  1739. union {
  1740. struct {
  1741. /* deprecated old names */
  1742. A_UINT32 ax_mu_mimo_brpoll_1;
  1743. A_UINT32 ax_mu_mimo_brpoll_2;
  1744. A_UINT32 ax_mu_mimo_brpoll_3;
  1745. A_UINT32 ax_mu_mimo_brpoll_4;
  1746. A_UINT32 ax_mu_mimo_brpoll_5;
  1747. A_UINT32 ax_mu_mimo_brpoll_6;
  1748. A_UINT32 ax_mu_mimo_brpoll_7;
  1749. };
  1750. /* 11AX HE MU BR-POLL frame for users 1 - 7 sent over the air */
  1751. A_UINT32 ax_mu_mimo_brpoll[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  1752. };
  1753. A_UINT32 ax_basic_trigger; /* 11AX HE MU Basic Trigger frame sent over the air */
  1754. A_UINT32 ax_bsr_trigger; /* 11AX HE MU BSRP Trigger frame sent over the air */
  1755. A_UINT32 ax_mu_bar_trigger; /* 11AX HE MU BAR Trigger frame sent over the air */
  1756. A_UINT32 ax_mu_rts_trigger; /* 11AX HE MU RTS Trigger frame sent over the air */
  1757. A_UINT32 ax_ulmumimo_trigger; /* 11AX HE MU UL-MUMIMO Trigger frame sent over the air */
  1758. A_UINT32 ax_su_ndpa_queued; /* 11AX HE SU NDPA frame queued to the HW */
  1759. A_UINT32 ax_su_ndp_queued; /* 11AX HE SU NDP frame queued to the HW */
  1760. A_UINT32 ax_mu_mimo_ndpa_queued; /* 11AX HE MU MIMO NDPA frame queued to the HW */
  1761. A_UINT32 ax_mu_mimo_ndp_queued; /* 11AX HE MU MIMO NDP frame queued to the HW */
  1762. /* 11AX HE MU BR-POLL frame for users 1 - 7 queued to the HW */
  1763. A_UINT32 ax_mu_mimo_brpoll_queued[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  1764. /* 11AX HE UL-MUMIMO Trigger frame for users 0 - 7 successfully sent over the air */
  1765. A_UINT32 ax_ul_mumimo_trigger[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  1766. } htt_tx_selfgen_ax_stats_tlv;
  1767. typedef struct {
  1768. htt_tlv_hdr_t tlv_hdr;
  1769. /* 11AX HE OFDMA NDPA frame queued to the HW */
  1770. A_UINT32 ax_ofdma_ndpa_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1771. /* 11AX HE OFDMA NDPA frame sent over the air */
  1772. A_UINT32 ax_ofdma_ndpa_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1773. /* 11AX HE OFDMA NDPA frame flushed by HW */
  1774. A_UINT32 ax_ofdma_ndpa_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1775. /* 11AX HE OFDMA NDPA frame completed with error(s) */
  1776. A_UINT32 ax_ofdma_ndpa_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1777. } htt_txbf_ofdma_ndpa_stats_tlv;
  1778. typedef struct {
  1779. htt_tlv_hdr_t tlv_hdr;
  1780. /* 11AX HE OFDMA NDP frame queued to the HW */
  1781. A_UINT32 ax_ofdma_ndp_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1782. /* 11AX HE OFDMA NDPA frame sent over the air */
  1783. A_UINT32 ax_ofdma_ndp_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1784. /* 11AX HE OFDMA NDPA frame flushed by HW */
  1785. A_UINT32 ax_ofdma_ndp_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1786. /* 11AX HE OFDMA NDPA frame completed with error(s) */
  1787. A_UINT32 ax_ofdma_ndp_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1788. } htt_txbf_ofdma_ndp_stats_tlv;
  1789. typedef struct {
  1790. htt_tlv_hdr_t tlv_hdr;
  1791. /* 11AX HE OFDMA MU BRPOLL frame queued to the HW */
  1792. A_UINT32 ax_ofdma_brpoll_queued[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1793. /* 11AX HE OFDMA MU BRPOLL frame sent over the air */
  1794. A_UINT32 ax_ofdma_brpoll_tried[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1795. /* 11AX HE OFDMA MU BRPOLL frame flushed by HW */
  1796. A_UINT32 ax_ofdma_brpoll_flushed[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1797. /* 11AX HE OFDMA MU BRPOLL frame completed with error(s) */
  1798. A_UINT32 ax_ofdma_brp_err[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1799. /* Number of CBF(s) received when 11AX HE OFDMA MU BRPOLL frame completed with error(s) */
  1800. A_UINT32 ax_ofdma_brp_err_num_cbf_rcvd[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS+1];
  1801. } htt_txbf_ofdma_brp_stats_tlv;
  1802. typedef struct {
  1803. htt_tlv_hdr_t tlv_hdr;
  1804. /* 11AX HE OFDMA PPDUs that were sent over the air with steering (TXBF + OFDMA) */
  1805. A_UINT32 ax_ofdma_num_ppdu_steer[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1806. /* 11AX HE OFDMA PPDUs that were sent over the air in open loop */
  1807. A_UINT32 ax_ofdma_num_ppdu_ol[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1808. /* 11AX HE OFDMA number of users for which CBF prefetch was initiated to PHY HW during TX */
  1809. A_UINT32 ax_ofdma_num_usrs_prefetch[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1810. /* 11AX HE OFDMA number of users for which sounding was initiated during TX */
  1811. A_UINT32 ax_ofdma_num_usrs_sound[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1812. /* 11AX HE OFDMA number of users for which sounding was forced during TX */
  1813. A_UINT32 ax_ofdma_num_usrs_force_sound[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  1814. } htt_txbf_ofdma_steer_stats_tlv;
  1815. /* STATS_TYPE : HTT_DBG_EXT_STATS_TXBF_OFDMA
  1816. * TLV_TAGS:
  1817. * - HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG
  1818. * - HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG
  1819. * - HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG
  1820. * - HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG
  1821. */
  1822. /* NOTE:
  1823. * This structure is for documentation, and cannot be safely used directly.
  1824. * Instead, use the constituent TLV structures to fill/parse.
  1825. */
  1826. typedef struct {
  1827. htt_txbf_ofdma_ndpa_stats_tlv ofdma_ndpa_tlv;
  1828. htt_txbf_ofdma_ndp_stats_tlv ofdma_ndp_tlv;
  1829. htt_txbf_ofdma_brp_stats_tlv ofdma_brp_tlv;
  1830. htt_txbf_ofdma_steer_stats_tlv ofdma_steer_tlv;
  1831. } htt_tx_pdev_txbf_ofdma_stats_t;
  1832. typedef struct {
  1833. htt_tlv_hdr_t tlv_hdr;
  1834. A_UINT32 ac_su_ndp_err; /* 11AC VHT SU NDP frame completed with error(s) */
  1835. A_UINT32 ac_su_ndpa_err; /* 11AC VHT SU NDPA frame completed with error(s) */
  1836. A_UINT32 ac_mu_mimo_ndpa_err; /* 11AC VHT MU MIMO NDPA frame completed with error(s) */
  1837. A_UINT32 ac_mu_mimo_ndp_err; /* 11AC VHT MU MIMO NDP frame completed with error(s) */
  1838. A_UINT32 ac_mu_mimo_brp1_err; /* 11AC VHT MU MIMO BRPOLL for user 1 frame completed with error(s) */
  1839. A_UINT32 ac_mu_mimo_brp2_err; /* 11AC VHT MU MIMO BRPOLL for user 2 frame completed with error(s) */
  1840. A_UINT32 ac_mu_mimo_brp3_err; /* 11AC VHT MU MIMO BRPOLL for user 3 frame completed with error(s) */
  1841. A_UINT32 ac_su_ndpa_flushed; /* 11AC VHT SU NDPA frame flushed by HW */
  1842. A_UINT32 ac_su_ndp_flushed; /* 11AC VHT SU NDP frame flushed by HW */
  1843. A_UINT32 ac_mu_mimo_ndpa_flushed; /* 11AC VHT MU MIMO NDPA frame flushed by HW */
  1844. A_UINT32 ac_mu_mimo_ndp_flushed; /* 11AC VHT MU MIMO NDP frame flushed by HW */
  1845. A_UINT32 ac_mu_mimo_brpoll1_flushed; /* 11AC VHT MU MIMO BRPOLL for user 1 frame flushed by HW */
  1846. A_UINT32 ac_mu_mimo_brpoll2_flushed; /* 11AC VHT MU MIMO BRPOLL for user 2 frame flushed by HW */
  1847. A_UINT32 ac_mu_mimo_brpoll3_flushed; /* 11AC VHT MU MIMO BRPOLL for user 3 frame flushed by HW */
  1848. } htt_tx_selfgen_ac_err_stats_tlv;
  1849. typedef struct {
  1850. htt_tlv_hdr_t tlv_hdr;
  1851. A_UINT32 ax_su_ndp_err; /* 11AX HE SU NDP frame completed with error(s) */
  1852. A_UINT32 ax_su_ndpa_err; /* 11AX HE SU NDPA frame completed with error(s) */
  1853. A_UINT32 ax_mu_mimo_ndpa_err; /* 11AX HE MU MIMO NDPA frame completed with error(s) */
  1854. A_UINT32 ax_mu_mimo_ndp_err; /* 11AX HE MU MIMO NDP frame completed with error(s) */
  1855. union {
  1856. struct {
  1857. /* deprecated old names */
  1858. A_UINT32 ax_mu_mimo_brp1_err;
  1859. A_UINT32 ax_mu_mimo_brp2_err;
  1860. A_UINT32 ax_mu_mimo_brp3_err;
  1861. A_UINT32 ax_mu_mimo_brp4_err;
  1862. A_UINT32 ax_mu_mimo_brp5_err;
  1863. A_UINT32 ax_mu_mimo_brp6_err;
  1864. A_UINT32 ax_mu_mimo_brp7_err;
  1865. };
  1866. /* 11AX HE MU BR-POLL frame for 1 - 7 users completed with error(s) */
  1867. A_UINT32 ax_mu_mimo_brp_err[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  1868. };
  1869. A_UINT32 ax_basic_trigger_err; /* 11AX HE MU Basic Trigger frame completed with error(s) */
  1870. A_UINT32 ax_bsr_trigger_err; /* 11AX HE MU BSRP Trigger frame completed with error(s) */
  1871. A_UINT32 ax_mu_bar_trigger_err; /* 11AX HE MU BAR Trigger frame completed with error(s) */
  1872. A_UINT32 ax_mu_rts_trigger_err; /* 11AX HE MU RTS Trigger frame completed with error(s) */
  1873. A_UINT32 ax_ulmumimo_trigger_err; /* 11AX HE MU ULMUMIMO Trigger frame completed with error(s) */
  1874. /* Number of CBF(s) received when 11AX HE MU MIMO BRPOLL frame completed with error(s) */
  1875. A_UINT32 ax_mu_mimo_brp_err_num_cbf_received[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  1876. A_UINT32 ax_su_ndpa_flushed; /* 11AX HE SU NDPA frame flushed by HW */
  1877. A_UINT32 ax_su_ndp_flushed; /* 11AX HE SU NDP frame flushed by HW */
  1878. A_UINT32 ax_mu_mimo_ndpa_flushed; /* 11AX HE MU MIMO NDPA frame flushed by HW */
  1879. A_UINT32 ax_mu_mimo_ndp_flushed; /* 11AX HE MU MIMO NDP frame flushed by HW */
  1880. /* 11AX HE MU BR-POLL frame for users 1 - 7 flushed by HW */
  1881. A_UINT32 ax_mu_mimo_brpoll_flushed[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS - 1];
  1882. /* 11AX HE UL-MUMIMO Trigger frame for users 0 - 7 completed with error(s) */
  1883. A_UINT32 ax_ul_mumimo_trigger_err[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  1884. } htt_tx_selfgen_ax_err_stats_tlv;
  1885. /*
  1886. * Scheduler completion status reason code.
  1887. * (0) HTT_TXERR_NONE - No error (Success).
  1888. * (1) HTT_TXERR_RESP - Response timeout, response mismatch, BW mismatch,
  1889. * MIMO control mismatch, CRC error etc.
  1890. * (2) HTT_TXERR_FILT - Blocked by HW tx filtering.
  1891. * (3) HTT_TXERR_FIFO - FIFO, misc. errors in HW.
  1892. * (4) HTT_TXERR_SWABORT - Software initialted abort (TX_ABORT).
  1893. * (5) HTT_TXERR_RESERVED1 - Currently reserved.
  1894. * (6) HTT_TXERR_RESERVED2 - Currently reserved.
  1895. */
  1896. /* Scheduler error code.
  1897. * (0) HTT_TX_SELFGEN_SCH_TSFLAG_FLUSH_RCVD_ERR - Flush received from HW.
  1898. * (1) HTT_TX_SELFGEN_SCH_TSFLAG_FILT_SCHED_CMD_ERR - Scheduler command was
  1899. * filtered by HW.
  1900. * (2) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_MISMATCH_ERR - Response frame mismatch
  1901. * error.
  1902. * (3) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_MIMO_CTRL_MISMATCH_ERR - CBF
  1903. * received with MIMO control mismatch.
  1904. * (4) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_CBF_BW_MISMATCH_ERR - CBF received with
  1905. * BW mismatch.
  1906. * (5) HTT_TX_SELFGEN_SCH_TSFLAG_RETRY_COUNT_FAIL_ERR - Error in transmitting
  1907. * frame even after maximum retries.
  1908. * (6) HTT_TX_SELFGEN_SCH_TSFLAG_RESP_TOO_LATE_RECEIVED_ERR - Response frame
  1909. * received outside RX window.
  1910. * (7) HTT_TX_SELFGEN_SCH_TSFLAG_SIFS_STALL_NO_NEXT_CMD_ERR - No frame
  1911. * received by HW for queuing within SIFS interval.
  1912. */
  1913. typedef struct {
  1914. htt_tlv_hdr_t tlv_hdr;
  1915. /* 11AC VHT SU NDPA scheduler completion status reason code */
  1916. A_UINT32 ac_su_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1917. /* 11AC VHT SU NDP scheduler completion status reason code */
  1918. A_UINT32 ac_su_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1919. /* 11AC VHT SU NDP scheduler error code */
  1920. A_UINT32 ac_su_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  1921. /* 11AC VHT MU MIMO NDPA scheduler completion status reason code */
  1922. A_UINT32 ac_mu_mimo_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1923. /* 11AC VHT MU MIMO NDP scheduler completion status reason code */
  1924. A_UINT32 ac_mu_mimo_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1925. /* 11AC VHT MU MIMO NDP scheduler error code */
  1926. A_UINT32 ac_mu_mimo_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  1927. /* 11AC VHT MU MIMO BRPOLL scheduler completion status reason code */
  1928. A_UINT32 ac_mu_mimo_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1929. /* 11AC VHT MU MIMO BRPOLL scheduler error code */
  1930. A_UINT32 ac_mu_mimo_brp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  1931. } htt_tx_selfgen_ac_sched_status_stats_tlv;
  1932. typedef struct {
  1933. htt_tlv_hdr_t tlv_hdr;
  1934. /* 11AX HE SU NDPA scheduler completion status reason code */
  1935. A_UINT32 ax_su_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1936. /* 11AX SU NDP scheduler completion status reason code */
  1937. A_UINT32 ax_su_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1938. /* 11AX HE SU NDP scheduler error code */
  1939. A_UINT32 ax_su_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  1940. /* 11AX HE MU MIMO NDPA scheduler completion status reason code */
  1941. A_UINT32 ax_mu_mimo_ndpa_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1942. /* 11AX HE MU MIMO NDP scheduler completion status reason code */
  1943. A_UINT32 ax_mu_mimo_ndp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1944. /* 11AX HE MU MIMO NDP scheduler error code */
  1945. A_UINT32 ax_mu_mimo_ndp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  1946. /* 11AX HE MU MIMO MU BRPOLL scheduler completion status reason code */
  1947. A_UINT32 ax_mu_brp_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1948. /* 11AX HE MU MIMO MU BRPOLL scheduler error code */
  1949. A_UINT32 ax_mu_brp_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  1950. /* 11AX HE MU BAR scheduler completion status reason code */
  1951. A_UINT32 ax_mu_bar_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1952. /* 11AX HE MU BAR scheduler error code */
  1953. A_UINT32 ax_mu_bar_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  1954. /* 11AX HE Basic Trigger scheduler completion status reason code */
  1955. A_UINT32 ax_basic_trig_sch_status[HTT_TX_PDEV_STATS_NUM_TX_ERR_STATUS];
  1956. /* 11AX HE Basic Trigger scheduler error code */
  1957. A_UINT32 ax_basic_trig_sch_flag_err[HTT_TX_SELFGEN_NUM_SCH_TSFLAG_ERROR_STATS];
  1958. } htt_tx_selfgen_ax_sched_status_stats_tlv;
  1959. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_SELFGEN_INFO
  1960. * TLV_TAGS:
  1961. * - HTT_STATS_TX_SELFGEN_CMN_STATS_TAG
  1962. * - HTT_STATS_TX_SELFGEN_AC_STATS_TAG
  1963. * - HTT_STATS_TX_SELFGEN_AX_STATS_TAG
  1964. * - HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG
  1965. * - HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG
  1966. */
  1967. /* NOTE:
  1968. * This structure is for documentation, and cannot be safely used directly.
  1969. * Instead, use the constituent TLV structures to fill/parse.
  1970. */
  1971. typedef struct {
  1972. htt_tx_selfgen_cmn_stats_tlv cmn_tlv;
  1973. htt_tx_selfgen_ac_stats_tlv ac_tlv;
  1974. htt_tx_selfgen_ax_stats_tlv ax_tlv;
  1975. htt_tx_selfgen_ac_err_stats_tlv ac_err_tlv;
  1976. htt_tx_selfgen_ax_err_stats_tlv ax_err_tlv;
  1977. htt_tx_selfgen_ac_sched_status_stats_tlv ac_sched_status_tlv;
  1978. htt_tx_selfgen_ax_sched_status_stats_tlv ax_sched_status_tlv;
  1979. } htt_tx_pdev_selfgen_stats_t;
  1980. /* == TX MU STATS == */
  1981. typedef struct {
  1982. htt_tlv_hdr_t tlv_hdr;
  1983. A_UINT32 mu_mimo_sch_posted; /* Number of MU MIMO schedules posted to HW */
  1984. A_UINT32 mu_mimo_sch_failed; /* Number of MU MIMO schedules failed to post */
  1985. A_UINT32 mu_mimo_ppdu_posted; /* Number of MU MIMO PPDUs posted to HW */
  1986. /*
  1987. * This is the common description for the below sch stats.
  1988. * Counts the number of transmissions of each number of MU users
  1989. * in each TX mode.
  1990. * The array index is the "number of users - 1".
  1991. * For example, ac_mu_mimo_sch_nusers[1] counts the number of 11AC MU2
  1992. * TX PPDUs, ac_mu_mimo_sch_nusers[2] counts the number of 11AC MU3
  1993. * TX PPDUs and so on.
  1994. * The same is applicable for the other TX mode stats.
  1995. */
  1996. /* Represents the count for 11AC DL MU MIMO sequences */
  1997. A_UINT32 ac_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  1998. /* Represents the count for 11AX DL MU MIMO sequences */
  1999. A_UINT32 ax_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2000. /* Represents the count for 11AX DL MU OFDMA sequences */
  2001. A_UINT32 ax_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2002. /* Represents the count for 11AX UL MU OFDMA sequences with Basic Triggers */
  2003. A_UINT32 ax_ul_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2004. /* Represents the count for 11AX UL MU OFDMA sequences with BSRP Triggers */
  2005. A_UINT32 ax_ul_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2006. /* Represents the count for 11AX UL MU OFDMA sequences with BAR Triggers */
  2007. A_UINT32 ax_ul_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2008. /* Represents the count for 11AX UL MU OFDMA sequences with BRP Triggers */
  2009. A_UINT32 ax_ul_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2010. /* Represents the count for 11AX UL MU MIMO sequences with Basic Triggers */
  2011. A_UINT32 ax_ul_mumimo_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  2012. /* Represents the count for 11AX UL MU MIMO sequences with BRP Triggers */
  2013. A_UINT32 ax_ul_mumimo_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  2014. /* Number of 11AC DL MU MIMO schedules posted per group size */
  2015. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  2016. /* Number of 11AX DL MU MIMO schedules posted per group size */
  2017. A_UINT32 ax_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2018. } htt_tx_pdev_mu_mimo_sch_stats_tlv;
  2019. typedef struct {
  2020. htt_tlv_hdr_t tlv_hdr;
  2021. A_UINT32 mu_mimo_sch_posted; /* Number of MU MIMO schedules posted to HW */
  2022. A_UINT32 mu_mimo_sch_failed; /* Number of MU MIMO schedules failed to post */
  2023. A_UINT32 mu_mimo_ppdu_posted; /* Number of MU MIMO PPDUs posted to HW */
  2024. /*
  2025. * This is the common description for the below sch stats.
  2026. * Counts the number of transmissions of each number of MU users
  2027. * in each TX mode.
  2028. * The array index is the "number of users - 1".
  2029. * For example, ac_mu_mimo_sch_nusers[1] counts the number of 11AC MU2
  2030. * TX PPDUs, ac_mu_mimo_sch_nusers[2] counts the number of 11AC MU3
  2031. * TX PPDUs and so on.
  2032. * The same is applicable for the other TX mode stats.
  2033. */
  2034. /* Represents the count for 11AC DL MU MIMO sequences */
  2035. A_UINT32 ac_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  2036. /* Represents the count for 11AX DL MU MIMO sequences */
  2037. A_UINT32 ax_mu_mimo_sch_nusers[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2038. /* Number of 11AC DL MU MIMO schedules posted per group size */
  2039. A_UINT32 ac_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS];
  2040. /* Number of 11AX DL MU MIMO schedules posted per group size */
  2041. A_UINT32 ax_mu_mimo_sch_posted_per_grp_sz[HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS];
  2042. } htt_tx_pdev_dl_mu_mimo_sch_stats_tlv;
  2043. typedef struct {
  2044. htt_tlv_hdr_t tlv_hdr;
  2045. /* Represents the count for 11AX DL MU OFDMA sequences */
  2046. A_UINT32 ax_mu_ofdma_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2047. } htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv;
  2048. typedef struct {
  2049. htt_tlv_hdr_t tlv_hdr;
  2050. /* Represents the count for 11AX UL MU OFDMA sequences with Basic Triggers */
  2051. A_UINT32 ax_ul_mu_ofdma_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2052. /* Represents the count for 11AX UL MU OFDMA sequences with BSRP Triggers */
  2053. A_UINT32 ax_ul_mu_ofdma_bsr_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2054. /* Represents the count for 11AX UL MU OFDMA sequences with BAR Triggers */
  2055. A_UINT32 ax_ul_mu_ofdma_bar_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2056. /* Represents the count for 11AX UL MU OFDMA sequences with BRP Triggers */
  2057. A_UINT32 ax_ul_mu_ofdma_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS];
  2058. } htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv;
  2059. typedef struct {
  2060. htt_tlv_hdr_t tlv_hdr;
  2061. /* Represents the count for 11AX UL MU MIMO sequences with Basic Triggers */
  2062. A_UINT32 ax_ul_mu_mimo_basic_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  2063. /* Represents the count for 11AX UL MU MIMO sequences with BRP Triggers */
  2064. A_UINT32 ax_ul_mu_mimo_brp_sch_nusers[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS];
  2065. } htt_tx_pdev_ul_mu_mimo_sch_stats_tlv;
  2066. typedef struct {
  2067. htt_tlv_hdr_t tlv_hdr;
  2068. A_UINT32 mu_mimo_mpdus_queued_usr; /* 11AC DL MU MIMO number of mpdus queued to HW, per user */
  2069. A_UINT32 mu_mimo_mpdus_tried_usr; /* 11AC DL MU MIMO number of mpdus tried over the air, per user */
  2070. A_UINT32 mu_mimo_mpdus_failed_usr; /* 11AC DL MU MIMO number of mpdus failed acknowledgement, per user */
  2071. A_UINT32 mu_mimo_mpdus_requeued_usr; /* 11AC DL MU MIMO number of mpdus re-queued to HW, per user */
  2072. A_UINT32 mu_mimo_err_no_ba_usr; /* 11AC DL MU MIMO BA not receieved, per user */
  2073. A_UINT32 mu_mimo_mpdu_underrun_usr; /* 11AC DL MU MIMO mpdu underrun encountered, per user */
  2074. A_UINT32 mu_mimo_ampdu_underrun_usr; /* 11AC DL MU MIMO ampdu underrun encountered, per user */
  2075. A_UINT32 ax_mu_mimo_mpdus_queued_usr; /* 11AX MU MIMO number of mpdus queued to HW, per user */
  2076. A_UINT32 ax_mu_mimo_mpdus_tried_usr; /* 11AX MU MIMO number of mpdus tried over the air, per user */
  2077. A_UINT32 ax_mu_mimo_mpdus_failed_usr; /* 11AX DL MU MIMO number of mpdus failed acknowledgement, per user */
  2078. A_UINT32 ax_mu_mimo_mpdus_requeued_usr; /* 11AX DL MU MIMO number of mpdus re-queued to HW, per user */
  2079. A_UINT32 ax_mu_mimo_err_no_ba_usr; /* 11AX DL MU MIMO BA not receieved, per user */
  2080. A_UINT32 ax_mu_mimo_mpdu_underrun_usr; /* 11AX DL MU MIMO mpdu underrun encountered, per user */
  2081. A_UINT32 ax_mu_mimo_ampdu_underrun_usr; /* 11AX DL MU MIMO ampdu underrun encountered, per user */
  2082. A_UINT32 ax_ofdma_mpdus_queued_usr; /* 11AX MU OFDMA number of mpdus queued to HW, per user */
  2083. A_UINT32 ax_ofdma_mpdus_tried_usr; /* 11AX MU OFDMA number of mpdus tried over the air, per user */
  2084. A_UINT32 ax_ofdma_mpdus_failed_usr; /* 11AX MU OFDMA number of mpdus failed acknowledgement, per user */
  2085. A_UINT32 ax_ofdma_mpdus_requeued_usr; /* 11AX MU OFDMA number of mpdus re-queued to HW, per user */
  2086. A_UINT32 ax_ofdma_err_no_ba_usr; /* 11AX MU OFDMA BA not receieved, per user */
  2087. A_UINT32 ax_ofdma_mpdu_underrun_usr; /* 11AX MU OFDMA mpdu underrun encountered, per user */
  2088. A_UINT32 ax_ofdma_ampdu_underrun_usr; /* 11AX MU OFDMA ampdu underrun encountered, per user */
  2089. } htt_tx_pdev_mu_mimo_mpdu_stats_tlv;
  2090. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AC 1 /* SCHED_TX_MODE_MU_MIMO_AC */
  2091. #define HTT_STATS_TX_SCHED_MODE_MU_MIMO_AX 2 /* SCHED_TX_MODE_MU_MIMO_AX */
  2092. #define HTT_STATS_TX_SCHED_MODE_MU_OFDMA_AX 3 /* SCHED_TX_MODE_MU_OFDMA_AX */
  2093. typedef struct {
  2094. htt_tlv_hdr_t tlv_hdr;
  2095. /* mpdu level stats */
  2096. A_UINT32 mpdus_queued_usr;
  2097. A_UINT32 mpdus_tried_usr;
  2098. A_UINT32 mpdus_failed_usr;
  2099. A_UINT32 mpdus_requeued_usr;
  2100. A_UINT32 err_no_ba_usr;
  2101. A_UINT32 mpdu_underrun_usr;
  2102. A_UINT32 ampdu_underrun_usr;
  2103. A_UINT32 user_index;
  2104. A_UINT32 tx_sched_mode; /* HTT_STATS_TX_SCHED_MODE_xxx */
  2105. } htt_tx_pdev_mpdu_stats_tlv;
  2106. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_MU
  2107. * TLV_TAGS:
  2108. * - HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG (multiple)
  2109. * - HTT_STATS_TX_PDEV_MPDU_STATS_TAG (multiple)
  2110. */
  2111. /* NOTE:
  2112. * This structure is for documentation, and cannot be safely used directly.
  2113. * Instead, use the constituent TLV structures to fill/parse.
  2114. */
  2115. typedef struct {
  2116. htt_tx_pdev_mu_mimo_sch_stats_tlv mu_mimo_sch_stats_tlv[1]; /* WAL_TX_STATS_MAX_GROUP_SIZE */
  2117. htt_tx_pdev_dl_mu_mimo_sch_stats_tlv dl_mu_mimo_sch_stats_tlv[1];
  2118. htt_tx_pdev_ul_mu_mimo_sch_stats_tlv ul_mu_mimo_sch_stats_tlv[1];
  2119. htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv dl_mu_ofdma_sch_stats_tlv[1];
  2120. htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv ul_mu_ofdma_sch_stats_tlv[1];
  2121. /*
  2122. * Note that though mu_mimo_mpdu_stats_tlv is named MU-MIMO,
  2123. * it can also hold MU-OFDMA stats.
  2124. */
  2125. htt_tx_pdev_mpdu_stats_tlv mu_mimo_mpdu_stats_tlv[1]; /* WAL_TX_STATS_MAX_NUM_USERS */
  2126. } htt_tx_pdev_mu_mimo_stats_t;
  2127. /* == TX SCHED STATS == */
  2128. #define HTT_SCHED_TXQ_CMD_POSTED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2129. /* NOTE: Variable length TLV, use length spec to infer array size */
  2130. typedef struct {
  2131. htt_tlv_hdr_t tlv_hdr;
  2132. /* Scheduler command posted per tx_mode */
  2133. A_UINT32 sched_cmd_posted[1/* length = num tx modes */];
  2134. } htt_sched_txq_cmd_posted_tlv_v;
  2135. #define HTT_SCHED_TXQ_CMD_REAPED_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2136. /* NOTE: Variable length TLV, use length spec to infer array size */
  2137. typedef struct {
  2138. htt_tlv_hdr_t tlv_hdr;
  2139. /* Scheduler command reaped per tx_mode */
  2140. A_UINT32 sched_cmd_reaped[1/* length = num tx modes */];
  2141. } htt_sched_txq_cmd_reaped_tlv_v;
  2142. #define HTT_SCHED_TXQ_SCHED_ORDER_SU_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2143. /* NOTE: Variable length TLV, use length spec to infer array size */
  2144. typedef struct {
  2145. htt_tlv_hdr_t tlv_hdr;
  2146. /*
  2147. * sched_order_su contains the peer IDs of peers chosen in the last
  2148. * NUM_SCHED_ORDER_LOG scheduler instances.
  2149. * The array is circular; it's unspecified which array element corresponds
  2150. * to the most recent scheduler invocation, and which corresponds to
  2151. * the (NUM_SCHED_ORDER_LOG-1) most recent scheduler invocation.
  2152. */
  2153. A_UINT32 sched_order_su[1]; /* HTT_TX_PDEV_NUM_SCHED_ORDER_LOG */
  2154. } htt_sched_txq_sched_order_su_tlv_v;
  2155. typedef struct {
  2156. htt_tlv_hdr_t tlv_hdr;
  2157. A_UINT32 htt_stats_type;
  2158. } htt_stats_error_tlv_v;
  2159. typedef enum {
  2160. HTT_SCHED_TID_SKIP_SCHED_MASK_DISABLED = 0, /* Skip the tid when WAL_TID_DISABLE_TX_SCHED_MASK is true */
  2161. HTT_SCHED_TID_SKIP_NOTIFY_MPDU, /* Skip the tid's 2nd sched_cmd when 1st cmd is ongoing */
  2162. HTT_SCHED_TID_SKIP_MPDU_STATE_INVALID, /* Skip the tid when MPDU state is invalid */
  2163. HTT_SCHED_TID_SKIP_SCHED_DISABLED, /* Skip the tid when scheduling is disabled for that tid */
  2164. HTT_SCHED_TID_SKIP_TQM_BYPASS_CMD_PENDING, /* Skip the TQM bypass tid when it has pending sched_cmd */
  2165. HTT_SCHED_TID_SKIP_SECOND_SU_SCHEDULE, /* Skip tid from 2nd SU schedule when any of the following flag is set
  2166. WAL_TX_TID(SEND_BAR | TQM_MPDU_STATE_VALID | SEND_QOS_NULL | TQM_NOTIFY_MPDU | SENDN_PENDING) */
  2167. HTT_SCHED_TID_SKIP_CMD_SLOT_NOT_AVAIL, /* Skip the tid when command slot is not available */
  2168. HTT_SCHED_TID_SKIP_NO_DATA, /* Skip tid without data */
  2169. HTT_SCHED_TID_SKIP_NO_ENQ = HTT_SCHED_TID_SKIP_NO_DATA, /* deprecated old name */
  2170. HTT_SCHED_TID_SKIP_LOW_ENQ, /* Skip the tid when enqueue is low */
  2171. HTT_SCHED_TID_SKIP_PAUSED, /* Skipping the paused tid(sendn-frames) */
  2172. HTT_SCHED_TID_SKIP_UL_RESP, /* skip UL response tid */
  2173. HTT_SCHED_TID_SKIP_UL = HTT_SCHED_TID_SKIP_UL_RESP, /* deprecated old name */
  2174. HTT_SCHED_TID_REMOVE_PAUSED, /* Removing the paused tid when number of sendn frames is zero */
  2175. HTT_SCHED_TID_REMOVE_NO_ENQ, /* Remove tid with zero queue depth */
  2176. HTT_SCHED_TID_REMOVE_UL_RESP, /* Remove tid UL response */
  2177. HTT_SCHED_TID_REMOVE_UL = HTT_SCHED_TID_REMOVE_UL_RESP, /* deprecated old name */
  2178. HTT_SCHED_TID_QUERY, /* Moving to next user and adding tid in prepend list when qstats update is pending */
  2179. HTT_SCHED_TID_SU_ONLY, /* Tid is eligible and TX_SCHED_SU_ONLY is true */
  2180. HTT_SCHED_TID_ELIGIBLE, /* Tid is eligible for scheduling */
  2181. HTT_SCHED_TID_SKIP_EXCEPT_EAPOL, /* skip tid except eapol */
  2182. HTT_SCHED_TID_SU_LOW_PRI_ONLY, /* su low priority tid only */
  2183. HTT_SCHED_TID_SKIP_SOUND_IN_PROGRESS, /* skip tid sound in progress */
  2184. HTT_SCHED_TID_SKIP_NO_UL_DATA, /* skip ul tid when no ul data */
  2185. HTT_SCHED_TID_REMOVE_UL_NOT_CAPABLE, /* Remove tid that are not UL capable */
  2186. HTT_SCHED_TID_UL_ELIGIBLE, /* Tid is eligible for UL scheduling */
  2187. HTT_SCHED_TID_FALLBACK_TO_PREV_DECISION, /* Fall back to previous decision */
  2188. HTT_SCHED_TID_SKIP_PEER_ALREADY_IN_TXQ, /* skip tid, peer is already available in the txq */
  2189. HTT_SCHED_TID_SKIP_DELAY_UL_SCHED, /* skip tid delay UL schedule */
  2190. HTT_SCHED_INELIGIBILITY_MAX,
  2191. } htt_sched_txq_sched_ineligibility_tlv_enum;
  2192. #define HTT_SCHED_TXQ_SCHED_INELIGIBILITY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2193. /* NOTE: Variable length TLV, use length spec to infer array size */
  2194. typedef struct {
  2195. htt_tlv_hdr_t tlv_hdr;
  2196. /* sched_ineligibility counts the number of occurrences of different reasons for tid ineligibility during eligibility checks per txq in scheduling */
  2197. A_UINT32 sched_ineligibility[1]; /* indexed by htt_sched_txq_sched_ineligibility_tlv_enum */
  2198. } htt_sched_txq_sched_ineligibility_tlv_v;
  2199. typedef enum {
  2200. HTT_SCHED_SUPERCYCLE_TRIGGER_NONE = 0, /* Supercycle not triggerd */
  2201. HTT_SCHED_SUPERCYCLE_TRIGGER_FORCED, /* forced supercycle trigger */
  2202. HTT_SCHED_SUPERCYCLE_TRIGGER_LESS_NUM_TIDQ_ENTRIES, /* Num tidq entries is less than max_client threshold */
  2203. HTT_SCHED_SUPERCYCLE_TRIGGER_LESS_NUM_ACTIVE_TIDS, /* Num active tids is less than max_client threshold */
  2204. HTT_SCHED_SUPERCYCLE_TRIGGER_MAX_ITR_REACHED, /* max sched iteration reached */
  2205. HTT_SCHED_SUPERCYCLE_TRIGGER_DUR_THRESHOLD_REACHED, /* duration threshold reached */
  2206. HTT_SCHED_SUPERCYCLE_TRIGGER_TWT_TRIGGER, /* TWT supercycle trigger */
  2207. HTT_SCHED_SUPERCYCLE_TRIGGER_MAX,
  2208. } htt_sched_txq_supercycle_triggers_tlv_enum;
  2209. #define HTT_SCHED_TXQ_SUPERCYCLE_TRIGGERS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2210. /* NOTE: Variable length TLV, use length spec to infer array size */
  2211. typedef struct {
  2212. htt_tlv_hdr_t tlv_hdr;
  2213. /*
  2214. * supercycle_triggers[] is a histogram that counts the number of
  2215. * occurrences of each different reason for a transmit scheduler
  2216. * supercycle to be triggered.
  2217. * The htt_sched_txq_supercycle_triggers_tlv_enum is used to index
  2218. * supercycle_triggers[], e.g. supercycle_triggers[1] holds the number
  2219. * of times a supercycle has been forced.
  2220. * These supercycle trigger counts are not automatically reset, but
  2221. * are reset upon request.
  2222. */
  2223. A_UINT32 supercycle_triggers[1/*HTT_SCHED_SUPERCYCLE_TRIGGER_MAX*/];
  2224. } htt_sched_txq_supercycle_triggers_tlv_v;
  2225. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M 0x000000ff
  2226. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S 0
  2227. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M 0x0000ff00
  2228. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S 8
  2229. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_GET(_var) \
  2230. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_M) >> \
  2231. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)
  2232. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_SET(_var, _val) \
  2233. do { \
  2234. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID, _val); \
  2235. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_MAC_ID_S)); \
  2236. } while (0)
  2237. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_GET(_var) \
  2238. (((_var) & HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_M) >> \
  2239. HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)
  2240. #define HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_SET(_var, _val) \
  2241. do { \
  2242. HTT_CHECK_SET_VAL(HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID, _val); \
  2243. ((_var) |= ((_val) << HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TXQUEUE_ID_S)); \
  2244. } while (0)
  2245. typedef struct {
  2246. htt_tlv_hdr_t tlv_hdr;
  2247. /* BIT [ 7 : 0] :- mac_id
  2248. * BIT [15 : 8] :- txq_id
  2249. * BIT [31 : 16] :- reserved
  2250. */
  2251. A_UINT32 mac_id__txq_id__word;
  2252. /* Scheduler policy ised for this TxQ */
  2253. A_UINT32 sched_policy;
  2254. /* Timestamp of last scheduler command posted */
  2255. A_UINT32 last_sched_cmd_posted_timestamp;
  2256. /* Timestamp of last scheduler command completed */
  2257. A_UINT32 last_sched_cmd_compl_timestamp;
  2258. /* Num of Sched2TAC ring hit Low Water Mark condition */
  2259. A_UINT32 sched_2_tac_lwm_count;
  2260. /* Num of Sched2TAC ring full condition */
  2261. A_UINT32 sched_2_tac_ring_full;
  2262. /* Num of scheduler command post failures that includes su/mu mimo/mu ofdma sequence type */
  2263. A_UINT32 sched_cmd_post_failure;
  2264. /* Num of active tids for this TxQ at current instance */
  2265. A_UINT32 num_active_tids;
  2266. /* Num of powersave schedules */
  2267. A_UINT32 num_ps_schedules;
  2268. /* Num of scheduler commands pending for this TxQ */
  2269. A_UINT32 sched_cmds_pending;
  2270. /* Num of tidq registration for this TxQ */
  2271. A_UINT32 num_tid_register;
  2272. /* Num of tidq de-registration for this TxQ */
  2273. A_UINT32 num_tid_unregister;
  2274. /* Num of iterations msduq stats was updated */
  2275. A_UINT32 num_qstats_queried;
  2276. /* qstats query update status */
  2277. A_UINT32 qstats_update_pending;
  2278. /* Timestamp of Last query stats made */
  2279. A_UINT32 last_qstats_query_timestamp;
  2280. /* Num of sched2tqm command queue full condition */
  2281. A_UINT32 num_tqm_cmdq_full;
  2282. /* Num of scheduler trigger from DE Module */
  2283. A_UINT32 num_de_sched_algo_trigger;
  2284. /* Num of scheduler trigger from RT Module */
  2285. A_UINT32 num_rt_sched_algo_trigger;
  2286. /* Num of scheduler trigger from TQM Module */
  2287. A_UINT32 num_tqm_sched_algo_trigger;
  2288. /* Num of schedules for notify frame */
  2289. A_UINT32 notify_sched;
  2290. /* Duration based sendn termination */
  2291. A_UINT32 dur_based_sendn_term;
  2292. /* scheduled via NOTIFY2 */
  2293. A_UINT32 su_notify2_sched;
  2294. /* schedule if queued packets are greater than avg MSDUs in PPDU */
  2295. A_UINT32 su_optimal_queued_msdus_sched;
  2296. /* schedule due to timeout */
  2297. A_UINT32 su_delay_timeout_sched;
  2298. /* delay if txtime is less than 500us */
  2299. A_UINT32 su_min_txtime_sched_delay;
  2300. /* scheduled via no delay */
  2301. A_UINT32 su_no_delay;
  2302. /* Num of supercycles for this TxQ */
  2303. A_UINT32 num_supercycles;
  2304. /* Num of subcycles with sort for this TxQ */
  2305. A_UINT32 num_subcycles_with_sort;
  2306. /* Num of subcycles without sort for this Txq */
  2307. A_UINT32 num_subcycles_no_sort;
  2308. } htt_tx_pdev_stats_sched_per_txq_tlv;
  2309. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_M 0x000000ff
  2310. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_S 0
  2311. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_GET(_var) \
  2312. (((_var) & HTT_STATS_TX_SCHED_CMN_MAC_ID_M) >> \
  2313. HTT_STATS_TX_SCHED_CMN_MAC_ID_S)
  2314. #define HTT_STATS_TX_SCHED_CMN_MAC_ID_SET(_var, _val) \
  2315. do { \
  2316. HTT_CHECK_SET_VAL(HTT_STATS_TX_SCHED_CMN_MAC_ID, _val); \
  2317. ((_var) |= ((_val) << HTT_STATS_TX_SCHED_CMN_MAC_ID_S)); \
  2318. } while (0)
  2319. typedef struct {
  2320. htt_tlv_hdr_t tlv_hdr;
  2321. /* BIT [ 7 : 0] :- mac_id
  2322. * BIT [31 : 8] :- reserved
  2323. */
  2324. A_UINT32 mac_id__word;
  2325. /* Current timestamp */
  2326. A_UINT32 current_timestamp;
  2327. } htt_stats_tx_sched_cmn_tlv;
  2328. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_SCHED
  2329. * TLV_TAGS:
  2330. * - HTT_STATS_TX_SCHED_CMN_TAG
  2331. * - HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG
  2332. * - HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG
  2333. * - HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG
  2334. * - HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG
  2335. * - HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG
  2336. * - HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG
  2337. */
  2338. /* NOTE:
  2339. * This structure is for documentation, and cannot be safely used directly.
  2340. * Instead, use the constituent TLV structures to fill/parse.
  2341. */
  2342. typedef struct {
  2343. htt_stats_tx_sched_cmn_tlv cmn_tlv;
  2344. struct _txq_tx_sched_stats {
  2345. htt_tx_pdev_stats_sched_per_txq_tlv txq_tlv;
  2346. htt_sched_txq_cmd_posted_tlv_v cmd_posted_tlv;
  2347. htt_sched_txq_cmd_reaped_tlv_v cmd_reaped_tlv;
  2348. htt_sched_txq_sched_order_su_tlv_v sched_order_su_tlv;
  2349. htt_sched_txq_sched_ineligibility_tlv_v sched_ineligibility_tlv;
  2350. htt_sched_txq_supercycle_triggers_tlv_v sched_supercycle_trigger_tlv;
  2351. } txq[1];
  2352. } htt_stats_tx_sched_t;
  2353. /* == TQM STATS == */
  2354. #define HTT_TX_TQM_MAX_GEN_MPDU_END_REASON 16
  2355. #define HTT_TX_TQM_MAX_LIST_MPDU_END_REASON 16
  2356. #define HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS 16
  2357. #define HTT_TX_TQM_GEN_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2358. /* NOTE: Variable length TLV, use length spec to infer array size */
  2359. typedef struct {
  2360. htt_tlv_hdr_t tlv_hdr;
  2361. A_UINT32 gen_mpdu_end_reason[1]; /* HTT_TX_TQM_MAX_GEN_MPDU_END_REASON */
  2362. } htt_tx_tqm_gen_mpdu_stats_tlv_v;
  2363. #define HTT_TX_TQM_LIST_MPDU_STATS_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2364. /* NOTE: Variable length TLV, use length spec to infer array size */
  2365. typedef struct {
  2366. htt_tlv_hdr_t tlv_hdr;
  2367. A_UINT32 list_mpdu_end_reason[1]; /* HTT_TX_TQM_MAX_LIST_MPDU_END_REASON */
  2368. } htt_tx_tqm_list_mpdu_stats_tlv_v;
  2369. #define HTT_TX_TQM_LIST_MPDU_CNT_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2370. /* NOTE: Variable length TLV, use length spec to infer array size */
  2371. typedef struct {
  2372. htt_tlv_hdr_t tlv_hdr;
  2373. A_UINT32 list_mpdu_cnt_hist[1]; /* HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS */
  2374. } htt_tx_tqm_list_mpdu_cnt_tlv_v;
  2375. typedef struct {
  2376. htt_tlv_hdr_t tlv_hdr;
  2377. A_UINT32 msdu_count;
  2378. A_UINT32 mpdu_count;
  2379. A_UINT32 remove_msdu;
  2380. A_UINT32 remove_mpdu;
  2381. A_UINT32 remove_msdu_ttl;
  2382. A_UINT32 send_bar;
  2383. A_UINT32 bar_sync;
  2384. A_UINT32 notify_mpdu;
  2385. A_UINT32 sync_cmd;
  2386. A_UINT32 write_cmd;
  2387. A_UINT32 hwsch_trigger;
  2388. A_UINT32 ack_tlv_proc;
  2389. A_UINT32 gen_mpdu_cmd;
  2390. A_UINT32 gen_list_cmd;
  2391. A_UINT32 remove_mpdu_cmd;
  2392. A_UINT32 remove_mpdu_tried_cmd;
  2393. A_UINT32 mpdu_queue_stats_cmd;
  2394. A_UINT32 mpdu_head_info_cmd;
  2395. A_UINT32 msdu_flow_stats_cmd;
  2396. A_UINT32 remove_msdu_cmd;
  2397. A_UINT32 remove_msdu_ttl_cmd;
  2398. A_UINT32 flush_cache_cmd;
  2399. A_UINT32 update_mpduq_cmd;
  2400. A_UINT32 enqueue;
  2401. A_UINT32 enqueue_notify;
  2402. A_UINT32 notify_mpdu_at_head;
  2403. A_UINT32 notify_mpdu_state_valid;
  2404. /*
  2405. * On receiving TQM_FLOW_NOT_EMPTY_STATUS from TQM, (on MSDUs being enqueued
  2406. * the flow is non empty), if the number of MSDUs is greater than the threshold,
  2407. * notify is incremented. UDP_THRESH counters are for UDP MSDUs, and NONUDP are
  2408. * for non-UDP MSDUs.
  2409. * MSDUQ_SWNOTIFY_UDP_THRESH1 threshold - sched_udp_notify1 is incremented
  2410. * MSDUQ_SWNOTIFY_UDP_THRESH2 threshold - sched_udp_notify2 is incremented
  2411. * MSDUQ_SWNOTIFY_NONUDP_THRESH1 threshold - sched_nonudp_notify1 is incremented
  2412. * MSDUQ_SWNOTIFY_NONUDP_THRESH2 threshold - sched_nonudp_notify2 is incremented
  2413. *
  2414. * Notify signifies that we trigger the scheduler.
  2415. */
  2416. A_UINT32 sched_udp_notify1;
  2417. A_UINT32 sched_udp_notify2;
  2418. A_UINT32 sched_nonudp_notify1;
  2419. A_UINT32 sched_nonudp_notify2;
  2420. } htt_tx_tqm_pdev_stats_tlv_v;
  2421. #define HTT_TX_TQM_CMN_STATS_MAC_ID_M 0x000000ff
  2422. #define HTT_TX_TQM_CMN_STATS_MAC_ID_S 0
  2423. #define HTT_TX_TQM_CMN_STATS_MAC_ID_GET(_var) \
  2424. (((_var) & HTT_TX_TQM_CMN_STATS_MAC_ID_M) >> \
  2425. HTT_TX_TQM_CMN_STATS_MAC_ID_S)
  2426. #define HTT_TX_TQM_CMN_STATS_MAC_ID_SET(_var, _val) \
  2427. do { \
  2428. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMN_STATS_MAC_ID, _val); \
  2429. ((_var) |= ((_val) << HTT_TX_TQM_CMN_STATS_MAC_ID_S)); \
  2430. } while (0)
  2431. typedef struct {
  2432. htt_tlv_hdr_t tlv_hdr;
  2433. /* BIT [ 7 : 0] :- mac_id
  2434. * BIT [31 : 8] :- reserved
  2435. */
  2436. A_UINT32 mac_id__word;
  2437. A_UINT32 max_cmdq_id;
  2438. A_UINT32 list_mpdu_cnt_hist_intvl;
  2439. /* Global stats */
  2440. A_UINT32 add_msdu;
  2441. A_UINT32 q_empty;
  2442. A_UINT32 q_not_empty;
  2443. A_UINT32 drop_notification;
  2444. A_UINT32 desc_threshold;
  2445. A_UINT32 hwsch_tqm_invalid_status;
  2446. A_UINT32 missed_tqm_gen_mpdus;
  2447. A_UINT32 tqm_active_tids;
  2448. A_UINT32 tqm_inactive_tids;
  2449. A_UINT32 tqm_active_msduq_flows;
  2450. } htt_tx_tqm_cmn_stats_tlv;
  2451. typedef struct {
  2452. htt_tlv_hdr_t tlv_hdr;
  2453. /* Error stats */
  2454. A_UINT32 q_empty_failure;
  2455. A_UINT32 q_not_empty_failure;
  2456. A_UINT32 add_msdu_failure;
  2457. } htt_tx_tqm_error_stats_tlv;
  2458. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TQM
  2459. * TLV_TAGS:
  2460. * - HTT_STATS_TX_TQM_CMN_TAG
  2461. * - HTT_STATS_TX_TQM_ERROR_STATS_TAG
  2462. * - HTT_STATS_TX_TQM_GEN_MPDU_TAG
  2463. * - HTT_STATS_TX_TQM_LIST_MPDU_TAG
  2464. * - HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG
  2465. * - HTT_STATS_TX_TQM_PDEV_TAG
  2466. */
  2467. /* NOTE:
  2468. * This structure is for documentation, and cannot be safely used directly.
  2469. * Instead, use the constituent TLV structures to fill/parse.
  2470. */
  2471. typedef struct {
  2472. htt_tx_tqm_cmn_stats_tlv cmn_tlv;
  2473. htt_tx_tqm_error_stats_tlv err_tlv;
  2474. htt_tx_tqm_gen_mpdu_stats_tlv_v gen_mpdu_stats_tlv;
  2475. htt_tx_tqm_list_mpdu_stats_tlv_v list_mpdu_stats_tlv;
  2476. htt_tx_tqm_list_mpdu_cnt_tlv_v list_mpdu_cnt_tlv;
  2477. htt_tx_tqm_pdev_stats_tlv_v tqm_pdev_stats_tlv;
  2478. } htt_tx_tqm_pdev_stats_t;
  2479. /* == TQM CMDQ stats == */
  2480. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M 0x000000ff
  2481. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S 0
  2482. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M 0x0000ff00
  2483. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S 8
  2484. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_GET(_var) \
  2485. (((_var) & HTT_TX_TQM_CMDQ_STATUS_MAC_ID_M) >> \
  2486. HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)
  2487. #define HTT_TX_TQM_CMDQ_STATUS_MAC_ID_SET(_var, _val) \
  2488. do { \
  2489. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_MAC_ID, _val); \
  2490. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_MAC_ID_S)); \
  2491. } while (0)
  2492. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_GET(_var) \
  2493. (((_var) & HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_M) >> \
  2494. HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)
  2495. #define HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_SET(_var, _val) \
  2496. do { \
  2497. HTT_CHECK_SET_VAL(HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID, _val); \
  2498. ((_var) |= ((_val) << HTT_TX_TQM_CMDQ_STATUS_CMDQ_ID_S)); \
  2499. } while (0)
  2500. typedef struct {
  2501. htt_tlv_hdr_t tlv_hdr;
  2502. /* BIT [ 7 : 0] :- mac_id
  2503. * BIT [15 : 8] :- cmdq_id
  2504. * BIT [31 : 16] :- reserved
  2505. */
  2506. A_UINT32 mac_id__cmdq_id__word;
  2507. A_UINT32 sync_cmd;
  2508. A_UINT32 write_cmd;
  2509. A_UINT32 gen_mpdu_cmd;
  2510. A_UINT32 mpdu_queue_stats_cmd;
  2511. A_UINT32 mpdu_head_info_cmd;
  2512. A_UINT32 msdu_flow_stats_cmd;
  2513. A_UINT32 remove_mpdu_cmd;
  2514. A_UINT32 remove_msdu_cmd;
  2515. A_UINT32 flush_cache_cmd;
  2516. A_UINT32 update_mpduq_cmd;
  2517. A_UINT32 update_msduq_cmd;
  2518. } htt_tx_tqm_cmdq_status_tlv;
  2519. /* STATS_TYPE : HTT_DBG_EXT_STATS_TQM_CMDQ
  2520. * TLV_TAGS:
  2521. * - HTT_STATS_STRING_TAG
  2522. * - HTT_STATS_TX_TQM_CMDQ_STATUS_TAG
  2523. */
  2524. /* NOTE:
  2525. * This structure is for documentation, and cannot be safely used directly.
  2526. * Instead, use the constituent TLV structures to fill/parse.
  2527. */
  2528. typedef struct {
  2529. struct _cmdq_stats {
  2530. htt_stats_string_tlv cmdq_str_tlv;
  2531. htt_tx_tqm_cmdq_status_tlv status_tlv;
  2532. } q[1];
  2533. } htt_tx_tqm_cmdq_stats_t;
  2534. /* == TX-DE STATS == */
  2535. /* Structures for tx de stats */
  2536. typedef struct {
  2537. htt_tlv_hdr_t tlv_hdr;
  2538. A_UINT32 m1_packets;
  2539. A_UINT32 m2_packets;
  2540. A_UINT32 m3_packets;
  2541. A_UINT32 m4_packets;
  2542. A_UINT32 g1_packets;
  2543. A_UINT32 g2_packets;
  2544. A_UINT32 rc4_packets;
  2545. A_UINT32 eap_packets;
  2546. A_UINT32 eapol_start_packets;
  2547. A_UINT32 eapol_logoff_packets;
  2548. A_UINT32 eapol_encap_asf_packets;
  2549. } htt_tx_de_eapol_packets_stats_tlv;
  2550. typedef struct {
  2551. htt_tlv_hdr_t tlv_hdr;
  2552. A_UINT32 ap_bss_peer_not_found;
  2553. A_UINT32 ap_bcast_mcast_no_peer;
  2554. A_UINT32 sta_delete_in_progress;
  2555. A_UINT32 ibss_no_bss_peer;
  2556. A_UINT32 invaild_vdev_type;
  2557. A_UINT32 invalid_ast_peer_entry;
  2558. A_UINT32 peer_entry_invalid;
  2559. A_UINT32 ethertype_not_ip;
  2560. A_UINT32 eapol_lookup_failed;
  2561. A_UINT32 qpeer_not_allow_data;
  2562. A_UINT32 fse_tid_override;
  2563. A_UINT32 ipv6_jumbogram_zero_length;
  2564. A_UINT32 qos_to_non_qos_in_prog;
  2565. A_UINT32 ap_bcast_mcast_eapol;
  2566. A_UINT32 unicast_on_ap_bss_peer;
  2567. A_UINT32 ap_vdev_invalid;
  2568. A_UINT32 incomplete_llc;
  2569. A_UINT32 eapol_duplicate_m3;
  2570. A_UINT32 eapol_duplicate_m4;
  2571. } htt_tx_de_classify_failed_stats_tlv;
  2572. typedef struct {
  2573. htt_tlv_hdr_t tlv_hdr;
  2574. A_UINT32 arp_packets;
  2575. A_UINT32 igmp_packets;
  2576. A_UINT32 dhcp_packets;
  2577. A_UINT32 host_inspected;
  2578. A_UINT32 htt_included;
  2579. A_UINT32 htt_valid_mcs;
  2580. A_UINT32 htt_valid_nss;
  2581. A_UINT32 htt_valid_preamble_type;
  2582. A_UINT32 htt_valid_chainmask;
  2583. A_UINT32 htt_valid_guard_interval;
  2584. A_UINT32 htt_valid_retries;
  2585. A_UINT32 htt_valid_bw_info;
  2586. A_UINT32 htt_valid_power;
  2587. A_UINT32 htt_valid_key_flags;
  2588. A_UINT32 htt_valid_no_encryption;
  2589. A_UINT32 fse_entry_count;
  2590. A_UINT32 fse_priority_be;
  2591. A_UINT32 fse_priority_high;
  2592. A_UINT32 fse_priority_low;
  2593. A_UINT32 fse_traffic_ptrn_be;
  2594. A_UINT32 fse_traffic_ptrn_over_sub;
  2595. A_UINT32 fse_traffic_ptrn_bursty;
  2596. A_UINT32 fse_traffic_ptrn_interactive;
  2597. A_UINT32 fse_traffic_ptrn_periodic;
  2598. A_UINT32 fse_hwqueue_alloc;
  2599. A_UINT32 fse_hwqueue_created;
  2600. A_UINT32 fse_hwqueue_send_to_host;
  2601. A_UINT32 mcast_entry;
  2602. A_UINT32 bcast_entry;
  2603. A_UINT32 htt_update_peer_cache;
  2604. A_UINT32 htt_learning_frame;
  2605. A_UINT32 fse_invalid_peer;
  2606. /*
  2607. * mec_notify is HTT TX WBM multicast echo check notification
  2608. * from firmware to host. FW sends SA addresses to host for all
  2609. * multicast/broadcast packets received on STA side.
  2610. */
  2611. A_UINT32 mec_notify;
  2612. } htt_tx_de_classify_stats_tlv;
  2613. typedef struct {
  2614. htt_tlv_hdr_t tlv_hdr;
  2615. A_UINT32 eok;
  2616. A_UINT32 classify_done;
  2617. A_UINT32 lookup_failed;
  2618. A_UINT32 send_host_dhcp;
  2619. A_UINT32 send_host_mcast;
  2620. A_UINT32 send_host_unknown_dest;
  2621. A_UINT32 send_host;
  2622. A_UINT32 status_invalid;
  2623. } htt_tx_de_classify_status_stats_tlv;
  2624. typedef struct {
  2625. htt_tlv_hdr_t tlv_hdr;
  2626. A_UINT32 enqueued_pkts;
  2627. A_UINT32 to_tqm;
  2628. A_UINT32 to_tqm_bypass;
  2629. } htt_tx_de_enqueue_packets_stats_tlv;
  2630. typedef struct {
  2631. htt_tlv_hdr_t tlv_hdr;
  2632. A_UINT32 discarded_pkts;
  2633. A_UINT32 local_frames;
  2634. A_UINT32 is_ext_msdu;
  2635. } htt_tx_de_enqueue_discard_stats_tlv;
  2636. typedef struct {
  2637. htt_tlv_hdr_t tlv_hdr;
  2638. A_UINT32 tcl_dummy_frame;
  2639. A_UINT32 tqm_dummy_frame;
  2640. A_UINT32 tqm_notify_frame;
  2641. A_UINT32 fw2wbm_enq;
  2642. A_UINT32 tqm_bypass_frame;
  2643. } htt_tx_de_compl_stats_tlv;
  2644. #define HTT_TX_DE_CMN_STATS_MAC_ID_M 0x000000ff
  2645. #define HTT_TX_DE_CMN_STATS_MAC_ID_S 0
  2646. #define HTT_TX_DE_CMN_STATS_MAC_ID_GET(_var) \
  2647. (((_var) & HTT_TX_DE_CMN_STATS_MAC_ID_M) >> \
  2648. HTT_TX_DE_CMN_STATS_MAC_ID_S)
  2649. #define HTT_TX_DE_CMN_STATS_MAC_ID_SET(_var, _val) \
  2650. do { \
  2651. HTT_CHECK_SET_VAL(HTT_TX_DE_CMN_STATS_MAC_ID, _val); \
  2652. ((_var) |= ((_val) << HTT_TX_DE_CMN_STATS_MAC_ID_S)); \
  2653. } while (0)
  2654. /*
  2655. * The htt_tx_de_fw2wbm_ring_full_hist_tlv is a histogram of time we waited
  2656. * for the fw2wbm ring buffer. we are requesting a buffer in FW2WBM release
  2657. * ring,which may fail, due to non availability of buffer. Hence we sleep for
  2658. * 200us & again request for it. This is a histogram of time we wait, with
  2659. * bin of 200ms & there are 10 bin (2 seconds max)
  2660. * They are defined by the following macros in FW
  2661. * #define ENTRIES_PER_BIN_COUNT 1000 // per bin 1000 * 200us = 200ms
  2662. * #define RING_FULL_BIN_ENTRIES (WAL_TX_DE_FW2WBM_ALLOC_TIMEOUT_COUNT /
  2663. * ENTRIES_PER_BIN_COUNT)
  2664. */
  2665. typedef struct {
  2666. htt_tlv_hdr_t tlv_hdr;
  2667. A_UINT32 fw2wbm_ring_full_hist[1];
  2668. } htt_tx_de_fw2wbm_ring_full_hist_tlv;
  2669. typedef struct {
  2670. htt_tlv_hdr_t tlv_hdr;
  2671. /* BIT [ 7 : 0] :- mac_id
  2672. * BIT [31 : 8] :- reserved
  2673. */
  2674. A_UINT32 mac_id__word;
  2675. /* Global Stats */
  2676. A_UINT32 tcl2fw_entry_count;
  2677. A_UINT32 not_to_fw;
  2678. A_UINT32 invalid_pdev_vdev_peer;
  2679. A_UINT32 tcl_res_invalid_addrx;
  2680. A_UINT32 wbm2fw_entry_count;
  2681. A_UINT32 invalid_pdev;
  2682. A_UINT32 tcl_res_addrx_timeout;
  2683. A_UINT32 invalid_vdev;
  2684. A_UINT32 invalid_tcl_exp_frame_desc;
  2685. } htt_tx_de_cmn_stats_tlv;
  2686. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_DE_INFO
  2687. * TLV_TAGS:
  2688. * - HTT_STATS_TX_DE_CMN_TAG
  2689. * - HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG
  2690. * - HTT_STATS_TX_DE_EAPOL_PACKETS_TAG
  2691. * - HTT_STATS_TX_DE_CLASSIFY_STATS_TAG
  2692. * - HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG
  2693. * - HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG
  2694. * - HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG
  2695. * - HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG
  2696. * - HTT_STATS_TX_DE_COMPL_STATS_TAG
  2697. */
  2698. /* NOTE:
  2699. * This structure is for documentation, and cannot be safely used directly.
  2700. * Instead, use the constituent TLV structures to fill/parse.
  2701. */
  2702. typedef struct {
  2703. htt_tx_de_cmn_stats_tlv cmn_tlv;
  2704. htt_tx_de_fw2wbm_ring_full_hist_tlv fw2wbm_hist_tlv;
  2705. htt_tx_de_eapol_packets_stats_tlv eapol_stats_tlv;
  2706. htt_tx_de_classify_stats_tlv classify_stats_tlv;
  2707. htt_tx_de_classify_failed_stats_tlv classify_failed_tlv;
  2708. htt_tx_de_classify_status_stats_tlv classify_status_rlv;
  2709. htt_tx_de_enqueue_packets_stats_tlv enqueue_packets_tlv;
  2710. htt_tx_de_enqueue_discard_stats_tlv enqueue_discard_tlv;
  2711. htt_tx_de_compl_stats_tlv comp_status_tlv;
  2712. } htt_tx_de_stats_t;
  2713. /* == RING-IF STATS == */
  2714. /* DWORD num_elems__prefetch_tail_idx */
  2715. #define HTT_RING_IF_STATS_NUM_ELEMS_M 0x0000ffff
  2716. #define HTT_RING_IF_STATS_NUM_ELEMS_S 0
  2717. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M 0xffff0000
  2718. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S 16
  2719. #define HTT_RING_IF_STATS_NUM_ELEMS_GET(_var) \
  2720. (((_var) & HTT_RING_IF_STATS_NUM_ELEMS_M) >> \
  2721. HTT_RING_IF_STATS_NUM_ELEMS_S)
  2722. #define HTT_RING_IF_STATS_NUM_ELEMS_SET(_var, _val) \
  2723. do { \
  2724. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_NUM_ELEMS, _val); \
  2725. ((_var) |= ((_val) << HTT_RING_IF_STATS_NUM_ELEMS_S)); \
  2726. } while (0)
  2727. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_GET(_var) \
  2728. (((_var) & HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_M) >> \
  2729. HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)
  2730. #define HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_SET(_var, _val) \
  2731. do { \
  2732. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_PREFETCH_TAIL_IDX, _val); \
  2733. ((_var) |= ((_val) << HTT_RING_IF_STATS_PREFETCH_TAIL_IDX_S)); \
  2734. } while (0)
  2735. /* DWORD head_idx__tail_idx */
  2736. #define HTT_RING_IF_STATS_HEAD_IDX_M 0x0000ffff
  2737. #define HTT_RING_IF_STATS_HEAD_IDX_S 0
  2738. #define HTT_RING_IF_STATS_TAIL_IDX_M 0xffff0000
  2739. #define HTT_RING_IF_STATS_TAIL_IDX_S 16
  2740. #define HTT_RING_IF_STATS_HEAD_IDX_GET(_var) \
  2741. (((_var) & HTT_RING_IF_STATS_HEAD_IDX_M) >> \
  2742. HTT_RING_IF_STATS_HEAD_IDX_S)
  2743. #define HTT_RING_IF_STATS_HEAD_IDX_SET(_var, _val) \
  2744. do { \
  2745. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HEAD_IDX, _val); \
  2746. ((_var) |= ((_val) << HTT_RING_IF_STATS_HEAD_IDX_S)); \
  2747. } while (0)
  2748. #define HTT_RING_IF_STATS_TAIL_IDX_GET(_var) \
  2749. (((_var) & HTT_RING_IF_STATS_TAIL_IDX_M) >> \
  2750. HTT_RING_IF_STATS_TAIL_IDX_S)
  2751. #define HTT_RING_IF_STATS_TAIL_IDX_SET(_var, _val) \
  2752. do { \
  2753. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_TAIL_IDX, _val); \
  2754. ((_var) |= ((_val) << HTT_RING_IF_STATS_TAIL_IDX_S)); \
  2755. } while (0)
  2756. /* DWORD shadow_head_idx__shadow_tail_idx */
  2757. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M 0x0000ffff
  2758. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S 0
  2759. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M 0xffff0000
  2760. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S 16
  2761. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_GET(_var) \
  2762. (((_var) & HTT_RING_IF_STATS_SHADOW_HEAD_IDX_M) >> \
  2763. HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)
  2764. #define HTT_RING_IF_STATS_SHADOW_HEAD_IDX_SET(_var, _val) \
  2765. do { \
  2766. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_HEAD_IDX, _val); \
  2767. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_HEAD_IDX_S)); \
  2768. } while (0)
  2769. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_GET(_var) \
  2770. (((_var) & HTT_RING_IF_STATS_SHADOW_TAIL_IDX_M) >> \
  2771. HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)
  2772. #define HTT_RING_IF_STATS_SHADOW_TAIL_IDX_SET(_var, _val) \
  2773. do { \
  2774. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_SHADOW_TAIL_IDX, _val); \
  2775. ((_var) |= ((_val) << HTT_RING_IF_STATS_SHADOW_TAIL_IDX_S)); \
  2776. } while (0)
  2777. /* DWORD lwm_thresh__hwm_thresh */
  2778. #define HTT_RING_IF_STATS_LWM_THRESHOLD_M 0x0000ffff
  2779. #define HTT_RING_IF_STATS_LWM_THRESHOLD_S 0
  2780. #define HTT_RING_IF_STATS_HWM_THRESHOLD_M 0xffff0000
  2781. #define HTT_RING_IF_STATS_HWM_THRESHOLD_S 16
  2782. #define HTT_RING_IF_STATS_LWM_THRESHOLD_GET(_var) \
  2783. (((_var) & HTT_RING_IF_STATS_LWM_THRESHOLD_M) >> \
  2784. HTT_RING_IF_STATS_LWM_THRESHOLD_S)
  2785. #define HTT_RING_IF_STATS_LWM_THRESHOLD_SET(_var, _val) \
  2786. do { \
  2787. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_LWM_THRESHOLD, _val); \
  2788. ((_var) |= ((_val) << HTT_RING_IF_STATS_LWM_THRESHOLD_S)); \
  2789. } while (0)
  2790. #define HTT_RING_IF_STATS_HWM_THRESHOLD_GET(_var) \
  2791. (((_var) & HTT_RING_IF_STATS_HWM_THRESHOLD_M) >> \
  2792. HTT_RING_IF_STATS_HWM_THRESHOLD_S)
  2793. #define HTT_RING_IF_STATS_HWM_THRESHOLD_SET(_var, _val) \
  2794. do { \
  2795. HTT_CHECK_SET_VAL(HTT_RING_IF_STATS_HWM_THRESHOLD, _val); \
  2796. ((_var) |= ((_val) << HTT_RING_IF_STATS_HWM_THRESHOLD_S)); \
  2797. } while (0)
  2798. #define HTT_STATS_LOW_WM_BINS 5
  2799. #define HTT_STATS_HIGH_WM_BINS 5
  2800. typedef struct {
  2801. A_UINT32 base_addr; /* DWORD aligned base memory address of the ring */
  2802. A_UINT32 elem_size; /* size of each ring element */
  2803. /* BIT [15 : 0] :- num_elems
  2804. * BIT [31 : 16] :- prefetch_tail_idx
  2805. */
  2806. A_UINT32 num_elems__prefetch_tail_idx;
  2807. /* BIT [15 : 0] :- head_idx
  2808. * BIT [31 : 16] :- tail_idx
  2809. */
  2810. A_UINT32 head_idx__tail_idx;
  2811. /* BIT [15 : 0] :- shadow_head_idx
  2812. * BIT [31 : 16] :- shadow_tail_idx
  2813. */
  2814. A_UINT32 shadow_head_idx__shadow_tail_idx;
  2815. A_UINT32 num_tail_incr;
  2816. /* BIT [15 : 0] :- lwm_thresh
  2817. * BIT [31 : 16] :- hwm_thresh
  2818. */
  2819. A_UINT32 lwm_thresh__hwm_thresh;
  2820. A_UINT32 overrun_hit_count;
  2821. A_UINT32 underrun_hit_count;
  2822. A_UINT32 prod_blockwait_count;
  2823. A_UINT32 cons_blockwait_count;
  2824. A_UINT32 low_wm_hit_count[HTT_STATS_LOW_WM_BINS]; /* FIX THIS: explain what each array element is for */
  2825. A_UINT32 high_wm_hit_count[HTT_STATS_HIGH_WM_BINS]; /* FIX THIS: explain what each array element is for */
  2826. } htt_ring_if_stats_tlv;
  2827. #define HTT_RING_IF_CMN_MAC_ID_M 0x000000ff
  2828. #define HTT_RING_IF_CMN_MAC_ID_S 0
  2829. #define HTT_RING_IF_CMN_MAC_ID_GET(_var) \
  2830. (((_var) & HTT_RING_IF_CMN_MAC_ID_M) >> \
  2831. HTT_RING_IF_CMN_MAC_ID_S)
  2832. #define HTT_RING_IF_CMN_MAC_ID_SET(_var, _val) \
  2833. do { \
  2834. HTT_CHECK_SET_VAL(HTT_RING_IF_CMN_MAC_ID, _val); \
  2835. ((_var) |= ((_val) << HTT_RING_IF_CMN_MAC_ID_S)); \
  2836. } while (0)
  2837. typedef struct {
  2838. htt_tlv_hdr_t tlv_hdr;
  2839. /* BIT [ 7 : 0] :- mac_id
  2840. * BIT [31 : 8] :- reserved
  2841. */
  2842. A_UINT32 mac_id__word;
  2843. A_UINT32 num_records;
  2844. } htt_ring_if_cmn_tlv;
  2845. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  2846. * TLV_TAGS:
  2847. * - HTT_STATS_RING_IF_CMN_TAG
  2848. * - HTT_STATS_STRING_TAG
  2849. * - HTT_STATS_RING_IF_TAG
  2850. */
  2851. /* NOTE:
  2852. * This structure is for documentation, and cannot be safely used directly.
  2853. * Instead, use the constituent TLV structures to fill/parse.
  2854. */
  2855. typedef struct {
  2856. htt_ring_if_cmn_tlv cmn_tlv;
  2857. /* Variable based on the Number of records. */
  2858. struct _ring_if {
  2859. htt_stats_string_tlv ring_str_tlv;
  2860. htt_ring_if_stats_tlv ring_tlv;
  2861. } r[1];
  2862. } htt_ring_if_stats_t;
  2863. /* == SFM STATS == */
  2864. #define HTT_SFM_CLIENT_USER_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  2865. /* NOTE: Variable length TLV, use length spec to infer array size */
  2866. typedef struct {
  2867. htt_tlv_hdr_t tlv_hdr;
  2868. /* Number of DWORDS used per user and per client */
  2869. A_UINT32 dwords_used_by_user_n[1];
  2870. } htt_sfm_client_user_tlv_v;
  2871. typedef struct {
  2872. htt_tlv_hdr_t tlv_hdr;
  2873. /* Client ID */
  2874. A_UINT32 client_id;
  2875. /* Minimum number of buffers */
  2876. A_UINT32 buf_min;
  2877. /* Maximum number of buffers */
  2878. A_UINT32 buf_max;
  2879. /* Number of Busy buffers */
  2880. A_UINT32 buf_busy;
  2881. /* Number of Allocated buffers */
  2882. A_UINT32 buf_alloc;
  2883. /* Number of Available/Usable buffers */
  2884. A_UINT32 buf_avail;
  2885. /* Number of users */
  2886. A_UINT32 num_users;
  2887. } htt_sfm_client_tlv;
  2888. #define HTT_SFM_CMN_MAC_ID_M 0x000000ff
  2889. #define HTT_SFM_CMN_MAC_ID_S 0
  2890. #define HTT_SFM_CMN_MAC_ID_GET(_var) \
  2891. (((_var) & HTT_SFM_CMN_MAC_ID_M) >> \
  2892. HTT_SFM_CMN_MAC_ID_S)
  2893. #define HTT_SFM_CMN_MAC_ID_SET(_var, _val) \
  2894. do { \
  2895. HTT_CHECK_SET_VAL(HTT_SFM_CMN_MAC_ID, _val); \
  2896. ((_var) |= ((_val) << HTT_SFM_CMN_MAC_ID_S)); \
  2897. } while (0)
  2898. typedef struct {
  2899. htt_tlv_hdr_t tlv_hdr;
  2900. /* BIT [ 7 : 0] :- mac_id
  2901. * BIT [31 : 8] :- reserved
  2902. */
  2903. A_UINT32 mac_id__word;
  2904. /* Indicates the total number of 128 byte buffers in the CMEM that are available for buffer sharing */
  2905. A_UINT32 buf_total;
  2906. /* Indicates for certain client or all the clients there is no dowrd saved in SFM, refer to SFM_R1_MEM_EMPTY */
  2907. A_UINT32 mem_empty;
  2908. /* DEALLOCATE_BUFFERS, refer to register SFM_R0_DEALLOCATE_BUFFERS */
  2909. A_UINT32 deallocate_bufs;
  2910. /* Number of Records */
  2911. A_UINT32 num_records;
  2912. } htt_sfm_cmn_tlv;
  2913. /* STATS_TYPE : HTT_DBG_EXT_STATS_RING_IF_INFO
  2914. * TLV_TAGS:
  2915. * - HTT_STATS_SFM_CMN_TAG
  2916. * - HTT_STATS_STRING_TAG
  2917. * - HTT_STATS_SFM_CLIENT_TAG
  2918. * - HTT_STATS_SFM_CLIENT_USER_TAG
  2919. */
  2920. /* NOTE:
  2921. * This structure is for documentation, and cannot be safely used directly.
  2922. * Instead, use the constituent TLV structures to fill/parse.
  2923. */
  2924. typedef struct {
  2925. htt_sfm_cmn_tlv cmn_tlv;
  2926. /* Variable based on the Number of records. */
  2927. struct _sfm_client {
  2928. htt_stats_string_tlv client_str_tlv;
  2929. htt_sfm_client_tlv client_tlv;
  2930. htt_sfm_client_user_tlv_v user_tlv;
  2931. } r[1];
  2932. } htt_sfm_stats_t;
  2933. /* == SRNG STATS == */
  2934. /* DWORD mac_id__ring_id__arena__ep */
  2935. #define HTT_SRING_STATS_MAC_ID_M 0x000000ff
  2936. #define HTT_SRING_STATS_MAC_ID_S 0
  2937. #define HTT_SRING_STATS_RING_ID_M 0x0000ff00
  2938. #define HTT_SRING_STATS_RING_ID_S 8
  2939. #define HTT_SRING_STATS_ARENA_M 0x00ff0000
  2940. #define HTT_SRING_STATS_ARENA_S 16
  2941. #define HTT_SRING_STATS_EP_TYPE_M 0x01000000
  2942. #define HTT_SRING_STATS_EP_TYPE_S 24
  2943. #define HTT_SRING_STATS_MAC_ID_GET(_var) \
  2944. (((_var) & HTT_SRING_STATS_MAC_ID_M) >> \
  2945. HTT_SRING_STATS_MAC_ID_S)
  2946. #define HTT_SRING_STATS_MAC_ID_SET(_var, _val) \
  2947. do { \
  2948. HTT_CHECK_SET_VAL(HTT_SRING_STATS_MAC_ID, _val); \
  2949. ((_var) |= ((_val) << HTT_SRING_STATS_MAC_ID_S)); \
  2950. } while (0)
  2951. #define HTT_SRING_STATS_RING_ID_GET(_var) \
  2952. (((_var) & HTT_SRING_STATS_RING_ID_M) >> \
  2953. HTT_SRING_STATS_RING_ID_S)
  2954. #define HTT_SRING_STATS_RING_ID_SET(_var, _val) \
  2955. do { \
  2956. HTT_CHECK_SET_VAL(HTT_SRING_STATS_RING_ID, _val); \
  2957. ((_var) |= ((_val) << HTT_SRING_STATS_RING_ID_S)); \
  2958. } while (0)
  2959. #define HTT_SRING_STATS_ARENA_GET(_var) \
  2960. (((_var) & HTT_SRING_STATS_ARENA_M) >> \
  2961. HTT_SRING_STATS_ARENA_S)
  2962. #define HTT_SRING_STATS_ARENA_SET(_var, _val) \
  2963. do { \
  2964. HTT_CHECK_SET_VAL(HTT_SRING_STATS_ARENA, _val); \
  2965. ((_var) |= ((_val) << HTT_SRING_STATS_ARENA_S)); \
  2966. } while (0)
  2967. #define HTT_SRING_STATS_EP_TYPE_GET(_var) \
  2968. (((_var) & HTT_SRING_STATS_EP_TYPE_M) >> \
  2969. HTT_SRING_STATS_EP_TYPE_S)
  2970. #define HTT_SRING_STATS_EP_TYPE_SET(_var, _val) \
  2971. do { \
  2972. HTT_CHECK_SET_VAL(HTT_SRING_STATS_EP_TYPE, _val); \
  2973. ((_var) |= ((_val) << HTT_SRING_STATS_EP_TYPE_S)); \
  2974. } while (0)
  2975. /* DWORD num_avail_words__num_valid_words */
  2976. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_M 0x0000ffff
  2977. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_S 0
  2978. #define HTT_SRING_STATS_NUM_VALID_WORDS_M 0xffff0000
  2979. #define HTT_SRING_STATS_NUM_VALID_WORDS_S 16
  2980. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_GET(_var) \
  2981. (((_var) & HTT_SRING_STATS_NUM_AVAIL_WORDS_M) >> \
  2982. HTT_SRING_STATS_NUM_AVAIL_WORDS_S)
  2983. #define HTT_SRING_STATS_NUM_AVAIL_WORDS_SET(_var, _val) \
  2984. do { \
  2985. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_AVAIL_WORDS, _val); \
  2986. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_AVAIL_WORDS_S)); \
  2987. } while (0)
  2988. #define HTT_SRING_STATS_NUM_VALID_WORDS_GET(_var) \
  2989. (((_var) & HTT_SRING_STATS_NUM_VALID_WORDS_M) >> \
  2990. HTT_SRING_STATS_NUM_VALID_WORDS_S)
  2991. #define HTT_SRING_STATS_NUM_VALID_WORDS_SET(_var, _val) \
  2992. do { \
  2993. HTT_CHECK_SET_VAL(HTT_SRING_STATS_NUM_VALID_WORDS, _val); \
  2994. ((_var) |= ((_val) << HTT_SRING_STATS_NUM_VALID_WORDS_S)); \
  2995. } while (0)
  2996. /* DWORD head_ptr__tail_ptr */
  2997. #define HTT_SRING_STATS_HEAD_PTR_M 0x0000ffff
  2998. #define HTT_SRING_STATS_HEAD_PTR_S 0
  2999. #define HTT_SRING_STATS_TAIL_PTR_M 0xffff0000
  3000. #define HTT_SRING_STATS_TAIL_PTR_S 16
  3001. #define HTT_SRING_STATS_HEAD_PTR_GET(_var) \
  3002. (((_var) & HTT_SRING_STATS_HEAD_PTR_M) >> \
  3003. HTT_SRING_STATS_HEAD_PTR_S)
  3004. #define HTT_SRING_STATS_HEAD_PTR_SET(_var, _val) \
  3005. do { \
  3006. HTT_CHECK_SET_VAL(HTT_SRING_STATS_HEAD_PTR, _val); \
  3007. ((_var) |= ((_val) << HTT_SRING_STATS_HEAD_PTR_S)); \
  3008. } while (0)
  3009. #define HTT_SRING_STATS_TAIL_PTR_GET(_var) \
  3010. (((_var) & HTT_SRING_STATS_TAIL_PTR_M) >> \
  3011. HTT_SRING_STATS_TAIL_PTR_S)
  3012. #define HTT_SRING_STATS_TAIL_PTR_SET(_var, _val) \
  3013. do { \
  3014. HTT_CHECK_SET_VAL(HTT_SRING_STATS_TAIL_PTR, _val); \
  3015. ((_var) |= ((_val) << HTT_SRING_STATS_TAIL_PTR_S)); \
  3016. } while (0)
  3017. /* DWORD consumer_empty__producer_full */
  3018. #define HTT_SRING_STATS_CONSUMER_EMPTY_M 0x0000ffff
  3019. #define HTT_SRING_STATS_CONSUMER_EMPTY_S 0
  3020. #define HTT_SRING_STATS_PRODUCER_FULL_M 0xffff0000
  3021. #define HTT_SRING_STATS_PRODUCER_FULL_S 16
  3022. #define HTT_SRING_STATS_CONSUMER_EMPTY_GET(_var) \
  3023. (((_var) & HTT_SRING_STATS_CONSUMER_EMPTY_M) >> \
  3024. HTT_SRING_STATS_CONSUMER_EMPTY_S)
  3025. #define HTT_SRING_STATS_CONSUMER_EMPTY_SET(_var, _val) \
  3026. do { \
  3027. HTT_CHECK_SET_VAL(HTT_SRING_STATS_CONSUMER_EMPTY, _val); \
  3028. ((_var) |= ((_val) << HTT_SRING_STATS_CONSUMER_EMPTY_S)); \
  3029. } while (0)
  3030. #define HTT_SRING_STATS_PRODUCER_FULL_GET(_var) \
  3031. (((_var) & HTT_SRING_STATS_PRODUCER_FULL_M) >> \
  3032. HTT_SRING_STATS_PRODUCER_FULL_S)
  3033. #define HTT_SRING_STATS_PRODUCER_FULL_SET(_var, _val) \
  3034. do { \
  3035. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PRODUCER_FULL, _val); \
  3036. ((_var) |= ((_val) << HTT_SRING_STATS_PRODUCER_FULL_S)); \
  3037. } while (0)
  3038. /* DWORD prefetch_count__internal_tail_ptr */
  3039. #define HTT_SRING_STATS_PREFETCH_COUNT_M 0x0000ffff
  3040. #define HTT_SRING_STATS_PREFETCH_COUNT_S 0
  3041. #define HTT_SRING_STATS_INTERNAL_TP_M 0xffff0000
  3042. #define HTT_SRING_STATS_INTERNAL_TP_S 16
  3043. #define HTT_SRING_STATS_PREFETCH_COUNT_GET(_var) \
  3044. (((_var) & HTT_SRING_STATS_PREFETCH_COUNT_M) >> \
  3045. HTT_SRING_STATS_PREFETCH_COUNT_S)
  3046. #define HTT_SRING_STATS_PREFETCH_COUNT_SET(_var, _val) \
  3047. do { \
  3048. HTT_CHECK_SET_VAL(HTT_SRING_STATS_PREFETCH_COUNT, _val); \
  3049. ((_var) |= ((_val) << HTT_SRING_STATS_PREFETCH_COUNT_S)); \
  3050. } while (0)
  3051. #define HTT_SRING_STATS_INTERNAL_TP_GET(_var) \
  3052. (((_var) & HTT_SRING_STATS_INTERNAL_TP_M) >> \
  3053. HTT_SRING_STATS_INTERNAL_TP_S)
  3054. #define HTT_SRING_STATS_INTERNAL_TP_SET(_var, _val) \
  3055. do { \
  3056. HTT_CHECK_SET_VAL(HTT_SRING_STATS_INTERNAL_TP, _val); \
  3057. ((_var) |= ((_val) << HTT_SRING_STATS_INTERNAL_TP_S)); \
  3058. } while (0)
  3059. typedef struct {
  3060. htt_tlv_hdr_t tlv_hdr;
  3061. /* BIT [ 7 : 0] :- mac_id
  3062. * BIT [15 : 8] :- ring_id
  3063. * BIT [23 : 16] :- arena 0 -SRING_HRAM, 1 - SRING_HCRAM, 2 - SRING_HW2HW.
  3064. * BIT [24 : 24] :- EP 0 -consumer, 1 - producer
  3065. * BIT [31 : 25] :- reserved
  3066. */
  3067. A_UINT32 mac_id__ring_id__arena__ep;
  3068. A_UINT32 base_addr_lsb; /* DWORD aligned base memory address of the ring */
  3069. A_UINT32 base_addr_msb;
  3070. A_UINT32 ring_size; /* size of ring */
  3071. A_UINT32 elem_size; /* size of each ring element */
  3072. /* Ring status */
  3073. /* BIT [15 : 0] :- num_avail_words
  3074. * BIT [31 : 16] :- num_valid_words
  3075. */
  3076. A_UINT32 num_avail_words__num_valid_words;
  3077. /* Index of head and tail */
  3078. /* BIT [15 : 0] :- head_ptr
  3079. * BIT [31 : 16] :- tail_ptr
  3080. */
  3081. A_UINT32 head_ptr__tail_ptr;
  3082. /* Empty or full counter of rings */
  3083. /* BIT [15 : 0] :- consumer_empty
  3084. * BIT [31 : 16] :- producer_full
  3085. */
  3086. A_UINT32 consumer_empty__producer_full;
  3087. /* Prefetch status of consumer ring */
  3088. /* BIT [15 : 0] :- prefetch_count
  3089. * BIT [31 : 16] :- internal_tail_ptr
  3090. */
  3091. A_UINT32 prefetch_count__internal_tail_ptr;
  3092. } htt_sring_stats_tlv;
  3093. typedef struct {
  3094. htt_tlv_hdr_t tlv_hdr;
  3095. A_UINT32 num_records;
  3096. } htt_sring_cmn_tlv;
  3097. /* STATS_TYPE : HTT_DBG_EXT_STATS_SRNG_INFO
  3098. * TLV_TAGS:
  3099. * - HTT_STATS_SRING_CMN_TAG
  3100. * - HTT_STATS_STRING_TAG
  3101. * - HTT_STATS_SRING_STATS_TAG
  3102. */
  3103. /* NOTE:
  3104. * This structure is for documentation, and cannot be safely used directly.
  3105. * Instead, use the constituent TLV structures to fill/parse.
  3106. */
  3107. typedef struct {
  3108. htt_sring_cmn_tlv cmn_tlv;
  3109. /* Variable based on the Number of records. */
  3110. struct _sring_stats {
  3111. htt_stats_string_tlv sring_str_tlv;
  3112. htt_sring_stats_tlv sring_stats_tlv;
  3113. } r[1];
  3114. } htt_sring_stats_t;
  3115. /* == PDEV TX RATE CTRL STATS == */
  3116. #define HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  3117. #define HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  3118. #define HTT_TX_PDEV_STATS_NUM_GI_COUNTERS 4
  3119. #define HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS 5
  3120. #define HTT_TX_PDEV_STATS_NUM_BW_COUNTERS 4
  3121. #define HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  3122. #define HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  3123. #define HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
  3124. #define HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
  3125. #define HTT_TX_PDEV_STATS_NUM_LTF 4
  3126. #define HTT_TX_PDEV_STATS_NUM_11AX_TRIGGER_TYPES 6
  3127. #define HTT_TX_NUM_OF_SOUNDING_STATS_WORDS \
  3128. (HTT_TX_PDEV_STATS_NUM_BW_COUNTERS * \
  3129. HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS)
  3130. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  3131. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_S 0
  3132. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  3133. (((_var) & HTT_TX_PDEV_RATE_STATS_MAC_ID_M) >> \
  3134. HTT_TX_PDEV_RATE_STATS_MAC_ID_S)
  3135. #define HTT_TX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  3136. do { \
  3137. HTT_CHECK_SET_VAL(HTT_TX_PDEV_RATE_STATS_MAC_ID, _val); \
  3138. ((_var) |= ((_val) << HTT_TX_PDEV_RATE_STATS_MAC_ID_S)); \
  3139. } while (0)
  3140. typedef struct {
  3141. htt_tlv_hdr_t tlv_hdr;
  3142. /* BIT [ 7 : 0] :- mac_id
  3143. * BIT [31 : 8] :- reserved
  3144. */
  3145. A_UINT32 mac_id__word;
  3146. /* Number of tx ldpc packets */
  3147. A_UINT32 tx_ldpc;
  3148. /* Number of tx rts packets */
  3149. A_UINT32 rts_cnt;
  3150. /* RSSI value of last ack packet (units = dB above noise floor) */
  3151. A_UINT32 ack_rssi;
  3152. A_UINT32 tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3153. /* tx_xx_mcs: currently unused */
  3154. A_UINT32 tx_su_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3155. A_UINT32 tx_mu_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3156. A_UINT32 tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  3157. A_UINT32 tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS]; /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  3158. A_UINT32 tx_stbc[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3159. A_UINT32 tx_pream[HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  3160. /* Counters to track number of tx packets in each GI (400us, 800us, 1600us & 3200us) in each mcs (0-11) */
  3161. A_UINT32 tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3162. /* Counters to track packets in dcm mcs (MCS 0, 1, 3, 4) */
  3163. A_UINT32 tx_dcm[HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS];
  3164. /* Number of CTS-acknowledged RTS packets */
  3165. A_UINT32 rts_success;
  3166. /*
  3167. * Counters for legacy 11a and 11b transmissions.
  3168. *
  3169. * The index corresponds to:
  3170. *
  3171. * CCK: 0: 1 Mbps, 1: 2 Mbps, 2: 5.5 Mbps, 3: 11 Mbps
  3172. *
  3173. * OFDM: 0: 6 Mbps, 1: 9 Mbps, 2: 12 Mbps, 3: 18 Mbps,
  3174. * 4: 24 Mbps, 5: 36 Mbps, 6: 48 Mbps, 7: 54 Mbps
  3175. */
  3176. A_UINT32 tx_legacy_cck_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
  3177. A_UINT32 tx_legacy_ofdm_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  3178. A_UINT32 ac_mu_mimo_tx_ldpc; /* 11AC VHT DL MU MIMO LDPC count */
  3179. A_UINT32 ax_mu_mimo_tx_ldpc; /* 11AX HE DL MU MIMO LDPC count */
  3180. A_UINT32 ofdma_tx_ldpc; /* 11AX HE DL MU OFDMA LDPC count */
  3181. /*
  3182. * Counters for 11ax HE LTF selection during TX.
  3183. *
  3184. * The index corresponds to:
  3185. *
  3186. * 0: unused, 1: 1x LTF, 2: 2x LTF, 3: 4x LTF
  3187. */
  3188. A_UINT32 tx_he_ltf[HTT_TX_PDEV_STATS_NUM_LTF];
  3189. /* 11AC VHT DL MU MIMO TX MCS stats */
  3190. A_UINT32 ac_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3191. /* 11AX HE DL MU MIMO TX MCS stats */
  3192. A_UINT32 ax_mu_mimo_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3193. /* 11AX HE DL MU OFDMA TX MCS stats */
  3194. A_UINT32 ofdma_tx_mcs[HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3195. /* 11AC VHT DL MU MIMO TX NSS stats (Indicates NSS for individual users) */
  3196. A_UINT32 ac_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  3197. /* 11AX HE DL MU MIMO TX NSS stats (Indicates NSS for individual users) */
  3198. A_UINT32 ax_mu_mimo_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  3199. /* 11AX HE DL MU OFDMA TX NSS stats (Indicates NSS for individual users) */
  3200. A_UINT32 ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  3201. /* 11AC VHT DL MU MIMO TX BW stats */
  3202. A_UINT32 ac_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  3203. /* 11AX HE DL MU MIMO TX BW stats */
  3204. A_UINT32 ax_mu_mimo_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  3205. /* 11AX HE DL MU OFDMA TX BW stats */
  3206. A_UINT32 ofdma_tx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  3207. /* 11AC VHT DL MU MIMO TX guard interval stats */
  3208. A_UINT32 ac_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3209. /* 11AX HE DL MU MIMO TX guard interval stats */
  3210. A_UINT32 ax_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3211. /* 11AX HE DL MU OFDMA TX guard interval stats */
  3212. A_UINT32 ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS];
  3213. A_UINT32 trigger_type_11ax[HTT_TX_PDEV_STATS_NUM_11AX_TRIGGER_TYPES];
  3214. A_UINT32 tx_11ax_su_ext;
  3215. /* Stats for MCS 12/13 */
  3216. A_UINT32 tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3217. A_UINT32 tx_stbc_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3218. A_UINT32 tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3219. /* 11AX VHT DL MU MIMO extended TX MCS stats for MCS 12/13 */
  3220. A_UINT32 ax_mu_mimo_tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3221. /* 11AX VHT DL MU OFDMA extended TX MCS stats for MCS 12/13 */
  3222. A_UINT32 ofdma_tx_mcs_ext[HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3223. /* 11AX VHT DL MU MIMO extended TX guard interval stats for MCS 12/13 */
  3224. A_UINT32 ax_mu_mimo_tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3225. /* 11AX VHT DL MU OFDMA extended TX guard interval stats for MCS 12/13 */
  3226. A_UINT32 ofdma_tx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_TX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3227. } htt_tx_pdev_rate_stats_tlv;
  3228. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_TX_RATE
  3229. * TLV_TAGS:
  3230. * - HTT_STATS_TX_PDEV_RATE_STATS_TAG
  3231. */
  3232. /* NOTE:
  3233. * This structure is for documentation, and cannot be safely used directly.
  3234. * Instead, use the constituent TLV structures to fill/parse.
  3235. */
  3236. typedef struct {
  3237. htt_tx_pdev_rate_stats_tlv rate_tlv;
  3238. } htt_tx_pdev_rate_stats_t;
  3239. /* == PDEV RX RATE CTRL STATS == */
  3240. #define HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS 4
  3241. #define HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS 8
  3242. #define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS 12 /* 0-11 */
  3243. #define HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS 2 /* 12, 13 */
  3244. #define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT 14 /* 0-13 */
  3245. #define HTT_RX_PDEV_STATS_NUM_GI_COUNTERS 4
  3246. #define HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS 5
  3247. #define HTT_RX_PDEV_STATS_NUM_BW_COUNTERS 4
  3248. #define HTT_RX_PDEV_STATS_TOTAL_BW_COUNTERS \
  3249. (HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS + HTT_RX_PDEV_STATS_NUM_BW_COUNTERS)
  3250. #define HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS 8
  3251. #define HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS 8
  3252. #define HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES HTT_STATS_PREAM_COUNT
  3253. #define HTT_RX_PDEV_MAX_OFDMA_NUM_USER 8
  3254. #define HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER 8
  3255. #define HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS 16
  3256. /*HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS:
  3257. * RU size index 0: HTT_UL_OFDMA_V0_RU_SIZE_RU_26
  3258. * RU size index 1: HTT_UL_OFDMA_V0_RU_SIZE_RU_52
  3259. * RU size index 2: HTT_UL_OFDMA_V0_RU_SIZE_RU_106
  3260. * RU size index 3: HTT_UL_OFDMA_V0_RU_SIZE_RU_242
  3261. * RU size index 4: HTT_UL_OFDMA_V0_RU_SIZE_RU_484
  3262. * RU size index 5: HTT_UL_OFDMA_V0_RU_SIZE_RU_996
  3263. */
  3264. #define HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS 6
  3265. /* HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS:
  3266. * RU size index 0: HTT_UL_OFDMA_V0_RU_SIZE_RU_26
  3267. * RU size index 1: HTT_UL_OFDMA_V0_RU_SIZE_RU_52
  3268. * RU size index 2: HTT_UL_OFDMA_V0_RU_SIZE_RU_106
  3269. * RU size index 3: HTT_UL_OFDMA_V0_RU_SIZE_RU_242
  3270. * RU size index 4: HTT_UL_OFDMA_V0_RU_SIZE_RU_484
  3271. * RU size index 5: HTT_UL_OFDMA_V0_RU_SIZE_RU_996
  3272. * RU size index 6: HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  3273. */
  3274. #define HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS 7 /* includes 996x2 */
  3275. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_M 0x000000ff
  3276. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_S 0
  3277. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_GET(_var) \
  3278. (((_var) & HTT_RX_PDEV_RATE_STATS_MAC_ID_M) >> \
  3279. HTT_RX_PDEV_RATE_STATS_MAC_ID_S)
  3280. #define HTT_RX_PDEV_RATE_STATS_MAC_ID_SET(_var, _val) \
  3281. do { \
  3282. HTT_CHECK_SET_VAL(HTT_RX_PDEV_RATE_STATS_MAC_ID, _val); \
  3283. ((_var) |= ((_val) << HTT_RX_PDEV_RATE_STATS_MAC_ID_S)); \
  3284. } while (0)
  3285. typedef struct {
  3286. htt_tlv_hdr_t tlv_hdr;
  3287. /* BIT [ 7 : 0] :- mac_id
  3288. * BIT [31 : 8] :- reserved
  3289. */
  3290. A_UINT32 mac_id__word;
  3291. A_UINT32 nsts;
  3292. /* Number of rx ldpc packets */
  3293. A_UINT32 rx_ldpc;
  3294. /* Number of rx rts packets */
  3295. A_UINT32 rts_cnt;
  3296. A_UINT32 rssi_mgmt; /* units = dB above noise floor */
  3297. A_UINT32 rssi_data; /* units = dB above noise floor */
  3298. A_UINT32 rssi_comb; /* units = dB above noise floor */
  3299. A_UINT32 rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3300. A_UINT32 rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS]; /* element 0,1, ...7 -> NSS 1,2, ...8 */
  3301. A_UINT32 rx_dcm[HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS];
  3302. A_UINT32 rx_stbc[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3303. A_UINT32 rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS]; /* element 0: 20 MHz, 1: 40 MHz, 2: 80 MHz, 3: 160 and 80+80 MHz */
  3304. A_UINT32 rx_pream[HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES];
  3305. A_UINT8 rssi_chain[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS]; /* units = dB above noise floor */
  3306. /* Counters to track number of rx packets in each GI in each mcs (0-11) */
  3307. A_UINT32 rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3308. A_INT32 rssi_in_dbm; /* rx Signal Strength value in dBm unit */
  3309. A_UINT32 rx_11ax_su_ext;
  3310. A_UINT32 rx_11ac_mumimo;
  3311. A_UINT32 rx_11ax_mumimo;
  3312. A_UINT32 rx_11ax_ofdma;
  3313. A_UINT32 txbf;
  3314. A_UINT32 rx_legacy_cck_rate[HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS];
  3315. A_UINT32 rx_legacy_ofdm_rate[HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  3316. A_UINT32 rx_active_dur_us_low;
  3317. A_UINT32 rx_active_dur_us_high;
  3318. /* number of times UL MU MIMO RX packets received */
  3319. A_UINT32 rx_11ax_ul_ofdma;
  3320. /* 11AX HE UL OFDMA RX TB PPDU MCS stats */
  3321. A_UINT32 ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3322. /* 11AX HE UL OFDMA RX TB PPDU GI stats */
  3323. A_UINT32 ul_ofdma_rx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3324. /* 11AX HE UL OFDMA RX TB PPDU NSS stats (Increments the individual user NSS in the OFDMA PPDU received) */
  3325. A_UINT32 ul_ofdma_rx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  3326. /* 11AX HE UL OFDMA RX TB PPDU BW stats */
  3327. A_UINT32 ul_ofdma_rx_bw[HTT_TX_PDEV_STATS_NUM_BW_COUNTERS];
  3328. /* Number of times UL OFDMA TB PPDUs received with stbc */
  3329. A_UINT32 ul_ofdma_rx_stbc;
  3330. /* Number of times UL OFDMA TB PPDUs received with ldpc */
  3331. A_UINT32 ul_ofdma_rx_ldpc;
  3332. /* Number of non data PPDUs received for each degree (number of users) in UL OFDMA */
  3333. A_UINT32 rx_ulofdma_non_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  3334. /* Number of data ppdus received for each degree (number of users) in UL OFDMA */
  3335. A_UINT32 rx_ulofdma_data_ppdu[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  3336. /* Number of mpdus passed for each degree (number of users) in UL OFDMA TB PPDU */
  3337. A_UINT32 rx_ulofdma_mpdu_ok[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  3338. /* Number of mpdus failed for each degree (number of users) in UL OFDMA TB PPDU */
  3339. A_UINT32 rx_ulofdma_mpdu_fail[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  3340. A_UINT32 nss_count;
  3341. A_UINT32 pilot_count;
  3342. /* RxEVM stats in dB */
  3343. A_INT32 rx_pilot_evm_dB[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_RXEVM_MAX_PILOTS_PER_NSS];
  3344. /* rx_pilot_evm_dB_mean:
  3345. * EVM mean across pilots, computed as
  3346. * mean(10*log10(rx_pilot_evm_linear)) = mean(rx_pilot_evm_dB)
  3347. */
  3348. A_INT32 rx_pilot_evm_dB_mean[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  3349. A_INT8 rx_ul_fd_rssi[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_MAX_OFDMA_NUM_USER]; /* dBm units */
  3350. /* per_chain_rssi_pkt_type:
  3351. * This field shows what type of rx frame the per-chain RSSI was computed
  3352. * on, by recording the frame type and sub-type as bit-fields within this
  3353. * field:
  3354. * BIT [3 : 0] :- IEEE80211_FC0_TYPE
  3355. * BIT [7 : 4] :- IEEE80211_FC0_SUBTYPE
  3356. * BIT [31 : 8] :- Reserved
  3357. */
  3358. A_UINT32 per_chain_rssi_pkt_type;
  3359. A_INT8 rx_per_chain_rssi_in_dbm[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  3360. A_UINT32 rx_su_ndpa;
  3361. A_UINT32 rx_11ax_su_txbf_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3362. A_UINT32 rx_mu_ndpa;
  3363. A_UINT32 rx_11ax_mu_txbf_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3364. A_UINT32 rx_br_poll;
  3365. A_UINT32 rx_11ax_dl_ofdma_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3366. A_UINT32 rx_11ax_dl_ofdma_ru[HTT_RX_PDEV_STATS_NUM_RU_SIZE_COUNTERS];
  3367. /* Number of non data ppdus received for each degree (number of users) with UL MUMIMO */
  3368. A_UINT32 rx_ulmumimo_non_data_ppdu[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  3369. /* Number of data ppdus received for each degree (number of users) with UL MUMIMO */
  3370. A_UINT32 rx_ulmumimo_data_ppdu[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  3371. /* Number of mpdus passed for each degree (number of users) with UL MUMIMO TB PPDU */
  3372. A_UINT32 rx_ulmumimo_mpdu_ok[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  3373. /* Number of mpdus failed for each degree (number of users) with UL MUMIMO TB PPDU */
  3374. A_UINT32 rx_ulmumimo_mpdu_fail[HTT_RX_PDEV_MAX_ULMUMIMO_NUM_USER];
  3375. /* Number of non data ppdus received for each degree (number of users) in UL OFDMA */
  3376. A_UINT32 rx_ulofdma_non_data_nusers[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  3377. /* Number of data ppdus received for each degree (number of users) in UL OFDMA */
  3378. A_UINT32 rx_ulofdma_data_nusers[HTT_RX_PDEV_MAX_OFDMA_NUM_USER];
  3379. /*
  3380. * NOTE - this TLV is already large enough that it causes the HTT message
  3381. * carrying it to be nearly at the message size limit that applies to
  3382. * many targets/hosts.
  3383. * No further fields should be added to this TLV without very careful
  3384. * review to ensure the size increase is acceptable.
  3385. */
  3386. } htt_rx_pdev_rate_stats_tlv;
  3387. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX_RATE
  3388. * TLV_TAGS:
  3389. * - HTT_STATS_RX_PDEV_RATE_STATS_TAG
  3390. */
  3391. /* NOTE:
  3392. * This structure is for documentation, and cannot be safely used directly.
  3393. * Instead, use the constituent TLV structures to fill/parse.
  3394. */
  3395. typedef struct {
  3396. htt_rx_pdev_rate_stats_tlv rate_tlv;
  3397. } htt_rx_pdev_rate_stats_t;
  3398. typedef struct {
  3399. htt_tlv_hdr_t tlv_hdr;
  3400. A_UINT8 rssi_chain_ext[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS]; /* units = dB above noise floor */
  3401. A_INT8 rx_per_chain_rssi_ext_in_dbm[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS];
  3402. A_INT32 rssi_mcast_in_dbm; /* rx mcast signal strength value in dBm unit */
  3403. A_INT32 rssi_mgmt_in_dbm; /* rx mgmt packet signal Strength value in dBm unit */
  3404. /*
  3405. * Stats for MCS 0-13 since rx_pdev_rate_stats_tlv cannot be updated,
  3406. * due to message size limitations.
  3407. */
  3408. A_UINT32 rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3409. A_UINT32 rx_stbc_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3410. A_UINT32 rx_gi_ext[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3411. A_UINT32 ul_ofdma_rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3412. A_UINT32 ul_ofdma_rx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3413. A_UINT32 rx_11ax_su_txbf_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3414. A_UINT32 rx_11ax_mu_txbf_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3415. A_UINT32 rx_11ax_dl_ofdma_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
  3416. } htt_rx_pdev_rate_ext_stats_tlv;
  3417. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX_RATE_EXT
  3418. * TLV_TAGS:
  3419. * - HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG
  3420. */
  3421. /* NOTE:
  3422. * This structure is for documentation, and cannot be safely used directly.
  3423. * Instead, use the constituent TLV structures to fill/parse.
  3424. */
  3425. typedef struct {
  3426. htt_rx_pdev_rate_ext_stats_tlv rate_tlv;
  3427. } htt_rx_pdev_rate_ext_stats_t;
  3428. #define HTT_STATS_CMN_MAC_ID_M 0x000000ff
  3429. #define HTT_STATS_CMN_MAC_ID_S 0
  3430. #define HTT_STATS_CMN_MAC_ID_GET(_var) \
  3431. (((_var) & HTT_STATS_CMN_MAC_ID_M) >> \
  3432. HTT_STATS_CMN_MAC_ID_S)
  3433. #define HTT_STATS_CMN_MAC_ID_SET(_var, _val) \
  3434. do { \
  3435. HTT_CHECK_SET_VAL(HTT_STATS_CMN_MAC_ID, _val); \
  3436. ((_var) |= ((_val) << HTT_STATS_CMN_MAC_ID_S)); \
  3437. } while (0)
  3438. #define HTT_RX_UL_MAX_UPLINK_RSSI_TRACK 5
  3439. typedef struct {
  3440. htt_tlv_hdr_t tlv_hdr;
  3441. /* BIT [ 7 : 0] :- mac_id
  3442. * BIT [31 : 8] :- reserved
  3443. */
  3444. A_UINT32 mac_id__word;
  3445. A_UINT32 rx_11ax_ul_ofdma;
  3446. A_UINT32 ul_ofdma_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3447. A_UINT32 ul_ofdma_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3448. A_UINT32 ul_ofdma_rx_nss[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  3449. A_UINT32 ul_ofdma_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  3450. A_UINT32 ul_ofdma_rx_stbc;
  3451. A_UINT32 ul_ofdma_rx_ldpc;
  3452. /*
  3453. * These are arrays to hold the number of PPDUs that we received per RU.
  3454. * E.g. PPDUs (data or non data) received in RU26 will be incremented in
  3455. * array offset 0 and similarly RU52 will be incremented in array offset 1
  3456. */
  3457. A_UINT32 rx_ulofdma_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS]; /* ppdu level */
  3458. A_UINT32 rx_ulofdma_non_data_ru_size_ppdu[HTT_RX_PDEV_STATS_NUM_RU_SIZE_160MHZ_CNTRS]; /* ppdu level */
  3459. /*
  3460. * These arrays hold Target RSSI (rx power the AP wants),
  3461. * FD RSSI (rx power the AP sees) & Power headroom values of STAs
  3462. * which can be identified by AIDs, during trigger based RX.
  3463. * Array acts a circular buffer and holds values for last 5 STAs
  3464. * in the same order as RX.
  3465. */
  3466. /* uplink_sta_aid:
  3467. * STA AID array for identifying which STA the
  3468. * Target-RSSI / FD-RSSI / pwr headroom stats are for
  3469. */
  3470. A_UINT32 uplink_sta_aid[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  3471. /* uplink_sta_target_rssi:
  3472. * Trig Target RSSI for STA AID in same index - UNIT(dBm)
  3473. */
  3474. A_INT32 uplink_sta_target_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  3475. /* uplink_sta_fd_rssi:
  3476. * Trig FD RSSI from STA AID in same index - UNIT(dBm)
  3477. */
  3478. A_INT32 uplink_sta_fd_rssi[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  3479. /* uplink_sta_power_headroom:
  3480. * Trig power headroom for STA AID in same idx - UNIT(dB)
  3481. */
  3482. A_UINT32 uplink_sta_power_headroom[HTT_RX_UL_MAX_UPLINK_RSSI_TRACK];
  3483. } htt_rx_pdev_ul_trigger_stats_tlv;
  3484. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_TRIG_STATS
  3485. * TLV_TAGS:
  3486. * - HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG
  3487. * NOTE:
  3488. * This structure is for documentation, and cannot be safely used directly.
  3489. * Instead, use the constituent TLV structures to fill/parse.
  3490. */
  3491. typedef struct {
  3492. htt_rx_pdev_ul_trigger_stats_tlv ul_trigger_tlv;
  3493. } htt_rx_pdev_ul_trigger_stats_t;
  3494. typedef struct {
  3495. htt_tlv_hdr_t tlv_hdr;
  3496. A_UINT32 user_index;
  3497. A_UINT32 rx_ulofdma_non_data_ppdu; /* ppdu level */
  3498. A_UINT32 rx_ulofdma_data_ppdu; /* ppdu level */
  3499. A_UINT32 rx_ulofdma_mpdu_ok; /* mpdu level */
  3500. A_UINT32 rx_ulofdma_mpdu_fail; /* mpdu level */
  3501. A_UINT32 rx_ulofdma_non_data_nusers;
  3502. A_UINT32 rx_ulofdma_data_nusers;
  3503. } htt_rx_pdev_ul_ofdma_user_stats_tlv;
  3504. typedef struct {
  3505. htt_tlv_hdr_t tlv_hdr;
  3506. A_UINT32 user_index;
  3507. A_UINT32 rx_ulmumimo_non_data_ppdu; /* ppdu level */
  3508. A_UINT32 rx_ulmumimo_data_ppdu; /* ppdu level */
  3509. A_UINT32 rx_ulmumimo_mpdu_ok; /* mpdu level */
  3510. A_UINT32 rx_ulmumimo_mpdu_fail; /* mpdu level */
  3511. } htt_rx_pdev_ul_mimo_user_stats_tlv;
  3512. /* == RX PDEV/SOC STATS == */
  3513. typedef struct {
  3514. htt_tlv_hdr_t tlv_hdr;
  3515. /*
  3516. * BIT [7:0] :- mac_id
  3517. * BIT [31:8] :- reserved
  3518. *
  3519. * Refer to HTT_STATS_CMN_MAC_ID_GET/SET macros.
  3520. */
  3521. A_UINT32 mac_id__word;
  3522. /* Number of times UL MUMIMO RX packets received */
  3523. A_UINT32 rx_11ax_ul_mumimo;
  3524. /* 11AX HE UL MU-MIMO RX TB PPDU MCS stats */
  3525. A_UINT32 ul_mumimo_rx_mcs[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3526. /*
  3527. * 11AX HE UL MU-MIMO RX GI & LTF stats.
  3528. * Index 0 indicates 1xLTF + 1.6 msec GI
  3529. * Index 1 indicates 2xLTF + 1.6 msec GI
  3530. * Index 2 indicates 4xLTF + 3.2 msec GI
  3531. */
  3532. A_UINT32 ul_mumimo_rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS];
  3533. /* 11AX HE UL MU-MIMO RX TB PPDU NSS stats (Increments the individual user NSS in the UL MU MIMO PPDU received) */
  3534. A_UINT32 ul_mumimo_rx_nss[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  3535. /* 11AX HE UL MU-MIMO RX TB PPDU BW stats */
  3536. A_UINT32 ul_mumimo_rx_bw[HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  3537. /* Number of times UL MUMIMO TB PPDUs received with STBC */
  3538. A_UINT32 ul_mumimo_rx_stbc;
  3539. /* Number of times UL MUMIMO TB PPDUs received with LDPC */
  3540. A_UINT32 ul_mumimo_rx_ldpc;
  3541. /* Stats for MCS 12/13 */
  3542. A_UINT32 ul_mumimo_rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3543. A_UINT32 ul_mumimo_rx_gi_ext[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS][HTT_RX_PDEV_STATS_NUM_EXTRA_MCS_COUNTERS];
  3544. /* RSSI in dBm for Rx TB PPDUs */
  3545. A_INT8 rx_ul_mumimo_chain_rssi_in_dbm[HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS][HTT_RX_PDEV_STATS_TOTAL_BW_COUNTERS];
  3546. /* Target RSSI programmed in UL MUMIMO triggers (units dBm) */
  3547. A_INT8 rx_ul_mumimo_target_rssi[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS][HTT_RX_PDEV_STATS_NUM_BW_COUNTERS];
  3548. /* FD RSSI measured for Rx UL TB PPDUs (units dBm) */
  3549. A_INT8 rx_ul_mumimo_fd_rssi[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS][HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  3550. /* Average pilot EVM measued for RX UL TB PPDU */
  3551. A_INT8 rx_ulmumimo_pilot_evm_dB_mean[HTT_TX_PDEV_STATS_NUM_UL_MUMIMO_USER_STATS][HTT_RX_PDEV_STATS_ULMUMIMO_NUM_SPATIAL_STREAMS];
  3552. } htt_rx_pdev_ul_mumimo_trig_stats_tlv;
  3553. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_UL_MUMIMO_TRIG_STATS
  3554. * TLV_TAGS:
  3555. * - HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG
  3556. */
  3557. typedef struct {
  3558. htt_rx_pdev_ul_mumimo_trig_stats_tlv ul_mumimo_trig_tlv;
  3559. } htt_rx_pdev_ul_mumimo_trig_stats_t;
  3560. typedef struct {
  3561. htt_tlv_hdr_t tlv_hdr;
  3562. /* Num Packets received on REO FW ring */
  3563. A_UINT32 fw_reo_ring_data_msdu;
  3564. /* Num bc/mc packets indicated from fw to host */
  3565. A_UINT32 fw_to_host_data_msdu_bcmc;
  3566. /* Num unicast packets indicated from fw to host */
  3567. A_UINT32 fw_to_host_data_msdu_uc;
  3568. /* Num remote buf recycle from offload */
  3569. A_UINT32 ofld_remote_data_buf_recycle_cnt;
  3570. /* Num remote free buf given to offload */
  3571. A_UINT32 ofld_remote_free_buf_indication_cnt;
  3572. /* Num unicast packets from local path indicated to host */
  3573. A_UINT32 ofld_buf_to_host_data_msdu_uc;
  3574. /* Num unicast packets from REO indicated to host */
  3575. A_UINT32 reo_fw_ring_to_host_data_msdu_uc;
  3576. /* Num Packets received from WBM SW1 ring */
  3577. A_UINT32 wbm_sw_ring_reap;
  3578. /* Num packets from WBM forwarded from fw to host via WBM */
  3579. A_UINT32 wbm_forward_to_host_cnt;
  3580. /* Num packets from WBM recycled to target refill ring */
  3581. A_UINT32 wbm_target_recycle_cnt;
  3582. /* Total Num of recycled to refill ring, including packets from WBM and REO */
  3583. A_UINT32 target_refill_ring_recycle_cnt;
  3584. } htt_rx_soc_fw_stats_tlv;
  3585. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3586. /* NOTE: Variable length TLV, use length spec to infer array size */
  3587. typedef struct {
  3588. htt_tlv_hdr_t tlv_hdr;
  3589. /* Num ring empty encountered */
  3590. A_UINT32 refill_ring_empty_cnt[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
  3591. } htt_rx_soc_fw_refill_ring_empty_tlv_v;
  3592. #define HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3593. /* NOTE: Variable length TLV, use length spec to infer array size */
  3594. typedef struct {
  3595. htt_tlv_hdr_t tlv_hdr;
  3596. /* Num total buf refilled from refill ring */
  3597. A_UINT32 refill_ring_num_refill[1]; /* HTT_RX_STATS_REFILL_MAX_RING */
  3598. } htt_rx_soc_fw_refill_ring_num_refill_tlv_v;
  3599. /* RXDMA error code from WBM released packets */
  3600. typedef enum {
  3601. HTT_RX_RXDMA_OVERFLOW_ERR = 0,
  3602. HTT_RX_RXDMA_MPDU_LENGTH_ERR = 1,
  3603. HTT_RX_RXDMA_FCS_ERR = 2,
  3604. HTT_RX_RXDMA_DECRYPT_ERR = 3,
  3605. HTT_RX_RXDMA_TKIP_MIC_ERR = 4,
  3606. HTT_RX_RXDMA_UNECRYPTED_ERR = 5,
  3607. HTT_RX_RXDMA_MSDU_LEN_ERR = 6,
  3608. HTT_RX_RXDMA_MSDU_LIMIT_ERR = 7,
  3609. HTT_RX_RXDMA_WIFI_PARSE_ERR = 8,
  3610. HTT_RX_RXDMA_AMSDU_PARSE_ERR = 9,
  3611. HTT_RX_RXDMA_SA_TIMEOUT_ERR = 10,
  3612. HTT_RX_RXDMA_DA_TIMEOUT_ERR = 11,
  3613. HTT_RX_RXDMA_FLOW_TIMEOUT_ERR = 12,
  3614. HTT_RX_RXDMA_FLUSH_REQUEST = 13,
  3615. HTT_RX_RXDMA_ERR_CODE_RVSD0 = 14,
  3616. HTT_RX_RXDMA_ERR_CODE_RVSD1 = 15,
  3617. /*
  3618. * This MAX_ERR_CODE should not be used in any host/target messages,
  3619. * so that even though it is defined within a host/target interface
  3620. * definition header file, it isn't actually part of the host/target
  3621. * interface, and thus can be modified.
  3622. */
  3623. HTT_RX_RXDMA_MAX_ERR_CODE
  3624. } htt_rx_rxdma_error_code_enum;
  3625. /* NOTE: Variable length TLV, use length spec to infer array size */
  3626. typedef struct {
  3627. htt_tlv_hdr_t tlv_hdr;
  3628. /* NOTE:
  3629. * The mapping of RXDMA error types to rxdma_err array elements is HW dependent.
  3630. * It is expected but not required that the target will provide a rxdma_err element
  3631. * for each of the htt_rx_rxdma_error_code_enum values, up to but not including
  3632. * MAX_ERR_CODE. The host should ignore any array elements whose
  3633. * indices are >= the MAX_ERR_CODE value the host was compiled with.
  3634. */
  3635. A_UINT32 rxdma_err[1]; /* HTT_RX_RXDMA_MAX_ERR_CODE */
  3636. } htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v;
  3637. /* REO error code from WBM released packets */
  3638. typedef enum {
  3639. HTT_RX_REO_QUEUE_DESC_ADDR_ZERO = 0,
  3640. HTT_RX_REO_QUEUE_DESC_NOT_VALID = 1,
  3641. HTT_RX_AMPDU_IN_NON_BA = 2,
  3642. HTT_RX_NON_BA_DUPLICATE = 3,
  3643. HTT_RX_BA_DUPLICATE = 4,
  3644. HTT_RX_REGULAR_FRAME_2K_JUMP = 5,
  3645. HTT_RX_BAR_FRAME_2K_JUMP = 6,
  3646. HTT_RX_REGULAR_FRAME_OOR = 7,
  3647. HTT_RX_BAR_FRAME_OOR = 8,
  3648. HTT_RX_BAR_FRAME_NO_BA_SESSION = 9,
  3649. HTT_RX_BAR_FRAME_SN_EQUALS_SSN = 10,
  3650. HTT_RX_PN_CHECK_FAILED = 11,
  3651. HTT_RX_2K_ERROR_HANDLING_FLAG_SET = 12,
  3652. HTT_RX_PN_ERROR_HANDLING_FLAG_SET = 13,
  3653. HTT_RX_QUEUE_DESCRIPTOR_BLOCKED_SET = 14,
  3654. HTT_RX_REO_ERR_CODE_RVSD = 15,
  3655. /*
  3656. * This MAX_ERR_CODE should not be used in any host/target messages,
  3657. * so that even though it is defined within a host/target interface
  3658. * definition header file, it isn't actually part of the host/target
  3659. * interface, and thus can be modified.
  3660. */
  3661. HTT_RX_REO_MAX_ERR_CODE
  3662. } htt_rx_reo_error_code_enum;
  3663. /* NOTE: Variable length TLV, use length spec to infer array size */
  3664. typedef struct {
  3665. htt_tlv_hdr_t tlv_hdr;
  3666. /* NOTE:
  3667. * The mapping of REO error types to reo_err array elements is HW dependent.
  3668. * It is expected but not required that the target will provide a rxdma_err element
  3669. * for each of the htt_rx_reo_error_code_enum values, up to but not including
  3670. * MAX_ERR_CODE. The host should ignore any array elements whose
  3671. * indices are >= the MAX_ERR_CODE value the host was compiled with.
  3672. */
  3673. A_UINT32 reo_err[1]; /* HTT_RX_REO_MAX_ERR_CODE */
  3674. } htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v;
  3675. /* NOTE:
  3676. * This structure is for documentation, and cannot be safely used directly.
  3677. * Instead, use the constituent TLV structures to fill/parse.
  3678. */
  3679. typedef struct {
  3680. htt_rx_soc_fw_stats_tlv fw_tlv;
  3681. htt_rx_soc_fw_refill_ring_empty_tlv_v fw_refill_ring_empty_tlv;
  3682. htt_rx_soc_fw_refill_ring_num_refill_tlv_v fw_refill_ring_num_refill_tlv;
  3683. htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v fw_refill_ring_num_rxdma_err_tlv;
  3684. htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v fw_refill_ring_num_reo_err_tlv;
  3685. } htt_rx_soc_stats_t;
  3686. /* == RX PDEV STATS == */
  3687. #define HTT_RX_PDEV_FW_STATS_MAC_ID_M 0x000000ff
  3688. #define HTT_RX_PDEV_FW_STATS_MAC_ID_S 0
  3689. #define HTT_RX_PDEV_FW_STATS_MAC_ID_GET(_var) \
  3690. (((_var) & HTT_RX_PDEV_FW_STATS_MAC_ID_M) >> \
  3691. HTT_RX_PDEV_FW_STATS_MAC_ID_S)
  3692. #define HTT_RX_PDEV_FW_STATS_MAC_ID_SET(_var, _val) \
  3693. do { \
  3694. HTT_CHECK_SET_VAL(HTT_RX_PDEV_FW_STATS_MAC_ID, _val); \
  3695. ((_var) |= ((_val) << HTT_RX_PDEV_FW_STATS_MAC_ID_S)); \
  3696. } while (0)
  3697. typedef struct {
  3698. htt_tlv_hdr_t tlv_hdr;
  3699. /* BIT [ 7 : 0] :- mac_id
  3700. * BIT [31 : 8] :- reserved
  3701. */
  3702. A_UINT32 mac_id__word;
  3703. /* Num PPDU status processed from HW */
  3704. A_UINT32 ppdu_recvd;
  3705. /* Num MPDU across PPDUs with FCS ok */
  3706. A_UINT32 mpdu_cnt_fcs_ok;
  3707. /* Num MPDU across PPDUs with FCS err */
  3708. A_UINT32 mpdu_cnt_fcs_err;
  3709. /* Num MSDU across PPDUs */
  3710. A_UINT32 tcp_msdu_cnt;
  3711. /* Num MSDU across PPDUs */
  3712. A_UINT32 tcp_ack_msdu_cnt;
  3713. /* Num MSDU across PPDUs */
  3714. A_UINT32 udp_msdu_cnt;
  3715. /* Num MSDU across PPDUs */
  3716. A_UINT32 other_msdu_cnt;
  3717. /* Num MPDU on FW ring indicated */
  3718. A_UINT32 fw_ring_mpdu_ind;
  3719. /* Num MGMT MPDU given to protocol */
  3720. A_UINT32 fw_ring_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  3721. /* Num ctrl MPDU given to protocol */
  3722. A_UINT32 fw_ring_ctrl_subtype[HTT_STATS_SUBTYPE_MAX];
  3723. /* Num mcast data packet received */
  3724. A_UINT32 fw_ring_mcast_data_msdu;
  3725. /* Num broadcast data packet received */
  3726. A_UINT32 fw_ring_bcast_data_msdu;
  3727. /* Num unicat data packet received */
  3728. A_UINT32 fw_ring_ucast_data_msdu;
  3729. /* Num null data packet received */
  3730. A_UINT32 fw_ring_null_data_msdu;
  3731. /* Num MPDU on FW ring dropped */
  3732. A_UINT32 fw_ring_mpdu_drop;
  3733. /* Num buf indication to offload */
  3734. A_UINT32 ofld_local_data_ind_cnt;
  3735. /* Num buf recycle from offload */
  3736. A_UINT32 ofld_local_data_buf_recycle_cnt;
  3737. /* Num buf indication to data_rx */
  3738. A_UINT32 drx_local_data_ind_cnt;
  3739. /* Num buf recycle from data_rx */
  3740. A_UINT32 drx_local_data_buf_recycle_cnt;
  3741. /* Num buf indication to protocol */
  3742. A_UINT32 local_nondata_ind_cnt;
  3743. /* Num buf recycle from protocol */
  3744. A_UINT32 local_nondata_buf_recycle_cnt;
  3745. /* Num buf fed */
  3746. A_UINT32 fw_status_buf_ring_refill_cnt;
  3747. /* Num ring empty encountered */
  3748. A_UINT32 fw_status_buf_ring_empty_cnt;
  3749. /* Num buf fed */
  3750. A_UINT32 fw_pkt_buf_ring_refill_cnt;
  3751. /* Num ring empty encountered */
  3752. A_UINT32 fw_pkt_buf_ring_empty_cnt;
  3753. /* Num buf fed */
  3754. A_UINT32 fw_link_buf_ring_refill_cnt;
  3755. /* Num ring empty encountered */
  3756. A_UINT32 fw_link_buf_ring_empty_cnt;
  3757. /* Num buf fed */
  3758. A_UINT32 host_pkt_buf_ring_refill_cnt;
  3759. /* Num ring empty encountered */
  3760. A_UINT32 host_pkt_buf_ring_empty_cnt;
  3761. /* Num buf fed */
  3762. A_UINT32 mon_pkt_buf_ring_refill_cnt;
  3763. /* Num ring empty encountered */
  3764. A_UINT32 mon_pkt_buf_ring_empty_cnt;
  3765. /* Num buf fed */
  3766. A_UINT32 mon_status_buf_ring_refill_cnt;
  3767. /* Num ring empty encountered */
  3768. A_UINT32 mon_status_buf_ring_empty_cnt;
  3769. /* Num buf fed */
  3770. A_UINT32 mon_desc_buf_ring_refill_cnt;
  3771. /* Num ring empty encountered */
  3772. A_UINT32 mon_desc_buf_ring_empty_cnt;
  3773. /* Num buf fed */
  3774. A_UINT32 mon_dest_ring_update_cnt;
  3775. /* Num ring full encountered */
  3776. A_UINT32 mon_dest_ring_full_cnt;
  3777. /* Num rx suspend is attempted */
  3778. A_UINT32 rx_suspend_cnt;
  3779. /* Num rx suspend failed */
  3780. A_UINT32 rx_suspend_fail_cnt;
  3781. /* Num rx resume attempted */
  3782. A_UINT32 rx_resume_cnt;
  3783. /* Num rx resume failed */
  3784. A_UINT32 rx_resume_fail_cnt;
  3785. /* Num rx ring switch */
  3786. A_UINT32 rx_ring_switch_cnt;
  3787. /* Num rx ring restore */
  3788. A_UINT32 rx_ring_restore_cnt;
  3789. /* Num rx flush issued */
  3790. A_UINT32 rx_flush_cnt;
  3791. /* Num rx recovery */
  3792. A_UINT32 rx_recovery_reset_cnt;
  3793. } htt_rx_pdev_fw_stats_tlv;
  3794. typedef struct {
  3795. htt_tlv_hdr_t tlv_hdr;
  3796. /* peer mac address */
  3797. htt_mac_addr peer_mac_addr;
  3798. /* Num of tx mgmt frames with subtype on peer level */
  3799. A_UINT32 peer_tx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  3800. /* Num of rx mgmt frames with subtype on peer level */
  3801. A_UINT32 peer_rx_mgmt_subtype[HTT_STATS_SUBTYPE_MAX];
  3802. } htt_peer_ctrl_path_txrx_stats_tlv;
  3803. #define HTT_STATS_PHY_ERR_MAX 43
  3804. typedef struct {
  3805. htt_tlv_hdr_t tlv_hdr;
  3806. /* BIT [ 7 : 0] :- mac_id
  3807. * BIT [31 : 8] :- reserved
  3808. */
  3809. A_UINT32 mac_id__word;
  3810. /* Num of phy err */
  3811. A_UINT32 total_phy_err_cnt;
  3812. /* Counts of different types of phy errs
  3813. * The mapping of PHY error types to phy_err array elements is HW dependent.
  3814. * The only currently-supported mapping is shown below:
  3815. *
  3816. * 0 phyrx_err_phy_off Reception aborted due to receiving a PHY_OFF TLV
  3817. * 1 phyrx_err_synth_off
  3818. * 2 phyrx_err_ofdma_timing
  3819. * 3 phyrx_err_ofdma_signal_parity
  3820. * 4 phyrx_err_ofdma_rate_illegal
  3821. * 5 phyrx_err_ofdma_length_illegal
  3822. * 6 phyrx_err_ofdma_restart
  3823. * 7 phyrx_err_ofdma_service
  3824. * 8 phyrx_err_ppdu_ofdma_power_drop
  3825. * 9 phyrx_err_cck_blokker
  3826. * 10 phyrx_err_cck_timing
  3827. * 11 phyrx_err_cck_header_crc
  3828. * 12 phyrx_err_cck_rate_illegal
  3829. * 13 phyrx_err_cck_length_illegal
  3830. * 14 phyrx_err_cck_restart
  3831. * 15 phyrx_err_cck_service
  3832. * 16 phyrx_err_cck_power_drop
  3833. * 17 phyrx_err_ht_crc_err
  3834. * 18 phyrx_err_ht_length_illegal
  3835. * 19 phyrx_err_ht_rate_illegal
  3836. * 20 phyrx_err_ht_zlf
  3837. * 21 phyrx_err_false_radar_ext
  3838. * 22 phyrx_err_green_field
  3839. * 23 phyrx_err_bw_gt_dyn_bw
  3840. * 24 phyrx_err_leg_ht_mismatch
  3841. * 25 phyrx_err_vht_crc_error
  3842. * 26 phyrx_err_vht_siga_unsupported
  3843. * 27 phyrx_err_vht_lsig_len_invalid
  3844. * 28 phyrx_err_vht_ndp_or_zlf
  3845. * 29 phyrx_err_vht_nsym_lt_zero
  3846. * 30 phyrx_err_vht_rx_extra_symbol_mismatch
  3847. * 31 phyrx_err_vht_rx_skip_group_id0
  3848. * 32 phyrx_err_vht_rx_skip_group_id1to62
  3849. * 33 phyrx_err_vht_rx_skip_group_id63
  3850. * 34 phyrx_err_ofdm_ldpc_decoder_disabled
  3851. * 35 phyrx_err_defer_nap
  3852. * 36 phyrx_err_fdomain_timeout
  3853. * 37 phyrx_err_lsig_rel_check
  3854. * 38 phyrx_err_bt_collision
  3855. * 39 phyrx_err_unsupported_mu_feedback
  3856. * 40 phyrx_err_ppdu_tx_interrupt_rx
  3857. * 41 phyrx_err_unsupported_cbf
  3858. * 42 phyrx_err_other
  3859. */
  3860. A_UINT32 phy_err[HTT_STATS_PHY_ERR_MAX];
  3861. } htt_rx_pdev_fw_stats_phy_err_tlv;
  3862. #define HTT_RX_PDEV_FW_RING_MPDU_ERR_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3863. /* NOTE: Variable length TLV, use length spec to infer array size */
  3864. typedef struct {
  3865. htt_tlv_hdr_t tlv_hdr;
  3866. /* Num error MPDU for each RxDMA error type */
  3867. A_UINT32 fw_ring_mpdu_err[1]; /* HTT_RX_STATS_RXDMA_MAX_ERR */
  3868. } htt_rx_pdev_fw_ring_mpdu_err_tlv_v;
  3869. #define HTT_RX_PDEV_FW_MPDU_DROP_TLV_SZ(_num_elems) (sizeof(A_UINT32) * (_num_elems))
  3870. /* NOTE: Variable length TLV, use length spec to infer array size */
  3871. typedef struct {
  3872. htt_tlv_hdr_t tlv_hdr;
  3873. /* Num MPDU dropped */
  3874. A_UINT32 fw_mpdu_drop[1]; /* HTT_RX_STATS_FW_DROP_REASON_MAX */
  3875. } htt_rx_pdev_fw_mpdu_drop_tlv_v;
  3876. /* STATS_TYPE : HTT_DBG_EXT_STATS_PDEV_RX
  3877. * TLV_TAGS:
  3878. * - HTT_STATS_RX_SOC_FW_STATS_TAG (head TLV in soc_stats)
  3879. * - HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG (inside soc_stats)
  3880. * - HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG (inside soc_stats)
  3881. * - HTT_STATS_RX_PDEV_FW_STATS_TAG
  3882. * - HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG
  3883. * - HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG
  3884. */
  3885. /* NOTE:
  3886. * This structure is for documentation, and cannot be safely used directly.
  3887. * Instead, use the constituent TLV structures to fill/parse.
  3888. */
  3889. typedef struct {
  3890. htt_rx_soc_stats_t soc_stats;
  3891. htt_rx_pdev_fw_stats_tlv fw_stats_tlv;
  3892. htt_rx_pdev_fw_ring_mpdu_err_tlv_v fw_ring_mpdu_err_tlv;
  3893. htt_rx_pdev_fw_mpdu_drop_tlv_v fw_ring_mpdu_drop;
  3894. htt_rx_pdev_fw_stats_phy_err_tlv fw_stats_phy_err_tlv;
  3895. } htt_rx_pdev_stats_t;
  3896. /* STATS_TYPE : HTT_DBG_EXT_PEER_CTRL_PATH_TXRX_STATS
  3897. * TLV_TAGS:
  3898. * - HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG
  3899. *
  3900. */
  3901. typedef struct {
  3902. htt_peer_ctrl_path_txrx_stats_tlv peer_ctrl_path_txrx_stats_tlv;
  3903. } htt_ctrl_path_txrx_stats_t;
  3904. #define HTT_PDEV_CCA_STATS_TX_FRAME_INFO_PRESENT (0x1)
  3905. #define HTT_PDEV_CCA_STATS_RX_FRAME_INFO_PRESENT (0x2)
  3906. #define HTT_PDEV_CCA_STATS_RX_CLEAR_INFO_PRESENT (0x4)
  3907. #define HTT_PDEV_CCA_STATS_MY_RX_FRAME_INFO_PRESENT (0x8)
  3908. #define HTT_PDEV_CCA_STATS_USEC_CNT_INFO_PRESENT (0x10)
  3909. #define HTT_PDEV_CCA_STATS_MED_RX_IDLE_INFO_PRESENT (0x20)
  3910. #define HTT_PDEV_CCA_STATS_MED_TX_IDLE_GLOBAL_INFO_PRESENT (0x40)
  3911. #define HTT_PDEV_CCA_STATS_CCA_OBBS_USEC_INFO_PRESENT (0x80)
  3912. typedef struct {
  3913. htt_tlv_hdr_t tlv_hdr;
  3914. /* Below values are obtained from the HW Cycles counter registers */
  3915. A_UINT32 tx_frame_usec;
  3916. A_UINT32 rx_frame_usec;
  3917. A_UINT32 rx_clear_usec;
  3918. A_UINT32 my_rx_frame_usec;
  3919. A_UINT32 usec_cnt;
  3920. A_UINT32 med_rx_idle_usec;
  3921. A_UINT32 med_tx_idle_global_usec;
  3922. A_UINT32 cca_obss_usec;
  3923. } htt_pdev_stats_cca_counters_tlv;
  3924. /* NOTE: THIS htt_pdev_cca_stats_hist_tlv STRUCTURE IS DEPRECATED,
  3925. * due to lack of support in some host stats infrastructures for
  3926. * TLVs nested within TLVs.
  3927. */
  3928. typedef struct {
  3929. htt_tlv_hdr_t tlv_hdr;
  3930. /* The channel number on which these stats were collected */
  3931. A_UINT32 chan_num;
  3932. /* num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
  3933. A_UINT32 num_records;
  3934. /*
  3935. * Bit map of valid CCA counters
  3936. * Bit0 - tx_frame_usec
  3937. * Bit1 - rx_frame_usec
  3938. * Bit2 - rx_clear_usec
  3939. * Bit3 - my_rx_frame_usec
  3940. * bit4 - usec_cnt
  3941. * Bit5 - med_rx_idle_usec
  3942. * Bit6 - med_tx_idle_global_usec
  3943. * Bit7 - cca_obss_usec
  3944. *
  3945. * See HTT_PDEV_CCA_STATS_xxx_INFO_PRESENT defs
  3946. */
  3947. A_UINT32 valid_cca_counters_bitmap;
  3948. /* Indicates the stats collection interval
  3949. * Valid Values:
  3950. * 100 - For the 100ms interval CCA stats histogram
  3951. * 1000 - For 1sec interval CCA histogram
  3952. * 0xFFFFFFFF - For Cumulative CCA Stats
  3953. */
  3954. A_UINT32 collection_interval;
  3955. /**
  3956. * This will be followed by an array which contains the CCA stats
  3957. * collected in the last N intervals,
  3958. * if the indication is for last N intervals CCA stats.
  3959. * Then the pdev_cca_stats[0] element contains the oldest CCA stats
  3960. * and pdev_cca_stats[N-1] will have the most recent CCA stats.
  3961. */
  3962. htt_pdev_stats_cca_counters_tlv cca_hist_tlv[1];
  3963. } htt_pdev_cca_stats_hist_tlv;
  3964. typedef struct {
  3965. htt_tlv_hdr_t tlv_hdr;
  3966. /* The channel number on which these stats were collected */
  3967. A_UINT32 chan_num;
  3968. /* num of CCA records (Num of htt_pdev_stats_cca_counters_tlv)*/
  3969. A_UINT32 num_records;
  3970. /*
  3971. * Bit map of valid CCA counters
  3972. * Bit0 - tx_frame_usec
  3973. * Bit1 - rx_frame_usec
  3974. * Bit2 - rx_clear_usec
  3975. * Bit3 - my_rx_frame_usec
  3976. * bit4 - usec_cnt
  3977. * Bit5 - med_rx_idle_usec
  3978. * Bit6 - med_tx_idle_global_usec
  3979. * Bit7 - cca_obss_usec
  3980. *
  3981. * See HTT_PDEV_CCA_STATS_xxx_INFO_PRESENT defs
  3982. */
  3983. A_UINT32 valid_cca_counters_bitmap;
  3984. /* Indicates the stats collection interval
  3985. * Valid Values:
  3986. * 100 - For the 100ms interval CCA stats histogram
  3987. * 1000 - For 1sec interval CCA histogram
  3988. * 0xFFFFFFFF - For Cumulative CCA Stats
  3989. */
  3990. A_UINT32 collection_interval;
  3991. /**
  3992. * This will be followed by an array which contains the CCA stats
  3993. * collected in the last N intervals,
  3994. * if the indication is for last N intervals CCA stats.
  3995. * Then the pdev_cca_stats[0] element contains the oldest CCA stats
  3996. * and pdev_cca_stats[N-1] will have the most recent CCA stats.
  3997. * htt_pdev_stats_cca_counters_tlv cca_hist_tlv[1];
  3998. */
  3999. } htt_pdev_cca_stats_hist_v1_tlv;
  4000. #define HTT_TWT_SESSION_FLAG_FLOW_ID_M 0x0000ffff
  4001. #define HTT_TWT_SESSION_FLAG_FLOW_ID_S 0
  4002. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_M 0x00010000
  4003. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_S 16
  4004. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_M 0x00020000
  4005. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S 17
  4006. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_M 0x00040000
  4007. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S 18
  4008. #define HTT_TWT_SESSION_FLAG_FLOW_ID_GET(_var) \
  4009. (((_var) & HTT_TWT_SESSION_FLAG_FLOW_ID_M) >> \
  4010. HTT_TWT_SESSION_FLAG_FLOW_ID_S)
  4011. #define HTT_TWT_SESSION_FLAG_FLOW_ID_SET(_var, _val) \
  4012. do { \
  4013. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_FLOW_ID, _val); \
  4014. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_FLOW_ID_S)); \
  4015. } while (0)
  4016. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_GET(_var) \
  4017. (((_var) & HTT_TWT_SESSION_FLAG_BCAST_TWT_M) >> \
  4018. HTT_TWT_SESSION_FLAG_BCAST_TWT_S)
  4019. #define HTT_TWT_SESSION_FLAG_BCAST_TWT_SET(_var, _val) \
  4020. do { \
  4021. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_BCAST_TWT, _val); \
  4022. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_BCAST_TWT_S)); \
  4023. } while (0)
  4024. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_GET(_var) \
  4025. (((_var) & HTT_TWT_SESSION_FLAG_TRIGGER_TWT_M) >> \
  4026. HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S)
  4027. #define HTT_TWT_SESSION_FLAG_TRIGGER_TWT_SET(_var, _val) \
  4028. do { \
  4029. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_TRIGGER_TWT, _val); \
  4030. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_TRIGGER_TWT_S)); \
  4031. } while (0)
  4032. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_GET(_var) \
  4033. (((_var) & HTT_TWT_SESSION_FLAG_ANNOUN_TWT_M) >> \
  4034. HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S)
  4035. #define HTT_TWT_SESSION_FLAG_ANNOUN_TWT_SET(_var, _val) \
  4036. do { \
  4037. HTT_CHECK_SET_VAL(HTT_TWT_SESSION_FLAG_ANNOUN_TWT, _val); \
  4038. ((_var) |= ((_val) << HTT_TWT_SESSION_FLAG_ANNOUN_TWT_S)); \
  4039. } while (0)
  4040. #define TWT_DIALOG_ID_UNAVAILABLE 0xFFFFFFFF
  4041. typedef struct {
  4042. htt_tlv_hdr_t tlv_hdr;
  4043. A_UINT32 vdev_id;
  4044. htt_mac_addr peer_mac;
  4045. A_UINT32 flow_id_flags;
  4046. A_UINT32 dialog_id; /* TWT_DIALOG_ID_UNAVAILABLE is used when TWT session is not initiated by host */
  4047. A_UINT32 wake_dura_us;
  4048. A_UINT32 wake_intvl_us;
  4049. A_UINT32 sp_offset_us;
  4050. } htt_pdev_stats_twt_session_tlv;
  4051. typedef struct {
  4052. htt_tlv_hdr_t tlv_hdr;
  4053. A_UINT32 pdev_id;
  4054. A_UINT32 num_sessions;
  4055. htt_pdev_stats_twt_session_tlv twt_session[1];
  4056. } htt_pdev_stats_twt_sessions_tlv;
  4057. /* STATS_TYPE: HTT_DBG_EXT_STATS_TWT_SESSIONS
  4058. * TLV_TAGS:
  4059. * - HTT_STATS_PDEV_TWT_SESSIONS_TAG
  4060. * - HTT_STATS_PDEV_TWT_SESSION_TAG
  4061. */
  4062. /* NOTE:
  4063. * This structure is for documentation, and cannot be safely used directly.
  4064. * Instead, use the constituent TLV structures to fill/parse.
  4065. */
  4066. typedef struct {
  4067. htt_pdev_stats_twt_sessions_tlv twt_sessions[1];
  4068. } htt_pdev_twt_sessions_stats_t;
  4069. typedef enum {
  4070. /* Global link descriptor queued in REO */
  4071. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_0 = 0,
  4072. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_1 = 1,
  4073. HTT_RX_REO_RESOURCE_GLOBAL_LINK_DESC_COUNT_2 = 2,
  4074. /*Number of queue descriptors of this aging group */
  4075. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC0 = 3,
  4076. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC1 = 4,
  4077. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC2 = 5,
  4078. HTT_RX_REO_RESOURCE_BUFFERS_USED_AC3 = 6,
  4079. /* Total number of MSDUs buffered in AC */
  4080. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC0 = 7,
  4081. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC1 = 8,
  4082. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC2 = 9,
  4083. HTT_RX_REO_RESOURCE_AGING_NUM_QUEUES_AC3 = 10,
  4084. HTT_RX_REO_RESOURCE_STATS_MAX = 16
  4085. } htt_rx_reo_resource_sample_id_enum;
  4086. typedef struct {
  4087. htt_tlv_hdr_t tlv_hdr;
  4088. /* Variable based on the Number of records. HTT_RX_REO_RESOURCE_STATS_MAX */
  4089. /* htt_rx_reo_debug_sample_id_enum */
  4090. A_UINT32 sample_id;
  4091. /* Max value of all samples */
  4092. A_UINT32 total_max;
  4093. /* Average value of total samples */
  4094. A_UINT32 total_avg;
  4095. /* Num of samples including both zeros and non zeros ones*/
  4096. A_UINT32 total_sample;
  4097. /* Average value of all non zeros samples */
  4098. A_UINT32 non_zeros_avg;
  4099. /* Num of non zeros samples */
  4100. A_UINT32 non_zeros_sample;
  4101. /* Max value of last N non zero samples (N = last_non_zeros_sample) */
  4102. A_UINT32 last_non_zeros_max;
  4103. /* Min value of last N non zero samples (N = last_non_zeros_sample) */
  4104. A_UINT32 last_non_zeros_min;
  4105. /* Average value of last N non zero samples (N = last_non_zeros_sample) */
  4106. A_UINT32 last_non_zeros_avg;
  4107. /* Num of last non zero samples */
  4108. A_UINT32 last_non_zeros_sample;
  4109. } htt_rx_reo_resource_stats_tlv_v;
  4110. /* STATS_TYPE: HTT_DBG_EXT_STATS_REO_RESOURCE_STATS
  4111. * TLV_TAGS:
  4112. * - HTT_STATS_RX_REO_RESOURCE_STATS_TAG
  4113. */
  4114. /* NOTE:
  4115. * This structure is for documentation, and cannot be safely used directly.
  4116. * Instead, use the constituent TLV structures to fill/parse.
  4117. */
  4118. typedef struct {
  4119. htt_rx_reo_resource_stats_tlv_v reo_resource_stats;
  4120. } htt_soc_reo_resource_stats_t;
  4121. /* == TX SOUNDING STATS == */
  4122. /* config_param0 */
  4123. #define HTT_DBG_EXT_STATS_SET_VDEV_MASK(_var) ((_var << 1) | 0x1)
  4124. #define HTT_DBG_EXT_STATS_GET_VDEV_ID_FROM_VDEV_MASK(_var) ((_var >> 1) & 0xFF)
  4125. #define HTT_DBG_EXT_STATS_IS_VDEV_ID_SET(_var) ((_var) & 0x1)
  4126. typedef enum {
  4127. /* Implicit beamforming stats */
  4128. HTT_IMPLICIT_TXBF_STEER_STATS = 0,
  4129. /* Single user short inter frame sequence steer stats */
  4130. HTT_EXPLICIT_TXBF_SU_SIFS_STEER_STATS = 1,
  4131. /* Single user random back off steer stats */
  4132. HTT_EXPLICIT_TXBF_SU_RBO_STEER_STATS = 2,
  4133. /* Multi user short inter frame sequence steer stats */
  4134. HTT_EXPLICIT_TXBF_MU_SIFS_STEER_STATS = 3,
  4135. /* Multi user random back off steer stats */
  4136. HTT_EXPLICIT_TXBF_MU_RBO_STEER_STATS = 4,
  4137. /* For backward compatability new modes cannot be added */
  4138. HTT_TXBF_MAX_NUM_OF_MODES = 5
  4139. } htt_txbf_sound_steer_modes;
  4140. typedef enum {
  4141. HTT_TX_AC_SOUNDING_MODE = 0,
  4142. HTT_TX_AX_SOUNDING_MODE = 1,
  4143. } htt_stats_sounding_tx_mode;
  4144. typedef struct {
  4145. htt_tlv_hdr_t tlv_hdr;
  4146. A_UINT32 tx_sounding_mode; /* HTT_TX_XX_SOUNDING_MODE */
  4147. /* Counts number of soundings for all steering modes in each bw */
  4148. A_UINT32 cbf_20[HTT_TXBF_MAX_NUM_OF_MODES];
  4149. A_UINT32 cbf_40[HTT_TXBF_MAX_NUM_OF_MODES];
  4150. A_UINT32 cbf_80[HTT_TXBF_MAX_NUM_OF_MODES];
  4151. A_UINT32 cbf_160[HTT_TXBF_MAX_NUM_OF_MODES];
  4152. /*
  4153. * The sounding array is a 2-D array stored as an 1-D array of
  4154. * A_UINT32. The stats for a particular user/bw combination is
  4155. * referenced with the following:
  4156. *
  4157. * sounding[(user* max_bw) + bw]
  4158. *
  4159. * ... where max_bw == 4 for 160mhz
  4160. */
  4161. A_UINT32 sounding[HTT_TX_NUM_OF_SOUNDING_STATS_WORDS];
  4162. } htt_tx_sounding_stats_tlv;
  4163. /* STATS_TYPE : HTT_DBG_EXT_STATS_TX_SOUNDING_INFO
  4164. * TLV_TAGS:
  4165. * - HTT_STATS_TX_SOUNDING_STATS_TAG
  4166. */
  4167. /* NOTE:
  4168. * This structure is for documentation, and cannot be safely used directly.
  4169. * Instead, use the constituent TLV structures to fill/parse.
  4170. */
  4171. typedef struct {
  4172. htt_tx_sounding_stats_tlv sounding_tlv;
  4173. } htt_tx_sounding_stats_t;
  4174. typedef struct {
  4175. htt_tlv_hdr_t tlv_hdr;
  4176. A_UINT32 num_obss_tx_ppdu_success;
  4177. A_UINT32 num_obss_tx_ppdu_failure;
  4178. /* num_sr_tx_transmissions:
  4179. * Counter of TX done by aborting other BSS RX with spatial reuse
  4180. * (for cases where rx RSSI from other BSS is below the packet-detection
  4181. * threshold for doing spatial reuse)
  4182. */
  4183. union {
  4184. A_UINT32 num_sr_tx_transmissions; /* CORRECTED - use this one */
  4185. A_UINT32 num_sr_tx_tranmissions; /* DEPRECATED - has typo in name */
  4186. };
  4187. union {
  4188. /*
  4189. * Count the number of times the RSSI from an other-BSS signal
  4190. * is below the spatial reuse power threshold, thus providing an
  4191. * opportunity for spatial reuse since OBSS interference will be
  4192. * inconsequential.
  4193. */
  4194. A_UINT32 num_spatial_reuse_opportunities;
  4195. /* DEPRECATED: num_sr_rx_ge_pd_rssi_thr
  4196. * This old name has been deprecated because it does not
  4197. * clearly and accurately reflect the information stored within
  4198. * this field.
  4199. * Use the new name (num_spatial_reuse_opportunities) instead of
  4200. * the deprecated old name (num_sr_rx_ge_pd_rssi_thr).
  4201. */
  4202. A_UINT32 num_sr_rx_ge_pd_rssi_thr;
  4203. };
  4204. /*
  4205. * Count of number of times OBSS frames were aborted and non-SRG
  4206. * opportunities were created. Non-SRG opportunities are created when
  4207. * incoming OBSS RSSI is lesser than the global configured non-SRG RSSI
  4208. * threshold and non-SRG OBSS color / non-SRG OBSS BSSID registers
  4209. * allow non-SRG TX.
  4210. */
  4211. A_UINT32 num_non_srg_opportunities;
  4212. /*
  4213. * Count of number of times TX PPDU were transmitted using non-SRG
  4214. * opportunities created. Incoming OBSS frame RSSI is compared with per
  4215. * PPDU non-SRG RSSI threshold configured in each PPDU. If incoming OBSS
  4216. * RSSI < non-SRG RSSI threshold configured in each PPDU, then non-SRG
  4217. * tranmission happens.
  4218. */
  4219. A_UINT32 num_non_srg_ppdu_tried;
  4220. /*
  4221. * Count of number of times non-SRG based TX transmissions were successful
  4222. */
  4223. A_UINT32 num_non_srg_ppdu_success;
  4224. /*
  4225. * Count of number of times OBSS frames were aborted and SRG opportunities
  4226. * were created. Srg opportunities are created when incoming OBSS RSSI
  4227. * is less than the global configured SRG RSSI threshold and SRC OBSS
  4228. * color / SRG OBSS BSSID / SRG partial bssid / SRG BSS color bitmap
  4229. * registers allow SRG TX.
  4230. */
  4231. A_UINT32 num_srg_opportunities;
  4232. /*
  4233. * Count of number of times TX PPDU were transmitted using SRG
  4234. * opportunities created.
  4235. * Incoming OBSS frame RSSI is compared with per PPDU SRG RSSI
  4236. * threshold configured in each PPDU.
  4237. * If incoming OBSS RSSI < SRG RSSI threshold configured in each PPDU,
  4238. * then SRG tranmission happens.
  4239. */
  4240. A_UINT32 num_srg_ppdu_tried;
  4241. /*
  4242. * Count of number of times SRG based TX transmissions were successful
  4243. */
  4244. A_UINT32 num_srg_ppdu_success;
  4245. /*
  4246. * Count of number of times PSR opportunities were created by aborting
  4247. * OBSS UL OFDMA HE-TB PPDU frame. HE-TB ppdu frames are aborted if the
  4248. * spatial reuse info in the OBSS trigger common field is set to allow PSR
  4249. * based spatial reuse.
  4250. */
  4251. A_UINT32 num_psr_opportunities;
  4252. /*
  4253. * Count of number of times TX PPDU were transmitted using PSR
  4254. * opportunities created.
  4255. */
  4256. A_UINT32 num_psr_ppdu_tried;
  4257. /*
  4258. * Count of number of times PSR based TX transmissions were successful.
  4259. */
  4260. A_UINT32 num_psr_ppdu_success;
  4261. } htt_pdev_obss_pd_stats_tlv;
  4262. /* NOTE:
  4263. * This structure is for documentation, and cannot be safely used directly.
  4264. * Instead, use the constituent TLV structures to fill/parse.
  4265. */
  4266. typedef struct {
  4267. htt_pdev_obss_pd_stats_tlv obss_pd_stat;
  4268. } htt_pdev_obss_pd_stats_t;
  4269. typedef struct {
  4270. htt_tlv_hdr_t tlv_hdr;
  4271. A_UINT32 pdev_id;
  4272. A_UINT32 current_head_idx;
  4273. A_UINT32 current_tail_idx;
  4274. A_UINT32 num_htt_msgs_sent;
  4275. /*
  4276. * Time in milliseconds for which the ring has been in
  4277. * its current backpressure condition
  4278. */
  4279. A_UINT32 backpressure_time_ms;
  4280. /* backpressure_hist - histogram showing how many times different degrees
  4281. * of backpressure duration occurred:
  4282. * Index 0 indicates the number of times ring was
  4283. * continously in backpressure state for 100 - 200ms.
  4284. * Index 1 indicates the number of times ring was
  4285. * continously in backpressure state for 200 - 300ms.
  4286. * Index 2 indicates the number of times ring was
  4287. * continously in backpressure state for 300 - 400ms.
  4288. * Index 3 indicates the number of times ring was
  4289. * continously in backpressure state for 400 - 500ms.
  4290. * Index 4 indicates the number of times ring was
  4291. * continously in backpressure state beyond 500ms.
  4292. */
  4293. A_UINT32 backpressure_hist[5];
  4294. } htt_ring_backpressure_stats_tlv;
  4295. /* STATS_TYPE : HTT_STATS_RING_BACKPRESSURE_STATS_INFO
  4296. * TLV_TAGS:
  4297. * - HTT_STATS_RING_BACKPRESSURE_STATS_TAG
  4298. */
  4299. /* NOTE:
  4300. * This structure is for documentation, and cannot be safely used directly.
  4301. * Instead, use the constituent TLV structures to fill/parse.
  4302. */
  4303. typedef struct {
  4304. htt_sring_cmn_tlv cmn_tlv;
  4305. struct {
  4306. htt_stats_string_tlv sring_str_tlv;
  4307. htt_ring_backpressure_stats_tlv backpressure_stats_tlv;
  4308. } r[1]; /* variable-length array */
  4309. } htt_ring_backpressure_stats_t;
  4310. #define HTT_LATENCY_PROFILE_MAX_HIST 3
  4311. #define HTT_STATS_MAX_PROF_STATS_NAME_LEN 32
  4312. #define HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST 3
  4313. typedef struct {
  4314. htt_tlv_hdr_t tlv_hdr;
  4315. /* print_header:
  4316. * This field suggests whether the host should print a header when
  4317. * displaying the TLV (because this is the first latency_prof_stats
  4318. * TLV within a series), or if only the TLV contents should be displayed
  4319. * without a header (because this is not the first TLV within the series).
  4320. */
  4321. A_UINT32 print_header;
  4322. A_UINT8 latency_prof_name[HTT_STATS_MAX_PROF_STATS_NAME_LEN];
  4323. A_UINT32 cnt; /* number of data values included in the tot sum */
  4324. A_UINT32 min; /* time in us */
  4325. A_UINT32 max; /* time in us */
  4326. A_UINT32 last;
  4327. A_UINT32 tot; /* time in us */
  4328. A_UINT32 avg; /* time in us */
  4329. /* hist_intvl:
  4330. * Histogram interval, i.e. the latency range covered by each
  4331. * bin of the histogram, in microsecond units.
  4332. * hist[0] counts how many latencies were between 0 to hist_intvl
  4333. * hist[1] counts how many latencies were between hist_intvl to 2*hist_intvl
  4334. * hist[2] counts how many latencies were more than 2*hist_intvl
  4335. */
  4336. A_UINT32 hist_intvl;
  4337. A_UINT32 hist[HTT_LATENCY_PROFILE_MAX_HIST];
  4338. A_UINT32 page_fault_max; /* max page faults in any 1 sampling window */
  4339. A_UINT32 page_fault_total; /* summed over all sampling windows */
  4340. /* ignored_latency_count:
  4341. * ignore some of profile latency to avoid avg skewing
  4342. */
  4343. A_UINT32 ignored_latency_count;
  4344. /* interrupts_max: max interrupts within any single sampling window */
  4345. A_UINT32 interrupts_max;
  4346. /* interrupts_hist: histogram of interrupt rate
  4347. * bin0 contains the number of sampling windows that had 0 interrupts,
  4348. * bin1 contains the number of sampling windows that had 1-4 interrupts,
  4349. * bin2 contains the number of sampling windows that had > 4 interrupts
  4350. */
  4351. A_UINT32 interrupts_hist[HTT_INTERRUPTS_LATENCY_PROFILE_MAX_HIST];
  4352. } htt_latency_prof_stats_tlv;
  4353. typedef struct {
  4354. htt_tlv_hdr_t tlv_hdr;
  4355. /* duration:
  4356. * Time period over which counts were gathered, units = microseconds.
  4357. */
  4358. A_UINT32 duration;
  4359. A_UINT32 tx_msdu_cnt;
  4360. A_UINT32 tx_mpdu_cnt;
  4361. A_UINT32 tx_ppdu_cnt;
  4362. A_UINT32 rx_msdu_cnt;
  4363. A_UINT32 rx_mpdu_cnt;
  4364. } htt_latency_prof_ctx_tlv;
  4365. typedef struct {
  4366. htt_tlv_hdr_t tlv_hdr;
  4367. A_UINT32 prof_enable_cnt; /* count of enabled profiles */
  4368. } htt_latency_prof_cnt_tlv;
  4369. /* STATS_TYPE : HTT_DBG_EXT_STATS_LATENCY_PROF_STATS
  4370. * TLV_TAGS:
  4371. * HTT_STATS_LATENCY_PROF_STATS_TAG / htt_latency_prof_stats_tlv
  4372. * HTT_STATS_LATENCY_CTX_TAG / htt_latency_prof_ctx_tlv
  4373. * HTT_STATS_LATENCY_CNT_TAG / htt_latency_prof_cnt_tlv
  4374. */
  4375. /* NOTE:
  4376. * This structure is for documentation, and cannot be safely used directly.
  4377. * Instead, use the constituent TLV structures to fill/parse.
  4378. */
  4379. typedef struct {
  4380. htt_latency_prof_stats_tlv latency_prof_stat;
  4381. htt_latency_prof_ctx_tlv latency_ctx_stat;
  4382. htt_latency_prof_cnt_tlv latency_cnt_stat;
  4383. } htt_soc_latency_stats_t;
  4384. #define HTT_RX_MAX_PEAK_OCCUPANCY_INDEX 10
  4385. #define HTT_RX_MAX_CURRENT_OCCUPANCY_INDEX 10
  4386. #define HTT_RX_SQUARE_INDEX 6
  4387. #define HTT_RX_MAX_PEAK_SEARCH_INDEX 4
  4388. #define HTT_RX_MAX_PENDING_SEARCH_INDEX 4
  4389. /* STATS_TYPE : HTT_DBG_EXT_RX_FSE_STATS
  4390. * TLV_TAGS:
  4391. * - HTT_STATS_RX_FSE_STATS_TAG
  4392. */
  4393. typedef struct {
  4394. htt_tlv_hdr_t tlv_hdr;
  4395. /*
  4396. * Number of times host requested for fse enable/disable
  4397. */
  4398. A_UINT32 fse_enable_cnt;
  4399. A_UINT32 fse_disable_cnt;
  4400. /*
  4401. * Number of times host requested for fse cache invalidation
  4402. * individual entries or full cache
  4403. */
  4404. A_UINT32 fse_cache_invalidate_entry_cnt;
  4405. A_UINT32 fse_full_cache_invalidate_cnt;
  4406. /*
  4407. * Cache hits count will increase if there is a matching flow in the cache
  4408. * There is no register for cache miss but the number of cache misses can
  4409. * be calculated as
  4410. * cache miss = (num_searches - cache_hits)
  4411. * Thus, there is no need to have a separate variable for cache misses.
  4412. * Num searches is flow search times done in the cache.
  4413. */
  4414. A_UINT32 fse_num_cache_hits_cnt;
  4415. A_UINT32 fse_num_searches_cnt;
  4416. /**
  4417. * Cache Occupancy holds 2 types of values: Peak and Current.
  4418. * 10 bins are used to keep track of peak occupancy.
  4419. * 8 of these bins represent ranges of values, while the first and last
  4420. * bins represent the extreme cases of the cache being completely empty
  4421. * or completely full.
  4422. * For the non-extreme bins, the number of cache occupancy values per
  4423. * bin is the maximum cache occupancy (128), divided by the number of
  4424. * non-extreme bins (8), so 128/8 = 16 values per bin.
  4425. * The range of values for each histogram bins is specified below:
  4426. * Bin0 = Counter increments when cache occupancy is empty
  4427. * Bin1 = Counter increments when cache occupancy is within [1 to 16]
  4428. * Bin2 = Counter increments when cache occupancy is within [17 to 32]
  4429. * Bin3 = Counter increments when cache occupancy is within [33 to 48]
  4430. * Bin4 = Counter increments when cache occupancy is within [49 to 64]
  4431. * Bin5 = Counter increments when cache occupancy is within [65 to 80]
  4432. * Bin6 = Counter increments when cache occupancy is within [81 to 96]
  4433. * Bin7 = Counter increments when cache occupancy is within [97 to 112]
  4434. * Bin8 = Counter increments when cache occupancy is within [113 to 127]
  4435. * Bin9 = Counter increments when cache occupancy is equal to 128
  4436. * The above histogram bin definitions apply to both the peak-occupancy
  4437. * histogram and the current-occupancy histogram.
  4438. *
  4439. * @fse_cache_occupancy_peak_cnt:
  4440. * Array records periodically PEAK cache occupancy values.
  4441. * Peak Occupancy will increment only if it is greater than current
  4442. * occupancy value.
  4443. *
  4444. * @fse_cache_occupancy_curr_cnt:
  4445. * Array records periodically current cache occupancy value.
  4446. * Current Cache occupancy always holds instant snapshot of
  4447. * current number of cache entries.
  4448. **/
  4449. A_UINT32 fse_cache_occupancy_peak_cnt[HTT_RX_MAX_PEAK_OCCUPANCY_INDEX];
  4450. A_UINT32 fse_cache_occupancy_curr_cnt[HTT_RX_MAX_CURRENT_OCCUPANCY_INDEX];
  4451. /*
  4452. * Square stat is sum of squares of cache occupancy to better understand
  4453. * any variation/deviation within each cache set, over a given time-window.
  4454. *
  4455. * Square stat is calculated this way:
  4456. * Square = SUM(Squares of all Occupancy in a Set) / 8
  4457. * The cache has 16-way set associativity, so the occupancy of a
  4458. * set can vary from 0 to 16. There are 8 sets within the cache.
  4459. * Therefore, the minimum possible square value is 0, and the maximum
  4460. * possible square value is (8*16^2) / 8 = 256.
  4461. *
  4462. * 6 bins are used to keep track of square stats:
  4463. * Bin0 = increments when square of current cache occupancy is zero
  4464. * Bin1 = increments when square of current cache occupancy is within
  4465. * [1 to 50]
  4466. * Bin2 = increments when square of current cache occupancy is within
  4467. * [51 to 100]
  4468. * Bin3 = increments when square of current cache occupancy is within
  4469. * [101 to 200]
  4470. * Bin4 = increments when square of current cache occupancy is within
  4471. * [201 to 255]
  4472. * Bin5 = increments when square of current cache occupancy is 256
  4473. */
  4474. A_UINT32 fse_search_stat_square_cnt[HTT_RX_SQUARE_INDEX];
  4475. /**
  4476. * Search stats has 2 types of values: Peak Pending and Number of
  4477. * Search Pending.
  4478. * GSE command ring for FSE can hold maximum of 5 Pending searches
  4479. * at any given time.
  4480. *
  4481. * 4 bins are used to keep track of search stats:
  4482. * Bin0 = Counter increments when there are NO pending searches
  4483. * (For peak, it will be number of pending searches greater
  4484. * than GSE command ring FIFO outstanding requests.
  4485. * For Search Pending, it will be number of pending search
  4486. * inside GSE command ring FIFO.)
  4487. * Bin1 = Counter increments when number of pending searches are within
  4488. * [1 to 2]
  4489. * Bin2 = Counter increments when number of pending searches are within
  4490. * [3 to 4]
  4491. * Bin3 = Counter increments when number of pending searches are
  4492. * greater/equal to [ >= 5]
  4493. */
  4494. A_UINT32 fse_search_stat_peak_cnt[HTT_RX_MAX_PEAK_SEARCH_INDEX];
  4495. A_UINT32 fse_search_stat_search_pending_cnt[HTT_RX_MAX_PENDING_SEARCH_INDEX];
  4496. } htt_rx_fse_stats_tlv;
  4497. /* NOTE:
  4498. * This structure is for documentation, and cannot be safely used directly.
  4499. * Instead, use the constituent TLV structures to fill/parse.
  4500. */
  4501. typedef struct {
  4502. htt_rx_fse_stats_tlv rx_fse_stats;
  4503. } htt_rx_fse_stats_t;
  4504. #define HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS 14
  4505. #define HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS 5 /* 20, 40, 80, 160, 320 */
  4506. typedef struct {
  4507. htt_tlv_hdr_t tlv_hdr;
  4508. /* SU TxBF TX MCS stats */
  4509. A_UINT32 tx_su_txbf_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  4510. /* Implicit BF TX MCS stats */
  4511. A_UINT32 tx_su_ibf_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  4512. /* Open loop TX MCS stats */
  4513. A_UINT32 tx_su_ol_mcs[HTT_TX_TXBF_RATE_STATS_NUM_MCS_COUNTERS];
  4514. /* SU TxBF TX NSS stats */
  4515. A_UINT32 tx_su_txbf_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4516. /* Implicit BF TX NSS stats */
  4517. A_UINT32 tx_su_ibf_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4518. /* Open loop TX NSS stats */
  4519. A_UINT32 tx_su_ol_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4520. /* SU TxBF TX BW stats */
  4521. A_UINT32 tx_su_txbf_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  4522. /* Implicit BF TX BW stats */
  4523. A_UINT32 tx_su_ibf_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  4524. /* Open loop TX BW stats */
  4525. A_UINT32 tx_su_ol_bw[HTT_TX_TXBF_RATE_STATS_NUM_BW_COUNTERS];
  4526. /* Legacy and OFDM TX rate stats */
  4527. A_UINT32 tx_legacy_ofdm_rate[HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS];
  4528. } htt_tx_pdev_txbf_rate_stats_tlv;
  4529. /* NOTE:
  4530. * This structure is for documentation, and cannot be safely used directly.
  4531. * Instead, use the constituent TLV structures to fill/parse.
  4532. */
  4533. typedef struct {
  4534. htt_tx_pdev_txbf_rate_stats_tlv txbf_rate_stats;
  4535. } htt_pdev_txbf_rate_stats_t;
  4536. typedef enum {
  4537. HTT_ULTRIG_QBOOST_TRIGGER = 0,
  4538. HTT_ULTRIG_PSPOLL_TRIGGER,
  4539. HTT_ULTRIG_UAPSD_TRIGGER,
  4540. HTT_ULTRIG_11AX_TRIGGER,
  4541. HTT_ULTRIG_11AX_WILDCARD_TRIGGER,
  4542. HTT_ULTRIG_11AX_UNASSOC_WILDCARD_TRIGGER,
  4543. HTT_STA_UL_OFDMA_NUM_TRIG_TYPE,
  4544. } HTT_STA_UL_OFDMA_RX_TRIG_TYPE;
  4545. typedef enum {
  4546. HTT_11AX_TRIGGER_BASIC_E = 0,
  4547. HTT_11AX_TRIGGER_BRPOLL_E = 1,
  4548. HTT_11AX_TRIGGER_MU_BAR_E = 2,
  4549. HTT_11AX_TRIGGER_MU_RTS_E = 3,
  4550. HTT_11AX_TRIGGER_BUFFER_SIZE_E = 4,
  4551. HTT_11AX_TRIGGER_GCR_MU_BAR_E = 5,
  4552. HTT_11AX_TRIGGER_BQRP_E = 6,
  4553. HTT_11AX_TRIGGER_NDP_FB_REPORT_POLL_E = 7,
  4554. HTT_11AX_TRIGGER_RESERVED_8_E = 8,
  4555. HTT_11AX_TRIGGER_RESERVED_9_E = 9,
  4556. HTT_11AX_TRIGGER_RESERVED_10_E = 10,
  4557. HTT_11AX_TRIGGER_RESERVED_11_E = 11,
  4558. HTT_11AX_TRIGGER_RESERVED_12_E = 12,
  4559. HTT_11AX_TRIGGER_RESERVED_13_E = 13,
  4560. HTT_11AX_TRIGGER_RESERVED_14_E = 14,
  4561. HTT_11AX_TRIGGER_RESERVED_15_E = 15,
  4562. HTT_STA_UL_OFDMA_NUM_11AX_TRIG_TYPE,
  4563. } HTT_STA_UL_OFDMA_11AX_TRIG_TYPE;
  4564. /* UL RESP Queues 0 - HIPRI, 1 - LOPRI & 2 - BSR */
  4565. #define HTT_STA_UL_OFDMA_NUM_UL_QUEUES 3
  4566. /* Actual resp type sent by STA for trigger
  4567. * 0 - HE TB PPDU, 1 - NULL Delimiter */
  4568. #define HTT_STA_UL_OFDMA_NUM_RESP_END_TYPE 2
  4569. /* Counter for MCS 0-13 */
  4570. #define HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS 14
  4571. /* Counters BW 20,40,80,160,320 */
  4572. #define HTT_STA_UL_OFDMA_NUM_BW_COUNTERS 5
  4573. /* STATS_TYPE : HTT_DBG_EXT_STA_11AX_UL_STATS
  4574. * TLV_TAGS:
  4575. * - HTT_STATS_STA_UL_OFDMA_STATS_TAG
  4576. */
  4577. typedef struct {
  4578. htt_tlv_hdr_t tlv_hdr;
  4579. A_UINT32 pdev_id;
  4580. /* Trigger Type reported by HWSCH on RX reception
  4581. * Each index populate enum HTT_STA_UL_OFDMA_RX_TRIG_TYPE */
  4582. A_UINT32 rx_trigger_type[HTT_STA_UL_OFDMA_NUM_TRIG_TYPE];
  4583. /* 11AX Trigger Type on RX reception
  4584. * Each index populate enum HTT_STA_UL_OFDMA_11AX_TRIG_TYPE */
  4585. A_UINT32 ax_trigger_type[HTT_STA_UL_OFDMA_NUM_11AX_TRIG_TYPE];
  4586. /* Num data PPDUs/Delims responded to trigs. per HWQ for UL RESP */
  4587. A_UINT32 num_data_ppdu_responded_per_hwq[HTT_STA_UL_OFDMA_NUM_UL_QUEUES];
  4588. A_UINT32 num_null_delimiters_responded_per_hwq[HTT_STA_UL_OFDMA_NUM_UL_QUEUES];
  4589. /* Overall UL STA RESP Status 0 - HE TB PPDU, 1 - NULL Delimiter
  4590. * Super set of num_data_ppdu_responded_per_hwq, num_null_delimiters_responded_per_hwq */
  4591. A_UINT32 num_total_trig_responses[HTT_STA_UL_OFDMA_NUM_RESP_END_TYPE];
  4592. /* Time interval between current time ms and last successful trigger RX
  4593. * 0xFFFFFFFF denotes no trig received / timestamp roll back */
  4594. A_UINT32 last_trig_rx_time_delta_ms;
  4595. /* Rate Statistics for UL OFDMA
  4596. * UL TB PPDU TX MCS, NSS, GI, BW from STA HWQ */
  4597. A_UINT32 ul_ofdma_tx_mcs[HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS];
  4598. A_UINT32 ul_ofdma_tx_nss[HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS];
  4599. A_UINT32 ul_ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS][HTT_STA_UL_OFDMA_NUM_MCS_COUNTERS];
  4600. A_UINT32 ul_ofdma_tx_ldpc;
  4601. A_UINT32 ul_ofdma_tx_bw[HTT_STA_UL_OFDMA_NUM_BW_COUNTERS];
  4602. /* Trig based PPDU TX/ RBO based PPDU TX Count */
  4603. A_UINT32 trig_based_ppdu_tx;
  4604. A_UINT32 rbo_based_ppdu_tx;
  4605. /* Switch MU EDCA to SU EDCA Count */
  4606. A_UINT32 mu_edca_to_su_edca_switch_count;
  4607. /* Num MU EDCA applied Count */
  4608. A_UINT32 num_mu_edca_param_apply_count;
  4609. /* Current MU EDCA Parameters for WMM ACs
  4610. * Mode - 0 - SU EDCA, 1- MU EDCA */
  4611. A_UINT32 current_edca_hwq_mode[HTT_NUM_AC_WMM];
  4612. /* Contention Window minimum. Range: 1 - 10 */
  4613. A_UINT32 current_cw_min[HTT_NUM_AC_WMM];
  4614. /* Contention Window maximum. Range: 1 - 10 */
  4615. A_UINT32 current_cw_max[HTT_NUM_AC_WMM];
  4616. /* AIFS value - 0 -255 */
  4617. A_UINT32 current_aifs[HTT_NUM_AC_WMM];
  4618. } htt_sta_ul_ofdma_stats_tlv;
  4619. /* NOTE:
  4620. * This structure is for documentation, and cannot be safely used directly.
  4621. * Instead, use the constituent TLV structures to fill/parse.
  4622. */
  4623. typedef struct {
  4624. htt_sta_ul_ofdma_stats_tlv ul_ofdma_sta_stats;
  4625. } htt_sta_11ax_ul_stats_t;
  4626. typedef struct {
  4627. htt_tlv_hdr_t tlv_hdr;
  4628. /* No of Fine Timing Measurement frames transmitted successfully */
  4629. A_UINT32 tx_ftm_suc;
  4630. /* No of Fine Timing Measurement frames transmitted successfully after retry */
  4631. A_UINT32 tx_ftm_suc_retry;
  4632. /* No of Fine Timing Measurement frames not transmitted successfully */
  4633. A_UINT32 tx_ftm_fail;
  4634. /* No of Fine Timing Measurement Request frames received, including initial, non-initial, and duplicates */
  4635. A_UINT32 rx_ftmr_cnt;
  4636. /* No of duplicate Fine Timing Measurement Request frames received, including both initial and non-initial */
  4637. A_UINT32 rx_ftmr_dup_cnt;
  4638. /* No of initial Fine Timing Measurement Request frames received */
  4639. A_UINT32 rx_iftmr_cnt;
  4640. /* No of duplicate initial Fine Timing Measurement Request frames received */
  4641. A_UINT32 rx_iftmr_dup_cnt;
  4642. } htt_vdev_rtt_resp_stats_tlv;
  4643. typedef struct {
  4644. htt_vdev_rtt_resp_stats_tlv vdev_rtt_resp_stats;
  4645. } htt_vdev_rtt_resp_stats_t;
  4646. /* STATS_TYPE : HTT_DBG_EXT_PKTLOG_AND_HTT_RING_STATS
  4647. * TLV_TAGS:
  4648. * - HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG
  4649. */
  4650. /* NOTE:
  4651. * This structure is for documentation, and cannot be safely used directly.
  4652. * Instead, use the constituent TLV structures to fill/parse.
  4653. */
  4654. typedef struct {
  4655. htt_tlv_hdr_t tlv_hdr;
  4656. /* No of pktlog payloads that were dropped in htt_ppdu_stats path */
  4657. A_UINT32 pktlog_lite_drop_cnt;
  4658. /* No of pktlog payloads that were dropped in TQM path */
  4659. A_UINT32 pktlog_tqm_drop_cnt;
  4660. /* No of pktlog ppdu stats payloads that were dropped */
  4661. A_UINT32 pktlog_ppdu_stats_drop_cnt;
  4662. /* No of pktlog ppdu ctrl payloads that were dropped */
  4663. A_UINT32 pktlog_ppdu_ctrl_drop_cnt;
  4664. /* No of pktlog sw events payloads that were dropped */
  4665. A_UINT32 pktlog_sw_events_drop_cnt;
  4666. } htt_pktlog_and_htt_ring_stats_tlv;
  4667. #define HTT_DLPAGER_STATS_MAX_HIST 10
  4668. #define HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M 0x000000FF
  4669. #define HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S 0
  4670. #define HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M 0x0000FF00
  4671. #define HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S 8
  4672. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_M 0x0000FFFF
  4673. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_S 0
  4674. #define HTT_DLPAGER_TOTAL_FREE_PAGES_M 0xFFFF0000
  4675. #define HTT_DLPAGER_TOTAL_FREE_PAGES_S 16
  4676. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M 0x0000FFFF
  4677. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S 0
  4678. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M 0xFFFF0000
  4679. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S 16
  4680. #define HTT_DLPAGER_ASYNC_LOCK_PAGE_COUNT_GET(_var) \
  4681. (((_var) & HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M) >> \
  4682. HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S)
  4683. #define HTT_DLPAGER_ASYNC_LOCK_PAGE_COUNT_SET(_var, _val) \
  4684. do { \
  4685. HTT_CHECK_SET_VAL(HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT, _val); \
  4686. ((_var) &= ~(HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_M));\
  4687. ((_var) |= ((_val) << HTT_DLPAGER_ASYNC_LOCKED_PAGE_COUNT_S)); \
  4688. } while (0)
  4689. #define HTT_DLPAGER_SYNC_LOCK_PAGE_COUNT_GET(_var) \
  4690. (((_var) & HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M) >> \
  4691. HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S)
  4692. #define HTT_DLPAGER_SYNC_LOCK_PAGE_COUNT_SET(_var, _val) \
  4693. do { \
  4694. HTT_CHECK_SET_VAL(HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT, _val); \
  4695. ((_var) &= ~(HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_M));\
  4696. ((_var) |= ((_val) << HTT_DLPAGER_SYNC_LOCKED_PAGE_COUNT_S)); \
  4697. } while (0)
  4698. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_GET(_var) \
  4699. (((_var) & HTT_DLPAGER_TOTAL_LOCKED_PAGES_M) >> \
  4700. HTT_DLPAGER_TOTAL_LOCKED_PAGES_S)
  4701. #define HTT_DLPAGER_TOTAL_LOCKED_PAGES_SET(_var, _val) \
  4702. do { \
  4703. HTT_CHECK_SET_VAL(HTT_DLPAGER_TOTAL_LOCKED_PAGES, _val); \
  4704. ((_var) &= ~(HTT_DLPAGER_TOTAL_LOCKED_PAGES_M)); \
  4705. ((_var) |= ((_val) << HTT_DLPAGER_TOTAL_LOCKED_PAGES_S)); \
  4706. } while (0)
  4707. #define HTT_DLPAGER_TOTAL_FREE_PAGES_GET(_var) \
  4708. (((_var) & HTT_DLPAGER_TOTAL_FREE_PAGES_M) >> \
  4709. HTT_DLPAGER_TOTAL_FREE_PAGES_S)
  4710. #define HTT_DLPAGER_TOTAL_FREE_PAGES_SET(_var, _val) \
  4711. do { \
  4712. HTT_CHECK_SET_VAL(HTT_DLPAGER_TOTAL_FREE_PAGES, _val); \
  4713. ((_var) &= ~(HTT_DLPAGER_TOTAL_FREE_PAGES_M)); \
  4714. ((_var) |= ((_val) << HTT_DLPAGER_TOTAL_FREE_PAGES_S)); \
  4715. } while (0)
  4716. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_GET(_var) \
  4717. (((_var) & HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M) >> \
  4718. HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S)
  4719. #define HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_SET(_var, _val) \
  4720. do { \
  4721. HTT_CHECK_SET_VAL(HTT_DLPAGER_LAST_LOCKED_PAGE_IDX, _val); \
  4722. ((_var) &= ~(HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_M)); \
  4723. ((_var) |= ((_val) << HTT_DLPAGER_LAST_LOCKED_PAGE_IDX_S)); \
  4724. } while (0)
  4725. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_GET(_var) \
  4726. (((_var) & HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M) >> \
  4727. HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S)
  4728. #define HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_SET(_var, _val) \
  4729. do { \
  4730. HTT_CHECK_SET_VAL(HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX, _val); \
  4731. ((_var) &= ~(HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_M)); \
  4732. ((_var) |= ((_val) << HTT_DLPAGER_LAST_UNLOCKED_PAGE_IDX_S)); \
  4733. } while (0)
  4734. enum {
  4735. HTT_STATS_PAGE_LOCKED = 0,
  4736. HTT_STATS_PAGE_UNLOCKED = 1,
  4737. HTT_STATS_NUM_PAGE_LOCK_STATES
  4738. };
  4739. /* dlPagerStats structure
  4740. * Number of lock/unlock pages with last 10 lock/unlock occurrences are recorded */
  4741. typedef struct{
  4742. /* msg_dword_1 bitfields:
  4743. * async_lock : 8,
  4744. * sync_lock : 8,
  4745. * reserved : 16;
  4746. */
  4747. A_UINT32 msg_dword_1;
  4748. /* mst_dword_2 bitfields:
  4749. * total_locked_pages : 16,
  4750. * total_free_pages : 16;
  4751. */
  4752. A_UINT32 msg_dword_2;
  4753. /* msg_dword_3 bitfields:
  4754. * last_locked_page_idx : 16,
  4755. * last_unlocked_page_idx : 16;
  4756. */
  4757. A_UINT32 msg_dword_3;
  4758. struct {
  4759. A_UINT32 page_num;
  4760. A_UINT32 num_of_pages;
  4761. /* timestamp is in microsecond units, from SoC timer clock */
  4762. A_UINT32 timestamp_lsbs;
  4763. A_UINT32 timestamp_msbs;
  4764. } last_pages_info[HTT_STATS_NUM_PAGE_LOCK_STATES][HTT_DLPAGER_STATS_MAX_HIST];
  4765. } htt_dl_pager_stats_tlv;
  4766. /* NOTE:
  4767. * This structure is for documentation, and cannot be safely used directly.
  4768. * Instead, use the constituent TLV structures to fill/parse.
  4769. * STATS_TYPE : HTT_DBG_EXT_STATS_DLPAGER_STATS
  4770. * TLV_TAGS:
  4771. * - HTT_STATS_DLPAGER_STATS_TAG
  4772. */
  4773. typedef struct {
  4774. htt_tlv_hdr_t tlv_hdr;
  4775. htt_dl_pager_stats_tlv dl_pager_stats;
  4776. } htt_dlpager_stats_t;
  4777. /*======= PHY STATS ====================*/
  4778. /*
  4779. * STATS TYPE : HTT_DBG_EXT_PHY_COUNTERS_AND_PHY_STATS
  4780. * TLV_TAGS:
  4781. * - HTT_STATS_PHY_COUNTERS_TAG
  4782. * - HTT_STATS_PHY_STATS_TAG
  4783. */
  4784. #define HTT_MAX_RX_PKT_CNT 8
  4785. #define HTT_MAX_RX_PKT_CRC_PASS_CNT 8
  4786. #define HTT_MAX_PER_BLK_ERR_CNT 20
  4787. #define HTT_MAX_RX_OTA_ERR_CNT 14
  4788. typedef struct {
  4789. htt_tlv_hdr_t tlv_hdr;
  4790. /* number of RXTD OFDMA OTA error counts except power surge and drop */
  4791. A_UINT32 rx_ofdma_timing_err_cnt;
  4792. /* rx_cck_fail_cnt:
  4793. * number of cck error counts due to rx reception failure because of
  4794. * timing error in cck
  4795. */
  4796. A_UINT32 rx_cck_fail_cnt;
  4797. /* number of times tx abort initiated by mac */
  4798. A_UINT32 mactx_abort_cnt;
  4799. /* number of times rx abort initiated by mac */
  4800. A_UINT32 macrx_abort_cnt;
  4801. /* number of times tx abort initiated by phy */
  4802. A_UINT32 phytx_abort_cnt;
  4803. /* number of times rx abort initiated by phy */
  4804. A_UINT32 phyrx_abort_cnt;
  4805. /* number of rx defered count initiated by phy */
  4806. A_UINT32 phyrx_defer_abort_cnt;
  4807. /* number of sizing events generated at LSTF */
  4808. A_UINT32 rx_gain_adj_lstf_event_cnt; /* a.k.a sizing1 */
  4809. /* number of sizing events generated at non-legacy LTF */
  4810. A_UINT32 rx_gain_adj_non_legacy_cnt; /* a.k.a sizing2 */
  4811. /* rx_pkt_cnt -
  4812. * Received EOP (end-of-packet) count per packet type;
  4813. * [0] = 11a; [1] = 11b; [2] = 11n; [3] = 11ac; [4] = 11ax; [5] = GF
  4814. * [6-7]=RSVD
  4815. */
  4816. A_UINT32 rx_pkt_cnt[HTT_MAX_RX_PKT_CNT];
  4817. /* rx_pkt_crc_pass_cnt -
  4818. * Received EOP (end-of-packet) count per packet type;
  4819. * [0] = 11a; [1] = 11b; [2] = 11n; [3] = 11ac; [4] = 11ax; [5] = GF
  4820. * [6-7]=RSVD
  4821. */
  4822. A_UINT32 rx_pkt_crc_pass_cnt[HTT_MAX_RX_PKT_CRC_PASS_CNT];
  4823. /* per_blk_err_cnt -
  4824. * Error count per error source;
  4825. * [0] = unknown; [1] = LSIG; [2] = HTSIG; [3] = VHTSIG; [4] = HESIG;
  4826. * [5] = RXTD_OTA; [6] = RXTD_FATAL; [7] = DEMF; [8] = ROBE;
  4827. * [9] = PMI; [10] = TXFD; [11] = TXTD; [12] = PHYRF
  4828. * [13-19]=RSVD
  4829. */
  4830. A_UINT32 per_blk_err_cnt[HTT_MAX_PER_BLK_ERR_CNT];
  4831. /* rx_ota_err_cnt -
  4832. * RXTD OTA (over-the-air) error count per error reason;
  4833. * [0] = voting fail; [1] = weak det fail; [2] = strong sig fail;
  4834. * [3] = cck fail; [4] = power surge; [5] = power drop;
  4835. * [6] = btcf timing timeout error; [7] = btcf packet detect error;
  4836. * [8] = coarse timing timeout error
  4837. * [9-13]=RSVD
  4838. */
  4839. A_UINT32 rx_ota_err_cnt[HTT_MAX_RX_OTA_ERR_CNT];
  4840. } htt_phy_counters_tlv;
  4841. typedef struct {
  4842. htt_tlv_hdr_t tlv_hdr;
  4843. /* per chain hw noise floor values in dBm */
  4844. A_INT32 nf_chain[HTT_STATS_MAX_CHAINS];
  4845. /* number of false radars detected */
  4846. A_UINT32 false_radar_cnt;
  4847. /* number of channel switches happened due to radar detection */
  4848. A_UINT32 radar_cs_cnt;
  4849. /* ani_level -
  4850. * ANI level (noise interference) corresponds to the channel
  4851. * the desense levels range from -5 to 15 in dB units,
  4852. * higher values indicating more noise interference.
  4853. */
  4854. A_INT32 ani_level;
  4855. /* running time in minutes since FW boot */
  4856. A_UINT32 fw_run_time;
  4857. } htt_phy_stats_tlv;
  4858. /* NOTE:
  4859. * This structure is for documentation, and cannot be safely used directly.
  4860. * Instead, use the constituent TLV structures to fill/parse.
  4861. */
  4862. typedef struct {
  4863. htt_phy_counters_tlv phy_counters;
  4864. htt_phy_stats_tlv phy_stats;
  4865. } htt_phy_counters_and_phy_stats_t;
  4866. #endif /* __HTT_STATS_H__ */