dp_stats.c 195 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080
  1. /*
  2. * Copyright (c) 2017-2019 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. #include "qdf_types.h"
  19. #include "dp_peer.h"
  20. #include "dp_types.h"
  21. #include "dp_internal.h"
  22. #include "htt_stats.h"
  23. #include "htt_ppdu_stats.h"
  24. #include "dp_htt.h"
  25. #define DP_MAX_STRING_LEN 500
  26. #define DP_HTT_HW_INTR_NAME_LEN HTT_STATS_MAX_HW_INTR_NAME_LEN
  27. #define DP_HTT_HW_MODULE_NAME_LEN HTT_STATS_MAX_HW_MODULE_NAME_LEN
  28. #define DP_HTT_COUNTER_NAME_LEN HTT_MAX_COUNTER_NAME
  29. #define DP_HTT_LOW_WM_HIT_COUNT_LEN HTT_STATS_LOW_WM_BINS
  30. #define DP_HTT_HIGH_WM_HIT_COUNT_LEN HTT_STATS_HIGH_WM_BINS
  31. #define DP_HTT_TX_MCS_LEN HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS
  32. #define DP_HTT_TX_SU_MCS_LEN HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS
  33. #define DP_HTT_TX_MU_MCS_LEN HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS
  34. #define DP_HTT_TX_NSS_LEN HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS
  35. #define DP_HTT_TX_BW_LEN HTT_TX_PDEV_STATS_NUM_BW_COUNTERS
  36. #define DP_HTT_TX_PREAM_LEN HTT_TX_PDEV_STATS_NUM_PREAMBLE_TYPES
  37. #define DP_HTT_TX_PDEV_GI_LEN HTT_TX_PDEV_STATS_NUM_GI_COUNTERS
  38. #define DP_HTT_TX_DCM_LEN HTT_TX_PDEV_STATS_NUM_DCM_COUNTERS
  39. #define DP_HTT_RX_MCS_LEN HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS
  40. #define DP_HTT_RX_NSS_LEN HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS
  41. #define DP_HTT_RX_DCM_LEN HTT_RX_PDEV_STATS_NUM_DCM_COUNTERS
  42. #define DP_HTT_RX_BW_LEN HTT_RX_PDEV_STATS_NUM_BW_COUNTERS
  43. #define DP_HTT_RX_PREAM_LEN HTT_RX_PDEV_STATS_NUM_PREAMBLE_TYPES
  44. #define DP_HTT_RSSI_CHAIN_LEN HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS
  45. #define DP_HTT_RX_GI_LEN HTT_RX_PDEV_STATS_NUM_GI_COUNTERS
  46. #define DP_HTT_FW_RING_MGMT_SUBTYPE_LEN HTT_STATS_SUBTYPE_MAX
  47. #define DP_HTT_FW_RING_CTRL_SUBTYPE_LEN HTT_STATS_SUBTYPE_MAX
  48. #define DP_HTT_FW_RING_MPDU_ERR_LEN HTT_RX_STATS_RXDMA_MAX_ERR
  49. #define DP_HTT_TID_NAME_LEN MAX_HTT_TID_NAME
  50. #define DP_HTT_PEER_NUM_SS HTT_RX_PEER_STATS_NUM_SPATIAL_STREAMS
  51. #define DP_HTT_PDEV_TX_GI_LEN HTT_TX_PDEV_STATS_NUM_GI_COUNTERS
  52. #define DP_MAX_INT_CONTEXTS_STRING_LENGTH (6 * WLAN_CFG_INT_NUM_CONTEXTS)
  53. #define DP_NSS_LENGTH (6 * SS_COUNT)
  54. #define DP_MU_GROUP_LENGTH (6 * DP_MU_GROUP_SHOW)
  55. #define DP_MU_GROUP_SHOW 16
  56. #define DP_MAX_MCS_STRING_LEN 34
  57. #define DP_RXDMA_ERR_LENGTH (6 * HAL_RXDMA_ERR_MAX)
  58. #define DP_REO_ERR_LENGTH (6 * HAL_REO_ERR_MAX)
  59. #define STATS_PROC_TIMEOUT (HZ / 1000)
  60. #define MCS_VALID 1
  61. #define MCS_INVALID 0
  62. /*
  63. * struct dp_rate_debug
  64. *
  65. * @mcs_type: print string for a given mcs
  66. * @valid: valid mcs rate?
  67. */
  68. struct dp_rate_debug {
  69. char mcs_type[DP_MAX_MCS_STRING_LEN];
  70. uint8_t valid;
  71. };
  72. static const struct dp_rate_debug dp_rate_string[DOT11_MAX][MAX_MCS] = {
  73. {
  74. {"OFDM 48 Mbps", MCS_VALID},
  75. {"OFDM 24 Mbps", MCS_VALID},
  76. {"OFDM 12 Mbps", MCS_VALID},
  77. {"OFDM 6 Mbps ", MCS_VALID},
  78. {"OFDM 54 Mbps", MCS_VALID},
  79. {"OFDM 36 Mbps", MCS_VALID},
  80. {"OFDM 18 Mbps", MCS_VALID},
  81. {"OFDM 9 Mbps ", MCS_VALID},
  82. {"INVALID ", MCS_INVALID},
  83. {"INVALID ", MCS_INVALID},
  84. {"INVALID ", MCS_INVALID},
  85. {"INVALID ", MCS_INVALID},
  86. {"INVALID ", MCS_VALID},
  87. },
  88. {
  89. {"CCK 11 Mbps Long ", MCS_VALID},
  90. {"CCK 5.5 Mbps Long ", MCS_VALID},
  91. {"CCK 2 Mbps Long ", MCS_VALID},
  92. {"CCK 1 Mbps Long ", MCS_VALID},
  93. {"CCK 11 Mbps Short ", MCS_VALID},
  94. {"CCK 5.5 Mbps Short", MCS_VALID},
  95. {"CCK 2 Mbps Short ", MCS_VALID},
  96. {"INVALID ", MCS_INVALID},
  97. {"INVALID ", MCS_INVALID},
  98. {"INVALID ", MCS_INVALID},
  99. {"INVALID ", MCS_INVALID},
  100. {"INVALID ", MCS_INVALID},
  101. {"INVALID ", MCS_VALID},
  102. },
  103. {
  104. {"HT MCS 0 (BPSK 1/2) ", MCS_VALID},
  105. {"HT MCS 1 (QPSK 1/2) ", MCS_VALID},
  106. {"HT MCS 2 (QPSK 3/4) ", MCS_VALID},
  107. {"HT MCS 3 (16-QAM 1/2)", MCS_VALID},
  108. {"HT MCS 4 (16-QAM 3/4)", MCS_VALID},
  109. {"HT MCS 5 (64-QAM 2/3)", MCS_VALID},
  110. {"HT MCS 6 (64-QAM 3/4)", MCS_VALID},
  111. {"HT MCS 7 (64-QAM 5/6)", MCS_VALID},
  112. {"INVALID ", MCS_INVALID},
  113. {"INVALID ", MCS_INVALID},
  114. {"INVALID ", MCS_INVALID},
  115. {"INVALID ", MCS_INVALID},
  116. {"INVALID ", MCS_VALID},
  117. },
  118. {
  119. {"VHT MCS 0 (BPSK 1/2) ", MCS_VALID},
  120. {"VHT MCS 1 (QPSK 1/2) ", MCS_VALID},
  121. {"VHT MCS 2 (QPSK 3/4) ", MCS_VALID},
  122. {"VHT MCS 3 (16-QAM 1/2) ", MCS_VALID},
  123. {"VHT MCS 4 (16-QAM 3/4) ", MCS_VALID},
  124. {"VHT MCS 5 (64-QAM 2/3) ", MCS_VALID},
  125. {"VHT MCS 6 (64-QAM 3/4) ", MCS_VALID},
  126. {"VHT MCS 7 (64-QAM 5/6) ", MCS_VALID},
  127. {"VHT MCS 8 (256-QAM 3/4) ", MCS_VALID},
  128. {"VHT MCS 9 (256-QAM 5/6) ", MCS_VALID},
  129. {"VHT MCS 10 (1024-QAM 3/4)", MCS_VALID},
  130. {"VHT MCS 11 (1024-QAM 5/6)", MCS_VALID},
  131. {"INVALID ", MCS_VALID},
  132. },
  133. {
  134. {"HE MCS 0 (BPSK 1/2) ", MCS_VALID},
  135. {"HE MCS 1 (QPSK 1/2) ", MCS_VALID},
  136. {"HE MCS 2 (QPSK 3/4) ", MCS_VALID},
  137. {"HE MCS 3 (16-QAM 1/2) ", MCS_VALID},
  138. {"HE MCS 4 (16-QAM 3/4) ", MCS_VALID},
  139. {"HE MCS 5 (64-QAM 2/3) ", MCS_VALID},
  140. {"HE MCS 6 (64-QAM 3/4) ", MCS_VALID},
  141. {"HE MCS 7 (64-QAM 5/6) ", MCS_VALID},
  142. {"HE MCS 8 (256-QAM 3/4) ", MCS_VALID},
  143. {"HE MCS 9 (256-QAM 5/6) ", MCS_VALID},
  144. {"HE MCS 10 (1024-QAM 3/4)", MCS_VALID},
  145. {"HE MCS 11 (1024-QAM 5/6)", MCS_VALID},
  146. {"INVALID ", MCS_VALID},
  147. }
  148. };
  149. static const struct dp_rate_debug dp_ppdu_rate_string[DOT11_MAX][MAX_MCS] = {
  150. {
  151. {"HE MCS 0 (BPSK 1/2) ", MCS_VALID},
  152. {"HE MCS 1 (QPSK 1/2) ", MCS_VALID},
  153. {"HE MCS 2 (QPSK 3/4) ", MCS_VALID},
  154. {"HE MCS 3 (16-QAM 1/2) ", MCS_VALID},
  155. {"HE MCS 4 (16-QAM 3/4) ", MCS_VALID},
  156. {"HE MCS 5 (64-QAM 2/3) ", MCS_VALID},
  157. {"HE MCS 6 (64-QAM 3/4) ", MCS_VALID},
  158. {"HE MCS 7 (64-QAM 5/6) ", MCS_VALID},
  159. {"HE MCS 8 (256-QAM 3/4) ", MCS_VALID},
  160. {"HE MCS 9 (256-QAM 5/6) ", MCS_VALID},
  161. {"HE MCS 10 (1024-QAM 3/4)", MCS_VALID},
  162. {"HE MCS 11 (1024-QAM 5/6)", MCS_VALID},
  163. {"INVALID ", MCS_VALID},
  164. }
  165. };
  166. static const struct dp_rate_debug dp_mu_rate_string[RX_TYPE_MU_MAX][MAX_MCS] = {
  167. {
  168. {"HE MU-MIMO MCS 0 (BPSK 1/2) ", MCS_VALID},
  169. {"HE MU-MIMO MCS 1 (QPSK 1/2) ", MCS_VALID},
  170. {"HE MU-MIMO MCS 2 (QPSK 3/4) ", MCS_VALID},
  171. {"HE MU-MIMO MCS 3 (16-QAM 1/2) ", MCS_VALID},
  172. {"HE MU-MIMO MCS 4 (16-QAM 3/4) ", MCS_VALID},
  173. {"HE MU-MIMO MCS 5 (64-QAM 2/3) ", MCS_VALID},
  174. {"HE MU-MIMO MCS 6 (64-QAM 3/4) ", MCS_VALID},
  175. {"HE MU-MIMO MCS 7 (64-QAM 5/6) ", MCS_VALID},
  176. {"HE MU-MIMO MCS 8 (256-QAM 3/4) ", MCS_VALID},
  177. {"HE MU-MIMO MCS 9 (256-QAM 5/6) ", MCS_VALID},
  178. {"HE MU-MIMO MCS 10 (1024-QAM 3/4)", MCS_VALID},
  179. {"HE MU-MIMO MCS 11 (1024-QAM 5/6)", MCS_VALID},
  180. {"INVALID ", MCS_VALID},
  181. },
  182. {
  183. {"HE OFDMA MCS 0 (BPSK 1/2) ", MCS_VALID},
  184. {"HE OFDMA MCS 1 (QPSK 1/2) ", MCS_VALID},
  185. {"HE OFDMA MCS 2 (QPSK 3/4) ", MCS_VALID},
  186. {"HE OFDMA MCS 3 (16-QAM 1/2) ", MCS_VALID},
  187. {"HE OFDMA MCS 4 (16-QAM 3/4) ", MCS_VALID},
  188. {"HE OFDMA MCS 5 (64-QAM 2/3) ", MCS_VALID},
  189. {"HE OFDMA MCS 6 (64-QAM 3/4) ", MCS_VALID},
  190. {"HE OFDMA MCS 7 (64-QAM 5/6) ", MCS_VALID},
  191. {"HE OFDMA MCS 8 (256-QAM 3/4) ", MCS_VALID},
  192. {"HE OFDMA MCS 9 (256-QAM 5/6) ", MCS_VALID},
  193. {"HE OFDMA MCS 10 (1024-QAM 3/4)", MCS_VALID},
  194. {"HE OFDMA MCS 11 (1024-QAM 5/6)", MCS_VALID},
  195. {"INVALID ", MCS_VALID},
  196. },
  197. };
  198. const char *mu_reception_mode[RX_TYPE_MU_MAX] = {
  199. "MU MIMO", "MU OFDMA"
  200. };
  201. #ifdef QCA_ENH_V3_STATS_SUPPORT
  202. const char *fw_to_hw_delay_bucket[CDP_DELAY_BUCKET_MAX + 1] = {
  203. "0 to 10 ms", "11 to 20 ms",
  204. "21 to 30 ms", "31 to 40 ms",
  205. "41 to 50 ms", "51 to 60 ms",
  206. "61 to 70 ms", "71 to 80 ms",
  207. "81 to 90 ms", "91 to 100 ms",
  208. "101 to 250 ms", "251 to 500 ms", "500+ ms"
  209. };
  210. const char *sw_enq_delay_bucket[CDP_DELAY_BUCKET_MAX + 1] = {
  211. "0 to 1 ms", "1 to 2 ms",
  212. "2 to 3 ms", "3 to 4 ms",
  213. "4 to 5 ms", "5 to 6 ms",
  214. "6 to 7 ms", "7 to 8 ms",
  215. "8 to 9 ms", "9 to 10 ms",
  216. "10 to 11 ms", "11 to 12 ms", "12+ ms"
  217. };
  218. const char *intfrm_delay_bucket[CDP_DELAY_BUCKET_MAX + 1] = {
  219. "0 to 5 ms", "6 to 10 ms",
  220. "11 to 15 ms", "16 to 20 ms",
  221. "21 to 25 ms", "26 to 30 ms",
  222. "31 to 35 ms", "36 to 40 ms",
  223. "41 to 45 ms", "46 to 50 ms",
  224. "51 to 55 ms", "56 to 60 ms", "60+ ms"
  225. };
  226. #endif
  227. #ifdef WLAN_TX_PKT_CAPTURE_ENH
  228. #include "dp_tx_capture.h"
  229. #endif
  230. #define TID_COUNTER_STATS 1 /* Success/drop stats type */
  231. #define TID_DELAY_STATS 2 /* Delay stats type */
  232. /*
  233. * dp_print_stats_string_tlv: display htt_stats_string_tlv
  234. * @tag_buf: buffer containing the tlv htt_stats_string_tlv
  235. *
  236. * return:void
  237. */
  238. static inline void dp_print_stats_string_tlv(uint32_t *tag_buf)
  239. {
  240. htt_stats_string_tlv *dp_stats_buf =
  241. (htt_stats_string_tlv *)tag_buf;
  242. uint8_t i;
  243. uint16_t index = 0;
  244. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  245. char *data = qdf_mem_malloc(DP_MAX_STRING_LEN);
  246. if (!data) {
  247. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  248. FL("Output buffer not allocated"));
  249. return;
  250. }
  251. DP_PRINT_STATS("HTT_STATS_STRING_TLV:");
  252. for (i = 0; i < tag_len; i++) {
  253. index += qdf_snprint(&data[index],
  254. DP_MAX_STRING_LEN - index,
  255. " %u:%u,", i, dp_stats_buf->data[i]);
  256. }
  257. DP_PRINT_STATS("data = %s\n", data);
  258. qdf_mem_free(data);
  259. }
  260. /*
  261. * dp_print_tx_pdev_stats_cmn_tlv: display htt_tx_pdev_stats_cmn_tlv
  262. * @tag_buf: buffer containing the tlv htt_tx_pdev_stats_cmn_tlv
  263. *
  264. * return:void
  265. */
  266. static inline void dp_print_tx_pdev_stats_cmn_tlv(uint32_t *tag_buf)
  267. {
  268. htt_tx_pdev_stats_cmn_tlv *dp_stats_buf =
  269. (htt_tx_pdev_stats_cmn_tlv *)tag_buf;
  270. DP_PRINT_STATS("HTT_TX_PDEV_STATS_CMN_TLV:");
  271. DP_PRINT_STATS("mac_id__word = %u",
  272. dp_stats_buf->mac_id__word);
  273. DP_PRINT_STATS("hw_queued = %u",
  274. dp_stats_buf->hw_queued);
  275. DP_PRINT_STATS("hw_reaped = %u",
  276. dp_stats_buf->hw_reaped);
  277. DP_PRINT_STATS("underrun = %u",
  278. dp_stats_buf->underrun);
  279. DP_PRINT_STATS("hw_paused = %u",
  280. dp_stats_buf->hw_paused);
  281. DP_PRINT_STATS("hw_flush = %u",
  282. dp_stats_buf->hw_flush);
  283. DP_PRINT_STATS("hw_filt = %u",
  284. dp_stats_buf->hw_filt);
  285. DP_PRINT_STATS("tx_abort = %u",
  286. dp_stats_buf->tx_abort);
  287. DP_PRINT_STATS("mpdu_requeued = %u",
  288. dp_stats_buf->mpdu_requed);
  289. DP_PRINT_STATS("tx_xretry = %u",
  290. dp_stats_buf->tx_xretry);
  291. DP_PRINT_STATS("data_rc = %u",
  292. dp_stats_buf->data_rc);
  293. DP_PRINT_STATS("mpdu_dropped_xretry = %u",
  294. dp_stats_buf->mpdu_dropped_xretry);
  295. DP_PRINT_STATS("illegal_rate_phy_err = %u",
  296. dp_stats_buf->illgl_rate_phy_err);
  297. DP_PRINT_STATS("cont_xretry = %u",
  298. dp_stats_buf->cont_xretry);
  299. DP_PRINT_STATS("tx_timeout = %u",
  300. dp_stats_buf->tx_timeout);
  301. DP_PRINT_STATS("pdev_resets = %u",
  302. dp_stats_buf->pdev_resets);
  303. DP_PRINT_STATS("phy_underrun = %u",
  304. dp_stats_buf->phy_underrun);
  305. DP_PRINT_STATS("txop_ovf = %u",
  306. dp_stats_buf->txop_ovf);
  307. DP_PRINT_STATS("seq_posted = %u",
  308. dp_stats_buf->seq_posted);
  309. DP_PRINT_STATS("seq_failed_queueing = %u",
  310. dp_stats_buf->seq_failed_queueing);
  311. DP_PRINT_STATS("seq_completed = %u",
  312. dp_stats_buf->seq_completed);
  313. DP_PRINT_STATS("seq_restarted = %u",
  314. dp_stats_buf->seq_restarted);
  315. DP_PRINT_STATS("mu_seq_posted = %u",
  316. dp_stats_buf->mu_seq_posted);
  317. DP_PRINT_STATS("seq_switch_hw_paused = %u",
  318. dp_stats_buf->seq_switch_hw_paused);
  319. DP_PRINT_STATS("next_seq_posted_dsr = %u",
  320. dp_stats_buf->next_seq_posted_dsr);
  321. DP_PRINT_STATS("seq_posted_isr = %u",
  322. dp_stats_buf->seq_posted_isr);
  323. DP_PRINT_STATS("seq_ctrl_cached = %u",
  324. dp_stats_buf->seq_ctrl_cached);
  325. DP_PRINT_STATS("mpdu_count_tqm = %u",
  326. dp_stats_buf->mpdu_count_tqm);
  327. DP_PRINT_STATS("msdu_count_tqm = %u",
  328. dp_stats_buf->msdu_count_tqm);
  329. DP_PRINT_STATS("mpdu_removed_tqm = %u",
  330. dp_stats_buf->mpdu_removed_tqm);
  331. DP_PRINT_STATS("msdu_removed_tqm = %u",
  332. dp_stats_buf->msdu_removed_tqm);
  333. DP_PRINT_STATS("mpdus_sw_flush = %u",
  334. dp_stats_buf->mpdus_sw_flush);
  335. DP_PRINT_STATS("mpdus_hw_filter = %u",
  336. dp_stats_buf->mpdus_hw_filter);
  337. DP_PRINT_STATS("mpdus_truncated = %u",
  338. dp_stats_buf->mpdus_truncated);
  339. DP_PRINT_STATS("mpdus_ack_failed = %u",
  340. dp_stats_buf->mpdus_ack_failed);
  341. DP_PRINT_STATS("mpdus_expired = %u",
  342. dp_stats_buf->mpdus_expired);
  343. DP_PRINT_STATS("mpdus_seq_hw_retry = %u",
  344. dp_stats_buf->mpdus_seq_hw_retry);
  345. DP_PRINT_STATS("ack_tlv_proc = %u",
  346. dp_stats_buf->ack_tlv_proc);
  347. DP_PRINT_STATS("coex_abort_mpdu_cnt_valid = %u",
  348. dp_stats_buf->coex_abort_mpdu_cnt_valid);
  349. DP_PRINT_STATS("coex_abort_mpdu_cnt = %u\n",
  350. dp_stats_buf->coex_abort_mpdu_cnt);
  351. }
  352. /*
  353. * dp_print_tx_pdev_stats_urrn_tlv_v: display htt_tx_pdev_stats_urrn_tlv_v
  354. * @tag_buf: buffer containing the tlv htt_tx_pdev_stats_urrn_tlv_v
  355. *
  356. * return:void
  357. */
  358. static inline void dp_print_tx_pdev_stats_urrn_tlv_v(uint32_t *tag_buf)
  359. {
  360. htt_tx_pdev_stats_urrn_tlv_v *dp_stats_buf =
  361. (htt_tx_pdev_stats_urrn_tlv_v *)tag_buf;
  362. uint8_t i;
  363. uint16_t index = 0;
  364. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  365. char *urrn_stats = qdf_mem_malloc(DP_MAX_STRING_LEN);
  366. if (!urrn_stats) {
  367. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  368. FL("Output buffer not allocated"));
  369. return;
  370. }
  371. tag_len = qdf_min(tag_len, (uint32_t)HTT_TX_PDEV_MAX_URRN_STATS);
  372. DP_PRINT_STATS("HTT_TX_PDEV_STATS_URRN_TLV_V:");
  373. for (i = 0; i < tag_len; i++) {
  374. index += qdf_snprint(&urrn_stats[index],
  375. DP_MAX_STRING_LEN - index,
  376. " %u:%u,", i, dp_stats_buf->urrn_stats[i]);
  377. }
  378. DP_PRINT_STATS("urrn_stats = %s\n", urrn_stats);
  379. qdf_mem_free(urrn_stats);
  380. }
  381. /*
  382. * dp_print_tx_pdev_stats_flush_tlv_v: display htt_tx_pdev_stats_flush_tlv_v
  383. * @tag_buf: buffer containing the tlv htt_tx_pdev_stats_flush_tlv_v
  384. *
  385. * return:void
  386. */
  387. static inline void dp_print_tx_pdev_stats_flush_tlv_v(uint32_t *tag_buf)
  388. {
  389. htt_tx_pdev_stats_flush_tlv_v *dp_stats_buf =
  390. (htt_tx_pdev_stats_flush_tlv_v *)tag_buf;
  391. uint8_t i;
  392. uint16_t index = 0;
  393. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  394. char *flush_errs = qdf_mem_malloc(DP_MAX_STRING_LEN);
  395. if (!flush_errs) {
  396. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  397. FL("Output buffer not allocated"));
  398. return;
  399. }
  400. tag_len = qdf_min(tag_len,
  401. (uint32_t)HTT_TX_PDEV_MAX_FLUSH_REASON_STATS);
  402. DP_PRINT_STATS("HTT_TX_PDEV_STATS_FLUSH_TLV_V:");
  403. for (i = 0; i < tag_len; i++) {
  404. index += qdf_snprint(&flush_errs[index],
  405. DP_MAX_STRING_LEN - index,
  406. " %u:%u,", i, dp_stats_buf->flush_errs[i]);
  407. }
  408. DP_PRINT_STATS("flush_errs = %s\n", flush_errs);
  409. qdf_mem_free(flush_errs);
  410. }
  411. /*
  412. * dp_print_tx_pdev_stats_sifs_tlv_v: display htt_tx_pdev_stats_sifs_tlv_v
  413. * @tag_buf: buffer containing the tlv htt_tx_pdev_stats_sifs_tlv_v
  414. *
  415. * return:void
  416. */
  417. static inline void dp_print_tx_pdev_stats_sifs_tlv_v(uint32_t *tag_buf)
  418. {
  419. htt_tx_pdev_stats_sifs_tlv_v *dp_stats_buf =
  420. (htt_tx_pdev_stats_sifs_tlv_v *)tag_buf;
  421. uint8_t i;
  422. uint16_t index = 0;
  423. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  424. char *sifs_status = qdf_mem_malloc(DP_MAX_STRING_LEN);
  425. if (!sifs_status) {
  426. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  427. FL("Output buffer not allocated"));
  428. return;
  429. }
  430. tag_len = qdf_min(tag_len, (uint32_t)HTT_TX_PDEV_MAX_SIFS_BURST_STATS);
  431. DP_PRINT_STATS("HTT_TX_PDEV_STATS_SIFS_TLV_V:");
  432. for (i = 0; i < tag_len; i++) {
  433. index += qdf_snprint(&sifs_status[index],
  434. DP_MAX_STRING_LEN - index,
  435. " %u:%u,", i, dp_stats_buf->sifs_status[i]);
  436. }
  437. DP_PRINT_STATS("sifs_status = %s\n", sifs_status);
  438. qdf_mem_free(sifs_status);
  439. }
  440. /*
  441. * dp_print_tx_pdev_stats_phy_err_tlv_v: display htt_tx_pdev_stats_phy_err_tlv_v
  442. * @tag_buf: buffer containing the tlv htt_tx_pdev_stats_phy_err_tlv_v
  443. *
  444. * return:void
  445. */
  446. static inline void dp_print_tx_pdev_stats_phy_err_tlv_v(uint32_t *tag_buf)
  447. {
  448. htt_tx_pdev_stats_phy_err_tlv_v *dp_stats_buf =
  449. (htt_tx_pdev_stats_phy_err_tlv_v *)tag_buf;
  450. uint8_t i;
  451. uint16_t index = 0;
  452. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  453. char *phy_errs = qdf_mem_malloc(DP_MAX_STRING_LEN);
  454. if (!phy_errs) {
  455. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  456. FL("Output buffer not allocated"));
  457. return;
  458. }
  459. tag_len = qdf_min(tag_len, (uint32_t)HTT_TX_PDEV_MAX_PHY_ERR_STATS);
  460. DP_PRINT_STATS("HTT_TX_PDEV_STATS_PHY_ERR_TLV_V:");
  461. for (i = 0; i < tag_len; i++) {
  462. index += qdf_snprint(&phy_errs[index],
  463. DP_MAX_STRING_LEN - index,
  464. " %u:%u,", i, dp_stats_buf->phy_errs[i]);
  465. }
  466. DP_PRINT_STATS("phy_errs = %s\n", phy_errs);
  467. qdf_mem_free(phy_errs);
  468. }
  469. /*
  470. * dp_print_hw_stats_intr_misc_tlv: display htt_hw_stats_intr_misc_tlv
  471. * @tag_buf: buffer containing the tlv htt_hw_stats_intr_misc_tlv
  472. *
  473. * return:void
  474. */
  475. static inline void dp_print_hw_stats_intr_misc_tlv(uint32_t *tag_buf)
  476. {
  477. htt_hw_stats_intr_misc_tlv *dp_stats_buf =
  478. (htt_hw_stats_intr_misc_tlv *)tag_buf;
  479. uint8_t i;
  480. uint16_t index = 0;
  481. char *hw_intr_name = qdf_mem_malloc(DP_MAX_STRING_LEN);
  482. if (!hw_intr_name) {
  483. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  484. FL("Output buffer not allocated"));
  485. return;
  486. }
  487. DP_PRINT_STATS("HTT_HW_STATS_INTR_MISC_TLV:");
  488. for (i = 0; i < DP_HTT_HW_INTR_NAME_LEN; i++) {
  489. index += qdf_snprint(&hw_intr_name[index],
  490. DP_MAX_STRING_LEN - index,
  491. " %u:%u,", i, dp_stats_buf->hw_intr_name[i]);
  492. }
  493. DP_PRINT_STATS("hw_intr_name = %s ", hw_intr_name);
  494. DP_PRINT_STATS("mask = %u",
  495. dp_stats_buf->mask);
  496. DP_PRINT_STATS("count = %u\n",
  497. dp_stats_buf->count);
  498. qdf_mem_free(hw_intr_name);
  499. }
  500. /*
  501. * dp_print_hw_stats_wd_timeout_tlv: display htt_hw_stats_wd_timeout_tlv
  502. * @tag_buf: buffer containing the tlv htt_hw_stats_wd_timeout_tlv
  503. *
  504. * return:void
  505. */
  506. static inline void dp_print_hw_stats_wd_timeout_tlv(uint32_t *tag_buf)
  507. {
  508. htt_hw_stats_wd_timeout_tlv *dp_stats_buf =
  509. (htt_hw_stats_wd_timeout_tlv *)tag_buf;
  510. uint8_t i;
  511. uint16_t index = 0;
  512. char *hw_module_name = qdf_mem_malloc(DP_MAX_STRING_LEN);
  513. if (!hw_module_name) {
  514. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  515. FL("Output buffer not allocated"));
  516. return;
  517. }
  518. DP_PRINT_STATS("HTT_HW_STATS_WD_TIMEOUT_TLV:");
  519. for (i = 0; i < DP_HTT_HW_MODULE_NAME_LEN; i++) {
  520. index += qdf_snprint(&hw_module_name[index],
  521. DP_MAX_STRING_LEN - index,
  522. " %u:%u,", i, dp_stats_buf->hw_module_name[i]);
  523. }
  524. DP_PRINT_STATS("hw_module_name = %s ", hw_module_name);
  525. DP_PRINT_STATS("count = %u",
  526. dp_stats_buf->count);
  527. qdf_mem_free(hw_module_name);
  528. }
  529. /*
  530. * dp_print_hw_stats_pdev_errs_tlv: display htt_hw_stats_pdev_errs_tlv
  531. * @tag_buf: buffer containing the tlv htt_hw_stats_pdev_errs_tlv
  532. *
  533. * return:void
  534. */
  535. static inline void dp_print_hw_stats_pdev_errs_tlv(uint32_t *tag_buf)
  536. {
  537. htt_hw_stats_pdev_errs_tlv *dp_stats_buf =
  538. (htt_hw_stats_pdev_errs_tlv *)tag_buf;
  539. DP_PRINT_STATS("HTT_HW_STATS_PDEV_ERRS_TLV:");
  540. DP_PRINT_STATS("mac_id__word = %u",
  541. dp_stats_buf->mac_id__word);
  542. DP_PRINT_STATS("tx_abort = %u",
  543. dp_stats_buf->tx_abort);
  544. DP_PRINT_STATS("tx_abort_fail_count = %u",
  545. dp_stats_buf->tx_abort_fail_count);
  546. DP_PRINT_STATS("rx_abort = %u",
  547. dp_stats_buf->rx_abort);
  548. DP_PRINT_STATS("rx_abort_fail_count = %u",
  549. dp_stats_buf->rx_abort_fail_count);
  550. DP_PRINT_STATS("warm_reset = %u",
  551. dp_stats_buf->warm_reset);
  552. DP_PRINT_STATS("cold_reset = %u",
  553. dp_stats_buf->cold_reset);
  554. DP_PRINT_STATS("tx_flush = %u",
  555. dp_stats_buf->tx_flush);
  556. DP_PRINT_STATS("tx_glb_reset = %u",
  557. dp_stats_buf->tx_glb_reset);
  558. DP_PRINT_STATS("tx_txq_reset = %u",
  559. dp_stats_buf->tx_txq_reset);
  560. DP_PRINT_STATS("rx_timeout_reset = %u\n",
  561. dp_stats_buf->rx_timeout_reset);
  562. }
  563. /*
  564. * dp_print_msdu_flow_stats_tlv: display htt_msdu_flow_stats_tlv
  565. * @tag_buf: buffer containing the tlv htt_msdu_flow_stats_tlv
  566. *
  567. * return:void
  568. */
  569. static inline void dp_print_msdu_flow_stats_tlv(uint32_t *tag_buf)
  570. {
  571. htt_msdu_flow_stats_tlv *dp_stats_buf =
  572. (htt_msdu_flow_stats_tlv *)tag_buf;
  573. DP_PRINT_STATS("HTT_MSDU_FLOW_STATS_TLV:");
  574. DP_PRINT_STATS("last_update_timestamp = %u",
  575. dp_stats_buf->last_update_timestamp);
  576. DP_PRINT_STATS("last_add_timestamp = %u",
  577. dp_stats_buf->last_add_timestamp);
  578. DP_PRINT_STATS("last_remove_timestamp = %u",
  579. dp_stats_buf->last_remove_timestamp);
  580. DP_PRINT_STATS("total_processed_msdu_count = %u",
  581. dp_stats_buf->total_processed_msdu_count);
  582. DP_PRINT_STATS("cur_msdu_count_in_flowq = %u",
  583. dp_stats_buf->cur_msdu_count_in_flowq);
  584. DP_PRINT_STATS("sw_peer_id = %u",
  585. dp_stats_buf->sw_peer_id);
  586. DP_PRINT_STATS("tx_flow_no__tid_num__drop_rule = %u\n",
  587. dp_stats_buf->tx_flow_no__tid_num__drop_rule);
  588. }
  589. /*
  590. * dp_print_tx_tid_stats_tlv: display htt_tx_tid_stats_tlv
  591. * @tag_buf: buffer containing the tlv htt_tx_tid_stats_tlv
  592. *
  593. * return:void
  594. */
  595. static inline void dp_print_tx_tid_stats_tlv(uint32_t *tag_buf)
  596. {
  597. htt_tx_tid_stats_tlv *dp_stats_buf =
  598. (htt_tx_tid_stats_tlv *)tag_buf;
  599. uint8_t i;
  600. uint16_t index = 0;
  601. char *tid_name = qdf_mem_malloc(DP_MAX_STRING_LEN);
  602. if (!tid_name) {
  603. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  604. FL("Output buffer not allocated"));
  605. return;
  606. }
  607. DP_PRINT_STATS("HTT_TX_TID_STATS_TLV:");
  608. for (i = 0; i < DP_HTT_TID_NAME_LEN; i++) {
  609. index += qdf_snprint(&tid_name[index],
  610. DP_MAX_STRING_LEN - index,
  611. " %u:%u,", i, dp_stats_buf->tid_name[i]);
  612. }
  613. DP_PRINT_STATS("tid_name = %s ", tid_name);
  614. DP_PRINT_STATS("sw_peer_id__tid_num = %u",
  615. dp_stats_buf->sw_peer_id__tid_num);
  616. DP_PRINT_STATS("num_sched_pending__num_ppdu_in_hwq = %u",
  617. dp_stats_buf->num_sched_pending__num_ppdu_in_hwq);
  618. DP_PRINT_STATS("tid_flags = %u",
  619. dp_stats_buf->tid_flags);
  620. DP_PRINT_STATS("hw_queued = %u",
  621. dp_stats_buf->hw_queued);
  622. DP_PRINT_STATS("hw_reaped = %u",
  623. dp_stats_buf->hw_reaped);
  624. DP_PRINT_STATS("mpdus_hw_filter = %u",
  625. dp_stats_buf->mpdus_hw_filter);
  626. DP_PRINT_STATS("qdepth_bytes = %u",
  627. dp_stats_buf->qdepth_bytes);
  628. DP_PRINT_STATS("qdepth_num_msdu = %u",
  629. dp_stats_buf->qdepth_num_msdu);
  630. DP_PRINT_STATS("qdepth_num_mpdu = %u",
  631. dp_stats_buf->qdepth_num_mpdu);
  632. DP_PRINT_STATS("last_scheduled_tsmp = %u",
  633. dp_stats_buf->last_scheduled_tsmp);
  634. DP_PRINT_STATS("pause_module_id = %u",
  635. dp_stats_buf->pause_module_id);
  636. DP_PRINT_STATS("block_module_id = %u\n",
  637. dp_stats_buf->block_module_id);
  638. DP_PRINT_STATS("tid_tx_airtime = %u\n",
  639. dp_stats_buf->tid_tx_airtime);
  640. qdf_mem_free(tid_name);
  641. }
  642. /*
  643. * dp_print_tx_tid_stats_v1_tlv: display htt_tx_tid_stats_v1_tlv
  644. * @tag_buf: buffer containing the tlv htt_tx_tid_stats_v1_tlv
  645. *
  646. * return:void
  647. */
  648. static inline void dp_print_tx_tid_stats_v1_tlv(uint32_t *tag_buf)
  649. {
  650. htt_tx_tid_stats_v1_tlv *dp_stats_buf =
  651. (htt_tx_tid_stats_v1_tlv *)tag_buf;
  652. uint8_t i;
  653. uint16_t index = 0;
  654. char *tid_name = qdf_mem_malloc(DP_MAX_STRING_LEN);
  655. if (!tid_name) {
  656. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  657. FL("Output buffer not allocated"));
  658. return;
  659. }
  660. DP_PRINT_STATS("HTT_TX_TID_STATS_V1_TLV:");
  661. for (i = 0; i < DP_HTT_TID_NAME_LEN; i++) {
  662. index += qdf_snprint(&tid_name[index],
  663. DP_MAX_STRING_LEN - index,
  664. " %u:%u,", i, dp_stats_buf->tid_name[i]);
  665. }
  666. DP_PRINT_STATS("tid_name = %s ", tid_name);
  667. DP_PRINT_STATS("sw_peer_id__tid_num = %u",
  668. dp_stats_buf->sw_peer_id__tid_num);
  669. DP_PRINT_STATS("num_sched_pending__num_ppdu_in_hwq = %u",
  670. dp_stats_buf->num_sched_pending__num_ppdu_in_hwq);
  671. DP_PRINT_STATS("tid_flags = %u",
  672. dp_stats_buf->tid_flags);
  673. DP_PRINT_STATS("max_qdepth_bytes = %u",
  674. dp_stats_buf->max_qdepth_bytes);
  675. DP_PRINT_STATS("max_qdepth_n_msdus = %u",
  676. dp_stats_buf->max_qdepth_n_msdus);
  677. DP_PRINT_STATS("rsvd = %u",
  678. dp_stats_buf->rsvd);
  679. DP_PRINT_STATS("qdepth_bytes = %u",
  680. dp_stats_buf->qdepth_bytes);
  681. DP_PRINT_STATS("qdepth_num_msdu = %u",
  682. dp_stats_buf->qdepth_num_msdu);
  683. DP_PRINT_STATS("qdepth_num_mpdu = %u",
  684. dp_stats_buf->qdepth_num_mpdu);
  685. DP_PRINT_STATS("last_scheduled_tsmp = %u",
  686. dp_stats_buf->last_scheduled_tsmp);
  687. DP_PRINT_STATS("pause_module_id = %u",
  688. dp_stats_buf->pause_module_id);
  689. DP_PRINT_STATS("block_module_id = %u\n",
  690. dp_stats_buf->block_module_id);
  691. DP_PRINT_STATS("tid_tx_airtime = %u\n",
  692. dp_stats_buf->tid_tx_airtime);
  693. qdf_mem_free(tid_name);
  694. }
  695. /*
  696. * dp_print_rx_tid_stats_tlv: display htt_rx_tid_stats_tlv
  697. * @tag_buf: buffer containing the tlv htt_rx_tid_stats_tlv
  698. *
  699. * return:void
  700. */
  701. static inline void dp_print_rx_tid_stats_tlv(uint32_t *tag_buf)
  702. {
  703. htt_rx_tid_stats_tlv *dp_stats_buf =
  704. (htt_rx_tid_stats_tlv *)tag_buf;
  705. uint8_t i;
  706. uint16_t index = 0;
  707. char *tid_name = qdf_mem_malloc(DP_MAX_STRING_LEN);
  708. if (!tid_name) {
  709. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  710. FL("Output buffer not allocated"));
  711. return;
  712. }
  713. DP_PRINT_STATS("HTT_RX_TID_STATS_TLV:");
  714. DP_PRINT_STATS("sw_peer_id__tid_num = %u",
  715. dp_stats_buf->sw_peer_id__tid_num);
  716. for (i = 0; i < DP_HTT_TID_NAME_LEN; i++) {
  717. index += qdf_snprint(&tid_name[index],
  718. DP_MAX_STRING_LEN - index,
  719. " %u:%u,", i, dp_stats_buf->tid_name[i]);
  720. }
  721. DP_PRINT_STATS("tid_name = %s ", tid_name);
  722. DP_PRINT_STATS("dup_in_reorder = %u",
  723. dp_stats_buf->dup_in_reorder);
  724. DP_PRINT_STATS("dup_past_outside_window = %u",
  725. dp_stats_buf->dup_past_outside_window);
  726. DP_PRINT_STATS("dup_past_within_window = %u",
  727. dp_stats_buf->dup_past_within_window);
  728. DP_PRINT_STATS("rxdesc_err_decrypt = %u\n",
  729. dp_stats_buf->rxdesc_err_decrypt);
  730. qdf_mem_free(tid_name);
  731. }
  732. /*
  733. * dp_print_counter_tlv: display htt_counter_tlv
  734. * @tag_buf: buffer containing the tlv htt_counter_tlv
  735. *
  736. * return:void
  737. */
  738. static inline void dp_print_counter_tlv(uint32_t *tag_buf)
  739. {
  740. htt_counter_tlv *dp_stats_buf =
  741. (htt_counter_tlv *)tag_buf;
  742. uint8_t i;
  743. uint16_t index = 0;
  744. char *counter_name = qdf_mem_malloc(DP_MAX_STRING_LEN);
  745. if (!counter_name) {
  746. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  747. FL("Output buffer not allocated"));
  748. return;
  749. }
  750. DP_PRINT_STATS("HTT_COUNTER_TLV:");
  751. for (i = 0; i < DP_HTT_COUNTER_NAME_LEN; i++) {
  752. index += qdf_snprint(&counter_name[index],
  753. DP_MAX_STRING_LEN - index,
  754. " %u:%u,", i, dp_stats_buf->counter_name[i]);
  755. }
  756. DP_PRINT_STATS("counter_name = %s ", counter_name);
  757. DP_PRINT_STATS("count = %u\n",
  758. dp_stats_buf->count);
  759. qdf_mem_free(counter_name);
  760. }
  761. /*
  762. * dp_print_peer_stats_cmn_tlv: display htt_peer_stats_cmn_tlv
  763. * @tag_buf: buffer containing the tlv htt_peer_stats_cmn_tlv
  764. *
  765. * return:void
  766. */
  767. static inline void dp_print_peer_stats_cmn_tlv(uint32_t *tag_buf)
  768. {
  769. htt_peer_stats_cmn_tlv *dp_stats_buf =
  770. (htt_peer_stats_cmn_tlv *)tag_buf;
  771. DP_PRINT_STATS("HTT_PEER_STATS_CMN_TLV:");
  772. DP_PRINT_STATS("ppdu_cnt = %u",
  773. dp_stats_buf->ppdu_cnt);
  774. DP_PRINT_STATS("mpdu_cnt = %u",
  775. dp_stats_buf->mpdu_cnt);
  776. DP_PRINT_STATS("msdu_cnt = %u",
  777. dp_stats_buf->msdu_cnt);
  778. DP_PRINT_STATS("pause_bitmap = %u",
  779. dp_stats_buf->pause_bitmap);
  780. DP_PRINT_STATS("block_bitmap = %u",
  781. dp_stats_buf->block_bitmap);
  782. DP_PRINT_STATS("current_timestamp = %u\n",
  783. dp_stats_buf->current_timestamp);
  784. DP_PRINT_STATS("inactive_time = %u",
  785. dp_stats_buf->inactive_time);
  786. }
  787. /*
  788. * dp_print_peer_details_tlv: display htt_peer_details_tlv
  789. * @tag_buf: buffer containing the tlv htt_peer_details_tlv
  790. *
  791. * return:void
  792. */
  793. static inline void dp_print_peer_details_tlv(uint32_t *tag_buf)
  794. {
  795. htt_peer_details_tlv *dp_stats_buf =
  796. (htt_peer_details_tlv *)tag_buf;
  797. DP_PRINT_STATS("HTT_PEER_DETAILS_TLV:");
  798. DP_PRINT_STATS("peer_type = %u",
  799. dp_stats_buf->peer_type);
  800. DP_PRINT_STATS("sw_peer_id = %u",
  801. dp_stats_buf->sw_peer_id);
  802. DP_PRINT_STATS("vdev_pdev_ast_idx = %u",
  803. dp_stats_buf->vdev_pdev_ast_idx);
  804. DP_PRINT_STATS("mac_addr(upper 4 bytes) = %u",
  805. dp_stats_buf->mac_addr.mac_addr31to0);
  806. DP_PRINT_STATS("mac_addr(lower 2 bytes) = %u",
  807. dp_stats_buf->mac_addr.mac_addr47to32);
  808. DP_PRINT_STATS("peer_flags = %u",
  809. dp_stats_buf->peer_flags);
  810. DP_PRINT_STATS("qpeer_flags = %u\n",
  811. dp_stats_buf->qpeer_flags);
  812. }
  813. /*
  814. * dp_print_tx_peer_rate_stats_tlv: display htt_tx_peer_rate_stats_tlv
  815. * @tag_buf: buffer containing the tlv htt_tx_peer_rate_stats_tlv
  816. *
  817. * return:void
  818. */
  819. static inline void dp_print_tx_peer_rate_stats_tlv(uint32_t *tag_buf)
  820. {
  821. htt_tx_peer_rate_stats_tlv *dp_stats_buf =
  822. (htt_tx_peer_rate_stats_tlv *)tag_buf;
  823. uint8_t i, j;
  824. uint16_t index = 0;
  825. char *tx_gi[HTT_TX_PEER_STATS_NUM_GI_COUNTERS];
  826. char *str_buf = qdf_mem_malloc(DP_MAX_STRING_LEN);
  827. if (!str_buf) {
  828. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  829. FL("Output buffer not allocated"));
  830. return;
  831. }
  832. for (i = 0; i < HTT_TX_PEER_STATS_NUM_GI_COUNTERS; i++)
  833. tx_gi[i] = (char *)qdf_mem_malloc(DP_MAX_STRING_LEN);
  834. DP_PRINT_STATS("HTT_TX_PEER_RATE_STATS_TLV:");
  835. DP_PRINT_STATS("tx_ldpc = %u",
  836. dp_stats_buf->tx_ldpc);
  837. DP_PRINT_STATS("rts_cnt = %u",
  838. dp_stats_buf->rts_cnt);
  839. DP_PRINT_STATS("ack_rssi = %u",
  840. dp_stats_buf->ack_rssi);
  841. index = 0;
  842. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  843. for (i = 0; i < DP_HTT_TX_MCS_LEN; i++) {
  844. index += qdf_snprint(&str_buf[index],
  845. DP_MAX_STRING_LEN - index,
  846. " %u:%u,", i, dp_stats_buf->tx_mcs[i]);
  847. }
  848. DP_PRINT_STATS("tx_mcs = %s ", str_buf);
  849. index = 0;
  850. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  851. for (i = 0; i < DP_HTT_TX_SU_MCS_LEN; i++) {
  852. index += qdf_snprint(&str_buf[index],
  853. DP_MAX_STRING_LEN - index,
  854. " %u:%u,", i, dp_stats_buf->tx_su_mcs[i]);
  855. }
  856. DP_PRINT_STATS("tx_su_mcs = %s ", str_buf);
  857. index = 0;
  858. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  859. for (i = 0; i < DP_HTT_TX_MU_MCS_LEN; i++) {
  860. index += qdf_snprint(&str_buf[index],
  861. DP_MAX_STRING_LEN - index,
  862. " %u:%u,", i, dp_stats_buf->tx_mu_mcs[i]);
  863. }
  864. DP_PRINT_STATS("tx_mu_mcs = %s ", str_buf);
  865. index = 0;
  866. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  867. for (i = 0; i < DP_HTT_TX_NSS_LEN; i++) {
  868. /* 0 stands for NSS 1, 1 stands for NSS 2, etc. */
  869. index += qdf_snprint(&str_buf[index],
  870. DP_MAX_STRING_LEN - index,
  871. " %u:%u,", (i + 1),
  872. dp_stats_buf->tx_nss[i]);
  873. }
  874. DP_PRINT_STATS("tx_nss = %s ", str_buf);
  875. index = 0;
  876. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  877. for (i = 0; i < DP_HTT_TX_BW_LEN; i++) {
  878. index += qdf_snprint(&str_buf[index],
  879. DP_MAX_STRING_LEN - index,
  880. " %u:%u,", i, dp_stats_buf->tx_bw[i]);
  881. }
  882. DP_PRINT_STATS("tx_bw = %s ", str_buf);
  883. index = 0;
  884. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  885. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  886. index += qdf_snprint(&str_buf[index],
  887. DP_MAX_STRING_LEN - index,
  888. " %u:%u,", i, dp_stats_buf->tx_stbc[i]);
  889. }
  890. DP_PRINT_STATS("tx_stbc = %s ", str_buf);
  891. index = 0;
  892. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  893. for (i = 0; i < DP_HTT_TX_PREAM_LEN; i++) {
  894. index += qdf_snprint(&str_buf[index],
  895. DP_MAX_STRING_LEN - index,
  896. " %u:%u,", i, dp_stats_buf->tx_pream[i]);
  897. }
  898. DP_PRINT_STATS("tx_pream = %s ", str_buf);
  899. for (j = 0; j < HTT_TX_PEER_STATS_NUM_GI_COUNTERS; j++) {
  900. index = 0;
  901. for (i = 0; i < HTT_TX_PEER_STATS_NUM_MCS_COUNTERS; i++) {
  902. index += qdf_snprint(&tx_gi[j][index],
  903. DP_MAX_STRING_LEN - index,
  904. " %u:%u,", i,
  905. dp_stats_buf->tx_gi[j][i]);
  906. }
  907. DP_PRINT_STATS("tx_gi[%u] = %s ", j, tx_gi[j]);
  908. }
  909. index = 0;
  910. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  911. for (i = 0; i < DP_HTT_TX_DCM_LEN; i++) {
  912. index += qdf_snprint(&str_buf[index],
  913. DP_MAX_STRING_LEN - index,
  914. " %u:%u,", i, dp_stats_buf->tx_dcm[i]);
  915. }
  916. DP_PRINT_STATS("tx_dcm = %s\n", str_buf);
  917. for (i = 0; i < HTT_TX_PEER_STATS_NUM_GI_COUNTERS; i++)
  918. qdf_mem_free(tx_gi[i]);
  919. qdf_mem_free(str_buf);
  920. }
  921. /*
  922. * dp_print_rx_peer_rate_stats_tlv: display htt_rx_peer_rate_stats_tlv
  923. * @tag_buf: buffer containing the tlv htt_rx_peer_rate_stats_tlv
  924. *
  925. * return:void
  926. */
  927. static inline void dp_print_rx_peer_rate_stats_tlv(uint32_t *tag_buf)
  928. {
  929. htt_rx_peer_rate_stats_tlv *dp_stats_buf =
  930. (htt_rx_peer_rate_stats_tlv *)tag_buf;
  931. uint8_t i, j;
  932. uint16_t index = 0;
  933. char *rssi_chain[DP_HTT_PEER_NUM_SS];
  934. char *rx_gi[HTT_RX_PEER_STATS_NUM_GI_COUNTERS];
  935. char *str_buf = qdf_mem_malloc(DP_MAX_STRING_LEN);
  936. if (!str_buf) {
  937. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  938. FL("Output buffer not allocated"));
  939. return;
  940. }
  941. for (i = 0; i < DP_HTT_PEER_NUM_SS; i++)
  942. rssi_chain[i] = qdf_mem_malloc(DP_MAX_STRING_LEN);
  943. for (i = 0; i < HTT_RX_PEER_STATS_NUM_GI_COUNTERS; i++)
  944. rx_gi[i] = qdf_mem_malloc(DP_MAX_STRING_LEN);
  945. DP_PRINT_STATS("HTT_RX_PEER_RATE_STATS_TLV:");
  946. DP_PRINT_STATS("nsts = %u",
  947. dp_stats_buf->nsts);
  948. DP_PRINT_STATS("rx_ldpc = %u",
  949. dp_stats_buf->rx_ldpc);
  950. DP_PRINT_STATS("rts_cnt = %u",
  951. dp_stats_buf->rts_cnt);
  952. DP_PRINT_STATS("rssi_mgmt = %u",
  953. dp_stats_buf->rssi_mgmt);
  954. DP_PRINT_STATS("rssi_data = %u",
  955. dp_stats_buf->rssi_data);
  956. DP_PRINT_STATS("rssi_comb = %u",
  957. dp_stats_buf->rssi_comb);
  958. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  959. for (i = 0; i < DP_HTT_RX_MCS_LEN; i++) {
  960. index += qdf_snprint(&str_buf[index],
  961. DP_MAX_STRING_LEN - index,
  962. " %u:%u,", i, dp_stats_buf->rx_mcs[i]);
  963. }
  964. DP_PRINT_STATS("rx_mcs = %s ", str_buf);
  965. index = 0;
  966. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  967. for (i = 0; i < DP_HTT_RX_NSS_LEN; i++) {
  968. /* 0 stands for NSS 1, 1 stands for NSS 2, etc. */
  969. index += qdf_snprint(&str_buf[index],
  970. DP_MAX_STRING_LEN - index,
  971. " %u:%u,", (i + 1),
  972. dp_stats_buf->rx_nss[i]);
  973. }
  974. DP_PRINT_STATS("rx_nss = %s ", str_buf);
  975. index = 0;
  976. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  977. for (i = 0; i < DP_HTT_RX_DCM_LEN; i++) {
  978. index += qdf_snprint(&str_buf[index],
  979. DP_MAX_STRING_LEN - index,
  980. " %u:%u,", i, dp_stats_buf->rx_dcm[i]);
  981. }
  982. DP_PRINT_STATS("rx_dcm = %s ", str_buf);
  983. index = 0;
  984. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  985. for (i = 0; i < HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  986. index += qdf_snprint(&str_buf[index],
  987. DP_MAX_STRING_LEN - index,
  988. " %u:%u,", i, dp_stats_buf->rx_stbc[i]);
  989. }
  990. DP_PRINT_STATS("rx_stbc = %s ", str_buf);
  991. index = 0;
  992. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  993. for (i = 0; i < DP_HTT_RX_BW_LEN; i++) {
  994. index += qdf_snprint(&str_buf[index],
  995. DP_MAX_STRING_LEN - index,
  996. " %u:%u,", i, dp_stats_buf->rx_bw[i]);
  997. }
  998. DP_PRINT_STATS("rx_bw = %s ", str_buf);
  999. for (j = 0; j < DP_HTT_PEER_NUM_SS; j++) {
  1000. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  1001. index = 0;
  1002. for (i = 0; i < HTT_RX_PEER_STATS_NUM_BW_COUNTERS; i++) {
  1003. index += qdf_snprint(&rssi_chain[j][index],
  1004. DP_MAX_STRING_LEN - index,
  1005. " %u:%u,", i,
  1006. dp_stats_buf->rssi_chain[j][i]);
  1007. }
  1008. DP_PRINT_STATS("rssi_chain[%u] = %s ", j, rssi_chain[j]);
  1009. }
  1010. for (j = 0; j < HTT_RX_PEER_STATS_NUM_GI_COUNTERS; j++) {
  1011. index = 0;
  1012. for (i = 0; i < HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  1013. index += qdf_snprint(&rx_gi[j][index],
  1014. DP_MAX_STRING_LEN - index,
  1015. " %u:%u,", i,
  1016. dp_stats_buf->rx_gi[j][i]);
  1017. }
  1018. DP_PRINT_STATS("rx_gi[%u] = %s ", j, rx_gi[j]);
  1019. }
  1020. index = 0;
  1021. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  1022. for (i = 0; i < DP_HTT_RX_PREAM_LEN; i++) {
  1023. index += qdf_snprint(&str_buf[index],
  1024. DP_MAX_STRING_LEN - index,
  1025. " %u:%u,", i, dp_stats_buf->rx_pream[i]);
  1026. }
  1027. DP_PRINT_STATS("rx_pream = %s\n", str_buf);
  1028. for (i = 0; i < DP_HTT_PEER_NUM_SS; i++)
  1029. qdf_mem_free(rssi_chain[i]);
  1030. for (i = 0; i < HTT_RX_PEER_STATS_NUM_GI_COUNTERS; i++)
  1031. qdf_mem_free(rx_gi[i]);
  1032. qdf_mem_free(str_buf);
  1033. }
  1034. /*
  1035. * dp_print_tx_hwq_mu_mimo_sch_stats_tlv: display htt_tx_hwq_mu_mimo_sch_stats
  1036. * @tag_buf: buffer containing the tlv htt_tx_hwq_mu_mimo_sch_stats_tlv
  1037. *
  1038. * return:void
  1039. */
  1040. static inline void dp_print_tx_hwq_mu_mimo_sch_stats_tlv(uint32_t *tag_buf)
  1041. {
  1042. htt_tx_hwq_mu_mimo_sch_stats_tlv *dp_stats_buf =
  1043. (htt_tx_hwq_mu_mimo_sch_stats_tlv *)tag_buf;
  1044. DP_PRINT_STATS("HTT_TX_HWQ_MU_MIMO_SCH_STATS_TLV:");
  1045. DP_PRINT_STATS("mu_mimo_sch_posted = %u",
  1046. dp_stats_buf->mu_mimo_sch_posted);
  1047. DP_PRINT_STATS("mu_mimo_sch_failed = %u",
  1048. dp_stats_buf->mu_mimo_sch_failed);
  1049. DP_PRINT_STATS("mu_mimo_ppdu_posted = %u\n",
  1050. dp_stats_buf->mu_mimo_ppdu_posted);
  1051. }
  1052. /*
  1053. * dp_print_tx_hwq_mu_mimo_mpdu_stats_tlv: display htt_tx_hwq_mu_mimo_mpdu_stats
  1054. * @tag_buf: buffer containing the tlv htt_tx_hwq_mu_mimo_mpdu_stats_tlv
  1055. *
  1056. * return:void
  1057. */
  1058. static inline void dp_print_tx_hwq_mu_mimo_mpdu_stats_tlv(uint32_t *tag_buf)
  1059. {
  1060. htt_tx_hwq_mu_mimo_mpdu_stats_tlv *dp_stats_buf =
  1061. (htt_tx_hwq_mu_mimo_mpdu_stats_tlv *)tag_buf;
  1062. DP_PRINT_STATS("HTT_TX_HWQ_MU_MIMO_MPDU_STATS_TLV:");
  1063. DP_PRINT_STATS("mu_mimo_mpdus_queued_usr = %u",
  1064. dp_stats_buf->mu_mimo_mpdus_queued_usr);
  1065. DP_PRINT_STATS("mu_mimo_mpdus_tried_usr = %u",
  1066. dp_stats_buf->mu_mimo_mpdus_tried_usr);
  1067. DP_PRINT_STATS("mu_mimo_mpdus_failed_usr = %u",
  1068. dp_stats_buf->mu_mimo_mpdus_failed_usr);
  1069. DP_PRINT_STATS("mu_mimo_mpdus_requeued_usr = %u",
  1070. dp_stats_buf->mu_mimo_mpdus_requeued_usr);
  1071. DP_PRINT_STATS("mu_mimo_err_no_ba_usr = %u",
  1072. dp_stats_buf->mu_mimo_err_no_ba_usr);
  1073. DP_PRINT_STATS("mu_mimo_mpdu_underrun_usr = %u",
  1074. dp_stats_buf->mu_mimo_mpdu_underrun_usr);
  1075. DP_PRINT_STATS("mu_mimo_ampdu_underrun_usr = %u\n",
  1076. dp_stats_buf->mu_mimo_ampdu_underrun_usr);
  1077. }
  1078. /*
  1079. * dp_print_tx_hwq_mu_mimo_cmn_stats_tlv: display htt_tx_hwq_mu_mimo_cmn_stats
  1080. * @tag_buf: buffer containing the tlv htt_tx_hwq_mu_mimo_cmn_stats_tlv
  1081. *
  1082. * return:void
  1083. */
  1084. static inline void dp_print_tx_hwq_mu_mimo_cmn_stats_tlv(uint32_t *tag_buf)
  1085. {
  1086. htt_tx_hwq_mu_mimo_cmn_stats_tlv *dp_stats_buf =
  1087. (htt_tx_hwq_mu_mimo_cmn_stats_tlv *)tag_buf;
  1088. DP_PRINT_STATS("HTT_TX_HWQ_MU_MIMO_CMN_STATS_TLV:");
  1089. DP_PRINT_STATS("mac_id__hwq_id__word = %u\n",
  1090. dp_stats_buf->mac_id__hwq_id__word);
  1091. }
  1092. /*
  1093. * dp_print_tx_hwq_stats_cmn_tlv: display htt_tx_hwq_stats_cmn_tlv
  1094. * @tag_buf: buffer containing the tlv htt_tx_hwq_stats_cmn_tlv
  1095. *
  1096. * return:void
  1097. */
  1098. static inline void dp_print_tx_hwq_stats_cmn_tlv(uint32_t *tag_buf)
  1099. {
  1100. htt_tx_hwq_stats_cmn_tlv *dp_stats_buf =
  1101. (htt_tx_hwq_stats_cmn_tlv *)tag_buf;
  1102. DP_PRINT_STATS("HTT_TX_HWQ_STATS_CMN_TLV:");
  1103. DP_PRINT_STATS("mac_id__hwq_id__word = %u",
  1104. dp_stats_buf->mac_id__hwq_id__word);
  1105. DP_PRINT_STATS("xretry = %u",
  1106. dp_stats_buf->xretry);
  1107. DP_PRINT_STATS("underrun_cnt = %u",
  1108. dp_stats_buf->underrun_cnt);
  1109. DP_PRINT_STATS("flush_cnt = %u",
  1110. dp_stats_buf->flush_cnt);
  1111. DP_PRINT_STATS("filt_cnt = %u",
  1112. dp_stats_buf->filt_cnt);
  1113. DP_PRINT_STATS("null_mpdu_bmap = %u",
  1114. dp_stats_buf->null_mpdu_bmap);
  1115. DP_PRINT_STATS("user_ack_failure = %u",
  1116. dp_stats_buf->user_ack_failure);
  1117. DP_PRINT_STATS("ack_tlv_proc = %u",
  1118. dp_stats_buf->ack_tlv_proc);
  1119. DP_PRINT_STATS("sched_id_proc = %u",
  1120. dp_stats_buf->sched_id_proc);
  1121. DP_PRINT_STATS("null_mpdu_tx_count = %u",
  1122. dp_stats_buf->null_mpdu_tx_count);
  1123. DP_PRINT_STATS("mpdu_bmap_not_recvd = %u",
  1124. dp_stats_buf->mpdu_bmap_not_recvd);
  1125. DP_PRINT_STATS("num_bar = %u",
  1126. dp_stats_buf->num_bar);
  1127. DP_PRINT_STATS("rts = %u",
  1128. dp_stats_buf->rts);
  1129. DP_PRINT_STATS("cts2self = %u",
  1130. dp_stats_buf->cts2self);
  1131. DP_PRINT_STATS("qos_null = %u",
  1132. dp_stats_buf->qos_null);
  1133. DP_PRINT_STATS("mpdu_tried_cnt = %u",
  1134. dp_stats_buf->mpdu_tried_cnt);
  1135. DP_PRINT_STATS("mpdu_queued_cnt = %u",
  1136. dp_stats_buf->mpdu_queued_cnt);
  1137. DP_PRINT_STATS("mpdu_ack_fail_cnt = %u",
  1138. dp_stats_buf->mpdu_ack_fail_cnt);
  1139. DP_PRINT_STATS("mpdu_filt_cnt = %u",
  1140. dp_stats_buf->mpdu_filt_cnt);
  1141. DP_PRINT_STATS("false_mpdu_ack_count = %u\n",
  1142. dp_stats_buf->false_mpdu_ack_count);
  1143. }
  1144. /*
  1145. * dp_print_tx_hwq_difs_latency_stats_tlv_v: display
  1146. * htt_tx_hwq_difs_latency_stats_tlv_v
  1147. * @tag_buf: buffer containing the tlv htt_tx_hwq_difs_latency_stats_tlv_v
  1148. *
  1149. *return:void
  1150. */
  1151. static inline void dp_print_tx_hwq_difs_latency_stats_tlv_v(uint32_t *tag_buf)
  1152. {
  1153. htt_tx_hwq_difs_latency_stats_tlv_v *dp_stats_buf =
  1154. (htt_tx_hwq_difs_latency_stats_tlv_v *)tag_buf;
  1155. uint8_t i;
  1156. uint16_t index = 0;
  1157. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  1158. char *difs_latency_hist = qdf_mem_malloc(DP_MAX_STRING_LEN);
  1159. if (!difs_latency_hist) {
  1160. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  1161. FL("Output buffer not allocated"));
  1162. return;
  1163. }
  1164. tag_len = qdf_min(tag_len,
  1165. (uint32_t)HTT_TX_HWQ_MAX_DIFS_LATENCY_BINS);
  1166. DP_PRINT_STATS("HTT_TX_HWQ_DIFS_LATENCY_STATS_TLV_V:");
  1167. DP_PRINT_STATS("hist_intvl = %u",
  1168. dp_stats_buf->hist_intvl);
  1169. for (i = 0; i < tag_len; i++) {
  1170. index += qdf_snprint(&difs_latency_hist[index],
  1171. DP_MAX_STRING_LEN - index,
  1172. " %u:%u,", i,
  1173. dp_stats_buf->difs_latency_hist[i]);
  1174. }
  1175. DP_PRINT_STATS("difs_latency_hist = %s\n", difs_latency_hist);
  1176. qdf_mem_free(difs_latency_hist);
  1177. }
  1178. /*
  1179. * dp_print_tx_hwq_cmd_result_stats_tlv_v: display htt_tx_hwq_cmd_result_stats
  1180. * @tag_buf: buffer containing the tlv htt_tx_hwq_cmd_result_stats_tlv_v
  1181. *
  1182. * return:void
  1183. */
  1184. static inline void dp_print_tx_hwq_cmd_result_stats_tlv_v(uint32_t *tag_buf)
  1185. {
  1186. htt_tx_hwq_cmd_result_stats_tlv_v *dp_stats_buf =
  1187. (htt_tx_hwq_cmd_result_stats_tlv_v *)tag_buf;
  1188. uint8_t i;
  1189. uint16_t index = 0;
  1190. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  1191. char *cmd_result = qdf_mem_malloc(DP_MAX_STRING_LEN);
  1192. if (!cmd_result) {
  1193. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  1194. FL("Output buffer not allocated"));
  1195. return;
  1196. }
  1197. tag_len = qdf_min(tag_len, (uint32_t)HTT_TX_HWQ_MAX_CMD_RESULT_STATS);
  1198. DP_PRINT_STATS("HTT_TX_HWQ_CMD_RESULT_STATS_TLV_V:");
  1199. for (i = 0; i < tag_len; i++) {
  1200. index += qdf_snprint(&cmd_result[index],
  1201. DP_MAX_STRING_LEN - index,
  1202. " %u:%u,", i, dp_stats_buf->cmd_result[i]);
  1203. }
  1204. DP_PRINT_STATS("cmd_result = %s ", cmd_result);
  1205. qdf_mem_free(cmd_result);
  1206. }
  1207. /*
  1208. * dp_print_tx_hwq_cmd_stall_stats_tlv_v: display htt_tx_hwq_cmd_stall_stats_tlv
  1209. * @tag_buf: buffer containing the tlv htt_tx_hwq_cmd_stall_stats_tlv_v
  1210. *
  1211. * return:void
  1212. */
  1213. static inline void dp_print_tx_hwq_cmd_stall_stats_tlv_v(uint32_t *tag_buf)
  1214. {
  1215. htt_tx_hwq_cmd_stall_stats_tlv_v *dp_stats_buf =
  1216. (htt_tx_hwq_cmd_stall_stats_tlv_v *)tag_buf;
  1217. uint8_t i;
  1218. uint16_t index = 0;
  1219. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  1220. char *cmd_stall_status = qdf_mem_malloc(DP_MAX_STRING_LEN);
  1221. if (!cmd_stall_status) {
  1222. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  1223. FL("Output buffer not allocated"));
  1224. return;
  1225. }
  1226. tag_len = qdf_min(tag_len, (uint32_t)HTT_TX_HWQ_MAX_CMD_STALL_STATS);
  1227. DP_PRINT_STATS("HTT_TX_HWQ_CMD_STALL_STATS_TLV_V:");
  1228. for (i = 0; i < tag_len; i++) {
  1229. index += qdf_snprint(&cmd_stall_status[index],
  1230. DP_MAX_STRING_LEN - index,
  1231. " %u:%u,", i,
  1232. dp_stats_buf->cmd_stall_status[i]);
  1233. }
  1234. DP_PRINT_STATS("cmd_stall_status = %s\n", cmd_stall_status);
  1235. qdf_mem_free(cmd_stall_status);
  1236. }
  1237. /*
  1238. * dp_print_tx_hwq_fes_result_stats_tlv_v: display htt_tx_hwq_fes_result_stats
  1239. * @tag_buf: buffer containing the tlv htt_tx_hwq_fes_result_stats_tlv_v
  1240. *
  1241. * return:void
  1242. */
  1243. static inline void dp_print_tx_hwq_fes_result_stats_tlv_v(uint32_t *tag_buf)
  1244. {
  1245. htt_tx_hwq_fes_result_stats_tlv_v *dp_stats_buf =
  1246. (htt_tx_hwq_fes_result_stats_tlv_v *)tag_buf;
  1247. uint8_t i;
  1248. uint16_t index = 0;
  1249. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  1250. char *fes_result = qdf_mem_malloc(DP_MAX_STRING_LEN);
  1251. if (!fes_result) {
  1252. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  1253. FL("Output buffer not allocated"));
  1254. return;
  1255. }
  1256. tag_len = qdf_min(tag_len, (uint32_t)HTT_TX_HWQ_MAX_FES_RESULT_STATS);
  1257. DP_PRINT_STATS("HTT_TX_HWQ_FES_RESULT_STATS_TLV_V:");
  1258. for (i = 0; i < tag_len; i++) {
  1259. index += qdf_snprint(&fes_result[index],
  1260. DP_MAX_STRING_LEN - index,
  1261. " %u:%u,", i, dp_stats_buf->fes_result[i]);
  1262. }
  1263. DP_PRINT_STATS("fes_result = %s ", fes_result);
  1264. qdf_mem_free(fes_result);
  1265. }
  1266. /*
  1267. * dp_print_tx_selfgen_cmn_stats_tlv: display htt_tx_selfgen_cmn_stats_tlv
  1268. * @tag_buf: buffer containing the tlv htt_tx_selfgen_cmn_stats_tlv
  1269. *
  1270. * return:void
  1271. */
  1272. static inline void dp_print_tx_selfgen_cmn_stats_tlv(uint32_t *tag_buf)
  1273. {
  1274. htt_tx_selfgen_cmn_stats_tlv *dp_stats_buf =
  1275. (htt_tx_selfgen_cmn_stats_tlv *)tag_buf;
  1276. DP_PRINT_STATS("HTT_TX_SELFGEN_CMN_STATS_TLV:");
  1277. DP_PRINT_STATS("mac_id__word = %u",
  1278. dp_stats_buf->mac_id__word);
  1279. DP_PRINT_STATS("su_bar = %u",
  1280. dp_stats_buf->su_bar);
  1281. DP_PRINT_STATS("rts = %u",
  1282. dp_stats_buf->rts);
  1283. DP_PRINT_STATS("cts2self = %u",
  1284. dp_stats_buf->cts2self);
  1285. DP_PRINT_STATS("qos_null = %u",
  1286. dp_stats_buf->qos_null);
  1287. DP_PRINT_STATS("delayed_bar_1 = %u",
  1288. dp_stats_buf->delayed_bar_1);
  1289. DP_PRINT_STATS("delayed_bar_2 = %u",
  1290. dp_stats_buf->delayed_bar_2);
  1291. DP_PRINT_STATS("delayed_bar_3 = %u",
  1292. dp_stats_buf->delayed_bar_3);
  1293. DP_PRINT_STATS("delayed_bar_4 = %u",
  1294. dp_stats_buf->delayed_bar_4);
  1295. DP_PRINT_STATS("delayed_bar_5 = %u",
  1296. dp_stats_buf->delayed_bar_5);
  1297. DP_PRINT_STATS("delayed_bar_6 = %u",
  1298. dp_stats_buf->delayed_bar_6);
  1299. DP_PRINT_STATS("delayed_bar_7 = %u\n",
  1300. dp_stats_buf->delayed_bar_7);
  1301. }
  1302. /*
  1303. * dp_print_tx_selfgen_ac_stats_tlv: display htt_tx_selfgen_ac_stats_tlv
  1304. * @tag_buf: buffer containing the tlv htt_tx_selfgen_ac_stats_tlv
  1305. *
  1306. * return:void
  1307. */
  1308. static inline void dp_print_tx_selfgen_ac_stats_tlv(uint32_t *tag_buf)
  1309. {
  1310. htt_tx_selfgen_ac_stats_tlv *dp_stats_buf =
  1311. (htt_tx_selfgen_ac_stats_tlv *)tag_buf;
  1312. DP_PRINT_STATS("HTT_TX_SELFGEN_AC_STATS_TLV:");
  1313. DP_PRINT_STATS("ac_su_ndpa = %u",
  1314. dp_stats_buf->ac_su_ndpa);
  1315. DP_PRINT_STATS("ac_su_ndp = %u",
  1316. dp_stats_buf->ac_su_ndp);
  1317. DP_PRINT_STATS("ac_mu_mimo_ndpa = %u",
  1318. dp_stats_buf->ac_mu_mimo_ndpa);
  1319. DP_PRINT_STATS("ac_mu_mimo_ndp = %u",
  1320. dp_stats_buf->ac_mu_mimo_ndp);
  1321. DP_PRINT_STATS("ac_mu_mimo_brpoll_1 = %u",
  1322. dp_stats_buf->ac_mu_mimo_brpoll_1);
  1323. DP_PRINT_STATS("ac_mu_mimo_brpoll_2 = %u",
  1324. dp_stats_buf->ac_mu_mimo_brpoll_2);
  1325. DP_PRINT_STATS("ac_mu_mimo_brpoll_3 = %u\n",
  1326. dp_stats_buf->ac_mu_mimo_brpoll_3);
  1327. }
  1328. /*
  1329. * dp_print_tx_selfgen_ax_stats_tlv: display htt_tx_selfgen_ax_stats_tlv
  1330. * @tag_buf: buffer containing the tlv htt_tx_selfgen_ax_stats_tlv
  1331. *
  1332. * return:void
  1333. */
  1334. static inline void dp_print_tx_selfgen_ax_stats_tlv(uint32_t *tag_buf)
  1335. {
  1336. htt_tx_selfgen_ax_stats_tlv *dp_stats_buf =
  1337. (htt_tx_selfgen_ax_stats_tlv *)tag_buf;
  1338. DP_PRINT_STATS("HTT_TX_SELFGEN_AX_STATS_TLV:");
  1339. DP_PRINT_STATS("ax_su_ndpa = %u",
  1340. dp_stats_buf->ax_su_ndpa);
  1341. DP_PRINT_STATS("ax_su_ndp = %u",
  1342. dp_stats_buf->ax_su_ndp);
  1343. DP_PRINT_STATS("ax_mu_mimo_ndpa = %u",
  1344. dp_stats_buf->ax_mu_mimo_ndpa);
  1345. DP_PRINT_STATS("ax_mu_mimo_ndp = %u",
  1346. dp_stats_buf->ax_mu_mimo_ndp);
  1347. DP_PRINT_STATS("ax_mu_mimo_brpoll_1 = %u",
  1348. dp_stats_buf->ax_mu_mimo_brpoll_1);
  1349. DP_PRINT_STATS("ax_mu_mimo_brpoll_2 = %u",
  1350. dp_stats_buf->ax_mu_mimo_brpoll_2);
  1351. DP_PRINT_STATS("ax_mu_mimo_brpoll_3 = %u",
  1352. dp_stats_buf->ax_mu_mimo_brpoll_3);
  1353. DP_PRINT_STATS("ax_mu_mimo_brpoll_4 = %u",
  1354. dp_stats_buf->ax_mu_mimo_brpoll_4);
  1355. DP_PRINT_STATS("ax_mu_mimo_brpoll_5 = %u",
  1356. dp_stats_buf->ax_mu_mimo_brpoll_5);
  1357. DP_PRINT_STATS("ax_mu_mimo_brpoll_6 = %u",
  1358. dp_stats_buf->ax_mu_mimo_brpoll_6);
  1359. DP_PRINT_STATS("ax_mu_mimo_brpoll_7 = %u",
  1360. dp_stats_buf->ax_mu_mimo_brpoll_7);
  1361. DP_PRINT_STATS("ax_basic_trigger = %u",
  1362. dp_stats_buf->ax_basic_trigger);
  1363. DP_PRINT_STATS("ax_bsr_trigger = %u",
  1364. dp_stats_buf->ax_bsr_trigger);
  1365. DP_PRINT_STATS("ax_mu_bar_trigger = %u",
  1366. dp_stats_buf->ax_mu_bar_trigger);
  1367. DP_PRINT_STATS("ax_mu_rts_trigger = %u\n",
  1368. dp_stats_buf->ax_mu_rts_trigger);
  1369. }
  1370. /*
  1371. * dp_print_tx_selfgen_ac_err_stats_tlv: display htt_tx_selfgen_ac_err_stats_tlv
  1372. * @tag_buf: buffer containing the tlv htt_tx_selfgen_ac_err_stats_tlv
  1373. *
  1374. * return:void
  1375. */
  1376. static inline void dp_print_tx_selfgen_ac_err_stats_tlv(uint32_t *tag_buf)
  1377. {
  1378. htt_tx_selfgen_ac_err_stats_tlv *dp_stats_buf =
  1379. (htt_tx_selfgen_ac_err_stats_tlv *)tag_buf;
  1380. DP_PRINT_STATS("HTT_TX_SELFGEN_AC_ERR_STATS_TLV:");
  1381. DP_PRINT_STATS("ac_su_ndp_err = %u",
  1382. dp_stats_buf->ac_su_ndp_err);
  1383. DP_PRINT_STATS("ac_su_ndpa_err = %u",
  1384. dp_stats_buf->ac_su_ndpa_err);
  1385. DP_PRINT_STATS("ac_mu_mimo_ndpa_err = %u",
  1386. dp_stats_buf->ac_mu_mimo_ndpa_err);
  1387. DP_PRINT_STATS("ac_mu_mimo_ndp_err = %u",
  1388. dp_stats_buf->ac_mu_mimo_ndp_err);
  1389. DP_PRINT_STATS("ac_mu_mimo_brp1_err = %u",
  1390. dp_stats_buf->ac_mu_mimo_brp1_err);
  1391. DP_PRINT_STATS("ac_mu_mimo_brp2_err = %u",
  1392. dp_stats_buf->ac_mu_mimo_brp2_err);
  1393. DP_PRINT_STATS("ac_mu_mimo_brp3_err = %u\n",
  1394. dp_stats_buf->ac_mu_mimo_brp3_err);
  1395. }
  1396. /*
  1397. * dp_print_tx_selfgen_ax_err_stats_tlv: display htt_tx_selfgen_ax_err_stats_tlv
  1398. * @tag_buf: buffer containing the tlv htt_tx_selfgen_ax_err_stats_tlv
  1399. *
  1400. * return:void
  1401. */
  1402. static inline void dp_print_tx_selfgen_ax_err_stats_tlv(uint32_t *tag_buf)
  1403. {
  1404. htt_tx_selfgen_ax_err_stats_tlv *dp_stats_buf =
  1405. (htt_tx_selfgen_ax_err_stats_tlv *)tag_buf;
  1406. DP_PRINT_STATS("HTT_TX_SELFGEN_AX_ERR_STATS_TLV:");
  1407. DP_PRINT_STATS("ax_su_ndp_err = %u",
  1408. dp_stats_buf->ax_su_ndp_err);
  1409. DP_PRINT_STATS("ax_su_ndpa_err = %u",
  1410. dp_stats_buf->ax_su_ndpa_err);
  1411. DP_PRINT_STATS("ax_mu_mimo_ndpa_err = %u",
  1412. dp_stats_buf->ax_mu_mimo_ndpa_err);
  1413. DP_PRINT_STATS("ax_mu_mimo_ndp_err = %u",
  1414. dp_stats_buf->ax_mu_mimo_ndp_err);
  1415. DP_PRINT_STATS("ax_mu_mimo_brp1_err = %u",
  1416. dp_stats_buf->ax_mu_mimo_brp1_err);
  1417. DP_PRINT_STATS("ax_mu_mimo_brp2_err = %u",
  1418. dp_stats_buf->ax_mu_mimo_brp2_err);
  1419. DP_PRINT_STATS("ax_mu_mimo_brp3_err = %u",
  1420. dp_stats_buf->ax_mu_mimo_brp3_err);
  1421. DP_PRINT_STATS("ax_mu_mimo_brp4_err = %u",
  1422. dp_stats_buf->ax_mu_mimo_brp4_err);
  1423. DP_PRINT_STATS("ax_mu_mimo_brp5_err = %u",
  1424. dp_stats_buf->ax_mu_mimo_brp5_err);
  1425. DP_PRINT_STATS("ax_mu_mimo_brp6_err = %u",
  1426. dp_stats_buf->ax_mu_mimo_brp6_err);
  1427. DP_PRINT_STATS("ax_mu_mimo_brp7_err = %u",
  1428. dp_stats_buf->ax_mu_mimo_brp7_err);
  1429. DP_PRINT_STATS("ax_basic_trigger_err = %u",
  1430. dp_stats_buf->ax_basic_trigger_err);
  1431. DP_PRINT_STATS("ax_bsr_trigger_err = %u",
  1432. dp_stats_buf->ax_bsr_trigger_err);
  1433. DP_PRINT_STATS("ax_mu_bar_trigger_err = %u",
  1434. dp_stats_buf->ax_mu_bar_trigger_err);
  1435. DP_PRINT_STATS("ax_mu_rts_trigger_err = %u\n",
  1436. dp_stats_buf->ax_mu_rts_trigger_err);
  1437. }
  1438. /*
  1439. * dp_print_tx_pdev_mu_mimo_sch_stats_tlv: display htt_tx_pdev_mu_mimo_sch_stats
  1440. * @tag_buf: buffer containing the tlv htt_tx_pdev_mu_mimo_sch_stats_tlv
  1441. *
  1442. * return:void
  1443. */
  1444. static inline void dp_print_tx_pdev_mu_mimo_sch_stats_tlv(uint32_t *tag_buf)
  1445. {
  1446. uint8_t i;
  1447. htt_tx_pdev_mu_mimo_sch_stats_tlv *dp_stats_buf =
  1448. (htt_tx_pdev_mu_mimo_sch_stats_tlv *)tag_buf;
  1449. DP_PRINT_STATS("HTT_TX_PDEV_MU_MIMO_SCH_STATS_TLV:");
  1450. DP_PRINT_STATS("mu_mimo_sch_posted = %u",
  1451. dp_stats_buf->mu_mimo_sch_posted);
  1452. DP_PRINT_STATS("mu_mimo_sch_failed = %u",
  1453. dp_stats_buf->mu_mimo_sch_failed);
  1454. DP_PRINT_STATS("mu_mimo_ppdu_posted = %u\n",
  1455. dp_stats_buf->mu_mimo_ppdu_posted);
  1456. DP_PRINT_STATS("11ac MU_MIMO SCH STATS:");
  1457. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS; i++) {
  1458. DP_PRINT_STATS("ac_mu_mimo_sch_nusers_%u = %u", i,
  1459. dp_stats_buf->ac_mu_mimo_sch_nusers[i]);
  1460. }
  1461. DP_PRINT_STATS("\n11ax MU_MIMO SCH STATS:");
  1462. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS; i++) {
  1463. DP_PRINT_STATS("ax_mu_mimo_sch_nusers_%u = %u", i,
  1464. dp_stats_buf->ax_mu_mimo_sch_nusers[i]);
  1465. }
  1466. DP_PRINT_STATS("\n11ax OFDMA SCH STATS:");
  1467. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS; i++) {
  1468. DP_PRINT_STATS("ax_ofdma_sch_nusers_%u = %u", i,
  1469. dp_stats_buf->ax_ofdma_sch_nusers[i]);
  1470. }
  1471. }
  1472. /*
  1473. * dp_print_tx_pdev_mu_mimo_mpdu_stats_tlv: display
  1474. * htt_tx_pdev_mu_mimo_mpdu_stats_tlv
  1475. * @tag_buf: buffer containing the tlv htt_tx_pdev_mu_mimo_mpdu_stats_tlv
  1476. *
  1477. * return:void
  1478. */
  1479. static inline void dp_print_tx_pdev_mu_mimo_mpdu_stats_tlv(uint32_t *tag_buf)
  1480. {
  1481. htt_tx_pdev_mpdu_stats_tlv *dp_stats_buf =
  1482. (htt_tx_pdev_mpdu_stats_tlv *)tag_buf;
  1483. if (dp_stats_buf->tx_sched_mode ==
  1484. HTT_STATS_TX_SCHED_MODE_MU_MIMO_AC) {
  1485. if (!dp_stats_buf->user_index)
  1486. DP_PRINT_STATS(
  1487. "HTT_TX_PDEV_MU_MIMO_AC_MPDU_STATS:\n");
  1488. if (dp_stats_buf->user_index <
  1489. HTT_TX_PDEV_STATS_NUM_AC_MUMIMO_USER_STATS) {
  1490. DP_PRINT_STATS(
  1491. "ac_mu_mimo_mpdus_queued_usr_%u = %u",
  1492. dp_stats_buf->user_index,
  1493. dp_stats_buf->mpdus_queued_usr);
  1494. DP_PRINT_STATS(
  1495. "ac_mu_mimo_mpdus_tried_usr_%u = %u",
  1496. dp_stats_buf->user_index,
  1497. dp_stats_buf->mpdus_tried_usr);
  1498. DP_PRINT_STATS(
  1499. "ac_mu_mimo_mpdus_failed_usr_%u = %u",
  1500. dp_stats_buf->user_index,
  1501. dp_stats_buf->mpdus_failed_usr);
  1502. DP_PRINT_STATS(
  1503. "ac_mu_mimo_mpdus_requeued_usr_%u = %u",
  1504. dp_stats_buf->user_index,
  1505. dp_stats_buf->mpdus_requeued_usr);
  1506. DP_PRINT_STATS(
  1507. "ac_mu_mimo_err_no_ba_usr_%u = %u",
  1508. dp_stats_buf->user_index,
  1509. dp_stats_buf->err_no_ba_usr);
  1510. DP_PRINT_STATS(
  1511. "ac_mu_mimo_mpdu_underrun_usr_%u = %u",
  1512. dp_stats_buf->user_index,
  1513. dp_stats_buf->mpdu_underrun_usr);
  1514. DP_PRINT_STATS(
  1515. "ac_mu_mimo_ampdu_underrun_usr_%u = %u\n",
  1516. dp_stats_buf->user_index,
  1517. dp_stats_buf->ampdu_underrun_usr);
  1518. }
  1519. }
  1520. if (dp_stats_buf->tx_sched_mode == HTT_STATS_TX_SCHED_MODE_MU_MIMO_AX) {
  1521. if (!dp_stats_buf->user_index)
  1522. DP_PRINT_STATS(
  1523. "HTT_TX_PDEV_MU_MIMO_AX_MPDU_STATS:\n");
  1524. if (dp_stats_buf->user_index <
  1525. HTT_TX_PDEV_STATS_NUM_AX_MUMIMO_USER_STATS) {
  1526. DP_PRINT_STATS(
  1527. "ax_mu_mimo_mpdus_queued_usr_%u = %u",
  1528. dp_stats_buf->user_index,
  1529. dp_stats_buf->mpdus_queued_usr);
  1530. DP_PRINT_STATS(
  1531. "ax_mu_mimo_mpdus_tried_usr_%u = %u",
  1532. dp_stats_buf->user_index,
  1533. dp_stats_buf->mpdus_tried_usr);
  1534. DP_PRINT_STATS(
  1535. "ax_mu_mimo_mpdus_failed_usr_%u = %u",
  1536. dp_stats_buf->user_index,
  1537. dp_stats_buf->mpdus_failed_usr);
  1538. DP_PRINT_STATS(
  1539. "ax_mu_mimo_mpdus_requeued_usr_%u = %u",
  1540. dp_stats_buf->user_index,
  1541. dp_stats_buf->mpdus_requeued_usr);
  1542. DP_PRINT_STATS(
  1543. "ax_mu_mimo_err_no_ba_usr_%u = %u",
  1544. dp_stats_buf->user_index,
  1545. dp_stats_buf->err_no_ba_usr);
  1546. DP_PRINT_STATS(
  1547. "ax_mu_mimo_mpdu_underrun_usr_%u = %u",
  1548. dp_stats_buf->user_index,
  1549. dp_stats_buf->mpdu_underrun_usr);
  1550. DP_PRINT_STATS(
  1551. "ax_mu_mimo_ampdu_underrun_usr_%u = %u\n",
  1552. dp_stats_buf->user_index,
  1553. dp_stats_buf->ampdu_underrun_usr);
  1554. }
  1555. }
  1556. if (dp_stats_buf->tx_sched_mode ==
  1557. HTT_STATS_TX_SCHED_MODE_MU_OFDMA_AX) {
  1558. if (!dp_stats_buf->user_index)
  1559. DP_PRINT_STATS(
  1560. "HTT_TX_PDEV_AX_MU_OFDMA_MPDU_STATS:\n");
  1561. if (dp_stats_buf->user_index <
  1562. HTT_TX_PDEV_STATS_NUM_OFDMA_USER_STATS) {
  1563. DP_PRINT_STATS(
  1564. "ax_mu_ofdma_mpdus_queued_usr_%u = %u",
  1565. dp_stats_buf->user_index,
  1566. dp_stats_buf->mpdus_queued_usr);
  1567. DP_PRINT_STATS(
  1568. "ax_mu_ofdma_mpdus_tried_usr_%u = %u",
  1569. dp_stats_buf->user_index,
  1570. dp_stats_buf->mpdus_tried_usr);
  1571. DP_PRINT_STATS(
  1572. "ax_mu_ofdma_mpdus_failed_usr_%u = %u",
  1573. dp_stats_buf->user_index,
  1574. dp_stats_buf->mpdus_failed_usr);
  1575. DP_PRINT_STATS(
  1576. "ax_mu_ofdma_mpdus_requeued_usr_%u = %u",
  1577. dp_stats_buf->user_index,
  1578. dp_stats_buf->mpdus_requeued_usr);
  1579. DP_PRINT_STATS(
  1580. "ax_mu_ofdma_err_no_ba_usr_%u = %u",
  1581. dp_stats_buf->user_index,
  1582. dp_stats_buf->err_no_ba_usr);
  1583. DP_PRINT_STATS(
  1584. "ax_mu_ofdma_mpdu_underrun_usr_%u = %u",
  1585. dp_stats_buf->user_index,
  1586. dp_stats_buf->mpdu_underrun_usr);
  1587. DP_PRINT_STATS(
  1588. "ax_mu_ofdma_ampdu_underrun_usr_%u = %u\n",
  1589. dp_stats_buf->user_index,
  1590. dp_stats_buf->ampdu_underrun_usr);
  1591. }
  1592. }
  1593. }
  1594. /*
  1595. * dp_print_sched_txq_cmd_posted_tlv_v: display htt_sched_txq_cmd_posted_tlv_v
  1596. * @tag_buf: buffer containing the tlv htt_sched_txq_cmd_posted_tlv_v
  1597. *
  1598. * return:void
  1599. */
  1600. static inline void dp_print_sched_txq_cmd_posted_tlv_v(uint32_t *tag_buf)
  1601. {
  1602. htt_sched_txq_cmd_posted_tlv_v *dp_stats_buf =
  1603. (htt_sched_txq_cmd_posted_tlv_v *)tag_buf;
  1604. uint8_t i;
  1605. uint16_t index = 0;
  1606. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  1607. char *sched_cmd_posted = qdf_mem_malloc(DP_MAX_STRING_LEN);
  1608. if (!sched_cmd_posted) {
  1609. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  1610. FL("Output buffer not allocated"));
  1611. return;
  1612. }
  1613. tag_len = qdf_min(tag_len, (uint32_t)HTT_TX_PDEV_SCHED_TX_MODE_MAX);
  1614. DP_PRINT_STATS("HTT_SCHED_TXQ_CMD_POSTED_TLV_V:");
  1615. for (i = 0; i < tag_len; i++) {
  1616. index += qdf_snprint(&sched_cmd_posted[index],
  1617. DP_MAX_STRING_LEN - index,
  1618. " %u:%u,", i,
  1619. dp_stats_buf->sched_cmd_posted[i]);
  1620. }
  1621. DP_PRINT_STATS("sched_cmd_posted = %s\n", sched_cmd_posted);
  1622. qdf_mem_free(sched_cmd_posted);
  1623. }
  1624. /*
  1625. * dp_print_sched_txq_cmd_reaped_tlv_v: display htt_sched_txq_cmd_reaped_tlv_v
  1626. * @tag_buf: buffer containing the tlv htt_sched_txq_cmd_reaped_tlv_v
  1627. *
  1628. * return:void
  1629. */
  1630. static inline void dp_print_sched_txq_cmd_reaped_tlv_v(uint32_t *tag_buf)
  1631. {
  1632. htt_sched_txq_cmd_reaped_tlv_v *dp_stats_buf =
  1633. (htt_sched_txq_cmd_reaped_tlv_v *)tag_buf;
  1634. uint8_t i;
  1635. uint16_t index = 0;
  1636. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  1637. char *sched_cmd_reaped = qdf_mem_malloc(DP_MAX_STRING_LEN);
  1638. if (!sched_cmd_reaped) {
  1639. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  1640. FL("Output buffer not allocated"));
  1641. return;
  1642. }
  1643. tag_len = qdf_min(tag_len, (uint32_t)HTT_TX_PDEV_SCHED_TX_MODE_MAX);
  1644. DP_PRINT_STATS("HTT_SCHED_TXQ_CMD_REAPED_TLV_V:");
  1645. for (i = 0; i < tag_len; i++) {
  1646. index += qdf_snprint(&sched_cmd_reaped[index],
  1647. DP_MAX_STRING_LEN - index,
  1648. " %u:%u,", i,
  1649. dp_stats_buf->sched_cmd_reaped[i]);
  1650. }
  1651. DP_PRINT_STATS("sched_cmd_reaped = %s\n", sched_cmd_reaped);
  1652. qdf_mem_free(sched_cmd_reaped);
  1653. }
  1654. /*
  1655. * dp_print_tx_pdev_stats_sched_per_txq_tlv: display
  1656. * htt_tx_pdev_stats_sched_per_txq_tlv
  1657. * @tag_buf: buffer containing the tlv htt_tx_pdev_stats_sched_per_txq_tlv
  1658. *
  1659. * return:void
  1660. */
  1661. static inline void dp_print_tx_pdev_stats_sched_per_txq_tlv(uint32_t *tag_buf)
  1662. {
  1663. htt_tx_pdev_stats_sched_per_txq_tlv *dp_stats_buf =
  1664. (htt_tx_pdev_stats_sched_per_txq_tlv *)tag_buf;
  1665. DP_PRINT_STATS("HTT_TX_PDEV_STATS_SCHED_PER_TXQ_TLV:");
  1666. DP_PRINT_STATS("mac_id__txq_id__word = %u",
  1667. dp_stats_buf->mac_id__txq_id__word);
  1668. DP_PRINT_STATS("sched_policy = %u",
  1669. dp_stats_buf->sched_policy);
  1670. DP_PRINT_STATS("last_sched_cmd_posted_timestamp = %u",
  1671. dp_stats_buf->last_sched_cmd_posted_timestamp);
  1672. DP_PRINT_STATS("last_sched_cmd_compl_timestamp = %u",
  1673. dp_stats_buf->last_sched_cmd_compl_timestamp);
  1674. DP_PRINT_STATS("sched_2_tac_lwm_count = %u",
  1675. dp_stats_buf->sched_2_tac_lwm_count);
  1676. DP_PRINT_STATS("sched_2_tac_ring_full = %u",
  1677. dp_stats_buf->sched_2_tac_ring_full);
  1678. DP_PRINT_STATS("sched_cmd_post_failure = %u",
  1679. dp_stats_buf->sched_cmd_post_failure);
  1680. DP_PRINT_STATS("num_active_tids = %u",
  1681. dp_stats_buf->num_active_tids);
  1682. DP_PRINT_STATS("num_ps_schedules = %u",
  1683. dp_stats_buf->num_ps_schedules);
  1684. DP_PRINT_STATS("sched_cmds_pending = %u",
  1685. dp_stats_buf->sched_cmds_pending);
  1686. DP_PRINT_STATS("num_tid_register = %u",
  1687. dp_stats_buf->num_tid_register);
  1688. DP_PRINT_STATS("num_tid_unregister = %u",
  1689. dp_stats_buf->num_tid_unregister);
  1690. DP_PRINT_STATS("num_qstats_queried = %u",
  1691. dp_stats_buf->num_qstats_queried);
  1692. DP_PRINT_STATS("qstats_update_pending = %u",
  1693. dp_stats_buf->qstats_update_pending);
  1694. DP_PRINT_STATS("last_qstats_query_timestamp = %u",
  1695. dp_stats_buf->last_qstats_query_timestamp);
  1696. DP_PRINT_STATS("num_tqm_cmdq_full = %u",
  1697. dp_stats_buf->num_tqm_cmdq_full);
  1698. DP_PRINT_STATS("num_de_sched_algo_trigger = %u",
  1699. dp_stats_buf->num_de_sched_algo_trigger);
  1700. DP_PRINT_STATS("num_rt_sched_algo_trigger = %u",
  1701. dp_stats_buf->num_rt_sched_algo_trigger);
  1702. DP_PRINT_STATS("num_tqm_sched_algo_trigger = %u",
  1703. dp_stats_buf->num_tqm_sched_algo_trigger);
  1704. DP_PRINT_STATS("notify_sched = %u\n",
  1705. dp_stats_buf->notify_sched);
  1706. }
  1707. /*
  1708. * dp_print_stats_tx_sched_cmn_tlv: display htt_stats_tx_sched_cmn_tlv
  1709. * @tag_buf: buffer containing the tlv htt_stats_tx_sched_cmn_tlv
  1710. *
  1711. * return:void
  1712. */
  1713. static inline void dp_print_stats_tx_sched_cmn_tlv(uint32_t *tag_buf)
  1714. {
  1715. htt_stats_tx_sched_cmn_tlv *dp_stats_buf =
  1716. (htt_stats_tx_sched_cmn_tlv *)tag_buf;
  1717. DP_PRINT_STATS("HTT_STATS_TX_SCHED_CMN_TLV:");
  1718. DP_PRINT_STATS("mac_id__word = %u",
  1719. dp_stats_buf->mac_id__word);
  1720. DP_PRINT_STATS("current_timestamp = %u\n",
  1721. dp_stats_buf->current_timestamp);
  1722. }
  1723. /*
  1724. * dp_print_tx_tqm_gen_mpdu_stats_tlv_v: display htt_tx_tqm_gen_mpdu_stats_tlv_v
  1725. * @tag_buf: buffer containing the tlv htt_tx_tqm_gen_mpdu_stats_tlv_v
  1726. *
  1727. * return:void
  1728. */
  1729. static inline void dp_print_tx_tqm_gen_mpdu_stats_tlv_v(uint32_t *tag_buf)
  1730. {
  1731. htt_tx_tqm_gen_mpdu_stats_tlv_v *dp_stats_buf =
  1732. (htt_tx_tqm_gen_mpdu_stats_tlv_v *)tag_buf;
  1733. uint8_t i;
  1734. uint16_t index = 0;
  1735. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  1736. char *gen_mpdu_end_reason = qdf_mem_malloc(DP_MAX_STRING_LEN);
  1737. if (!gen_mpdu_end_reason) {
  1738. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  1739. FL("Output buffer not allocated"));
  1740. return;
  1741. }
  1742. tag_len = qdf_min(tag_len,
  1743. (uint32_t)HTT_TX_TQM_MAX_GEN_MPDU_END_REASON);
  1744. DP_PRINT_STATS("HTT_TX_TQM_GEN_MPDU_STATS_TLV_V:");
  1745. for (i = 0; i < tag_len; i++) {
  1746. index += qdf_snprint(&gen_mpdu_end_reason[index],
  1747. DP_MAX_STRING_LEN - index,
  1748. " %u:%u,", i,
  1749. dp_stats_buf->gen_mpdu_end_reason[i]);
  1750. }
  1751. DP_PRINT_STATS("gen_mpdu_end_reason = %s\n", gen_mpdu_end_reason);
  1752. qdf_mem_free(gen_mpdu_end_reason);
  1753. }
  1754. /*
  1755. * dp_print_tx_tqm_list_mpdu_stats_tlv_v: display htt_tx_tqm_list_mpdu_stats_tlv
  1756. * @tag_buf: buffer containing the tlv htt_tx_tqm_list_mpdu_stats_tlv_v
  1757. *
  1758. * return:void
  1759. */
  1760. static inline void dp_print_tx_tqm_list_mpdu_stats_tlv_v(uint32_t *tag_buf)
  1761. {
  1762. htt_tx_tqm_list_mpdu_stats_tlv_v *dp_stats_buf =
  1763. (htt_tx_tqm_list_mpdu_stats_tlv_v *)tag_buf;
  1764. uint8_t i;
  1765. uint16_t index = 0;
  1766. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  1767. char *list_mpdu_end_reason = qdf_mem_malloc(DP_MAX_STRING_LEN);
  1768. if (!list_mpdu_end_reason) {
  1769. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  1770. FL("Output buffer not allocated"));
  1771. return;
  1772. }
  1773. tag_len = qdf_min(tag_len,
  1774. (uint32_t)HTT_TX_TQM_MAX_LIST_MPDU_END_REASON);
  1775. DP_PRINT_STATS("HTT_TX_TQM_LIST_MPDU_STATS_TLV_V:");
  1776. for (i = 0; i < tag_len; i++) {
  1777. index += qdf_snprint(&list_mpdu_end_reason[index],
  1778. DP_MAX_STRING_LEN - index,
  1779. " %u:%u,", i,
  1780. dp_stats_buf->list_mpdu_end_reason[i]);
  1781. }
  1782. DP_PRINT_STATS("list_mpdu_end_reason = %s\n",
  1783. list_mpdu_end_reason);
  1784. qdf_mem_free(list_mpdu_end_reason);
  1785. }
  1786. /*
  1787. * dp_print_tx_tqm_list_mpdu_cnt_tlv_v: display htt_tx_tqm_list_mpdu_cnt_tlv_v
  1788. * @tag_buf: buffer containing the tlv htt_tx_tqm_list_mpdu_cnt_tlv_v
  1789. *
  1790. * return:void
  1791. */
  1792. static inline void dp_print_tx_tqm_list_mpdu_cnt_tlv_v(uint32_t *tag_buf)
  1793. {
  1794. htt_tx_tqm_list_mpdu_cnt_tlv_v *dp_stats_buf =
  1795. (htt_tx_tqm_list_mpdu_cnt_tlv_v *)tag_buf;
  1796. uint8_t i;
  1797. uint16_t index = 0;
  1798. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  1799. char *list_mpdu_cnt_hist = qdf_mem_malloc(DP_MAX_STRING_LEN);
  1800. if (!list_mpdu_cnt_hist) {
  1801. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  1802. FL("Output buffer not allocated"));
  1803. return;
  1804. }
  1805. tag_len = qdf_min(tag_len,
  1806. (uint32_t)HTT_TX_TQM_MAX_LIST_MPDU_CNT_HISTOGRAM_BINS);
  1807. DP_PRINT_STATS("HTT_TX_TQM_LIST_MPDU_CNT_TLV_V:");
  1808. for (i = 0; i < tag_len; i++) {
  1809. index += qdf_snprint(&list_mpdu_cnt_hist[index],
  1810. DP_MAX_STRING_LEN - index,
  1811. " %u:%u,", i,
  1812. dp_stats_buf->list_mpdu_cnt_hist[i]);
  1813. }
  1814. DP_PRINT_STATS("list_mpdu_cnt_hist = %s\n", list_mpdu_cnt_hist);
  1815. qdf_mem_free(list_mpdu_cnt_hist);
  1816. }
  1817. /*
  1818. * dp_print_tx_tqm_pdev_stats_tlv_v: display htt_tx_tqm_pdev_stats_tlv_v
  1819. * @tag_buf: buffer containing the tlv htt_tx_tqm_pdev_stats_tlv_v
  1820. *
  1821. * return:void
  1822. */
  1823. static inline void dp_print_tx_tqm_pdev_stats_tlv_v(uint32_t *tag_buf)
  1824. {
  1825. htt_tx_tqm_pdev_stats_tlv_v *dp_stats_buf =
  1826. (htt_tx_tqm_pdev_stats_tlv_v *)tag_buf;
  1827. DP_PRINT_STATS("HTT_TX_TQM_PDEV_STATS_TLV_V:");
  1828. DP_PRINT_STATS("msdu_count = %u",
  1829. dp_stats_buf->msdu_count);
  1830. DP_PRINT_STATS("mpdu_count = %u",
  1831. dp_stats_buf->mpdu_count);
  1832. DP_PRINT_STATS("remove_msdu = %u",
  1833. dp_stats_buf->remove_msdu);
  1834. DP_PRINT_STATS("remove_mpdu = %u",
  1835. dp_stats_buf->remove_mpdu);
  1836. DP_PRINT_STATS("remove_msdu_ttl = %u",
  1837. dp_stats_buf->remove_msdu_ttl);
  1838. DP_PRINT_STATS("send_bar = %u",
  1839. dp_stats_buf->send_bar);
  1840. DP_PRINT_STATS("bar_sync = %u",
  1841. dp_stats_buf->bar_sync);
  1842. DP_PRINT_STATS("notify_mpdu = %u",
  1843. dp_stats_buf->notify_mpdu);
  1844. DP_PRINT_STATS("sync_cmd = %u",
  1845. dp_stats_buf->sync_cmd);
  1846. DP_PRINT_STATS("write_cmd = %u",
  1847. dp_stats_buf->write_cmd);
  1848. DP_PRINT_STATS("hwsch_trigger = %u",
  1849. dp_stats_buf->hwsch_trigger);
  1850. DP_PRINT_STATS("ack_tlv_proc = %u",
  1851. dp_stats_buf->ack_tlv_proc);
  1852. DP_PRINT_STATS("gen_mpdu_cmd = %u",
  1853. dp_stats_buf->gen_mpdu_cmd);
  1854. DP_PRINT_STATS("gen_list_cmd = %u",
  1855. dp_stats_buf->gen_list_cmd);
  1856. DP_PRINT_STATS("remove_mpdu_cmd = %u",
  1857. dp_stats_buf->remove_mpdu_cmd);
  1858. DP_PRINT_STATS("remove_mpdu_tried_cmd = %u",
  1859. dp_stats_buf->remove_mpdu_tried_cmd);
  1860. DP_PRINT_STATS("mpdu_queue_stats_cmd = %u",
  1861. dp_stats_buf->mpdu_queue_stats_cmd);
  1862. DP_PRINT_STATS("mpdu_head_info_cmd = %u",
  1863. dp_stats_buf->mpdu_head_info_cmd);
  1864. DP_PRINT_STATS("msdu_flow_stats_cmd = %u",
  1865. dp_stats_buf->msdu_flow_stats_cmd);
  1866. DP_PRINT_STATS("remove_msdu_cmd = %u",
  1867. dp_stats_buf->remove_msdu_cmd);
  1868. DP_PRINT_STATS("remove_msdu_ttl_cmd = %u",
  1869. dp_stats_buf->remove_msdu_ttl_cmd);
  1870. DP_PRINT_STATS("flush_cache_cmd = %u",
  1871. dp_stats_buf->flush_cache_cmd);
  1872. DP_PRINT_STATS("update_mpduq_cmd = %u",
  1873. dp_stats_buf->update_mpduq_cmd);
  1874. DP_PRINT_STATS("enqueue = %u",
  1875. dp_stats_buf->enqueue);
  1876. DP_PRINT_STATS("enqueue_notify = %u",
  1877. dp_stats_buf->enqueue_notify);
  1878. DP_PRINT_STATS("notify_mpdu_at_head = %u",
  1879. dp_stats_buf->notify_mpdu_at_head);
  1880. DP_PRINT_STATS("notify_mpdu_state_valid = %u\n",
  1881. dp_stats_buf->notify_mpdu_state_valid);
  1882. }
  1883. /*
  1884. * dp_print_tx_tqm_cmn_stats_tlv: display htt_tx_tqm_cmn_stats_tlv
  1885. * @tag_buf: buffer containing the tlv htt_tx_tqm_cmn_stats_tlv
  1886. *
  1887. * return:void
  1888. */
  1889. static inline void dp_print_tx_tqm_cmn_stats_tlv(uint32_t *tag_buf)
  1890. {
  1891. htt_tx_tqm_cmn_stats_tlv *dp_stats_buf =
  1892. (htt_tx_tqm_cmn_stats_tlv *)tag_buf;
  1893. DP_PRINT_STATS("HTT_TX_TQM_CMN_STATS_TLV:");
  1894. DP_PRINT_STATS("mac_id__word = %u",
  1895. dp_stats_buf->mac_id__word);
  1896. DP_PRINT_STATS("max_cmdq_id = %u",
  1897. dp_stats_buf->max_cmdq_id);
  1898. DP_PRINT_STATS("list_mpdu_cnt_hist_intvl = %u",
  1899. dp_stats_buf->list_mpdu_cnt_hist_intvl);
  1900. DP_PRINT_STATS("add_msdu = %u",
  1901. dp_stats_buf->add_msdu);
  1902. DP_PRINT_STATS("q_empty = %u",
  1903. dp_stats_buf->q_empty);
  1904. DP_PRINT_STATS("q_not_empty = %u",
  1905. dp_stats_buf->q_not_empty);
  1906. DP_PRINT_STATS("drop_notification = %u",
  1907. dp_stats_buf->drop_notification);
  1908. DP_PRINT_STATS("desc_threshold = %u\n",
  1909. dp_stats_buf->desc_threshold);
  1910. }
  1911. /*
  1912. * dp_print_tx_tqm_error_stats_tlv: display htt_tx_tqm_error_stats_tlv
  1913. * @tag_buf: buffer containing the tlv htt_tx_tqm_error_stats_tlv
  1914. *
  1915. * return:void
  1916. */
  1917. static inline void dp_print_tx_tqm_error_stats_tlv(uint32_t *tag_buf)
  1918. {
  1919. htt_tx_tqm_error_stats_tlv *dp_stats_buf =
  1920. (htt_tx_tqm_error_stats_tlv *)tag_buf;
  1921. DP_PRINT_STATS("HTT_TX_TQM_ERROR_STATS_TLV:");
  1922. DP_PRINT_STATS("q_empty_failure = %u",
  1923. dp_stats_buf->q_empty_failure);
  1924. DP_PRINT_STATS("q_not_empty_failure = %u",
  1925. dp_stats_buf->q_not_empty_failure);
  1926. DP_PRINT_STATS("add_msdu_failure = %u\n",
  1927. dp_stats_buf->add_msdu_failure);
  1928. }
  1929. /*
  1930. * dp_print_tx_tqm_cmdq_status_tlv: display htt_tx_tqm_cmdq_status_tlv
  1931. * @tag_buf: buffer containing the tlv htt_tx_tqm_cmdq_status_tlv
  1932. *
  1933. * return:void
  1934. */
  1935. static inline void dp_print_tx_tqm_cmdq_status_tlv(uint32_t *tag_buf)
  1936. {
  1937. htt_tx_tqm_cmdq_status_tlv *dp_stats_buf =
  1938. (htt_tx_tqm_cmdq_status_tlv *)tag_buf;
  1939. DP_PRINT_STATS("HTT_TX_TQM_CMDQ_STATUS_TLV:");
  1940. DP_PRINT_STATS("mac_id__cmdq_id__word = %u",
  1941. dp_stats_buf->mac_id__cmdq_id__word);
  1942. DP_PRINT_STATS("sync_cmd = %u",
  1943. dp_stats_buf->sync_cmd);
  1944. DP_PRINT_STATS("write_cmd = %u",
  1945. dp_stats_buf->write_cmd);
  1946. DP_PRINT_STATS("gen_mpdu_cmd = %u",
  1947. dp_stats_buf->gen_mpdu_cmd);
  1948. DP_PRINT_STATS("mpdu_queue_stats_cmd = %u",
  1949. dp_stats_buf->mpdu_queue_stats_cmd);
  1950. DP_PRINT_STATS("mpdu_head_info_cmd = %u",
  1951. dp_stats_buf->mpdu_head_info_cmd);
  1952. DP_PRINT_STATS("msdu_flow_stats_cmd = %u",
  1953. dp_stats_buf->msdu_flow_stats_cmd);
  1954. DP_PRINT_STATS("remove_mpdu_cmd = %u",
  1955. dp_stats_buf->remove_mpdu_cmd);
  1956. DP_PRINT_STATS("remove_msdu_cmd = %u",
  1957. dp_stats_buf->remove_msdu_cmd);
  1958. DP_PRINT_STATS("flush_cache_cmd = %u",
  1959. dp_stats_buf->flush_cache_cmd);
  1960. DP_PRINT_STATS("update_mpduq_cmd = %u",
  1961. dp_stats_buf->update_mpduq_cmd);
  1962. DP_PRINT_STATS("update_msduq_cmd = %u\n",
  1963. dp_stats_buf->update_msduq_cmd);
  1964. }
  1965. /*
  1966. * dp_print_tx_de_eapol_packets_stats_tlv: display htt_tx_de_eapol_packets_stats
  1967. * @tag_buf: buffer containing the tlv htt_tx_de_eapol_packets_stats_tlv
  1968. *
  1969. * return:void
  1970. */
  1971. static inline void dp_print_tx_de_eapol_packets_stats_tlv(uint32_t *tag_buf)
  1972. {
  1973. htt_tx_de_eapol_packets_stats_tlv *dp_stats_buf =
  1974. (htt_tx_de_eapol_packets_stats_tlv *)tag_buf;
  1975. DP_PRINT_STATS("HTT_TX_DE_EAPOL_PACKETS_STATS_TLV:");
  1976. DP_PRINT_STATS("m1_packets = %u",
  1977. dp_stats_buf->m1_packets);
  1978. DP_PRINT_STATS("m2_packets = %u",
  1979. dp_stats_buf->m2_packets);
  1980. DP_PRINT_STATS("m3_packets = %u",
  1981. dp_stats_buf->m3_packets);
  1982. DP_PRINT_STATS("m4_packets = %u",
  1983. dp_stats_buf->m4_packets);
  1984. DP_PRINT_STATS("g1_packets = %u",
  1985. dp_stats_buf->g1_packets);
  1986. DP_PRINT_STATS("g2_packets = %u\n",
  1987. dp_stats_buf->g2_packets);
  1988. }
  1989. /*
  1990. * dp_print_tx_de_classify_failed_stats_tlv: display
  1991. * htt_tx_de_classify_failed_stats_tlv
  1992. * @tag_buf: buffer containing the tlv htt_tx_de_classify_failed_stats_tlv
  1993. *
  1994. * return:void
  1995. */
  1996. static inline void dp_print_tx_de_classify_failed_stats_tlv(uint32_t *tag_buf)
  1997. {
  1998. htt_tx_de_classify_failed_stats_tlv *dp_stats_buf =
  1999. (htt_tx_de_classify_failed_stats_tlv *)tag_buf;
  2000. DP_PRINT_STATS("HTT_TX_DE_CLASSIFY_FAILED_STATS_TLV:");
  2001. DP_PRINT_STATS("ap_bss_peer_not_found = %u",
  2002. dp_stats_buf->ap_bss_peer_not_found);
  2003. DP_PRINT_STATS("ap_bcast_mcast_no_peer = %u",
  2004. dp_stats_buf->ap_bcast_mcast_no_peer);
  2005. DP_PRINT_STATS("sta_delete_in_progress = %u",
  2006. dp_stats_buf->sta_delete_in_progress);
  2007. DP_PRINT_STATS("ibss_no_bss_peer = %u",
  2008. dp_stats_buf->ibss_no_bss_peer);
  2009. DP_PRINT_STATS("invaild_vdev_type = %u",
  2010. dp_stats_buf->invaild_vdev_type);
  2011. DP_PRINT_STATS("invalid_ast_peer_entry = %u",
  2012. dp_stats_buf->invalid_ast_peer_entry);
  2013. DP_PRINT_STATS("peer_entry_invalid = %u",
  2014. dp_stats_buf->peer_entry_invalid);
  2015. DP_PRINT_STATS("ethertype_not_ip = %u",
  2016. dp_stats_buf->ethertype_not_ip);
  2017. DP_PRINT_STATS("eapol_lookup_failed = %u",
  2018. dp_stats_buf->eapol_lookup_failed);
  2019. DP_PRINT_STATS("qpeer_not_allow_data = %u",
  2020. dp_stats_buf->qpeer_not_allow_data);
  2021. DP_PRINT_STATS("fse_tid_override = %u\n",
  2022. dp_stats_buf->fse_tid_override);
  2023. }
  2024. /*
  2025. * dp_print_tx_de_classify_stats_tlv: display htt_tx_de_classify_stats_tlv
  2026. * @tag_buf: buffer containing the tlv htt_tx_de_classify_stats_tlv
  2027. *
  2028. * return:void
  2029. */
  2030. static inline void dp_print_tx_de_classify_stats_tlv(uint32_t *tag_buf)
  2031. {
  2032. htt_tx_de_classify_stats_tlv *dp_stats_buf =
  2033. (htt_tx_de_classify_stats_tlv *)tag_buf;
  2034. DP_PRINT_STATS("HTT_TX_DE_CLASSIFY_STATS_TLV:");
  2035. DP_PRINT_STATS("arp_packets = %u",
  2036. dp_stats_buf->arp_packets);
  2037. DP_PRINT_STATS("igmp_packets = %u",
  2038. dp_stats_buf->igmp_packets);
  2039. DP_PRINT_STATS("dhcp_packets = %u",
  2040. dp_stats_buf->dhcp_packets);
  2041. DP_PRINT_STATS("host_inspected = %u",
  2042. dp_stats_buf->host_inspected);
  2043. DP_PRINT_STATS("htt_included = %u",
  2044. dp_stats_buf->htt_included);
  2045. DP_PRINT_STATS("htt_valid_mcs = %u",
  2046. dp_stats_buf->htt_valid_mcs);
  2047. DP_PRINT_STATS("htt_valid_nss = %u",
  2048. dp_stats_buf->htt_valid_nss);
  2049. DP_PRINT_STATS("htt_valid_preamble_type = %u",
  2050. dp_stats_buf->htt_valid_preamble_type);
  2051. DP_PRINT_STATS("htt_valid_chainmask = %u",
  2052. dp_stats_buf->htt_valid_chainmask);
  2053. DP_PRINT_STATS("htt_valid_guard_interval = %u",
  2054. dp_stats_buf->htt_valid_guard_interval);
  2055. DP_PRINT_STATS("htt_valid_retries = %u",
  2056. dp_stats_buf->htt_valid_retries);
  2057. DP_PRINT_STATS("htt_valid_bw_info = %u",
  2058. dp_stats_buf->htt_valid_bw_info);
  2059. DP_PRINT_STATS("htt_valid_power = %u",
  2060. dp_stats_buf->htt_valid_power);
  2061. DP_PRINT_STATS("htt_valid_key_flags = %u",
  2062. dp_stats_buf->htt_valid_key_flags);
  2063. DP_PRINT_STATS("htt_valid_no_encryption = %u",
  2064. dp_stats_buf->htt_valid_no_encryption);
  2065. DP_PRINT_STATS("fse_entry_count = %u",
  2066. dp_stats_buf->fse_entry_count);
  2067. DP_PRINT_STATS("fse_priority_be = %u",
  2068. dp_stats_buf->fse_priority_be);
  2069. DP_PRINT_STATS("fse_priority_high = %u",
  2070. dp_stats_buf->fse_priority_high);
  2071. DP_PRINT_STATS("fse_priority_low = %u",
  2072. dp_stats_buf->fse_priority_low);
  2073. DP_PRINT_STATS("fse_traffic_ptrn_be = %u",
  2074. dp_stats_buf->fse_traffic_ptrn_be);
  2075. DP_PRINT_STATS("fse_traffic_ptrn_over_sub = %u",
  2076. dp_stats_buf->fse_traffic_ptrn_over_sub);
  2077. DP_PRINT_STATS("fse_traffic_ptrn_bursty = %u",
  2078. dp_stats_buf->fse_traffic_ptrn_bursty);
  2079. DP_PRINT_STATS("fse_traffic_ptrn_interactive = %u",
  2080. dp_stats_buf->fse_traffic_ptrn_interactive);
  2081. DP_PRINT_STATS("fse_traffic_ptrn_periodic = %u",
  2082. dp_stats_buf->fse_traffic_ptrn_periodic);
  2083. DP_PRINT_STATS("fse_hwqueue_alloc = %u",
  2084. dp_stats_buf->fse_hwqueue_alloc);
  2085. DP_PRINT_STATS("fse_hwqueue_created = %u",
  2086. dp_stats_buf->fse_hwqueue_created);
  2087. DP_PRINT_STATS("fse_hwqueue_send_to_host = %u",
  2088. dp_stats_buf->fse_hwqueue_send_to_host);
  2089. DP_PRINT_STATS("mcast_entry = %u",
  2090. dp_stats_buf->mcast_entry);
  2091. DP_PRINT_STATS("bcast_entry = %u\n",
  2092. dp_stats_buf->bcast_entry);
  2093. }
  2094. /*
  2095. * dp_print_tx_de_classify_status_stats_tlv: display
  2096. * htt_tx_de_classify_status_stats_tlv
  2097. * @tag_buf: buffer containing the tlv htt_tx_de_classify_status_stats_tlv
  2098. *
  2099. * return:void
  2100. */
  2101. static inline void dp_print_tx_de_classify_status_stats_tlv(uint32_t *tag_buf)
  2102. {
  2103. htt_tx_de_classify_status_stats_tlv *dp_stats_buf =
  2104. (htt_tx_de_classify_status_stats_tlv *)tag_buf;
  2105. DP_PRINT_STATS("HTT_TX_DE_CLASSIFY_STATUS_STATS_TLV:");
  2106. DP_PRINT_STATS("eok = %u",
  2107. dp_stats_buf->eok);
  2108. DP_PRINT_STATS("classify_done = %u",
  2109. dp_stats_buf->classify_done);
  2110. DP_PRINT_STATS("lookup_failed = %u",
  2111. dp_stats_buf->lookup_failed);
  2112. DP_PRINT_STATS("send_host_dhcp = %u",
  2113. dp_stats_buf->send_host_dhcp);
  2114. DP_PRINT_STATS("send_host_mcast = %u",
  2115. dp_stats_buf->send_host_mcast);
  2116. DP_PRINT_STATS("send_host_unknown_dest = %u",
  2117. dp_stats_buf->send_host_unknown_dest);
  2118. DP_PRINT_STATS("send_host = %u",
  2119. dp_stats_buf->send_host);
  2120. DP_PRINT_STATS("status_invalid = %u\n",
  2121. dp_stats_buf->status_invalid);
  2122. }
  2123. /*
  2124. * dp_print_tx_de_enqueue_packets_stats_tlv: display
  2125. * htt_tx_de_enqueue_packets_stats_tlv
  2126. * @tag_buf: buffer containing the tlv htt_tx_de_enqueue_packets_stats_tlv
  2127. *
  2128. * return:void
  2129. */
  2130. static inline void dp_print_tx_de_enqueue_packets_stats_tlv(uint32_t *tag_buf)
  2131. {
  2132. htt_tx_de_enqueue_packets_stats_tlv *dp_stats_buf =
  2133. (htt_tx_de_enqueue_packets_stats_tlv *)tag_buf;
  2134. DP_PRINT_STATS("HTT_TX_DE_ENQUEUE_PACKETS_STATS_TLV:");
  2135. DP_PRINT_STATS("enqueued_pkts = %u",
  2136. dp_stats_buf->enqueued_pkts);
  2137. DP_PRINT_STATS("to_tqm = %u",
  2138. dp_stats_buf->to_tqm);
  2139. DP_PRINT_STATS("to_tqm_bypass = %u\n",
  2140. dp_stats_buf->to_tqm_bypass);
  2141. }
  2142. /*
  2143. * dp_print_tx_de_enqueue_discard_stats_tlv: display
  2144. * htt_tx_de_enqueue_discard_stats_tlv
  2145. * @tag_buf: buffer containing the tlv htt_tx_de_enqueue_discard_stats_tlv
  2146. *
  2147. * return:void
  2148. */
  2149. static inline void dp_print_tx_de_enqueue_discard_stats_tlv(uint32_t *tag_buf)
  2150. {
  2151. htt_tx_de_enqueue_discard_stats_tlv *dp_stats_buf =
  2152. (htt_tx_de_enqueue_discard_stats_tlv *)tag_buf;
  2153. DP_PRINT_STATS("HTT_TX_DE_ENQUEUE_DISCARD_STATS_TLV:");
  2154. DP_PRINT_STATS("discarded_pkts = %u",
  2155. dp_stats_buf->discarded_pkts);
  2156. DP_PRINT_STATS("local_frames = %u",
  2157. dp_stats_buf->local_frames);
  2158. DP_PRINT_STATS("is_ext_msdu = %u\n",
  2159. dp_stats_buf->is_ext_msdu);
  2160. }
  2161. /*
  2162. * dp_print_tx_de_compl_stats_tlv: display htt_tx_de_compl_stats_tlv
  2163. * @tag_buf: buffer containing the tlv htt_tx_de_compl_stats_tlv
  2164. *
  2165. * return:void
  2166. */
  2167. static inline void dp_print_tx_de_compl_stats_tlv(uint32_t *tag_buf)
  2168. {
  2169. htt_tx_de_compl_stats_tlv *dp_stats_buf =
  2170. (htt_tx_de_compl_stats_tlv *)tag_buf;
  2171. DP_PRINT_STATS("HTT_TX_DE_COMPL_STATS_TLV:");
  2172. DP_PRINT_STATS("tcl_dummy_frame = %u",
  2173. dp_stats_buf->tcl_dummy_frame);
  2174. DP_PRINT_STATS("tqm_dummy_frame = %u",
  2175. dp_stats_buf->tqm_dummy_frame);
  2176. DP_PRINT_STATS("tqm_notify_frame = %u",
  2177. dp_stats_buf->tqm_notify_frame);
  2178. DP_PRINT_STATS("fw2wbm_enq = %u",
  2179. dp_stats_buf->fw2wbm_enq);
  2180. DP_PRINT_STATS("tqm_bypass_frame = %u\n",
  2181. dp_stats_buf->tqm_bypass_frame);
  2182. }
  2183. /*
  2184. * dp_print_tx_de_cmn_stats_tlv: display htt_tx_de_cmn_stats_tlv
  2185. * @tag_buf: buffer containing the tlv htt_tx_de_cmn_stats_tlv
  2186. *
  2187. * return:void
  2188. */
  2189. static inline void dp_print_tx_de_cmn_stats_tlv(uint32_t *tag_buf)
  2190. {
  2191. htt_tx_de_cmn_stats_tlv *dp_stats_buf =
  2192. (htt_tx_de_cmn_stats_tlv *)tag_buf;
  2193. DP_PRINT_STATS("HTT_TX_DE_CMN_STATS_TLV:");
  2194. DP_PRINT_STATS("mac_id__word = %u",
  2195. dp_stats_buf->mac_id__word);
  2196. DP_PRINT_STATS("tcl2fw_entry_count = %u",
  2197. dp_stats_buf->tcl2fw_entry_count);
  2198. DP_PRINT_STATS("not_to_fw = %u",
  2199. dp_stats_buf->not_to_fw);
  2200. DP_PRINT_STATS("invalid_pdev_vdev_peer = %u",
  2201. dp_stats_buf->invalid_pdev_vdev_peer);
  2202. DP_PRINT_STATS("tcl_res_invalid_addrx = %u",
  2203. dp_stats_buf->tcl_res_invalid_addrx);
  2204. DP_PRINT_STATS("wbm2fw_entry_count = %u",
  2205. dp_stats_buf->wbm2fw_entry_count);
  2206. DP_PRINT_STATS("invalid_pdev = %u\n",
  2207. dp_stats_buf->invalid_pdev);
  2208. }
  2209. /*
  2210. * dp_print_ring_if_stats_tlv: display htt_ring_if_stats_tlv
  2211. * @tag_buf: buffer containing the tlv htt_ring_if_stats_tlv
  2212. *
  2213. * return:void
  2214. */
  2215. static inline void dp_print_ring_if_stats_tlv(uint32_t *tag_buf)
  2216. {
  2217. htt_ring_if_stats_tlv *dp_stats_buf =
  2218. (htt_ring_if_stats_tlv *)tag_buf;
  2219. uint8_t i;
  2220. uint16_t index = 0;
  2221. char *wm_hit_count = qdf_mem_malloc(DP_MAX_STRING_LEN);
  2222. if (!wm_hit_count) {
  2223. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  2224. FL("Output buffer not allocated"));
  2225. return;
  2226. }
  2227. DP_PRINT_STATS("HTT_RING_IF_STATS_TLV:");
  2228. DP_PRINT_STATS("base_addr = %u",
  2229. dp_stats_buf->base_addr);
  2230. DP_PRINT_STATS("elem_size = %u",
  2231. dp_stats_buf->elem_size);
  2232. DP_PRINT_STATS("num_elems__prefetch_tail_idx = %u",
  2233. dp_stats_buf->num_elems__prefetch_tail_idx);
  2234. DP_PRINT_STATS("head_idx__tail_idx = %u",
  2235. dp_stats_buf->head_idx__tail_idx);
  2236. DP_PRINT_STATS("shadow_head_idx__shadow_tail_idx = %u",
  2237. dp_stats_buf->shadow_head_idx__shadow_tail_idx);
  2238. DP_PRINT_STATS("num_tail_incr = %u",
  2239. dp_stats_buf->num_tail_incr);
  2240. DP_PRINT_STATS("lwm_thresh__hwm_thresh = %u",
  2241. dp_stats_buf->lwm_thresh__hwm_thresh);
  2242. DP_PRINT_STATS("overrun_hit_count = %u",
  2243. dp_stats_buf->overrun_hit_count);
  2244. DP_PRINT_STATS("underrun_hit_count = %u",
  2245. dp_stats_buf->underrun_hit_count);
  2246. DP_PRINT_STATS("prod_blockwait_count = %u",
  2247. dp_stats_buf->prod_blockwait_count);
  2248. DP_PRINT_STATS("cons_blockwait_count = %u",
  2249. dp_stats_buf->cons_blockwait_count);
  2250. for (i = 0; i < DP_HTT_LOW_WM_HIT_COUNT_LEN; i++) {
  2251. index += qdf_snprint(&wm_hit_count[index],
  2252. DP_MAX_STRING_LEN - index,
  2253. " %u:%u,", i,
  2254. dp_stats_buf->low_wm_hit_count[i]);
  2255. }
  2256. DP_PRINT_STATS("low_wm_hit_count = %s ", wm_hit_count);
  2257. qdf_mem_zero(wm_hit_count, DP_MAX_STRING_LEN);
  2258. index = 0;
  2259. for (i = 0; i < DP_HTT_HIGH_WM_HIT_COUNT_LEN; i++) {
  2260. index += qdf_snprint(&wm_hit_count[index],
  2261. DP_MAX_STRING_LEN - index,
  2262. " %u:%u,", i,
  2263. dp_stats_buf->high_wm_hit_count[i]);
  2264. }
  2265. DP_PRINT_STATS("high_wm_hit_count = %s\n", wm_hit_count);
  2266. }
  2267. /*
  2268. * dp_print_ring_if_cmn_tlv: display htt_ring_if_cmn_tlv
  2269. * @tag_buf: buffer containing the tlv htt_ring_if_cmn_tlv
  2270. *
  2271. * return:void
  2272. */
  2273. static inline void dp_print_ring_if_cmn_tlv(uint32_t *tag_buf)
  2274. {
  2275. htt_ring_if_cmn_tlv *dp_stats_buf =
  2276. (htt_ring_if_cmn_tlv *)tag_buf;
  2277. DP_PRINT_STATS("HTT_RING_IF_CMN_TLV:");
  2278. DP_PRINT_STATS("mac_id__word = %u",
  2279. dp_stats_buf->mac_id__word);
  2280. DP_PRINT_STATS("num_records = %u\n",
  2281. dp_stats_buf->num_records);
  2282. }
  2283. /*
  2284. * dp_print_sfm_client_user_tlv_v: display htt_sfm_client_user_tlv_v
  2285. * @tag_buf: buffer containing the tlv htt_sfm_client_user_tlv_v
  2286. *
  2287. * return:void
  2288. */
  2289. static inline void dp_print_sfm_client_user_tlv_v(uint32_t *tag_buf)
  2290. {
  2291. htt_sfm_client_user_tlv_v *dp_stats_buf =
  2292. (htt_sfm_client_user_tlv_v *)tag_buf;
  2293. uint8_t i;
  2294. uint16_t index = 0;
  2295. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  2296. char *dwords_used_by_user_n = qdf_mem_malloc(DP_MAX_STRING_LEN);
  2297. if (!dwords_used_by_user_n) {
  2298. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  2299. FL("Output buffer not allocated"));
  2300. return;
  2301. }
  2302. DP_PRINT_STATS("HTT_SFM_CLIENT_USER_TLV_V:");
  2303. for (i = 0; i < tag_len; i++) {
  2304. index += qdf_snprint(&dwords_used_by_user_n[index],
  2305. DP_MAX_STRING_LEN - index,
  2306. " %u:%u,", i,
  2307. dp_stats_buf->dwords_used_by_user_n[i]);
  2308. }
  2309. DP_PRINT_STATS("dwords_used_by_user_n = %s\n",
  2310. dwords_used_by_user_n);
  2311. qdf_mem_free(dwords_used_by_user_n);
  2312. }
  2313. /*
  2314. * dp_print_sfm_client_tlv: display htt_sfm_client_tlv
  2315. * @tag_buf: buffer containing the tlv htt_sfm_client_tlv
  2316. *
  2317. * return:void
  2318. */
  2319. static inline void dp_print_sfm_client_tlv(uint32_t *tag_buf)
  2320. {
  2321. htt_sfm_client_tlv *dp_stats_buf =
  2322. (htt_sfm_client_tlv *)tag_buf;
  2323. DP_PRINT_STATS("HTT_SFM_CLIENT_TLV:");
  2324. DP_PRINT_STATS("client_id = %u",
  2325. dp_stats_buf->client_id);
  2326. DP_PRINT_STATS("buf_min = %u",
  2327. dp_stats_buf->buf_min);
  2328. DP_PRINT_STATS("buf_max = %u",
  2329. dp_stats_buf->buf_max);
  2330. DP_PRINT_STATS("buf_busy = %u",
  2331. dp_stats_buf->buf_busy);
  2332. DP_PRINT_STATS("buf_alloc = %u",
  2333. dp_stats_buf->buf_alloc);
  2334. DP_PRINT_STATS("buf_avail = %u",
  2335. dp_stats_buf->buf_avail);
  2336. DP_PRINT_STATS("num_users = %u\n",
  2337. dp_stats_buf->num_users);
  2338. }
  2339. /*
  2340. * dp_print_sfm_cmn_tlv: display htt_sfm_cmn_tlv
  2341. * @tag_buf: buffer containing the tlv htt_sfm_cmn_tlv
  2342. *
  2343. * return:void
  2344. */
  2345. static inline void dp_print_sfm_cmn_tlv(uint32_t *tag_buf)
  2346. {
  2347. htt_sfm_cmn_tlv *dp_stats_buf =
  2348. (htt_sfm_cmn_tlv *)tag_buf;
  2349. DP_PRINT_STATS("HTT_SFM_CMN_TLV:");
  2350. DP_PRINT_STATS("mac_id__word = %u",
  2351. dp_stats_buf->mac_id__word);
  2352. DP_PRINT_STATS("buf_total = %u",
  2353. dp_stats_buf->buf_total);
  2354. DP_PRINT_STATS("mem_empty = %u",
  2355. dp_stats_buf->mem_empty);
  2356. DP_PRINT_STATS("deallocate_bufs = %u",
  2357. dp_stats_buf->deallocate_bufs);
  2358. DP_PRINT_STATS("num_records = %u\n",
  2359. dp_stats_buf->num_records);
  2360. }
  2361. /*
  2362. * dp_print_sring_stats_tlv: display htt_sring_stats_tlv
  2363. * @tag_buf: buffer containing the tlv htt_sring_stats_tlv
  2364. *
  2365. * return:void
  2366. */
  2367. static inline void dp_print_sring_stats_tlv(uint32_t *tag_buf)
  2368. {
  2369. htt_sring_stats_tlv *dp_stats_buf =
  2370. (htt_sring_stats_tlv *)tag_buf;
  2371. DP_PRINT_STATS("HTT_SRING_STATS_TLV:");
  2372. DP_PRINT_STATS("mac_id__ring_id__arena__ep = %u",
  2373. dp_stats_buf->mac_id__ring_id__arena__ep);
  2374. DP_PRINT_STATS("base_addr_lsb = %u",
  2375. dp_stats_buf->base_addr_lsb);
  2376. DP_PRINT_STATS("base_addr_msb = %u",
  2377. dp_stats_buf->base_addr_msb);
  2378. DP_PRINT_STATS("ring_size = %u",
  2379. dp_stats_buf->ring_size);
  2380. DP_PRINT_STATS("elem_size = %u",
  2381. dp_stats_buf->elem_size);
  2382. DP_PRINT_STATS("num_avail_words__num_valid_words = %u",
  2383. dp_stats_buf->num_avail_words__num_valid_words);
  2384. DP_PRINT_STATS("head_ptr__tail_ptr = %u",
  2385. dp_stats_buf->head_ptr__tail_ptr);
  2386. DP_PRINT_STATS("consumer_empty__producer_full = %u",
  2387. dp_stats_buf->consumer_empty__producer_full);
  2388. DP_PRINT_STATS("prefetch_count__internal_tail_ptr = %u\n",
  2389. dp_stats_buf->prefetch_count__internal_tail_ptr);
  2390. }
  2391. /*
  2392. * dp_print_sring_cmn_tlv: display htt_sring_cmn_tlv
  2393. * @tag_buf: buffer containing the tlv htt_sring_cmn_tlv
  2394. *
  2395. * return:void
  2396. */
  2397. static inline void dp_print_sring_cmn_tlv(uint32_t *tag_buf)
  2398. {
  2399. htt_sring_cmn_tlv *dp_stats_buf =
  2400. (htt_sring_cmn_tlv *)tag_buf;
  2401. DP_PRINT_STATS("HTT_SRING_CMN_TLV:");
  2402. DP_PRINT_STATS("num_records = %u\n",
  2403. dp_stats_buf->num_records);
  2404. }
  2405. /*
  2406. * dp_print_tx_pdev_rate_stats_tlv: display htt_tx_pdev_rate_stats_tlv
  2407. * @tag_buf: buffer containing the tlv htt_tx_pdev_rate_stats_tlv
  2408. *
  2409. * return:void
  2410. */
  2411. static void dp_print_tx_pdev_rate_stats_tlv(uint32_t *tag_buf)
  2412. {
  2413. htt_tx_pdev_rate_stats_tlv *dp_stats_buf =
  2414. (htt_tx_pdev_rate_stats_tlv *)tag_buf;
  2415. uint8_t i, j;
  2416. uint16_t index = 0;
  2417. char *tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS];
  2418. char *ac_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS];
  2419. char *ax_mu_mimo_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS];
  2420. char *ofdma_tx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS];
  2421. char *str_buf = qdf_mem_malloc(DP_MAX_STRING_LEN);
  2422. if (!str_buf) {
  2423. dp_err("Output buffer not allocated");
  2424. return;
  2425. }
  2426. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_GI_COUNTERS; i++) {
  2427. tx_gi[i] = (char *)qdf_mem_malloc(DP_MAX_STRING_LEN);
  2428. if (!tx_gi[i]) {
  2429. dp_err("Unable to allocate buffer for tx_gi");
  2430. goto fail1;
  2431. }
  2432. ac_mu_mimo_tx_gi[i] = (char *)qdf_mem_malloc(DP_MAX_STRING_LEN);
  2433. if (!ac_mu_mimo_tx_gi[i]) {
  2434. dp_err("Unable to allocate buffer for ac_mu_mimo_tx_gi");
  2435. goto fail2;
  2436. }
  2437. ax_mu_mimo_tx_gi[i] = (char *)qdf_mem_malloc(DP_MAX_STRING_LEN);
  2438. if (!ax_mu_mimo_tx_gi[i]) {
  2439. dp_err("Unable to allocate buffer for ax_mu_mimo_tx_gi");
  2440. goto fail3;
  2441. }
  2442. ofdma_tx_gi[i] = (char *)qdf_mem_malloc(DP_MAX_STRING_LEN);
  2443. if (!ofdma_tx_gi[i]) {
  2444. dp_err("Unable to allocate buffer for ofdma_tx_gi");
  2445. goto fail4;
  2446. }
  2447. }
  2448. DP_PRINT_STATS("HTT_TX_PDEV_RATE_STATS_TLV:");
  2449. DP_PRINT_STATS("mac_id__word = %u",
  2450. dp_stats_buf->mac_id__word);
  2451. DP_PRINT_STATS("tx_ldpc = %u",
  2452. dp_stats_buf->tx_ldpc);
  2453. DP_PRINT_STATS("rts_cnt = %u",
  2454. dp_stats_buf->rts_cnt);
  2455. DP_PRINT_STATS("rts_success = %u",
  2456. dp_stats_buf->rts_success);
  2457. DP_PRINT_STATS("ack_rssi = %u",
  2458. dp_stats_buf->ack_rssi);
  2459. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2460. for (i = 0; i < DP_HTT_TX_MCS_LEN; i++) {
  2461. index += qdf_snprint(&str_buf[index],
  2462. DP_MAX_STRING_LEN - index,
  2463. " %u:%u,", i, dp_stats_buf->tx_mcs[i]);
  2464. }
  2465. DP_PRINT_STATS("tx_mcs = %s ", str_buf);
  2466. index = 0;
  2467. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2468. for (i = 0; i < DP_HTT_TX_SU_MCS_LEN; i++) {
  2469. index += qdf_snprint(&str_buf[index],
  2470. DP_MAX_STRING_LEN - index,
  2471. " %u:%u,", i, dp_stats_buf->tx_su_mcs[i]);
  2472. }
  2473. DP_PRINT_STATS("tx_su_mcs = %s ", str_buf);
  2474. index = 0;
  2475. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2476. for (i = 0; i < DP_HTT_TX_MU_MCS_LEN; i++) {
  2477. index += qdf_snprint(&str_buf[index],
  2478. DP_MAX_STRING_LEN - index,
  2479. " %u:%u,", i, dp_stats_buf->tx_mu_mcs[i]);
  2480. }
  2481. DP_PRINT_STATS("tx_mu_mcs = %s ", str_buf);
  2482. index = 0;
  2483. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2484. for (i = 0; i < DP_HTT_TX_NSS_LEN; i++) {
  2485. /* 0 stands for NSS 1, 1 stands for NSS 2, etc. */
  2486. index += qdf_snprint(&str_buf[index],
  2487. DP_MAX_STRING_LEN - index,
  2488. " %u:%u,", (i + 1),
  2489. dp_stats_buf->tx_nss[i]);
  2490. }
  2491. DP_PRINT_STATS("tx_nss = %s ", str_buf);
  2492. index = 0;
  2493. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2494. for (i = 0; i < DP_HTT_TX_BW_LEN; i++) {
  2495. index += qdf_snprint(&str_buf[index],
  2496. DP_MAX_STRING_LEN - index,
  2497. " %u:%u,", i, dp_stats_buf->tx_bw[i]);
  2498. }
  2499. DP_PRINT_STATS("tx_bw = %s ", str_buf);
  2500. index = 0;
  2501. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2502. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  2503. index += qdf_snprint(&str_buf[index],
  2504. DP_MAX_STRING_LEN - index,
  2505. " %u:%u,", i, dp_stats_buf->tx_stbc[i]);
  2506. }
  2507. DP_PRINT_STATS("tx_stbc = %s ", str_buf);
  2508. index = 0;
  2509. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2510. for (i = 0; i < DP_HTT_TX_PREAM_LEN; i++) {
  2511. index += qdf_snprint(&str_buf[index],
  2512. DP_MAX_STRING_LEN - index,
  2513. " %u:%u,", i, dp_stats_buf->tx_pream[i]);
  2514. }
  2515. DP_PRINT_STATS("tx_pream = %s ", str_buf);
  2516. for (j = 0; j < DP_HTT_PDEV_TX_GI_LEN; j++) {
  2517. index = 0;
  2518. qdf_mem_zero(tx_gi[j], DP_MAX_STRING_LEN);
  2519. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  2520. index += qdf_snprint(&tx_gi[j][index],
  2521. DP_MAX_STRING_LEN - index,
  2522. " %u:%u,", i,
  2523. dp_stats_buf->tx_gi[j][i]);
  2524. }
  2525. DP_PRINT_STATS("tx_gi[%u] = %s ", j, tx_gi[j]);
  2526. }
  2527. index = 0;
  2528. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2529. for (i = 0; i < DP_HTT_TX_DCM_LEN; i++) {
  2530. index += qdf_snprint(&str_buf[index],
  2531. DP_MAX_STRING_LEN - index,
  2532. " %u:%u,", i, dp_stats_buf->tx_dcm[i]);
  2533. }
  2534. DP_PRINT_STATS("tx_dcm = %s\n", str_buf);
  2535. DP_PRINT_STATS("rts_success = %u",
  2536. dp_stats_buf->rts_success);
  2537. DP_PRINT_STATS("ac_mu_mimo_tx_ldpc = %u",
  2538. dp_stats_buf->ac_mu_mimo_tx_ldpc);
  2539. DP_PRINT_STATS("ax_mu_mimo_tx_ldpc = %u",
  2540. dp_stats_buf->ax_mu_mimo_tx_ldpc);
  2541. DP_PRINT_STATS("ofdma_tx_ldpc = %u",
  2542. dp_stats_buf->ofdma_tx_ldpc);
  2543. index = 0;
  2544. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2545. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_LEGACY_CCK_STATS; i++) {
  2546. index += qdf_snprint(&str_buf[index],
  2547. DP_MAX_STRING_LEN - index,
  2548. " %u:%u,",
  2549. i, dp_stats_buf->tx_legacy_cck_rate[i]);
  2550. }
  2551. DP_PRINT_STATS("tx_legacy_cck_rate = %s ", str_buf);
  2552. index = 0;
  2553. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2554. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_LEGACY_OFDM_STATS; i++) {
  2555. index += qdf_snprint(&str_buf[index],
  2556. DP_MAX_STRING_LEN - index,
  2557. " %u:%u,", i,
  2558. dp_stats_buf->tx_legacy_ofdm_rate[i]);
  2559. }
  2560. DP_PRINT_STATS("tx_legacy_ofdm_rate = %s ", str_buf);
  2561. index = 0;
  2562. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2563. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_LTF; i++) {
  2564. index += qdf_snprint(&str_buf[index],
  2565. DP_MAX_STRING_LEN - index,
  2566. " %u:%u,",
  2567. i, dp_stats_buf->tx_he_ltf[i]);
  2568. }
  2569. DP_PRINT_STATS("tx_he_ltf = %s ", str_buf);
  2570. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2571. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  2572. index += qdf_snprint(&str_buf[index],
  2573. DP_MAX_STRING_LEN - index,
  2574. " %u:%u,",
  2575. i, dp_stats_buf->ofdma_tx_mcs[i]);
  2576. }
  2577. DP_PRINT_STATS("ofdma_tx_mcs = %s ", str_buf);
  2578. index = 0;
  2579. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2580. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  2581. index += qdf_snprint(&str_buf[index],
  2582. DP_MAX_STRING_LEN - index,
  2583. " %u:%u,",
  2584. i, dp_stats_buf->ac_mu_mimo_tx_mcs[i]);
  2585. }
  2586. DP_PRINT_STATS("ac_mu_mimo_tx_mcs = %s ", str_buf);
  2587. index = 0;
  2588. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2589. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  2590. index += qdf_snprint(&str_buf[index],
  2591. DP_MAX_STRING_LEN - index,
  2592. " %u:%u,",
  2593. i, dp_stats_buf->ax_mu_mimo_tx_mcs[i]);
  2594. }
  2595. DP_PRINT_STATS("ax_mu_mimo_tx_mcs = %s ", str_buf);
  2596. index = 0;
  2597. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2598. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  2599. index += qdf_snprint(&str_buf[index],
  2600. DP_MAX_STRING_LEN - index,
  2601. " %u:%u,",
  2602. i, dp_stats_buf->ofdma_tx_mcs[i]);
  2603. }
  2604. DP_PRINT_STATS("ofdma_tx_mcs = %s ", str_buf);
  2605. index = 0;
  2606. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2607. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS; i++) {
  2608. index += qdf_snprint(&str_buf[index],
  2609. DP_MAX_STRING_LEN - index,
  2610. " %u:%u,",
  2611. i, dp_stats_buf->ac_mu_mimo_tx_nss[i]);
  2612. }
  2613. DP_PRINT_STATS("ac_mu_mimo_tx_nss = %s ", str_buf);
  2614. index = 0;
  2615. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2616. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS; i++) {
  2617. index += qdf_snprint(&str_buf[index],
  2618. DP_MAX_STRING_LEN - index,
  2619. " %u:%u,",
  2620. i, dp_stats_buf->ax_mu_mimo_tx_nss[i]);
  2621. }
  2622. DP_PRINT_STATS("ax_mu_mimo_tx_nss = %s ", str_buf);
  2623. index = 0;
  2624. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2625. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS; i++) {
  2626. index += qdf_snprint(&str_buf[index],
  2627. DP_MAX_STRING_LEN - index,
  2628. " %u:%u,",
  2629. i, dp_stats_buf->ofdma_tx_nss[i]);
  2630. }
  2631. DP_PRINT_STATS("ofdma_tx_nss = %s ", str_buf);
  2632. index = 0;
  2633. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2634. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_BW_COUNTERS; i++) {
  2635. index += qdf_snprint(&str_buf[index],
  2636. DP_MAX_STRING_LEN - index,
  2637. " %u:%u,",
  2638. i, dp_stats_buf->ac_mu_mimo_tx_bw[i]);
  2639. }
  2640. DP_PRINT_STATS("ac_mu_mimo_tx_bw = %s ", str_buf);
  2641. index = 0;
  2642. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2643. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_BW_COUNTERS; i++) {
  2644. index += qdf_snprint(&str_buf[index],
  2645. DP_MAX_STRING_LEN - index,
  2646. " %u:%u,",
  2647. i, dp_stats_buf->ax_mu_mimo_tx_bw[i]);
  2648. }
  2649. DP_PRINT_STATS("ax_mu_mimo_tx_bw = %s ", str_buf);
  2650. index = 0;
  2651. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2652. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_BW_COUNTERS; i++) {
  2653. index += qdf_snprint(&str_buf[index],
  2654. DP_MAX_STRING_LEN - index,
  2655. " %u:%u,",
  2656. i, dp_stats_buf->ofdma_tx_bw[i]);
  2657. }
  2658. DP_PRINT_STATS("ofdma_tx_bw = %s ", str_buf);
  2659. for (j = 0; j < HTT_TX_PDEV_STATS_NUM_GI_COUNTERS; j++) {
  2660. index = 0;
  2661. qdf_mem_zero(ac_mu_mimo_tx_gi[j], DP_MAX_STRING_LEN);
  2662. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  2663. index += qdf_snprint(&ac_mu_mimo_tx_gi[j][index],
  2664. DP_MAX_STRING_LEN - index,
  2665. " %u:%u,", i,
  2666. dp_stats_buf->
  2667. ac_mu_mimo_tx_gi[j][i]);
  2668. }
  2669. DP_PRINT_STATS("ac_mu_mimo_tx_gi[%u] = %s ",
  2670. j, ac_mu_mimo_tx_gi[j]);
  2671. }
  2672. for (j = 0; j < HTT_TX_PDEV_STATS_NUM_GI_COUNTERS; j++) {
  2673. index = 0;
  2674. qdf_mem_zero(ax_mu_mimo_tx_gi[j], DP_MAX_STRING_LEN);
  2675. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  2676. index += qdf_snprint(&ax_mu_mimo_tx_gi[j][index],
  2677. DP_MAX_STRING_LEN - index,
  2678. " %u:%u,", i,
  2679. dp_stats_buf->ax_mu_mimo_tx_gi[j][i]);
  2680. }
  2681. DP_PRINT_STATS("ax_mu_mimo_tx_gi[%u] = %s ",
  2682. j, ax_mu_mimo_tx_gi[j]);
  2683. }
  2684. for (j = 0; j < HTT_TX_PDEV_STATS_NUM_GI_COUNTERS; j++) {
  2685. index = 0;
  2686. qdf_mem_zero(ofdma_tx_gi[j], DP_MAX_STRING_LEN);
  2687. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  2688. index += qdf_snprint(&ofdma_tx_gi[j][index],
  2689. DP_MAX_STRING_LEN - index,
  2690. " %u:%u,", i,
  2691. dp_stats_buf->ofdma_tx_gi[j][i]);
  2692. }
  2693. DP_PRINT_STATS("ofdma_tx_gi[%u] = %s ",
  2694. j, ofdma_tx_gi[j]);
  2695. }
  2696. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_GI_COUNTERS; i++)
  2697. qdf_mem_free(ofdma_tx_gi[i]);
  2698. fail4:
  2699. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_GI_COUNTERS; i++)
  2700. qdf_mem_free(ax_mu_mimo_tx_gi[i]);
  2701. fail3:
  2702. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_GI_COUNTERS; i++)
  2703. qdf_mem_free(ac_mu_mimo_tx_gi[i]);
  2704. fail2:
  2705. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_GI_COUNTERS; i++)
  2706. qdf_mem_free(tx_gi[i]);
  2707. fail1:
  2708. qdf_mem_free(str_buf);
  2709. }
  2710. /*
  2711. * dp_print_rx_pdev_rate_stats_tlv: display htt_rx_pdev_rate_stats_tlv
  2712. * @tag_buf: buffer containing the tlv htt_rx_pdev_rate_stats_tlv
  2713. *
  2714. * return:void
  2715. */
  2716. static void dp_print_rx_pdev_rate_stats_tlv(struct dp_pdev *pdev,
  2717. uint32_t *tag_buf)
  2718. {
  2719. htt_rx_pdev_rate_stats_tlv *dp_stats_buf =
  2720. (htt_rx_pdev_rate_stats_tlv *)tag_buf;
  2721. uint8_t i, j;
  2722. uint16_t index = 0;
  2723. char *rssi_chain[DP_HTT_RSSI_CHAIN_LEN];
  2724. char *rx_gi[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS];
  2725. char *str_buf = qdf_mem_malloc(DP_MAX_STRING_LEN);
  2726. char *ul_ofdma_rx_gi[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS];
  2727. if (!str_buf) {
  2728. dp_err("Output buffer not allocated");
  2729. return;
  2730. }
  2731. for (i = 0; i < DP_HTT_RSSI_CHAIN_LEN; i++) {
  2732. rssi_chain[i] = qdf_mem_malloc(DP_MAX_STRING_LEN);
  2733. if (!rssi_chain[i]) {
  2734. dp_err("Unable to allocate buffer for rssi_chain");
  2735. goto fail1;
  2736. }
  2737. }
  2738. for (i = 0; i < HTT_RX_PDEV_STATS_NUM_GI_COUNTERS; i++) {
  2739. rx_gi[i] = qdf_mem_malloc(DP_MAX_STRING_LEN);
  2740. if (!rx_gi[i]) {
  2741. dp_err("Unable to allocate buffer for rx_gi");
  2742. goto fail2;
  2743. }
  2744. }
  2745. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_GI_COUNTERS; i++) {
  2746. ul_ofdma_rx_gi[i] = qdf_mem_malloc(DP_MAX_STRING_LEN);
  2747. if (!ul_ofdma_rx_gi[i]) {
  2748. dp_err("Unable to allocate buffer for ul_ofdma_rx_gi");
  2749. goto fail3;
  2750. }
  2751. }
  2752. DP_PRINT_STATS("ul_ofdma_data_rx_ppdu = %d",
  2753. pdev->stats.ul_ofdma.data_rx_ppdu);
  2754. for (i = 0; i < OFDMA_NUM_USERS; i++) {
  2755. DP_PRINT_STATS("ul_ofdma data %d user = %d",
  2756. i, pdev->stats.ul_ofdma.data_users[i]);
  2757. }
  2758. index = 0;
  2759. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2760. for (i = 0; i < OFDMA_NUM_RU_SIZE; i++) {
  2761. index += qdf_snprint(&str_buf[index],
  2762. DP_MAX_STRING_LEN - index,
  2763. " %u:%u,", i,
  2764. pdev->stats.ul_ofdma.data_rx_ru_size[i]);
  2765. }
  2766. DP_PRINT_STATS("ul_ofdma_data_rx_ru_size= %s", str_buf);
  2767. index = 0;
  2768. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2769. for (i = 0; i < OFDMA_NUM_RU_SIZE; i++) {
  2770. index += qdf_snprint(&str_buf[index],
  2771. DP_MAX_STRING_LEN - index,
  2772. " %u:%u,", i,
  2773. pdev->stats.ul_ofdma.nondata_rx_ru_size[i]);
  2774. }
  2775. DP_PRINT_STATS("ul_ofdma_nondata_rx_ru_size= %s", str_buf);
  2776. DP_PRINT_STATS("HTT_RX_PDEV_RATE_STATS_TLV:");
  2777. DP_PRINT_STATS("mac_id__word = %u",
  2778. dp_stats_buf->mac_id__word);
  2779. DP_PRINT_STATS("nsts = %u",
  2780. dp_stats_buf->nsts);
  2781. DP_PRINT_STATS("rx_ldpc = %u",
  2782. dp_stats_buf->rx_ldpc);
  2783. DP_PRINT_STATS("rts_cnt = %u",
  2784. dp_stats_buf->rts_cnt);
  2785. DP_PRINT_STATS("rssi_mgmt = %u",
  2786. dp_stats_buf->rssi_mgmt);
  2787. DP_PRINT_STATS("rssi_data = %u",
  2788. dp_stats_buf->rssi_data);
  2789. DP_PRINT_STATS("rssi_comb = %u",
  2790. dp_stats_buf->rssi_comb);
  2791. DP_PRINT_STATS("rssi_in_dbm = %d",
  2792. dp_stats_buf->rssi_in_dbm);
  2793. DP_PRINT_STATS("rx_11ax_su_ext = %u",
  2794. dp_stats_buf->rx_11ax_su_ext);
  2795. DP_PRINT_STATS("rx_11ac_mumimo = %u",
  2796. dp_stats_buf->rx_11ac_mumimo);
  2797. DP_PRINT_STATS("rx_11ax_mumimo = %u",
  2798. dp_stats_buf->rx_11ax_mumimo);
  2799. DP_PRINT_STATS("rx_11ax_ofdma = %u",
  2800. dp_stats_buf->rx_11ax_ofdma);
  2801. DP_PRINT_STATS("txbf = %u",
  2802. dp_stats_buf->txbf);
  2803. index = 0;
  2804. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2805. for (i = 0; i < DP_HTT_RX_MCS_LEN; i++) {
  2806. index += qdf_snprint(&str_buf[index],
  2807. DP_MAX_STRING_LEN - index,
  2808. " %u:%u,", i, dp_stats_buf->rx_mcs[i]);
  2809. }
  2810. DP_PRINT_STATS("rx_mcs = %s ", str_buf);
  2811. index = 0;
  2812. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2813. for (i = 0; i < DP_HTT_RX_NSS_LEN; i++) {
  2814. /* 0 stands for NSS 1, 1 stands for NSS 2, etc. */
  2815. index += qdf_snprint(&str_buf[index],
  2816. DP_MAX_STRING_LEN - index,
  2817. " %u:%u,", (i + 1),
  2818. dp_stats_buf->rx_nss[i]);
  2819. }
  2820. DP_PRINT_STATS("rx_nss = %s ", str_buf);
  2821. index = 0;
  2822. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2823. for (i = 0; i < DP_HTT_RX_DCM_LEN; i++) {
  2824. index += qdf_snprint(&str_buf[index],
  2825. DP_MAX_STRING_LEN - index,
  2826. " %u:%u,", i, dp_stats_buf->rx_dcm[i]);
  2827. }
  2828. DP_PRINT_STATS("rx_dcm = %s ", str_buf);
  2829. index = 0;
  2830. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2831. for (i = 0; i < HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  2832. index += qdf_snprint(&str_buf[index],
  2833. DP_MAX_STRING_LEN - index,
  2834. " %u:%u,", i, dp_stats_buf->rx_stbc[i]);
  2835. }
  2836. DP_PRINT_STATS("rx_stbc = %s ", str_buf);
  2837. index = 0;
  2838. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2839. for (i = 0; i < DP_HTT_RX_BW_LEN; i++) {
  2840. index += qdf_snprint(&str_buf[index],
  2841. DP_MAX_STRING_LEN - index,
  2842. " %u:%u,", i, dp_stats_buf->rx_bw[i]);
  2843. }
  2844. DP_PRINT_STATS("rx_bw = %s ", str_buf);
  2845. for (j = 0; j < DP_HTT_RSSI_CHAIN_LEN; j++) {
  2846. index = 0;
  2847. for (i = 0; i < HTT_RX_PDEV_STATS_NUM_BW_COUNTERS; i++) {
  2848. index += qdf_snprint(&rssi_chain[j][index],
  2849. DP_MAX_STRING_LEN - index,
  2850. " %u:%u,", i,
  2851. dp_stats_buf->rssi_chain[j][i]);
  2852. }
  2853. DP_PRINT_STATS("rssi_chain[%u] = %s ", j, rssi_chain[j]);
  2854. }
  2855. for (j = 0; j < DP_HTT_RX_GI_LEN; j++) {
  2856. index = 0;
  2857. qdf_mem_zero(rx_gi[j], DP_MAX_STRING_LEN);
  2858. for (i = 0; i < HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  2859. index += qdf_snprint(&rx_gi[j][index],
  2860. DP_MAX_STRING_LEN - index,
  2861. " %u:%u,", i,
  2862. dp_stats_buf->rx_gi[j][i]);
  2863. }
  2864. DP_PRINT_STATS("rx_gi[%u] = %s ", j, rx_gi[j]);
  2865. }
  2866. index = 0;
  2867. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2868. for (i = 0; i < DP_HTT_RX_PREAM_LEN; i++) {
  2869. index += qdf_snprint(&str_buf[index],
  2870. DP_MAX_STRING_LEN - index,
  2871. " %u:%u,",
  2872. i,
  2873. dp_stats_buf->rx_pream[i]);
  2874. }
  2875. DP_PRINT_STATS("rx_pream = %s", str_buf);
  2876. index = 0;
  2877. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2878. for (i = 0; i < HTT_RX_PDEV_STATS_NUM_LEGACY_CCK_STATS; i++) {
  2879. index += qdf_snprint(&str_buf[index],
  2880. DP_MAX_STRING_LEN - index,
  2881. " %u:%u,",
  2882. i,
  2883. dp_stats_buf->rx_legacy_cck_rate[i]);
  2884. }
  2885. DP_PRINT_STATS("rx_legacy_cck_rate = %s", str_buf);
  2886. index = 0;
  2887. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2888. for (i = 0; i < HTT_RX_PDEV_STATS_NUM_LEGACY_OFDM_STATS; i++) {
  2889. index += qdf_snprint(&str_buf[index],
  2890. DP_MAX_STRING_LEN - index,
  2891. " %u:%u,",
  2892. i,
  2893. dp_stats_buf->rx_legacy_ofdm_rate[i]);
  2894. }
  2895. DP_PRINT_STATS("rx_legacy_ofdm_rate = %s", str_buf);
  2896. index = 0;
  2897. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2898. for (i = 0; i < HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  2899. index += qdf_snprint(&str_buf[index],
  2900. DP_MAX_STRING_LEN - index,
  2901. " %u:%u,",
  2902. i, dp_stats_buf->ul_ofdma_rx_mcs[i]);
  2903. }
  2904. DP_PRINT_STATS("ul_ofdma_rx_mcs = %s", str_buf);
  2905. DP_PRINT_STATS("rx_11ax_ul_ofdma = %u",
  2906. dp_stats_buf->rx_11ax_ul_ofdma);
  2907. for (j = 0; j < HTT_TX_PDEV_STATS_NUM_GI_COUNTERS; j++) {
  2908. index = 0;
  2909. qdf_mem_zero(ul_ofdma_rx_gi[j], DP_MAX_STRING_LEN);
  2910. for (i = 0; i < HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS; i++) {
  2911. index += qdf_snprint(&ul_ofdma_rx_gi[j][index],
  2912. DP_MAX_STRING_LEN - index,
  2913. " %u:%u,", i,
  2914. dp_stats_buf->
  2915. ul_ofdma_rx_gi[j][i]);
  2916. }
  2917. DP_PRINT_STATS("ul_ofdma_rx_gi[%u] = %s ",
  2918. j, ul_ofdma_rx_gi[j]);
  2919. }
  2920. index = 0;
  2921. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2922. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_SPATIAL_STREAMS; i++) {
  2923. index += qdf_snprint(&str_buf[index],
  2924. DP_MAX_STRING_LEN - index,
  2925. " %u:%u,", i, dp_stats_buf->ul_ofdma_rx_nss[i]);
  2926. }
  2927. DP_PRINT_STATS("ul_ofdma_rx_nss = %s", str_buf);
  2928. index = 0;
  2929. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2930. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_BW_COUNTERS; i++) {
  2931. index += qdf_snprint(&str_buf[index],
  2932. DP_MAX_STRING_LEN - index,
  2933. " %u:%u,", i, dp_stats_buf->ul_ofdma_rx_bw[i]);
  2934. }
  2935. DP_PRINT_STATS("ul_ofdma_rx_bw = %s", str_buf);
  2936. DP_PRINT_STATS("ul_ofdma_rx_stbc = %u",
  2937. dp_stats_buf->ul_ofdma_rx_stbc);
  2938. DP_PRINT_STATS("ul_ofdma_rx_ldpc = %u",
  2939. dp_stats_buf->ul_ofdma_rx_ldpc);
  2940. index = 0;
  2941. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2942. for (i = 0; i < HTT_RX_PDEV_MAX_OFDMA_NUM_USER; i++) {
  2943. index += qdf_snprint(&str_buf[index],
  2944. DP_MAX_STRING_LEN - index,
  2945. " %u:%u,", i,
  2946. dp_stats_buf->rx_ulofdma_non_data_ppdu[i]);
  2947. }
  2948. DP_PRINT_STATS("rx_ulofdma_non_data_ppdu = %s", str_buf);
  2949. index = 0;
  2950. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2951. for (i = 0; i < HTT_RX_PDEV_MAX_OFDMA_NUM_USER; i++) {
  2952. index += qdf_snprint(&str_buf[index],
  2953. DP_MAX_STRING_LEN - index,
  2954. " %u:%u,",
  2955. i, dp_stats_buf->rx_ulofdma_data_ppdu[i]);
  2956. }
  2957. DP_PRINT_STATS("rx_ulofdma_data_ppdu = %s", str_buf);
  2958. index = 0;
  2959. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2960. for (i = 0; i < HTT_RX_PDEV_MAX_OFDMA_NUM_USER; i++) {
  2961. index += qdf_snprint(&str_buf[index],
  2962. DP_MAX_STRING_LEN - index,
  2963. " %u:%u,",
  2964. i, dp_stats_buf->rx_ulofdma_mpdu_ok[i]);
  2965. }
  2966. DP_PRINT_STATS("rx_ulofdma_mpdu_ok = %s", str_buf);
  2967. index = 0;
  2968. qdf_mem_zero(str_buf, DP_MAX_STRING_LEN);
  2969. for (i = 0; i < HTT_RX_PDEV_MAX_OFDMA_NUM_USER; i++) {
  2970. index += qdf_snprint(&str_buf[index],
  2971. DP_MAX_STRING_LEN - index,
  2972. " %u:%u,",
  2973. i, dp_stats_buf->rx_ulofdma_mpdu_fail[i]);
  2974. }
  2975. DP_PRINT_STATS("rx_ulofdma_mpdu_fail = %s", str_buf);
  2976. for (i = 0; i < HTT_TX_PDEV_STATS_NUM_GI_COUNTERS; i++)
  2977. qdf_mem_free(ul_ofdma_rx_gi[i]);
  2978. fail3:
  2979. for (i = 0; i < HTT_RX_PDEV_STATS_NUM_GI_COUNTERS; i++)
  2980. qdf_mem_free(rx_gi[i]);
  2981. fail2:
  2982. for (i = 0; i < DP_HTT_RSSI_CHAIN_LEN; i++)
  2983. qdf_mem_free(rssi_chain[i]);
  2984. fail1:
  2985. qdf_mem_free(str_buf);
  2986. }
  2987. /*
  2988. * dp_print_rx_soc_fw_stats_tlv: display htt_rx_soc_fw_stats_tlv
  2989. * @tag_buf: buffer containing the tlv htt_rx_soc_fw_stats_tlv
  2990. *
  2991. * return:void
  2992. */
  2993. static inline void dp_print_rx_soc_fw_stats_tlv(uint32_t *tag_buf)
  2994. {
  2995. htt_rx_soc_fw_stats_tlv *dp_stats_buf =
  2996. (htt_rx_soc_fw_stats_tlv *)tag_buf;
  2997. DP_PRINT_STATS("HTT_RX_SOC_FW_STATS_TLV:");
  2998. DP_PRINT_STATS("fw_reo_ring_data_msdu = %u",
  2999. dp_stats_buf->fw_reo_ring_data_msdu);
  3000. DP_PRINT_STATS("fw_to_host_data_msdu_bcmc = %u",
  3001. dp_stats_buf->fw_to_host_data_msdu_bcmc);
  3002. DP_PRINT_STATS("fw_to_host_data_msdu_uc = %u",
  3003. dp_stats_buf->fw_to_host_data_msdu_uc);
  3004. DP_PRINT_STATS("ofld_remote_data_buf_recycle_cnt = %u",
  3005. dp_stats_buf->ofld_remote_data_buf_recycle_cnt);
  3006. DP_PRINT_STATS("ofld_remote_free_buf_indication_cnt = %u",
  3007. dp_stats_buf->ofld_remote_free_buf_indication_cnt);
  3008. DP_PRINT_STATS("ofld_buf_to_host_data_msdu_uc = %u ",
  3009. dp_stats_buf->ofld_buf_to_host_data_msdu_uc);
  3010. DP_PRINT_STATS("reo_fw_ring_to_host_data_msdu_uc = %u ",
  3011. dp_stats_buf->reo_fw_ring_to_host_data_msdu_uc);
  3012. DP_PRINT_STATS("wbm_sw_ring_reap = %u ",
  3013. dp_stats_buf->wbm_sw_ring_reap);
  3014. DP_PRINT_STATS("wbm_forward_to_host_cnt = %u ",
  3015. dp_stats_buf->wbm_forward_to_host_cnt);
  3016. DP_PRINT_STATS("wbm_target_recycle_cnt = %u ",
  3017. dp_stats_buf->wbm_target_recycle_cnt);
  3018. DP_PRINT_STATS("target_refill_ring_recycle_cnt = %u",
  3019. dp_stats_buf->target_refill_ring_recycle_cnt);
  3020. }
  3021. /*
  3022. * dp_print_rx_soc_fw_refill_ring_empty_tlv_v: display
  3023. * htt_rx_soc_fw_refill_ring_empty_tlv_v
  3024. * @tag_buf: buffer containing the tlv htt_rx_soc_fw_refill_ring_empty_tlv_v
  3025. *
  3026. * return:void
  3027. */
  3028. static inline void dp_print_rx_soc_fw_refill_ring_empty_tlv_v(uint32_t *tag_buf)
  3029. {
  3030. htt_rx_soc_fw_refill_ring_empty_tlv_v *dp_stats_buf =
  3031. (htt_rx_soc_fw_refill_ring_empty_tlv_v *)tag_buf;
  3032. uint8_t i;
  3033. uint16_t index = 0;
  3034. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  3035. char *refill_ring_empty_cnt = qdf_mem_malloc(DP_MAX_STRING_LEN);
  3036. if (!refill_ring_empty_cnt) {
  3037. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  3038. FL("Output buffer not allocated"));
  3039. return;
  3040. }
  3041. tag_len = qdf_min(tag_len, (uint32_t)HTT_RX_STATS_REFILL_MAX_RING);
  3042. DP_PRINT_STATS("HTT_RX_SOC_FW_REFILL_RING_EMPTY_TLV_V:");
  3043. for (i = 0; i < tag_len; i++) {
  3044. index += qdf_snprint(&refill_ring_empty_cnt[index],
  3045. DP_MAX_STRING_LEN - index,
  3046. " %u:%u,", i,
  3047. dp_stats_buf->refill_ring_empty_cnt[i]);
  3048. }
  3049. DP_PRINT_STATS("refill_ring_empty_cnt = %s\n",
  3050. refill_ring_empty_cnt);
  3051. qdf_mem_free(refill_ring_empty_cnt);
  3052. }
  3053. /*
  3054. * dp_print_rx_soc_fw_refill_ring_num_refill_tlv_v: display
  3055. * htt_rx_soc_fw_refill_ring_num_refill_tlv_v
  3056. * @tag_buf: buffer containing the tlv htt_rx_soc_fw_refill_ring_num_refill_tlv
  3057. *
  3058. * return:void
  3059. */
  3060. static inline void dp_print_rx_soc_fw_refill_ring_num_refill_tlv_v(
  3061. uint32_t *tag_buf)
  3062. {
  3063. htt_rx_soc_fw_refill_ring_num_refill_tlv_v *dp_stats_buf =
  3064. (htt_rx_soc_fw_refill_ring_num_refill_tlv_v *)tag_buf;
  3065. uint8_t i;
  3066. uint16_t index = 0;
  3067. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  3068. char *refill_ring_num_refill = qdf_mem_malloc(DP_MAX_STRING_LEN);
  3069. if (!refill_ring_num_refill) {
  3070. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  3071. FL("Output buffer not allocated"));
  3072. return;
  3073. }
  3074. tag_len = qdf_min(tag_len, (uint32_t)HTT_TX_PDEV_MAX_URRN_STATS);
  3075. DP_PRINT_STATS("HTT_RX_SOC_FW_REFILL_RING_NUM_REFILL_TLV_V:");
  3076. for (i = 0; i < tag_len; i++) {
  3077. index += qdf_snprint(&refill_ring_num_refill[index],
  3078. DP_MAX_STRING_LEN - index,
  3079. " %u:%u,", i,
  3080. dp_stats_buf->refill_ring_num_refill[i]);
  3081. }
  3082. DP_PRINT_STATS("refill_ring_num_refill = %s\n",
  3083. refill_ring_num_refill);
  3084. qdf_mem_free(refill_ring_num_refill);
  3085. }
  3086. /*
  3087. * dp_print_rx_pdev_fw_stats_tlv: display htt_rx_pdev_fw_stats_tlv
  3088. * @tag_buf: buffer containing the tlv htt_rx_pdev_fw_stats_tlv
  3089. *
  3090. * return:void
  3091. */
  3092. static inline void dp_print_rx_pdev_fw_stats_tlv(uint32_t *tag_buf)
  3093. {
  3094. htt_rx_pdev_fw_stats_tlv *dp_stats_buf =
  3095. (htt_rx_pdev_fw_stats_tlv *)tag_buf;
  3096. uint8_t i;
  3097. uint16_t index = 0;
  3098. char fw_ring_mgmt_subtype[DP_MAX_STRING_LEN];
  3099. char fw_ring_ctrl_subtype[DP_MAX_STRING_LEN];
  3100. DP_PRINT_STATS("HTT_RX_PDEV_FW_STATS_TLV:");
  3101. DP_PRINT_STATS("mac_id__word = %u",
  3102. dp_stats_buf->mac_id__word);
  3103. DP_PRINT_STATS("ppdu_recvd = %u",
  3104. dp_stats_buf->ppdu_recvd);
  3105. DP_PRINT_STATS("mpdu_cnt_fcs_ok = %u",
  3106. dp_stats_buf->mpdu_cnt_fcs_ok);
  3107. DP_PRINT_STATS("mpdu_cnt_fcs_err = %u",
  3108. dp_stats_buf->mpdu_cnt_fcs_err);
  3109. DP_PRINT_STATS("tcp_msdu_cnt = %u",
  3110. dp_stats_buf->tcp_msdu_cnt);
  3111. DP_PRINT_STATS("tcp_ack_msdu_cnt = %u",
  3112. dp_stats_buf->tcp_ack_msdu_cnt);
  3113. DP_PRINT_STATS("udp_msdu_cnt = %u",
  3114. dp_stats_buf->udp_msdu_cnt);
  3115. DP_PRINT_STATS("other_msdu_cnt = %u",
  3116. dp_stats_buf->other_msdu_cnt);
  3117. DP_PRINT_STATS("fw_ring_mpdu_ind = %u",
  3118. dp_stats_buf->fw_ring_mpdu_ind);
  3119. for (i = 0; i < DP_HTT_FW_RING_MGMT_SUBTYPE_LEN; i++) {
  3120. index += qdf_snprint(&fw_ring_mgmt_subtype[index],
  3121. DP_MAX_STRING_LEN - index,
  3122. " %u:%u,", i,
  3123. dp_stats_buf->fw_ring_mgmt_subtype[i]);
  3124. }
  3125. DP_PRINT_STATS("fw_ring_mgmt_subtype = %s ", fw_ring_mgmt_subtype);
  3126. index = 0;
  3127. for (i = 0; i < DP_HTT_FW_RING_CTRL_SUBTYPE_LEN; i++) {
  3128. index += qdf_snprint(&fw_ring_ctrl_subtype[index],
  3129. DP_MAX_STRING_LEN - index,
  3130. " %u:%u,", i,
  3131. dp_stats_buf->fw_ring_ctrl_subtype[i]);
  3132. }
  3133. DP_PRINT_STATS("fw_ring_ctrl_subtype = %s ", fw_ring_ctrl_subtype);
  3134. DP_PRINT_STATS("fw_ring_mcast_data_msdu = %u",
  3135. dp_stats_buf->fw_ring_mcast_data_msdu);
  3136. DP_PRINT_STATS("fw_ring_bcast_data_msdu = %u",
  3137. dp_stats_buf->fw_ring_bcast_data_msdu);
  3138. DP_PRINT_STATS("fw_ring_ucast_data_msdu = %u",
  3139. dp_stats_buf->fw_ring_ucast_data_msdu);
  3140. DP_PRINT_STATS("fw_ring_null_data_msdu = %u",
  3141. dp_stats_buf->fw_ring_null_data_msdu);
  3142. DP_PRINT_STATS("fw_ring_mpdu_drop = %u",
  3143. dp_stats_buf->fw_ring_mpdu_drop);
  3144. DP_PRINT_STATS("ofld_local_data_ind_cnt = %u",
  3145. dp_stats_buf->ofld_local_data_ind_cnt);
  3146. DP_PRINT_STATS("ofld_local_data_buf_recycle_cnt = %u",
  3147. dp_stats_buf->ofld_local_data_buf_recycle_cnt);
  3148. DP_PRINT_STATS("drx_local_data_ind_cnt = %u",
  3149. dp_stats_buf->drx_local_data_ind_cnt);
  3150. DP_PRINT_STATS("drx_local_data_buf_recycle_cnt = %u",
  3151. dp_stats_buf->drx_local_data_buf_recycle_cnt);
  3152. DP_PRINT_STATS("local_nondata_ind_cnt = %u",
  3153. dp_stats_buf->local_nondata_ind_cnt);
  3154. DP_PRINT_STATS("local_nondata_buf_recycle_cnt = %u",
  3155. dp_stats_buf->local_nondata_buf_recycle_cnt);
  3156. DP_PRINT_STATS("fw_status_buf_ring_refill_cnt = %u",
  3157. dp_stats_buf->fw_status_buf_ring_refill_cnt);
  3158. DP_PRINT_STATS("fw_status_buf_ring_empty_cnt = %u",
  3159. dp_stats_buf->fw_status_buf_ring_empty_cnt);
  3160. DP_PRINT_STATS("fw_pkt_buf_ring_refill_cnt = %u",
  3161. dp_stats_buf->fw_pkt_buf_ring_refill_cnt);
  3162. DP_PRINT_STATS("fw_pkt_buf_ring_empty_cnt = %u",
  3163. dp_stats_buf->fw_pkt_buf_ring_empty_cnt);
  3164. DP_PRINT_STATS("fw_link_buf_ring_refill_cnt = %u",
  3165. dp_stats_buf->fw_link_buf_ring_refill_cnt);
  3166. DP_PRINT_STATS("fw_link_buf_ring_empty_cnt = %u",
  3167. dp_stats_buf->fw_link_buf_ring_empty_cnt);
  3168. DP_PRINT_STATS("host_pkt_buf_ring_refill_cnt = %u",
  3169. dp_stats_buf->host_pkt_buf_ring_refill_cnt);
  3170. DP_PRINT_STATS("host_pkt_buf_ring_empty_cnt = %u",
  3171. dp_stats_buf->host_pkt_buf_ring_empty_cnt);
  3172. DP_PRINT_STATS("mon_pkt_buf_ring_refill_cnt = %u",
  3173. dp_stats_buf->mon_pkt_buf_ring_refill_cnt);
  3174. DP_PRINT_STATS("mon_pkt_buf_ring_empty_cnt = %u",
  3175. dp_stats_buf->mon_pkt_buf_ring_empty_cnt);
  3176. DP_PRINT_STATS("mon_status_buf_ring_refill_cnt = %u",
  3177. dp_stats_buf->mon_status_buf_ring_refill_cnt);
  3178. DP_PRINT_STATS("mon_status_buf_ring_empty_cnt = %u",
  3179. dp_stats_buf->mon_status_buf_ring_empty_cnt);
  3180. DP_PRINT_STATS("mon_desc_buf_ring_refill_cnt = %u",
  3181. dp_stats_buf->mon_desc_buf_ring_refill_cnt);
  3182. DP_PRINT_STATS("mon_desc_buf_ring_empty_cnt = %u",
  3183. dp_stats_buf->mon_desc_buf_ring_empty_cnt);
  3184. DP_PRINT_STATS("mon_dest_ring_update_cnt = %u",
  3185. dp_stats_buf->mon_dest_ring_update_cnt);
  3186. DP_PRINT_STATS("mon_dest_ring_full_cnt = %u",
  3187. dp_stats_buf->mon_dest_ring_full_cnt);
  3188. DP_PRINT_STATS("rx_suspend_cnt = %u",
  3189. dp_stats_buf->rx_suspend_cnt);
  3190. DP_PRINT_STATS("rx_suspend_fail_cnt = %u",
  3191. dp_stats_buf->rx_suspend_fail_cnt);
  3192. DP_PRINT_STATS("rx_resume_cnt = %u",
  3193. dp_stats_buf->rx_resume_cnt);
  3194. DP_PRINT_STATS("rx_resume_fail_cnt = %u",
  3195. dp_stats_buf->rx_resume_fail_cnt);
  3196. DP_PRINT_STATS("rx_ring_switch_cnt = %u",
  3197. dp_stats_buf->rx_ring_switch_cnt);
  3198. DP_PRINT_STATS("rx_ring_restore_cnt = %u",
  3199. dp_stats_buf->rx_ring_restore_cnt);
  3200. DP_PRINT_STATS("rx_flush_cnt = %u\n",
  3201. dp_stats_buf->rx_flush_cnt);
  3202. }
  3203. /*
  3204. * dp_print_rx_pdev_fw_ring_mpdu_err_tlv_v: display
  3205. * htt_rx_pdev_fw_ring_mpdu_err_tlv_v
  3206. * @tag_buf: buffer containing the tlv htt_rx_pdev_fw_ring_mpdu_err_tlv_v
  3207. *
  3208. * return:void
  3209. */
  3210. static inline void dp_print_rx_pdev_fw_ring_mpdu_err_tlv_v(uint32_t *tag_buf)
  3211. {
  3212. htt_rx_pdev_fw_ring_mpdu_err_tlv_v *dp_stats_buf =
  3213. (htt_rx_pdev_fw_ring_mpdu_err_tlv_v *)tag_buf;
  3214. uint8_t i;
  3215. uint16_t index = 0;
  3216. char *fw_ring_mpdu_err = qdf_mem_malloc(DP_MAX_STRING_LEN);
  3217. if (!fw_ring_mpdu_err) {
  3218. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  3219. FL("Output buffer not allocated"));
  3220. return;
  3221. }
  3222. DP_PRINT_STATS("HTT_RX_PDEV_FW_RING_MPDU_ERR_TLV_V:");
  3223. for (i = 0; i < DP_HTT_FW_RING_MPDU_ERR_LEN; i++) {
  3224. index += qdf_snprint(&fw_ring_mpdu_err[index],
  3225. DP_MAX_STRING_LEN - index,
  3226. " %u:%u,", i,
  3227. dp_stats_buf->fw_ring_mpdu_err[i]);
  3228. }
  3229. DP_PRINT_STATS("fw_ring_mpdu_err = %s\n", fw_ring_mpdu_err);
  3230. qdf_mem_free(fw_ring_mpdu_err);
  3231. }
  3232. /*
  3233. * dp_print_rx_pdev_fw_mpdu_drop_tlv_v: display htt_rx_pdev_fw_mpdu_drop_tlv_v
  3234. * @tag_buf: buffer containing the tlv htt_rx_pdev_fw_mpdu_drop_tlv_v
  3235. *
  3236. * return:void
  3237. */
  3238. static inline void dp_print_rx_pdev_fw_mpdu_drop_tlv_v(uint32_t *tag_buf)
  3239. {
  3240. htt_rx_pdev_fw_mpdu_drop_tlv_v *dp_stats_buf =
  3241. (htt_rx_pdev_fw_mpdu_drop_tlv_v *)tag_buf;
  3242. uint8_t i;
  3243. uint16_t index = 0;
  3244. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  3245. char *fw_mpdu_drop = qdf_mem_malloc(DP_MAX_STRING_LEN);
  3246. if (!fw_mpdu_drop) {
  3247. QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
  3248. FL("Output buffer not allocated"));
  3249. return;
  3250. }
  3251. tag_len = qdf_min(tag_len, (uint32_t)HTT_RX_STATS_FW_DROP_REASON_MAX);
  3252. DP_PRINT_STATS("HTT_RX_PDEV_FW_MPDU_DROP_TLV_V:");
  3253. for (i = 0; i < tag_len; i++) {
  3254. index += qdf_snprint(&fw_mpdu_drop[index],
  3255. DP_MAX_STRING_LEN - index,
  3256. " %u:%u,", i, dp_stats_buf->fw_mpdu_drop[i]);
  3257. }
  3258. DP_PRINT_STATS("fw_mpdu_drop = %s\n", fw_mpdu_drop);
  3259. qdf_mem_free(fw_mpdu_drop);
  3260. }
  3261. /*
  3262. * dp_print_rx_soc_fw_refill_ring_num_rxdma_err_tlv() - Accounts for rxdma error
  3263. * packets
  3264. *
  3265. * tag_buf - Buffer
  3266. * Return - NULL
  3267. */
  3268. static inline void dp_print_rx_soc_fw_refill_ring_num_rxdma_err_tlv(uint32_t *tag_buf)
  3269. {
  3270. htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v *dp_stats_buf =
  3271. (htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v *)tag_buf;
  3272. uint8_t i;
  3273. uint16_t index = 0;
  3274. char rxdma_err_cnt[DP_MAX_STRING_LEN];
  3275. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  3276. tag_len = qdf_min(tag_len, (uint32_t)HTT_RX_RXDMA_MAX_ERR_CODE);
  3277. DP_PRINT_STATS("HTT_RX_SOC_FW_REFILL_RING_NUM_RXDMA_ERR_TLV_V");
  3278. for (i = 0; i < tag_len; i++) {
  3279. index += snprintf(&rxdma_err_cnt[index],
  3280. DP_MAX_STRING_LEN - index,
  3281. " %u:%u,", i,
  3282. dp_stats_buf->rxdma_err[i]);
  3283. }
  3284. DP_PRINT_STATS("rxdma_err = %s\n", rxdma_err_cnt);
  3285. }
  3286. /*
  3287. * dp_print_rx_soc_fw_refill_ring_num_reo_err_tlv() - Accounts for reo error
  3288. * packets
  3289. *
  3290. * tag_buf - Buffer
  3291. * Return - NULL
  3292. */
  3293. static inline void dp_print_rx_soc_fw_refill_ring_num_reo_err_tlv(uint32_t *tag_buf)
  3294. {
  3295. htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v *dp_stats_buf =
  3296. (htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v *)tag_buf;
  3297. uint8_t i;
  3298. uint16_t index = 0;
  3299. char reo_err_cnt[DP_MAX_STRING_LEN];
  3300. uint32_t tag_len = (HTT_STATS_TLV_LENGTH_GET(*tag_buf) >> 2);
  3301. tag_len = qdf_min(tag_len, (uint32_t)HTT_RX_REO_MAX_ERR_CODE);
  3302. DP_PRINT_STATS("HTT_RX_SOC_FW_REFILL_RING_NUM_REO_ERR_TLV_V");
  3303. for (i = 0; i < tag_len; i++) {
  3304. index += snprintf(&reo_err_cnt[index],
  3305. DP_MAX_STRING_LEN - index,
  3306. " %u:%u,", i,
  3307. dp_stats_buf->reo_err[i]);
  3308. }
  3309. DP_PRINT_STATS("reo_err = %s\n", reo_err_cnt);
  3310. }
  3311. /*
  3312. * dp_print_rx_reo_debug_stats_tlv() - REO Statistics
  3313. *
  3314. * tag_buf - Buffer
  3315. * Return - NULL
  3316. */
  3317. static inline void dp_print_rx_reo_debug_stats_tlv(uint32_t *tag_buf)
  3318. {
  3319. htt_rx_reo_resource_stats_tlv_v *dp_stats_buf =
  3320. (htt_rx_reo_resource_stats_tlv_v *)tag_buf;
  3321. DP_PRINT_STATS("HTT_RX_REO_RESOURCE_STATS_TLV");
  3322. DP_PRINT_STATS("sample_id: %u ",
  3323. dp_stats_buf->sample_id);
  3324. DP_PRINT_STATS("total_max: %u ",
  3325. dp_stats_buf->total_max);
  3326. DP_PRINT_STATS("total_avg: %u ",
  3327. dp_stats_buf->total_avg);
  3328. DP_PRINT_STATS("total_sample: %u ",
  3329. dp_stats_buf->total_sample);
  3330. DP_PRINT_STATS("non_zeros_avg: %u ",
  3331. dp_stats_buf->non_zeros_avg);
  3332. DP_PRINT_STATS("non_zeros_sample: %u ",
  3333. dp_stats_buf->non_zeros_sample);
  3334. DP_PRINT_STATS("last_non_zeros_max: %u ",
  3335. dp_stats_buf->last_non_zeros_max);
  3336. DP_PRINT_STATS("last_non_zeros_min: %u ",
  3337. dp_stats_buf->last_non_zeros_min);
  3338. DP_PRINT_STATS("last_non_zeros_avg: %u ",
  3339. dp_stats_buf->last_non_zeros_avg);
  3340. DP_PRINT_STATS("last_non_zeros_sample: %u\n ",
  3341. dp_stats_buf->last_non_zeros_sample);
  3342. }
  3343. /*
  3344. * dp_print_rx_pdev_fw_stats_phy_err_tlv() - Accounts for phy errors
  3345. *
  3346. * tag_buf - Buffer
  3347. * Return - NULL
  3348. */
  3349. static inline void dp_print_rx_pdev_fw_stats_phy_err_tlv(uint32_t *tag_buf)
  3350. {
  3351. htt_rx_pdev_fw_stats_phy_err_tlv *dp_stats_buf =
  3352. (htt_rx_pdev_fw_stats_phy_err_tlv *)tag_buf;
  3353. uint8_t i = 0;
  3354. uint16_t index = 0;
  3355. char phy_errs[DP_MAX_STRING_LEN];
  3356. DP_PRINT_STATS("HTT_RX_PDEV_FW_STATS_PHY_ERR_TLV");
  3357. DP_PRINT_STATS("mac_id_word: %u",
  3358. dp_stats_buf->mac_id__word);
  3359. DP_PRINT_STATS("total_phy_err_cnt: %u",
  3360. dp_stats_buf->total_phy_err_cnt);
  3361. for (i = 0; i < HTT_STATS_PHY_ERR_MAX; i++) {
  3362. index += snprintf(&phy_errs[index],
  3363. DP_MAX_STRING_LEN - index,
  3364. " %u:%u,", i, dp_stats_buf->phy_err[i]);
  3365. }
  3366. DP_PRINT_STATS("phy_errs: %s\n", phy_errs);
  3367. }
  3368. /*
  3369. * dp_htt_stats_print_tag: function to select the tag type and
  3370. * print the corresponding tag structure
  3371. * @pdev: pdev pointer
  3372. * @tag_type: tag type that is to be printed
  3373. * @tag_buf: pointer to the tag structure
  3374. *
  3375. * return: void
  3376. */
  3377. void dp_htt_stats_print_tag(struct dp_pdev *pdev,
  3378. uint8_t tag_type, uint32_t *tag_buf)
  3379. {
  3380. switch (tag_type) {
  3381. case HTT_STATS_TX_PDEV_CMN_TAG:
  3382. dp_print_tx_pdev_stats_cmn_tlv(tag_buf);
  3383. break;
  3384. case HTT_STATS_TX_PDEV_UNDERRUN_TAG:
  3385. dp_print_tx_pdev_stats_urrn_tlv_v(tag_buf);
  3386. break;
  3387. case HTT_STATS_TX_PDEV_SIFS_TAG:
  3388. dp_print_tx_pdev_stats_sifs_tlv_v(tag_buf);
  3389. break;
  3390. case HTT_STATS_TX_PDEV_FLUSH_TAG:
  3391. dp_print_tx_pdev_stats_flush_tlv_v(tag_buf);
  3392. break;
  3393. case HTT_STATS_TX_PDEV_PHY_ERR_TAG:
  3394. dp_print_tx_pdev_stats_phy_err_tlv_v(tag_buf);
  3395. break;
  3396. case HTT_STATS_STRING_TAG:
  3397. dp_print_stats_string_tlv(tag_buf);
  3398. break;
  3399. case HTT_STATS_TX_HWQ_CMN_TAG:
  3400. dp_print_tx_hwq_stats_cmn_tlv(tag_buf);
  3401. break;
  3402. case HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG:
  3403. dp_print_tx_hwq_difs_latency_stats_tlv_v(tag_buf);
  3404. break;
  3405. case HTT_STATS_TX_HWQ_CMD_RESULT_TAG:
  3406. dp_print_tx_hwq_cmd_result_stats_tlv_v(tag_buf);
  3407. break;
  3408. case HTT_STATS_TX_HWQ_CMD_STALL_TAG:
  3409. dp_print_tx_hwq_cmd_stall_stats_tlv_v(tag_buf);
  3410. break;
  3411. case HTT_STATS_TX_HWQ_FES_STATUS_TAG:
  3412. dp_print_tx_hwq_fes_result_stats_tlv_v(tag_buf);
  3413. break;
  3414. case HTT_STATS_TX_TQM_GEN_MPDU_TAG:
  3415. dp_print_tx_tqm_gen_mpdu_stats_tlv_v(tag_buf);
  3416. break;
  3417. case HTT_STATS_TX_TQM_LIST_MPDU_TAG:
  3418. dp_print_tx_tqm_list_mpdu_stats_tlv_v(tag_buf);
  3419. break;
  3420. case HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG:
  3421. dp_print_tx_tqm_list_mpdu_cnt_tlv_v(tag_buf);
  3422. break;
  3423. case HTT_STATS_TX_TQM_CMN_TAG:
  3424. dp_print_tx_tqm_cmn_stats_tlv(tag_buf);
  3425. break;
  3426. case HTT_STATS_TX_TQM_PDEV_TAG:
  3427. dp_print_tx_tqm_pdev_stats_tlv_v(tag_buf);
  3428. break;
  3429. case HTT_STATS_TX_TQM_CMDQ_STATUS_TAG:
  3430. dp_print_tx_tqm_cmdq_status_tlv(tag_buf);
  3431. break;
  3432. case HTT_STATS_TX_DE_EAPOL_PACKETS_TAG:
  3433. dp_print_tx_de_eapol_packets_stats_tlv(tag_buf);
  3434. break;
  3435. case HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG:
  3436. dp_print_tx_de_classify_failed_stats_tlv(tag_buf);
  3437. break;
  3438. case HTT_STATS_TX_DE_CLASSIFY_STATS_TAG:
  3439. dp_print_tx_de_classify_stats_tlv(tag_buf);
  3440. break;
  3441. case HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG:
  3442. dp_print_tx_de_classify_status_stats_tlv(tag_buf);
  3443. break;
  3444. case HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG:
  3445. dp_print_tx_de_enqueue_packets_stats_tlv(tag_buf);
  3446. break;
  3447. case HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG:
  3448. dp_print_tx_de_enqueue_discard_stats_tlv(tag_buf);
  3449. break;
  3450. case HTT_STATS_TX_DE_CMN_TAG:
  3451. dp_print_tx_de_cmn_stats_tlv(tag_buf);
  3452. break;
  3453. case HTT_STATS_RING_IF_TAG:
  3454. dp_print_ring_if_stats_tlv(tag_buf);
  3455. break;
  3456. case HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG:
  3457. dp_print_tx_pdev_mu_mimo_sch_stats_tlv(tag_buf);
  3458. break;
  3459. case HTT_STATS_SFM_CMN_TAG:
  3460. dp_print_sfm_cmn_tlv(tag_buf);
  3461. break;
  3462. case HTT_STATS_SRING_STATS_TAG:
  3463. dp_print_sring_stats_tlv(tag_buf);
  3464. break;
  3465. case HTT_STATS_RX_PDEV_FW_STATS_TAG:
  3466. dp_print_rx_pdev_fw_stats_tlv(tag_buf);
  3467. break;
  3468. case HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG:
  3469. dp_print_rx_pdev_fw_ring_mpdu_err_tlv_v(tag_buf);
  3470. break;
  3471. case HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG:
  3472. dp_print_rx_pdev_fw_mpdu_drop_tlv_v(tag_buf);
  3473. break;
  3474. case HTT_STATS_RX_SOC_FW_STATS_TAG:
  3475. dp_print_rx_soc_fw_stats_tlv(tag_buf);
  3476. break;
  3477. case HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG:
  3478. dp_print_rx_soc_fw_refill_ring_empty_tlv_v(tag_buf);
  3479. break;
  3480. case HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG:
  3481. dp_print_rx_soc_fw_refill_ring_num_refill_tlv_v(
  3482. tag_buf);
  3483. break;
  3484. case HTT_STATS_TX_PDEV_RATE_STATS_TAG:
  3485. dp_print_tx_pdev_rate_stats_tlv(tag_buf);
  3486. break;
  3487. case HTT_STATS_RX_PDEV_RATE_STATS_TAG:
  3488. dp_print_rx_pdev_rate_stats_tlv(pdev, tag_buf);
  3489. break;
  3490. case HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG:
  3491. dp_print_tx_pdev_stats_sched_per_txq_tlv(tag_buf);
  3492. break;
  3493. case HTT_STATS_TX_SCHED_CMN_TAG:
  3494. dp_print_stats_tx_sched_cmn_tlv(tag_buf);
  3495. break;
  3496. case HTT_STATS_TX_PDEV_MPDU_STATS_TAG:
  3497. dp_print_tx_pdev_mu_mimo_mpdu_stats_tlv(tag_buf);
  3498. break;
  3499. case HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG:
  3500. dp_print_sched_txq_cmd_posted_tlv_v(tag_buf);
  3501. break;
  3502. case HTT_STATS_RING_IF_CMN_TAG:
  3503. dp_print_ring_if_cmn_tlv(tag_buf);
  3504. break;
  3505. case HTT_STATS_SFM_CLIENT_USER_TAG:
  3506. dp_print_sfm_client_user_tlv_v(tag_buf);
  3507. break;
  3508. case HTT_STATS_SFM_CLIENT_TAG:
  3509. dp_print_sfm_client_tlv(tag_buf);
  3510. break;
  3511. case HTT_STATS_TX_TQM_ERROR_STATS_TAG:
  3512. dp_print_tx_tqm_error_stats_tlv(tag_buf);
  3513. break;
  3514. case HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG:
  3515. dp_print_sched_txq_cmd_reaped_tlv_v(tag_buf);
  3516. break;
  3517. case HTT_STATS_SRING_CMN_TAG:
  3518. dp_print_sring_cmn_tlv(tag_buf);
  3519. break;
  3520. case HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG:
  3521. dp_print_tx_selfgen_ac_err_stats_tlv(tag_buf);
  3522. break;
  3523. case HTT_STATS_TX_SELFGEN_CMN_STATS_TAG:
  3524. dp_print_tx_selfgen_cmn_stats_tlv(tag_buf);
  3525. break;
  3526. case HTT_STATS_TX_SELFGEN_AC_STATS_TAG:
  3527. dp_print_tx_selfgen_ac_stats_tlv(tag_buf);
  3528. break;
  3529. case HTT_STATS_TX_SELFGEN_AX_STATS_TAG:
  3530. dp_print_tx_selfgen_ax_stats_tlv(tag_buf);
  3531. break;
  3532. case HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG:
  3533. dp_print_tx_selfgen_ax_err_stats_tlv(tag_buf);
  3534. break;
  3535. case HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG:
  3536. dp_print_tx_hwq_mu_mimo_sch_stats_tlv(tag_buf);
  3537. break;
  3538. case HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG:
  3539. dp_print_tx_hwq_mu_mimo_mpdu_stats_tlv(tag_buf);
  3540. break;
  3541. case HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG:
  3542. dp_print_tx_hwq_mu_mimo_cmn_stats_tlv(tag_buf);
  3543. break;
  3544. case HTT_STATS_HW_INTR_MISC_TAG:
  3545. dp_print_hw_stats_intr_misc_tlv(tag_buf);
  3546. break;
  3547. case HTT_STATS_HW_WD_TIMEOUT_TAG:
  3548. dp_print_hw_stats_wd_timeout_tlv(tag_buf);
  3549. break;
  3550. case HTT_STATS_HW_PDEV_ERRS_TAG:
  3551. dp_print_hw_stats_pdev_errs_tlv(tag_buf);
  3552. break;
  3553. case HTT_STATS_COUNTER_NAME_TAG:
  3554. dp_print_counter_tlv(tag_buf);
  3555. break;
  3556. case HTT_STATS_TX_TID_DETAILS_TAG:
  3557. dp_print_tx_tid_stats_tlv(tag_buf);
  3558. break;
  3559. case HTT_STATS_TX_TID_DETAILS_V1_TAG:
  3560. dp_print_tx_tid_stats_v1_tlv(tag_buf);
  3561. break;
  3562. case HTT_STATS_RX_TID_DETAILS_TAG:
  3563. dp_print_rx_tid_stats_tlv(tag_buf);
  3564. break;
  3565. case HTT_STATS_PEER_STATS_CMN_TAG:
  3566. dp_print_peer_stats_cmn_tlv(tag_buf);
  3567. break;
  3568. case HTT_STATS_PEER_DETAILS_TAG:
  3569. dp_print_peer_details_tlv(tag_buf);
  3570. break;
  3571. case HTT_STATS_PEER_MSDU_FLOWQ_TAG:
  3572. dp_print_msdu_flow_stats_tlv(tag_buf);
  3573. break;
  3574. case HTT_STATS_PEER_TX_RATE_STATS_TAG:
  3575. dp_print_tx_peer_rate_stats_tlv(tag_buf);
  3576. break;
  3577. case HTT_STATS_PEER_RX_RATE_STATS_TAG:
  3578. dp_print_rx_peer_rate_stats_tlv(tag_buf);
  3579. break;
  3580. case HTT_STATS_TX_DE_COMPL_STATS_TAG:
  3581. dp_print_tx_de_compl_stats_tlv(tag_buf);
  3582. break;
  3583. case HTT_STATS_RX_REFILL_RXDMA_ERR_TAG:
  3584. dp_print_rx_soc_fw_refill_ring_num_rxdma_err_tlv(tag_buf);
  3585. break;
  3586. case HTT_STATS_RX_REFILL_REO_ERR_TAG:
  3587. dp_print_rx_soc_fw_refill_ring_num_reo_err_tlv(tag_buf);
  3588. break;
  3589. case HTT_STATS_RX_REO_RESOURCE_STATS_TAG:
  3590. dp_print_rx_reo_debug_stats_tlv(tag_buf);
  3591. break;
  3592. case HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG:
  3593. dp_print_rx_pdev_fw_stats_phy_err_tlv(tag_buf);
  3594. break;
  3595. default:
  3596. break;
  3597. }
  3598. }
  3599. /*
  3600. * dp_htt_stats_copy_tag: function to select the tag type and
  3601. * copy the corresponding tag structure
  3602. * @pdev: DP_PDEV handle
  3603. * @tag_type: tag type that is to be printed
  3604. * @tag_buf: pointer to the tag structure
  3605. *
  3606. * return: void
  3607. */
  3608. void dp_htt_stats_copy_tag(struct dp_pdev *pdev, uint8_t tag_type, uint32_t *tag_buf)
  3609. {
  3610. void *dest_ptr = NULL;
  3611. uint32_t size = 0;
  3612. switch (tag_type) {
  3613. case HTT_STATS_TX_PDEV_CMN_TAG:
  3614. dest_ptr = &pdev->stats.htt_tx_pdev_stats.cmn_tlv;
  3615. size = sizeof(htt_tx_pdev_stats_cmn_tlv);
  3616. break;
  3617. case HTT_STATS_TX_PDEV_UNDERRUN_TAG:
  3618. dest_ptr = &pdev->stats.htt_tx_pdev_stats.underrun_tlv;
  3619. size = sizeof(htt_tx_pdev_stats_urrn_tlv_v);
  3620. break;
  3621. case HTT_STATS_TX_PDEV_SIFS_TAG:
  3622. dest_ptr = &pdev->stats.htt_tx_pdev_stats.sifs_tlv;
  3623. size = sizeof(htt_tx_pdev_stats_sifs_tlv_v);
  3624. break;
  3625. case HTT_STATS_TX_PDEV_FLUSH_TAG:
  3626. dest_ptr = &pdev->stats.htt_tx_pdev_stats.flush_tlv;
  3627. size = sizeof(htt_tx_pdev_stats_flush_tlv_v);
  3628. break;
  3629. case HTT_STATS_TX_PDEV_PHY_ERR_TAG:
  3630. dest_ptr = &pdev->stats.htt_tx_pdev_stats.phy_err_tlv;
  3631. size = sizeof(htt_tx_pdev_stats_phy_err_tlv_v);
  3632. break;
  3633. case HTT_STATS_RX_PDEV_FW_STATS_TAG:
  3634. dest_ptr = &pdev->stats.htt_rx_pdev_stats.fw_stats_tlv;
  3635. size = sizeof(htt_rx_pdev_fw_stats_tlv);
  3636. break;
  3637. case HTT_STATS_RX_SOC_FW_STATS_TAG:
  3638. dest_ptr = &pdev->stats.htt_rx_pdev_stats.soc_stats.fw_tlv;
  3639. size = sizeof(htt_rx_soc_fw_stats_tlv);
  3640. break;
  3641. case HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG:
  3642. dest_ptr = &pdev->stats.htt_rx_pdev_stats.soc_stats.fw_refill_ring_empty_tlv;
  3643. size = sizeof(htt_rx_soc_fw_refill_ring_empty_tlv_v);
  3644. break;
  3645. case HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG:
  3646. dest_ptr = &pdev->stats.htt_rx_pdev_stats.soc_stats.fw_refill_ring_num_refill_tlv;
  3647. size = sizeof(htt_rx_soc_fw_refill_ring_num_refill_tlv_v);
  3648. break;
  3649. case HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG:
  3650. dest_ptr = &pdev->stats.htt_rx_pdev_stats.fw_ring_mpdu_err_tlv;
  3651. size = sizeof(htt_rx_pdev_fw_ring_mpdu_err_tlv_v);
  3652. break;
  3653. case HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG:
  3654. dest_ptr = &pdev->stats.htt_rx_pdev_stats.fw_ring_mpdu_drop;
  3655. size = sizeof(htt_rx_pdev_fw_mpdu_drop_tlv_v);
  3656. break;
  3657. default:
  3658. break;
  3659. }
  3660. if (dest_ptr)
  3661. qdf_mem_copy(dest_ptr, tag_buf, size);
  3662. }
  3663. QDF_STATUS dp_peer_stats_notify(struct dp_pdev *dp_pdev, struct dp_peer *peer)
  3664. {
  3665. struct cdp_interface_peer_stats peer_stats_intf;
  3666. struct cdp_peer_stats *peer_stats = &peer->stats;
  3667. if (!peer->vdev)
  3668. return QDF_STATUS_E_FAULT;
  3669. qdf_mem_zero(&peer_stats_intf, sizeof(peer_stats_intf));
  3670. if (peer_stats->rx.last_rssi != peer_stats->rx.rssi)
  3671. peer_stats_intf.rssi_changed = true;
  3672. if ((peer_stats->rx.rssi && peer_stats_intf.rssi_changed) ||
  3673. (peer_stats->tx.tx_rate &&
  3674. peer_stats->tx.tx_rate != peer_stats->tx.last_tx_rate)) {
  3675. peer_stats_intf.peer_hdl = peer->ctrl_peer;
  3676. peer_stats_intf.last_peer_tx_rate = peer_stats->tx.last_tx_rate;
  3677. peer_stats_intf.peer_tx_rate = peer_stats->tx.tx_rate;
  3678. peer_stats_intf.peer_rssi = peer_stats->rx.rssi;
  3679. peer_stats_intf.tx_packet_count = peer_stats->tx.ucast.num;
  3680. peer_stats_intf.rx_packet_count = peer_stats->rx.to_stack.num;
  3681. peer_stats_intf.tx_byte_count = peer_stats->tx.tx_success.bytes;
  3682. peer_stats_intf.rx_byte_count = peer_stats->rx.to_stack.bytes;
  3683. peer_stats_intf.per = peer_stats->tx.last_per;
  3684. peer_stats_intf.ack_rssi = peer_stats->tx.last_ack_rssi;
  3685. dp_wdi_event_handler(WDI_EVENT_PEER_STATS, dp_pdev->soc,
  3686. (void *)&peer_stats_intf, 0,
  3687. WDI_NO_VAL, dp_pdev->pdev_id);
  3688. }
  3689. return QDF_STATUS_SUCCESS;
  3690. }
  3691. #ifdef QCA_ENH_V3_STATS_SUPPORT
  3692. /**
  3693. * dp_vow_str_fw_to_hw_delay() - Return string for a delay
  3694. * @index: Index of delay
  3695. *
  3696. * Return: char const pointer
  3697. */
  3698. static inline const char *dp_vow_str_fw_to_hw_delay(uint8_t index)
  3699. {
  3700. if (index > CDP_DELAY_BUCKET_MAX) {
  3701. return "Invalid index";
  3702. }
  3703. return fw_to_hw_delay_bucket[index];
  3704. }
  3705. /**
  3706. * dp_vow_str_sw_enq_delay() - Return string for a delay
  3707. * @index: Index of delay
  3708. *
  3709. * Return: char const pointer
  3710. */
  3711. static inline const char *dp_vow_str_sw_enq_delay(uint8_t index)
  3712. {
  3713. if (index > CDP_DELAY_BUCKET_MAX) {
  3714. return "Invalid index";
  3715. }
  3716. return sw_enq_delay_bucket[index];
  3717. }
  3718. /**
  3719. * dp_vow_str_intfrm_delay() - Return string for a delay
  3720. * @index: Index of delay
  3721. *
  3722. * Return: char const pointer
  3723. */
  3724. static inline const char *dp_vow_str_intfrm_delay(uint8_t index)
  3725. {
  3726. if (index > CDP_DELAY_BUCKET_MAX) {
  3727. return "Invalid index";
  3728. }
  3729. return intfrm_delay_bucket[index];
  3730. }
  3731. /**
  3732. * dp_accumulate_delay_stats() - Update delay stats members
  3733. * @total: Update stats total structure
  3734. * @per_ring: per ring structures from where stats need to be accumulated
  3735. *
  3736. * Return: void
  3737. */
  3738. static void
  3739. dp_accumulate_delay_stats(struct cdp_delay_stats *total,
  3740. struct cdp_delay_stats *per_ring)
  3741. {
  3742. uint8_t index;
  3743. for (index = 0; index < CDP_DELAY_BUCKET_MAX; index++)
  3744. total->delay_bucket[index] += per_ring->delay_bucket[index];
  3745. total->min_delay = QDF_MIN(total->min_delay, per_ring->min_delay);
  3746. total->max_delay = QDF_MAX(total->max_delay, per_ring->max_delay);
  3747. total->avg_delay = (total->avg_delay + per_ring->avg_delay) / 2;
  3748. }
  3749. /**
  3750. * dp_accumulate_tid_stats() - Accumulate TID stats from each ring
  3751. * @pdev: pdev handle
  3752. * @tid: traffic ID
  3753. * @total_tx: fill this tx structure to get stats from all wbm rings
  3754. * @total_rx: fill this rx structure to get stats from all reo rings
  3755. * @type: delay stats or regular frame counters
  3756. *
  3757. * Return: void
  3758. */
  3759. static void
  3760. dp_accumulate_tid_stats(struct dp_pdev *pdev, uint8_t tid,
  3761. struct cdp_tid_tx_stats *total_tx,
  3762. struct cdp_tid_rx_stats *total_rx, uint8_t type)
  3763. {
  3764. uint8_t ring_id = 0, drop = 0, tqm_status_idx = 0, htt_status_idx = 0;
  3765. struct cdp_tid_stats *tid_stats = &pdev->stats.tid_stats;
  3766. struct cdp_tid_tx_stats *per_ring_tx = NULL;
  3767. struct cdp_tid_rx_stats *per_ring_rx = NULL;
  3768. if (wlan_cfg_get_dp_soc_nss_cfg(pdev->soc->wlan_cfg_ctx)) {
  3769. qdf_mem_copy(total_tx, &tid_stats->tid_tx_stats[0][tid],
  3770. sizeof(struct cdp_tid_tx_stats));
  3771. qdf_mem_copy(total_rx, &tid_stats->tid_rx_stats[0][tid],
  3772. sizeof(struct cdp_tid_rx_stats));
  3773. return;
  3774. } else {
  3775. qdf_mem_zero(total_tx, sizeof(struct cdp_tid_tx_stats));
  3776. qdf_mem_zero(total_rx, sizeof(struct cdp_tid_rx_stats));
  3777. }
  3778. switch (type) {
  3779. case TID_COUNTER_STATS:
  3780. {
  3781. for (ring_id = 0; ring_id < CDP_MAX_TX_COMP_RINGS; ring_id++) {
  3782. per_ring_tx = &tid_stats->tid_tx_stats[ring_id][tid];
  3783. total_tx->success_cnt += per_ring_tx->success_cnt;
  3784. for (tqm_status_idx = 0; tqm_status_idx < CDP_MAX_TX_TQM_STATUS; tqm_status_idx++) {
  3785. total_tx->tqm_status_cnt[tqm_status_idx] +=
  3786. per_ring_tx->tqm_status_cnt[tqm_status_idx];
  3787. }
  3788. for (htt_status_idx = 0; htt_status_idx < CDP_MAX_TX_HTT_STATUS; htt_status_idx++) {
  3789. total_tx->htt_status_cnt[htt_status_idx] +=
  3790. per_ring_tx->htt_status_cnt[htt_status_idx];
  3791. }
  3792. for (drop = 0; drop < TX_MAX_DROP; drop++)
  3793. total_tx->swdrop_cnt[drop] +=
  3794. per_ring_tx->swdrop_cnt[drop];
  3795. }
  3796. for (ring_id = 0; ring_id < CDP_MAX_RX_RINGS; ring_id++) {
  3797. per_ring_rx = &tid_stats->tid_rx_stats[ring_id][tid];
  3798. total_rx->delivered_to_stack +=
  3799. per_ring_rx->delivered_to_stack;
  3800. total_rx->intrabss_cnt += per_ring_rx->intrabss_cnt;
  3801. total_rx->msdu_cnt += per_ring_rx->msdu_cnt;
  3802. total_rx->mcast_msdu_cnt += per_ring_rx->mcast_msdu_cnt;
  3803. total_rx->bcast_msdu_cnt += per_ring_rx->bcast_msdu_cnt;
  3804. for (drop = 0; drop < RX_MAX_DROP; drop++)
  3805. total_rx->fail_cnt[drop] +=
  3806. per_ring_rx->fail_cnt[drop];
  3807. }
  3808. break;
  3809. }
  3810. case TID_DELAY_STATS:
  3811. {
  3812. for (ring_id = 0; ring_id < CDP_MAX_TX_COMP_RINGS; ring_id++) {
  3813. per_ring_tx = &tid_stats->tid_tx_stats[ring_id][tid];
  3814. dp_accumulate_delay_stats(&total_tx->swq_delay,
  3815. &per_ring_tx->swq_delay);
  3816. dp_accumulate_delay_stats(&total_tx->hwtx_delay,
  3817. &per_ring_tx->hwtx_delay);
  3818. dp_accumulate_delay_stats(&total_tx->intfrm_delay,
  3819. &per_ring_tx->intfrm_delay);
  3820. }
  3821. for (ring_id = 0; ring_id < CDP_MAX_RX_RINGS; ring_id++) {
  3822. per_ring_rx = &tid_stats->tid_rx_stats[ring_id][tid];
  3823. dp_accumulate_delay_stats(&total_rx->intfrm_delay,
  3824. &per_ring_rx->intfrm_delay);
  3825. dp_accumulate_delay_stats(&total_rx->to_stack_delay,
  3826. &per_ring_rx->to_stack_delay);
  3827. }
  3828. break;
  3829. }
  3830. default:
  3831. qdf_err("Invalid stats type");
  3832. break;
  3833. }
  3834. }
  3835. void dp_pdev_print_tid_stats(struct dp_pdev *pdev)
  3836. {
  3837. struct cdp_tid_tx_stats total_tx;
  3838. struct cdp_tid_rx_stats total_rx;
  3839. uint8_t tid, tqm_status_idx, htt_status_idx;
  3840. DP_PRINT_STATS("Packets received in hardstart: %llu ",
  3841. pdev->stats.tid_stats.ingress_stack);
  3842. DP_PRINT_STATS("Packets dropped in osif layer: %llu ",
  3843. pdev->stats.tid_stats.osif_drop);
  3844. DP_PRINT_STATS("Per TID Video Stats:\n");
  3845. for (tid = 0; tid < CDP_MAX_DATA_TIDS; tid++) {
  3846. dp_accumulate_tid_stats(pdev, tid, &total_tx, &total_rx,
  3847. TID_COUNTER_STATS);
  3848. DP_PRINT_STATS("----TID: %d----", tid);
  3849. DP_PRINT_STATS("Tx TQM Success Count: %llu",
  3850. total_tx.tqm_status_cnt[HAL_TX_TQM_RR_FRAME_ACKED]);
  3851. DP_PRINT_STATS("Tx HTT Success Count: %llu",
  3852. total_tx.htt_status_cnt[HTT_TX_FW2WBM_TX_STATUS_OK]);
  3853. for (tqm_status_idx = 1; tqm_status_idx < CDP_MAX_TX_TQM_STATUS; tqm_status_idx++) {
  3854. if (total_tx.tqm_status_cnt[tqm_status_idx]) {
  3855. DP_PRINT_STATS("Tx TQM Drop Count[%d]: %llu",
  3856. tqm_status_idx, total_tx.tqm_status_cnt[tqm_status_idx]);
  3857. }
  3858. }
  3859. for (htt_status_idx = 1; htt_status_idx < CDP_MAX_TX_HTT_STATUS; htt_status_idx++) {
  3860. if (total_tx.htt_status_cnt[htt_status_idx]) {
  3861. DP_PRINT_STATS("Tx HTT Drop Count[%d]: %llu",
  3862. htt_status_idx, total_tx.htt_status_cnt[htt_status_idx]);
  3863. }
  3864. }
  3865. DP_PRINT_STATS("Tx Hardware Drop Count: %llu",
  3866. total_tx.swdrop_cnt[TX_HW_ENQUEUE]);
  3867. DP_PRINT_STATS("Tx Software Drop Count: %llu",
  3868. total_tx.swdrop_cnt[TX_SW_ENQUEUE]);
  3869. DP_PRINT_STATS("Tx Descriptor Error Count: %llu",
  3870. total_tx.swdrop_cnt[TX_DESC_ERR]);
  3871. DP_PRINT_STATS("Tx HAL Ring Error Count: %llu",
  3872. total_tx.swdrop_cnt[TX_HAL_RING_ACCESS_ERR]);
  3873. DP_PRINT_STATS("Tx Dma Map Error Count: %llu",
  3874. total_tx.swdrop_cnt[TX_DMA_MAP_ERR]);
  3875. DP_PRINT_STATS("Rx Delievered Count: %llu",
  3876. total_rx.delivered_to_stack);
  3877. DP_PRINT_STATS("Rx Software Enqueue Drop Count: %llu",
  3878. total_rx.fail_cnt[ENQUEUE_DROP]);
  3879. DP_PRINT_STATS("Rx Intrabss Drop Count: %llu",
  3880. total_rx.fail_cnt[INTRABSS_DROP]);
  3881. DP_PRINT_STATS("Rx Msdu Done Failure Count: %llu",
  3882. total_rx.fail_cnt[MSDU_DONE_FAILURE]);
  3883. DP_PRINT_STATS("Rx Invalid Peer Count: %llu",
  3884. total_rx.fail_cnt[INVALID_PEER_VDEV]);
  3885. DP_PRINT_STATS("Rx Policy Check Drop Count: %llu",
  3886. total_rx.fail_cnt[POLICY_CHECK_DROP]);
  3887. DP_PRINT_STATS("Rx Mec Drop Count: %llu",
  3888. total_rx.fail_cnt[MEC_DROP]);
  3889. DP_PRINT_STATS("Rx Nawds Mcast Drop Count: %llu",
  3890. total_rx.fail_cnt[NAWDS_MCAST_DROP]);
  3891. DP_PRINT_STATS("Rx Mesh Filter Drop Count: %llu",
  3892. total_rx.fail_cnt[MESH_FILTER_DROP]);
  3893. DP_PRINT_STATS("Rx Intra Bss Deliver Count: %llu",
  3894. total_rx.intrabss_cnt);
  3895. DP_PRINT_STATS("Rx MSDU Count: %llu", total_rx.msdu_cnt);
  3896. DP_PRINT_STATS("Rx Multicast MSDU Count: %llu",
  3897. total_rx.mcast_msdu_cnt);
  3898. DP_PRINT_STATS("Rx Broadcast MSDU Count: %llu\n",
  3899. total_rx.bcast_msdu_cnt);
  3900. }
  3901. }
  3902. void dp_pdev_print_delay_stats(struct dp_pdev *pdev)
  3903. {
  3904. struct dp_soc *soc = pdev->soc;
  3905. struct cdp_tid_tx_stats total_tx;
  3906. struct cdp_tid_rx_stats total_rx;
  3907. struct cdp_tid_stats *tid_stats;
  3908. uint8_t tid, index;
  3909. uint64_t count = 0;
  3910. if (!soc)
  3911. return;
  3912. tid = 0;
  3913. index = 0;
  3914. tid_stats = &pdev->stats.tid_stats;
  3915. DP_PRINT_STATS("Per TID Delay Non-Zero Stats:\n");
  3916. for (tid = 0; tid < CDP_MAX_DATA_TIDS; tid++) {
  3917. dp_accumulate_tid_stats(pdev, tid, &total_tx, &total_rx,
  3918. TID_DELAY_STATS);
  3919. DP_PRINT_STATS("----TID: %d----", tid);
  3920. DP_PRINT_STATS("Software Enqueue Delay:");
  3921. for (index = 0; index < CDP_DELAY_BUCKET_MAX; index++) {
  3922. count = total_tx.swq_delay.delay_bucket[index];
  3923. if (count) {
  3924. DP_PRINT_STATS("%s: Packets = %llu",
  3925. dp_vow_str_sw_enq_delay(index),
  3926. count);
  3927. }
  3928. }
  3929. DP_PRINT_STATS("Min = %u", total_tx.swq_delay.min_delay);
  3930. DP_PRINT_STATS("Max = %u", total_tx.swq_delay.max_delay);
  3931. DP_PRINT_STATS("Avg = %u\n", total_tx.swq_delay.avg_delay);
  3932. DP_PRINT_STATS("Hardware Transmission Delay:");
  3933. for (index = 0; index < CDP_DELAY_BUCKET_MAX; index++) {
  3934. count = total_tx.hwtx_delay.delay_bucket[index];
  3935. if (count) {
  3936. DP_PRINT_STATS("%s: Packets = %llu",
  3937. dp_vow_str_fw_to_hw_delay(index),
  3938. count);
  3939. }
  3940. }
  3941. DP_PRINT_STATS("Min = %u", total_tx.hwtx_delay.min_delay);
  3942. DP_PRINT_STATS("Max = %u", total_tx.hwtx_delay.max_delay);
  3943. DP_PRINT_STATS("Avg = %u\n", total_tx.hwtx_delay.avg_delay);
  3944. DP_PRINT_STATS("Tx Interframe Delay:");
  3945. for (index = 0; index < CDP_DELAY_BUCKET_MAX; index++) {
  3946. count = total_tx.intfrm_delay.delay_bucket[index];
  3947. if (count) {
  3948. DP_PRINT_STATS("%s: Packets = %llu",
  3949. dp_vow_str_intfrm_delay(index),
  3950. count);
  3951. }
  3952. }
  3953. DP_PRINT_STATS("Min = %u", total_tx.intfrm_delay.min_delay);
  3954. DP_PRINT_STATS("Max = %u", total_tx.intfrm_delay.max_delay);
  3955. DP_PRINT_STATS("Avg = %u\n", total_tx.intfrm_delay.avg_delay);
  3956. DP_PRINT_STATS("Rx Interframe Delay:");
  3957. for (index = 0; index < CDP_DELAY_BUCKET_MAX; index++) {
  3958. count = total_rx.intfrm_delay.delay_bucket[index];
  3959. if (count) {
  3960. DP_PRINT_STATS("%s: Packets = %llu",
  3961. dp_vow_str_intfrm_delay(index),
  3962. count);
  3963. }
  3964. }
  3965. DP_PRINT_STATS("Min = %u", total_rx.intfrm_delay.min_delay);
  3966. DP_PRINT_STATS("Max = %u", total_rx.intfrm_delay.max_delay);
  3967. DP_PRINT_STATS("Avg = %u\n", total_rx.intfrm_delay.avg_delay);
  3968. DP_PRINT_STATS("Rx Reap to Stack Delay:");
  3969. for (index = 0; index < CDP_DELAY_BUCKET_MAX; index++) {
  3970. count = total_rx.to_stack_delay.delay_bucket[index];
  3971. if (count) {
  3972. DP_PRINT_STATS("%s: Packets = %llu",
  3973. dp_vow_str_intfrm_delay(index),
  3974. count);
  3975. }
  3976. }
  3977. DP_PRINT_STATS("Min = %u", total_rx.to_stack_delay.min_delay);
  3978. DP_PRINT_STATS("Max = %u", total_rx.to_stack_delay.max_delay);
  3979. DP_PRINT_STATS("Avg = %u\n", total_rx.to_stack_delay.avg_delay);
  3980. }
  3981. }
  3982. #endif
  3983. void dp_print_soc_cfg_params(struct dp_soc *soc)
  3984. {
  3985. struct wlan_cfg_dp_soc_ctxt *soc_cfg_ctx;
  3986. uint8_t index = 0, i = 0;
  3987. char ring_mask[DP_MAX_INT_CONTEXTS_STRING_LENGTH];
  3988. int num_of_int_contexts;
  3989. if (!soc) {
  3990. dp_err("Context is null");
  3991. return;
  3992. }
  3993. soc_cfg_ctx = soc->wlan_cfg_ctx;
  3994. if (!soc_cfg_ctx) {
  3995. dp_err("Context is null");
  3996. return;
  3997. }
  3998. num_of_int_contexts =
  3999. wlan_cfg_get_num_contexts(soc_cfg_ctx);
  4000. DP_PRINT_STATS("No. of interrupt contexts: %u",
  4001. soc_cfg_ctx->num_int_ctxts);
  4002. DP_PRINT_STATS("Max clients: %u",
  4003. soc_cfg_ctx->max_clients);
  4004. DP_PRINT_STATS("Max alloc size: %u ",
  4005. soc_cfg_ctx->max_alloc_size);
  4006. DP_PRINT_STATS("Per pdev tx ring: %u ",
  4007. soc_cfg_ctx->per_pdev_tx_ring);
  4008. DP_PRINT_STATS("Num tcl data rings: %u ",
  4009. soc_cfg_ctx->num_tcl_data_rings);
  4010. DP_PRINT_STATS("Per pdev rx ring: %u ",
  4011. soc_cfg_ctx->per_pdev_rx_ring);
  4012. DP_PRINT_STATS("Per pdev lmac ring: %u ",
  4013. soc_cfg_ctx->per_pdev_lmac_ring);
  4014. DP_PRINT_STATS("Num of reo dest rings: %u ",
  4015. soc_cfg_ctx->num_reo_dest_rings);
  4016. DP_PRINT_STATS("Num tx desc pool: %u ",
  4017. soc_cfg_ctx->num_tx_desc_pool);
  4018. DP_PRINT_STATS("Num tx ext desc pool: %u ",
  4019. soc_cfg_ctx->num_tx_ext_desc_pool);
  4020. DP_PRINT_STATS("Num tx desc: %u ",
  4021. soc_cfg_ctx->num_tx_desc);
  4022. DP_PRINT_STATS("Num tx ext desc: %u ",
  4023. soc_cfg_ctx->num_tx_ext_desc);
  4024. DP_PRINT_STATS("Htt packet type: %u ",
  4025. soc_cfg_ctx->htt_packet_type);
  4026. DP_PRINT_STATS("Max peer_ids: %u ",
  4027. soc_cfg_ctx->max_peer_id);
  4028. DP_PRINT_STATS("Tx ring size: %u ",
  4029. soc_cfg_ctx->tx_ring_size);
  4030. DP_PRINT_STATS("Tx comp ring size: %u ",
  4031. soc_cfg_ctx->tx_comp_ring_size);
  4032. DP_PRINT_STATS("Tx comp ring size nss: %u ",
  4033. soc_cfg_ctx->tx_comp_ring_size_nss);
  4034. DP_PRINT_STATS("Int batch threshold tx: %u ",
  4035. soc_cfg_ctx->int_batch_threshold_tx);
  4036. DP_PRINT_STATS("Int timer threshold tx: %u ",
  4037. soc_cfg_ctx->int_timer_threshold_tx);
  4038. DP_PRINT_STATS("Int batch threshold rx: %u ",
  4039. soc_cfg_ctx->int_batch_threshold_rx);
  4040. DP_PRINT_STATS("Int timer threshold rx: %u ",
  4041. soc_cfg_ctx->int_timer_threshold_rx);
  4042. DP_PRINT_STATS("Int batch threshold other: %u ",
  4043. soc_cfg_ctx->int_batch_threshold_other);
  4044. DP_PRINT_STATS("Int timer threshold other: %u ",
  4045. soc_cfg_ctx->int_timer_threshold_other);
  4046. for (i = 0; i < num_of_int_contexts; i++) {
  4047. index += qdf_snprint(&ring_mask[index],
  4048. DP_MAX_INT_CONTEXTS_STRING_LENGTH - index,
  4049. " %d",
  4050. soc_cfg_ctx->int_tx_ring_mask[i]);
  4051. }
  4052. DP_PRINT_STATS("Tx ring mask (0-%d):%s",
  4053. num_of_int_contexts, ring_mask);
  4054. index = 0;
  4055. for (i = 0; i < num_of_int_contexts; i++) {
  4056. index += qdf_snprint(&ring_mask[index],
  4057. DP_MAX_INT_CONTEXTS_STRING_LENGTH - index,
  4058. " %d",
  4059. soc_cfg_ctx->int_rx_ring_mask[i]);
  4060. }
  4061. DP_PRINT_STATS("Rx ring mask (0-%d):%s",
  4062. num_of_int_contexts, ring_mask);
  4063. index = 0;
  4064. for (i = 0; i < num_of_int_contexts; i++) {
  4065. index += qdf_snprint(&ring_mask[index],
  4066. DP_MAX_INT_CONTEXTS_STRING_LENGTH - index,
  4067. " %d",
  4068. soc_cfg_ctx->int_rx_mon_ring_mask[i]);
  4069. }
  4070. DP_PRINT_STATS("Rx mon ring mask (0-%d):%s",
  4071. num_of_int_contexts, ring_mask);
  4072. index = 0;
  4073. for (i = 0; i < num_of_int_contexts; i++) {
  4074. index += qdf_snprint(&ring_mask[index],
  4075. DP_MAX_INT_CONTEXTS_STRING_LENGTH - index,
  4076. " %d",
  4077. soc_cfg_ctx->int_rx_err_ring_mask[i]);
  4078. }
  4079. DP_PRINT_STATS("Rx err ring mask (0-%d):%s",
  4080. num_of_int_contexts, ring_mask);
  4081. index = 0;
  4082. for (i = 0; i < num_of_int_contexts; i++) {
  4083. index += qdf_snprint(&ring_mask[index],
  4084. DP_MAX_INT_CONTEXTS_STRING_LENGTH - index,
  4085. " %d",
  4086. soc_cfg_ctx->int_rx_wbm_rel_ring_mask[i]);
  4087. }
  4088. DP_PRINT_STATS("Rx wbm rel ring mask (0-%d):%s",
  4089. num_of_int_contexts, ring_mask);
  4090. index = 0;
  4091. for (i = 0; i < num_of_int_contexts; i++) {
  4092. index += qdf_snprint(&ring_mask[index],
  4093. DP_MAX_INT_CONTEXTS_STRING_LENGTH - index,
  4094. " %d",
  4095. soc_cfg_ctx->int_reo_status_ring_mask[i]);
  4096. }
  4097. DP_PRINT_STATS("Reo ring mask (0-%d):%s",
  4098. num_of_int_contexts, ring_mask);
  4099. index = 0;
  4100. for (i = 0; i < num_of_int_contexts; i++) {
  4101. index += qdf_snprint(&ring_mask[index],
  4102. DP_MAX_INT_CONTEXTS_STRING_LENGTH - index,
  4103. " %d",
  4104. soc_cfg_ctx->int_rxdma2host_ring_mask[i]);
  4105. }
  4106. DP_PRINT_STATS("Rxdma2host ring mask (0-%d):%s",
  4107. num_of_int_contexts, ring_mask);
  4108. index = 0;
  4109. for (i = 0; i < num_of_int_contexts; i++) {
  4110. index += qdf_snprint(&ring_mask[index],
  4111. DP_MAX_INT_CONTEXTS_STRING_LENGTH - index,
  4112. " %d",
  4113. soc_cfg_ctx->int_host2rxdma_ring_mask[i]);
  4114. }
  4115. DP_PRINT_STATS("Host2rxdma ring mask (0-%d):%s",
  4116. num_of_int_contexts, ring_mask);
  4117. DP_PRINT_STATS("Rx hash: %u ",
  4118. soc_cfg_ctx->rx_hash);
  4119. DP_PRINT_STATS("Tso enabled: %u ",
  4120. soc_cfg_ctx->tso_enabled);
  4121. DP_PRINT_STATS("Lro enabled: %u ",
  4122. soc_cfg_ctx->lro_enabled);
  4123. DP_PRINT_STATS("Sg enabled: %u ",
  4124. soc_cfg_ctx->sg_enabled);
  4125. DP_PRINT_STATS("Gro enabled: %u ",
  4126. soc_cfg_ctx->gro_enabled);
  4127. DP_PRINT_STATS("rawmode enabled: %u ",
  4128. soc_cfg_ctx->rawmode_enabled);
  4129. DP_PRINT_STATS("peer flow ctrl enabled: %u ",
  4130. soc_cfg_ctx->peer_flow_ctrl_enabled);
  4131. DP_PRINT_STATS("napi enabled: %u ",
  4132. soc_cfg_ctx->napi_enabled);
  4133. DP_PRINT_STATS("Tcp Udp checksum offload: %u ",
  4134. soc_cfg_ctx->tcp_udp_checksumoffload);
  4135. DP_PRINT_STATS("Defrag timeout check: %u ",
  4136. soc_cfg_ctx->defrag_timeout_check);
  4137. DP_PRINT_STATS("Rx defrag min timeout: %u ",
  4138. soc_cfg_ctx->rx_defrag_min_timeout);
  4139. DP_PRINT_STATS("WBM release ring: %u ",
  4140. soc_cfg_ctx->wbm_release_ring);
  4141. DP_PRINT_STATS("TCL CMD ring: %u ",
  4142. soc_cfg_ctx->tcl_cmd_ring);
  4143. DP_PRINT_STATS("TCL Status ring: %u ",
  4144. soc_cfg_ctx->tcl_status_ring);
  4145. DP_PRINT_STATS("REO Reinject ring: %u ",
  4146. soc_cfg_ctx->reo_reinject_ring);
  4147. DP_PRINT_STATS("RX release ring: %u ",
  4148. soc_cfg_ctx->rx_release_ring);
  4149. DP_PRINT_STATS("REO Exception ring: %u ",
  4150. soc_cfg_ctx->reo_exception_ring);
  4151. DP_PRINT_STATS("REO CMD ring: %u ",
  4152. soc_cfg_ctx->reo_cmd_ring);
  4153. DP_PRINT_STATS("REO STATUS ring: %u ",
  4154. soc_cfg_ctx->reo_status_ring);
  4155. DP_PRINT_STATS("RXDMA refill ring: %u ",
  4156. soc_cfg_ctx->rxdma_refill_ring);
  4157. DP_PRINT_STATS("TX_desc limit_0: %u ",
  4158. soc_cfg_ctx->tx_desc_limit_0);
  4159. DP_PRINT_STATS("TX_desc limit_1: %u ",
  4160. soc_cfg_ctx->tx_desc_limit_1);
  4161. DP_PRINT_STATS("TX_desc limit_2: %u ",
  4162. soc_cfg_ctx->tx_desc_limit_2);
  4163. DP_PRINT_STATS("TX device limit: %u ",
  4164. soc_cfg_ctx->tx_device_limit);
  4165. DP_PRINT_STATS("TX sw internode queue: %u ",
  4166. soc_cfg_ctx->tx_sw_internode_queue);
  4167. DP_PRINT_STATS("RXDMA err dst ring: %u ",
  4168. soc_cfg_ctx->rxdma_err_dst_ring);
  4169. DP_PRINT_STATS("RX Flow Tag Enabled: %u ",
  4170. soc_cfg_ctx->is_rx_flow_tag_enabled);
  4171. DP_PRINT_STATS("RX Flow Search Table Size (# of entries): %u ",
  4172. soc_cfg_ctx->rx_flow_search_table_size);
  4173. DP_PRINT_STATS("RX Flow Search Table Per PDev : %u ",
  4174. soc_cfg_ctx->is_rx_flow_search_table_per_pdev);
  4175. }
  4176. void
  4177. dp_print_pdev_cfg_params(struct dp_pdev *pdev)
  4178. {
  4179. struct wlan_cfg_dp_pdev_ctxt *pdev_cfg_ctx;
  4180. if (!pdev) {
  4181. dp_err("Context is null");
  4182. return;
  4183. }
  4184. pdev_cfg_ctx = pdev->wlan_cfg_ctx;
  4185. if (!pdev_cfg_ctx) {
  4186. dp_err("Context is null");
  4187. return;
  4188. }
  4189. DP_PRINT_STATS("Rx dma buf ring size: %d ",
  4190. pdev_cfg_ctx->rx_dma_buf_ring_size);
  4191. DP_PRINT_STATS("DMA Mon buf ring size: %d ",
  4192. pdev_cfg_ctx->dma_mon_buf_ring_size);
  4193. DP_PRINT_STATS("DMA Mon dest ring size: %d ",
  4194. pdev_cfg_ctx->dma_mon_dest_ring_size);
  4195. DP_PRINT_STATS("DMA Mon status ring size: %d ",
  4196. pdev_cfg_ctx->dma_mon_status_ring_size);
  4197. DP_PRINT_STATS("Rxdma monitor desc ring: %d",
  4198. pdev_cfg_ctx->rxdma_monitor_desc_ring);
  4199. DP_PRINT_STATS("Num mac rings: %d ",
  4200. pdev_cfg_ctx->num_mac_rings);
  4201. }
  4202. /**
  4203. * dp_print_ring_stat_from_hal(): Print hal level ring stats
  4204. * @soc: DP_SOC handle
  4205. * @srng: DP_SRNG handle
  4206. * @ring_name: SRNG name
  4207. * @ring_type: srng src/dst ring
  4208. *
  4209. * Return: void
  4210. */
  4211. static void
  4212. dp_print_ring_stat_from_hal(struct dp_soc *soc, struct dp_srng *srng,
  4213. enum hal_ring_type ring_type)
  4214. {
  4215. uint32_t tailp;
  4216. uint32_t headp;
  4217. int32_t hw_headp = -1;
  4218. int32_t hw_tailp = -1;
  4219. const char *ring_name;
  4220. struct hal_soc *hal_soc;
  4221. if (soc && srng && srng->hal_srng) {
  4222. hal_soc = (struct hal_soc *)soc->hal_soc;
  4223. ring_name = dp_srng_get_str_from_hal_ring_type(ring_type);
  4224. hal_get_sw_hptp(soc->hal_soc, srng->hal_srng, &tailp, &headp);
  4225. DP_PRINT_STATS("%s:SW:Head pointer = %d Tail Pointer = %d\n",
  4226. ring_name, headp, tailp);
  4227. hal_get_hw_hptp(soc->hal_soc, srng->hal_srng, &hw_headp,
  4228. &hw_tailp, ring_type);
  4229. DP_PRINT_STATS("%s:HW:Head pointer = %d Tail Pointer = %d\n",
  4230. ring_name, hw_headp, hw_tailp);
  4231. }
  4232. }
  4233. #ifdef FEATURE_TSO_STATS
  4234. /**
  4235. * dp_print_tso_seg_stats - tso segment stats
  4236. * @pdev: pdev handle
  4237. * @id: tso packet id
  4238. *
  4239. * Return: None
  4240. */
  4241. static void dp_print_tso_seg_stats(struct dp_pdev *pdev, uint32_t id)
  4242. {
  4243. uint8_t num_seg;
  4244. uint32_t segid;
  4245. /* TSO LEVEL 2 - SEGMENT INFO */
  4246. num_seg = pdev->stats.tso_stats.tso_info.tso_packet_info[id].num_seg;
  4247. for (segid = 0; segid < CDP_MAX_TSO_SEGMENTS && segid < num_seg; segid++) {
  4248. DP_PRINT_STATS(
  4249. "Segment id:[%u] fragments: %u | Segment Length %u | TCP Seq no.: %u | ip_id: %u",
  4250. segid,
  4251. pdev->stats.tso_stats.tso_info.tso_packet_info[id]
  4252. .tso_seg[segid].num_frags,
  4253. pdev->stats.tso_stats.tso_info.tso_packet_info[id]
  4254. .tso_seg[segid].total_len,
  4255. pdev->stats.tso_stats.tso_info.tso_packet_info[id]
  4256. .tso_seg[segid].tso_flags.tcp_seq_num,
  4257. pdev->stats.tso_stats.tso_info.tso_packet_info[id]
  4258. .tso_seg[segid].tso_flags.ip_id);
  4259. DP_PRINT_STATS(
  4260. "fin: %u syn: %u rst: %u psh: %u ack: %u urg: %u ece: %u cwr: %u ns: %u",
  4261. pdev->stats.tso_stats.tso_info.tso_packet_info[id]
  4262. .tso_seg[segid].tso_flags.fin,
  4263. pdev->stats.tso_stats.tso_info.tso_packet_info[id]
  4264. .tso_seg[segid].tso_flags.syn,
  4265. pdev->stats.tso_stats.tso_info.tso_packet_info[id]
  4266. .tso_seg[segid].tso_flags.rst,
  4267. pdev->stats.tso_stats.tso_info.tso_packet_info[id]
  4268. .tso_seg[segid].tso_flags.psh,
  4269. pdev->stats.tso_stats.tso_info.tso_packet_info[id]
  4270. .tso_seg[segid].tso_flags.ack,
  4271. pdev->stats.tso_stats.tso_info.tso_packet_info[id]
  4272. .tso_seg[segid].tso_flags.urg,
  4273. pdev->stats.tso_stats.tso_info.tso_packet_info[id]
  4274. .tso_seg[segid].tso_flags.ece,
  4275. pdev->stats.tso_stats.tso_info.tso_packet_info[id]
  4276. .tso_seg[segid].tso_flags.cwr,
  4277. pdev->stats.tso_stats.tso_info.tso_packet_info[id]
  4278. .tso_seg[segid].tso_flags.ns);
  4279. }
  4280. }
  4281. #else
  4282. static inline
  4283. void dp_print_tso_seg_stats(struct dp_pdev *pdev, uint32_t id)
  4284. {
  4285. }
  4286. #endif /* FEATURE_TSO_STATS */
  4287. /**
  4288. * dp_print_mon_ring_stats_from_hal() - Print stat for monitor rings based
  4289. * on target
  4290. * @pdev: physical device handle
  4291. * @mac_id: mac id
  4292. *
  4293. * Return: void
  4294. */
  4295. static inline
  4296. void dp_print_mon_ring_stat_from_hal(struct dp_pdev *pdev, uint8_t mac_id)
  4297. {
  4298. if (pdev->soc->wlan_cfg_ctx->rxdma1_enable) {
  4299. dp_print_ring_stat_from_hal(pdev->soc,
  4300. &pdev->rxdma_mon_buf_ring[mac_id],
  4301. RXDMA_MONITOR_BUF);
  4302. dp_print_ring_stat_from_hal(pdev->soc,
  4303. &pdev->rxdma_mon_dst_ring[mac_id],
  4304. RXDMA_MONITOR_DST);
  4305. dp_print_ring_stat_from_hal(pdev->soc,
  4306. &pdev->rxdma_mon_desc_ring[mac_id],
  4307. RXDMA_MONITOR_DESC);
  4308. }
  4309. dp_print_ring_stat_from_hal(pdev->soc,
  4310. &pdev->rxdma_mon_status_ring[mac_id],
  4311. RXDMA_MONITOR_STATUS);
  4312. }
  4313. void
  4314. dp_print_ring_stats(struct dp_pdev *pdev)
  4315. {
  4316. uint32_t i;
  4317. int mac_id;
  4318. if (hif_pm_runtime_get_sync(pdev->soc->hif_handle))
  4319. return;
  4320. dp_print_ring_stat_from_hal(pdev->soc,
  4321. &pdev->soc->reo_exception_ring,
  4322. REO_EXCEPTION);
  4323. dp_print_ring_stat_from_hal(pdev->soc,
  4324. &pdev->soc->reo_reinject_ring,
  4325. REO_REINJECT);
  4326. dp_print_ring_stat_from_hal(pdev->soc,
  4327. &pdev->soc->reo_cmd_ring,
  4328. REO_CMD);
  4329. dp_print_ring_stat_from_hal(pdev->soc,
  4330. &pdev->soc->reo_status_ring,
  4331. REO_STATUS);
  4332. dp_print_ring_stat_from_hal(pdev->soc,
  4333. &pdev->soc->rx_rel_ring,
  4334. WBM2SW_RELEASE);
  4335. dp_print_ring_stat_from_hal(pdev->soc,
  4336. &pdev->soc->tcl_cmd_ring,
  4337. TCL_CMD);
  4338. dp_print_ring_stat_from_hal(pdev->soc,
  4339. &pdev->soc->tcl_status_ring,
  4340. TCL_STATUS);
  4341. dp_print_ring_stat_from_hal(pdev->soc,
  4342. &pdev->soc->wbm_desc_rel_ring,
  4343. SW2WBM_RELEASE);
  4344. for (i = 0; i < MAX_REO_DEST_RINGS; i++)
  4345. dp_print_ring_stat_from_hal(pdev->soc,
  4346. &pdev->soc->reo_dest_ring[i],
  4347. REO_DST);
  4348. for (i = 0; i < pdev->soc->num_tcl_data_rings; i++)
  4349. dp_print_ring_stat_from_hal(pdev->soc,
  4350. &pdev->soc->tcl_data_ring[i],
  4351. TCL_DATA);
  4352. for (i = 0; i < MAX_TCL_DATA_RINGS; i++)
  4353. dp_print_ring_stat_from_hal(pdev->soc,
  4354. &pdev->soc->tx_comp_ring[i],
  4355. WBM2SW_RELEASE);
  4356. dp_print_ring_stat_from_hal(pdev->soc,
  4357. &pdev->rx_refill_buf_ring,
  4358. RXDMA_BUF);
  4359. dp_print_ring_stat_from_hal(pdev->soc,
  4360. &pdev->rx_refill_buf_ring2,
  4361. RXDMA_BUF);
  4362. for (i = 0; i < MAX_RX_MAC_RINGS; i++)
  4363. dp_print_ring_stat_from_hal(pdev->soc,
  4364. &pdev->rx_mac_buf_ring[i],
  4365. RXDMA_BUF);
  4366. for (mac_id = 0; mac_id < NUM_RXDMA_RINGS_PER_PDEV; mac_id++)
  4367. dp_print_mon_ring_stat_from_hal(pdev, mac_id);
  4368. for (i = 0; i < NUM_RXDMA_RINGS_PER_PDEV; i++)
  4369. dp_print_ring_stat_from_hal(pdev->soc,
  4370. &pdev->rxdma_err_dst_ring[i],
  4371. RXDMA_DST);
  4372. hif_pm_runtime_put(pdev->soc->hif_handle);
  4373. }
  4374. /**
  4375. * dp_print_common_rates_info(): Print common rate for tx or rx
  4376. * @pkt_type_array: rate type array contains rate info
  4377. *
  4378. * Return:void
  4379. */
  4380. static inline void
  4381. dp_print_common_rates_info(struct cdp_pkt_type *pkt_type_array)
  4382. {
  4383. uint8_t mcs, pkt_type;
  4384. DP_PRINT_STATS("MSDU Count");
  4385. for (pkt_type = 0; pkt_type < DOT11_MAX; pkt_type++) {
  4386. for (mcs = 0; mcs < MAX_MCS; mcs++) {
  4387. if (!dp_rate_string[pkt_type][mcs].valid)
  4388. continue;
  4389. DP_PRINT_STATS(" %s = %d",
  4390. dp_rate_string[pkt_type][mcs].mcs_type,
  4391. pkt_type_array[pkt_type].mcs_count[mcs]);
  4392. }
  4393. DP_PRINT_STATS("\n");
  4394. }
  4395. }
  4396. /**
  4397. * dp_print_common_ppdu_rates_info(): Print common rate for tx or rx
  4398. * @pkt_type_array: rate type array contains rate info
  4399. *
  4400. * Return:void
  4401. */
  4402. static inline void
  4403. dp_print_common_ppdu_rates_info(struct cdp_pkt_type *pkt_type_array)
  4404. {
  4405. uint8_t mcs;
  4406. DP_PRINT_STATS("PPDU Count");
  4407. for (mcs = 0; mcs < MAX_MCS; mcs++) {
  4408. if (!dp_ppdu_rate_string[0][mcs].valid)
  4409. continue;
  4410. DP_PRINT_STATS(" %s = %d",
  4411. dp_ppdu_rate_string[0][mcs].mcs_type,
  4412. pkt_type_array->mcs_count[mcs]);
  4413. }
  4414. DP_PRINT_STATS("\n");
  4415. }
  4416. /**
  4417. * dp_print_mu_ppdu_rates_info(): Print mu rate for tx or rx
  4418. * @rx_mu: rx MU stats array
  4419. *
  4420. * Return:void
  4421. */
  4422. static inline void
  4423. dp_print_mu_ppdu_rates_info(struct cdp_rx_mu *rx_mu)
  4424. {
  4425. uint8_t mcs, pkt_type;
  4426. DP_PRINT_STATS("PPDU Count");
  4427. for (pkt_type = 0; pkt_type < RX_TYPE_MU_MAX; pkt_type++) {
  4428. for (mcs = 0; mcs < MAX_MCS; mcs++) {
  4429. if (!dp_mu_rate_string[pkt_type][mcs].valid)
  4430. continue;
  4431. DP_PRINT_STATS(" %s = %d",
  4432. dp_mu_rate_string[pkt_type][mcs].mcs_type,
  4433. rx_mu[pkt_type].ppdu.mcs_count[mcs]);
  4434. }
  4435. DP_PRINT_STATS("\n");
  4436. }
  4437. }
  4438. void dp_print_rx_rates(struct dp_vdev *vdev)
  4439. {
  4440. struct dp_pdev *pdev = (struct dp_pdev *)vdev->pdev;
  4441. uint8_t i;
  4442. uint8_t index = 0;
  4443. char nss[DP_NSS_LENGTH];
  4444. DP_PRINT_STATS("Rx Rate Info:\n");
  4445. dp_print_common_rates_info(pdev->stats.rx.pkt_type);
  4446. index = 0;
  4447. for (i = 0; i < SS_COUNT; i++) {
  4448. index += qdf_snprint(&nss[index], DP_NSS_LENGTH - index,
  4449. " %d", pdev->stats.rx.nss[i]);
  4450. }
  4451. DP_PRINT_STATS("NSS(1-8) = %s",
  4452. nss);
  4453. DP_PRINT_STATS("SGI = 0.8us %d 0.4us %d 1.6us %d 3.2us %d",
  4454. pdev->stats.rx.sgi_count[0],
  4455. pdev->stats.rx.sgi_count[1],
  4456. pdev->stats.rx.sgi_count[2],
  4457. pdev->stats.rx.sgi_count[3]);
  4458. DP_PRINT_STATS("BW Counts = 20MHZ %d, 40MHZ %d, 80MHZ %d, 160MHZ %d",
  4459. pdev->stats.rx.bw[0], pdev->stats.rx.bw[1],
  4460. pdev->stats.rx.bw[2], pdev->stats.rx.bw[3]);
  4461. DP_PRINT_STATS("Reception Type ="
  4462. "SU: %d MU_MIMO:%d MU_OFDMA:%d MU_OFDMA_MIMO:%d",
  4463. pdev->stats.rx.reception_type[0],
  4464. pdev->stats.rx.reception_type[1],
  4465. pdev->stats.rx.reception_type[2],
  4466. pdev->stats.rx.reception_type[3]);
  4467. DP_PRINT_STATS("Aggregation:\n");
  4468. DP_PRINT_STATS("Number of Msdu's Part of Ampdus = %d",
  4469. pdev->stats.rx.ampdu_cnt);
  4470. DP_PRINT_STATS("Number of Msdu's With No Mpdu Level Aggregation : %d",
  4471. pdev->stats.rx.non_ampdu_cnt);
  4472. DP_PRINT_STATS("Number of Msdu's Part of Amsdu: %d",
  4473. pdev->stats.rx.amsdu_cnt);
  4474. DP_PRINT_STATS("Number of Msdu's With No Msdu Level Aggregation: %d",
  4475. pdev->stats.rx.non_amsdu_cnt);
  4476. }
  4477. void dp_print_tx_rates(struct dp_vdev *vdev)
  4478. {
  4479. struct dp_pdev *pdev = (struct dp_pdev *)vdev->pdev;
  4480. DP_PRINT_STATS("Tx Rate Info:\n");
  4481. dp_print_common_rates_info(pdev->stats.tx.pkt_type);
  4482. DP_PRINT_STATS("SGI = 0.8us %d 0.4us %d 1.6us %d 3.2us %d",
  4483. pdev->stats.tx.sgi_count[0],
  4484. pdev->stats.tx.sgi_count[1],
  4485. pdev->stats.tx.sgi_count[2],
  4486. pdev->stats.tx.sgi_count[3]);
  4487. DP_PRINT_STATS("BW Counts = 20MHZ %d, 40MHZ %d, 80MHZ %d, 160MHZ %d",
  4488. pdev->stats.tx.bw[0], pdev->stats.tx.bw[1],
  4489. pdev->stats.tx.bw[2], pdev->stats.tx.bw[3]);
  4490. DP_PRINT_STATS("OFDMA = %d", pdev->stats.tx.ofdma);
  4491. DP_PRINT_STATS("STBC = %d", pdev->stats.tx.stbc);
  4492. DP_PRINT_STATS("LDPC = %d", pdev->stats.tx.ldpc);
  4493. DP_PRINT_STATS("Retries = %d", pdev->stats.tx.retries);
  4494. DP_PRINT_STATS("Last ack rssi = %d\n", pdev->stats.tx.last_ack_rssi);
  4495. DP_PRINT_STATS("Aggregation:\n");
  4496. DP_PRINT_STATS("Number of Msdu's Part of Ampdus = %d",
  4497. pdev->stats.tx.ampdu_cnt);
  4498. DP_PRINT_STATS("Number of Msdu's With No Mpdu Level Aggregation : %d",
  4499. pdev->stats.tx.non_ampdu_cnt);
  4500. DP_PRINT_STATS("Number of Msdu's Part of Amsdu = %d",
  4501. pdev->stats.tx.amsdu_cnt);
  4502. DP_PRINT_STATS("Number of Msdu's With No Msdu Level Aggregation = %d",
  4503. pdev->stats.tx.non_amsdu_cnt);
  4504. }
  4505. /**
  4506. * dp_print_nss(): Print nss count
  4507. * @nss: printable nss count array
  4508. * @pnss: nss count array
  4509. * @ss_count: number of nss
  4510. *
  4511. * Return:void
  4512. */
  4513. static void dp_print_nss(char *nss, uint32_t *pnss, uint32_t ss_count)
  4514. {
  4515. uint32_t index;
  4516. uint8_t i;
  4517. index = 0;
  4518. for (i = 0; i < ss_count; i++) {
  4519. index += qdf_snprint(&nss[index], DP_NSS_LENGTH - index,
  4520. " %d", *(pnss + i));
  4521. }
  4522. }
  4523. void dp_print_peer_stats(struct dp_peer *peer)
  4524. {
  4525. uint8_t i;
  4526. uint32_t index;
  4527. uint32_t j;
  4528. char nss[DP_NSS_LENGTH];
  4529. char mu_group_id[DP_MU_GROUP_LENGTH];
  4530. struct dp_pdev *pdev;
  4531. uint32_t *pnss;
  4532. enum cdp_mu_packet_type rx_mu_type;
  4533. struct cdp_rx_mu *rx_mu;
  4534. pdev = peer->vdev->pdev;
  4535. DP_PRINT_STATS("Node Tx Stats:\n");
  4536. DP_PRINT_STATS("Total Packet Completions = %d",
  4537. peer->stats.tx.comp_pkt.num);
  4538. DP_PRINT_STATS("Total Bytes Completions = %llu",
  4539. peer->stats.tx.comp_pkt.bytes);
  4540. DP_PRINT_STATS("Success Packets = %d",
  4541. peer->stats.tx.tx_success.num);
  4542. DP_PRINT_STATS("Success Bytes = %llu",
  4543. peer->stats.tx.tx_success.bytes);
  4544. DP_PRINT_STATS("Unicast Success Packets = %d",
  4545. peer->stats.tx.ucast.num);
  4546. DP_PRINT_STATS("Unicast Success Bytes = %llu",
  4547. peer->stats.tx.ucast.bytes);
  4548. DP_PRINT_STATS("Multicast Success Packets = %d",
  4549. peer->stats.tx.mcast.num);
  4550. DP_PRINT_STATS("Multicast Success Bytes = %llu",
  4551. peer->stats.tx.mcast.bytes);
  4552. DP_PRINT_STATS("Broadcast Success Packets = %d",
  4553. peer->stats.tx.bcast.num);
  4554. DP_PRINT_STATS("Broadcast Success Bytes = %llu",
  4555. peer->stats.tx.bcast.bytes);
  4556. DP_PRINT_STATS("Packets Failed = %d",
  4557. peer->stats.tx.tx_failed);
  4558. DP_PRINT_STATS("Packets In OFDMA = %d",
  4559. peer->stats.tx.ofdma);
  4560. DP_PRINT_STATS("Packets In STBC = %d",
  4561. peer->stats.tx.stbc);
  4562. DP_PRINT_STATS("Packets In LDPC = %d",
  4563. peer->stats.tx.ldpc);
  4564. DP_PRINT_STATS("Packet Retries = %d",
  4565. peer->stats.tx.retries);
  4566. DP_PRINT_STATS("MSDU's Part of AMSDU = %d",
  4567. peer->stats.tx.amsdu_cnt);
  4568. DP_PRINT_STATS("Msdu's As Part of Ampdu = %d",
  4569. peer->stats.tx.non_ampdu_cnt);
  4570. DP_PRINT_STATS("Msdu's As Ampdu = %d",
  4571. peer->stats.tx.ampdu_cnt);
  4572. DP_PRINT_STATS("Last Packet RSSI = %d",
  4573. peer->stats.tx.last_ack_rssi);
  4574. DP_PRINT_STATS("Dropped At FW: Removed Pkts = %u",
  4575. peer->stats.tx.dropped.fw_rem.num);
  4576. if (pdev && !wlan_cfg_get_dp_pdev_nss_enabled(pdev->wlan_cfg_ctx)) {
  4577. DP_PRINT_STATS("Dropped At FW: Removed bytes = %llu",
  4578. peer->stats.tx.dropped.fw_rem.bytes);
  4579. }
  4580. DP_PRINT_STATS("Dropped At FW: Removed transmitted = %d",
  4581. peer->stats.tx.dropped.fw_rem_tx);
  4582. DP_PRINT_STATS("Dropped At FW: Removed Untransmitted = %d",
  4583. peer->stats.tx.dropped.fw_rem_notx);
  4584. DP_PRINT_STATS("Dropped : Age Out = %d",
  4585. peer->stats.tx.dropped.age_out);
  4586. DP_PRINT_STATS("NAWDS : ");
  4587. DP_PRINT_STATS("Nawds multicast Drop Tx Packet = %d",
  4588. peer->stats.tx.nawds_mcast_drop);
  4589. DP_PRINT_STATS(" Nawds multicast Tx Packet Count = %d",
  4590. peer->stats.tx.nawds_mcast.num);
  4591. DP_PRINT_STATS(" Nawds multicast Tx Packet Bytes = %llu",
  4592. peer->stats.tx.nawds_mcast.bytes);
  4593. DP_PRINT_STATS("Rate Info:");
  4594. dp_print_common_rates_info(peer->stats.tx.pkt_type);
  4595. DP_PRINT_STATS("SGI = 0.8us %d 0.4us %d 1.6us %d 3.2us %d",
  4596. peer->stats.tx.sgi_count[0],
  4597. peer->stats.tx.sgi_count[1],
  4598. peer->stats.tx.sgi_count[2],
  4599. peer->stats.tx.sgi_count[3]);
  4600. DP_PRINT_STATS("Excess Retries per AC ");
  4601. DP_PRINT_STATS(" Best effort = %d",
  4602. peer->stats.tx.excess_retries_per_ac[0]);
  4603. DP_PRINT_STATS(" Background= %d",
  4604. peer->stats.tx.excess_retries_per_ac[1]);
  4605. DP_PRINT_STATS(" Video = %d",
  4606. peer->stats.tx.excess_retries_per_ac[2]);
  4607. DP_PRINT_STATS(" Voice = %d",
  4608. peer->stats.tx.excess_retries_per_ac[3]);
  4609. DP_PRINT_STATS("BW Counts = 20MHZ %d 40MHZ %d 80MHZ %d 160MHZ %d\n",
  4610. peer->stats.tx.bw[0], peer->stats.tx.bw[1],
  4611. peer->stats.tx.bw[2], peer->stats.tx.bw[3]);
  4612. pnss = &peer->stats.tx.nss[0];
  4613. dp_print_nss(nss, pnss, SS_COUNT);
  4614. DP_PRINT_STATS("NSS(1-8) = %s", nss);
  4615. DP_PRINT_STATS("Transmit Type :");
  4616. DP_PRINT_STATS("SU %d, MU_MIMO %d, MU_OFDMA %d, MU_MIMO_OFDMA %d",
  4617. peer->stats.tx.transmit_type[SU].num_msdu,
  4618. peer->stats.tx.transmit_type[MU_MIMO].num_msdu,
  4619. peer->stats.tx.transmit_type[MU_OFDMA].num_msdu,
  4620. peer->stats.tx.transmit_type[MU_MIMO_OFDMA].num_msdu);
  4621. for (i = 0; i < MAX_MU_GROUP_ID;) {
  4622. index = 0;
  4623. for (j = 0; j < DP_MU_GROUP_SHOW && i < MAX_MU_GROUP_ID;
  4624. j++) {
  4625. index += qdf_snprint(&mu_group_id[index],
  4626. DP_MU_GROUP_LENGTH - index,
  4627. " %d",
  4628. peer->stats.tx.mu_group_id[i]);
  4629. i++;
  4630. }
  4631. DP_PRINT_STATS("User position list for GID %02d->%d: [%s]",
  4632. i - DP_MU_GROUP_SHOW, i - 1, mu_group_id);
  4633. }
  4634. DP_PRINT_STATS("Last Packet RU index [%d], Size [%d]",
  4635. peer->stats.tx.ru_start, peer->stats.tx.ru_tones);
  4636. DP_PRINT_STATS("RU Locations RU[26 52 106 242 484 996]:");
  4637. DP_PRINT_STATS("RU_26: %d",
  4638. peer->stats.tx.ru_loc[RU_26_INDEX].num_msdu);
  4639. DP_PRINT_STATS("RU 52: %d",
  4640. peer->stats.tx.ru_loc[RU_52_INDEX].num_msdu);
  4641. DP_PRINT_STATS("RU 106: %d",
  4642. peer->stats.tx.ru_loc[RU_106_INDEX].num_msdu);
  4643. DP_PRINT_STATS("RU 242: %d",
  4644. peer->stats.tx.ru_loc[RU_242_INDEX].num_msdu);
  4645. DP_PRINT_STATS("RU 484: %d",
  4646. peer->stats.tx.ru_loc[RU_484_INDEX].num_msdu);
  4647. DP_PRINT_STATS("RU 996: %d",
  4648. peer->stats.tx.ru_loc[RU_996_INDEX].num_msdu);
  4649. DP_PRINT_STATS("Aggregation:");
  4650. DP_PRINT_STATS("Number of Msdu's Part of Amsdu = %d",
  4651. peer->stats.tx.amsdu_cnt);
  4652. DP_PRINT_STATS("Number of Msdu's With No Msdu Level Aggregation = %d",
  4653. peer->stats.tx.non_amsdu_cnt);
  4654. DP_PRINT_STATS("Bytes and Packets transmitted in last one sec:");
  4655. DP_PRINT_STATS(" Bytes transmitted in last sec: %d",
  4656. peer->stats.tx.tx_byte_rate);
  4657. DP_PRINT_STATS(" Data transmitted in last sec: %d",
  4658. peer->stats.tx.tx_data_rate);
  4659. DP_PRINT_STATS("Node Rx Stats:");
  4660. DP_PRINT_STATS("Packets Sent To Stack = %d",
  4661. peer->stats.rx.to_stack.num);
  4662. DP_PRINT_STATS("Bytes Sent To Stack = %llu",
  4663. peer->stats.rx.to_stack.bytes);
  4664. for (i = 0; i < CDP_MAX_RX_RINGS; i++) {
  4665. DP_PRINT_STATS("Ring Id = %d", i);
  4666. DP_PRINT_STATS(" Packets Received = %d",
  4667. peer->stats.rx.rcvd_reo[i].num);
  4668. DP_PRINT_STATS(" Bytes Received = %llu",
  4669. peer->stats.rx.rcvd_reo[i].bytes);
  4670. }
  4671. DP_PRINT_STATS("Multicast Packets Received = %d",
  4672. peer->stats.rx.multicast.num);
  4673. DP_PRINT_STATS("Multicast Bytes Received = %llu",
  4674. peer->stats.rx.multicast.bytes);
  4675. DP_PRINT_STATS("Broadcast Packets Received = %d",
  4676. peer->stats.rx.bcast.num);
  4677. DP_PRINT_STATS("Broadcast Bytes Received = %llu",
  4678. peer->stats.rx.bcast.bytes);
  4679. DP_PRINT_STATS("Intra BSS Packets Received = %d",
  4680. peer->stats.rx.intra_bss.pkts.num);
  4681. DP_PRINT_STATS("Intra BSS Bytes Received = %llu",
  4682. peer->stats.rx.intra_bss.pkts.bytes);
  4683. DP_PRINT_STATS("Raw Packets Received = %d",
  4684. peer->stats.rx.raw.num);
  4685. DP_PRINT_STATS("Raw Bytes Received = %llu",
  4686. peer->stats.rx.raw.bytes);
  4687. DP_PRINT_STATS("Errors: MIC Errors = %d",
  4688. peer->stats.rx.err.mic_err);
  4689. DP_PRINT_STATS("Erros: Decryption Errors = %d",
  4690. peer->stats.rx.err.decrypt_err);
  4691. DP_PRINT_STATS("Msdu's Received As Part of Ampdu = %d",
  4692. peer->stats.rx.non_ampdu_cnt);
  4693. DP_PRINT_STATS("Msdu's Recived As Ampdu = %d",
  4694. peer->stats.rx.ampdu_cnt);
  4695. DP_PRINT_STATS("Msdu's Received Not Part of Amsdu's = %d",
  4696. peer->stats.rx.non_amsdu_cnt);
  4697. DP_PRINT_STATS("MSDUs Received As Part of Amsdu = %d",
  4698. peer->stats.rx.amsdu_cnt);
  4699. DP_PRINT_STATS("NAWDS : ");
  4700. DP_PRINT_STATS(" Nawds multicast Drop Rx Packet = %d",
  4701. peer->stats.rx.nawds_mcast_drop);
  4702. DP_PRINT_STATS("SGI = 0.8us %d 0.4us %d 1.6us %d 3.2us %d",
  4703. peer->stats.rx.sgi_count[0],
  4704. peer->stats.rx.sgi_count[1],
  4705. peer->stats.rx.sgi_count[2],
  4706. peer->stats.rx.sgi_count[3]);
  4707. DP_PRINT_STATS("BW Counts = 20MHZ %d 40MHZ %d 80MHZ %d 160MHZ %d",
  4708. peer->stats.rx.bw[0], peer->stats.rx.bw[1],
  4709. peer->stats.rx.bw[2], peer->stats.rx.bw[3]);
  4710. DP_PRINT_STATS("MSDU Reception Type");
  4711. DP_PRINT_STATS("SU %d MU_MIMO %d MU_OFDMA %d MU_OFDMA_MIMO %d",
  4712. peer->stats.rx.reception_type[0],
  4713. peer->stats.rx.reception_type[1],
  4714. peer->stats.rx.reception_type[2],
  4715. peer->stats.rx.reception_type[3]);
  4716. DP_PRINT_STATS("PPDU Reception Type");
  4717. DP_PRINT_STATS("SU %d MU_MIMO %d MU_OFDMA %d MU_OFDMA_MIMO %d",
  4718. peer->stats.rx.ppdu_cnt[0],
  4719. peer->stats.rx.ppdu_cnt[1],
  4720. peer->stats.rx.ppdu_cnt[2],
  4721. peer->stats.rx.ppdu_cnt[3]);
  4722. dp_print_common_rates_info(peer->stats.rx.pkt_type);
  4723. dp_print_common_ppdu_rates_info(&peer->stats.rx.su_ax_ppdu_cnt);
  4724. dp_print_mu_ppdu_rates_info(&peer->stats.rx.rx_mu[0]);
  4725. pnss = &peer->stats.rx.nss[0];
  4726. dp_print_nss(nss, pnss, SS_COUNT);
  4727. DP_PRINT_STATS("MSDU Count");
  4728. DP_PRINT_STATS(" NSS(1-8) = %s", nss);
  4729. DP_PRINT_STATS("reception mode SU");
  4730. pnss = &peer->stats.rx.ppdu_nss[0];
  4731. dp_print_nss(nss, pnss, SS_COUNT);
  4732. DP_PRINT_STATS(" PPDU Count");
  4733. DP_PRINT_STATS(" NSS(1-8) = %s", nss);
  4734. DP_PRINT_STATS(" MPDU OK = %d, MPDU Fail = %d",
  4735. peer->stats.rx.mpdu_cnt_fcs_ok,
  4736. peer->stats.rx.mpdu_cnt_fcs_err);
  4737. for (rx_mu_type = 0; rx_mu_type < RX_TYPE_MU_MAX; rx_mu_type++) {
  4738. DP_PRINT_STATS("reception mode %s",
  4739. mu_reception_mode[rx_mu_type]);
  4740. rx_mu = &peer->stats.rx.rx_mu[rx_mu_type];
  4741. pnss = &rx_mu->ppdu_nss[0];
  4742. dp_print_nss(nss, pnss, SS_COUNT);
  4743. DP_PRINT_STATS(" PPDU Count");
  4744. DP_PRINT_STATS(" NSS(1-8) = %s", nss);
  4745. DP_PRINT_STATS(" MPDU OK = %d, MPDU Fail = %d",
  4746. rx_mu->mpdu_cnt_fcs_ok,
  4747. rx_mu->mpdu_cnt_fcs_err);
  4748. }
  4749. DP_PRINT_STATS("Aggregation:");
  4750. DP_PRINT_STATS(" Msdu's Part of Ampdu = %d",
  4751. peer->stats.rx.ampdu_cnt);
  4752. DP_PRINT_STATS(" Msdu's With No Mpdu Level Aggregation = %d",
  4753. peer->stats.rx.non_ampdu_cnt);
  4754. DP_PRINT_STATS(" Msdu's Part of Amsdu = %d",
  4755. peer->stats.rx.amsdu_cnt);
  4756. DP_PRINT_STATS(" Msdu's With No Msdu Level Aggregation = %d",
  4757. peer->stats.rx.non_amsdu_cnt);
  4758. DP_PRINT_STATS("Bytes and Packets received in last one sec:");
  4759. DP_PRINT_STATS(" Bytes received in last sec: %d",
  4760. peer->stats.rx.rx_byte_rate);
  4761. DP_PRINT_STATS(" Data received in last sec: %d",
  4762. peer->stats.rx.rx_data_rate);
  4763. }
  4764. void dp_print_per_ring_stats(struct dp_soc *soc)
  4765. {
  4766. uint8_t ring;
  4767. uint16_t core;
  4768. uint64_t total_packets;
  4769. DP_PRINT_STATS("Reo packets per ring:");
  4770. for (ring = 0; ring < MAX_REO_DEST_RINGS; ring++) {
  4771. total_packets = 0;
  4772. DP_PRINT_STATS("Packets on ring %u:", ring);
  4773. for (core = 0; core < num_possible_cpus(); core++) {
  4774. if (!soc->stats.rx.ring_packets[core][ring])
  4775. continue;
  4776. DP_PRINT_STATS("Packets arriving on core %u: %llu",
  4777. core,
  4778. soc->stats.rx.ring_packets[core][ring]);
  4779. total_packets += soc->stats.rx.ring_packets[core][ring];
  4780. }
  4781. DP_PRINT_STATS("Total packets on ring %u: %llu",
  4782. ring, total_packets);
  4783. }
  4784. }
  4785. void dp_txrx_path_stats(struct dp_soc *soc)
  4786. {
  4787. uint8_t error_code;
  4788. uint8_t loop_pdev;
  4789. struct dp_pdev *pdev;
  4790. uint8_t i;
  4791. if (!soc) {
  4792. dp_err("%s: Invalid access", __func__);
  4793. return;
  4794. }
  4795. for (loop_pdev = 0; loop_pdev < soc->pdev_count; loop_pdev++) {
  4796. pdev = soc->pdev_list[loop_pdev];
  4797. dp_aggregate_pdev_stats(pdev);
  4798. DP_PRINT_STATS("Tx path Statistics:");
  4799. DP_PRINT_STATS("from stack: %u msdus (%llu bytes)",
  4800. pdev->stats.tx_i.rcvd.num,
  4801. pdev->stats.tx_i.rcvd.bytes);
  4802. DP_PRINT_STATS("processed from host: %u msdus (%llu bytes)",
  4803. pdev->stats.tx_i.processed.num,
  4804. pdev->stats.tx_i.processed.bytes);
  4805. DP_PRINT_STATS("successfully transmitted: %u msdus (%llu bytes)",
  4806. pdev->stats.tx.tx_success.num,
  4807. pdev->stats.tx.tx_success.bytes);
  4808. DP_PRINT_STATS("Dropped in host:");
  4809. DP_PRINT_STATS("Total packets dropped: %u,",
  4810. pdev->stats.tx_i.dropped.dropped_pkt.num);
  4811. DP_PRINT_STATS("Descriptor not available: %u",
  4812. pdev->stats.tx_i.dropped.desc_na.num);
  4813. DP_PRINT_STATS("Ring full: %u",
  4814. pdev->stats.tx_i.dropped.ring_full);
  4815. DP_PRINT_STATS("Enqueue fail: %u",
  4816. pdev->stats.tx_i.dropped.enqueue_fail);
  4817. DP_PRINT_STATS("DMA Error: %u",
  4818. pdev->stats.tx_i.dropped.dma_error);
  4819. DP_PRINT_STATS("Dropped in hardware:");
  4820. DP_PRINT_STATS("total packets dropped: %u",
  4821. pdev->stats.tx.tx_failed);
  4822. DP_PRINT_STATS("mpdu age out: %u",
  4823. pdev->stats.tx.dropped.age_out);
  4824. DP_PRINT_STATS("firmware removed packets: %u (%llu bytes)",
  4825. pdev->stats.tx.dropped.fw_rem.num,
  4826. pdev->stats.tx.dropped.fw_rem.bytes);
  4827. DP_PRINT_STATS("firmware removed tx: %u",
  4828. pdev->stats.tx.dropped.fw_rem_tx);
  4829. DP_PRINT_STATS("firmware removed notx %u",
  4830. pdev->stats.tx.dropped.fw_rem_notx);
  4831. DP_PRINT_STATS("Invalid peer on tx path: %u",
  4832. pdev->soc->stats.tx.tx_invalid_peer.num);
  4833. DP_PRINT_STATS("Tx packets sent per interrupt:");
  4834. DP_PRINT_STATS("Single Packet: %u",
  4835. pdev->stats.tx_comp_histogram.pkts_1);
  4836. DP_PRINT_STATS("2-20 Packets: %u",
  4837. pdev->stats.tx_comp_histogram.pkts_2_20);
  4838. DP_PRINT_STATS("21-40 Packets: %u",
  4839. pdev->stats.tx_comp_histogram.pkts_21_40);
  4840. DP_PRINT_STATS("41-60 Packets: %u",
  4841. pdev->stats.tx_comp_histogram.pkts_41_60);
  4842. DP_PRINT_STATS("61-80 Packets: %u",
  4843. pdev->stats.tx_comp_histogram.pkts_61_80);
  4844. DP_PRINT_STATS("81-100 Packets: %u",
  4845. pdev->stats.tx_comp_histogram.pkts_81_100);
  4846. DP_PRINT_STATS("101-200 Packets: %u",
  4847. pdev->stats.tx_comp_histogram.pkts_101_200);
  4848. DP_PRINT_STATS(" 201+ Packets: %u",
  4849. pdev->stats.tx_comp_histogram.pkts_201_plus);
  4850. DP_PRINT_STATS("Rx path statistics");
  4851. DP_PRINT_STATS("delivered %u msdus ( %llu bytes),",
  4852. pdev->stats.rx.to_stack.num,
  4853. pdev->stats.rx.to_stack.bytes);
  4854. for (i = 0; i < CDP_MAX_RX_RINGS; i++) {
  4855. if (!pdev->stats.rx.rcvd_reo[i].num)
  4856. continue;
  4857. DP_PRINT_STATS(
  4858. "received on reo[%d] %u msdus( %llu bytes),",
  4859. i, pdev->stats.rx.rcvd_reo[i].num,
  4860. pdev->stats.rx.rcvd_reo[i].bytes);
  4861. }
  4862. DP_PRINT_STATS("intra-bss packets %u msdus ( %llu bytes),",
  4863. pdev->stats.rx.intra_bss.pkts.num,
  4864. pdev->stats.rx.intra_bss.pkts.bytes);
  4865. DP_PRINT_STATS("intra-bss fails %u msdus ( %llu bytes),",
  4866. pdev->stats.rx.intra_bss.fail.num,
  4867. pdev->stats.rx.intra_bss.fail.bytes);
  4868. DP_PRINT_STATS("intra-bss no mdns fwds %u msdus",
  4869. pdev->stats.rx.intra_bss.mdns_no_fwd);
  4870. DP_PRINT_STATS("raw packets %u msdus ( %llu bytes),",
  4871. pdev->stats.rx.raw.num,
  4872. pdev->stats.rx.raw.bytes);
  4873. DP_PRINT_STATS("mic errors %u",
  4874. pdev->stats.rx.err.mic_err);
  4875. DP_PRINT_STATS("Invalid peer on rx path: %u",
  4876. pdev->soc->stats.rx.err.rx_invalid_peer.num);
  4877. DP_PRINT_STATS("sw_peer_id invalid %u",
  4878. pdev->soc->stats.rx.err.rx_invalid_peer_id.num);
  4879. DP_PRINT_STATS("packet_len invalid %u",
  4880. pdev->soc->stats.rx.err.rx_invalid_pkt_len.num);
  4881. DP_PRINT_STATS("sa or da idx invalid %u",
  4882. pdev->soc->stats.rx.err.invalid_sa_da_idx);
  4883. DP_PRINT_STATS("defrag peer uninit %u",
  4884. pdev->soc->stats.rx.err.defrag_peer_uninit);
  4885. DP_PRINT_STATS("pkts delivered no peer %u",
  4886. pdev->soc->stats.rx.err.pkt_delivered_no_peer);
  4887. DP_PRINT_STATS("Reo Statistics");
  4888. DP_PRINT_STATS("near_full: %u ", soc->stats.rx.near_full);
  4889. DP_PRINT_STATS("rbm error: %u msdus",
  4890. pdev->soc->stats.rx.err.invalid_rbm);
  4891. DP_PRINT_STATS("hal ring access fail: %u msdus",
  4892. pdev->soc->stats.rx.err.hal_ring_access_fail);
  4893. for (error_code = 0; error_code < HAL_REO_ERR_MAX;
  4894. error_code++) {
  4895. if (!pdev->soc->stats.rx.err.reo_error[error_code])
  4896. continue;
  4897. DP_PRINT_STATS("Reo error number (%u): %u msdus",
  4898. error_code,
  4899. pdev->soc->stats.rx.err
  4900. .reo_error[error_code]);
  4901. }
  4902. for (error_code = 0; error_code < HAL_RXDMA_ERR_MAX;
  4903. error_code++) {
  4904. if (!pdev->soc->stats.rx.err.rxdma_error[error_code])
  4905. continue;
  4906. DP_PRINT_STATS("Rxdma error number (%u): %u msdus",
  4907. error_code,
  4908. pdev->soc->stats.rx.err
  4909. .rxdma_error[error_code]);
  4910. }
  4911. DP_PRINT_STATS("Rx packets reaped per interrupt:");
  4912. DP_PRINT_STATS("Single Packet: %u",
  4913. pdev->stats.rx_ind_histogram.pkts_1);
  4914. DP_PRINT_STATS("2-20 Packets: %u",
  4915. pdev->stats.rx_ind_histogram.pkts_2_20);
  4916. DP_PRINT_STATS("21-40 Packets: %u",
  4917. pdev->stats.rx_ind_histogram.pkts_21_40);
  4918. DP_PRINT_STATS("41-60 Packets: %u",
  4919. pdev->stats.rx_ind_histogram.pkts_41_60);
  4920. DP_PRINT_STATS("61-80 Packets: %u",
  4921. pdev->stats.rx_ind_histogram.pkts_61_80);
  4922. DP_PRINT_STATS("81-100 Packets: %u",
  4923. pdev->stats.rx_ind_histogram.pkts_81_100);
  4924. DP_PRINT_STATS("101-200 Packets: %u",
  4925. pdev->stats.rx_ind_histogram.pkts_101_200);
  4926. DP_PRINT_STATS(" 201+ Packets: %u",
  4927. pdev->stats.rx_ind_histogram.pkts_201_plus);
  4928. DP_PRINT_STATS("%s: tso_enable: %u lro_enable: %u rx_hash: %u napi_enable: %u",
  4929. __func__,
  4930. pdev->soc->wlan_cfg_ctx
  4931. ->tso_enabled,
  4932. pdev->soc->wlan_cfg_ctx
  4933. ->lro_enabled,
  4934. pdev->soc->wlan_cfg_ctx
  4935. ->rx_hash,
  4936. pdev->soc->wlan_cfg_ctx
  4937. ->napi_enabled);
  4938. #ifdef QCA_LL_TX_FLOW_CONTROL_V2
  4939. DP_PRINT_STATS("%s: Tx flow stop queue: %u tx flow start queue offset: %u",
  4940. __func__,
  4941. pdev->soc->wlan_cfg_ctx
  4942. ->tx_flow_stop_queue_threshold,
  4943. pdev->soc->wlan_cfg_ctx
  4944. ->tx_flow_start_queue_offset);
  4945. #endif
  4946. }
  4947. }
  4948. /*
  4949. * dp_aggregate_pdev_ctrl_frames_stats()- function to agreegate peer stats
  4950. * Current scope is bar received count
  4951. *
  4952. * @pdev_handle: DP_PDEV handle
  4953. *
  4954. * Return: void
  4955. */
  4956. static void
  4957. dp_aggregate_pdev_ctrl_frames_stats(struct dp_pdev *pdev)
  4958. {
  4959. struct dp_vdev *vdev;
  4960. struct dp_peer *peer;
  4961. uint32_t waitcnt;
  4962. TAILQ_FOREACH(vdev, &pdev->vdev_list, vdev_list_elem) {
  4963. TAILQ_FOREACH(peer, &vdev->peer_list, peer_list_elem) {
  4964. if (!peer) {
  4965. dp_err("DP Invalid Peer refernce");
  4966. return;
  4967. }
  4968. if (peer->delete_in_progress) {
  4969. dp_err("DP Peer deletion in progress");
  4970. continue;
  4971. }
  4972. qdf_atomic_inc(&peer->ref_cnt);
  4973. waitcnt = 0;
  4974. dp_peer_rxtid_stats(peer, dp_rx_bar_stats_cb, pdev);
  4975. while (!(qdf_atomic_read(&pdev->stats_cmd_complete)) &&
  4976. waitcnt < 10) {
  4977. schedule_timeout_interruptible(
  4978. STATS_PROC_TIMEOUT);
  4979. waitcnt++;
  4980. }
  4981. qdf_atomic_set(&pdev->stats_cmd_complete, 0);
  4982. dp_peer_unref_delete(peer);
  4983. }
  4984. }
  4985. }
  4986. void
  4987. dp_print_pdev_tx_stats(struct dp_pdev *pdev)
  4988. {
  4989. uint8_t i = 0, index = 0;
  4990. DP_PRINT_STATS("PDEV Tx Stats:\n");
  4991. DP_PRINT_STATS("Received From Stack:");
  4992. DP_PRINT_STATS(" Packets = %d",
  4993. pdev->stats.tx_i.rcvd.num);
  4994. DP_PRINT_STATS(" Bytes = %llu",
  4995. pdev->stats.tx_i.rcvd.bytes);
  4996. DP_PRINT_STATS("Processed:");
  4997. DP_PRINT_STATS(" Packets = %d",
  4998. pdev->stats.tx_i.processed.num);
  4999. DP_PRINT_STATS(" Bytes = %llu",
  5000. pdev->stats.tx_i.processed.bytes);
  5001. DP_PRINT_STATS("Total Completions:");
  5002. DP_PRINT_STATS(" Packets = %u",
  5003. pdev->stats.tx.comp_pkt.num);
  5004. DP_PRINT_STATS(" Bytes = %llu",
  5005. pdev->stats.tx.comp_pkt.bytes);
  5006. DP_PRINT_STATS("Successful Completions:");
  5007. DP_PRINT_STATS(" Packets = %u",
  5008. pdev->stats.tx.tx_success.num);
  5009. DP_PRINT_STATS(" Bytes = %llu",
  5010. pdev->stats.tx.tx_success.bytes);
  5011. DP_PRINT_STATS("Dropped:");
  5012. DP_PRINT_STATS(" Total = %d",
  5013. pdev->stats.tx_i.dropped.dropped_pkt.num);
  5014. DP_PRINT_STATS(" Dma_map_error = %d",
  5015. pdev->stats.tx_i.dropped.dma_error);
  5016. DP_PRINT_STATS(" Ring Full = %d",
  5017. pdev->stats.tx_i.dropped.ring_full);
  5018. DP_PRINT_STATS(" Descriptor Not available = %d",
  5019. pdev->stats.tx_i.dropped.desc_na.num);
  5020. DP_PRINT_STATS(" HW enqueue failed= %d",
  5021. pdev->stats.tx_i.dropped.enqueue_fail);
  5022. DP_PRINT_STATS(" Resources Full = %d",
  5023. pdev->stats.tx_i.dropped.res_full);
  5024. DP_PRINT_STATS(" FW removed Pkts = %u",
  5025. pdev->stats.tx.dropped.fw_rem.num);
  5026. DP_PRINT_STATS(" FW removed bytes= %llu",
  5027. pdev->stats.tx.dropped.fw_rem.bytes);
  5028. DP_PRINT_STATS(" FW removed transmitted = %d",
  5029. pdev->stats.tx.dropped.fw_rem_tx);
  5030. DP_PRINT_STATS(" FW removed untransmitted = %d",
  5031. pdev->stats.tx.dropped.fw_rem_notx);
  5032. DP_PRINT_STATS(" FW removed untransmitted fw_reason1 = %d",
  5033. pdev->stats.tx.dropped.fw_reason1);
  5034. DP_PRINT_STATS(" FW removed untransmitted fw_reason2 = %d",
  5035. pdev->stats.tx.dropped.fw_reason2);
  5036. DP_PRINT_STATS(" FW removed untransmitted fw_reason3 = %d",
  5037. pdev->stats.tx.dropped.fw_reason3);
  5038. DP_PRINT_STATS(" Aged Out from msdu/mpdu queues = %d",
  5039. pdev->stats.tx.dropped.age_out);
  5040. DP_PRINT_STATS(" headroom insufficient = %d",
  5041. pdev->stats.tx_i.dropped.headroom_insufficient);
  5042. DP_PRINT_STATS("Multicast:");
  5043. DP_PRINT_STATS(" Packets: %u",
  5044. pdev->stats.tx.mcast.num);
  5045. DP_PRINT_STATS(" Bytes: %llu",
  5046. pdev->stats.tx.mcast.bytes);
  5047. DP_PRINT_STATS("Scatter Gather:");
  5048. DP_PRINT_STATS(" Packets = %d",
  5049. pdev->stats.tx_i.sg.sg_pkt.num);
  5050. DP_PRINT_STATS(" Bytes = %llu",
  5051. pdev->stats.tx_i.sg.sg_pkt.bytes);
  5052. DP_PRINT_STATS(" Dropped By Host = %d",
  5053. pdev->stats.tx_i.sg.dropped_host.num);
  5054. DP_PRINT_STATS(" Dropped By Target = %d",
  5055. pdev->stats.tx_i.sg.dropped_target);
  5056. DP_PRINT_STATS("Mcast Enhancement:");
  5057. DP_PRINT_STATS(" Packets = %d",
  5058. pdev->stats.tx_i.mcast_en.mcast_pkt.num);
  5059. DP_PRINT_STATS(" Bytes = %llu",
  5060. pdev->stats.tx_i.mcast_en.mcast_pkt.bytes);
  5061. DP_PRINT_STATS(" Dropped: Map Errors = %d",
  5062. pdev->stats.tx_i.mcast_en.dropped_map_error);
  5063. DP_PRINT_STATS(" Dropped: Self Mac = %d",
  5064. pdev->stats.tx_i.mcast_en.dropped_self_mac);
  5065. DP_PRINT_STATS(" Dropped: Send Fail = %d",
  5066. pdev->stats.tx_i.mcast_en.dropped_send_fail);
  5067. DP_PRINT_STATS(" Unicast sent = %d",
  5068. pdev->stats.tx_i.mcast_en.ucast);
  5069. DP_PRINT_STATS("Raw:");
  5070. DP_PRINT_STATS(" Packets = %d",
  5071. pdev->stats.tx_i.raw.raw_pkt.num);
  5072. DP_PRINT_STATS(" Bytes = %llu",
  5073. pdev->stats.tx_i.raw.raw_pkt.bytes);
  5074. DP_PRINT_STATS(" DMA map error = %d",
  5075. pdev->stats.tx_i.raw.dma_map_error);
  5076. DP_PRINT_STATS(" RAW pkt type[!data] error = %d",
  5077. pdev->stats.tx_i.raw.invalid_raw_pkt_datatype);
  5078. DP_PRINT_STATS("Reinjected:");
  5079. DP_PRINT_STATS(" Packets = %d",
  5080. pdev->stats.tx_i.reinject_pkts.num);
  5081. DP_PRINT_STATS(" Bytes = %llu\n",
  5082. pdev->stats.tx_i.reinject_pkts.bytes);
  5083. DP_PRINT_STATS("Inspected:");
  5084. DP_PRINT_STATS(" Packets = %d",
  5085. pdev->stats.tx_i.inspect_pkts.num);
  5086. DP_PRINT_STATS(" Bytes = %llu",
  5087. pdev->stats.tx_i.inspect_pkts.bytes);
  5088. DP_PRINT_STATS("Nawds Multicast:");
  5089. DP_PRINT_STATS(" Packets = %d",
  5090. pdev->stats.tx_i.nawds_mcast.num);
  5091. DP_PRINT_STATS(" Bytes = %llu",
  5092. pdev->stats.tx_i.nawds_mcast.bytes);
  5093. DP_PRINT_STATS("CCE Classified:");
  5094. DP_PRINT_STATS(" CCE Classified Packets: %u",
  5095. pdev->stats.tx_i.cce_classified);
  5096. DP_PRINT_STATS(" RAW CCE Classified Packets: %u",
  5097. pdev->stats.tx_i.cce_classified_raw);
  5098. DP_PRINT_STATS("Mesh stats:");
  5099. DP_PRINT_STATS(" frames to firmware: %u",
  5100. pdev->stats.tx_i.mesh.exception_fw);
  5101. DP_PRINT_STATS(" completions from fw: %u",
  5102. pdev->stats.tx_i.mesh.completion_fw);
  5103. DP_PRINT_STATS("PPDU stats counter");
  5104. for (index = 0; index < CDP_PPDU_STATS_MAX_TAG; index++) {
  5105. DP_PRINT_STATS(" Tag[%d] = %llu", index,
  5106. pdev->stats.ppdu_stats_counter[index]);
  5107. }
  5108. DP_PRINT_STATS("BA not received for delayed_ba: %d",
  5109. pdev->stats.cdp_delayed_ba_not_recev);
  5110. DP_PRINT_STATS("tx_ppdu_proc: %llu\n",
  5111. pdev->tx_ppdu_proc);
  5112. for (i = 0; i < CDP_WDI_NUM_EVENTS; i++) {
  5113. if (!pdev->stats.wdi_event[i])
  5114. DP_PRINT_STATS("Wdi msgs received from fw[%d]:%d",
  5115. i, pdev->stats.wdi_event[i]);
  5116. }
  5117. }
  5118. void
  5119. dp_print_pdev_rx_stats(struct dp_pdev *pdev)
  5120. {
  5121. DP_PRINT_STATS("PDEV Rx Stats:\n");
  5122. DP_PRINT_STATS("Received From HW (Per Rx Ring):");
  5123. DP_PRINT_STATS(" Packets = %d %d %d %d",
  5124. pdev->stats.rx.rcvd_reo[0].num,
  5125. pdev->stats.rx.rcvd_reo[1].num,
  5126. pdev->stats.rx.rcvd_reo[2].num,
  5127. pdev->stats.rx.rcvd_reo[3].num);
  5128. DP_PRINT_STATS(" Bytes = %llu %llu %llu %llu",
  5129. pdev->stats.rx.rcvd_reo[0].bytes,
  5130. pdev->stats.rx.rcvd_reo[1].bytes,
  5131. pdev->stats.rx.rcvd_reo[2].bytes,
  5132. pdev->stats.rx.rcvd_reo[3].bytes);
  5133. DP_PRINT_STATS("Replenished:");
  5134. DP_PRINT_STATS(" Packets = %d",
  5135. pdev->stats.replenish.pkts.num);
  5136. DP_PRINT_STATS(" Bytes = %llu",
  5137. pdev->stats.replenish.pkts.bytes);
  5138. DP_PRINT_STATS(" Buffers Added To Freelist = %d",
  5139. pdev->stats.buf_freelist);
  5140. DP_PRINT_STATS(" Low threshold intr = %d",
  5141. pdev->stats.replenish.low_thresh_intrs);
  5142. DP_PRINT_STATS("Dropped:");
  5143. DP_PRINT_STATS(" msdu_not_done = %d",
  5144. pdev->stats.dropped.msdu_not_done);
  5145. DP_PRINT_STATS(" wifi parse = %d",
  5146. pdev->stats.dropped.wifi_parse);
  5147. DP_PRINT_STATS(" mon_rx_drop = %d",
  5148. pdev->stats.dropped.mon_rx_drop);
  5149. DP_PRINT_STATS(" mon_radiotap_update_err = %d",
  5150. pdev->stats.dropped.mon_radiotap_update_err);
  5151. DP_PRINT_STATS(" mec_drop = %d",
  5152. pdev->stats.rx.mec_drop.num);
  5153. DP_PRINT_STATS(" Bytes = %llu",
  5154. pdev->stats.rx.mec_drop.bytes);
  5155. DP_PRINT_STATS("Sent To Stack:");
  5156. DP_PRINT_STATS(" Packets = %d",
  5157. pdev->stats.rx.to_stack.num);
  5158. DP_PRINT_STATS(" Bytes = %llu",
  5159. pdev->stats.rx.to_stack.bytes);
  5160. DP_PRINT_STATS(" vlan_tag_stp_cnt = %d",
  5161. pdev->stats.vlan_tag_stp_cnt);
  5162. DP_PRINT_STATS("Multicast/Broadcast:");
  5163. DP_PRINT_STATS(" Packets = %d",
  5164. pdev->stats.rx.multicast.num);
  5165. DP_PRINT_STATS(" Bytes = %llu",
  5166. pdev->stats.rx.multicast.bytes);
  5167. DP_PRINT_STATS("Errors:");
  5168. DP_PRINT_STATS(" Rxdma Ring Un-inititalized = %d",
  5169. pdev->stats.replenish.rxdma_err);
  5170. DP_PRINT_STATS(" Desc Alloc Failed: = %d",
  5171. pdev->stats.err.desc_alloc_fail);
  5172. DP_PRINT_STATS(" IP checksum error = %d",
  5173. pdev->stats.err.ip_csum_err);
  5174. DP_PRINT_STATS(" TCP/UDP checksum error = %d",
  5175. pdev->stats.err.tcp_udp_csum_err);
  5176. /* Get bar_recv_cnt */
  5177. dp_aggregate_pdev_ctrl_frames_stats(pdev);
  5178. DP_PRINT_STATS("BAR Received Count: = %d",
  5179. pdev->stats.rx.bar_recv_cnt);
  5180. }
  5181. void
  5182. dp_print_pdev_rx_mon_stats(struct dp_pdev *pdev)
  5183. {
  5184. struct cdp_pdev_mon_stats *rx_mon_stats;
  5185. uint32_t *stat_ring_ppdu_ids;
  5186. uint32_t *dest_ring_ppdu_ids;
  5187. int i, idx;
  5188. rx_mon_stats = &pdev->rx_mon_stats;
  5189. DP_PRINT_STATS("PDEV Rx Monitor Stats:\n");
  5190. DP_PRINT_STATS("status_ppdu_compl_cnt = %d",
  5191. rx_mon_stats->status_ppdu_compl);
  5192. DP_PRINT_STATS("status_ppdu_start_cnt = %d",
  5193. rx_mon_stats->status_ppdu_start);
  5194. DP_PRINT_STATS("status_ppdu_end_cnt = %d",
  5195. rx_mon_stats->status_ppdu_end);
  5196. DP_PRINT_STATS("status_ppdu_start_mis_cnt = %d",
  5197. rx_mon_stats->status_ppdu_start_mis);
  5198. DP_PRINT_STATS("status_ppdu_end_mis_cnt = %d",
  5199. rx_mon_stats->status_ppdu_end_mis);
  5200. DP_PRINT_STATS("status_ppdu_done_cnt = %d",
  5201. rx_mon_stats->status_ppdu_done);
  5202. DP_PRINT_STATS("dest_ppdu_done_cnt = %d",
  5203. rx_mon_stats->dest_ppdu_done);
  5204. DP_PRINT_STATS("dest_mpdu_done_cnt = %d",
  5205. rx_mon_stats->dest_mpdu_done);
  5206. DP_PRINT_STATS("tlv_tag_status_err_cnt = %u",
  5207. rx_mon_stats->tlv_tag_status_err);
  5208. DP_PRINT_STATS("dest_mpdu_drop_cnt = %d",
  5209. rx_mon_stats->dest_mpdu_drop);
  5210. DP_PRINT_STATS("dup_mon_linkdesc_cnt = %d",
  5211. rx_mon_stats->dup_mon_linkdesc_cnt);
  5212. DP_PRINT_STATS("dup_mon_buf_cnt = %d",
  5213. rx_mon_stats->dup_mon_buf_cnt);
  5214. stat_ring_ppdu_ids =
  5215. (uint32_t *)qdf_mem_malloc(sizeof(uint32_t) * MAX_PPDU_ID_HIST);
  5216. dest_ring_ppdu_ids =
  5217. (uint32_t *)qdf_mem_malloc(sizeof(uint32_t) * MAX_PPDU_ID_HIST);
  5218. if (!stat_ring_ppdu_ids || !dest_ring_ppdu_ids)
  5219. DP_PRINT_STATS("Unable to allocate ppdu id hist mem\n");
  5220. qdf_spin_lock_bh(&pdev->mon_lock);
  5221. idx = rx_mon_stats->ppdu_id_hist_idx;
  5222. qdf_mem_copy(stat_ring_ppdu_ids,
  5223. rx_mon_stats->stat_ring_ppdu_id_hist,
  5224. sizeof(uint32_t) * MAX_PPDU_ID_HIST);
  5225. qdf_mem_copy(dest_ring_ppdu_ids,
  5226. rx_mon_stats->dest_ring_ppdu_id_hist,
  5227. sizeof(uint32_t) * MAX_PPDU_ID_HIST);
  5228. qdf_spin_unlock_bh(&pdev->mon_lock);
  5229. DP_PRINT_STATS("PPDU Id history:");
  5230. DP_PRINT_STATS("stat_ring_ppdu_ids\t dest_ring_ppdu_ids");
  5231. for (i = 0; i < MAX_PPDU_ID_HIST; i++) {
  5232. idx = (idx + 1) & (MAX_PPDU_ID_HIST - 1);
  5233. DP_PRINT_STATS("%*u\t%*u", 16,
  5234. rx_mon_stats->stat_ring_ppdu_id_hist[idx], 16,
  5235. rx_mon_stats->dest_ring_ppdu_id_hist[idx]);
  5236. }
  5237. qdf_mem_free(stat_ring_ppdu_ids);
  5238. qdf_mem_free(dest_ring_ppdu_ids);
  5239. DP_PRINT_STATS("mon_rx_dest_stuck = %d",
  5240. rx_mon_stats->mon_rx_dest_stuck);
  5241. }
  5242. void
  5243. dp_print_soc_tx_stats(struct dp_soc *soc)
  5244. {
  5245. uint8_t desc_pool_id;
  5246. soc->stats.tx.desc_in_use = 0;
  5247. DP_PRINT_STATS("SOC Tx Stats:\n");
  5248. for (desc_pool_id = 0;
  5249. desc_pool_id < wlan_cfg_get_num_tx_desc_pool(soc->wlan_cfg_ctx);
  5250. desc_pool_id++)
  5251. soc->stats.tx.desc_in_use +=
  5252. soc->tx_desc[desc_pool_id].num_allocated;
  5253. DP_PRINT_STATS("Tx Descriptors In Use = %d",
  5254. soc->stats.tx.desc_in_use);
  5255. DP_PRINT_STATS("Tx Invalid peer:");
  5256. DP_PRINT_STATS(" Packets = %d",
  5257. soc->stats.tx.tx_invalid_peer.num);
  5258. DP_PRINT_STATS(" Bytes = %llu",
  5259. soc->stats.tx.tx_invalid_peer.bytes);
  5260. DP_PRINT_STATS("Packets dropped due to TCL ring full = %d %d %d",
  5261. soc->stats.tx.tcl_ring_full[0],
  5262. soc->stats.tx.tcl_ring_full[1],
  5263. soc->stats.tx.tcl_ring_full[2]);
  5264. DP_PRINT_STATS("Tx invalid completion release = %d",
  5265. soc->stats.tx.invalid_release_source);
  5266. DP_PRINT_STATS("Tx comp wbm internal error = %d : [%d %d %d %d]",
  5267. soc->stats.tx.wbm_internal_error[WBM_INT_ERROR_ALL],
  5268. soc->stats.tx.wbm_internal_error[WBM_INT_ERROR_REO_NULL_BUFFER],
  5269. soc->stats.tx.wbm_internal_error[WBM_INT_ERROR_REO_NULL_LINK_DESC],
  5270. soc->stats.tx.wbm_internal_error[WBM_INT_ERROR_REO_NULL_MSDU_BUFF],
  5271. soc->stats.tx.wbm_internal_error[WBM_INT_ERROR_REO_BUFF_REAPED]);
  5272. DP_PRINT_STATS("Tx comp loop pkt limit hit = %d",
  5273. soc->stats.tx.tx_comp_loop_pkt_limit_hit);
  5274. DP_PRINT_STATS("Tx comp HP out of sync2 = %d",
  5275. soc->stats.tx.hp_oos2);
  5276. }
  5277. void dp_print_soc_interrupt_stats(struct dp_soc *soc)
  5278. {
  5279. int i = 0;
  5280. struct dp_intr_stats *intr_stats;
  5281. DP_PRINT_STATS("INT: Total |txComps|reo[0] |reo[1] |reo[2] |reo[3] |mon |rx_err | wbm |reo_sta|rxdm2hst|hst2rxdm|");
  5282. for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
  5283. intr_stats = &soc->intr_ctx[i].intr_stats;
  5284. DP_PRINT_STATS("%3u[%3d]: %7u %7u %7u %7u %7u %7u %7u %7u %7u %7u %8u %8u",
  5285. i,
  5286. hif_get_int_ctx_irq_num(soc->hif_handle, i),
  5287. intr_stats->num_masks,
  5288. intr_stats->num_tx_ring_masks[0],
  5289. intr_stats->num_rx_ring_masks[0],
  5290. intr_stats->num_rx_ring_masks[1],
  5291. intr_stats->num_rx_ring_masks[2],
  5292. intr_stats->num_rx_ring_masks[3],
  5293. intr_stats->num_rx_mon_ring_masks,
  5294. intr_stats->num_rx_err_ring_masks,
  5295. intr_stats->num_rx_wbm_rel_ring_masks,
  5296. intr_stats->num_reo_status_ring_masks,
  5297. intr_stats->num_rxdma2host_ring_masks,
  5298. intr_stats->num_host2rxdma_ring_masks);
  5299. }
  5300. }
  5301. void
  5302. dp_print_soc_rx_stats(struct dp_soc *soc)
  5303. {
  5304. uint32_t i;
  5305. char reo_error[DP_REO_ERR_LENGTH];
  5306. char rxdma_error[DP_RXDMA_ERR_LENGTH];
  5307. uint8_t index = 0;
  5308. DP_PRINT_STATS("No of AST Entries = %d", soc->num_ast_entries);
  5309. DP_PRINT_STATS("SOC Rx Stats:\n");
  5310. DP_PRINT_STATS("Fragmented packets: %u",
  5311. soc->stats.rx.rx_frags);
  5312. DP_PRINT_STATS("Reo reinjected packets: %u",
  5313. soc->stats.rx.reo_reinject);
  5314. DP_PRINT_STATS("Errors:\n");
  5315. DP_PRINT_STATS("Rx Decrypt Errors = %d",
  5316. (soc->stats.rx.err.rxdma_error[HAL_RXDMA_ERR_DECRYPT] +
  5317. soc->stats.rx.err.rxdma_error[HAL_RXDMA_ERR_TKIP_MIC]));
  5318. DP_PRINT_STATS("Invalid RBM = %d",
  5319. soc->stats.rx.err.invalid_rbm);
  5320. DP_PRINT_STATS("Invalid Vdev = %d",
  5321. soc->stats.rx.err.invalid_vdev);
  5322. DP_PRINT_STATS("Invalid sa_idx or da_idx = %d",
  5323. soc->stats.rx.err.invalid_sa_da_idx);
  5324. DP_PRINT_STATS("Defrag peer uninit = %d",
  5325. soc->stats.rx.err.defrag_peer_uninit);
  5326. DP_PRINT_STATS("Pkts delivered no peer = %d",
  5327. soc->stats.rx.err.pkt_delivered_no_peer);
  5328. DP_PRINT_STATS("Invalid Pdev = %d",
  5329. soc->stats.rx.err.invalid_pdev);
  5330. DP_PRINT_STATS("Invalid Peer = %d",
  5331. soc->stats.rx.err.rx_invalid_peer.num);
  5332. DP_PRINT_STATS("HAL Ring Access Fail = %d",
  5333. soc->stats.rx.err.hal_ring_access_fail);
  5334. DP_PRINT_STATS("MSDU Done failures = %d",
  5335. soc->stats.rx.err.msdu_done_fail);
  5336. DP_PRINT_STATS("RX frags: %d", soc->stats.rx.rx_frags);
  5337. DP_PRINT_STATS("RX frag wait: %d", soc->stats.rx.rx_frag_wait);
  5338. DP_PRINT_STATS("RX frag err: %d", soc->stats.rx.rx_frag_err);
  5339. DP_PRINT_STATS("RX HP out_of_sync: %d", soc->stats.rx.hp_oos2);
  5340. DP_PRINT_STATS("RX Ring Near Full: %d", soc->stats.rx.near_full);
  5341. DP_PRINT_STATS("RX Reap Loop Pkt Limit Hit: %d",
  5342. soc->stats.rx.reap_loop_pkt_limit_hit);
  5343. DP_PRINT_STATS("RX DESC invalid magic: %u",
  5344. soc->stats.rx.err.rx_desc_invalid_magic);
  5345. DP_PRINT_STATS("RX DUP DESC: %d",
  5346. soc->stats.rx.err.hal_reo_dest_dup);
  5347. DP_PRINT_STATS("RX REL DUP DESC: %d",
  5348. soc->stats.rx.err.hal_wbm_rel_dup);
  5349. DP_PRINT_STATS("RXDMA ERR DUP DESC: %d",
  5350. soc->stats.rx.err.hal_rxdma_err_dup);
  5351. for (i = 0; i < HAL_RXDMA_ERR_MAX; i++) {
  5352. index += qdf_snprint(&rxdma_error[index],
  5353. DP_RXDMA_ERR_LENGTH - index,
  5354. " %d", soc->stats.rx.err.rxdma_error[i]);
  5355. }
  5356. DP_PRINT_STATS("RXDMA Error (0-31):%s", rxdma_error);
  5357. index = 0;
  5358. for (i = 0; i < HAL_REO_ERR_MAX; i++) {
  5359. index += qdf_snprint(&reo_error[index],
  5360. DP_REO_ERR_LENGTH - index,
  5361. " %d", soc->stats.rx.err.reo_error[i]);
  5362. }
  5363. DP_PRINT_STATS("REO Error(0-14):%s", reo_error);
  5364. DP_PRINT_STATS("REO CMD SEND FAIL: %d",
  5365. soc->stats.rx.err.reo_cmd_send_fail);
  5366. }
  5367. #ifdef FEATURE_TSO_STATS
  5368. void dp_print_tso_stats(struct dp_soc *soc,
  5369. enum qdf_stats_verbosity_level level)
  5370. {
  5371. uint8_t loop_pdev;
  5372. uint32_t id;
  5373. struct dp_pdev *pdev;
  5374. for (loop_pdev = 0; loop_pdev < soc->pdev_count; loop_pdev++) {
  5375. pdev = soc->pdev_list[loop_pdev];
  5376. DP_PRINT_STATS("TSO Statistics\n");
  5377. DP_PRINT_STATS(
  5378. "From stack: %d | Successful completions: %d | TSO Packets: %d | TSO Completions: %d",
  5379. pdev->stats.tx_i.rcvd.num,
  5380. pdev->stats.tx.tx_success.num,
  5381. pdev->stats.tso_stats.num_tso_pkts.num,
  5382. pdev->stats.tso_stats.tso_comp);
  5383. for (id = 0; id < CDP_MAX_TSO_PACKETS; id++) {
  5384. /* TSO LEVEL 1 - PACKET INFO */
  5385. DP_PRINT_STATS(
  5386. "Packet_Id:[%u]: Packet Length %zu | No. of segments: %u",
  5387. id,
  5388. pdev->stats.tso_stats.tso_info
  5389. .tso_packet_info[id].tso_packet_len,
  5390. pdev->stats.tso_stats.tso_info
  5391. .tso_packet_info[id].num_seg);
  5392. /* TSO LEVEL 2 */
  5393. if (level == QDF_STATS_VERBOSITY_LEVEL_HIGH)
  5394. dp_print_tso_seg_stats(pdev, id);
  5395. }
  5396. DP_PRINT_STATS(
  5397. "TSO Histogram: Single: %llu | 2-5 segs: %llu | 6-10: %llu segs | 11-15 segs: %llu | 16-20 segs: %llu | 20+ segs: %llu",
  5398. pdev->stats.tso_stats.seg_histogram.segs_1,
  5399. pdev->stats.tso_stats.seg_histogram.segs_2_5,
  5400. pdev->stats.tso_stats.seg_histogram.segs_6_10,
  5401. pdev->stats.tso_stats.seg_histogram.segs_11_15,
  5402. pdev->stats.tso_stats.seg_histogram.segs_16_20,
  5403. pdev->stats.tso_stats.seg_histogram.segs_20_plus);
  5404. }
  5405. }
  5406. void dp_stats_tso_segment_histogram_update(struct dp_pdev *pdev,
  5407. uint8_t _p_cntrs)
  5408. {
  5409. if (_p_cntrs == 1) {
  5410. DP_STATS_INC(pdev,
  5411. tso_stats.seg_histogram.segs_1, 1);
  5412. } else if (_p_cntrs >= 2 && _p_cntrs <= 5) {
  5413. DP_STATS_INC(pdev,
  5414. tso_stats.seg_histogram.segs_2_5, 1);
  5415. } else if (_p_cntrs > 5 && _p_cntrs <= 10) {
  5416. DP_STATS_INC(pdev,
  5417. tso_stats.seg_histogram.segs_6_10, 1);
  5418. } else if (_p_cntrs > 10 && _p_cntrs <= 15) {
  5419. DP_STATS_INC(pdev,
  5420. tso_stats.seg_histogram.segs_11_15, 1);
  5421. } else if (_p_cntrs > 15 && _p_cntrs <= 20) {
  5422. DP_STATS_INC(pdev,
  5423. tso_stats.seg_histogram.segs_16_20, 1);
  5424. } else if (_p_cntrs > 20) {
  5425. DP_STATS_INC(pdev,
  5426. tso_stats.seg_histogram.segs_20_plus, 1);
  5427. }
  5428. }
  5429. void dp_tso_segment_update(struct dp_pdev *pdev,
  5430. uint32_t stats_idx,
  5431. uint8_t idx,
  5432. struct qdf_tso_seg_t seg)
  5433. {
  5434. DP_STATS_UPD(pdev, tso_stats.tso_info.tso_packet_info[stats_idx]
  5435. .tso_seg[idx].num_frags,
  5436. seg.num_frags);
  5437. DP_STATS_UPD(pdev, tso_stats.tso_info.tso_packet_info[stats_idx]
  5438. .tso_seg[idx].total_len,
  5439. seg.total_len);
  5440. DP_STATS_UPD(pdev, tso_stats.tso_info.tso_packet_info[stats_idx]
  5441. .tso_seg[idx].tso_flags.tso_enable,
  5442. seg.tso_flags.tso_enable);
  5443. DP_STATS_UPD(pdev, tso_stats.tso_info.tso_packet_info[stats_idx]
  5444. .tso_seg[idx].tso_flags.fin,
  5445. seg.tso_flags.fin);
  5446. DP_STATS_UPD(pdev, tso_stats.tso_info.tso_packet_info[stats_idx]
  5447. .tso_seg[idx].tso_flags.syn,
  5448. seg.tso_flags.syn);
  5449. DP_STATS_UPD(pdev, tso_stats.tso_info.tso_packet_info[stats_idx]
  5450. .tso_seg[idx].tso_flags.rst,
  5451. seg.tso_flags.rst);
  5452. DP_STATS_UPD(pdev, tso_stats.tso_info.tso_packet_info[stats_idx]
  5453. .tso_seg[idx].tso_flags.psh,
  5454. seg.tso_flags.psh);
  5455. DP_STATS_UPD(pdev, tso_stats.tso_info.tso_packet_info[stats_idx]
  5456. .tso_seg[idx].tso_flags.ack,
  5457. seg.tso_flags.ack);
  5458. DP_STATS_UPD(pdev, tso_stats.tso_info.tso_packet_info[stats_idx]
  5459. .tso_seg[idx].tso_flags.urg,
  5460. seg.tso_flags.urg);
  5461. DP_STATS_UPD(pdev, tso_stats.tso_info.tso_packet_info[stats_idx]
  5462. .tso_seg[idx].tso_flags.ece,
  5463. seg.tso_flags.ece);
  5464. DP_STATS_UPD(pdev, tso_stats.tso_info.tso_packet_info[stats_idx]
  5465. .tso_seg[idx].tso_flags.cwr,
  5466. seg.tso_flags.cwr);
  5467. DP_STATS_UPD(pdev, tso_stats.tso_info.tso_packet_info[stats_idx]
  5468. .tso_seg[idx].tso_flags.ns,
  5469. seg.tso_flags.ns);
  5470. DP_STATS_UPD(pdev, tso_stats.tso_info.tso_packet_info[stats_idx]
  5471. .tso_seg[idx].tso_flags.tcp_seq_num,
  5472. seg.tso_flags.tcp_seq_num);
  5473. DP_STATS_UPD(pdev, tso_stats.tso_info.tso_packet_info[stats_idx]
  5474. .tso_seg[idx].tso_flags.ip_id,
  5475. seg.tso_flags.ip_id);
  5476. }
  5477. void dp_tso_packet_update(struct dp_pdev *pdev, uint32_t stats_idx,
  5478. qdf_nbuf_t msdu, uint16_t num_segs)
  5479. {
  5480. DP_STATS_UPD(pdev,
  5481. tso_stats.tso_info.tso_packet_info[stats_idx]
  5482. .num_seg,
  5483. num_segs);
  5484. DP_STATS_UPD(pdev,
  5485. tso_stats.tso_info.tso_packet_info[stats_idx]
  5486. .tso_packet_len,
  5487. qdf_nbuf_get_tcp_payload_len(msdu));
  5488. }
  5489. void dp_tso_segment_stats_update(struct dp_pdev *pdev,
  5490. struct qdf_tso_seg_elem_t *stats_seg,
  5491. uint32_t stats_idx)
  5492. {
  5493. uint8_t tso_seg_idx = 0;
  5494. while (stats_seg && (tso_seg_idx < CDP_MAX_TSO_SEGMENTS)) {
  5495. dp_tso_segment_update(pdev, stats_idx,
  5496. tso_seg_idx,
  5497. stats_seg->seg);
  5498. ++tso_seg_idx;
  5499. stats_seg = stats_seg->next;
  5500. }
  5501. }
  5502. void dp_txrx_clear_tso_stats(struct dp_soc *soc)
  5503. {
  5504. uint8_t loop_pdev;
  5505. struct dp_pdev *pdev;
  5506. for (loop_pdev = 0; loop_pdev < soc->pdev_count; loop_pdev++) {
  5507. pdev = soc->pdev_list[loop_pdev];
  5508. dp_init_tso_stats(pdev);
  5509. }
  5510. }
  5511. #endif /* FEATURE_TSO_STATS */