htt_stats.h 226 KB

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