htt.h 878 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. */
  231. #define HTT_CURRENT_VERSION_MAJOR 3
  232. #define HTT_CURRENT_VERSION_MINOR 109
  233. #define HTT_NUM_TX_FRAG_DESC 1024
  234. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  235. #define HTT_CHECK_SET_VAL(field, val) \
  236. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  237. /* macros to assist in sign-extending fields from HTT messages */
  238. #define HTT_SIGN_BIT_MASK(field) \
  239. ((field ## _M + (1 << field ## _S)) >> 1)
  240. #define HTT_SIGN_BIT(_val, field) \
  241. (_val & HTT_SIGN_BIT_MASK(field))
  242. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  243. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  244. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  245. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  246. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  247. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  248. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  249. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  250. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  251. /*
  252. * TEMPORARY:
  253. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  254. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  255. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  256. * updated.
  257. */
  258. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  259. /*
  260. * TEMPORARY:
  261. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  262. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  263. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  264. * updated.
  265. */
  266. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  267. /**
  268. * htt_dbg_stats_type -
  269. * bit positions for each stats type within a stats type bitmask
  270. * The bitmask contains 24 bits.
  271. */
  272. enum htt_dbg_stats_type {
  273. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  274. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  275. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  276. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  277. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  278. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  279. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  280. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  281. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  282. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  283. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  284. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  285. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  286. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  287. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  288. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  289. /* bits 16-23 currently reserved */
  290. /* keep this last */
  291. HTT_DBG_NUM_STATS
  292. };
  293. /*=== HTT option selection TLVs ===
  294. * Certain HTT messages have alternatives or options.
  295. * For such cases, the host and target need to agree on which option to use.
  296. * Option specification TLVs can be appended to the VERSION_REQ and
  297. * VERSION_CONF messages to select options other than the default.
  298. * These TLVs are entirely optional - if they are not provided, there is a
  299. * well-defined default for each option. If they are provided, they can be
  300. * provided in any order. Each TLV can be present or absent independent of
  301. * the presence / absence of other TLVs.
  302. *
  303. * The HTT option selection TLVs use the following format:
  304. * |31 16|15 8|7 0|
  305. * |---------------------------------+----------------+----------------|
  306. * | value (payload) | length | tag |
  307. * |-------------------------------------------------------------------|
  308. * The value portion need not be only 2 bytes; it can be extended by any
  309. * integer number of 4-byte units. The total length of the TLV, including
  310. * the tag and length fields, must be a multiple of 4 bytes. The length
  311. * field specifies the total TLV size in 4-byte units. Thus, the typical
  312. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  313. * field, would store 0x1 in its length field, to show that the TLV occupies
  314. * a single 4-byte unit.
  315. */
  316. /*--- TLV header format - applies to all HTT option TLVs ---*/
  317. enum HTT_OPTION_TLV_TAGS {
  318. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  319. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  320. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  321. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  322. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  323. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  324. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  325. };
  326. #define HTT_TCL_METADATA_VER_SZ 4
  327. PREPACK struct htt_option_tlv_header_t {
  328. A_UINT8 tag;
  329. A_UINT8 length;
  330. } POSTPACK;
  331. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  332. #define HTT_OPTION_TLV_TAG_S 0
  333. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  334. #define HTT_OPTION_TLV_LENGTH_S 8
  335. /*
  336. * value0 - 16 bit value field stored in word0
  337. * The TLV's value field may be longer than 2 bytes, in which case
  338. * the remainder of the value is stored in word1, word2, etc.
  339. */
  340. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  341. #define HTT_OPTION_TLV_VALUE0_S 16
  342. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  343. do { \
  344. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  345. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  346. } while (0)
  347. #define HTT_OPTION_TLV_TAG_GET(word) \
  348. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  349. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  350. do { \
  351. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  352. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  353. } while (0)
  354. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  355. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  356. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  357. do { \
  358. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  359. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  360. } while (0)
  361. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  362. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  363. /*--- format of specific HTT option TLVs ---*/
  364. /*
  365. * HTT option TLV for specifying LL bus address size
  366. * Some chips require bus addresses used by the target to access buffers
  367. * within the host's memory to be 32 bits; others require bus addresses
  368. * used by the target to access buffers within the host's memory to be
  369. * 64 bits.
  370. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  371. * a suffix to the VERSION_CONF message to specify which bus address format
  372. * the target requires.
  373. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  374. * default to providing bus addresses to the target in 32-bit format.
  375. */
  376. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  377. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  378. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  379. };
  380. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  381. struct htt_option_tlv_header_t hdr;
  382. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  383. } POSTPACK;
  384. /*
  385. * HTT option TLV for specifying whether HL systems should indicate
  386. * over-the-air tx completion for individual frames, or should instead
  387. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  388. * requests an OTA tx completion for a particular tx frame.
  389. * This option does not apply to LL systems, where the TX_COMPL_IND
  390. * is mandatory.
  391. * This option is primarily intended for HL systems in which the tx frame
  392. * downloads over the host --> target bus are as slow as or slower than
  393. * the transmissions over the WLAN PHY. For cases where the bus is faster
  394. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  395. * and consquently will send one TX_COMPL_IND message that covers several
  396. * tx frames. For cases where the WLAN PHY is faster than the bus,
  397. * the target will end up transmitting very short A-MPDUs, and consequently
  398. * sending many TX_COMPL_IND messages, which each cover a very small number
  399. * of tx frames.
  400. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  401. * a suffix to the VERSION_REQ message to request whether the host desires to
  402. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  403. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  404. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  405. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  406. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  407. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  408. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  409. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  410. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  411. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  412. * TLV.
  413. */
  414. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  415. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  416. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  417. };
  418. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  419. struct htt_option_tlv_header_t hdr;
  420. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  421. } POSTPACK;
  422. /*
  423. * HTT option TLV for specifying how many tx queue groups the target
  424. * may establish.
  425. * This TLV specifies the maximum value the target may send in the
  426. * txq_group_id field of any TXQ_GROUP information elements sent by
  427. * the target to the host. This allows the host to pre-allocate an
  428. * appropriate number of tx queue group structs.
  429. *
  430. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  431. * a suffix to the VERSION_REQ message to specify whether the host supports
  432. * tx queue groups at all, and if so if there is any limit on the number of
  433. * tx queue groups that the host supports.
  434. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  435. * a suffix to the VERSION_CONF message. If the host has specified in the
  436. * VER_REQ message a limit on the number of tx queue groups the host can
  437. * supprt, the target shall limit its specification of the maximum tx groups
  438. * to be no larger than this host-specified limit.
  439. *
  440. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  441. * shall preallocate 4 tx queue group structs, and the target shall not
  442. * specify a txq_group_id larger than 3.
  443. */
  444. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  445. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  446. /*
  447. * values 1 through N specify the max number of tx queue groups
  448. * the sender supports
  449. */
  450. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  451. };
  452. /* TEMPORARY backwards-compatibility alias for a typo fix -
  453. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  454. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  455. * to support the old name (with the typo) until all references to the
  456. * old name are replaced with the new name.
  457. */
  458. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  459. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  460. struct htt_option_tlv_header_t hdr;
  461. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  462. } POSTPACK;
  463. /*
  464. * HTT option TLV for specifying whether the target supports an extended
  465. * version of the HTT tx descriptor. If the target provides this TLV
  466. * and specifies in the TLV that the target supports an extended version
  467. * of the HTT tx descriptor, the target must check the "extension" bit in
  468. * the HTT tx descriptor, and if the extension bit is set, to expect a
  469. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  470. * descriptor. Furthermore, the target must provide room for the HTT
  471. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  472. * This option is intended for systems where the host needs to explicitly
  473. * control the transmission parameters such as tx power for individual
  474. * tx frames.
  475. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  476. * as a suffix to the VERSION_CONF message to explicitly specify whether
  477. * the target supports the HTT tx MSDU extension descriptor.
  478. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  479. * by the host as lack of target support for the HTT tx MSDU extension
  480. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  481. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  482. * the HTT tx MSDU extension descriptor.
  483. * The host is not required to provide the HTT tx MSDU extension descriptor
  484. * just because the target supports it; the target must check the
  485. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  486. * extension descriptor is present.
  487. */
  488. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  489. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  490. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  491. };
  492. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  493. struct htt_option_tlv_header_t hdr;
  494. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  495. } POSTPACK;
  496. /*
  497. * For the tcl data command V2 and higher support added a new
  498. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  499. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  500. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  501. * HTT option TLV for specifying which version of the TCL metadata struct
  502. * should be used:
  503. * V1 -> use htt_tx_tcl_metadata struct
  504. * V2 -> use htt_tx_tcl_metadata_v2 struct
  505. * Old FW will only support V1.
  506. * New FW will support V2. New FW will still support V1, at least during
  507. * a transition period.
  508. * Similarly, old host will only support V1, and new host will support V1 + V2.
  509. *
  510. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  511. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  512. * of TCL metadata the host supports. If the host doesn't provide a
  513. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  514. * is implicitly understood that the host only supports V1.
  515. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  516. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  517. * the host shall use. The target shall only select one of the versions
  518. * supported by the host. If the target doesn't provide a
  519. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  520. * is implicitly understood that the V1 TCL metadata shall be used.
  521. */
  522. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  523. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  524. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  525. };
  526. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  527. struct htt_option_tlv_header_t hdr;
  528. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  529. } POSTPACK;
  530. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  531. HTT_OPTION_TLV_VALUE0_SET(word, value)
  532. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  533. HTT_OPTION_TLV_VALUE0_GET(word)
  534. typedef struct {
  535. union {
  536. /* BIT [11 : 0] :- tag
  537. * BIT [23 : 12] :- length
  538. * BIT [31 : 24] :- reserved
  539. */
  540. A_UINT32 tag__length;
  541. /*
  542. * The following struct is not endian-portable.
  543. * It is suitable for use within the target, which is known to be
  544. * little-endian.
  545. * The host should use the above endian-portable macros to access
  546. * the tag and length bitfields in an endian-neutral manner.
  547. */
  548. struct {
  549. A_UINT32 tag : 12, /* BIT [11 : 0] */
  550. length : 12, /* BIT [23 : 12] */
  551. reserved : 8; /* BIT [31 : 24] */
  552. };
  553. };
  554. } htt_tlv_hdr_t;
  555. /** HTT stats TLV tag values */
  556. typedef enum {
  557. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  558. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  559. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  560. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  561. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  562. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  563. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  564. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  565. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  566. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  567. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  568. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  569. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  570. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  571. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  572. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  573. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  574. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  575. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  576. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  577. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  578. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  579. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  580. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  581. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  582. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  583. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  584. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  585. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  586. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  587. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  588. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  589. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  590. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  591. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  592. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  593. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  594. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  595. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  596. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  597. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  598. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  599. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  600. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  601. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  602. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  603. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  604. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  605. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  606. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  607. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  608. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  609. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  610. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  611. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  612. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  613. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  614. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  615. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  616. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  617. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  618. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  619. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  620. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  621. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  622. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  623. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  624. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  625. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  626. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  627. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  628. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  629. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  630. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  631. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  632. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  633. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  634. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  635. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  636. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  637. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  638. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  639. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  640. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  641. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  642. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  643. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  644. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  645. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  646. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  647. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  648. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  649. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  650. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  651. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  652. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  653. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  654. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  655. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  656. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  657. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  658. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  659. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  660. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  661. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  662. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  663. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  664. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  665. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  666. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  667. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  668. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  669. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  670. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  671. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  672. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  673. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  674. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  675. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  676. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  677. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  678. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  679. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  680. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  681. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  682. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  683. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  684. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  685. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  686. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  687. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  688. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  689. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  690. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  691. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  692. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  693. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  694. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  695. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  696. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  697. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  698. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  699. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  700. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  701. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  702. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  703. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  704. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  705. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  706. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  707. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  708. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  709. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  710. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  711. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  712. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  713. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  714. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  715. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  716. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  717. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  718. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  719. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  720. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  721. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  722. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  723. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  724. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  725. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  726. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v */
  727. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  728. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v */
  729. HTT_STATS_MAX_TAG,
  730. } htt_stats_tlv_tag_t;
  731. /* retain deprecated enum name as an alias for the current enum name */
  732. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  733. #define HTT_STATS_TLV_TAG_M 0x00000fff
  734. #define HTT_STATS_TLV_TAG_S 0
  735. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  736. #define HTT_STATS_TLV_LENGTH_S 12
  737. #define HTT_STATS_TLV_TAG_GET(_var) \
  738. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  739. HTT_STATS_TLV_TAG_S)
  740. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  741. do { \
  742. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  743. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  744. } while (0)
  745. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  746. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  747. HTT_STATS_TLV_LENGTH_S)
  748. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  749. do { \
  750. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  751. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  752. } while (0)
  753. /*=== host -> target messages ===============================================*/
  754. enum htt_h2t_msg_type {
  755. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  756. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  757. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  758. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  759. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  760. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  761. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  762. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  763. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  764. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  765. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  766. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  767. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  768. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  769. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  770. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  771. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  772. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  773. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  774. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  775. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  776. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  777. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  778. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  779. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  780. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  781. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  782. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  783. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  784. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  785. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  786. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  787. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  788. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  789. /* keep this last */
  790. HTT_H2T_NUM_MSGS
  791. };
  792. /*
  793. * HTT host to target message type -
  794. * stored in bits 7:0 of the first word of the message
  795. */
  796. #define HTT_H2T_MSG_TYPE_M 0xff
  797. #define HTT_H2T_MSG_TYPE_S 0
  798. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  799. do { \
  800. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  801. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  802. } while (0)
  803. #define HTT_H2T_MSG_TYPE_GET(word) \
  804. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  805. /**
  806. * @brief host -> target version number request message definition
  807. *
  808. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  809. *
  810. *
  811. * |31 24|23 16|15 8|7 0|
  812. * |----------------+----------------+----------------+----------------|
  813. * | reserved | msg type |
  814. * |-------------------------------------------------------------------|
  815. * : option request TLV (optional) |
  816. * :...................................................................:
  817. *
  818. * The VER_REQ message may consist of a single 4-byte word, or may be
  819. * extended with TLVs that specify which HTT options the host is requesting
  820. * from the target.
  821. * The following option TLVs may be appended to the VER_REQ message:
  822. * - HL_SUPPRESS_TX_COMPL_IND
  823. * - HL_MAX_TX_QUEUE_GROUPS
  824. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  825. * may be appended to the VER_REQ message (but only one TLV of each type).
  826. *
  827. * Header fields:
  828. * - MSG_TYPE
  829. * Bits 7:0
  830. * Purpose: identifies this as a version number request message
  831. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  832. */
  833. #define HTT_VER_REQ_BYTES 4
  834. /* TBDXXX: figure out a reasonable number */
  835. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  836. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  837. /**
  838. * @brief HTT tx MSDU descriptor
  839. *
  840. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  841. *
  842. * @details
  843. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  844. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  845. * the target firmware needs for the FW's tx processing, particularly
  846. * for creating the HW msdu descriptor.
  847. * The same HTT tx descriptor is used for HL and LL systems, though
  848. * a few fields within the tx descriptor are used only by LL or
  849. * only by HL.
  850. * The HTT tx descriptor is defined in two manners: by a struct with
  851. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  852. * definitions.
  853. * The target should use the struct def, for simplicitly and clarity,
  854. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  855. * neutral. Specifically, the host shall use the get/set macros built
  856. * around the mask + shift defs.
  857. */
  858. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  859. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  860. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  861. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  862. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  863. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  864. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  865. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  866. #define HTT_TX_VDEV_ID_WORD 0
  867. #define HTT_TX_VDEV_ID_MASK 0x3f
  868. #define HTT_TX_VDEV_ID_SHIFT 16
  869. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  870. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  871. #define HTT_TX_MSDU_LEN_DWORD 1
  872. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  873. /*
  874. * HTT_VAR_PADDR macros
  875. * Allow physical / bus addresses to be either a single 32-bit value,
  876. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  877. */
  878. #define HTT_VAR_PADDR32(var_name) \
  879. A_UINT32 var_name
  880. #define HTT_VAR_PADDR64_LE(var_name) \
  881. struct { \
  882. /* little-endian: lo precedes hi */ \
  883. A_UINT32 lo; \
  884. A_UINT32 hi; \
  885. } var_name
  886. /*
  887. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  888. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  889. * addresses are stored in a XXX-bit field.
  890. * This macro is used to define both htt_tx_msdu_desc32_t and
  891. * htt_tx_msdu_desc64_t structs.
  892. */
  893. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  894. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  895. { \
  896. /* DWORD 0: flags and meta-data */ \
  897. A_UINT32 \
  898. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  899. \
  900. /* pkt_subtype - \
  901. * Detailed specification of the tx frame contents, extending the \
  902. * general specification provided by pkt_type. \
  903. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  904. * pkt_type | pkt_subtype \
  905. * ============================================================== \
  906. * 802.3 | bit 0:3 - Reserved \
  907. * | bit 4: 0x0 - Copy-Engine Classification Results \
  908. * | not appended to the HTT message \
  909. * | 0x1 - Copy-Engine Classification Results \
  910. * | appended to the HTT message in the \
  911. * | format: \
  912. * | [HTT tx desc, frame header, \
  913. * | CE classification results] \
  914. * | The CE classification results begin \
  915. * | at the next 4-byte boundary after \
  916. * | the frame header. \
  917. * ------------+------------------------------------------------- \
  918. * Eth2 | bit 0:3 - Reserved \
  919. * | bit 4: 0x0 - Copy-Engine Classification Results \
  920. * | not appended to the HTT message \
  921. * | 0x1 - Copy-Engine Classification Results \
  922. * | appended to the HTT message. \
  923. * | See the above specification of the \
  924. * | CE classification results location. \
  925. * ------------+------------------------------------------------- \
  926. * native WiFi | bit 0:3 - Reserved \
  927. * | bit 4: 0x0 - Copy-Engine Classification Results \
  928. * | not appended to the HTT message \
  929. * | 0x1 - Copy-Engine Classification Results \
  930. * | appended to the HTT message. \
  931. * | See the above specification of the \
  932. * | CE classification results location. \
  933. * ------------+------------------------------------------------- \
  934. * mgmt | 0x0 - 802.11 MAC header absent \
  935. * | 0x1 - 802.11 MAC header present \
  936. * ------------+------------------------------------------------- \
  937. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  938. * | 0x1 - 802.11 MAC header present \
  939. * | bit 1: 0x0 - allow aggregation \
  940. * | 0x1 - don't allow aggregation \
  941. * | bit 2: 0x0 - perform encryption \
  942. * | 0x1 - don't perform encryption \
  943. * | bit 3: 0x0 - perform tx classification / queuing \
  944. * | 0x1 - don't perform tx classification; \
  945. * | insert the frame into the "misc" \
  946. * | tx queue \
  947. * | bit 4: 0x0 - Copy-Engine Classification Results \
  948. * | not appended to the HTT message \
  949. * | 0x1 - Copy-Engine Classification Results \
  950. * | appended to the HTT message. \
  951. * | See the above specification of the \
  952. * | CE classification results location. \
  953. */ \
  954. pkt_subtype: 5, \
  955. \
  956. /* pkt_type - \
  957. * General specification of the tx frame contents. \
  958. * The htt_pkt_type enum should be used to specify and check the \
  959. * value of this field. \
  960. */ \
  961. pkt_type: 3, \
  962. \
  963. /* vdev_id - \
  964. * ID for the vdev that is sending this tx frame. \
  965. * For certain non-standard packet types, e.g. pkt_type == raw \
  966. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  967. * This field is used primarily for determining where to queue \
  968. * broadcast and multicast frames. \
  969. */ \
  970. vdev_id: 6, \
  971. /* ext_tid - \
  972. * The extended traffic ID. \
  973. * If the TID is unknown, the extended TID is set to \
  974. * HTT_TX_EXT_TID_INVALID. \
  975. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  976. * value of the QoS TID. \
  977. * If the tx frame is non-QoS data, then the extended TID is set to \
  978. * HTT_TX_EXT_TID_NON_QOS. \
  979. * If the tx frame is multicast or broadcast, then the extended TID \
  980. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  981. */ \
  982. ext_tid: 5, \
  983. \
  984. /* postponed - \
  985. * This flag indicates whether the tx frame has been downloaded to \
  986. * the target before but discarded by the target, and now is being \
  987. * downloaded again; or if this is a new frame that is being \
  988. * downloaded for the first time. \
  989. * This flag allows the target to determine the correct order for \
  990. * transmitting new vs. old frames. \
  991. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  992. * This flag only applies to HL systems, since in LL systems, \
  993. * the tx flow control is handled entirely within the target. \
  994. */ \
  995. postponed: 1, \
  996. \
  997. /* extension - \
  998. * This flag indicates whether a HTT tx MSDU extension descriptor \
  999. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1000. * \
  1001. * 0x0 - no extension MSDU descriptor is present \
  1002. * 0x1 - an extension MSDU descriptor immediately follows the \
  1003. * regular MSDU descriptor \
  1004. */ \
  1005. extension: 1, \
  1006. \
  1007. /* cksum_offload - \
  1008. * This flag indicates whether checksum offload is enabled or not \
  1009. * for this frame. Target FW use this flag to turn on HW checksumming \
  1010. * 0x0 - No checksum offload \
  1011. * 0x1 - L3 header checksum only \
  1012. * 0x2 - L4 checksum only \
  1013. * 0x3 - L3 header checksum + L4 checksum \
  1014. */ \
  1015. cksum_offload: 2, \
  1016. \
  1017. /* tx_comp_req - \
  1018. * This flag indicates whether Tx Completion \
  1019. * from fw is required or not. \
  1020. * This flag is only relevant if tx completion is not \
  1021. * universally enabled. \
  1022. * For all LL systems, tx completion is mandatory, \
  1023. * so this flag will be irrelevant. \
  1024. * For HL systems tx completion is optional, but HL systems in which \
  1025. * the bus throughput exceeds the WLAN throughput will \
  1026. * probably want to always use tx completion, and thus \
  1027. * would not check this flag. \
  1028. * This flag is required when tx completions are not used universally, \
  1029. * but are still required for certain tx frames for which \
  1030. * an OTA delivery acknowledgment is needed by the host. \
  1031. * In practice, this would be for HL systems in which the \
  1032. * bus throughput is less than the WLAN throughput. \
  1033. * \
  1034. * 0x0 - Tx Completion Indication from Fw not required \
  1035. * 0x1 - Tx Completion Indication from Fw is required \
  1036. */ \
  1037. tx_compl_req: 1; \
  1038. \
  1039. \
  1040. /* DWORD 1: MSDU length and ID */ \
  1041. A_UINT32 \
  1042. len: 16, /* MSDU length, in bytes */ \
  1043. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1044. * and this id is used to calculate fragmentation \
  1045. * descriptor pointer inside the target based on \
  1046. * the base address, configured inside the target. \
  1047. */ \
  1048. \
  1049. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1050. /* frags_desc_ptr - \
  1051. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1052. * where the tx frame's fragments reside in memory. \
  1053. * This field only applies to LL systems, since in HL systems the \
  1054. * (degenerate single-fragment) fragmentation descriptor is created \
  1055. * within the target. \
  1056. */ \
  1057. _paddr__frags_desc_ptr_; \
  1058. \
  1059. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1060. /* \
  1061. * Peer ID : Target can use this value to know which peer-id packet \
  1062. * destined to. \
  1063. * It's intended to be specified by host in case of NAWDS. \
  1064. */ \
  1065. A_UINT16 peerid; \
  1066. \
  1067. /* \
  1068. * Channel frequency: This identifies the desired channel \
  1069. * frequency (in mhz) for tx frames. This is used by FW to help \
  1070. * determine when it is safe to transmit or drop frames for \
  1071. * off-channel operation. \
  1072. * The default value of zero indicates to FW that the corresponding \
  1073. * VDEV's home channel (if there is one) is the desired channel \
  1074. * frequency. \
  1075. */ \
  1076. A_UINT16 chanfreq; \
  1077. \
  1078. /* Reason reserved is commented is increasing the htt structure size \
  1079. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1080. * A_UINT32 reserved_dword3_bits0_31; \
  1081. */ \
  1082. } POSTPACK
  1083. /* define a htt_tx_msdu_desc32_t type */
  1084. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1085. /* define a htt_tx_msdu_desc64_t type */
  1086. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1087. /*
  1088. * Make htt_tx_msdu_desc_t be an alias for either
  1089. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1090. */
  1091. #if HTT_PADDR64
  1092. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1093. #else
  1094. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1095. #endif
  1096. /* decriptor information for Management frame*/
  1097. /*
  1098. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1099. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1100. */
  1101. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1102. extern A_UINT32 mgmt_hdr_len;
  1103. PREPACK struct htt_mgmt_tx_desc_t {
  1104. A_UINT32 msg_type;
  1105. #if HTT_PADDR64
  1106. A_UINT64 frag_paddr; /* DMAble address of the data */
  1107. #else
  1108. A_UINT32 frag_paddr; /* DMAble address of the data */
  1109. #endif
  1110. A_UINT32 desc_id; /* returned to host during completion
  1111. * to free the meory*/
  1112. A_UINT32 len; /* Fragment length */
  1113. A_UINT32 vdev_id; /* virtual device ID*/
  1114. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1115. } POSTPACK;
  1116. PREPACK struct htt_mgmt_tx_compl_ind {
  1117. A_UINT32 desc_id;
  1118. A_UINT32 status;
  1119. } POSTPACK;
  1120. /*
  1121. * This SDU header size comes from the summation of the following:
  1122. * 1. Max of:
  1123. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1124. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1125. * b. 802.11 header, for raw frames: 36 bytes
  1126. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1127. * QoS header, HT header)
  1128. * c. 802.3 header, for ethernet frames: 14 bytes
  1129. * (destination address, source address, ethertype / length)
  1130. * 2. Max of:
  1131. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1132. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1133. * 3. 802.1Q VLAN header: 4 bytes
  1134. * 4. LLC/SNAP header: 8 bytes
  1135. */
  1136. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1137. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1138. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1139. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1140. A_COMPILE_TIME_ASSERT(
  1141. htt_encap_hdr_size_max_check_nwifi,
  1142. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1143. A_COMPILE_TIME_ASSERT(
  1144. htt_encap_hdr_size_max_check_enet,
  1145. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1146. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1147. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1148. #define HTT_TX_HDR_SIZE_802_1Q 4
  1149. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1150. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1151. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1152. HTT_TX_HDR_SIZE_802_1Q + \
  1153. HTT_TX_HDR_SIZE_LLC_SNAP)
  1154. #define HTT_HL_TX_FRM_HDR_LEN \
  1155. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1156. #define HTT_LL_TX_FRM_HDR_LEN \
  1157. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1158. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1159. /* dword 0 */
  1160. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1161. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1162. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1163. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1164. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1165. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1166. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1167. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1168. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1169. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1170. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1171. #define HTT_TX_DESC_PKT_TYPE_S 13
  1172. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1173. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1174. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1175. #define HTT_TX_DESC_VDEV_ID_S 16
  1176. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1177. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1178. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1179. #define HTT_TX_DESC_EXT_TID_S 22
  1180. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1181. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1182. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1183. #define HTT_TX_DESC_POSTPONED_S 27
  1184. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1185. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1186. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1187. #define HTT_TX_DESC_EXTENSION_S 28
  1188. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1189. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1190. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1191. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1192. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1193. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1194. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1195. #define HTT_TX_DESC_TX_COMP_S 31
  1196. /* dword 1 */
  1197. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1198. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1199. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1200. #define HTT_TX_DESC_FRM_LEN_S 0
  1201. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1202. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1203. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1204. #define HTT_TX_DESC_FRM_ID_S 16
  1205. /* dword 2 */
  1206. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1207. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1208. /* for systems using 64-bit format for bus addresses */
  1209. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1210. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1211. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1212. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1213. /* for systems using 32-bit format for bus addresses */
  1214. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1215. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1216. /* dword 3 */
  1217. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1218. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1219. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1220. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1221. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1222. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1223. #if HTT_PADDR64
  1224. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1225. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1226. #else
  1227. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1228. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1229. #endif
  1230. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1231. #define HTT_TX_DESC_PEER_ID_S 0
  1232. /*
  1233. * TEMPORARY:
  1234. * The original definitions for the PEER_ID fields contained typos
  1235. * (with _DESC_PADDR appended to this PEER_ID field name).
  1236. * Retain deprecated original names for PEER_ID fields until all code that
  1237. * refers to them has been updated.
  1238. */
  1239. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1240. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1241. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1242. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1243. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1244. HTT_TX_DESC_PEER_ID_M
  1245. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1246. HTT_TX_DESC_PEER_ID_S
  1247. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1248. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1249. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1250. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1251. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1252. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1253. #if HTT_PADDR64
  1254. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1255. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1256. #else
  1257. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1258. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1259. #endif
  1260. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1261. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1262. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1263. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1264. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1265. do { \
  1266. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1267. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1268. } while (0)
  1269. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1270. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1271. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1272. do { \
  1273. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1274. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1275. } while (0)
  1276. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1277. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1278. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1279. do { \
  1280. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1281. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1282. } while (0)
  1283. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1284. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1285. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1286. do { \
  1287. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1288. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1289. } while (0)
  1290. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1291. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1292. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1295. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1296. } while (0)
  1297. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1298. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1299. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1300. do { \
  1301. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1302. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1303. } while (0)
  1304. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1305. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1306. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1307. do { \
  1308. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1309. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1310. } while (0)
  1311. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1312. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1313. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1314. do { \
  1315. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1316. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1317. } while (0)
  1318. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1319. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1320. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1321. do { \
  1322. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1323. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1324. } while (0)
  1325. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1326. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1327. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1328. do { \
  1329. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1330. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1331. } while (0)
  1332. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1333. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1334. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1335. do { \
  1336. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1337. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1338. } while (0)
  1339. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1340. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1341. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1342. do { \
  1343. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1344. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1345. } while (0)
  1346. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1347. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1348. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1349. do { \
  1350. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1351. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1352. } while (0)
  1353. /* enums used in the HTT tx MSDU extension descriptor */
  1354. enum {
  1355. htt_tx_guard_interval_regular = 0,
  1356. htt_tx_guard_interval_short = 1,
  1357. };
  1358. enum {
  1359. htt_tx_preamble_type_ofdm = 0,
  1360. htt_tx_preamble_type_cck = 1,
  1361. htt_tx_preamble_type_ht = 2,
  1362. htt_tx_preamble_type_vht = 3,
  1363. };
  1364. enum {
  1365. htt_tx_bandwidth_5MHz = 0,
  1366. htt_tx_bandwidth_10MHz = 1,
  1367. htt_tx_bandwidth_20MHz = 2,
  1368. htt_tx_bandwidth_40MHz = 3,
  1369. htt_tx_bandwidth_80MHz = 4,
  1370. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1371. };
  1372. /**
  1373. * @brief HTT tx MSDU extension descriptor
  1374. * @details
  1375. * If the target supports HTT tx MSDU extension descriptors, the host has
  1376. * the option of appending the following struct following the regular
  1377. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1378. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1379. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1380. * tx specs for each frame.
  1381. */
  1382. PREPACK struct htt_tx_msdu_desc_ext_t {
  1383. /* DWORD 0: flags */
  1384. A_UINT32
  1385. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1386. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1387. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1388. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1389. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1390. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1391. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1392. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1393. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1394. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1395. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1396. /* DWORD 1: tx power, tx rate, tx BW */
  1397. A_UINT32
  1398. /* pwr -
  1399. * Specify what power the tx frame needs to be transmitted at.
  1400. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1401. * The value needs to be appropriately sign-extended when extracting
  1402. * the value from the message and storing it in a variable that is
  1403. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1404. * automatically handles this sign-extension.)
  1405. * If the transmission uses multiple tx chains, this power spec is
  1406. * the total transmit power, assuming incoherent combination of
  1407. * per-chain power to produce the total power.
  1408. */
  1409. pwr: 8,
  1410. /* mcs_mask -
  1411. * Specify the allowable values for MCS index (modulation and coding)
  1412. * to use for transmitting the frame.
  1413. *
  1414. * For HT / VHT preamble types, this mask directly corresponds to
  1415. * the HT or VHT MCS indices that are allowed. For each bit N set
  1416. * within the mask, MCS index N is allowed for transmitting the frame.
  1417. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1418. * rates versus OFDM rates, so the host has the option of specifying
  1419. * that the target must transmit the frame with CCK or OFDM rates
  1420. * (not HT or VHT), but leaving the decision to the target whether
  1421. * to use CCK or OFDM.
  1422. *
  1423. * For CCK and OFDM, the bits within this mask are interpreted as
  1424. * follows:
  1425. * bit 0 -> CCK 1 Mbps rate is allowed
  1426. * bit 1 -> CCK 2 Mbps rate is allowed
  1427. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1428. * bit 3 -> CCK 11 Mbps rate is allowed
  1429. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1430. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1431. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1432. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1433. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1434. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1435. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1436. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1437. *
  1438. * The MCS index specification needs to be compatible with the
  1439. * bandwidth mask specification. For example, a MCS index == 9
  1440. * specification is inconsistent with a preamble type == VHT,
  1441. * Nss == 1, and channel bandwidth == 20 MHz.
  1442. *
  1443. * Furthermore, the host has only a limited ability to specify to
  1444. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1445. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1446. */
  1447. mcs_mask: 12,
  1448. /* nss_mask -
  1449. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1450. * Each bit in this mask corresponds to a Nss value:
  1451. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1452. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1453. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1454. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1455. * The values in the Nss mask must be suitable for the recipient, e.g.
  1456. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1457. * recipient which only supports 2x2 MIMO.
  1458. */
  1459. nss_mask: 4,
  1460. /* guard_interval -
  1461. * Specify a htt_tx_guard_interval enum value to indicate whether
  1462. * the transmission should use a regular guard interval or a
  1463. * short guard interval.
  1464. */
  1465. guard_interval: 1,
  1466. /* preamble_type_mask -
  1467. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1468. * may choose from for transmitting this frame.
  1469. * The bits in this mask correspond to the values in the
  1470. * htt_tx_preamble_type enum. For example, to allow the target
  1471. * to transmit the frame as either CCK or OFDM, this field would
  1472. * be set to
  1473. * (1 << htt_tx_preamble_type_ofdm) |
  1474. * (1 << htt_tx_preamble_type_cck)
  1475. */
  1476. preamble_type_mask: 4,
  1477. reserved1_31_29: 3; /* unused, set to 0x0 */
  1478. /* DWORD 2: tx chain mask, tx retries */
  1479. A_UINT32
  1480. /* chain_mask - specify which chains to transmit from */
  1481. chain_mask: 4,
  1482. /* retry_limit -
  1483. * Specify the maximum number of transmissions, including the
  1484. * initial transmission, to attempt before giving up if no ack
  1485. * is received.
  1486. * If the tx rate is specified, then all retries shall use the
  1487. * same rate as the initial transmission.
  1488. * If no tx rate is specified, the target can choose whether to
  1489. * retain the original rate during the retransmissions, or to
  1490. * fall back to a more robust rate.
  1491. */
  1492. retry_limit: 4,
  1493. /* bandwidth_mask -
  1494. * Specify what channel widths may be used for the transmission.
  1495. * A value of zero indicates "don't care" - the target may choose
  1496. * the transmission bandwidth.
  1497. * The bits within this mask correspond to the htt_tx_bandwidth
  1498. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1499. * The bandwidth_mask must be consistent with the preamble_type_mask
  1500. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1501. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1502. */
  1503. bandwidth_mask: 6,
  1504. reserved2_31_14: 18; /* unused, set to 0x0 */
  1505. /* DWORD 3: tx expiry time (TSF) LSBs */
  1506. A_UINT32 expire_tsf_lo;
  1507. /* DWORD 4: tx expiry time (TSF) MSBs */
  1508. A_UINT32 expire_tsf_hi;
  1509. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1510. } POSTPACK;
  1511. /* DWORD 0 */
  1512. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1514. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1515. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1518. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1519. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1520. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1521. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1522. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1523. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1526. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1528. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1529. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1530. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1531. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1532. /* DWORD 1 */
  1533. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1534. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1535. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1536. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1537. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1538. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1539. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1540. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1541. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1542. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1543. /* DWORD 2 */
  1544. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1545. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1546. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1547. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1548. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1549. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1550. /* DWORD 0 */
  1551. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1552. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1553. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1554. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1555. do { \
  1556. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1557. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1558. } while (0)
  1559. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1560. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1561. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1562. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1563. do { \
  1564. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1565. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1566. } while (0)
  1567. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1568. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1569. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1570. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1571. do { \
  1572. HTT_CHECK_SET_VAL( \
  1573. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1574. ((_var) |= ((_val) \
  1575. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1576. } while (0)
  1577. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1578. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1579. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1580. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1581. do { \
  1582. HTT_CHECK_SET_VAL( \
  1583. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1584. ((_var) |= ((_val) \
  1585. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1586. } while (0)
  1587. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1588. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1589. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1590. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1591. do { \
  1592. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1593. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1594. } while (0)
  1595. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1596. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1597. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1598. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1599. do { \
  1600. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1601. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1602. } while (0)
  1603. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1604. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1605. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1606. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1607. do { \
  1608. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1609. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1610. } while (0)
  1611. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1612. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1613. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1614. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1615. do { \
  1616. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1617. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1618. } while (0)
  1619. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1620. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1621. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1622. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1623. do { \
  1624. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1625. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1626. } while (0)
  1627. /* DWORD 1 */
  1628. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1629. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1630. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1631. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1632. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1633. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1634. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1635. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1636. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1637. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1638. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1639. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1640. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1641. do { \
  1642. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1643. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1644. } while (0)
  1645. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1646. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1647. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1648. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1649. do { \
  1650. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1651. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1652. } while (0)
  1653. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1654. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1655. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1656. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1657. do { \
  1658. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1659. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1660. } while (0)
  1661. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1662. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1663. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1664. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1665. do { \
  1666. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1667. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1668. } while (0)
  1669. /* DWORD 2 */
  1670. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1671. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1672. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1673. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1674. do { \
  1675. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1676. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1677. } while (0)
  1678. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1679. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1680. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1681. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1682. do { \
  1683. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1684. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1685. } while (0)
  1686. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1687. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1688. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1689. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1690. do { \
  1691. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1692. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1693. } while (0)
  1694. typedef enum {
  1695. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1696. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1697. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1698. } htt_11ax_ltf_subtype_t;
  1699. typedef enum {
  1700. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1701. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1702. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1703. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1704. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1705. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1706. } htt_tx_ext2_preamble_type_t;
  1707. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1708. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1709. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1710. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1711. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1712. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1713. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1714. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1715. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1716. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1717. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1718. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1719. /**
  1720. * @brief HTT tx MSDU extension descriptor v2
  1721. * @details
  1722. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1723. * is received as tcl_exit_base->host_meta_info in firmware.
  1724. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1725. * are already part of tcl_exit_base.
  1726. */
  1727. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1728. /* DWORD 0: flags */
  1729. A_UINT32
  1730. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1731. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1732. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1733. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1734. valid_retries : 1, /* if set, tx retries spec is valid */
  1735. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1736. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1737. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1738. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1739. valid_key_flags : 1, /* if set, key flags is valid */
  1740. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1741. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1742. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1743. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1744. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1745. 1 = ENCRYPT,
  1746. 2 ~ 3 - Reserved */
  1747. /* retry_limit -
  1748. * Specify the maximum number of transmissions, including the
  1749. * initial transmission, to attempt before giving up if no ack
  1750. * is received.
  1751. * If the tx rate is specified, then all retries shall use the
  1752. * same rate as the initial transmission.
  1753. * If no tx rate is specified, the target can choose whether to
  1754. * retain the original rate during the retransmissions, or to
  1755. * fall back to a more robust rate.
  1756. */
  1757. retry_limit : 4,
  1758. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1759. * Valid only for 11ax preamble types HE_SU
  1760. * and HE_EXT_SU
  1761. */
  1762. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1763. * Valid only for 11ax preamble types HE_SU
  1764. * and HE_EXT_SU
  1765. */
  1766. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1767. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1768. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1769. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1770. */
  1771. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1772. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1773. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1774. * Use cases:
  1775. * Any time firmware uses TQM-BYPASS for Data
  1776. * TID, firmware expect host to set this bit.
  1777. */
  1778. /* DWORD 1: tx power, tx rate */
  1779. A_UINT32
  1780. power : 8, /* unit of the power field is 0.5 dbm
  1781. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1782. * signed value ranging from -64dbm to 63.5 dbm
  1783. */
  1784. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1785. * Setting more than one MCS isn't currently
  1786. * supported by the target (but is supported
  1787. * in the interface in case in the future
  1788. * the target supports specifications of
  1789. * a limited set of MCS values.
  1790. */
  1791. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1792. * Setting more than one Nss isn't currently
  1793. * supported by the target (but is supported
  1794. * in the interface in case in the future
  1795. * the target supports specifications of
  1796. * a limited set of Nss values.
  1797. */
  1798. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1799. update_peer_cache : 1; /* When set these custom values will be
  1800. * used for all packets, until the next
  1801. * update via this ext header.
  1802. * This is to make sure not all packets
  1803. * need to include this header.
  1804. */
  1805. /* DWORD 2: tx chain mask, tx retries */
  1806. A_UINT32
  1807. /* chain_mask - specify which chains to transmit from */
  1808. chain_mask : 8,
  1809. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1810. * TODO: Update Enum values for key_flags
  1811. */
  1812. /*
  1813. * Channel frequency: This identifies the desired channel
  1814. * frequency (in MHz) for tx frames. This is used by FW to help
  1815. * determine when it is safe to transmit or drop frames for
  1816. * off-channel operation.
  1817. * The default value of zero indicates to FW that the corresponding
  1818. * VDEV's home channel (if there is one) is the desired channel
  1819. * frequency.
  1820. */
  1821. chanfreq : 16;
  1822. /* DWORD 3: tx expiry time (TSF) LSBs */
  1823. A_UINT32 expire_tsf_lo;
  1824. /* DWORD 4: tx expiry time (TSF) MSBs */
  1825. A_UINT32 expire_tsf_hi;
  1826. /* DWORD 5: flags to control routing / processing of the MSDU */
  1827. A_UINT32
  1828. /* learning_frame
  1829. * When this flag is set, this frame will be dropped by FW
  1830. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1831. */
  1832. learning_frame : 1,
  1833. /* send_as_standalone
  1834. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1835. * i.e. with no A-MSDU or A-MPDU aggregation.
  1836. * The scope is extended to other use-cases.
  1837. */
  1838. send_as_standalone : 1,
  1839. /* is_host_opaque_valid
  1840. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1841. * with valid information.
  1842. */
  1843. is_host_opaque_valid : 1,
  1844. traffic_end_indication: 1,
  1845. rsvd0 : 28;
  1846. /* DWORD 6 : Host opaque cookie for special frames */
  1847. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1848. rsvd1 : 16;
  1849. /*
  1850. * This structure can be expanded further up to 40 bytes
  1851. * by adding further DWORDs as needed.
  1852. */
  1853. } POSTPACK;
  1854. /* DWORD 0 */
  1855. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1857. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1881. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1882. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1883. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1884. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1885. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1886. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1887. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1888. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1889. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1890. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1891. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1892. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1893. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1894. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1895. /* DWORD 1 */
  1896. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1897. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1898. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1899. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1900. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1901. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1902. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1903. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1904. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1905. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1906. /* DWORD 2 */
  1907. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1908. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1909. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1910. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1911. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1912. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1913. /* DWORD 5 */
  1914. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1915. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1916. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1918. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1919. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1920. /* DWORD 6 */
  1921. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1922. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1923. /* DWORD 0 */
  1924. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1925. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1926. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1927. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1928. do { \
  1929. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1930. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1931. } while (0)
  1932. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1933. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1934. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1935. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1936. do { \
  1937. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1938. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1939. } while (0)
  1940. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1941. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1942. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1943. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1944. do { \
  1945. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1946. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1947. } while (0)
  1948. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1949. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1950. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1951. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1952. do { \
  1953. HTT_CHECK_SET_VAL( \
  1954. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1955. ((_var) |= ((_val) \
  1956. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1957. } while (0)
  1958. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1959. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1960. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1961. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1962. do { \
  1963. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1964. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1965. } while (0)
  1966. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1967. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1968. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1969. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1970. do { \
  1971. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1972. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1973. } while (0)
  1974. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1975. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1976. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1977. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1978. do { \
  1979. HTT_CHECK_SET_VAL( \
  1980. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1981. ((_var) |= ((_val) \
  1982. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1983. } while (0)
  1984. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1985. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1986. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1987. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1988. do { \
  1989. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1990. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1991. } while (0)
  1992. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1993. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1994. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1995. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1996. do { \
  1997. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1998. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1999. } while (0)
  2000. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2001. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2002. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2003. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2004. do { \
  2005. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2006. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2007. } while (0)
  2008. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2009. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2010. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2011. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2012. do { \
  2013. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2014. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2015. } while (0)
  2016. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2017. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2018. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2019. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2020. do { \
  2021. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2022. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2023. } while (0)
  2024. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2025. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2026. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2027. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2028. do { \
  2029. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2030. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2031. } while (0)
  2032. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2033. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2034. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2035. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2036. do { \
  2037. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2038. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2039. } while (0)
  2040. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2041. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2042. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2043. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2044. do { \
  2045. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2046. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2047. } while (0)
  2048. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2049. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2050. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2051. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2052. do { \
  2053. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2054. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2055. } while (0)
  2056. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2057. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2058. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2059. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2060. do { \
  2061. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2062. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2063. } while (0)
  2064. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2065. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2066. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2067. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2068. do { \
  2069. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2070. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2071. } while (0)
  2072. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2073. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2074. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2075. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2076. do { \
  2077. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2078. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2079. } while (0)
  2080. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2081. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2082. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2083. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2084. do { \
  2085. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2086. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2087. } while (0)
  2088. /* DWORD 1 */
  2089. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2090. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2091. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2092. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2093. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2094. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2095. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2096. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2097. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2098. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2099. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2100. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2101. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2102. do { \
  2103. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2104. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2105. } while (0)
  2106. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2107. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2108. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2109. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2110. do { \
  2111. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2112. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2113. } while (0)
  2114. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2115. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2116. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2117. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2118. do { \
  2119. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2120. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2121. } while (0)
  2122. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2123. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2124. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2125. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2126. do { \
  2127. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2128. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2129. } while (0)
  2130. /* DWORD 2 */
  2131. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2132. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2133. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2134. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2135. do { \
  2136. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2137. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2138. } while (0)
  2139. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2140. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2141. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2142. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2143. do { \
  2144. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2145. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2146. } while (0)
  2147. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2148. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2149. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2150. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2151. do { \
  2152. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2153. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2154. } while (0)
  2155. /* DWORD 5 */
  2156. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2157. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2158. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2159. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2160. do { \
  2161. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2162. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2163. } while (0)
  2164. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2165. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2166. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2167. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2168. do { \
  2169. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2170. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2171. } while (0)
  2172. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2173. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2174. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2175. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2176. do { \
  2177. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2178. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2179. } while (0)
  2180. /* DWORD 6 */
  2181. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2182. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2183. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2184. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2185. do { \
  2186. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2187. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2188. } while (0)
  2189. typedef enum {
  2190. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2191. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2192. } htt_tcl_metadata_type;
  2193. /**
  2194. * @brief HTT TCL command number format
  2195. * @details
  2196. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2197. * available to firmware as tcl_exit_base->tcl_status_number.
  2198. * For regular / multicast packets host will send vdev and mac id and for
  2199. * NAWDS packets, host will send peer id.
  2200. * A_UINT32 is used to avoid endianness conversion problems.
  2201. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2202. */
  2203. typedef struct {
  2204. A_UINT32
  2205. type: 1, /* vdev_id based or peer_id based */
  2206. rsvd: 31;
  2207. } htt_tx_tcl_vdev_or_peer_t;
  2208. typedef struct {
  2209. A_UINT32
  2210. type: 1, /* vdev_id based or peer_id based */
  2211. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2212. vdev_id: 8,
  2213. pdev_id: 2,
  2214. host_inspected:1,
  2215. rsvd: 19;
  2216. } htt_tx_tcl_vdev_metadata;
  2217. typedef struct {
  2218. A_UINT32
  2219. type: 1, /* vdev_id based or peer_id based */
  2220. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2221. peer_id: 14,
  2222. rsvd: 16;
  2223. } htt_tx_tcl_peer_metadata;
  2224. PREPACK struct htt_tx_tcl_metadata {
  2225. union {
  2226. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2227. htt_tx_tcl_vdev_metadata vdev_meta;
  2228. htt_tx_tcl_peer_metadata peer_meta;
  2229. };
  2230. } POSTPACK;
  2231. /* DWORD 0 */
  2232. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2233. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2234. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2235. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2236. /* VDEV metadata */
  2237. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2238. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2239. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2240. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2241. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2242. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2243. /* PEER metadata */
  2244. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2245. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2246. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2247. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2248. HTT_TX_TCL_METADATA_TYPE_S)
  2249. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2250. do { \
  2251. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2252. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2253. } while (0)
  2254. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2255. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2256. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2257. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2258. do { \
  2259. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2260. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2261. } while (0)
  2262. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2263. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2264. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2265. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2266. do { \
  2267. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2268. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2269. } while (0)
  2270. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2271. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2272. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2273. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2274. do { \
  2275. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2276. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2277. } while (0)
  2278. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2279. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2280. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2281. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2282. do { \
  2283. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2284. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2285. } while (0)
  2286. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2287. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2288. HTT_TX_TCL_METADATA_PEER_ID_S)
  2289. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2290. do { \
  2291. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2292. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2293. } while (0)
  2294. /*------------------------------------------------------------------
  2295. * V2 Version of TCL Data Command
  2296. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2297. * MLO global_seq all flavours of TCL Data Cmd.
  2298. *-----------------------------------------------------------------*/
  2299. typedef enum {
  2300. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2301. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2302. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2303. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2304. } htt_tcl_metadata_type_v2;
  2305. /**
  2306. * @brief HTT TCL command number format
  2307. * @details
  2308. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2309. * available to firmware as tcl_exit_base->tcl_status_number.
  2310. * A_UINT32 is used to avoid endianness conversion problems.
  2311. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2312. */
  2313. typedef struct {
  2314. A_UINT32
  2315. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2316. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2317. vdev_id: 8,
  2318. pdev_id: 2,
  2319. host_inspected:1,
  2320. rsvd: 2,
  2321. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2322. } htt_tx_tcl_vdev_metadata_v2;
  2323. typedef struct {
  2324. A_UINT32
  2325. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2326. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2327. peer_id: 13,
  2328. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2329. } htt_tx_tcl_peer_metadata_v2;
  2330. typedef struct {
  2331. A_UINT32
  2332. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2333. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2334. svc_class_id: 8,
  2335. rsvd: 5,
  2336. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2337. } htt_tx_tcl_svc_class_id_metadata;
  2338. typedef struct {
  2339. A_UINT32
  2340. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2341. host_inspected: 1,
  2342. global_seq_no: 12,
  2343. rsvd: 1,
  2344. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2345. } htt_tx_tcl_global_seq_metadata;
  2346. PREPACK struct htt_tx_tcl_metadata_v2 {
  2347. union {
  2348. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2349. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2350. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2351. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2352. };
  2353. } POSTPACK;
  2354. /* DWORD 0 */
  2355. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2356. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2357. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2358. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2359. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2360. /* VDEV V2 metadata */
  2361. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2362. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2363. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2364. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2365. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2366. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2367. /* PEER V2 metadata */
  2368. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2369. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2370. /* SVC_CLASS_ID metadata */
  2371. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2372. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2373. /* Global Seq no metadata */
  2374. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2375. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2376. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2377. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2378. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2379. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2380. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2381. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2382. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2383. do { \
  2384. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2385. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2386. } while (0)
  2387. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2388. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2389. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2390. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2391. do { \
  2392. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2393. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2394. } while (0)
  2395. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2396. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2397. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2398. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2399. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2400. do { \
  2401. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2402. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2403. } while (0)
  2404. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2405. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2406. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2407. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2408. do { \
  2409. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2410. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2411. } while (0)
  2412. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2413. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2414. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2415. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2416. do { \
  2417. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2418. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2419. } while (0)
  2420. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2421. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2422. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2423. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2424. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2425. do { \
  2426. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2427. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2428. } while (0)
  2429. /*----- Get and Set V2 type field in Service Class fields ----*/
  2430. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2431. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2432. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2433. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2434. do { \
  2435. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2436. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2437. } while (0)
  2438. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2439. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2440. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2441. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2442. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2443. do { \
  2444. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2445. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2446. } while (0)
  2447. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2448. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2449. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2450. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2451. do { \
  2452. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2453. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2454. } while (0)
  2455. /*------------------------------------------------------------------
  2456. * End V2 Version of TCL Data Command
  2457. *-----------------------------------------------------------------*/
  2458. typedef enum {
  2459. HTT_TX_FW2WBM_TX_STATUS_OK,
  2460. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2461. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2462. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2463. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2464. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2465. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2466. HTT_TX_FW2WBM_TX_STATUS_MAX
  2467. } htt_tx_fw2wbm_tx_status_t;
  2468. typedef enum {
  2469. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2470. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2471. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2472. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2473. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2474. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2475. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2476. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2477. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2478. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2479. } htt_tx_fw2wbm_reinject_reason_t;
  2480. /**
  2481. * @brief HTT TX WBM Completion from firmware to host
  2482. * @details
  2483. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2484. * DWORD 3 and 4 for software based completions (Exception frames and
  2485. * TQM bypass frames)
  2486. * For software based completions, wbm_release_ring->release_source_module will
  2487. * be set to release_source_fw
  2488. */
  2489. PREPACK struct htt_tx_wbm_completion {
  2490. A_UINT32
  2491. sch_cmd_id: 24,
  2492. exception_frame: 1, /* If set, this packet was queued via exception path */
  2493. rsvd0_31_25: 7;
  2494. A_UINT32
  2495. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2496. * reception of an ACK or BA, this field indicates
  2497. * the RSSI of the received ACK or BA frame.
  2498. * When the frame is removed as result of a direct
  2499. * remove command from the SW, this field is set
  2500. * to 0x0 (which is never a valid value when real
  2501. * RSSI is available).
  2502. * Units: dB w.r.t noise floor
  2503. */
  2504. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2505. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2506. rsvd1_31_16: 16;
  2507. } POSTPACK;
  2508. /* DWORD 0 */
  2509. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2510. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2511. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2512. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2513. /* DWORD 1 */
  2514. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2515. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2516. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2517. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2518. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2519. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2520. /* DWORD 0 */
  2521. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2522. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2523. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2524. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2525. do { \
  2526. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2527. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2528. } while (0)
  2529. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2530. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2531. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2532. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2533. do { \
  2534. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2535. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2536. } while (0)
  2537. /* DWORD 1 */
  2538. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2539. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2540. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2541. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2542. do { \
  2543. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2544. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2545. } while (0)
  2546. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2547. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2548. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2549. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2550. do { \
  2551. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2552. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2553. } while (0)
  2554. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2555. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2556. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2557. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2558. do { \
  2559. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2560. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2561. } while (0)
  2562. /**
  2563. * @brief HTT TX WBM Completion from firmware to host
  2564. * @details
  2565. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2566. * (WBM) offload HW.
  2567. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2568. * For software based completions, release_source_module will
  2569. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2570. * struct wbm_release_ring and then switch to this after looking at
  2571. * release_source_module.
  2572. */
  2573. PREPACK struct htt_tx_wbm_completion_v2 {
  2574. A_UINT32
  2575. used_by_hw0; /* Refer to struct wbm_release_ring */
  2576. A_UINT32
  2577. used_by_hw1; /* Refer to struct wbm_release_ring */
  2578. A_UINT32
  2579. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2580. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2581. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2582. exception_frame: 1,
  2583. rsvd0: 12, /* For future use */
  2584. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2585. rsvd1: 1; /* For future use */
  2586. A_UINT32
  2587. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2588. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2589. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2590. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2591. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2592. */
  2593. A_UINT32
  2594. data1: 32;
  2595. A_UINT32
  2596. data2: 32;
  2597. A_UINT32
  2598. used_by_hw3; /* Refer to struct wbm_release_ring */
  2599. } POSTPACK;
  2600. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2601. /* DWORD 3 */
  2602. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2603. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2604. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2605. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2606. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2607. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2608. /* DWORD 3 */
  2609. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2610. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2611. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2612. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2613. do { \
  2614. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2615. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2616. } while (0)
  2617. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2618. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2619. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2620. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2621. do { \
  2622. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2623. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2624. } while (0)
  2625. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2626. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2627. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2628. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2629. do { \
  2630. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2631. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2632. } while (0)
  2633. /**
  2634. * @brief HTT TX WBM Completion from firmware to host (V3)
  2635. * @details
  2636. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2637. * (WBM) offload HW.
  2638. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2639. * For software based completions, release_source_module will
  2640. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2641. * struct wbm_release_ring and then switch to this after looking at
  2642. * release_source_module.
  2643. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2644. * by new generations of targets.
  2645. */
  2646. PREPACK struct htt_tx_wbm_completion_v3 {
  2647. A_UINT32
  2648. used_by_hw0; /* Refer to struct wbm_release_ring */
  2649. A_UINT32
  2650. used_by_hw1; /* Refer to struct wbm_release_ring */
  2651. A_UINT32
  2652. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2653. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2654. used_by_hw3: 15;
  2655. A_UINT32
  2656. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2657. exception_frame: 1,
  2658. rsvd0: 27; /* For future use */
  2659. A_UINT32
  2660. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2661. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2662. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2663. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2664. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2665. */
  2666. A_UINT32
  2667. data1: 32;
  2668. A_UINT32
  2669. data2: 32;
  2670. A_UINT32
  2671. rsvd1: 20,
  2672. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2673. } POSTPACK;
  2674. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2675. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2676. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2677. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2678. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2679. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2680. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2681. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2682. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2683. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2684. do { \
  2685. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2686. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2687. } while (0)
  2688. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2689. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2690. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2691. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2692. do { \
  2693. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2694. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2695. } while (0)
  2696. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2697. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2698. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2699. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2700. do { \
  2701. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2702. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2703. } while (0)
  2704. typedef enum {
  2705. TX_FRAME_TYPE_UNDEFINED = 0,
  2706. TX_FRAME_TYPE_EAPOL = 1,
  2707. } htt_tx_wbm_status_frame_type;
  2708. /**
  2709. * @brief HTT TX WBM transmit status from firmware to host
  2710. * @details
  2711. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2712. * (WBM) offload HW.
  2713. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2714. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2715. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2716. */
  2717. PREPACK struct htt_tx_wbm_transmit_status {
  2718. A_UINT32
  2719. sch_cmd_id: 24,
  2720. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2721. * reception of an ACK or BA, this field indicates
  2722. * the RSSI of the received ACK or BA frame.
  2723. * When the frame is removed as result of a direct
  2724. * remove command from the SW, this field is set
  2725. * to 0x0 (which is never a valid value when real
  2726. * RSSI is available).
  2727. * Units: dB w.r.t noise floor
  2728. */
  2729. A_UINT32
  2730. sw_peer_id: 16,
  2731. tid_num: 5,
  2732. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2733. * and tid_num fields contain valid data.
  2734. * If this "valid" flag is not set, the
  2735. * sw_peer_id and tid_num fields must be ignored.
  2736. */
  2737. mcast: 1,
  2738. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2739. * contains valid data.
  2740. */
  2741. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2742. reserved: 4;
  2743. A_UINT32
  2744. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2745. * packets in the wbm completion path
  2746. */
  2747. } POSTPACK;
  2748. /* DWORD 4 */
  2749. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2750. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2751. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2752. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2753. /* DWORD 5 */
  2754. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2755. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2756. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2757. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2758. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2759. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2760. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2761. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2762. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2763. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2764. /* DWORD 4 */
  2765. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2766. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2767. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2768. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2769. do { \
  2770. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2771. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2772. } while (0)
  2773. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2774. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2775. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2776. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2777. do { \
  2778. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2779. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2780. } while (0)
  2781. /* DWORD 5 */
  2782. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2783. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2784. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2785. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2786. do { \
  2787. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2788. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2789. } while (0)
  2790. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2791. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2792. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2793. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2794. do { \
  2795. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2796. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2797. } while (0)
  2798. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2799. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2800. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2801. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2802. do { \
  2803. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2804. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2805. } while (0)
  2806. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2807. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2808. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2809. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2810. do { \
  2811. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2812. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2813. } while (0)
  2814. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2815. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2816. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2817. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2818. do { \
  2819. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2820. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2821. } while (0)
  2822. /**
  2823. * @brief HTT TX WBM reinject status from firmware to host
  2824. * @details
  2825. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2826. * (WBM) offload HW.
  2827. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2828. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2829. */
  2830. PREPACK struct htt_tx_wbm_reinject_status {
  2831. A_UINT32
  2832. reserved0: 32;
  2833. A_UINT32
  2834. reserved1: 32;
  2835. A_UINT32
  2836. reserved2: 32;
  2837. } POSTPACK;
  2838. /**
  2839. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2840. * @details
  2841. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2842. * (WBM) offload HW.
  2843. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2844. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2845. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2846. * STA side.
  2847. */
  2848. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2849. A_UINT32
  2850. mec_sa_addr_31_0;
  2851. A_UINT32
  2852. mec_sa_addr_47_32: 16,
  2853. sa_ast_index: 16;
  2854. A_UINT32
  2855. vdev_id: 8,
  2856. reserved0: 24;
  2857. } POSTPACK;
  2858. /* DWORD 4 - mec_sa_addr_31_0 */
  2859. /* DWORD 5 */
  2860. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2861. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2862. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2863. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2864. /* DWORD 6 */
  2865. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2866. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2867. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2868. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2869. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2870. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2871. do { \
  2872. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2873. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2874. } while (0)
  2875. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2876. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2877. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2878. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2879. do { \
  2880. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2881. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2882. } while (0)
  2883. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2884. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2885. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2886. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2887. do { \
  2888. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2889. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2890. } while (0)
  2891. typedef enum {
  2892. TX_FLOW_PRIORITY_BE,
  2893. TX_FLOW_PRIORITY_HIGH,
  2894. TX_FLOW_PRIORITY_LOW,
  2895. } htt_tx_flow_priority_t;
  2896. typedef enum {
  2897. TX_FLOW_LATENCY_SENSITIVE,
  2898. TX_FLOW_LATENCY_INSENSITIVE,
  2899. } htt_tx_flow_latency_t;
  2900. typedef enum {
  2901. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2902. TX_FLOW_INTERACTIVE_TRAFFIC,
  2903. TX_FLOW_PERIODIC_TRAFFIC,
  2904. TX_FLOW_BURSTY_TRAFFIC,
  2905. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2906. } htt_tx_flow_traffic_pattern_t;
  2907. /**
  2908. * @brief HTT TX Flow search metadata format
  2909. * @details
  2910. * Host will set this metadata in flow table's flow search entry along with
  2911. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2912. * firmware and TQM ring if the flow search entry wins.
  2913. * This metadata is available to firmware in that first MSDU's
  2914. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2915. * to one of the available flows for specific tid and returns the tqm flow
  2916. * pointer as part of htt_tx_map_flow_info message.
  2917. */
  2918. PREPACK struct htt_tx_flow_metadata {
  2919. A_UINT32
  2920. rsvd0_1_0: 2,
  2921. tid: 4,
  2922. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2923. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2924. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2925. * Else choose final tid based on latency, priority.
  2926. */
  2927. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2928. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2929. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2930. } POSTPACK;
  2931. /* DWORD 0 */
  2932. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2933. #define HTT_TX_FLOW_METADATA_TID_S 2
  2934. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2935. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2936. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2937. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2938. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2939. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2940. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2941. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2942. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2943. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2944. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2945. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2946. /* DWORD 0 */
  2947. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2948. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2949. HTT_TX_FLOW_METADATA_TID_S)
  2950. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2951. do { \
  2952. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2953. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2954. } while (0)
  2955. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2956. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2957. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2958. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2959. do { \
  2960. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2961. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2962. } while (0)
  2963. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2964. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2965. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2966. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2967. do { \
  2968. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2969. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2970. } while (0)
  2971. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2972. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2973. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2974. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2975. do { \
  2976. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2977. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2978. } while (0)
  2979. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2980. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2981. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2982. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2983. do { \
  2984. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2985. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2986. } while (0)
  2987. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2988. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2989. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2990. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2991. do { \
  2992. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2993. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2994. } while (0)
  2995. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2996. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2997. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2998. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2999. do { \
  3000. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3001. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3002. } while (0)
  3003. /**
  3004. * @brief host -> target ADD WDS Entry
  3005. *
  3006. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3007. *
  3008. * @brief host -> target DELETE WDS Entry
  3009. *
  3010. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3011. *
  3012. * @details
  3013. * HTT wds entry from source port learning
  3014. * Host will learn wds entries from rx and send this message to firmware
  3015. * to enable firmware to configure/delete AST entries for wds clients.
  3016. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3017. * and when SA's entry is deleted, firmware removes this AST entry
  3018. *
  3019. * The message would appear as follows:
  3020. *
  3021. * |31 30|29 |17 16|15 8|7 0|
  3022. * |----------------+----------------+----------------+----------------|
  3023. * | rsvd0 |PDVID| vdev_id | msg_type |
  3024. * |-------------------------------------------------------------------|
  3025. * | sa_addr_31_0 |
  3026. * |-------------------------------------------------------------------|
  3027. * | | ta_peer_id | sa_addr_47_32 |
  3028. * |-------------------------------------------------------------------|
  3029. * Where PDVID = pdev_id
  3030. *
  3031. * The message is interpreted as follows:
  3032. *
  3033. * dword0 - b'0:7 - msg_type: This will be set to
  3034. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3035. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3036. *
  3037. * dword0 - b'8:15 - vdev_id
  3038. *
  3039. * dword0 - b'16:17 - pdev_id
  3040. *
  3041. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3042. *
  3043. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3044. *
  3045. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3046. *
  3047. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3048. */
  3049. PREPACK struct htt_wds_entry {
  3050. A_UINT32
  3051. msg_type: 8,
  3052. vdev_id: 8,
  3053. pdev_id: 2,
  3054. rsvd0: 14;
  3055. A_UINT32 sa_addr_31_0;
  3056. A_UINT32
  3057. sa_addr_47_32: 16,
  3058. ta_peer_id: 14,
  3059. rsvd2: 2;
  3060. } POSTPACK;
  3061. /* DWORD 0 */
  3062. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3063. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3064. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3065. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3066. /* DWORD 2 */
  3067. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3068. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3069. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3070. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3071. /* DWORD 0 */
  3072. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3073. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3074. HTT_WDS_ENTRY_VDEV_ID_S)
  3075. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3076. do { \
  3077. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3078. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3079. } while (0)
  3080. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3081. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3082. HTT_WDS_ENTRY_PDEV_ID_S)
  3083. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3084. do { \
  3085. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3086. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3087. } while (0)
  3088. /* DWORD 2 */
  3089. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3090. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3091. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3092. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3093. do { \
  3094. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3095. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3096. } while (0)
  3097. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3098. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3099. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3100. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3101. do { \
  3102. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3103. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3104. } while (0)
  3105. /**
  3106. * @brief MAC DMA rx ring setup specification
  3107. *
  3108. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3109. *
  3110. * @details
  3111. * To allow for dynamic rx ring reconfiguration and to avoid race
  3112. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3113. * it uses. Instead, it sends this message to the target, indicating how
  3114. * the rx ring used by the host should be set up and maintained.
  3115. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3116. * specifications.
  3117. *
  3118. * |31 16|15 8|7 0|
  3119. * |---------------------------------------------------------------|
  3120. * header: | reserved | num rings | msg type |
  3121. * |---------------------------------------------------------------|
  3122. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3123. #if HTT_PADDR64
  3124. * | FW_IDX shadow register physical address (bits 63:32) |
  3125. #endif
  3126. * |---------------------------------------------------------------|
  3127. * | rx ring base physical address (bits 31:0) |
  3128. #if HTT_PADDR64
  3129. * | rx ring base physical address (bits 63:32) |
  3130. #endif
  3131. * |---------------------------------------------------------------|
  3132. * | rx ring buffer size | rx ring length |
  3133. * |---------------------------------------------------------------|
  3134. * | FW_IDX initial value | enabled flags |
  3135. * |---------------------------------------------------------------|
  3136. * | MSDU payload offset | 802.11 header offset |
  3137. * |---------------------------------------------------------------|
  3138. * | PPDU end offset | PPDU start offset |
  3139. * |---------------------------------------------------------------|
  3140. * | MPDU end offset | MPDU start offset |
  3141. * |---------------------------------------------------------------|
  3142. * | MSDU end offset | MSDU start offset |
  3143. * |---------------------------------------------------------------|
  3144. * | frag info offset | rx attention offset |
  3145. * |---------------------------------------------------------------|
  3146. * payload 2, if present, has the same format as payload 1
  3147. * Header fields:
  3148. * - MSG_TYPE
  3149. * Bits 7:0
  3150. * Purpose: identifies this as an rx ring configuration message
  3151. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3152. * - NUM_RINGS
  3153. * Bits 15:8
  3154. * Purpose: indicates whether the host is setting up one rx ring or two
  3155. * Value: 1 or 2
  3156. * Payload:
  3157. * for systems using 64-bit format for bus addresses:
  3158. * - IDX_SHADOW_REG_PADDR_LO
  3159. * Bits 31:0
  3160. * Value: lower 4 bytes of physical address of the host's
  3161. * FW_IDX shadow register
  3162. * - IDX_SHADOW_REG_PADDR_HI
  3163. * Bits 31:0
  3164. * Value: upper 4 bytes of physical address of the host's
  3165. * FW_IDX shadow register
  3166. * - RING_BASE_PADDR_LO
  3167. * Bits 31:0
  3168. * Value: lower 4 bytes of physical address of the host's rx ring
  3169. * - RING_BASE_PADDR_HI
  3170. * Bits 31:0
  3171. * Value: uppper 4 bytes of physical address of the host's rx ring
  3172. * for systems using 32-bit format for bus addresses:
  3173. * - IDX_SHADOW_REG_PADDR
  3174. * Bits 31:0
  3175. * Value: physical address of the host's FW_IDX shadow register
  3176. * - RING_BASE_PADDR
  3177. * Bits 31:0
  3178. * Value: physical address of the host's rx ring
  3179. * - RING_LEN
  3180. * Bits 15:0
  3181. * Value: number of elements in the rx ring
  3182. * - RING_BUF_SZ
  3183. * Bits 31:16
  3184. * Value: size of the buffers referenced by the rx ring, in byte units
  3185. * - ENABLED_FLAGS
  3186. * Bits 15:0
  3187. * Value: 1-bit flags to show whether different rx fields are enabled
  3188. * bit 0: 802.11 header enabled (1) or disabled (0)
  3189. * bit 1: MSDU payload enabled (1) or disabled (0)
  3190. * bit 2: PPDU start enabled (1) or disabled (0)
  3191. * bit 3: PPDU end enabled (1) or disabled (0)
  3192. * bit 4: MPDU start enabled (1) or disabled (0)
  3193. * bit 5: MPDU end enabled (1) or disabled (0)
  3194. * bit 6: MSDU start enabled (1) or disabled (0)
  3195. * bit 7: MSDU end enabled (1) or disabled (0)
  3196. * bit 8: rx attention enabled (1) or disabled (0)
  3197. * bit 9: frag info enabled (1) or disabled (0)
  3198. * bit 10: unicast rx enabled (1) or disabled (0)
  3199. * bit 11: multicast rx enabled (1) or disabled (0)
  3200. * bit 12: ctrl rx enabled (1) or disabled (0)
  3201. * bit 13: mgmt rx enabled (1) or disabled (0)
  3202. * bit 14: null rx enabled (1) or disabled (0)
  3203. * bit 15: phy data rx enabled (1) or disabled (0)
  3204. * - IDX_INIT_VAL
  3205. * Bits 31:16
  3206. * Purpose: Specify the initial value for the FW_IDX.
  3207. * Value: the number of buffers initially present in the host's rx ring
  3208. * - OFFSET_802_11_HDR
  3209. * Bits 15:0
  3210. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3211. * - OFFSET_MSDU_PAYLOAD
  3212. * Bits 31:16
  3213. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3214. * - OFFSET_PPDU_START
  3215. * Bits 15:0
  3216. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3217. * - OFFSET_PPDU_END
  3218. * Bits 31:16
  3219. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3220. * - OFFSET_MPDU_START
  3221. * Bits 15:0
  3222. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3223. * - OFFSET_MPDU_END
  3224. * Bits 31:16
  3225. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3226. * - OFFSET_MSDU_START
  3227. * Bits 15:0
  3228. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3229. * - OFFSET_MSDU_END
  3230. * Bits 31:16
  3231. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3232. * - OFFSET_RX_ATTN
  3233. * Bits 15:0
  3234. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3235. * - OFFSET_FRAG_INFO
  3236. * Bits 31:16
  3237. * Value: offset in QUAD-bytes of frag info table
  3238. */
  3239. /* header fields */
  3240. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3241. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3242. /* payload fields */
  3243. /* for systems using a 64-bit format for bus addresses */
  3244. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3245. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3246. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3247. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3248. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3249. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3250. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3251. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3252. /* for systems using a 32-bit format for bus addresses */
  3253. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3254. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3255. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3256. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3257. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3258. #define HTT_RX_RING_CFG_LEN_S 0
  3259. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3260. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3261. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3262. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3263. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3264. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3265. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3266. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3267. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3268. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3269. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3270. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3271. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3272. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3273. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3274. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3275. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3276. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3277. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3278. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3279. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3280. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3281. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3282. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3283. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3284. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3285. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3286. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3287. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3288. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3289. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3290. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3291. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3292. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3293. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3294. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3295. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3296. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3297. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3298. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3299. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3300. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3301. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3302. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3303. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3304. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3305. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3306. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3307. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3308. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3309. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3310. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3311. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3312. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3313. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3314. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3315. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3316. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3317. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3318. #if HTT_PADDR64
  3319. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3320. #else
  3321. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3322. #endif
  3323. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3324. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3325. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3326. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3327. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3328. do { \
  3329. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3330. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3331. } while (0)
  3332. /* degenerate case for 32-bit fields */
  3333. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3334. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3335. ((_var) = (_val))
  3336. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3337. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3338. ((_var) = (_val))
  3339. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3340. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3341. ((_var) = (_val))
  3342. /* degenerate case for 32-bit fields */
  3343. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3344. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3345. ((_var) = (_val))
  3346. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3347. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3348. ((_var) = (_val))
  3349. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3350. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3351. ((_var) = (_val))
  3352. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3353. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3354. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3355. do { \
  3356. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3357. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3358. } while (0)
  3359. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3360. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3361. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3362. do { \
  3363. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3364. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3365. } while (0)
  3366. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3367. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3368. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3369. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3370. do { \
  3371. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3372. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3373. } while (0)
  3374. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3375. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3376. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3377. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3378. do { \
  3379. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3380. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3381. } while (0)
  3382. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3383. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3384. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3385. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3386. do { \
  3387. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3388. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3389. } while (0)
  3390. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3391. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3392. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3393. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3394. do { \
  3395. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3396. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3397. } while (0)
  3398. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3399. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3400. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3401. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3402. do { \
  3403. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3404. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3405. } while (0)
  3406. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3407. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3408. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3409. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3410. do { \
  3411. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3412. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3413. } while (0)
  3414. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3415. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3416. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3417. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3418. do { \
  3419. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3420. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3421. } while (0)
  3422. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3423. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3424. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3425. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3426. do { \
  3427. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3428. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3429. } while (0)
  3430. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3431. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3432. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3433. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3434. do { \
  3435. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3436. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3437. } while (0)
  3438. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3439. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3440. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3441. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3442. do { \
  3443. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3444. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3445. } while (0)
  3446. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3447. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3448. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3449. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3450. do { \
  3451. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3452. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3453. } while (0)
  3454. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3455. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3456. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3457. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3458. do { \
  3459. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3460. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3461. } while (0)
  3462. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3463. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3464. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3465. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3466. do { \
  3467. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3468. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3469. } while (0)
  3470. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3471. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3472. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3473. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3474. do { \
  3475. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3476. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3477. } while (0)
  3478. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3479. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3480. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3481. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3482. do { \
  3483. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3484. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3485. } while (0)
  3486. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3487. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3488. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3489. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3490. do { \
  3491. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3492. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3493. } while (0)
  3494. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3495. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3496. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3497. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3498. do { \
  3499. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3500. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3501. } while (0)
  3502. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3503. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3504. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3505. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3506. do { \
  3507. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3508. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3509. } while (0)
  3510. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3511. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3512. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3513. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3514. do { \
  3515. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3516. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3517. } while (0)
  3518. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3519. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3520. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3521. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3522. do { \
  3523. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3524. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3525. } while (0)
  3526. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3527. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3528. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3529. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3530. do { \
  3531. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3532. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3533. } while (0)
  3534. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3535. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3536. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3537. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3538. do { \
  3539. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3540. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3541. } while (0)
  3542. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3543. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3544. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3545. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3546. do { \
  3547. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3548. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3549. } while (0)
  3550. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3551. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3552. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3553. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3554. do { \
  3555. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3556. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3557. } while (0)
  3558. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3559. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3560. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3561. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3562. do { \
  3563. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3564. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3565. } while (0)
  3566. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3567. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3568. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3569. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3570. do { \
  3571. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3572. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3573. } while (0)
  3574. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3575. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3576. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3577. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3578. do { \
  3579. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3580. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3581. } while (0)
  3582. /**
  3583. * @brief host -> target FW statistics retrieve
  3584. *
  3585. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3586. *
  3587. * @details
  3588. * The following field definitions describe the format of the HTT host
  3589. * to target FW stats retrieve message. The message specifies the type of
  3590. * stats host wants to retrieve.
  3591. *
  3592. * |31 24|23 16|15 8|7 0|
  3593. * |-----------------------------------------------------------|
  3594. * | stats types request bitmask | msg type |
  3595. * |-----------------------------------------------------------|
  3596. * | stats types reset bitmask | reserved |
  3597. * |-----------------------------------------------------------|
  3598. * | stats type | config value |
  3599. * |-----------------------------------------------------------|
  3600. * | cookie LSBs |
  3601. * |-----------------------------------------------------------|
  3602. * | cookie MSBs |
  3603. * |-----------------------------------------------------------|
  3604. * Header fields:
  3605. * - MSG_TYPE
  3606. * Bits 7:0
  3607. * Purpose: identifies this is a stats upload request message
  3608. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3609. * - UPLOAD_TYPES
  3610. * Bits 31:8
  3611. * Purpose: identifies which types of FW statistics to upload
  3612. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3613. * - RESET_TYPES
  3614. * Bits 31:8
  3615. * Purpose: identifies which types of FW statistics to reset
  3616. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3617. * - CFG_VAL
  3618. * Bits 23:0
  3619. * Purpose: give an opaque configuration value to the specified stats type
  3620. * Value: stats-type specific configuration value
  3621. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3622. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3623. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3624. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3625. * - CFG_STAT_TYPE
  3626. * Bits 31:24
  3627. * Purpose: specify which stats type (if any) the config value applies to
  3628. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3629. * a valid configuration specification
  3630. * - COOKIE_LSBS
  3631. * Bits 31:0
  3632. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3633. * message with its preceding host->target stats request message.
  3634. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3635. * - COOKIE_MSBS
  3636. * Bits 31:0
  3637. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3638. * message with its preceding host->target stats request message.
  3639. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3640. */
  3641. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3642. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3643. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3644. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3645. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3646. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3647. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3648. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3649. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3650. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3651. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3652. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3653. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3654. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3655. do { \
  3656. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3657. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3658. } while (0)
  3659. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3660. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3661. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3662. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3663. do { \
  3664. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3665. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3666. } while (0)
  3667. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3668. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3669. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3670. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3671. do { \
  3672. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3673. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3674. } while (0)
  3675. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3676. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3677. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3678. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3679. do { \
  3680. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3681. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3682. } while (0)
  3683. /**
  3684. * @brief host -> target HTT out-of-band sync request
  3685. *
  3686. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3687. *
  3688. * @details
  3689. * The HTT SYNC tells the target to suspend processing of subsequent
  3690. * HTT host-to-target messages until some other target agent locally
  3691. * informs the target HTT FW that the current sync counter is equal to
  3692. * or greater than (in a modulo sense) the sync counter specified in
  3693. * the SYNC message.
  3694. * This allows other host-target components to synchronize their operation
  3695. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3696. * security key has been downloaded to and activated by the target.
  3697. * In the absence of any explicit synchronization counter value
  3698. * specification, the target HTT FW will use zero as the default current
  3699. * sync value.
  3700. *
  3701. * |31 24|23 16|15 8|7 0|
  3702. * |-----------------------------------------------------------|
  3703. * | reserved | sync count | msg type |
  3704. * |-----------------------------------------------------------|
  3705. * Header fields:
  3706. * - MSG_TYPE
  3707. * Bits 7:0
  3708. * Purpose: identifies this as a sync message
  3709. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3710. * - SYNC_COUNT
  3711. * Bits 15:8
  3712. * Purpose: specifies what sync value the HTT FW will wait for from
  3713. * an out-of-band specification to resume its operation
  3714. * Value: in-band sync counter value to compare against the out-of-band
  3715. * counter spec.
  3716. * The HTT target FW will suspend its host->target message processing
  3717. * as long as
  3718. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3719. */
  3720. #define HTT_H2T_SYNC_MSG_SZ 4
  3721. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3722. #define HTT_H2T_SYNC_COUNT_S 8
  3723. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3724. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3725. HTT_H2T_SYNC_COUNT_S)
  3726. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3727. do { \
  3728. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3729. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3730. } while (0)
  3731. /**
  3732. * @brief host -> target HTT aggregation configuration
  3733. *
  3734. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3735. */
  3736. #define HTT_AGGR_CFG_MSG_SZ 4
  3737. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3738. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3739. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3740. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3741. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3742. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3743. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3744. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3745. do { \
  3746. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3747. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3748. } while (0)
  3749. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3750. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3751. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3752. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3753. do { \
  3754. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3755. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3756. } while (0)
  3757. /**
  3758. * @brief host -> target HTT configure max amsdu info per vdev
  3759. *
  3760. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3761. *
  3762. * @details
  3763. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3764. *
  3765. * |31 21|20 16|15 8|7 0|
  3766. * |-----------------------------------------------------------|
  3767. * | reserved | vdev id | max amsdu | msg type |
  3768. * |-----------------------------------------------------------|
  3769. * Header fields:
  3770. * - MSG_TYPE
  3771. * Bits 7:0
  3772. * Purpose: identifies this as a aggr cfg ex message
  3773. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3774. * - MAX_NUM_AMSDU_SUBFRM
  3775. * Bits 15:8
  3776. * Purpose: max MSDUs per A-MSDU
  3777. * - VDEV_ID
  3778. * Bits 20:16
  3779. * Purpose: ID of the vdev to which this limit is applied
  3780. */
  3781. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3782. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3783. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3784. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3785. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3786. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3787. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3788. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3789. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3790. do { \
  3791. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3792. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3793. } while (0)
  3794. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3795. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3796. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3797. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3798. do { \
  3799. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3800. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3801. } while (0)
  3802. /**
  3803. * @brief HTT WDI_IPA Config Message
  3804. *
  3805. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3806. *
  3807. * @details
  3808. * The HTT WDI_IPA config message is created/sent by host at driver
  3809. * init time. It contains information about data structures used on
  3810. * WDI_IPA TX and RX path.
  3811. * TX CE ring is used for pushing packet metadata from IPA uC
  3812. * to WLAN FW
  3813. * TX Completion ring is used for generating TX completions from
  3814. * WLAN FW to IPA uC
  3815. * RX Indication ring is used for indicating RX packets from FW
  3816. * to IPA uC
  3817. * RX Ring2 is used as either completion ring or as second
  3818. * indication ring. when Ring2 is used as completion ring, IPA uC
  3819. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3820. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3821. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3822. * indicated in RX Indication ring. Please see WDI_IPA specification
  3823. * for more details.
  3824. * |31 24|23 16|15 8|7 0|
  3825. * |----------------+----------------+----------------+----------------|
  3826. * | tx pkt pool size | Rsvd | msg_type |
  3827. * |-------------------------------------------------------------------|
  3828. * | tx comp ring base (bits 31:0) |
  3829. #if HTT_PADDR64
  3830. * | tx comp ring base (bits 63:32) |
  3831. #endif
  3832. * |-------------------------------------------------------------------|
  3833. * | tx comp ring size |
  3834. * |-------------------------------------------------------------------|
  3835. * | tx comp WR_IDX physical address (bits 31:0) |
  3836. #if HTT_PADDR64
  3837. * | tx comp WR_IDX physical address (bits 63:32) |
  3838. #endif
  3839. * |-------------------------------------------------------------------|
  3840. * | tx CE WR_IDX physical address (bits 31:0) |
  3841. #if HTT_PADDR64
  3842. * | tx CE WR_IDX physical address (bits 63:32) |
  3843. #endif
  3844. * |-------------------------------------------------------------------|
  3845. * | rx indication ring base (bits 31:0) |
  3846. #if HTT_PADDR64
  3847. * | rx indication ring base (bits 63:32) |
  3848. #endif
  3849. * |-------------------------------------------------------------------|
  3850. * | rx indication ring size |
  3851. * |-------------------------------------------------------------------|
  3852. * | rx ind RD_IDX physical address (bits 31:0) |
  3853. #if HTT_PADDR64
  3854. * | rx ind RD_IDX physical address (bits 63:32) |
  3855. #endif
  3856. * |-------------------------------------------------------------------|
  3857. * | rx ind WR_IDX physical address (bits 31:0) |
  3858. #if HTT_PADDR64
  3859. * | rx ind WR_IDX physical address (bits 63:32) |
  3860. #endif
  3861. * |-------------------------------------------------------------------|
  3862. * |-------------------------------------------------------------------|
  3863. * | rx ring2 base (bits 31:0) |
  3864. #if HTT_PADDR64
  3865. * | rx ring2 base (bits 63:32) |
  3866. #endif
  3867. * |-------------------------------------------------------------------|
  3868. * | rx ring2 size |
  3869. * |-------------------------------------------------------------------|
  3870. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3871. #if HTT_PADDR64
  3872. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3873. #endif
  3874. * |-------------------------------------------------------------------|
  3875. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3876. #if HTT_PADDR64
  3877. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3878. #endif
  3879. * |-------------------------------------------------------------------|
  3880. *
  3881. * Header fields:
  3882. * Header fields:
  3883. * - MSG_TYPE
  3884. * Bits 7:0
  3885. * Purpose: Identifies this as WDI_IPA config message
  3886. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3887. * - TX_PKT_POOL_SIZE
  3888. * Bits 15:0
  3889. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3890. * WDI_IPA TX path
  3891. * For systems using 32-bit format for bus addresses:
  3892. * - TX_COMP_RING_BASE_ADDR
  3893. * Bits 31:0
  3894. * Purpose: TX Completion Ring base address in DDR
  3895. * - TX_COMP_RING_SIZE
  3896. * Bits 31:0
  3897. * Purpose: TX Completion Ring size (must be power of 2)
  3898. * - TX_COMP_WR_IDX_ADDR
  3899. * Bits 31:0
  3900. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3901. * updates the Write Index for WDI_IPA TX completion ring
  3902. * - TX_CE_WR_IDX_ADDR
  3903. * Bits 31:0
  3904. * Purpose: DDR address where IPA uC
  3905. * updates the WR Index for TX CE ring
  3906. * (needed for fusion platforms)
  3907. * - RX_IND_RING_BASE_ADDR
  3908. * Bits 31:0
  3909. * Purpose: RX Indication Ring base address in DDR
  3910. * - RX_IND_RING_SIZE
  3911. * Bits 31:0
  3912. * Purpose: RX Indication Ring size
  3913. * - RX_IND_RD_IDX_ADDR
  3914. * Bits 31:0
  3915. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3916. * RX indication ring
  3917. * - RX_IND_WR_IDX_ADDR
  3918. * Bits 31:0
  3919. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3920. * updates the Write Index for WDI_IPA RX indication ring
  3921. * - RX_RING2_BASE_ADDR
  3922. * Bits 31:0
  3923. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3924. * - RX_RING2_SIZE
  3925. * Bits 31:0
  3926. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3927. * - RX_RING2_RD_IDX_ADDR
  3928. * Bits 31:0
  3929. * Purpose: If Second RX ring is Indication ring, DDR address where
  3930. * IPA uC updates the Read Index for Ring2.
  3931. * If Second RX ring is completion ring, this is NOT used
  3932. * - RX_RING2_WR_IDX_ADDR
  3933. * Bits 31:0
  3934. * Purpose: If Second RX ring is Indication ring, DDR address where
  3935. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3936. * If second RX ring is completion ring, DDR address where
  3937. * IPA uC updates the Write Index for Ring 2.
  3938. * For systems using 64-bit format for bus addresses:
  3939. * - TX_COMP_RING_BASE_ADDR_LO
  3940. * Bits 31:0
  3941. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3942. * - TX_COMP_RING_BASE_ADDR_HI
  3943. * Bits 31:0
  3944. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3945. * - TX_COMP_RING_SIZE
  3946. * Bits 31:0
  3947. * Purpose: TX Completion Ring size (must be power of 2)
  3948. * - TX_COMP_WR_IDX_ADDR_LO
  3949. * Bits 31:0
  3950. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3951. * Lower 4 bytes of DDR address where WIFI FW
  3952. * updates the Write Index for WDI_IPA TX completion ring
  3953. * - TX_COMP_WR_IDX_ADDR_HI
  3954. * Bits 31:0
  3955. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3956. * Higher 4 bytes of DDR address where WIFI FW
  3957. * updates the Write Index for WDI_IPA TX completion ring
  3958. * - TX_CE_WR_IDX_ADDR_LO
  3959. * Bits 31:0
  3960. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3961. * updates the WR Index for TX CE ring
  3962. * (needed for fusion platforms)
  3963. * - TX_CE_WR_IDX_ADDR_HI
  3964. * Bits 31:0
  3965. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3966. * updates the WR Index for TX CE ring
  3967. * (needed for fusion platforms)
  3968. * - RX_IND_RING_BASE_ADDR_LO
  3969. * Bits 31:0
  3970. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3971. * - RX_IND_RING_BASE_ADDR_HI
  3972. * Bits 31:0
  3973. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3974. * - RX_IND_RING_SIZE
  3975. * Bits 31:0
  3976. * Purpose: RX Indication Ring size
  3977. * - RX_IND_RD_IDX_ADDR_LO
  3978. * Bits 31:0
  3979. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3980. * for WDI_IPA RX indication ring
  3981. * - RX_IND_RD_IDX_ADDR_HI
  3982. * Bits 31:0
  3983. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3984. * for WDI_IPA RX indication ring
  3985. * - RX_IND_WR_IDX_ADDR_LO
  3986. * Bits 31:0
  3987. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3988. * Lower 4 bytes of DDR address where WIFI FW
  3989. * updates the Write Index for WDI_IPA RX indication ring
  3990. * - RX_IND_WR_IDX_ADDR_HI
  3991. * Bits 31:0
  3992. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3993. * Higher 4 bytes of DDR address where WIFI FW
  3994. * updates the Write Index for WDI_IPA RX indication ring
  3995. * - RX_RING2_BASE_ADDR_LO
  3996. * Bits 31:0
  3997. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3998. * - RX_RING2_BASE_ADDR_HI
  3999. * Bits 31:0
  4000. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4001. * - RX_RING2_SIZE
  4002. * Bits 31:0
  4003. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4004. * - RX_RING2_RD_IDX_ADDR_LO
  4005. * Bits 31:0
  4006. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4007. * DDR address where IPA uC updates the Read Index for Ring2.
  4008. * If Second RX ring is completion ring, this is NOT used
  4009. * - RX_RING2_RD_IDX_ADDR_HI
  4010. * Bits 31:0
  4011. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4012. * DDR address where IPA uC updates the Read Index for Ring2.
  4013. * If Second RX ring is completion ring, this is NOT used
  4014. * - RX_RING2_WR_IDX_ADDR_LO
  4015. * Bits 31:0
  4016. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4017. * DDR address where WIFI FW updates the Write Index
  4018. * for WDI_IPA RX ring2
  4019. * If second RX ring is completion ring, lower 4 bytes of
  4020. * DDR address where IPA uC updates the Write Index for Ring 2.
  4021. * - RX_RING2_WR_IDX_ADDR_HI
  4022. * Bits 31:0
  4023. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4024. * DDR address where WIFI FW updates the Write Index
  4025. * for WDI_IPA RX ring2
  4026. * If second RX ring is completion ring, higher 4 bytes of
  4027. * DDR address where IPA uC updates the Write Index for Ring 2.
  4028. */
  4029. #if HTT_PADDR64
  4030. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4031. #else
  4032. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4033. #endif
  4034. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4035. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4036. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4037. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4038. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4039. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4040. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4041. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4042. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4043. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4044. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4045. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4046. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4047. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4048. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4049. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4050. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4051. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4052. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4053. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4054. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4055. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4056. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4057. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4058. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4059. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4060. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4061. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4062. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4063. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4064. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4065. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4066. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4067. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4068. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4069. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4070. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4071. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4072. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4073. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4074. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4075. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4076. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4077. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4078. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4079. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4080. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4081. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4082. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4083. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4084. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4085. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4086. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4087. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4088. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4089. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4090. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4091. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4092. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4093. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4094. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4095. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4096. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4097. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4098. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4099. do { \
  4100. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4101. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4102. } while (0)
  4103. /* for systems using 32-bit format for bus addr */
  4104. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4105. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4106. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4107. do { \
  4108. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4109. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4110. } while (0)
  4111. /* for systems using 64-bit format for bus addr */
  4112. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4113. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4114. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4115. do { \
  4116. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4117. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4118. } while (0)
  4119. /* for systems using 64-bit format for bus addr */
  4120. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4121. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4122. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4123. do { \
  4124. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4125. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4126. } while (0)
  4127. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4128. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4129. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4130. do { \
  4131. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4132. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4133. } while (0)
  4134. /* for systems using 32-bit format for bus addr */
  4135. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4136. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4137. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4138. do { \
  4139. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4140. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4141. } while (0)
  4142. /* for systems using 64-bit format for bus addr */
  4143. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4144. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4145. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4146. do { \
  4147. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4148. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4149. } while (0)
  4150. /* for systems using 64-bit format for bus addr */
  4151. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4152. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4153. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4154. do { \
  4155. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4156. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4157. } while (0)
  4158. /* for systems using 32-bit format for bus addr */
  4159. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4160. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4161. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4162. do { \
  4163. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4164. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4165. } while (0)
  4166. /* for systems using 64-bit format for bus addr */
  4167. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4168. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4169. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4170. do { \
  4171. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4172. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4173. } while (0)
  4174. /* for systems using 64-bit format for bus addr */
  4175. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4176. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4177. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4178. do { \
  4179. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4180. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4181. } while (0)
  4182. /* for systems using 32-bit format for bus addr */
  4183. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4184. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4185. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4186. do { \
  4187. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4188. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4189. } while (0)
  4190. /* for systems using 64-bit format for bus addr */
  4191. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4192. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4193. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4194. do { \
  4195. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4196. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4197. } while (0)
  4198. /* for systems using 64-bit format for bus addr */
  4199. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4200. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4201. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4202. do { \
  4203. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4204. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4205. } while (0)
  4206. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4207. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4208. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4209. do { \
  4210. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4211. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4212. } while (0)
  4213. /* for systems using 32-bit format for bus addr */
  4214. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4215. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4216. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4217. do { \
  4218. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4219. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4220. } while (0)
  4221. /* for systems using 64-bit format for bus addr */
  4222. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4223. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4224. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4225. do { \
  4226. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4227. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4228. } while (0)
  4229. /* for systems using 64-bit format for bus addr */
  4230. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4231. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4232. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4233. do { \
  4234. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4235. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4236. } while (0)
  4237. /* for systems using 32-bit format for bus addr */
  4238. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4239. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4240. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4241. do { \
  4242. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4243. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4244. } while (0)
  4245. /* for systems using 64-bit format for bus addr */
  4246. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4247. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4248. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4249. do { \
  4250. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4251. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4252. } while (0)
  4253. /* for systems using 64-bit format for bus addr */
  4254. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4255. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4256. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4257. do { \
  4258. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4259. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4260. } while (0)
  4261. /* for systems using 32-bit format for bus addr */
  4262. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4263. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4264. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4265. do { \
  4266. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4267. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4268. } while (0)
  4269. /* for systems using 64-bit format for bus addr */
  4270. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4271. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4272. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4273. do { \
  4274. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4275. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4276. } while (0)
  4277. /* for systems using 64-bit format for bus addr */
  4278. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4279. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4280. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4281. do { \
  4282. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4283. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4284. } while (0)
  4285. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4286. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4287. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4288. do { \
  4289. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4290. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4291. } while (0)
  4292. /* for systems using 32-bit format for bus addr */
  4293. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4294. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4295. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4296. do { \
  4297. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4298. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4299. } while (0)
  4300. /* for systems using 64-bit format for bus addr */
  4301. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4302. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4303. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4304. do { \
  4305. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4306. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4307. } while (0)
  4308. /* for systems using 64-bit format for bus addr */
  4309. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4310. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4311. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4312. do { \
  4313. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4314. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4315. } while (0)
  4316. /* for systems using 32-bit format for bus addr */
  4317. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4318. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4319. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4320. do { \
  4321. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4322. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4323. } while (0)
  4324. /* for systems using 64-bit format for bus addr */
  4325. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4326. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4327. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4328. do { \
  4329. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4330. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4331. } while (0)
  4332. /* for systems using 64-bit format for bus addr */
  4333. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4334. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4335. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4336. do { \
  4337. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4338. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4339. } while (0)
  4340. /*
  4341. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4342. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4343. * addresses are stored in a XXX-bit field.
  4344. * This macro is used to define both htt_wdi_ipa_config32_t and
  4345. * htt_wdi_ipa_config64_t structs.
  4346. */
  4347. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4348. _paddr__tx_comp_ring_base_addr_, \
  4349. _paddr__tx_comp_wr_idx_addr_, \
  4350. _paddr__tx_ce_wr_idx_addr_, \
  4351. _paddr__rx_ind_ring_base_addr_, \
  4352. _paddr__rx_ind_rd_idx_addr_, \
  4353. _paddr__rx_ind_wr_idx_addr_, \
  4354. _paddr__rx_ring2_base_addr_,\
  4355. _paddr__rx_ring2_rd_idx_addr_,\
  4356. _paddr__rx_ring2_wr_idx_addr_) \
  4357. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4358. { \
  4359. /* DWORD 0: flags and meta-data */ \
  4360. A_UINT32 \
  4361. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4362. reserved: 8, \
  4363. tx_pkt_pool_size: 16;\
  4364. /* DWORD 1 */\
  4365. _paddr__tx_comp_ring_base_addr_;\
  4366. /* DWORD 2 (or 3)*/\
  4367. A_UINT32 tx_comp_ring_size;\
  4368. /* DWORD 3 (or 4)*/\
  4369. _paddr__tx_comp_wr_idx_addr_;\
  4370. /* DWORD 4 (or 6)*/\
  4371. _paddr__tx_ce_wr_idx_addr_;\
  4372. /* DWORD 5 (or 8)*/\
  4373. _paddr__rx_ind_ring_base_addr_;\
  4374. /* DWORD 6 (or 10)*/\
  4375. A_UINT32 rx_ind_ring_size;\
  4376. /* DWORD 7 (or 11)*/\
  4377. _paddr__rx_ind_rd_idx_addr_;\
  4378. /* DWORD 8 (or 13)*/\
  4379. _paddr__rx_ind_wr_idx_addr_;\
  4380. /* DWORD 9 (or 15)*/\
  4381. _paddr__rx_ring2_base_addr_;\
  4382. /* DWORD 10 (or 17) */\
  4383. A_UINT32 rx_ring2_size;\
  4384. /* DWORD 11 (or 18) */\
  4385. _paddr__rx_ring2_rd_idx_addr_;\
  4386. /* DWORD 12 (or 20) */\
  4387. _paddr__rx_ring2_wr_idx_addr_;\
  4388. } POSTPACK
  4389. /* define a htt_wdi_ipa_config32_t type */
  4390. TEMPLATE_HTT_WDI_IPA_CONFIG_T(32, HTT_VAR_PADDR32(tx_comp_ring_base_addr), HTT_VAR_PADDR32(tx_comp_wr_idx_addr), HTT_VAR_PADDR32(tx_ce_wr_idx_addr), HTT_VAR_PADDR32(rx_ind_ring_base_addr), HTT_VAR_PADDR32(rx_ind_rd_idx_addr),HTT_VAR_PADDR32(rx_ind_wr_idx_addr), HTT_VAR_PADDR32(rx_ring2_base_addr), HTT_VAR_PADDR32(rx_ring2_rd_idx_addr), HTT_VAR_PADDR32(rx_ring2_wr_idx_addr));
  4391. /* define a htt_wdi_ipa_config64_t type */
  4392. TEMPLATE_HTT_WDI_IPA_CONFIG_T(64, HTT_VAR_PADDR64_LE(tx_comp_ring_base_addr), HTT_VAR_PADDR64_LE(tx_comp_wr_idx_addr), HTT_VAR_PADDR64_LE(tx_ce_wr_idx_addr), HTT_VAR_PADDR64_LE(rx_ind_ring_base_addr), HTT_VAR_PADDR64_LE(rx_ind_rd_idx_addr), HTT_VAR_PADDR64_LE(rx_ind_wr_idx_addr), HTT_VAR_PADDR64_LE(rx_ring2_base_addr), HTT_VAR_PADDR64_LE(rx_ring2_rd_idx_addr), HTT_VAR_PADDR64_LE(rx_ring2_wr_idx_addr));
  4393. #if HTT_PADDR64
  4394. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4395. #else
  4396. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4397. #endif
  4398. enum htt_wdi_ipa_op_code {
  4399. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4400. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4401. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4402. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4403. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4404. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4405. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4406. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4407. /* keep this last */
  4408. HTT_WDI_IPA_OPCODE_MAX
  4409. };
  4410. /**
  4411. * @brief HTT WDI_IPA Operation Request Message
  4412. *
  4413. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4414. *
  4415. * @details
  4416. * HTT WDI_IPA Operation Request message is sent by host
  4417. * to either suspend or resume WDI_IPA TX or RX path.
  4418. * |31 24|23 16|15 8|7 0|
  4419. * |----------------+----------------+----------------+----------------|
  4420. * | op_code | Rsvd | msg_type |
  4421. * |-------------------------------------------------------------------|
  4422. *
  4423. * Header fields:
  4424. * - MSG_TYPE
  4425. * Bits 7:0
  4426. * Purpose: Identifies this as WDI_IPA Operation Request message
  4427. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4428. * - OP_CODE
  4429. * Bits 31:16
  4430. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4431. * value: = enum htt_wdi_ipa_op_code
  4432. */
  4433. PREPACK struct htt_wdi_ipa_op_request_t
  4434. {
  4435. /* DWORD 0: flags and meta-data */
  4436. A_UINT32
  4437. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4438. reserved: 8,
  4439. op_code: 16;
  4440. } POSTPACK;
  4441. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4442. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4443. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4444. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4445. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4446. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4447. do { \
  4448. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4449. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4450. } while (0)
  4451. /*
  4452. * @brief host -> target HTT_MSI_SETUP message
  4453. *
  4454. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4455. *
  4456. * @details
  4457. * After target is booted up, host can send MSI setup message so that
  4458. * target sets up HW registers based on setup message.
  4459. *
  4460. * The message would appear as follows:
  4461. * |31 24|23 16|15|14 8|7 0|
  4462. * |---------------+-----------------+-----------------+-----------------|
  4463. * | reserved | msi_type | pdev_id | msg_type |
  4464. * |---------------------------------------------------------------------|
  4465. * | msi_addr_lo |
  4466. * |---------------------------------------------------------------------|
  4467. * | msi_addr_hi |
  4468. * |---------------------------------------------------------------------|
  4469. * | msi_data |
  4470. * |---------------------------------------------------------------------|
  4471. *
  4472. * The message is interpreted as follows:
  4473. * dword0 - b'0:7 - msg_type: This will be set to
  4474. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4475. * b'8:15 - pdev_id:
  4476. * 0 (for rings at SOC/UMAC level),
  4477. * 1/2/3 mac id (for rings at LMAC level)
  4478. * b'16:23 - msi_type: identify which msi registers need to be setup
  4479. * more details can be got from enum htt_msi_setup_type
  4480. * b'24:31 - reserved
  4481. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4482. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4483. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4484. */
  4485. PREPACK struct htt_msi_setup_t {
  4486. A_UINT32 msg_type: 8,
  4487. pdev_id: 8,
  4488. msi_type: 8,
  4489. reserved: 8;
  4490. A_UINT32 msi_addr_lo;
  4491. A_UINT32 msi_addr_hi;
  4492. A_UINT32 msi_data;
  4493. } POSTPACK;
  4494. enum htt_msi_setup_type {
  4495. HTT_PPDU_END_MSI_SETUP_TYPE,
  4496. /* Insert new types here*/
  4497. };
  4498. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4499. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4500. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4501. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4502. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4503. HTT_MSI_SETUP_PDEV_ID_S)
  4504. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4505. do { \
  4506. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4507. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4508. } while (0)
  4509. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4510. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4511. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4512. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4513. HTT_MSI_SETUP_MSI_TYPE_S)
  4514. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4515. do { \
  4516. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4517. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4518. } while (0)
  4519. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4520. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4521. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4522. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4523. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4524. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4525. do { \
  4526. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4527. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4528. } while (0)
  4529. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4530. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4531. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4532. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4533. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4534. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4535. do { \
  4536. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4537. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4538. } while (0)
  4539. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4540. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4541. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4542. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4543. HTT_MSI_SETUP_MSI_DATA_S)
  4544. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4545. do { \
  4546. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4547. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4548. } while (0)
  4549. /*
  4550. * @brief host -> target HTT_SRING_SETUP message
  4551. *
  4552. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4553. *
  4554. * @details
  4555. * After target is booted up, Host can send SRING setup message for
  4556. * each host facing LMAC SRING. Target setups up HW registers based
  4557. * on setup message and confirms back to Host if response_required is set.
  4558. * Host should wait for confirmation message before sending new SRING
  4559. * setup message
  4560. *
  4561. * The message would appear as follows:
  4562. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4563. * |--------------- +-----------------+-----------------+-----------------|
  4564. * | ring_type | ring_id | pdev_id | msg_type |
  4565. * |----------------------------------------------------------------------|
  4566. * | ring_base_addr_lo |
  4567. * |----------------------------------------------------------------------|
  4568. * | ring_base_addr_hi |
  4569. * |----------------------------------------------------------------------|
  4570. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4571. * |----------------------------------------------------------------------|
  4572. * | ring_head_offset32_remote_addr_lo |
  4573. * |----------------------------------------------------------------------|
  4574. * | ring_head_offset32_remote_addr_hi |
  4575. * |----------------------------------------------------------------------|
  4576. * | ring_tail_offset32_remote_addr_lo |
  4577. * |----------------------------------------------------------------------|
  4578. * | ring_tail_offset32_remote_addr_hi |
  4579. * |----------------------------------------------------------------------|
  4580. * | ring_msi_addr_lo |
  4581. * |----------------------------------------------------------------------|
  4582. * | ring_msi_addr_hi |
  4583. * |----------------------------------------------------------------------|
  4584. * | ring_msi_data |
  4585. * |----------------------------------------------------------------------|
  4586. * | intr_timer_th |IM| intr_batch_counter_th |
  4587. * |----------------------------------------------------------------------|
  4588. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4589. * |----------------------------------------------------------------------|
  4590. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4591. * |----------------------------------------------------------------------|
  4592. * Where
  4593. * IM = sw_intr_mode
  4594. * RR = response_required
  4595. * PTCF = prefetch_timer_cfg
  4596. * IP = IPA drop flag
  4597. *
  4598. * The message is interpreted as follows:
  4599. * dword0 - b'0:7 - msg_type: This will be set to
  4600. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4601. * b'8:15 - pdev_id:
  4602. * 0 (for rings at SOC/UMAC level),
  4603. * 1/2/3 mac id (for rings at LMAC level)
  4604. * b'16:23 - ring_id: identify which ring is to setup,
  4605. * more details can be got from enum htt_srng_ring_id
  4606. * b'24:31 - ring_type: identify type of host rings,
  4607. * more details can be got from enum htt_srng_ring_type
  4608. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4609. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4610. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4611. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4612. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4613. * SW_TO_HW_RING.
  4614. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4615. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4616. * Lower 32 bits of memory address of the remote variable
  4617. * storing the 4-byte word offset that identifies the head
  4618. * element within the ring.
  4619. * (The head offset variable has type A_UINT32.)
  4620. * Valid for HW_TO_SW and SW_TO_SW rings.
  4621. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4622. * Upper 32 bits of memory address of the remote variable
  4623. * storing the 4-byte word offset that identifies the head
  4624. * element within the ring.
  4625. * (The head offset variable has type A_UINT32.)
  4626. * Valid for HW_TO_SW and SW_TO_SW rings.
  4627. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4628. * Lower 32 bits of memory address of the remote variable
  4629. * storing the 4-byte word offset that identifies the tail
  4630. * element within the ring.
  4631. * (The tail offset variable has type A_UINT32.)
  4632. * Valid for HW_TO_SW and SW_TO_SW rings.
  4633. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4634. * Upper 32 bits of memory address of the remote variable
  4635. * storing the 4-byte word offset that identifies the tail
  4636. * element within the ring.
  4637. * (The tail offset variable has type A_UINT32.)
  4638. * Valid for HW_TO_SW and SW_TO_SW rings.
  4639. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4640. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4641. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4642. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4643. * dword10 - b'0:31 - ring_msi_data: MSI data
  4644. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4645. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4646. * dword11 - b'0:14 - intr_batch_counter_th:
  4647. * batch counter threshold is in units of 4-byte words.
  4648. * HW internally maintains and increments batch count.
  4649. * (see SRING spec for detail description).
  4650. * When batch count reaches threshold value, an interrupt
  4651. * is generated by HW.
  4652. * b'15 - sw_intr_mode:
  4653. * This configuration shall be static.
  4654. * Only programmed at power up.
  4655. * 0: generate pulse style sw interrupts
  4656. * 1: generate level style sw interrupts
  4657. * b'16:31 - intr_timer_th:
  4658. * The timer init value when timer is idle or is
  4659. * initialized to start downcounting.
  4660. * In 8us units (to cover a range of 0 to 524 ms)
  4661. * dword12 - b'0:15 - intr_low_threshold:
  4662. * Used only by Consumer ring to generate ring_sw_int_p.
  4663. * Ring entries low threshold water mark, that is used
  4664. * in combination with the interrupt timer as well as
  4665. * the the clearing of the level interrupt.
  4666. * b'16:18 - prefetch_timer_cfg:
  4667. * Used only by Consumer ring to set timer mode to
  4668. * support Application prefetch handling.
  4669. * The external tail offset/pointer will be updated
  4670. * at following intervals:
  4671. * 3'b000: (Prefetch feature disabled; used only for debug)
  4672. * 3'b001: 1 usec
  4673. * 3'b010: 4 usec
  4674. * 3'b011: 8 usec (default)
  4675. * 3'b100: 16 usec
  4676. * Others: Reserverd
  4677. * b'19 - response_required:
  4678. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4679. * b'20 - ipa_drop_flag:
  4680. Indicates that host will config ipa drop threshold percentage
  4681. * b'21:31 - reserved: reserved for future use
  4682. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4683. * b'8:15 - ipa drop high threshold percentage:
  4684. * b'16:31 - Reserved
  4685. */
  4686. PREPACK struct htt_sring_setup_t {
  4687. A_UINT32 msg_type: 8,
  4688. pdev_id: 8,
  4689. ring_id: 8,
  4690. ring_type: 8;
  4691. A_UINT32 ring_base_addr_lo;
  4692. A_UINT32 ring_base_addr_hi;
  4693. A_UINT32 ring_size: 16,
  4694. ring_entry_size: 8,
  4695. ring_misc_cfg_flag: 8;
  4696. A_UINT32 ring_head_offset32_remote_addr_lo;
  4697. A_UINT32 ring_head_offset32_remote_addr_hi;
  4698. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4699. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4700. A_UINT32 ring_msi_addr_lo;
  4701. A_UINT32 ring_msi_addr_hi;
  4702. A_UINT32 ring_msi_data;
  4703. A_UINT32 intr_batch_counter_th: 15,
  4704. sw_intr_mode: 1,
  4705. intr_timer_th: 16;
  4706. A_UINT32 intr_low_threshold: 16,
  4707. prefetch_timer_cfg: 3,
  4708. response_required: 1,
  4709. ipa_drop_flag: 1,
  4710. reserved1: 11;
  4711. A_UINT32 ipa_drop_low_threshold: 8,
  4712. ipa_drop_high_threshold: 8,
  4713. reserved: 16;
  4714. } POSTPACK;
  4715. enum htt_srng_ring_type {
  4716. HTT_HW_TO_SW_RING = 0,
  4717. HTT_SW_TO_HW_RING,
  4718. HTT_SW_TO_SW_RING,
  4719. /* Insert new ring types above this line */
  4720. };
  4721. enum htt_srng_ring_id {
  4722. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4723. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4724. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4725. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4726. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4727. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4728. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4729. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4730. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4731. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4732. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4733. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4734. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4735. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4736. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4737. /* Add Other SRING which can't be directly configured by host software above this line */
  4738. };
  4739. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4740. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4741. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4742. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4743. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4744. HTT_SRING_SETUP_PDEV_ID_S)
  4745. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4746. do { \
  4747. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4748. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4749. } while (0)
  4750. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4751. #define HTT_SRING_SETUP_RING_ID_S 16
  4752. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4753. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4754. HTT_SRING_SETUP_RING_ID_S)
  4755. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4756. do { \
  4757. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4758. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4759. } while (0)
  4760. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4761. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4762. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4763. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4764. HTT_SRING_SETUP_RING_TYPE_S)
  4765. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4766. do { \
  4767. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4768. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4769. } while (0)
  4770. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4771. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4772. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4773. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4774. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4775. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4776. do { \
  4777. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4778. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4779. } while (0)
  4780. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4781. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4782. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4783. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4784. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4785. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4786. do { \
  4787. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4788. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4789. } while (0)
  4790. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4791. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4792. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4793. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4794. HTT_SRING_SETUP_RING_SIZE_S)
  4795. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4796. do { \
  4797. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4798. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4799. } while (0)
  4800. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4801. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4802. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4803. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4804. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4805. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4806. do { \
  4807. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4808. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4809. } while (0)
  4810. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4811. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4812. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4813. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4814. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4815. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4816. do { \
  4817. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4818. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4819. } while (0)
  4820. /* This control bit is applicable to only Producer, which updates Ring ID field
  4821. * of each descriptor before pushing into the ring.
  4822. * 0: updates ring_id(default)
  4823. * 1: ring_id updating disabled */
  4824. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4825. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4826. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4827. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4828. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4829. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4830. do { \
  4831. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4832. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4833. } while (0)
  4834. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4835. * of each descriptor before pushing into the ring.
  4836. * 0: updates Loopcnt(default)
  4837. * 1: Loopcnt updating disabled */
  4838. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4839. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4840. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4841. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4842. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4843. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4844. do { \
  4845. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4846. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4847. } while (0)
  4848. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4849. * into security_id port of GXI/AXI. */
  4850. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4851. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4852. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4853. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4854. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4855. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4856. do { \
  4857. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4858. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4859. } while (0)
  4860. /* During MSI write operation, SRNG drives value of this register bit into
  4861. * swap bit of GXI/AXI. */
  4862. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4863. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4864. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4865. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4866. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4867. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4868. do { \
  4869. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4870. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4871. } while (0)
  4872. /* During Pointer write operation, SRNG drives value of this register bit into
  4873. * swap bit of GXI/AXI. */
  4874. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4875. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4876. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4877. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4878. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4879. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4880. do { \
  4881. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4882. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4883. } while (0)
  4884. /* During any data or TLV write operation, SRNG drives value of this register
  4885. * bit into swap bit of GXI/AXI. */
  4886. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4887. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4888. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4889. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4890. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4891. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4892. do { \
  4893. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4894. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4895. } while (0)
  4896. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4897. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4898. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4899. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4900. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4901. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4902. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4903. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4904. do { \
  4905. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4906. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4907. } while (0)
  4908. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4909. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4910. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4911. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4912. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4913. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4914. do { \
  4915. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4916. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4917. } while (0)
  4918. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4919. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4920. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4921. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4922. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4923. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4924. do { \
  4925. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4926. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4927. } while (0)
  4928. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4929. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4930. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4931. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4932. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4933. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4934. do { \
  4935. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4936. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4937. } while (0)
  4938. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4939. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4940. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4941. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4942. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4943. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4944. do { \
  4945. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4946. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4947. } while (0)
  4948. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4949. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4950. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4951. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4952. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4953. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4954. do { \
  4955. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4956. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4957. } while (0)
  4958. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4959. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4960. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4961. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4962. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4963. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4964. do { \
  4965. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4966. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4967. } while (0)
  4968. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4969. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4970. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4971. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4972. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4973. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4974. do { \
  4975. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4976. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4977. } while (0)
  4978. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4979. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4980. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4981. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4982. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4983. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4984. do { \
  4985. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4986. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4987. } while (0)
  4988. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4989. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4990. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4991. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4992. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4993. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4994. do { \
  4995. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4996. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4997. } while (0)
  4998. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4999. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5000. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5001. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5002. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5003. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5004. do { \
  5005. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5006. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5007. } while (0)
  5008. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5009. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5010. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5011. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5012. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5013. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5014. do { \
  5015. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5016. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5017. } while (0)
  5018. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5019. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5020. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5021. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5022. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5023. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5024. do { \
  5025. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5026. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5027. } while (0)
  5028. /**
  5029. * @brief host -> target RX ring selection config message
  5030. *
  5031. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5032. *
  5033. * @details
  5034. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5035. * configure RXDMA rings.
  5036. * The configuration is per ring based and includes both packet subtypes
  5037. * and PPDU/MPDU TLVs.
  5038. *
  5039. * The message would appear as follows:
  5040. *
  5041. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5042. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5043. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5044. * |-------------------------------------------------------------------|
  5045. * | rsvd2 | ring_buffer_size |
  5046. * |-------------------------------------------------------------------|
  5047. * | packet_type_enable_flags_0 |
  5048. * |-------------------------------------------------------------------|
  5049. * | packet_type_enable_flags_1 |
  5050. * |-------------------------------------------------------------------|
  5051. * | packet_type_enable_flags_2 |
  5052. * |-------------------------------------------------------------------|
  5053. * | packet_type_enable_flags_3 |
  5054. * |-------------------------------------------------------------------|
  5055. * | tlv_filter_in_flags |
  5056. * |-------------------------------------------------------------------|
  5057. * | rx_header_offset | rx_packet_offset |
  5058. * |-------------------------------------------------------------------|
  5059. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5060. * |-------------------------------------------------------------------|
  5061. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5062. * |-------------------------------------------------------------------|
  5063. * | rsvd3 | rx_attention_offset |
  5064. * |-------------------------------------------------------------------|
  5065. * | rsvd4 | mo| fp| rx_drop_threshold |
  5066. * | |ndp|ndp| |
  5067. * |-------------------------------------------------------------------|
  5068. * Where:
  5069. * PS = pkt_swap
  5070. * SS = status_swap
  5071. * OV = rx_offsets_valid
  5072. * DT = drop_thresh_valid
  5073. * The message is interpreted as follows:
  5074. * dword0 - b'0:7 - msg_type: This will be set to
  5075. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5076. * b'8:15 - pdev_id:
  5077. * 0 (for rings at SOC/UMAC level),
  5078. * 1/2/3 mac id (for rings at LMAC level)
  5079. * b'16:23 - ring_id : Identify the ring to configure.
  5080. * More details can be got from enum htt_srng_ring_id
  5081. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5082. * BUF_RING_CFG_0 defs within HW .h files,
  5083. * e.g. wmac_top_reg_seq_hwioreg.h
  5084. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5085. * BUF_RING_CFG_0 defs within HW .h files,
  5086. * e.g. wmac_top_reg_seq_hwioreg.h
  5087. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5088. * configuration fields are valid
  5089. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5090. * rx_drop_threshold field is valid
  5091. * b'28 - rx_mon_global_en: Enable/Disable global register
  5092. 8 configuration in Rx monitor module.
  5093. * b'29:31 - rsvd1: reserved for future use
  5094. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5095. * in byte units.
  5096. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5097. * b'16:18 - config_length_mgmt (MGMT):
  5098. * Represents the length of mpdu bytes for mgmt pkt.
  5099. * valid values:
  5100. * 001 - 64bytes
  5101. * 010 - 128bytes
  5102. * 100 - 256bytes
  5103. * 111 - Full mpdu bytes
  5104. * b'19:21 - config_length_ctrl (CTRL):
  5105. * Represents the length of mpdu bytes for ctrl pkt.
  5106. * valid values:
  5107. * 001 - 64bytes
  5108. * 010 - 128bytes
  5109. * 100 - 256bytes
  5110. * 111 - Full mpdu bytes
  5111. * b'22:24 - config_length_data (DATA):
  5112. * Represents the length of mpdu bytes for data pkt.
  5113. * valid values:
  5114. * 001 - 64bytes
  5115. * 010 - 128bytes
  5116. * 100 - 256bytes
  5117. * 111 - Full mpdu bytes
  5118. * b'25:26 - rx_hdr_len:
  5119. * Specifies the number of bytes of recvd packet to copy
  5120. * into the rx_hdr tlv.
  5121. * supported values for now by host:
  5122. * 01 - 64bytes
  5123. * 10 - 128bytes
  5124. * 11 - 256bytes
  5125. * default - 128 bytes
  5126. * b'27:31 - rsvd2: Reserved for future use
  5127. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5128. * Enable MGMT packet from 0b0000 to 0b1001
  5129. * bits from low to high: FP, MD, MO - 3 bits
  5130. * FP: Filter_Pass
  5131. * MD: Monitor_Direct
  5132. * MO: Monitor_Other
  5133. * 10 mgmt subtypes * 3 bits -> 30 bits
  5134. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5135. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5136. * Enable MGMT packet from 0b1010 to 0b1111
  5137. * bits from low to high: FP, MD, MO - 3 bits
  5138. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5139. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5140. * Enable CTRL packet from 0b0000 to 0b1001
  5141. * bits from low to high: FP, MD, MO - 3 bits
  5142. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5143. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5144. * Enable CTRL packet from 0b1010 to 0b1111,
  5145. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5146. * bits from low to high: FP, MD, MO - 3 bits
  5147. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5148. * dword6 - b'0:31 - tlv_filter_in_flags:
  5149. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5150. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5151. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5152. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5153. * A value of 0 will be considered as ignore this config.
  5154. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5155. * e.g. wmac_top_reg_seq_hwioreg.h
  5156. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5157. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5158. * A value of 0 will be considered as ignore this config.
  5159. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5160. * e.g. wmac_top_reg_seq_hwioreg.h
  5161. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5162. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5163. * A value of 0 will be considered as ignore this config.
  5164. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5165. * e.g. wmac_top_reg_seq_hwioreg.h
  5166. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5167. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5168. * A value of 0 will be considered as ignore this config.
  5169. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5170. * e.g. wmac_top_reg_seq_hwioreg.h
  5171. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5172. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5173. * A value of 0 will be considered as ignore this config.
  5174. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5175. * e.g. wmac_top_reg_seq_hwioreg.h
  5176. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5177. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5178. * A value of 0 will be considered as ignore this config.
  5179. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5180. * e.g. wmac_top_reg_seq_hwioreg.h
  5181. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5182. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5183. * A value of 0 will be considered as ignore this config.
  5184. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5185. * e.g. wmac_top_reg_seq_hwioreg.h
  5186. * - b'16:31 - rsvd3 for future use
  5187. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5188. * to source rings. Consumer drops packets if the available
  5189. * words in the ring falls below the configured threshold
  5190. * value.
  5191. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5192. * by host. 1 -> subscribed
  5193. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5194. * by host. 1 -> subscribed
  5195. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5196. * subscribed by host. 1 -> subscribed
  5197. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5198. * selection for the FP PHY ERR status tlv.
  5199. * 0 - wbm2rxdma_buf_source_ring
  5200. * 1 - fw2rxdma_buf_source_ring
  5201. * 2 - sw2rxdma_buf_source_ring
  5202. * 3 - no_buffer_ring
  5203. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5204. * selection for the FP PHY ERR status tlv.
  5205. * 0 - rxdma_release_ring
  5206. * 1 - rxdma2fw_ring
  5207. * 2 - rxdma2sw_ring
  5208. * 3 - rxdma2reo_ring
  5209. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5210. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5211. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5212. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5213. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5214. * 0: MSDU level logging
  5215. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5216. * 0: MSDU level logging
  5217. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5218. * 0: MSDU level logging
  5219. * - b'23 - word_mask_compaction: enable/disable word mask for
  5220. * mpdu/msdu start/end tlvs
  5221. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5222. * manager override
  5223. * - b'25:28 - rbm_override_val: return buffer manager override value
  5224. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5225. * which have to be posted to host from phy.
  5226. * Corresponding to errors defined in
  5227. * phyrx_abort_request_reason enums 0 to 31.
  5228. * Refer to RXPCU register definition header files for the
  5229. * phyrx_abort_request_reason enum definition.
  5230. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5231. * errors which have to be posted to host from phy.
  5232. * Corresponding to errors defined in
  5233. * phyrx_abort_request_reason enums 32 to 63.
  5234. * Refer to RXPCU register definition header files for the
  5235. * phyrx_abort_request_reason enum definition.
  5236. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5237. * applicable if word mask enabled
  5238. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5239. * applicable if word mask enabled
  5240. * - b'19:31 - rsvd7
  5241. * dword15- b'0:16 - rx_msdu_end_word_mask
  5242. * - b'17:31 - rsvd5
  5243. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5244. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5245. * buffer
  5246. * 1: RX_PKT TLV logging at specified offset for the
  5247. * subsequent buffer
  5248. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5249. */
  5250. PREPACK struct htt_rx_ring_selection_cfg_t {
  5251. A_UINT32 msg_type: 8,
  5252. pdev_id: 8,
  5253. ring_id: 8,
  5254. status_swap: 1,
  5255. pkt_swap: 1,
  5256. rx_offsets_valid: 1,
  5257. drop_thresh_valid: 1,
  5258. rx_mon_global_en: 1,
  5259. rsvd1: 3;
  5260. A_UINT32 ring_buffer_size: 16,
  5261. config_length_mgmt:3,
  5262. config_length_ctrl:3,
  5263. config_length_data:3,
  5264. rx_hdr_len: 2,
  5265. rsvd2: 5;
  5266. A_UINT32 packet_type_enable_flags_0;
  5267. A_UINT32 packet_type_enable_flags_1;
  5268. A_UINT32 packet_type_enable_flags_2;
  5269. A_UINT32 packet_type_enable_flags_3;
  5270. A_UINT32 tlv_filter_in_flags;
  5271. A_UINT32 rx_packet_offset: 16,
  5272. rx_header_offset: 16;
  5273. A_UINT32 rx_mpdu_end_offset: 16,
  5274. rx_mpdu_start_offset: 16;
  5275. A_UINT32 rx_msdu_end_offset: 16,
  5276. rx_msdu_start_offset: 16;
  5277. A_UINT32 rx_attn_offset: 16,
  5278. rsvd3: 16;
  5279. A_UINT32 rx_drop_threshold: 10,
  5280. fp_ndp: 1,
  5281. mo_ndp: 1,
  5282. fp_phy_err: 1,
  5283. fp_phy_err_buf_src: 2,
  5284. fp_phy_err_buf_dest: 2,
  5285. pkt_type_enable_msdu_or_mpdu_logging:3,
  5286. dma_mpdu_mgmt: 1,
  5287. dma_mpdu_ctrl: 1,
  5288. dma_mpdu_data: 1,
  5289. word_mask_compaction_enable:1,
  5290. rbm_override_enable: 1,
  5291. rbm_override_val: 4,
  5292. rsvd4: 3;
  5293. A_UINT32 phy_err_mask;
  5294. A_UINT32 phy_err_mask_cont;
  5295. A_UINT32 rx_mpdu_start_word_mask:16,
  5296. rx_mpdu_end_word_mask: 3,
  5297. rsvd7: 13;
  5298. A_UINT32 rx_msdu_end_word_mask: 17,
  5299. rsvd5: 15;
  5300. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5301. rx_pkt_tlv_offset: 15,
  5302. rsvd6: 16;
  5303. } POSTPACK;
  5304. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5305. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5306. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5307. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5308. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5309. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5310. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5311. do { \
  5312. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5313. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5314. } while (0)
  5315. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5316. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5317. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5318. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5319. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5320. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5321. do { \
  5322. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5323. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5324. } while (0)
  5325. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5326. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5327. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5328. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5329. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5330. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5331. do { \
  5332. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5333. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5334. } while (0)
  5335. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5336. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5337. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5338. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5339. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5340. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5341. do { \
  5342. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5343. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5344. } while (0)
  5345. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5346. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5347. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5348. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5349. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5350. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5351. do { \
  5352. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5353. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5354. } while (0)
  5355. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5356. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5357. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5358. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5359. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5360. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5361. do { \
  5362. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5363. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5364. } while (0)
  5365. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5366. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5367. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5368. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5369. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5370. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5371. do { \
  5372. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5373. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5374. } while (0)
  5375. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5376. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5377. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5378. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5379. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5380. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5381. do { \
  5382. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5383. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5384. } while (0)
  5385. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5386. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5387. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5388. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5389. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5390. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5391. do { \
  5392. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5393. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5394. } while (0)
  5395. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5396. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5397. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5398. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5399. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5400. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5401. do { \
  5402. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5403. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5404. } while (0)
  5405. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5406. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5407. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5408. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5409. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5410. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5411. do { \
  5412. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5413. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5414. } while (0)
  5415. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5416. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5417. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5418. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5419. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5420. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5421. do { \
  5422. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5423. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5424. } while(0)
  5425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5427. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5428. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5429. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5430. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5431. do { \
  5432. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5433. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5434. } while (0)
  5435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5437. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5438. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5439. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5440. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5441. do { \
  5442. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5443. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5444. } while (0)
  5445. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5448. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5449. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5451. do { \
  5452. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5453. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5454. } while (0)
  5455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5457. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5458. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5459. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5460. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5461. do { \
  5462. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5463. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5464. } while (0)
  5465. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5466. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5467. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5468. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5469. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5470. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5471. do { \
  5472. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5473. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5474. } while (0)
  5475. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5476. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5477. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5478. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5479. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5480. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5481. do { \
  5482. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5483. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5484. } while (0)
  5485. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5486. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5487. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5488. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5489. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5490. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5491. do { \
  5492. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5493. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5494. } while (0)
  5495. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5496. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5497. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5498. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5499. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5500. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5501. do { \
  5502. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5503. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5504. } while (0)
  5505. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5506. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5507. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5508. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5509. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5510. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5511. do { \
  5512. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5513. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5514. } while (0)
  5515. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5516. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5517. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5518. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5519. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5520. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5521. do { \
  5522. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5523. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5524. } while (0)
  5525. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5526. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5527. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5528. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5529. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5530. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5531. do { \
  5532. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5533. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5534. } while (0)
  5535. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5536. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5537. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5538. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5539. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5540. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5541. do { \
  5542. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5543. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5544. } while (0)
  5545. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5546. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5547. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5548. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5549. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5550. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5551. do { \
  5552. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5553. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5554. } while (0)
  5555. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5556. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5557. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5558. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5559. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5560. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5561. do { \
  5562. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5563. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5564. } while (0)
  5565. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5566. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5567. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5568. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5569. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5570. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5571. do { \
  5572. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5573. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5574. } while (0)
  5575. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5576. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5577. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5578. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5579. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5580. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5581. do { \
  5582. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5583. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5584. } while (0)
  5585. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5586. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5587. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5588. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5589. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5590. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5591. do { \
  5592. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5593. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5594. } while (0)
  5595. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5596. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5597. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5598. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5599. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5600. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5601. do { \
  5602. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5603. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5604. } while (0)
  5605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5608. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5609. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5611. do { \
  5612. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5613. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5614. } while (0)
  5615. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5616. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5617. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5618. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5619. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5620. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5621. do { \
  5622. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5623. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5624. } while (0)
  5625. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5626. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5627. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5628. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5629. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5630. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5631. do { \
  5632. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5633. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5634. } while (0)
  5635. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5636. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5637. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5638. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5639. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5640. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5641. do { \
  5642. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5643. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5644. } while (0)
  5645. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5646. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5647. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5648. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5649. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5650. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5651. do { \
  5652. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5653. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5654. } while (0)
  5655. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5656. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5657. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5658. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5659. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5660. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5661. do { \
  5662. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5663. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5664. } while (0)
  5665. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5666. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5667. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5668. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5669. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5670. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5671. do { \
  5672. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5673. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5674. } while (0)
  5675. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5676. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5677. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5678. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5679. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5680. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5681. do { \
  5682. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5683. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5684. } while (0)
  5685. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5686. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5687. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5688. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5689. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5690. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5691. do { \
  5692. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5693. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5694. } while (0)
  5695. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5696. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5697. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5698. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5699. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5700. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5701. do { \
  5702. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5703. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5704. } while (0)
  5705. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5706. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5707. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5708. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5709. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5710. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5711. do { \
  5712. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5713. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5714. } while (0)
  5715. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5716. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5717. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5718. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5719. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5720. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5721. do { \
  5722. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5723. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5724. } while (0)
  5725. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5726. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5727. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5728. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5729. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5730. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5731. do { \
  5732. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5733. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5734. } while (0)
  5735. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5736. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5737. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5738. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5739. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5740. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5741. do { \
  5742. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5743. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5744. } while (0)
  5745. /*
  5746. * Subtype based MGMT frames enable bits.
  5747. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5748. */
  5749. /* association request */
  5750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5756. /* association response */
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5763. /* Reassociation request */
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5770. /* Reassociation response */
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5777. /* Probe request */
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5784. /* Probe response */
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5791. /* Timing Advertisement */
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5798. /* Reserved */
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5805. /* Beacon */
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5812. /* ATIM */
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5819. /* Disassociation */
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5826. /* Authentication */
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5833. /* Deauthentication */
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5840. /* Action */
  5841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5847. /* Action No Ack */
  5848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5854. /* Reserved */
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5861. /*
  5862. * Subtype based CTRL frames enable bits.
  5863. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5864. */
  5865. /* Reserved */
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5872. /* Reserved */
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5879. /* Reserved */
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5886. /* Reserved */
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5893. /* Reserved */
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5900. /* Reserved */
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5907. /* Reserved */
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5914. /* Control Wrapper */
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5921. /* Block Ack Request */
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5928. /* Block Ack*/
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5935. /* PS-POLL */
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5942. /* RTS */
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5949. /* CTS */
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5956. /* ACK */
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5963. /* CF-END */
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5970. /* CF-END + CF-ACK */
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5977. /* Multicast data */
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5984. /* Unicast data */
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5991. /* NULL data */
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5999. do { \
  6000. HTT_CHECK_SET_VAL(httsym, value); \
  6001. (word) |= (value) << httsym##_S; \
  6002. } while (0)
  6003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6004. (((word) & httsym##_M) >> httsym##_S)
  6005. #define htt_rx_ring_pkt_enable_subtype_set( \
  6006. word, flag, mode, type, subtype, val) \
  6007. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6008. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6009. #define htt_rx_ring_pkt_enable_subtype_get( \
  6010. word, flag, mode, type, subtype) \
  6011. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6012. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6013. /* Definition to filter in TLVs */
  6014. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6021. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6022. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6023. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6024. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6025. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6026. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6027. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6028. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6029. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6030. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6031. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6032. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6033. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6034. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6035. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6036. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6037. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6038. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6039. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6040. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6041. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6042. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6043. do { \
  6044. HTT_CHECK_SET_VAL(httsym, enable); \
  6045. (word) |= (enable) << httsym##_S; \
  6046. } while (0)
  6047. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6048. (((word) & httsym##_M) >> httsym##_S)
  6049. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6050. HTT_RX_RING_TLV_ENABLE_SET( \
  6051. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6052. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6053. HTT_RX_RING_TLV_ENABLE_GET( \
  6054. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6055. /**
  6056. * @brief host -> target TX monitor config message
  6057. *
  6058. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6059. *
  6060. * @details
  6061. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6062. * configure RXDMA rings.
  6063. * The configuration is per ring based and includes both packet types
  6064. * and PPDU/MPDU TLVs.
  6065. *
  6066. * The message would appear as follows:
  6067. *
  6068. * |31 26|25|24|23 22|21|20|19|18 16|15|14|13|12|11|10|9|8|7|6|5|4|3|2 0|
  6069. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6070. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6071. * |-----------+--------+--------+-----+------------------------------------|
  6072. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6073. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6074. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6075. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6076. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6077. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6078. * |------------------------------------------------------------------------|
  6079. * | tlv_filter_mask_in0 |
  6080. * |------------------------------------------------------------------------|
  6081. * | tlv_filter_mask_in1 |
  6082. * |------------------------------------------------------------------------|
  6083. * | tlv_filter_mask_in2 |
  6084. * |------------------------------------------------------------------------|
  6085. * | tlv_filter_mask_in3 |
  6086. * |-----------------+-----------------+---------------------+--------------|
  6087. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6088. * |------------------------------------------------------------------------|
  6089. * | pcu_ppdu_setup_word_mask |
  6090. * |--------------------+--+--+--+-----+---------------------+--------------|
  6091. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6092. * |------------------------------------------------------------------------|
  6093. *
  6094. * Where:
  6095. * PS = pkt_swap
  6096. * SS = status_swap
  6097. * The message is interpreted as follows:
  6098. * dword0 - b'0:7 - msg_type: This will be set to
  6099. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6100. * b'8:15 - pdev_id:
  6101. * 0 (for rings at SOC level),
  6102. * 1/2/3 mac id (for rings at LMAC level)
  6103. * b'16:23 - ring_id : Identify the ring to configure.
  6104. * More details can be got from enum htt_srng_ring_id
  6105. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6106. * BUF_RING_CFG_0 defs within HW .h files,
  6107. * e.g. wmac_top_reg_seq_hwioreg.h
  6108. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6109. * BUF_RING_CFG_0 defs within HW .h files,
  6110. * e.g. wmac_top_reg_seq_hwioreg.h
  6111. * b'26 - tx_mon_global_en: Enable/Disable global register
  6112. * configuration in Tx monitor module.
  6113. * b'27:31 - rsvd1: reserved for future use
  6114. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6115. * in byte units.
  6116. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6117. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6118. * 64, 128, 256.
  6119. * If all 3 bits are set config length is > 256.
  6120. * if val is '0', then ignore this field.
  6121. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6122. * 64, 128, 256.
  6123. * If all 3 bits are set config length is > 256.
  6124. * if val is '0', then ignore this field.
  6125. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6126. * 64, 128, 256.
  6127. * If all 3 bits are set config length is > 256.
  6128. * If val is '0', then ignore this field.
  6129. * - b'25:31 - rsvd2: Reserved for future use
  6130. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6131. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6132. * If packet_type_enable_flags is '1' for MGMT type,
  6133. * monitor will ignore this bit and allow this TLV.
  6134. * If packet_type_enable_flags is '0' for MGMT type,
  6135. * monitor will use this bit to enable/disable logging
  6136. * of this TLV.
  6137. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6138. * If packet_type_enable_flags is '1' for CTRL type,
  6139. * monitor will ignore this bit and allow this TLV.
  6140. * If packet_type_enable_flags is '0' for CTRL type,
  6141. * monitor will use this bit to enable/disable logging
  6142. * of this TLV.
  6143. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6144. * If packet_type_enable_flags is '1' for DATA type,
  6145. * monitor will ignore this bit and allow this TLV.
  6146. * If packet_type_enable_flags is '0' for DATA type,
  6147. * monitor will use this bit to enable/disable logging
  6148. * of this TLV.
  6149. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6150. * If packet_type_enable_flags is '1' for MGMT type,
  6151. * monitor will ignore this bit and allow this TLV.
  6152. * If packet_type_enable_flags is '0' for MGMT type,
  6153. * monitor will use this bit to enable/disable logging
  6154. * of this TLV.
  6155. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6156. * If packet_type_enable_flags is '1' for CTRL type,
  6157. * monitor will ignore this bit and allow this TLV.
  6158. * If packet_type_enable_flags is '0' for CTRL type,
  6159. * monitor will use this bit to enable/disable logging
  6160. * of this TLV.
  6161. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6162. * If packet_type_enable_flags is '1' for DATA type,
  6163. * monitor will ignore this bit and allow this TLV.
  6164. * If packet_type_enable_flags is '0' for DATA type,
  6165. * monitor will use this bit to enable/disable logging
  6166. * of this TLV.
  6167. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6168. * If packet_type_enable_flags is '1' for MGMT type,
  6169. * monitor will ignore this bit and allow this TLV.
  6170. * If packet_type_enable_flags is '0' for MGMT type,
  6171. * monitor will use this bit to enable/disable logging
  6172. * of this TLV.
  6173. * If filter_in_TX_MPDU_START = 1 it is recommended
  6174. * to set this bit.
  6175. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6176. * If packet_type_enable_flags is '1' for CTRL type,
  6177. * monitor will ignore this bit and allow this TLV.
  6178. * If packet_type_enable_flags is '0' for CTRL type,
  6179. * monitor will use this bit to enable/disable logging
  6180. * of this TLV.
  6181. * If filter_in_TX_MPDU_START = 1 it is recommended
  6182. * to set this bit.
  6183. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6184. * If packet_type_enable_flags is '1' for DATA type,
  6185. * monitor will ignore this bit and allow this TLV.
  6186. * If packet_type_enable_flags is '0' for DATA type,
  6187. * monitor will use this bit to enable/disable logging
  6188. * of this TLV.
  6189. * If filter_in_TX_MPDU_START = 1 it is recommended
  6190. * to set this bit.
  6191. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6192. * If packet_type_enable_flags is '1' for MGMT type,
  6193. * monitor will ignore this bit and allow this TLV.
  6194. * If packet_type_enable_flags is '0' for MGMT type,
  6195. * monitor will use this bit to enable/disable logging
  6196. * of this TLV.
  6197. * If filter_in_TX_MSDU_START = 1 it is recommended
  6198. * to set this bit.
  6199. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6200. * If packet_type_enable_flags is '1' for CTRL type,
  6201. * monitor will ignore this bit and allow this TLV.
  6202. * If packet_type_enable_flags is '0' for CTRL type,
  6203. * monitor will use this bit to enable/disable logging
  6204. * of this TLV.
  6205. * If filter_in_TX_MSDU_START = 1 it is recommended
  6206. * to set this bit.
  6207. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6208. * If packet_type_enable_flags is '1' for DATA type,
  6209. * monitor will ignore this bit and allow this TLV.
  6210. * If packet_type_enable_flags is '0' for DATA type,
  6211. * monitor will use this bit to enable/disable logging
  6212. * of this TLV.
  6213. * If filter_in_TX_MSDU_START = 1 it is recommended
  6214. * to set this bit.
  6215. * b'15:31 - rsvd3: Reserved for future use
  6216. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6217. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6218. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6219. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6220. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6221. * - b'8:15 - tx_peer_entry_word_mask:
  6222. * - b'16:23 - tx_queue_ext_word_mask:
  6223. * - b'24:31 - tx_msdu_start_word_mask:
  6224. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6225. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6226. * - b'8:15 - rxpcu_user_setup_word_mask:
  6227. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6228. * MGMT, CTRL, DATA
  6229. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6230. * 0 -> MSDU level logging is enabled
  6231. * (valid only if bit is set in
  6232. * pkt_type_enable_msdu_or_mpdu_logging)
  6233. * 1 -> MPDU level logging is enabled
  6234. * (valid only if bit is set in
  6235. * pkt_type_enable_msdu_or_mpdu_logging)
  6236. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6237. * 0 -> MSDU level logging is enabled
  6238. * (valid only if bit is set in
  6239. * pkt_type_enable_msdu_or_mpdu_logging)
  6240. * 1 -> MPDU level logging is enabled
  6241. * (valid only if bit is set in
  6242. * pkt_type_enable_msdu_or_mpdu_logging)
  6243. * - b'21 - dma_mpdu_data(D) : For DATA
  6244. * 0 -> MSDU level logging is enabled
  6245. * (valid only if bit is set in
  6246. * pkt_type_enable_msdu_or_mpdu_logging)
  6247. * 1 -> MPDU level logging is enabled
  6248. * (valid only if bit is set in
  6249. * pkt_type_enable_msdu_or_mpdu_logging)
  6250. * - b'22:31 - rsvd4 for future use
  6251. */
  6252. PREPACK struct htt_tx_monitor_cfg_t {
  6253. A_UINT32 msg_type: 8,
  6254. pdev_id: 8,
  6255. ring_id: 8,
  6256. status_swap: 1,
  6257. pkt_swap: 1,
  6258. tx_mon_global_en: 1,
  6259. rsvd1: 5;
  6260. A_UINT32 ring_buffer_size: 16,
  6261. config_length_mgmt: 3,
  6262. config_length_ctrl: 3,
  6263. config_length_data: 3,
  6264. rsvd2: 7;
  6265. A_UINT32 pkt_type_enable_flags: 3,
  6266. filter_in_tx_mpdu_start_mgmt: 1,
  6267. filter_in_tx_mpdu_start_ctrl: 1,
  6268. filter_in_tx_mpdu_start_data: 1,
  6269. filter_in_tx_msdu_start_mgmt: 1,
  6270. filter_in_tx_msdu_start_ctrl: 1,
  6271. filter_in_tx_msdu_start_data: 1,
  6272. filter_in_tx_mpdu_end_mgmt: 1,
  6273. filter_in_tx_mpdu_end_ctrl: 1,
  6274. filter_in_tx_mpdu_end_data: 1,
  6275. filter_in_tx_msdu_end_mgmt: 1,
  6276. filter_in_tx_msdu_end_ctrl: 1,
  6277. filter_in_tx_msdu_end_data: 1,
  6278. rsvd3: 17;
  6279. A_UINT32 tlv_filter_mask_in0;
  6280. A_UINT32 tlv_filter_mask_in1;
  6281. A_UINT32 tlv_filter_mask_in2;
  6282. A_UINT32 tlv_filter_mask_in3;
  6283. A_UINT32 tx_fes_setup_word_mask: 8,
  6284. tx_peer_entry_word_mask: 8,
  6285. tx_queue_ext_word_mask: 8,
  6286. tx_msdu_start_word_mask: 8;
  6287. A_UINT32 pcu_ppdu_setup_word_mask;
  6288. A_UINT32 tx_mpdu_start_word_mask: 8,
  6289. rxpcu_user_setup_word_mask: 8,
  6290. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6291. dma_mpdu_mgmt: 1,
  6292. dma_mpdu_ctrl: 1,
  6293. dma_mpdu_data: 1,
  6294. rsvd4: 10;
  6295. } POSTPACK;
  6296. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6297. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6298. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6299. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6300. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6301. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6302. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6303. do { \
  6304. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6305. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6306. } while (0)
  6307. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6308. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6309. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6310. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6311. HTT_TX_MONITOR_CFG_RING_ID_S)
  6312. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6313. do { \
  6314. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6315. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6316. } while (0)
  6317. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6318. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6319. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6320. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6321. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6322. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6323. do { \
  6324. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6325. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6326. } while (0)
  6327. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6328. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6329. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6330. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6331. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6332. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6333. do { \
  6334. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6335. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6336. } while (0)
  6337. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6338. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6339. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6340. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6341. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6342. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6343. do { \
  6344. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6345. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6346. } while (0)
  6347. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6348. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6349. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6350. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6351. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6352. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6353. do { \
  6354. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6355. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6356. } while (0)
  6357. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6358. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6359. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6360. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6361. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6362. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6363. do { \
  6364. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6365. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6366. } while (0)
  6367. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6368. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6369. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6370. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6371. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6372. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6373. do { \
  6374. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6375. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6376. } while (0)
  6377. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6378. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6379. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6380. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6381. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6382. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6383. do { \
  6384. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6385. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6386. } while (0)
  6387. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6388. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6389. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6390. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6391. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6392. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6393. do { \
  6394. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6395. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6396. } while (0)
  6397. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6398. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6399. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6400. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6401. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6402. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6403. do { \
  6404. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6405. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6406. } while (0)
  6407. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6408. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6409. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6410. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6411. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6412. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6413. do { \
  6414. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6415. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6416. } while (0)
  6417. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6418. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6419. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6420. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6421. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6422. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6423. do { \
  6424. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6425. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6426. } while (0)
  6427. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6428. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6429. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6430. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6431. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6432. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6433. do { \
  6434. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6435. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6436. } while (0)
  6437. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6438. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6439. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6440. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6441. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6442. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6443. do { \
  6444. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6445. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6446. } while (0)
  6447. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6448. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6449. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6450. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6451. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6452. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6453. do { \
  6454. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6455. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6456. } while (0)
  6457. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6458. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6459. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6460. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6461. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6462. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6463. do { \
  6464. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6465. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6466. } while (0)
  6467. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6468. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6469. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6470. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6471. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6472. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6473. do { \
  6474. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6475. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6476. } while (0)
  6477. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6478. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6479. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6480. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6481. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6482. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6483. do { \
  6484. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6485. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6486. } while (0)
  6487. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6488. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6489. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6490. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6491. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6492. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6493. do { \
  6494. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6495. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6496. } while (0)
  6497. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6498. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6499. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6500. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6501. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6502. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6503. do { \
  6504. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6505. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6506. } while (0)
  6507. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6508. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6509. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6510. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6511. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6512. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6513. do { \
  6514. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6515. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6516. } while (0)
  6517. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6518. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6519. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6520. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6521. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6522. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6523. do { \
  6524. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6525. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6526. } while (0)
  6527. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6528. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6529. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6530. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6531. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6532. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6533. do { \
  6534. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6535. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6536. } while (0)
  6537. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6538. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6539. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6540. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6541. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6542. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6543. do { \
  6544. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6545. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6546. } while (0)
  6547. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6548. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6549. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6550. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6551. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6552. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6553. do { \
  6554. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6555. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6556. } while (0)
  6557. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6558. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6559. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6560. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6561. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6562. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6563. do { \
  6564. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6565. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6566. } while (0)
  6567. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6568. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6569. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6570. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6571. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6572. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6573. do { \
  6574. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6575. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6576. } while (0)
  6577. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6578. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6579. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6580. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6581. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6582. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6583. do { \
  6584. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6585. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6586. } while (0)
  6587. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6588. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6589. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6590. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6591. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6592. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6593. do { \
  6594. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6595. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6596. } while (0)
  6597. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6598. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6599. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6600. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6601. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6602. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6603. do { \
  6604. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6605. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6606. } while (0)
  6607. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6608. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6609. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6610. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6611. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6612. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6613. do { \
  6614. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6615. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6616. } while (0)
  6617. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6618. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6619. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6620. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6621. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6622. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6623. do { \
  6624. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6625. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6626. } while (0)
  6627. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6628. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6629. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6630. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6631. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6632. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6633. do { \
  6634. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6635. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6636. } while (0)
  6637. /*
  6638. * pkt_type_enable_flags
  6639. */
  6640. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6641. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6642. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6643. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6644. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6645. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6646. /*
  6647. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6648. */
  6649. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6650. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6651. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6652. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6653. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6654. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6655. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6656. do { \
  6657. HTT_CHECK_SET_VAL(httsym, value); \
  6658. (word) |= (value) << httsym##_S; \
  6659. } while (0)
  6660. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6661. (((word) & httsym##_M) >> httsym##_S)
  6662. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6663. * type -> MGMT, CTRL, DATA*/
  6664. #define htt_tx_ring_pkt_type_set( \
  6665. word, mode, type, val) \
  6666. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6667. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6668. #define htt_tx_ring_pkt_type_get( \
  6669. word, mode, type) \
  6670. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6671. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6672. /* Definition to filter in TLVs */
  6673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6718. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6719. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6720. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6721. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6722. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6723. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6724. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6725. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6726. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6727. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6728. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6729. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6730. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6737. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6738. do { \
  6739. HTT_CHECK_SET_VAL(httsym, enable); \
  6740. (word) |= (enable) << httsym##_S; \
  6741. } while (0)
  6742. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6743. (((word) & httsym##_M) >> httsym##_S)
  6744. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6745. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6746. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6747. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6748. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6749. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6797. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6798. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6799. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6800. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6801. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6802. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6803. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6804. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6805. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6806. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6807. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6814. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6815. do { \
  6816. HTT_CHECK_SET_VAL(httsym, enable); \
  6817. (word) |= (enable) << httsym##_S; \
  6818. } while (0)
  6819. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6820. (((word) & httsym##_M) >> httsym##_S)
  6821. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6822. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6823. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6824. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6825. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6826. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6873. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6874. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6875. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6876. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6877. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6878. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6879. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6880. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6881. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6882. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6883. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6884. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6891. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6892. do { \
  6893. HTT_CHECK_SET_VAL(httsym, enable); \
  6894. (word) |= (enable) << httsym##_S; \
  6895. } while (0)
  6896. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6897. (((word) & httsym##_M) >> httsym##_S)
  6898. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6899. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6900. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6901. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6902. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6903. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6948. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6949. do { \
  6950. HTT_CHECK_SET_VAL(httsym, enable); \
  6951. (word) |= (enable) << httsym##_S; \
  6952. } while (0)
  6953. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6954. (((word) & httsym##_M) >> httsym##_S)
  6955. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6956. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6957. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6958. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6959. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6960. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6961. /**
  6962. * @brief host --> target Receive Flow Steering configuration message definition
  6963. *
  6964. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6965. *
  6966. * host --> target Receive Flow Steering configuration message definition.
  6967. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6968. * The reason for this is we want RFS to be configured and ready before MAC
  6969. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6970. *
  6971. * |31 24|23 16|15 9|8|7 0|
  6972. * |----------------+----------------+----------------+----------------|
  6973. * | reserved |E| msg type |
  6974. * |-------------------------------------------------------------------|
  6975. * Where E = RFS enable flag
  6976. *
  6977. * The RFS_CONFIG message consists of a single 4-byte word.
  6978. *
  6979. * Header fields:
  6980. * - MSG_TYPE
  6981. * Bits 7:0
  6982. * Purpose: identifies this as a RFS config msg
  6983. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6984. * - RFS_CONFIG
  6985. * Bit 8
  6986. * Purpose: Tells target whether to enable (1) or disable (0)
  6987. * flow steering feature when sending rx indication messages to host
  6988. */
  6989. #define HTT_H2T_RFS_CONFIG_M 0x100
  6990. #define HTT_H2T_RFS_CONFIG_S 8
  6991. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6992. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6993. HTT_H2T_RFS_CONFIG_S)
  6994. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6995. do { \
  6996. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6997. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6998. } while (0)
  6999. #define HTT_RFS_CFG_REQ_BYTES 4
  7000. /**
  7001. * @brief host -> target FW extended statistics request
  7002. *
  7003. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7004. *
  7005. * @details
  7006. * The following field definitions describe the format of the HTT host
  7007. * to target FW extended stats retrieve message.
  7008. * The message specifies the type of stats the host wants to retrieve.
  7009. *
  7010. * |31 24|23 16|15 8|7 0|
  7011. * |-----------------------------------------------------------|
  7012. * | reserved | stats type | pdev_mask | msg type |
  7013. * |-----------------------------------------------------------|
  7014. * | config param [0] |
  7015. * |-----------------------------------------------------------|
  7016. * | config param [1] |
  7017. * |-----------------------------------------------------------|
  7018. * | config param [2] |
  7019. * |-----------------------------------------------------------|
  7020. * | config param [3] |
  7021. * |-----------------------------------------------------------|
  7022. * | reserved |
  7023. * |-----------------------------------------------------------|
  7024. * | cookie LSBs |
  7025. * |-----------------------------------------------------------|
  7026. * | cookie MSBs |
  7027. * |-----------------------------------------------------------|
  7028. * Header fields:
  7029. * - MSG_TYPE
  7030. * Bits 7:0
  7031. * Purpose: identifies this is a extended stats upload request message
  7032. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7033. * - PDEV_MASK
  7034. * Bits 8:15
  7035. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7036. * Value: This is a overloaded field, refer to usage and interpretation of
  7037. * PDEV in interface document.
  7038. * Bit 8 : Reserved for SOC stats
  7039. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7040. * Indicates MACID_MASK in DBS
  7041. * - STATS_TYPE
  7042. * Bits 23:16
  7043. * Purpose: identifies which FW statistics to upload
  7044. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7045. * - Reserved
  7046. * Bits 31:24
  7047. * - CONFIG_PARAM [0]
  7048. * Bits 31:0
  7049. * Purpose: give an opaque configuration value to the specified stats type
  7050. * Value: stats-type specific configuration value
  7051. * Refer to htt_stats.h for interpretation for each stats sub_type
  7052. * - CONFIG_PARAM [1]
  7053. * Bits 31:0
  7054. * Purpose: give an opaque configuration value to the specified stats type
  7055. * Value: stats-type specific configuration value
  7056. * Refer to htt_stats.h for interpretation for each stats sub_type
  7057. * - CONFIG_PARAM [2]
  7058. * Bits 31:0
  7059. * Purpose: give an opaque configuration value to the specified stats type
  7060. * Value: stats-type specific configuration value
  7061. * Refer to htt_stats.h for interpretation for each stats sub_type
  7062. * - CONFIG_PARAM [3]
  7063. * Bits 31:0
  7064. * Purpose: give an opaque configuration value to the specified stats type
  7065. * Value: stats-type specific configuration value
  7066. * Refer to htt_stats.h for interpretation for each stats sub_type
  7067. * - Reserved [31:0] for future use.
  7068. * - COOKIE_LSBS
  7069. * Bits 31:0
  7070. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7071. * message with its preceding host->target stats request message.
  7072. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7073. * - COOKIE_MSBS
  7074. * Bits 31:0
  7075. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7076. * message with its preceding host->target stats request message.
  7077. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7078. */
  7079. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7080. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7081. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7082. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7083. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7084. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7085. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7086. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7087. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7088. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7089. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7090. do { \
  7091. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7092. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7093. } while (0)
  7094. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7095. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7096. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7097. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7098. do { \
  7099. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7100. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7101. } while (0)
  7102. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7103. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7104. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7105. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7106. do { \
  7107. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7108. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7109. } while (0)
  7110. /**
  7111. * @brief host -> target FW streaming statistics request
  7112. *
  7113. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7114. *
  7115. * @details
  7116. * The following field definitions describe the format of the HTT host
  7117. * to target message that requests the target to start or stop producing
  7118. * ongoing stats of the specified type.
  7119. *
  7120. * |31|30 |23 16|15 8|7 0|
  7121. * |-----------------------------------------------------------|
  7122. * |EN| reserved | stats type | reserved | msg type |
  7123. * |-----------------------------------------------------------|
  7124. * | config param [0] |
  7125. * |-----------------------------------------------------------|
  7126. * | config param [1] |
  7127. * |-----------------------------------------------------------|
  7128. * | config param [2] |
  7129. * |-----------------------------------------------------------|
  7130. * | config param [3] |
  7131. * |-----------------------------------------------------------|
  7132. * Where:
  7133. * - EN is an enable/disable flag
  7134. * Header fields:
  7135. * - MSG_TYPE
  7136. * Bits 7:0
  7137. * Purpose: identifies this is a streaming stats upload request message
  7138. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7139. * - STATS_TYPE
  7140. * Bits 23:16
  7141. * Purpose: identifies which FW statistics to upload
  7142. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7143. * Only the htt_dbg_ext_stats_type values identified as streaming
  7144. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7145. * - ENABLE
  7146. * Bit 31
  7147. * Purpose: enable/disable the target's ongoing stats of the specified type
  7148. * Value:
  7149. * 0 - disable ongoing production of the specified stats type
  7150. * 1 - enable ongoing production of the specified stats type
  7151. * - CONFIG_PARAM [0]
  7152. * Bits 31:0
  7153. * Purpose: give an opaque configuration value to the specified stats type
  7154. * Value: stats-type specific configuration value
  7155. * Refer to htt_stats.h for interpretation for each stats sub_type
  7156. * - CONFIG_PARAM [1]
  7157. * Bits 31:0
  7158. * Purpose: give an opaque configuration value to the specified stats type
  7159. * Value: stats-type specific configuration value
  7160. * Refer to htt_stats.h for interpretation for each stats sub_type
  7161. * - CONFIG_PARAM [2]
  7162. * Bits 31:0
  7163. * Purpose: give an opaque configuration value to the specified stats type
  7164. * Value: stats-type specific configuration value
  7165. * Refer to htt_stats.h for interpretation for each stats sub_type
  7166. * - CONFIG_PARAM [3]
  7167. * Bits 31:0
  7168. * Purpose: give an opaque configuration value to the specified stats type
  7169. * Value: stats-type specific configuration value
  7170. * Refer to htt_stats.h for interpretation for each stats sub_type
  7171. */
  7172. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7173. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7174. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7175. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7176. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7177. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7178. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7179. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7180. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7181. do { \
  7182. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7183. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7184. } while (0)
  7185. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7186. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7187. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7188. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7189. do { \
  7190. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7191. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7192. } while (0)
  7193. /**
  7194. * @brief host -> target FW PPDU_STATS request message
  7195. *
  7196. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7197. *
  7198. * @details
  7199. * The following field definitions describe the format of the HTT host
  7200. * to target FW for PPDU_STATS_CFG msg.
  7201. * The message allows the host to configure the PPDU_STATS_IND messages
  7202. * produced by the target.
  7203. *
  7204. * |31 24|23 16|15 8|7 0|
  7205. * |-----------------------------------------------------------|
  7206. * | REQ bit mask | pdev_mask | msg type |
  7207. * |-----------------------------------------------------------|
  7208. * Header fields:
  7209. * - MSG_TYPE
  7210. * Bits 7:0
  7211. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7212. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7213. * - PDEV_MASK
  7214. * Bits 8:15
  7215. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7216. * Value: This is a overloaded field, refer to usage and interpretation of
  7217. * PDEV in interface document.
  7218. * Bit 8 : Reserved for SOC stats
  7219. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7220. * Indicates MACID_MASK in DBS
  7221. * - REQ_TLV_BIT_MASK
  7222. * Bits 16:31
  7223. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7224. * needs to be included in the target's PPDU_STATS_IND messages.
  7225. * Value: refer htt_ppdu_stats_tlv_tag_t
  7226. *
  7227. */
  7228. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7229. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7230. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7231. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7232. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7233. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7234. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7235. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7236. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7237. do { \
  7238. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7239. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7240. } while (0)
  7241. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7242. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7243. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7244. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7245. do { \
  7246. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7247. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7248. } while (0)
  7249. /**
  7250. * @brief Host-->target HTT RX FSE setup message
  7251. *
  7252. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7253. *
  7254. * @details
  7255. * Through this message, the host will provide details of the flow tables
  7256. * in host DDR along with hash keys.
  7257. * This message can be sent per SOC or per PDEV, which is differentiated
  7258. * by pdev id values.
  7259. * The host will allocate flow search table and sends table size,
  7260. * physical DMA address of flow table, and hash keys to firmware to
  7261. * program into the RXOLE FSE HW block.
  7262. *
  7263. * The following field definitions describe the format of the RX FSE setup
  7264. * message sent from the host to target
  7265. *
  7266. * Header fields:
  7267. * dword0 - b'7:0 - msg_type: This will be set to
  7268. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7269. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7270. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7271. * pdev's LMAC ring.
  7272. * b'31:16 - reserved : Reserved for future use
  7273. * dword1 - b'19:0 - number of records: This field indicates the number of
  7274. * entries in the flow table. For example: 8k number of
  7275. * records is equivalent to
  7276. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7277. * b'27:20 - max search: This field specifies the skid length to FSE
  7278. * parser HW module whenever match is not found at the
  7279. * exact index pointed by hash.
  7280. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7281. * Refer htt_ip_da_sa_prefix below for more details.
  7282. * b'31:30 - reserved: Reserved for future use
  7283. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7284. * table allocated by host in DDR
  7285. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7286. * table allocated by host in DDR
  7287. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7288. * entry hashing
  7289. *
  7290. *
  7291. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7292. * |---------------------------------------------------------------|
  7293. * | reserved | pdev_id | MSG_TYPE |
  7294. * |---------------------------------------------------------------|
  7295. * |resvd|IPDSA| max_search | Number of records |
  7296. * |---------------------------------------------------------------|
  7297. * | base address lo |
  7298. * |---------------------------------------------------------------|
  7299. * | base address high |
  7300. * |---------------------------------------------------------------|
  7301. * | toeplitz key 31_0 |
  7302. * |---------------------------------------------------------------|
  7303. * | toeplitz key 63_32 |
  7304. * |---------------------------------------------------------------|
  7305. * | toeplitz key 95_64 |
  7306. * |---------------------------------------------------------------|
  7307. * | toeplitz key 127_96 |
  7308. * |---------------------------------------------------------------|
  7309. * | toeplitz key 159_128 |
  7310. * |---------------------------------------------------------------|
  7311. * | toeplitz key 191_160 |
  7312. * |---------------------------------------------------------------|
  7313. * | toeplitz key 223_192 |
  7314. * |---------------------------------------------------------------|
  7315. * | toeplitz key 255_224 |
  7316. * |---------------------------------------------------------------|
  7317. * | toeplitz key 287_256 |
  7318. * |---------------------------------------------------------------|
  7319. * | reserved | toeplitz key 314_288(26:0 bits) |
  7320. * |---------------------------------------------------------------|
  7321. * where:
  7322. * IPDSA = ip_da_sa
  7323. */
  7324. /**
  7325. * @brief: htt_ip_da_sa_prefix
  7326. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7327. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7328. * documentation per RFC3849
  7329. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7330. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7331. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7332. */
  7333. enum htt_ip_da_sa_prefix {
  7334. HTT_RX_IPV6_20010db8,
  7335. HTT_RX_IPV4_MAPPED_IPV6,
  7336. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7337. HTT_RX_IPV6_64FF9B,
  7338. };
  7339. /**
  7340. * @brief Host-->target HTT RX FISA configure and enable
  7341. *
  7342. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7343. *
  7344. * @details
  7345. * The host will send this command down to configure and enable the FISA
  7346. * operational params.
  7347. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7348. * register.
  7349. * Should configure both the MACs.
  7350. *
  7351. * dword0 - b'7:0 - msg_type:
  7352. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7353. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7354. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7355. * pdev's LMAC ring.
  7356. * b'31:16 - reserved : Reserved for future use
  7357. *
  7358. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7359. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7360. * packets. 1 flow search will be skipped
  7361. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7362. * tcp,udp packets
  7363. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7364. * calculation
  7365. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7366. * calculation
  7367. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7368. * calculation
  7369. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7370. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7371. * length
  7372. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7373. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7374. * length
  7375. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7376. * num jump
  7377. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7378. * num jump
  7379. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7380. * data type switch has happend for MPDU Sequence num jump
  7381. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7382. * for MPDU Sequence num jump
  7383. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7384. * for decrypt errors
  7385. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7386. * while aggregating a msdu
  7387. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7388. * The aggregation is done until (number of MSDUs aggregated
  7389. * < LIMIT + 1)
  7390. * b'31:18 - Reserved
  7391. *
  7392. * fisa_control_value - 32bit value FW can write to register
  7393. *
  7394. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7395. * Threshold value for FISA timeout (units are microseconds).
  7396. * When the global timestamp exceeds this threshold, FISA
  7397. * aggregation will be restarted.
  7398. * A value of 0 means timeout is disabled.
  7399. * Compare the threshold register with timestamp field in
  7400. * flow entry to generate timeout for the flow.
  7401. *
  7402. * |31 18 |17 16|15 8|7 0|
  7403. * |-------------------------------------------------------------|
  7404. * | reserved | pdev_mask | msg type |
  7405. * |-------------------------------------------------------------|
  7406. * | reserved | FISA_CTRL |
  7407. * |-------------------------------------------------------------|
  7408. * | FISA_TIMEOUT_THRESH |
  7409. * |-------------------------------------------------------------|
  7410. */
  7411. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7412. A_UINT32 msg_type:8,
  7413. pdev_id:8,
  7414. reserved0:16;
  7415. /**
  7416. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7417. * [17:0]
  7418. */
  7419. union {
  7420. /*
  7421. * fisa_control_bits structure is deprecated.
  7422. * Please use fisa_control_bits_v2 going forward.
  7423. */
  7424. struct {
  7425. A_UINT32 fisa_enable: 1,
  7426. ipsec_skip_search: 1,
  7427. nontcp_skip_search: 1,
  7428. add_ipv4_fixed_hdr_len: 1,
  7429. add_ipv6_fixed_hdr_len: 1,
  7430. add_tcp_fixed_hdr_len: 1,
  7431. add_udp_hdr_len: 1,
  7432. chksum_cum_ip_len_en: 1,
  7433. disable_tid_check: 1,
  7434. disable_ta_check: 1,
  7435. disable_qos_check: 1,
  7436. disable_raw_check: 1,
  7437. disable_decrypt_err_check: 1,
  7438. disable_msdu_drop_check: 1,
  7439. fisa_aggr_limit: 4,
  7440. reserved: 14;
  7441. } fisa_control_bits;
  7442. struct {
  7443. A_UINT32 fisa_enable: 1,
  7444. fisa_aggr_limit: 4,
  7445. reserved: 27;
  7446. } fisa_control_bits_v2;
  7447. A_UINT32 fisa_control_value;
  7448. } u_fisa_control;
  7449. /**
  7450. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7451. * timeout threshold for aggregation. Unit in usec.
  7452. * [31:0]
  7453. */
  7454. A_UINT32 fisa_timeout_threshold;
  7455. } POSTPACK;
  7456. /* DWord 0: pdev-ID */
  7457. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7458. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7459. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7460. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7461. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7462. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7463. do { \
  7464. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7465. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7466. } while (0)
  7467. /* Dword 1: fisa_control_value fisa config */
  7468. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7469. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7470. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7471. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7472. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7473. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7474. do { \
  7475. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7476. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7477. } while (0)
  7478. /* Dword 1: fisa_control_value ipsec_skip_search */
  7479. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7480. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7481. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7482. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7483. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7484. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7485. do { \
  7486. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7487. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7488. } while (0)
  7489. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7490. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7491. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7492. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7493. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7494. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7495. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7496. do { \
  7497. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7498. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7499. } while (0)
  7500. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7501. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7502. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7503. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7504. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7505. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7506. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7507. do { \
  7508. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7509. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7510. } while (0)
  7511. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7512. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7513. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7514. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7515. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7516. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7517. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7518. do { \
  7519. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7520. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7521. } while (0)
  7522. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7523. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7524. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7525. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7526. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7527. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7528. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7529. do { \
  7530. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7531. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7532. } while (0)
  7533. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7534. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7535. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7536. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7537. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7538. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7539. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7540. do { \
  7541. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7542. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7543. } while (0)
  7544. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7545. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7546. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7547. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7548. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7549. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7550. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7551. do { \
  7552. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7553. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7554. } while (0)
  7555. /* Dword 1: fisa_control_value disable_tid_check */
  7556. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7557. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7558. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7559. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7560. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7561. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7562. do { \
  7563. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7564. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7565. } while (0)
  7566. /* Dword 1: fisa_control_value disable_ta_check */
  7567. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7568. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7569. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7570. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7571. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7572. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7573. do { \
  7574. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7575. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7576. } while (0)
  7577. /* Dword 1: fisa_control_value disable_qos_check */
  7578. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7579. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7580. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7581. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7582. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7583. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7584. do { \
  7585. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7586. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7587. } while (0)
  7588. /* Dword 1: fisa_control_value disable_raw_check */
  7589. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7590. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7591. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7592. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7593. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7594. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7595. do { \
  7596. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7597. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7598. } while (0)
  7599. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7600. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7601. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7602. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7603. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7604. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7605. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7606. do { \
  7607. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7608. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7609. } while (0)
  7610. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7611. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7612. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7613. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7614. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7615. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7616. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7617. do { \
  7618. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7619. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7620. } while (0)
  7621. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7622. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7623. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7624. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7625. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7626. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7627. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7628. do { \
  7629. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7630. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7631. } while (0)
  7632. /* Dword 1: fisa_control_value fisa config */
  7633. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7634. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7635. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7636. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7637. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7638. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7639. do { \
  7640. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7641. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7642. } while (0)
  7643. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7644. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7645. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7646. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7647. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7648. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7649. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7650. do { \
  7651. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7652. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7653. } while (0)
  7654. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7655. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7656. pdev_id:8,
  7657. reserved0:16;
  7658. A_UINT32 num_records:20,
  7659. max_search:8,
  7660. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7661. reserved1:2;
  7662. A_UINT32 base_addr_lo;
  7663. A_UINT32 base_addr_hi;
  7664. A_UINT32 toeplitz31_0;
  7665. A_UINT32 toeplitz63_32;
  7666. A_UINT32 toeplitz95_64;
  7667. A_UINT32 toeplitz127_96;
  7668. A_UINT32 toeplitz159_128;
  7669. A_UINT32 toeplitz191_160;
  7670. A_UINT32 toeplitz223_192;
  7671. A_UINT32 toeplitz255_224;
  7672. A_UINT32 toeplitz287_256;
  7673. A_UINT32 toeplitz314_288:27,
  7674. reserved2:5;
  7675. } POSTPACK;
  7676. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7677. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7678. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7679. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7680. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7681. /* DWORD 0: Pdev ID */
  7682. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7683. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7684. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7685. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7686. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7687. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7688. do { \
  7689. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7690. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7691. } while (0)
  7692. /* DWORD 1:num of records */
  7693. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7694. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7695. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7696. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7697. HTT_RX_FSE_SETUP_NUM_REC_S)
  7698. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7699. do { \
  7700. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7701. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7702. } while (0)
  7703. /* DWORD 1:max_search */
  7704. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7705. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7706. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7707. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7708. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7709. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7710. do { \
  7711. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7712. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7713. } while (0)
  7714. /* DWORD 1:ip_da_sa prefix */
  7715. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7716. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7717. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7718. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7719. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7720. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7721. do { \
  7722. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7723. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7724. } while (0)
  7725. /* DWORD 2: Base Address LO */
  7726. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7727. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7728. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7729. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7730. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7731. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7732. do { \
  7733. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7734. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7735. } while (0)
  7736. /* DWORD 3: Base Address High */
  7737. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7738. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7739. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7740. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7741. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7742. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7743. do { \
  7744. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7745. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7746. } while (0)
  7747. /* DWORD 4-12: Hash Value */
  7748. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7749. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7750. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7751. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7752. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7753. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7754. do { \
  7755. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7756. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7757. } while (0)
  7758. /* DWORD 13: Hash Value 314:288 bits */
  7759. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7760. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7761. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7762. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7763. do { \
  7764. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7765. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7766. } while (0)
  7767. /**
  7768. * @brief Host-->target HTT RX FSE operation message
  7769. *
  7770. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7771. *
  7772. * @details
  7773. * The host will send this Flow Search Engine (FSE) operation message for
  7774. * every flow add/delete operation.
  7775. * The FSE operation includes FSE full cache invalidation or individual entry
  7776. * invalidation.
  7777. * This message can be sent per SOC or per PDEV which is differentiated
  7778. * by pdev id values.
  7779. *
  7780. * |31 16|15 8|7 1|0|
  7781. * |-------------------------------------------------------------|
  7782. * | reserved | pdev_id | MSG_TYPE |
  7783. * |-------------------------------------------------------------|
  7784. * | reserved | operation |I|
  7785. * |-------------------------------------------------------------|
  7786. * | ip_src_addr_31_0 |
  7787. * |-------------------------------------------------------------|
  7788. * | ip_src_addr_63_32 |
  7789. * |-------------------------------------------------------------|
  7790. * | ip_src_addr_95_64 |
  7791. * |-------------------------------------------------------------|
  7792. * | ip_src_addr_127_96 |
  7793. * |-------------------------------------------------------------|
  7794. * | ip_dst_addr_31_0 |
  7795. * |-------------------------------------------------------------|
  7796. * | ip_dst_addr_63_32 |
  7797. * |-------------------------------------------------------------|
  7798. * | ip_dst_addr_95_64 |
  7799. * |-------------------------------------------------------------|
  7800. * | ip_dst_addr_127_96 |
  7801. * |-------------------------------------------------------------|
  7802. * | l4_dst_port | l4_src_port |
  7803. * | (32-bit SPI incase of IPsec) |
  7804. * |-------------------------------------------------------------|
  7805. * | reserved | l4_proto |
  7806. * |-------------------------------------------------------------|
  7807. *
  7808. * where I is 1-bit ipsec_valid.
  7809. *
  7810. * The following field definitions describe the format of the RX FSE operation
  7811. * message sent from the host to target for every add/delete flow entry to flow
  7812. * table.
  7813. *
  7814. * Header fields:
  7815. * dword0 - b'7:0 - msg_type: This will be set to
  7816. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7817. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7818. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7819. * specified pdev's LMAC ring.
  7820. * b'31:16 - reserved : Reserved for future use
  7821. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7822. * (Internet Protocol Security).
  7823. * IPsec describes the framework for providing security at
  7824. * IP layer. IPsec is defined for both versions of IP:
  7825. * IPV4 and IPV6.
  7826. * Please refer to htt_rx_flow_proto enumeration below for
  7827. * more info.
  7828. * ipsec_valid = 1 for IPSEC packets
  7829. * ipsec_valid = 0 for IP Packets
  7830. * b'7:1 - operation: This indicates types of FSE operation.
  7831. * Refer to htt_rx_fse_operation enumeration:
  7832. * 0 - No Cache Invalidation required
  7833. * 1 - Cache invalidate only one entry given by IP
  7834. * src/dest address at DWORD[2:9]
  7835. * 2 - Complete FSE Cache Invalidation
  7836. * 3 - FSE Disable
  7837. * 4 - FSE Enable
  7838. * b'31:8 - reserved: Reserved for future use
  7839. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7840. * for per flow addition/deletion
  7841. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7842. * and the subsequent 3 A_UINT32 will be padding bytes.
  7843. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7844. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7845. * from 0 to 65535 but only 0 to 1023 are designated as
  7846. * well-known ports. Refer to [RFC1700] for more details.
  7847. * This field is valid only if
  7848. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7849. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7850. * range from 0 to 65535 but only 0 to 1023 are designated
  7851. * as well-known ports. Refer to [RFC1700] for more details.
  7852. * This field is valid only if
  7853. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7854. * - SPI (31:0): Security Parameters Index is an
  7855. * identification tag added to the header while using IPsec
  7856. * for tunneling the IP traffici.
  7857. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7858. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7859. * Assigned Internet Protocol Numbers.
  7860. * l4_proto numbers for standard protocol like UDP/TCP
  7861. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7862. * l4_proto = 17 for UDP etc.
  7863. * b'31:8 - reserved: Reserved for future use.
  7864. *
  7865. */
  7866. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7867. A_UINT32 msg_type:8,
  7868. pdev_id:8,
  7869. reserved0:16;
  7870. A_UINT32 ipsec_valid:1,
  7871. operation:7,
  7872. reserved1:24;
  7873. A_UINT32 ip_src_addr_31_0;
  7874. A_UINT32 ip_src_addr_63_32;
  7875. A_UINT32 ip_src_addr_95_64;
  7876. A_UINT32 ip_src_addr_127_96;
  7877. A_UINT32 ip_dest_addr_31_0;
  7878. A_UINT32 ip_dest_addr_63_32;
  7879. A_UINT32 ip_dest_addr_95_64;
  7880. A_UINT32 ip_dest_addr_127_96;
  7881. union {
  7882. A_UINT32 spi;
  7883. struct {
  7884. A_UINT32 l4_src_port:16,
  7885. l4_dest_port:16;
  7886. } ip;
  7887. } u;
  7888. A_UINT32 l4_proto:8,
  7889. reserved:24;
  7890. } POSTPACK;
  7891. /**
  7892. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7893. *
  7894. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7895. *
  7896. * @details
  7897. * The host will send this Full monitor mode register configuration message.
  7898. * This message can be sent per SOC or per PDEV which is differentiated
  7899. * by pdev id values.
  7900. *
  7901. * |31 16|15 11|10 8|7 3|2|1|0|
  7902. * |-------------------------------------------------------------|
  7903. * | reserved | pdev_id | MSG_TYPE |
  7904. * |-------------------------------------------------------------|
  7905. * | reserved |Release Ring |N|Z|E|
  7906. * |-------------------------------------------------------------|
  7907. *
  7908. * where E is 1-bit full monitor mode enable/disable.
  7909. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7910. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7911. *
  7912. * The following field definitions describe the format of the full monitor
  7913. * mode configuration message sent from the host to target for each pdev.
  7914. *
  7915. * Header fields:
  7916. * dword0 - b'7:0 - msg_type: This will be set to
  7917. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7918. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7919. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7920. * specified pdev's LMAC ring.
  7921. * b'31:16 - reserved : Reserved for future use.
  7922. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7923. * monitor mode rxdma register is to be enabled or disabled.
  7924. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7925. * additional descriptors at ppdu end for zero mpdus
  7926. * enabled or disabled.
  7927. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7928. * additional descriptors at ppdu end for non zero mpdus
  7929. * enabled or disabled.
  7930. * b'10:3 - release_ring: This indicates the destination ring
  7931. * selection for the descriptor at the end of PPDU
  7932. * 0 - REO ring select
  7933. * 1 - FW ring select
  7934. * 2 - SW ring select
  7935. * 3 - Release ring select
  7936. * Refer to htt_rx_full_mon_release_ring.
  7937. * b'31:11 - reserved for future use
  7938. */
  7939. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7940. A_UINT32 msg_type:8,
  7941. pdev_id:8,
  7942. reserved0:16;
  7943. A_UINT32 full_monitor_mode_enable:1,
  7944. addnl_descs_zero_mpdus_end:1,
  7945. addnl_descs_non_zero_mpdus_end:1,
  7946. release_ring:8,
  7947. reserved1:21;
  7948. } POSTPACK;
  7949. /**
  7950. * Enumeration for full monitor mode destination ring select
  7951. * 0 - REO destination ring select
  7952. * 1 - FW destination ring select
  7953. * 2 - SW destination ring select
  7954. * 3 - Release destination ring select
  7955. */
  7956. enum htt_rx_full_mon_release_ring {
  7957. HTT_RX_MON_RING_REO,
  7958. HTT_RX_MON_RING_FW,
  7959. HTT_RX_MON_RING_SW,
  7960. HTT_RX_MON_RING_RELEASE,
  7961. };
  7962. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7963. /* DWORD 0: Pdev ID */
  7964. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7965. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7966. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7967. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7968. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7969. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7970. do { \
  7971. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7972. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7973. } while (0)
  7974. /* DWORD 1:ENABLE */
  7975. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7976. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7977. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7978. do { \
  7979. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7980. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7981. } while (0)
  7982. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7983. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7984. /* DWORD 1:ZERO_MPDU */
  7985. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7986. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7987. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7988. do { \
  7989. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7990. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7991. } while (0)
  7992. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7993. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7994. /* DWORD 1:NON_ZERO_MPDU */
  7995. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7996. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7997. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7998. do { \
  7999. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8000. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8001. } while (0)
  8002. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8003. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8004. /* DWORD 1:RELEASE_RINGS */
  8005. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8006. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8007. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8008. do { \
  8009. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8010. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8011. } while (0)
  8012. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8013. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8014. /**
  8015. * Enumeration for IP Protocol or IPSEC Protocol
  8016. * IPsec describes the framework for providing security at IP layer.
  8017. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8018. */
  8019. enum htt_rx_flow_proto {
  8020. HTT_RX_FLOW_IP_PROTO,
  8021. HTT_RX_FLOW_IPSEC_PROTO,
  8022. };
  8023. /**
  8024. * Enumeration for FSE Cache Invalidation
  8025. * 0 - No Cache Invalidation required
  8026. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8027. * 2 - Complete FSE Cache Invalidation
  8028. * 3 - FSE Disable
  8029. * 4 - FSE Enable
  8030. */
  8031. enum htt_rx_fse_operation {
  8032. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8033. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8034. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8035. HTT_RX_FSE_DISABLE,
  8036. HTT_RX_FSE_ENABLE,
  8037. };
  8038. /* DWORD 0: Pdev ID */
  8039. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8040. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8041. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8042. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8043. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8044. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8045. do { \
  8046. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8047. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8048. } while (0)
  8049. /* DWORD 1:IP PROTO or IPSEC */
  8050. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8051. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8052. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8053. do { \
  8054. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8055. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8056. } while (0)
  8057. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8058. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8059. /* DWORD 1:FSE Operation */
  8060. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8061. #define HTT_RX_FSE_OPERATION_S 1
  8062. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8063. do { \
  8064. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8065. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8066. } while (0)
  8067. #define HTT_RX_FSE_OPERATION_GET(word) \
  8068. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8069. /* DWORD 2-9:IP Address */
  8070. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8071. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8072. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8073. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8074. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8075. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8076. do { \
  8077. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8078. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8079. } while (0)
  8080. /* DWORD 10:Source Port Number */
  8081. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8082. #define HTT_RX_FSE_SOURCEPORT_S 0
  8083. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8084. do { \
  8085. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8086. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8087. } while (0)
  8088. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8089. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8090. /* DWORD 11:Destination Port Number */
  8091. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8092. #define HTT_RX_FSE_DESTPORT_S 16
  8093. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8094. do { \
  8095. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8096. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8097. } while (0)
  8098. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8099. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8100. /* DWORD 10-11:SPI (In case of IPSEC) */
  8101. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8102. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8103. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8104. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8105. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8106. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8107. do { \
  8108. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8109. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8110. } while (0)
  8111. /* DWORD 12:L4 PROTO */
  8112. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8113. #define HTT_RX_FSE_L4_PROTO_S 0
  8114. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8115. do { \
  8116. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8117. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8118. } while (0)
  8119. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8120. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8121. /**
  8122. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8123. *
  8124. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8125. *
  8126. * |31 24|23 |15 8|7 2|1|0|
  8127. * |----------------+----------------+----------------+----------------|
  8128. * | reserved | pdev_id | msg_type |
  8129. * |---------------------------------+----------------+----------------|
  8130. * | reserved |E|F|
  8131. * |---------------------------------+----------------+----------------|
  8132. * Where E = Configure the target to provide the 3-tuple hash value in
  8133. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8134. * F = Configure the target to provide the 3-tuple hash value in
  8135. * flow_id_toeplitz field of rx_msdu_start tlv
  8136. *
  8137. * The following field definitions describe the format of the 3 tuple hash value
  8138. * message sent from the host to target as part of initialization sequence.
  8139. *
  8140. * Header fields:
  8141. * dword0 - b'7:0 - msg_type: This will be set to
  8142. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8143. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8144. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8145. * specified pdev's LMAC ring.
  8146. * b'31:16 - reserved : Reserved for future use
  8147. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8148. * b'1 - toeplitz_hash_2_or_4_field_enable
  8149. * b'31:2 - reserved : Reserved for future use
  8150. * ---------+------+----------------------------------------------------------
  8151. * bit1 | bit0 | Functionality
  8152. * ---------+------+----------------------------------------------------------
  8153. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8154. * | | in flow_id_toeplitz field
  8155. * ---------+------+----------------------------------------------------------
  8156. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8157. * | | in toeplitz_hash_2_or_4 field
  8158. * ---------+------+----------------------------------------------------------
  8159. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8160. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8161. * ---------+------+----------------------------------------------------------
  8162. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8163. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8164. * | | toeplitz_hash_2_or_4 field
  8165. *----------------------------------------------------------------------------
  8166. */
  8167. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8168. A_UINT32 msg_type :8,
  8169. pdev_id :8,
  8170. reserved0 :16;
  8171. A_UINT32 flow_id_toeplitz_field_enable :1,
  8172. toeplitz_hash_2_or_4_field_enable :1,
  8173. reserved1 :30;
  8174. } POSTPACK;
  8175. /* DWORD0 : pdev_id configuration Macros */
  8176. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8177. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8178. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8179. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8180. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8181. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8182. do { \
  8183. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8184. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8185. } while (0)
  8186. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8187. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8188. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8189. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8190. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8191. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8192. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8193. do { \
  8194. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8195. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8196. } while (0)
  8197. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8198. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8199. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8200. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8201. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8202. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8203. do { \
  8204. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8205. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8206. } while (0)
  8207. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8208. /**
  8209. * @brief host --> target Host PA Address Size
  8210. *
  8211. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8212. *
  8213. * @details
  8214. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8215. * provide the physical start address and size of each of the memory
  8216. * areas within host DDR that the target FW may need to access.
  8217. *
  8218. * For example, the host can use this message to allow the target FW
  8219. * to set up access to the host's pools of TQM link descriptors.
  8220. * The message would appear as follows:
  8221. *
  8222. * |31 24|23 16|15 8|7 0|
  8223. * |----------------+----------------+----------------+----------------|
  8224. * | reserved | num_entries | msg_type |
  8225. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8226. * | mem area 0 size |
  8227. * |----------------+----------------+----------------+----------------|
  8228. * | mem area 0 physical_address_lo |
  8229. * |----------------+----------------+----------------+----------------|
  8230. * | mem area 0 physical_address_hi |
  8231. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8232. * | mem area 1 size |
  8233. * |----------------+----------------+----------------+----------------|
  8234. * | mem area 1 physical_address_lo |
  8235. * |----------------+----------------+----------------+----------------|
  8236. * | mem area 1 physical_address_hi |
  8237. * |----------------+----------------+----------------+----------------|
  8238. * ...
  8239. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8240. * | mem area N size |
  8241. * |----------------+----------------+----------------+----------------|
  8242. * | mem area N physical_address_lo |
  8243. * |----------------+----------------+----------------+----------------|
  8244. * | mem area N physical_address_hi |
  8245. * |----------------+----------------+----------------+----------------|
  8246. *
  8247. * The message is interpreted as follows:
  8248. * dword0 - b'0:7 - msg_type: This will be set to
  8249. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8250. * b'8:15 - number_entries: Indicated the number of host memory
  8251. * areas specified within the remainder of the message
  8252. * b'16:31 - reserved.
  8253. * dword1 - b'0:31 - memory area 0 size in bytes
  8254. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8255. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8256. * and similar for memory area 1 through memory area N.
  8257. */
  8258. PREPACK struct htt_h2t_host_paddr_size {
  8259. A_UINT32 msg_type: 8,
  8260. num_entries: 8,
  8261. reserved: 16;
  8262. } POSTPACK;
  8263. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8264. A_UINT32 size;
  8265. A_UINT32 physical_address_lo;
  8266. A_UINT32 physical_address_hi;
  8267. } POSTPACK;
  8268. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8269. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8270. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8271. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8272. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8273. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8274. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8275. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8276. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8277. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8278. do { \
  8279. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8280. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8281. } while (0)
  8282. /**
  8283. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8284. *
  8285. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8286. *
  8287. * @details
  8288. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8289. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8290. *
  8291. * The message would appear as follows:
  8292. *
  8293. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8294. * |---------------------------------+---+---+----------+-+-----------|
  8295. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8296. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8297. *
  8298. *
  8299. * The message is interpreted as follows:
  8300. * dword0 - b'0:7 - msg_type: This will be set to
  8301. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8302. * b'8 - override bit to drive MSDUs to PPE ring
  8303. * b'9:13 - REO destination ring indication
  8304. * b'14 - Multi buffer msdu override enable bit
  8305. * b'15 - Intra BSS override
  8306. * b'16 - Decap raw override
  8307. * b'17 - Decap Native wifi override
  8308. * b'18 - IP frag override
  8309. * b'19:31 - reserved
  8310. */
  8311. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8312. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8313. override: 1,
  8314. reo_destination_indication: 5,
  8315. multi_buffer_msdu_override_en: 1,
  8316. intra_bss_override: 1,
  8317. decap_raw_override: 1,
  8318. decap_nwifi_override: 1,
  8319. ip_frag_override: 1,
  8320. reserved: 13;
  8321. } POSTPACK;
  8322. /* DWORD 0: Override */
  8323. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8324. #define HTT_PPE_CFG_OVERRIDE_S 8
  8325. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8326. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8327. HTT_PPE_CFG_OVERRIDE_S)
  8328. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8329. do { \
  8330. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8331. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8332. } while (0)
  8333. /* DWORD 0: REO Destination Indication*/
  8334. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8335. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8336. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8337. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8338. HTT_PPE_CFG_REO_DEST_IND_S)
  8339. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8340. do { \
  8341. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8342. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8343. } while (0)
  8344. /* DWORD 0: Multi buffer MSDU override */
  8345. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8346. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8347. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8348. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8349. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8350. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8351. do { \
  8352. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8353. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8354. } while (0)
  8355. /* DWORD 0: Intra BSS override */
  8356. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8357. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8358. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8359. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8360. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8361. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8362. do { \
  8363. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8364. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8365. } while (0)
  8366. /* DWORD 0: Decap RAW override */
  8367. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8368. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8369. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8370. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8371. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8372. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8373. do { \
  8374. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8375. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8376. } while (0)
  8377. /* DWORD 0: Decap NWIFI override */
  8378. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8379. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8380. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8381. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8382. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8383. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8384. do { \
  8385. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8386. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8387. } while (0)
  8388. /* DWORD 0: IP frag override */
  8389. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8390. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8391. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8392. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8393. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8394. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8395. do { \
  8396. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8397. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8398. } while (0)
  8399. /*
  8400. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8401. *
  8402. * @details
  8403. * The following field definitions describe the format of the HTT host
  8404. * to target FW VDEV TX RX stats retrieve message.
  8405. * The message specifies the type of stats the host wants to retrieve.
  8406. *
  8407. * |31 27|26 25|24 17|16|15 8|7 0|
  8408. * |-----------------------------------------------------------|
  8409. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8410. * |-----------------------------------------------------------|
  8411. * | vdev_id lower bitmask |
  8412. * |-----------------------------------------------------------|
  8413. * | vdev_id upper bitmask |
  8414. * |-----------------------------------------------------------|
  8415. * Header fields:
  8416. * Where:
  8417. * dword0 - b'7:0 - msg_type: This will be set to
  8418. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8419. * b'15:8 - pdev id
  8420. * b'16(E) - Enable/Disable the vdev HW stats
  8421. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8422. * b'25:26(R) - Reset stats bits
  8423. * 0: don't reset stats
  8424. * 1: reset stats once
  8425. * 2: reset stats at the start of each periodic interval
  8426. * b'27:31 - reserved for future use
  8427. * dword1 - b'0:31 - vdev_id lower bitmask
  8428. * dword2 - b'0:31 - vdev_id upper bitmask
  8429. */
  8430. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8431. A_UINT32 msg_type :8,
  8432. pdev_id :8,
  8433. enable :1,
  8434. periodic_interval :8,
  8435. reset_stats_bits :2,
  8436. reserved0 :5;
  8437. A_UINT32 vdev_id_lower_bitmask;
  8438. A_UINT32 vdev_id_upper_bitmask;
  8439. } POSTPACK;
  8440. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8441. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8442. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8443. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8444. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8445. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8446. do { \
  8447. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8448. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8449. } while (0)
  8450. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8451. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8452. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8453. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8454. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8455. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8456. do { \
  8457. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8458. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8459. } while (0)
  8460. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8461. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8462. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8463. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8464. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8465. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8466. do { \
  8467. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8468. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8469. } while (0)
  8470. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8471. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8472. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8473. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8474. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8475. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8476. do { \
  8477. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8478. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8479. } while (0)
  8480. /*
  8481. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8482. *
  8483. * @details
  8484. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8485. * the default MSDU queues for one of the TIDs within the specified peer
  8486. * to the specified service class.
  8487. * The TID is indirectly specified - each service class is associated
  8488. * with a TID. All default MSDU queues for this peer-TID will be
  8489. * linked to the service class in question.
  8490. *
  8491. * |31 16|15 8|7 0|
  8492. * |------------------------------+--------------+--------------|
  8493. * | peer ID | svc class ID | msg type |
  8494. * |------------------------------------------------------------|
  8495. * Header fields:
  8496. * dword0 - b'7:0 - msg_type: This will be set to
  8497. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8498. * b'15:8 - service class ID
  8499. * b'31:16 - peer ID
  8500. */
  8501. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8502. A_UINT32 msg_type :8,
  8503. svc_class_id :8,
  8504. peer_id :16;
  8505. } POSTPACK;
  8506. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8507. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8508. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8509. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8510. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8511. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8512. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8513. do { \
  8514. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8515. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8516. } while (0)
  8517. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8518. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8519. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8520. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8521. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8522. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8523. do { \
  8524. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8525. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8526. } while (0)
  8527. /*
  8528. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8529. *
  8530. * @details
  8531. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8532. * remove the linkage of the specified peer-TID's MSDU queues to
  8533. * service classes.
  8534. *
  8535. * |31 16|15 8|7 0|
  8536. * |------------------------------+--------------+--------------|
  8537. * | peer ID | svc class ID | msg type |
  8538. * |------------------------------------------------------------|
  8539. * Header fields:
  8540. * dword0 - b'7:0 - msg_type: This will be set to
  8541. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8542. * b'15:8 - service class ID
  8543. * b'31:16 - peer ID
  8544. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8545. * value for peer ID indicates that the target should
  8546. * apply the UNMAP_REQ to all peers.
  8547. */
  8548. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8549. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8550. A_UINT32 msg_type :8,
  8551. svc_class_id :8,
  8552. peer_id :16;
  8553. } POSTPACK;
  8554. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8555. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8556. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8557. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8558. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8559. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8560. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8561. do { \
  8562. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8563. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8564. } while (0)
  8565. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8566. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8567. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8568. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8569. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8570. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8571. do { \
  8572. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8573. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8574. } while (0)
  8575. /*
  8576. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8577. *
  8578. * @details
  8579. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8580. * request the target to report what service class the default MSDU queues
  8581. * of the specified TIDs within the peer are linked to.
  8582. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8583. * to report what service class (if any) the default MSDU queues for
  8584. * each of the specified TIDs are linked to.
  8585. *
  8586. * |31 16|15 8|7 1| 0|
  8587. * |------------------------------+--------------+--------------|
  8588. * | peer ID | TID mask | msg type |
  8589. * |------------------------------------------------------------|
  8590. * | reserved |ETO|
  8591. * |------------------------------------------------------------|
  8592. * Header fields:
  8593. * dword0 - b'7:0 - msg_type: This will be set to
  8594. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8595. * b'15:8 - TID mask
  8596. * b'31:16 - peer ID
  8597. * dword1 - b'0 - "Existing Tids Only" flag
  8598. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8599. * message generated by this REQ will only show the
  8600. * mapping for TIDs that actually exist in the target's
  8601. * peer object.
  8602. * Any TIDs that are covered by a MAP_REQ but which
  8603. * do not actually exist will be shown as being
  8604. * unmapped (i.e. svc class ID 0xff).
  8605. * If this flag is cleared, the MAP_REPORT_CONF message
  8606. * will consider not only the mapping of TIDs currently
  8607. * existing in the peer, but also the mapping that will
  8608. * be applied for any TID objects created within this
  8609. * peer in the future.
  8610. * b'31:1 - reserved for future use
  8611. */
  8612. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8613. A_UINT32 msg_type :8,
  8614. tid_mask :8,
  8615. peer_id :16;
  8616. A_UINT32 existing_tids_only:1,
  8617. reserved :31;
  8618. } POSTPACK;
  8619. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8620. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8621. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8622. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8623. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8624. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8625. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8626. do { \
  8627. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8628. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8629. } while (0)
  8630. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8631. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8632. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8633. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8634. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8635. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8636. do { \
  8637. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8638. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8639. } while (0)
  8640. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8641. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8642. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8643. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8644. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8645. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8646. do { \
  8647. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8648. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8649. } while (0)
  8650. /**
  8651. * @brief Format of shared memory between Host and Target
  8652. * for UMAC hang recovery feature messaging.
  8653. * @details
  8654. * This is shared memory between Host and Target allocated
  8655. * and used in chips where UMAC hang recovery feature is supported.
  8656. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8657. * then host interprets it as a new message from target.
  8658. * Host clears that particular read bit in t2h_msg after each read
  8659. * operation. It is vice versa for h2t_msg. At any given point
  8660. * of time there is expected to be only one bit set
  8661. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8662. *
  8663. * The message is interpreted as follows:
  8664. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8665. * added for debuggability purpose.
  8666. * dword1 - b'0 - do_pre_reset
  8667. * b'1 - do_post_reset_start
  8668. * b'2 - do_post_reset_complete
  8669. * b'3:31 - rsvd_t2h
  8670. * dword2 - b'0 - pre_reset_done
  8671. * b'1 - post_reset_start_done
  8672. * b'2 - post_reset_complete_done
  8673. * b'3:31 - rsvd_h2t
  8674. */
  8675. PREPACK typedef struct {
  8676. /** Magic number added for debuggability. */
  8677. A_UINT32 magic_num;
  8678. union {
  8679. /*
  8680. * BIT [0] :- T2H msg to do pre-reset
  8681. * BIT [1] :- T2H msg to do post-reset start
  8682. * BIT [2] :- T2H msg to do post-reset complete
  8683. * BIT [31 : 3] :- reserved
  8684. */
  8685. A_UINT32 t2h_msg;
  8686. struct {
  8687. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8688. do_post_reset_start : 1, /* BIT [1] */
  8689. do_post_reset_complete : 1, /* BIT [2] */
  8690. rsvd_t2h : 29; /* BIT [31 : 3] */
  8691. };
  8692. };
  8693. union {
  8694. /*
  8695. * BIT [0] :- H2T msg to send pre-reset done
  8696. * BIT [1] :- H2T msg to send post-reset start done
  8697. * BIT [2] :- H2T msg to send post-reset complete done
  8698. * BIT [31 : 3] :- reserved
  8699. */
  8700. A_UINT32 h2t_msg;
  8701. struct {
  8702. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8703. post_reset_start_done : 1, /* BIT [1] */
  8704. post_reset_complete_done : 1, /* BIT [2] */
  8705. rsvd_h2t : 29; /* BIT [31 : 3] */
  8706. };
  8707. };
  8708. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8709. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8710. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8711. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8712. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8713. /* dword1 - b'0 - do_pre_reset */
  8714. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8715. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8716. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8717. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8718. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8719. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8720. do { \
  8721. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8722. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8723. } while (0)
  8724. /* dword1 - b'1 - do_post_reset_start */
  8725. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8726. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8727. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8728. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8729. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8730. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8731. do { \
  8732. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8733. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8734. } while (0)
  8735. /* dword1 - b'2 - do_post_reset_complete */
  8736. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8737. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8738. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8739. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8740. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8741. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  8742. do { \
  8743. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  8744. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  8745. } while (0)
  8746. /* dword2 - b'0 - pre_reset_done */
  8747. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  8748. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  8749. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  8750. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  8751. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  8752. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  8753. do { \
  8754. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  8755. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  8756. } while (0)
  8757. /* dword2 - b'1 - post_reset_start_done */
  8758. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  8759. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  8760. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  8761. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  8762. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  8763. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  8764. do { \
  8765. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  8766. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  8767. } while (0)
  8768. /* dword2 - b'2 - post_reset_complete_done */
  8769. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  8770. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  8771. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  8772. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  8773. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  8774. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  8775. do { \
  8776. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  8777. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  8778. } while (0)
  8779. /**
  8780. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  8781. *
  8782. * @details
  8783. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  8784. * by the host to provide prerequisite info to target for the UMAC hang
  8785. * recovery feature.
  8786. * The info sent in this H2T message are T2H message method, H2T message
  8787. * method, T2H MSI interrupt number and physical start address, size of
  8788. * the shared memory (refers to the shared memory dedicated for messaging
  8789. * between host and target when the DUT is in UMAC hang recovery mode).
  8790. * This H2T message is expected to be only sent if the WMI service bit
  8791. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  8792. *
  8793. * |31 16|15 12|11 8|7 0|
  8794. * |-------------------------------+--------------+--------------+------------|
  8795. * | reserved |h2t msg method|t2h msg method| msg_type |
  8796. * |--------------------------------------------------------------------------|
  8797. * | t2h msi interrupt number |
  8798. * |--------------------------------------------------------------------------|
  8799. * | shared memory area size |
  8800. * |--------------------------------------------------------------------------|
  8801. * | shared memory area physical address low |
  8802. * |--------------------------------------------------------------------------|
  8803. * | shared memory area physical address high |
  8804. * |--------------------------------------------------------------------------|
  8805. *
  8806. * The message is interpreted as follows:
  8807. * dword0 - b'0:7 - msg_type (= HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SETUP)
  8808. * b'8:11 - t2h_msg_method: indicates method to be used for
  8809. * T2H communication in UMAC hang recovery mode.
  8810. * Value zero indicates MSI interrupt (default method).
  8811. * Refer to htt_umac_hang_recovery_msg_method enum.
  8812. * b'12:15 - h2t_msg_method: indicates method to be used for
  8813. * H2T communication in UMAC hang recovery mode.
  8814. * Value zero indicates polling by target for this h2t msg
  8815. * during UMAC hang recovery mode.
  8816. * Refer to htt_umac_hang_recovery_msg_method enum.
  8817. * b'16:31 - reserved.
  8818. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  8819. * T2H communication in UMAC hang recovery mode.
  8820. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  8821. * only when in UMAC hang recovery mode.
  8822. * This refers to size in bytes.
  8823. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  8824. * of the shared memory dedicated for messaging only when
  8825. * in UMAC hang recovery mode.
  8826. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  8827. * of the shared memory dedicated for messaging only when
  8828. * in UMAC hang recovery mode.
  8829. */
  8830. /* t2h_msg_method and h2t_msg_method */
  8831. enum htt_umac_hang_recovery_msg_method {
  8832. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  8833. };
  8834. PREPACK typedef struct {
  8835. A_UINT32 msg_type : 8,
  8836. t2h_msg_method : 4,
  8837. h2t_msg_method : 4,
  8838. reserved : 16;
  8839. A_UINT32 t2h_msi_data;
  8840. /* size bytes and physical address of shared memory. */
  8841. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  8842. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  8843. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  8844. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  8845. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  8846. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  8847. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  8848. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  8849. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  8850. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  8851. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  8852. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  8853. do { \
  8854. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  8855. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  8856. } while (0)
  8857. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  8858. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  8859. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  8860. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  8861. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  8862. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  8863. do { \
  8864. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  8865. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  8866. } while (0)
  8867. /*=== target -> host messages ===============================================*/
  8868. enum htt_t2h_msg_type {
  8869. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8870. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8871. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8872. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8873. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8874. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8875. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8876. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8877. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8878. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8879. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8880. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8881. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8882. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8883. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8884. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8885. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8886. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8887. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8888. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8889. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8890. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8891. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8892. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8893. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8894. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8895. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8896. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8897. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8898. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8899. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8900. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8901. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8902. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8903. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8904. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8905. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8906. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8907. /* TX_OFFLOAD_DELIVER_IND:
  8908. * Forward the target's locally-generated packets to the host,
  8909. * to provide to the monitor mode interface.
  8910. */
  8911. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8912. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8913. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8914. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8915. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8916. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8917. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8918. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8919. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8920. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  8921. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  8922. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  8923. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  8924. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  8925. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  8926. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  8927. HTT_T2H_MSG_TYPE_TEST,
  8928. /* keep this last */
  8929. HTT_T2H_NUM_MSGS
  8930. };
  8931. /*
  8932. * HTT target to host message type -
  8933. * stored in bits 7:0 of the first word of the message
  8934. */
  8935. #define HTT_T2H_MSG_TYPE_M 0xff
  8936. #define HTT_T2H_MSG_TYPE_S 0
  8937. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8938. do { \
  8939. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8940. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8941. } while (0)
  8942. #define HTT_T2H_MSG_TYPE_GET(word) \
  8943. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8944. /**
  8945. * @brief target -> host version number confirmation message definition
  8946. *
  8947. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8948. *
  8949. * |31 24|23 16|15 8|7 0|
  8950. * |----------------+----------------+----------------+----------------|
  8951. * | reserved | major number | minor number | msg type |
  8952. * |-------------------------------------------------------------------|
  8953. * : option request TLV (optional) |
  8954. * :...................................................................:
  8955. *
  8956. * The VER_CONF message may consist of a single 4-byte word, or may be
  8957. * extended with TLVs that specify HTT options selected by the target.
  8958. * The following option TLVs may be appended to the VER_CONF message:
  8959. * - LL_BUS_ADDR_SIZE
  8960. * - HL_SUPPRESS_TX_COMPL_IND
  8961. * - MAX_TX_QUEUE_GROUPS
  8962. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8963. * may be appended to the VER_CONF message (but only one TLV of each type).
  8964. *
  8965. * Header fields:
  8966. * - MSG_TYPE
  8967. * Bits 7:0
  8968. * Purpose: identifies this as a version number confirmation message
  8969. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8970. * - VER_MINOR
  8971. * Bits 15:8
  8972. * Purpose: Specify the minor number of the HTT message library version
  8973. * in use by the target firmware.
  8974. * The minor number specifies the specific revision within a range
  8975. * of fundamentally compatible HTT message definition revisions.
  8976. * Compatible revisions involve adding new messages or perhaps
  8977. * adding new fields to existing messages, in a backwards-compatible
  8978. * manner.
  8979. * Incompatible revisions involve changing the message type values,
  8980. * or redefining existing messages.
  8981. * Value: minor number
  8982. * - VER_MAJOR
  8983. * Bits 15:8
  8984. * Purpose: Specify the major number of the HTT message library version
  8985. * in use by the target firmware.
  8986. * The major number specifies the family of minor revisions that are
  8987. * fundamentally compatible with each other, but not with prior or
  8988. * later families.
  8989. * Value: major number
  8990. */
  8991. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8992. #define HTT_VER_CONF_MINOR_S 8
  8993. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8994. #define HTT_VER_CONF_MAJOR_S 16
  8995. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8996. do { \
  8997. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8998. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8999. } while (0)
  9000. #define HTT_VER_CONF_MINOR_GET(word) \
  9001. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9002. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9003. do { \
  9004. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9005. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9006. } while (0)
  9007. #define HTT_VER_CONF_MAJOR_GET(word) \
  9008. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9009. #define HTT_VER_CONF_BYTES 4
  9010. /**
  9011. * @brief - target -> host HTT Rx In order indication message
  9012. *
  9013. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9014. *
  9015. * @details
  9016. *
  9017. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9018. * |----------------+-------------------+---------------------+---------------|
  9019. * | peer ID | P| F| O| ext TID | msg type |
  9020. * |--------------------------------------------------------------------------|
  9021. * | MSDU count | Reserved | vdev id |
  9022. * |--------------------------------------------------------------------------|
  9023. * | MSDU 0 bus address (bits 31:0) |
  9024. #if HTT_PADDR64
  9025. * | MSDU 0 bus address (bits 63:32) |
  9026. #endif
  9027. * |--------------------------------------------------------------------------|
  9028. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9029. * |--------------------------------------------------------------------------|
  9030. * | MSDU 1 bus address (bits 31:0) |
  9031. #if HTT_PADDR64
  9032. * | MSDU 1 bus address (bits 63:32) |
  9033. #endif
  9034. * |--------------------------------------------------------------------------|
  9035. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9036. * |--------------------------------------------------------------------------|
  9037. */
  9038. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9039. *
  9040. * @details
  9041. * bits
  9042. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9043. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9044. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9045. * | | frag | | | | fail |chksum fail|
  9046. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9047. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9048. */
  9049. struct htt_rx_in_ord_paddr_ind_hdr_t
  9050. {
  9051. A_UINT32 /* word 0 */
  9052. msg_type: 8,
  9053. ext_tid: 5,
  9054. offload: 1,
  9055. frag: 1,
  9056. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9057. peer_id: 16;
  9058. A_UINT32 /* word 1 */
  9059. vap_id: 8,
  9060. /* NOTE:
  9061. * This reserved_1 field is not truly reserved - certain targets use
  9062. * this field internally to store debug information, and do not zero
  9063. * out the contents of the field before uploading the message to the
  9064. * host. Thus, any host-target communication supported by this field
  9065. * is limited to using values that are never used by the debug
  9066. * information stored by certain targets in the reserved_1 field.
  9067. * In particular, the targets in question don't use the value 0x3
  9068. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9069. * so this previously-unused value within these bits is available to
  9070. * use as the host / target PKT_CAPTURE_MODE flag.
  9071. */
  9072. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9073. /* if pkt_capture_mode == 0x3, host should
  9074. * send rx frames to monitor mode interface
  9075. */
  9076. msdu_cnt: 16;
  9077. };
  9078. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9079. {
  9080. A_UINT32 dma_addr;
  9081. A_UINT32
  9082. length: 16,
  9083. fw_desc: 8,
  9084. msdu_info:8;
  9085. };
  9086. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9087. {
  9088. A_UINT32 dma_addr_lo;
  9089. A_UINT32 dma_addr_hi;
  9090. A_UINT32
  9091. length: 16,
  9092. fw_desc: 8,
  9093. msdu_info:8;
  9094. };
  9095. #if HTT_PADDR64
  9096. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9097. #else
  9098. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9099. #endif
  9100. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9101. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9102. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9103. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9104. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9105. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9106. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9107. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9108. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9109. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9110. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9111. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9112. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9113. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9114. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9115. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9116. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9117. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9118. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9119. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9120. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9121. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9122. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9123. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9124. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9125. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9126. /* for systems using 64-bit format for bus addresses */
  9127. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9128. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9129. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9130. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9131. /* for systems using 32-bit format for bus addresses */
  9132. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9133. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9134. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9135. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9136. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9137. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9138. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9139. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9140. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9141. do { \
  9142. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9143. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9144. } while (0)
  9145. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9146. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9147. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9148. do { \
  9149. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9150. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9151. } while (0)
  9152. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9153. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9154. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9155. do { \
  9156. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9157. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9158. } while (0)
  9159. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9160. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9161. /*
  9162. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9163. * deliver the rx frames to the monitor mode interface.
  9164. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9165. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9166. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9167. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9168. */
  9169. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9170. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9171. do { \
  9172. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9173. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9174. } while (0)
  9175. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9176. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9177. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9178. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9179. do { \
  9180. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9181. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9182. } while (0)
  9183. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9184. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9185. /* for systems using 64-bit format for bus addresses */
  9186. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9187. do { \
  9188. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9189. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9190. } while (0)
  9191. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9192. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9193. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9194. do { \
  9195. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9196. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9197. } while (0)
  9198. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9199. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9200. /* for systems using 32-bit format for bus addresses */
  9201. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9202. do { \
  9203. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9204. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9205. } while (0)
  9206. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9207. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9208. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9209. do { \
  9210. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9211. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9212. } while (0)
  9213. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9214. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9215. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9216. do { \
  9217. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9218. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9219. } while (0)
  9220. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9221. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9222. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9223. do { \
  9224. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9225. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9226. } while (0)
  9227. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9228. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9229. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9230. do { \
  9231. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9232. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9233. } while (0)
  9234. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9235. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9236. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9237. do { \
  9238. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9239. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9240. } while (0)
  9241. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9242. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9243. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9244. do { \
  9245. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9246. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9247. } while (0)
  9248. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9249. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9250. /* definitions used within target -> host rx indication message */
  9251. PREPACK struct htt_rx_ind_hdr_prefix_t
  9252. {
  9253. A_UINT32 /* word 0 */
  9254. msg_type: 8,
  9255. ext_tid: 5,
  9256. release_valid: 1,
  9257. flush_valid: 1,
  9258. reserved0: 1,
  9259. peer_id: 16;
  9260. A_UINT32 /* word 1 */
  9261. flush_start_seq_num: 6,
  9262. flush_end_seq_num: 6,
  9263. release_start_seq_num: 6,
  9264. release_end_seq_num: 6,
  9265. num_mpdu_ranges: 8;
  9266. } POSTPACK;
  9267. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9268. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9269. #define HTT_TGT_RSSI_INVALID 0x80
  9270. PREPACK struct htt_rx_ppdu_desc_t
  9271. {
  9272. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9273. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9274. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9275. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9276. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9277. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9278. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9279. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9280. A_UINT32 /* word 0 */
  9281. rssi_cmb: 8,
  9282. timestamp_submicrosec: 8,
  9283. phy_err_code: 8,
  9284. phy_err: 1,
  9285. legacy_rate: 4,
  9286. legacy_rate_sel: 1,
  9287. end_valid: 1,
  9288. start_valid: 1;
  9289. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9290. union {
  9291. A_UINT32 /* word 1 */
  9292. rssi0_pri20: 8,
  9293. rssi0_ext20: 8,
  9294. rssi0_ext40: 8,
  9295. rssi0_ext80: 8;
  9296. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9297. } u0;
  9298. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9299. union {
  9300. A_UINT32 /* word 2 */
  9301. rssi1_pri20: 8,
  9302. rssi1_ext20: 8,
  9303. rssi1_ext40: 8,
  9304. rssi1_ext80: 8;
  9305. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9306. } u1;
  9307. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9308. union {
  9309. A_UINT32 /* word 3 */
  9310. rssi2_pri20: 8,
  9311. rssi2_ext20: 8,
  9312. rssi2_ext40: 8,
  9313. rssi2_ext80: 8;
  9314. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9315. } u2;
  9316. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9317. union {
  9318. A_UINT32 /* word 4 */
  9319. rssi3_pri20: 8,
  9320. rssi3_ext20: 8,
  9321. rssi3_ext40: 8,
  9322. rssi3_ext80: 8;
  9323. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9324. } u3;
  9325. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9326. A_UINT32 tsf32; /* word 5 */
  9327. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9328. A_UINT32 timestamp_microsec; /* word 6 */
  9329. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9330. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9331. A_UINT32 /* word 7 */
  9332. vht_sig_a1: 24,
  9333. preamble_type: 8;
  9334. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9335. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9336. A_UINT32 /* word 8 */
  9337. vht_sig_a2: 24,
  9338. /* sa_ant_matrix
  9339. * For cases where a single rx chain has options to be connected to
  9340. * different rx antennas, show which rx antennas were in use during
  9341. * receipt of a given PPDU.
  9342. * This sa_ant_matrix provides a bitmask of the antennas used while
  9343. * receiving this frame.
  9344. */
  9345. sa_ant_matrix: 8;
  9346. } POSTPACK;
  9347. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9348. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9349. PREPACK struct htt_rx_ind_hdr_suffix_t
  9350. {
  9351. A_UINT32 /* word 0 */
  9352. fw_rx_desc_bytes: 16,
  9353. reserved0: 16;
  9354. } POSTPACK;
  9355. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9356. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9357. PREPACK struct htt_rx_ind_hdr_t
  9358. {
  9359. struct htt_rx_ind_hdr_prefix_t prefix;
  9360. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9361. struct htt_rx_ind_hdr_suffix_t suffix;
  9362. } POSTPACK;
  9363. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9364. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9365. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9366. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9367. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9368. /*
  9369. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9370. * the offset into the HTT rx indication message at which the
  9371. * FW rx PPDU descriptor resides
  9372. */
  9373. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9374. /*
  9375. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9376. * the offset into the HTT rx indication message at which the
  9377. * header suffix (FW rx MSDU byte count) resides
  9378. */
  9379. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9380. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9381. /*
  9382. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9383. * the offset into the HTT rx indication message at which the per-MSDU
  9384. * information starts
  9385. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9386. * per-MSDU information portion of the message. The per-MSDU info itself
  9387. * starts at byte 12.
  9388. */
  9389. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9390. /**
  9391. * @brief target -> host rx indication message definition
  9392. *
  9393. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9394. *
  9395. * @details
  9396. * The following field definitions describe the format of the rx indication
  9397. * message sent from the target to the host.
  9398. * The message consists of three major sections:
  9399. * 1. a fixed-length header
  9400. * 2. a variable-length list of firmware rx MSDU descriptors
  9401. * 3. one or more 4-octet MPDU range information elements
  9402. * The fixed length header itself has two sub-sections
  9403. * 1. the message meta-information, including identification of the
  9404. * sender and type of the received data, and a 4-octet flush/release IE
  9405. * 2. the firmware rx PPDU descriptor
  9406. *
  9407. * The format of the message is depicted below.
  9408. * in this depiction, the following abbreviations are used for information
  9409. * elements within the message:
  9410. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9411. * elements associated with the PPDU start are valid.
  9412. * Specifically, the following fields are valid only if SV is set:
  9413. * RSSI (all variants), L, legacy rate, preamble type, service,
  9414. * VHT-SIG-A
  9415. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9416. * elements associated with the PPDU end are valid.
  9417. * Specifically, the following fields are valid only if EV is set:
  9418. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9419. * - L - Legacy rate selector - if legacy rates are used, this flag
  9420. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9421. * (L == 0) PHY.
  9422. * - P - PHY error flag - boolean indication of whether the rx frame had
  9423. * a PHY error
  9424. *
  9425. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9426. * |----------------+-------------------+---------------------+---------------|
  9427. * | peer ID | |RV|FV| ext TID | msg type |
  9428. * |--------------------------------------------------------------------------|
  9429. * | num | release | release | flush | flush |
  9430. * | MPDU | end | start | end | start |
  9431. * | ranges | seq num | seq num | seq num | seq num |
  9432. * |==========================================================================|
  9433. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9434. * |V|V| | rate | | | timestamp | RSSI |
  9435. * |--------------------------------------------------------------------------|
  9436. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9437. * |--------------------------------------------------------------------------|
  9438. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9439. * |--------------------------------------------------------------------------|
  9440. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9441. * |--------------------------------------------------------------------------|
  9442. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9443. * |--------------------------------------------------------------------------|
  9444. * | TSF LSBs |
  9445. * |--------------------------------------------------------------------------|
  9446. * | microsec timestamp |
  9447. * |--------------------------------------------------------------------------|
  9448. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9449. * |--------------------------------------------------------------------------|
  9450. * | service | HT-SIG / VHT-SIG-A2 |
  9451. * |==========================================================================|
  9452. * | reserved | FW rx desc bytes |
  9453. * |--------------------------------------------------------------------------|
  9454. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9455. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9456. * |--------------------------------------------------------------------------|
  9457. * : : :
  9458. * |--------------------------------------------------------------------------|
  9459. * | alignment | MSDU Rx |
  9460. * | padding | desc Bn |
  9461. * |--------------------------------------------------------------------------|
  9462. * | reserved | MPDU range status | MPDU count |
  9463. * |--------------------------------------------------------------------------|
  9464. * : reserved : MPDU range status : MPDU count :
  9465. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9466. *
  9467. * Header fields:
  9468. * - MSG_TYPE
  9469. * Bits 7:0
  9470. * Purpose: identifies this as an rx indication message
  9471. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9472. * - EXT_TID
  9473. * Bits 12:8
  9474. * Purpose: identify the traffic ID of the rx data, including
  9475. * special "extended" TID values for multicast, broadcast, and
  9476. * non-QoS data frames
  9477. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9478. * - FLUSH_VALID (FV)
  9479. * Bit 13
  9480. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9481. * is valid
  9482. * Value:
  9483. * 1 -> flush IE is valid and needs to be processed
  9484. * 0 -> flush IE is not valid and should be ignored
  9485. * - REL_VALID (RV)
  9486. * Bit 13
  9487. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9488. * is valid
  9489. * Value:
  9490. * 1 -> release IE is valid and needs to be processed
  9491. * 0 -> release IE is not valid and should be ignored
  9492. * - PEER_ID
  9493. * Bits 31:16
  9494. * Purpose: Identify, by ID, which peer sent the rx data
  9495. * Value: ID of the peer who sent the rx data
  9496. * - FLUSH_SEQ_NUM_START
  9497. * Bits 5:0
  9498. * Purpose: Indicate the start of a series of MPDUs to flush
  9499. * Not all MPDUs within this series are necessarily valid - the host
  9500. * must check each sequence number within this range to see if the
  9501. * corresponding MPDU is actually present.
  9502. * This field is only valid if the FV bit is set.
  9503. * Value:
  9504. * The sequence number for the first MPDUs to check to flush.
  9505. * The sequence number is masked by 0x3f.
  9506. * - FLUSH_SEQ_NUM_END
  9507. * Bits 11:6
  9508. * Purpose: Indicate the end of a series of MPDUs to flush
  9509. * Value:
  9510. * The sequence number one larger than the sequence number of the
  9511. * last MPDU to check to flush.
  9512. * The sequence number is masked by 0x3f.
  9513. * Not all MPDUs within this series are necessarily valid - the host
  9514. * must check each sequence number within this range to see if the
  9515. * corresponding MPDU is actually present.
  9516. * This field is only valid if the FV bit is set.
  9517. * - REL_SEQ_NUM_START
  9518. * Bits 17:12
  9519. * Purpose: Indicate the start of a series of MPDUs to release.
  9520. * All MPDUs within this series are present and valid - the host
  9521. * need not check each sequence number within this range to see if
  9522. * the corresponding MPDU is actually present.
  9523. * This field is only valid if the RV bit is set.
  9524. * Value:
  9525. * The sequence number for the first MPDUs to check to release.
  9526. * The sequence number is masked by 0x3f.
  9527. * - REL_SEQ_NUM_END
  9528. * Bits 23:18
  9529. * Purpose: Indicate the end of a series of MPDUs to release.
  9530. * Value:
  9531. * The sequence number one larger than the sequence number of the
  9532. * last MPDU to check to release.
  9533. * The sequence number is masked by 0x3f.
  9534. * All MPDUs within this series are present and valid - the host
  9535. * need not check each sequence number within this range to see if
  9536. * the corresponding MPDU is actually present.
  9537. * This field is only valid if the RV bit is set.
  9538. * - NUM_MPDU_RANGES
  9539. * Bits 31:24
  9540. * Purpose: Indicate how many ranges of MPDUs are present.
  9541. * Each MPDU range consists of a series of contiguous MPDUs within the
  9542. * rx frame sequence which all have the same MPDU status.
  9543. * Value: 1-63 (typically a small number, like 1-3)
  9544. *
  9545. * Rx PPDU descriptor fields:
  9546. * - RSSI_CMB
  9547. * Bits 7:0
  9548. * Purpose: Combined RSSI from all active rx chains, across the active
  9549. * bandwidth.
  9550. * Value: RSSI dB units w.r.t. noise floor
  9551. * - TIMESTAMP_SUBMICROSEC
  9552. * Bits 15:8
  9553. * Purpose: high-resolution timestamp
  9554. * Value:
  9555. * Sub-microsecond time of PPDU reception.
  9556. * This timestamp ranges from [0,MAC clock MHz).
  9557. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9558. * to form a high-resolution, large range rx timestamp.
  9559. * - PHY_ERR_CODE
  9560. * Bits 23:16
  9561. * Purpose:
  9562. * If the rx frame processing resulted in a PHY error, indicate what
  9563. * type of rx PHY error occurred.
  9564. * Value:
  9565. * This field is valid if the "P" (PHY_ERR) flag is set.
  9566. * TBD: document/specify the values for this field
  9567. * - PHY_ERR
  9568. * Bit 24
  9569. * Purpose: indicate whether the rx PPDU had a PHY error
  9570. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9571. * - LEGACY_RATE
  9572. * Bits 28:25
  9573. * Purpose:
  9574. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9575. * specify which rate was used.
  9576. * Value:
  9577. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9578. * flag.
  9579. * If LEGACY_RATE_SEL is 0:
  9580. * 0x8: OFDM 48 Mbps
  9581. * 0x9: OFDM 24 Mbps
  9582. * 0xA: OFDM 12 Mbps
  9583. * 0xB: OFDM 6 Mbps
  9584. * 0xC: OFDM 54 Mbps
  9585. * 0xD: OFDM 36 Mbps
  9586. * 0xE: OFDM 18 Mbps
  9587. * 0xF: OFDM 9 Mbps
  9588. * If LEGACY_RATE_SEL is 1:
  9589. * 0x8: CCK 11 Mbps long preamble
  9590. * 0x9: CCK 5.5 Mbps long preamble
  9591. * 0xA: CCK 2 Mbps long preamble
  9592. * 0xB: CCK 1 Mbps long preamble
  9593. * 0xC: CCK 11 Mbps short preamble
  9594. * 0xD: CCK 5.5 Mbps short preamble
  9595. * 0xE: CCK 2 Mbps short preamble
  9596. * - LEGACY_RATE_SEL
  9597. * Bit 29
  9598. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9599. * Value:
  9600. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9601. * used a legacy rate.
  9602. * 0 -> OFDM, 1 -> CCK
  9603. * - END_VALID
  9604. * Bit 30
  9605. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9606. * the start of the PPDU are valid. Specifically, the following
  9607. * fields are only valid if END_VALID is set:
  9608. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9609. * TIMESTAMP_SUBMICROSEC
  9610. * Value:
  9611. * 0 -> rx PPDU desc end fields are not valid
  9612. * 1 -> rx PPDU desc end fields are valid
  9613. * - START_VALID
  9614. * Bit 31
  9615. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9616. * the end of the PPDU are valid. Specifically, the following
  9617. * fields are only valid if START_VALID is set:
  9618. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9619. * VHT-SIG-A
  9620. * Value:
  9621. * 0 -> rx PPDU desc start fields are not valid
  9622. * 1 -> rx PPDU desc start fields are valid
  9623. * - RSSI0_PRI20
  9624. * Bits 7:0
  9625. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9626. * Value: RSSI dB units w.r.t. noise floor
  9627. *
  9628. * - RSSI0_EXT20
  9629. * Bits 7:0
  9630. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9631. * (if the rx bandwidth was >= 40 MHz)
  9632. * Value: RSSI dB units w.r.t. noise floor
  9633. * - RSSI0_EXT40
  9634. * Bits 7:0
  9635. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9636. * (if the rx bandwidth was >= 80 MHz)
  9637. * Value: RSSI dB units w.r.t. noise floor
  9638. * - RSSI0_EXT80
  9639. * Bits 7:0
  9640. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9641. * (if the rx bandwidth was >= 160 MHz)
  9642. * Value: RSSI dB units w.r.t. noise floor
  9643. *
  9644. * - RSSI1_PRI20
  9645. * Bits 7:0
  9646. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9647. * Value: RSSI dB units w.r.t. noise floor
  9648. * - RSSI1_EXT20
  9649. * Bits 7:0
  9650. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9651. * (if the rx bandwidth was >= 40 MHz)
  9652. * Value: RSSI dB units w.r.t. noise floor
  9653. * - RSSI1_EXT40
  9654. * Bits 7:0
  9655. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9656. * (if the rx bandwidth was >= 80 MHz)
  9657. * Value: RSSI dB units w.r.t. noise floor
  9658. * - RSSI1_EXT80
  9659. * Bits 7:0
  9660. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9661. * (if the rx bandwidth was >= 160 MHz)
  9662. * Value: RSSI dB units w.r.t. noise floor
  9663. *
  9664. * - RSSI2_PRI20
  9665. * Bits 7:0
  9666. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9667. * Value: RSSI dB units w.r.t. noise floor
  9668. * - RSSI2_EXT20
  9669. * Bits 7:0
  9670. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9671. * (if the rx bandwidth was >= 40 MHz)
  9672. * Value: RSSI dB units w.r.t. noise floor
  9673. * - RSSI2_EXT40
  9674. * Bits 7:0
  9675. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9676. * (if the rx bandwidth was >= 80 MHz)
  9677. * Value: RSSI dB units w.r.t. noise floor
  9678. * - RSSI2_EXT80
  9679. * Bits 7:0
  9680. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9681. * (if the rx bandwidth was >= 160 MHz)
  9682. * Value: RSSI dB units w.r.t. noise floor
  9683. *
  9684. * - RSSI3_PRI20
  9685. * Bits 7:0
  9686. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9687. * Value: RSSI dB units w.r.t. noise floor
  9688. * - RSSI3_EXT20
  9689. * Bits 7:0
  9690. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9691. * (if the rx bandwidth was >= 40 MHz)
  9692. * Value: RSSI dB units w.r.t. noise floor
  9693. * - RSSI3_EXT40
  9694. * Bits 7:0
  9695. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9696. * (if the rx bandwidth was >= 80 MHz)
  9697. * Value: RSSI dB units w.r.t. noise floor
  9698. * - RSSI3_EXT80
  9699. * Bits 7:0
  9700. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9701. * (if the rx bandwidth was >= 160 MHz)
  9702. * Value: RSSI dB units w.r.t. noise floor
  9703. *
  9704. * - TSF32
  9705. * Bits 31:0
  9706. * Purpose: specify the time the rx PPDU was received, in TSF units
  9707. * Value: 32 LSBs of the TSF
  9708. * - TIMESTAMP_MICROSEC
  9709. * Bits 31:0
  9710. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9711. * Value: PPDU rx time, in microseconds
  9712. * - VHT_SIG_A1
  9713. * Bits 23:0
  9714. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9715. * from the rx PPDU
  9716. * Value:
  9717. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9718. * VHT-SIG-A1 data.
  9719. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9720. * first 24 bits of the HT-SIG data.
  9721. * Otherwise, this field is invalid.
  9722. * Refer to the the 802.11 protocol for the definition of the
  9723. * HT-SIG and VHT-SIG-A1 fields
  9724. * - VHT_SIG_A2
  9725. * Bits 23:0
  9726. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9727. * from the rx PPDU
  9728. * Value:
  9729. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9730. * VHT-SIG-A2 data.
  9731. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9732. * last 24 bits of the HT-SIG data.
  9733. * Otherwise, this field is invalid.
  9734. * Refer to the the 802.11 protocol for the definition of the
  9735. * HT-SIG and VHT-SIG-A2 fields
  9736. * - PREAMBLE_TYPE
  9737. * Bits 31:24
  9738. * Purpose: indicate the PHY format of the received burst
  9739. * Value:
  9740. * 0x4: Legacy (OFDM/CCK)
  9741. * 0x8: HT
  9742. * 0x9: HT with TxBF
  9743. * 0xC: VHT
  9744. * 0xD: VHT with TxBF
  9745. * - SERVICE
  9746. * Bits 31:24
  9747. * Purpose: TBD
  9748. * Value: TBD
  9749. *
  9750. * Rx MSDU descriptor fields:
  9751. * - FW_RX_DESC_BYTES
  9752. * Bits 15:0
  9753. * Purpose: Indicate how many bytes in the Rx indication are used for
  9754. * FW Rx descriptors
  9755. *
  9756. * Payload fields:
  9757. * - MPDU_COUNT
  9758. * Bits 7:0
  9759. * Purpose: Indicate how many sequential MPDUs share the same status.
  9760. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9761. * - MPDU_STATUS
  9762. * Bits 15:8
  9763. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9764. * received successfully.
  9765. * Value:
  9766. * 0x1: success
  9767. * 0x2: FCS error
  9768. * 0x3: duplicate error
  9769. * 0x4: replay error
  9770. * 0x5: invalid peer
  9771. */
  9772. /* header fields */
  9773. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9774. #define HTT_RX_IND_EXT_TID_S 8
  9775. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9776. #define HTT_RX_IND_FLUSH_VALID_S 13
  9777. #define HTT_RX_IND_REL_VALID_M 0x4000
  9778. #define HTT_RX_IND_REL_VALID_S 14
  9779. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9780. #define HTT_RX_IND_PEER_ID_S 16
  9781. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9782. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9783. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9784. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9785. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9786. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9787. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9788. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9789. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9790. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9791. /* rx PPDU descriptor fields */
  9792. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9793. #define HTT_RX_IND_RSSI_CMB_S 0
  9794. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9795. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9796. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9797. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9798. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9799. #define HTT_RX_IND_PHY_ERR_S 24
  9800. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9801. #define HTT_RX_IND_LEGACY_RATE_S 25
  9802. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9803. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9804. #define HTT_RX_IND_END_VALID_M 0x40000000
  9805. #define HTT_RX_IND_END_VALID_S 30
  9806. #define HTT_RX_IND_START_VALID_M 0x80000000
  9807. #define HTT_RX_IND_START_VALID_S 31
  9808. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9809. #define HTT_RX_IND_RSSI_PRI20_S 0
  9810. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9811. #define HTT_RX_IND_RSSI_EXT20_S 8
  9812. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9813. #define HTT_RX_IND_RSSI_EXT40_S 16
  9814. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9815. #define HTT_RX_IND_RSSI_EXT80_S 24
  9816. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9817. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9818. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9819. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9820. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9821. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9822. #define HTT_RX_IND_SERVICE_M 0xff000000
  9823. #define HTT_RX_IND_SERVICE_S 24
  9824. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9825. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9826. /* rx MSDU descriptor fields */
  9827. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9828. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9829. /* payload fields */
  9830. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9831. #define HTT_RX_IND_MPDU_COUNT_S 0
  9832. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9833. #define HTT_RX_IND_MPDU_STATUS_S 8
  9834. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9835. do { \
  9836. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9837. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9838. } while (0)
  9839. #define HTT_RX_IND_EXT_TID_GET(word) \
  9840. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9841. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9842. do { \
  9843. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9844. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9845. } while (0)
  9846. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9847. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9848. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9849. do { \
  9850. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9851. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9852. } while (0)
  9853. #define HTT_RX_IND_REL_VALID_GET(word) \
  9854. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9855. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9856. do { \
  9857. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9858. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9859. } while (0)
  9860. #define HTT_RX_IND_PEER_ID_GET(word) \
  9861. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9862. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9863. do { \
  9864. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9865. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9866. } while (0)
  9867. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9868. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9869. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9870. do { \
  9871. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9872. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9873. } while (0)
  9874. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9875. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9876. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9877. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9878. do { \
  9879. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9880. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9881. } while (0)
  9882. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9883. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9884. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9885. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9886. do { \
  9887. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9888. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9889. } while (0)
  9890. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9891. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9892. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9893. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9894. do { \
  9895. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9896. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9897. } while (0)
  9898. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9899. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9900. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9901. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9902. do { \
  9903. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9904. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9905. } while (0)
  9906. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9907. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9908. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9909. /* FW rx PPDU descriptor fields */
  9910. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9911. do { \
  9912. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9913. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9914. } while (0)
  9915. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9916. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9917. HTT_RX_IND_RSSI_CMB_S)
  9918. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9919. do { \
  9920. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9921. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9922. } while (0)
  9923. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9924. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9925. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9926. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9927. do { \
  9928. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9929. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9930. } while (0)
  9931. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9932. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9933. HTT_RX_IND_PHY_ERR_CODE_S)
  9934. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9935. do { \
  9936. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9937. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9938. } while (0)
  9939. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9940. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9941. HTT_RX_IND_PHY_ERR_S)
  9942. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9943. do { \
  9944. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9945. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9946. } while (0)
  9947. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9948. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9949. HTT_RX_IND_LEGACY_RATE_S)
  9950. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9951. do { \
  9952. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9953. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9954. } while (0)
  9955. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9956. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9957. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9958. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9959. do { \
  9960. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9961. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9962. } while (0)
  9963. #define HTT_RX_IND_END_VALID_GET(word) \
  9964. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9965. HTT_RX_IND_END_VALID_S)
  9966. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9967. do { \
  9968. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9969. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9970. } while (0)
  9971. #define HTT_RX_IND_START_VALID_GET(word) \
  9972. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9973. HTT_RX_IND_START_VALID_S)
  9974. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9975. do { \
  9976. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9977. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9978. } while (0)
  9979. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9980. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9981. HTT_RX_IND_RSSI_PRI20_S)
  9982. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9983. do { \
  9984. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9985. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9986. } while (0)
  9987. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9988. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9989. HTT_RX_IND_RSSI_EXT20_S)
  9990. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9991. do { \
  9992. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9993. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9994. } while (0)
  9995. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9996. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9997. HTT_RX_IND_RSSI_EXT40_S)
  9998. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9999. do { \
  10000. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10001. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10002. } while (0)
  10003. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10004. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10005. HTT_RX_IND_RSSI_EXT80_S)
  10006. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10007. do { \
  10008. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10009. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10010. } while (0)
  10011. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10012. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10013. HTT_RX_IND_VHT_SIG_A1_S)
  10014. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10015. do { \
  10016. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10017. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10018. } while (0)
  10019. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10020. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10021. HTT_RX_IND_VHT_SIG_A2_S)
  10022. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10023. do { \
  10024. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10025. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10026. } while (0)
  10027. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10028. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10029. HTT_RX_IND_PREAMBLE_TYPE_S)
  10030. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10031. do { \
  10032. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10033. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10034. } while (0)
  10035. #define HTT_RX_IND_SERVICE_GET(word) \
  10036. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10037. HTT_RX_IND_SERVICE_S)
  10038. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10039. do { \
  10040. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10041. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10042. } while (0)
  10043. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10044. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10045. HTT_RX_IND_SA_ANT_MATRIX_S)
  10046. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10047. do { \
  10048. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10049. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10050. } while (0)
  10051. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10052. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10053. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10054. do { \
  10055. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10056. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10057. } while (0)
  10058. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10059. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10060. #define HTT_RX_IND_HL_BYTES \
  10061. (HTT_RX_IND_HDR_BYTES + \
  10062. 4 /* single FW rx MSDU descriptor */ + \
  10063. 4 /* single MPDU range information element */)
  10064. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10065. /* Could we use one macro entry? */
  10066. #define HTT_WORD_SET(word, field, value) \
  10067. do { \
  10068. HTT_CHECK_SET_VAL(field, value); \
  10069. (word) |= ((value) << field ## _S); \
  10070. } while (0)
  10071. #define HTT_WORD_GET(word, field) \
  10072. (((word) & field ## _M) >> field ## _S)
  10073. PREPACK struct hl_htt_rx_ind_base {
  10074. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10075. } POSTPACK;
  10076. /*
  10077. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10078. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10079. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10080. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10081. * htt_rx_ind_hl_rx_desc_t.
  10082. */
  10083. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10084. struct htt_rx_ind_hl_rx_desc_t {
  10085. A_UINT8 ver;
  10086. A_UINT8 len;
  10087. struct {
  10088. A_UINT8
  10089. first_msdu: 1,
  10090. last_msdu: 1,
  10091. c3_failed: 1,
  10092. c4_failed: 1,
  10093. ipv6: 1,
  10094. tcp: 1,
  10095. udp: 1,
  10096. reserved: 1;
  10097. } flags;
  10098. /* NOTE: no reserved space - don't append any new fields here */
  10099. };
  10100. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10101. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10102. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10103. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10104. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10105. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10106. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10107. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10108. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10109. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10110. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10111. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10112. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10113. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10114. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10115. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10116. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10117. /* This structure is used in HL, the basic descriptor information
  10118. * used by host. the structure is translated by FW from HW desc
  10119. * or generated by FW. But in HL monitor mode, the host would use
  10120. * the same structure with LL.
  10121. */
  10122. PREPACK struct hl_htt_rx_desc_base {
  10123. A_UINT32
  10124. seq_num:12,
  10125. encrypted:1,
  10126. chan_info_present:1,
  10127. resv0:2,
  10128. mcast_bcast:1,
  10129. fragment:1,
  10130. key_id_oct:8,
  10131. resv1:6;
  10132. A_UINT32
  10133. pn_31_0;
  10134. union {
  10135. struct {
  10136. A_UINT16 pn_47_32;
  10137. A_UINT16 pn_63_48;
  10138. } pn16;
  10139. A_UINT32 pn_63_32;
  10140. } u0;
  10141. A_UINT32
  10142. pn_95_64;
  10143. A_UINT32
  10144. pn_127_96;
  10145. } POSTPACK;
  10146. /*
  10147. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10148. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10149. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10150. * Please see htt_chan_change_t for description of the fields.
  10151. */
  10152. PREPACK struct htt_chan_info_t
  10153. {
  10154. A_UINT32 primary_chan_center_freq_mhz: 16,
  10155. contig_chan1_center_freq_mhz: 16;
  10156. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10157. phy_mode: 8,
  10158. reserved: 8;
  10159. } POSTPACK;
  10160. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10161. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10162. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10163. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10164. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10165. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10166. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10167. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10168. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10169. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10170. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10171. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10172. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10173. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10174. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10175. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10176. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10177. /* Channel information */
  10178. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10179. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10180. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10181. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10182. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10183. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10184. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10185. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10186. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10187. do { \
  10188. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10189. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10190. } while (0)
  10191. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10192. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10193. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10194. do { \
  10195. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10196. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10197. } while (0)
  10198. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10199. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10200. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10201. do { \
  10202. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10203. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10204. } while (0)
  10205. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10206. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10207. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10208. do { \
  10209. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10210. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10211. } while (0)
  10212. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10213. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10214. /*
  10215. * @brief target -> host message definition for FW offloaded pkts
  10216. *
  10217. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10218. *
  10219. * @details
  10220. * The following field definitions describe the format of the firmware
  10221. * offload deliver message sent from the target to the host.
  10222. *
  10223. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10224. *
  10225. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10226. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10227. * | reserved_1 | msg type |
  10228. * |--------------------------------------------------------------------------|
  10229. * | phy_timestamp_l32 |
  10230. * |--------------------------------------------------------------------------|
  10231. * | WORD2 (see below) |
  10232. * |--------------------------------------------------------------------------|
  10233. * | seqno | framectrl |
  10234. * |--------------------------------------------------------------------------|
  10235. * | reserved_3 | vdev_id | tid_num|
  10236. * |--------------------------------------------------------------------------|
  10237. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10238. * |--------------------------------------------------------------------------|
  10239. *
  10240. * where:
  10241. * STAT = status
  10242. * F = format (802.3 vs. 802.11)
  10243. *
  10244. * definition for word 2
  10245. *
  10246. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10247. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10248. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10249. * |--------------------------------------------------------------------------|
  10250. *
  10251. * where:
  10252. * PR = preamble
  10253. * BF = beamformed
  10254. */
  10255. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10256. {
  10257. A_UINT32 /* word 0 */
  10258. msg_type:8, /* [ 7: 0] */
  10259. reserved_1:24; /* [31: 8] */
  10260. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10261. A_UINT32 /* word 2 */
  10262. /* preamble:
  10263. * 0-OFDM,
  10264. * 1-CCk,
  10265. * 2-HT,
  10266. * 3-VHT
  10267. */
  10268. preamble: 2, /* [1:0] */
  10269. /* mcs:
  10270. * In case of HT preamble interpret
  10271. * MCS along with NSS.
  10272. * Valid values for HT are 0 to 7.
  10273. * HT mcs 0 with NSS 2 is mcs 8.
  10274. * Valid values for VHT are 0 to 9.
  10275. */
  10276. mcs: 4, /* [5:2] */
  10277. /* rate:
  10278. * This is applicable only for
  10279. * CCK and OFDM preamble type
  10280. * rate 0: OFDM 48 Mbps,
  10281. * 1: OFDM 24 Mbps,
  10282. * 2: OFDM 12 Mbps
  10283. * 3: OFDM 6 Mbps
  10284. * 4: OFDM 54 Mbps
  10285. * 5: OFDM 36 Mbps
  10286. * 6: OFDM 18 Mbps
  10287. * 7: OFDM 9 Mbps
  10288. * rate 0: CCK 11 Mbps Long
  10289. * 1: CCK 5.5 Mbps Long
  10290. * 2: CCK 2 Mbps Long
  10291. * 3: CCK 1 Mbps Long
  10292. * 4: CCK 11 Mbps Short
  10293. * 5: CCK 5.5 Mbps Short
  10294. * 6: CCK 2 Mbps Short
  10295. */
  10296. rate : 3, /* [ 8: 6] */
  10297. rssi : 8, /* [16: 9] units=dBm */
  10298. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10299. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10300. stbc : 1, /* [22] */
  10301. sgi : 1, /* [23] */
  10302. ldpc : 1, /* [24] */
  10303. beamformed: 1, /* [25] */
  10304. reserved_2: 6; /* [31:26] */
  10305. A_UINT32 /* word 3 */
  10306. framectrl:16, /* [15: 0] */
  10307. seqno:16; /* [31:16] */
  10308. A_UINT32 /* word 4 */
  10309. tid_num:5, /* [ 4: 0] actual TID number */
  10310. vdev_id:8, /* [12: 5] */
  10311. reserved_3:19; /* [31:13] */
  10312. A_UINT32 /* word 5 */
  10313. /* status:
  10314. * 0: tx_ok
  10315. * 1: retry
  10316. * 2: drop
  10317. * 3: filtered
  10318. * 4: abort
  10319. * 5: tid delete
  10320. * 6: sw abort
  10321. * 7: dropped by peer migration
  10322. */
  10323. status:3, /* [2:0] */
  10324. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10325. tx_mpdu_bytes:16, /* [19:4] */
  10326. /* Indicates retry count of offloaded/local generated Data tx frames */
  10327. tx_retry_cnt:6, /* [25:20] */
  10328. reserved_4:6; /* [31:26] */
  10329. } POSTPACK;
  10330. /* FW offload deliver ind message header fields */
  10331. /* DWORD one */
  10332. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10333. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10334. /* DWORD two */
  10335. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10336. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10337. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10338. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10339. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10340. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10341. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10342. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10343. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10344. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10345. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10346. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10347. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10348. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10349. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10350. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10351. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10352. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10353. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10354. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10355. /* DWORD three*/
  10356. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10357. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10358. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10359. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10360. /* DWORD four */
  10361. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10362. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10363. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10364. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10365. /* DWORD five */
  10366. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10367. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10368. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10369. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10370. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10371. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10372. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10373. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10374. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10375. do { \
  10376. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10377. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10378. } while (0)
  10379. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10380. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10381. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10382. do { \
  10383. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10384. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10385. } while (0)
  10386. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10387. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10388. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10389. do { \
  10390. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10391. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10392. } while (0)
  10393. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10394. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10395. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10396. do { \
  10397. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10398. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10399. } while (0)
  10400. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10401. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10402. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10403. do { \
  10404. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10405. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10406. } while (0)
  10407. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10408. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10409. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10410. do { \
  10411. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10412. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10413. } while (0)
  10414. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10415. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10416. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10417. do { \
  10418. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10419. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10420. } while (0)
  10421. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10422. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10423. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10424. do { \
  10425. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10426. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10427. } while (0)
  10428. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10429. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10430. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10431. do { \
  10432. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10433. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10434. } while (0)
  10435. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10436. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10437. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10438. do { \
  10439. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10440. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10441. } while (0)
  10442. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10443. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10444. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10445. do { \
  10446. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10447. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10448. } while (0)
  10449. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10450. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10451. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10452. do { \
  10453. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10454. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10455. } while (0)
  10456. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10457. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10458. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10459. do { \
  10460. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10461. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10462. } while (0)
  10463. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10464. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10465. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10466. do { \
  10467. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10468. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10469. } while (0)
  10470. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10471. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10472. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10473. do { \
  10474. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10475. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10476. } while (0)
  10477. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10478. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10479. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10480. do { \
  10481. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10482. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10483. } while (0)
  10484. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10485. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10486. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10487. do { \
  10488. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10489. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10490. } while (0)
  10491. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10492. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10493. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10494. do { \
  10495. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10496. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10497. } while (0)
  10498. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10499. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10500. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10501. do { \
  10502. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10503. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10504. } while (0)
  10505. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10506. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10507. /*
  10508. * @brief target -> host rx reorder flush message definition
  10509. *
  10510. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10511. *
  10512. * @details
  10513. * The following field definitions describe the format of the rx flush
  10514. * message sent from the target to the host.
  10515. * The message consists of a 4-octet header, followed by one or more
  10516. * 4-octet payload information elements.
  10517. *
  10518. * |31 24|23 8|7 0|
  10519. * |--------------------------------------------------------------|
  10520. * | TID | peer ID | msg type |
  10521. * |--------------------------------------------------------------|
  10522. * | seq num end | seq num start | MPDU status | reserved |
  10523. * |--------------------------------------------------------------|
  10524. * First DWORD:
  10525. * - MSG_TYPE
  10526. * Bits 7:0
  10527. * Purpose: identifies this as an rx flush message
  10528. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10529. * - PEER_ID
  10530. * Bits 23:8 (only bits 18:8 actually used)
  10531. * Purpose: identify which peer's rx data is being flushed
  10532. * Value: (rx) peer ID
  10533. * - TID
  10534. * Bits 31:24 (only bits 27:24 actually used)
  10535. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10536. * Value: traffic identifier
  10537. * Second DWORD:
  10538. * - MPDU_STATUS
  10539. * Bits 15:8
  10540. * Purpose:
  10541. * Indicate whether the flushed MPDUs should be discarded or processed.
  10542. * Value:
  10543. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10544. * stages of rx processing
  10545. * other: discard the MPDUs
  10546. * It is anticipated that flush messages will always have
  10547. * MPDU status == 1, but the status flag is included for
  10548. * flexibility.
  10549. * - SEQ_NUM_START
  10550. * Bits 23:16
  10551. * Purpose:
  10552. * Indicate the start of a series of consecutive MPDUs being flushed.
  10553. * Not all MPDUs within this range are necessarily valid - the host
  10554. * must check each sequence number within this range to see if the
  10555. * corresponding MPDU is actually present.
  10556. * Value:
  10557. * The sequence number for the first MPDU in the sequence.
  10558. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10559. * - SEQ_NUM_END
  10560. * Bits 30:24
  10561. * Purpose:
  10562. * Indicate the end of a series of consecutive MPDUs being flushed.
  10563. * Value:
  10564. * The sequence number one larger than the sequence number of the
  10565. * last MPDU being flushed.
  10566. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10567. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10568. * are to be released for further rx processing.
  10569. * Not all MPDUs within this range are necessarily valid - the host
  10570. * must check each sequence number within this range to see if the
  10571. * corresponding MPDU is actually present.
  10572. */
  10573. /* first DWORD */
  10574. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10575. #define HTT_RX_FLUSH_PEER_ID_S 8
  10576. #define HTT_RX_FLUSH_TID_M 0xff000000
  10577. #define HTT_RX_FLUSH_TID_S 24
  10578. /* second DWORD */
  10579. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10580. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10581. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10582. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10583. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10584. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10585. #define HTT_RX_FLUSH_BYTES 8
  10586. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10587. do { \
  10588. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10589. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10590. } while (0)
  10591. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10592. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10593. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10594. do { \
  10595. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10596. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10597. } while (0)
  10598. #define HTT_RX_FLUSH_TID_GET(word) \
  10599. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10600. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10601. do { \
  10602. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10603. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10604. } while (0)
  10605. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10606. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10607. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10608. do { \
  10609. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10610. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10611. } while (0)
  10612. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10613. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10614. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10615. do { \
  10616. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10617. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10618. } while (0)
  10619. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10620. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10621. /*
  10622. * @brief target -> host rx pn check indication message
  10623. *
  10624. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10625. *
  10626. * @details
  10627. * The following field definitions describe the format of the Rx PN check
  10628. * indication message sent from the target to the host.
  10629. * The message consists of a 4-octet header, followed by the start and
  10630. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10631. * IE is one octet containing the sequence number that failed the PN
  10632. * check.
  10633. *
  10634. * |31 24|23 8|7 0|
  10635. * |--------------------------------------------------------------|
  10636. * | TID | peer ID | msg type |
  10637. * |--------------------------------------------------------------|
  10638. * | Reserved | PN IE count | seq num end | seq num start|
  10639. * |--------------------------------------------------------------|
  10640. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10641. * |--------------------------------------------------------------|
  10642. * First DWORD:
  10643. * - MSG_TYPE
  10644. * Bits 7:0
  10645. * Purpose: Identifies this as an rx pn check indication message
  10646. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10647. * - PEER_ID
  10648. * Bits 23:8 (only bits 18:8 actually used)
  10649. * Purpose: identify which peer
  10650. * Value: (rx) peer ID
  10651. * - TID
  10652. * Bits 31:24 (only bits 27:24 actually used)
  10653. * Purpose: identify traffic identifier
  10654. * Value: traffic identifier
  10655. * Second DWORD:
  10656. * - SEQ_NUM_START
  10657. * Bits 7:0
  10658. * Purpose:
  10659. * Indicates the starting sequence number of the MPDU in this
  10660. * series of MPDUs that went though PN check.
  10661. * Value:
  10662. * The sequence number for the first MPDU in the sequence.
  10663. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10664. * - SEQ_NUM_END
  10665. * Bits 15:8
  10666. * Purpose:
  10667. * Indicates the ending sequence number of the MPDU in this
  10668. * series of MPDUs that went though PN check.
  10669. * Value:
  10670. * The sequence number one larger then the sequence number of the last
  10671. * MPDU being flushed.
  10672. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10673. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10674. * for invalid PN numbers and are ready to be released for further processing.
  10675. * Not all MPDUs within this range are necessarily valid - the host
  10676. * must check each sequence number within this range to see if the
  10677. * corresponding MPDU is actually present.
  10678. * - PN_IE_COUNT
  10679. * Bits 23:16
  10680. * Purpose:
  10681. * Used to determine the variable number of PN information elements in this
  10682. * message
  10683. *
  10684. * PN information elements:
  10685. * - PN_IE_x-
  10686. * Purpose:
  10687. * Each PN information element contains the sequence number of the MPDU that
  10688. * has failed the target PN check.
  10689. * Value:
  10690. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10691. * that failed the PN check.
  10692. */
  10693. /* first DWORD */
  10694. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10695. #define HTT_RX_PN_IND_PEER_ID_S 8
  10696. #define HTT_RX_PN_IND_TID_M 0xff000000
  10697. #define HTT_RX_PN_IND_TID_S 24
  10698. /* second DWORD */
  10699. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10700. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10701. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10702. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10703. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10704. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10705. #define HTT_RX_PN_IND_BYTES 8
  10706. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10707. do { \
  10708. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10709. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10710. } while (0)
  10711. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10712. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10713. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10714. do { \
  10715. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10716. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10717. } while (0)
  10718. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10719. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10720. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10721. do { \
  10722. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10723. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10724. } while (0)
  10725. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10726. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10727. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10728. do { \
  10729. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10730. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10731. } while (0)
  10732. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10733. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10734. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10735. do { \
  10736. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10737. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10738. } while (0)
  10739. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10740. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10741. /*
  10742. * @brief target -> host rx offload deliver message for LL system
  10743. *
  10744. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10745. *
  10746. * @details
  10747. * In a low latency system this message is sent whenever the offload
  10748. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10749. * The DMA of the actual packets into host memory is done before sending out
  10750. * this message. This message indicates only how many MSDUs to reap. The
  10751. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10752. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10753. * DMA'd by the MAC directly into host memory these packets do not contain
  10754. * the MAC descriptors in the header portion of the packet. Instead they contain
  10755. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10756. * message, the packets are delivered directly to the NW stack without going
  10757. * through the regular reorder buffering and PN checking path since it has
  10758. * already been done in target.
  10759. *
  10760. * |31 24|23 16|15 8|7 0|
  10761. * |-----------------------------------------------------------------------|
  10762. * | Total MSDU count | reserved | msg type |
  10763. * |-----------------------------------------------------------------------|
  10764. *
  10765. * @brief target -> host rx offload deliver message for HL system
  10766. *
  10767. * @details
  10768. * In a high latency system this message is sent whenever the offload manager
  10769. * flushes out the packets it has coalesced in its coalescing buffer. The
  10770. * actual packets are also carried along with this message. When the host
  10771. * receives this message, it is expected to deliver these packets to the NW
  10772. * stack directly instead of routing them through the reorder buffering and
  10773. * PN checking path since it has already been done in target.
  10774. *
  10775. * |31 24|23 16|15 8|7 0|
  10776. * |-----------------------------------------------------------------------|
  10777. * | Total MSDU count | reserved | msg type |
  10778. * |-----------------------------------------------------------------------|
  10779. * | peer ID | MSDU length |
  10780. * |-----------------------------------------------------------------------|
  10781. * | MSDU payload | FW Desc | tid | vdev ID |
  10782. * |-----------------------------------------------------------------------|
  10783. * | MSDU payload contd. |
  10784. * |-----------------------------------------------------------------------|
  10785. * | peer ID | MSDU length |
  10786. * |-----------------------------------------------------------------------|
  10787. * | MSDU payload | FW Desc | tid | vdev ID |
  10788. * |-----------------------------------------------------------------------|
  10789. * | MSDU payload contd. |
  10790. * |-----------------------------------------------------------------------|
  10791. *
  10792. */
  10793. /* first DWORD */
  10794. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10795. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10796. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10797. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10798. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10799. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10800. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10801. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10802. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10803. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10804. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10805. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10806. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10807. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10808. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10809. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10810. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10811. do { \
  10812. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10813. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10814. } while (0)
  10815. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10816. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10817. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10818. do { \
  10819. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10820. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10821. } while (0)
  10822. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10823. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10824. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10825. do { \
  10826. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10827. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10828. } while (0)
  10829. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10830. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10831. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10832. do { \
  10833. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10834. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10835. } while (0)
  10836. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10837. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10838. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10839. do { \
  10840. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10841. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10842. } while (0)
  10843. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10844. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10845. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10846. do { \
  10847. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10848. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10849. } while (0)
  10850. /**
  10851. * @brief target -> host rx peer map/unmap message definition
  10852. *
  10853. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10854. *
  10855. * @details
  10856. * The following diagram shows the format of the rx peer map message sent
  10857. * from the target to the host. This layout assumes the target operates
  10858. * as little-endian.
  10859. *
  10860. * This message always contains a SW peer ID. The main purpose of the
  10861. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10862. * with, so that the host can use that peer ID to determine which peer
  10863. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10864. * other purposes, such as identifying during tx completions which peer
  10865. * the tx frames in question were transmitted to.
  10866. *
  10867. * In certain generations of chips, the peer map message also contains
  10868. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10869. * to identify which peer the frame needs to be forwarded to (i.e. the
  10870. * peer assocated with the Destination MAC Address within the packet),
  10871. * and particularly which vdev needs to transmit the frame (for cases
  10872. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10873. * meaning as AST_INDEX_0.
  10874. * This DA-based peer ID that is provided for certain rx frames
  10875. * (the rx frames that need to be re-transmitted as tx frames)
  10876. * is the ID that the HW uses for referring to the peer in question,
  10877. * rather than the peer ID that the SW+FW use to refer to the peer.
  10878. *
  10879. *
  10880. * |31 24|23 16|15 8|7 0|
  10881. * |-----------------------------------------------------------------------|
  10882. * | SW peer ID | VDEV ID | msg type |
  10883. * |-----------------------------------------------------------------------|
  10884. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10885. * |-----------------------------------------------------------------------|
  10886. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10887. * |-----------------------------------------------------------------------|
  10888. *
  10889. *
  10890. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10891. *
  10892. * The following diagram shows the format of the rx peer unmap message sent
  10893. * from the target to the host.
  10894. *
  10895. * |31 24|23 16|15 8|7 0|
  10896. * |-----------------------------------------------------------------------|
  10897. * | SW peer ID | VDEV ID | msg type |
  10898. * |-----------------------------------------------------------------------|
  10899. *
  10900. * The following field definitions describe the format of the rx peer map
  10901. * and peer unmap messages sent from the target to the host.
  10902. * - MSG_TYPE
  10903. * Bits 7:0
  10904. * Purpose: identifies this as an rx peer map or peer unmap message
  10905. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10906. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10907. * - VDEV_ID
  10908. * Bits 15:8
  10909. * Purpose: Indicates which virtual device the peer is associated
  10910. * with.
  10911. * Value: vdev ID (used in the host to look up the vdev object)
  10912. * - PEER_ID (a.k.a. SW_PEER_ID)
  10913. * Bits 31:16
  10914. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10915. * freeing (unmap)
  10916. * Value: (rx) peer ID
  10917. * - MAC_ADDR_L32 (peer map only)
  10918. * Bits 31:0
  10919. * Purpose: Identifies which peer node the peer ID is for.
  10920. * Value: lower 4 bytes of peer node's MAC address
  10921. * - MAC_ADDR_U16 (peer map only)
  10922. * Bits 15:0
  10923. * Purpose: Identifies which peer node the peer ID is for.
  10924. * Value: upper 2 bytes of peer node's MAC address
  10925. * - HW_PEER_ID
  10926. * Bits 31:16
  10927. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10928. * address, so for rx frames marked for rx --> tx forwarding, the
  10929. * host can determine from the HW peer ID provided as meta-data with
  10930. * the rx frame which peer the frame is supposed to be forwarded to.
  10931. * Value: ID used by the MAC HW to identify the peer
  10932. */
  10933. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10934. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10935. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10936. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10937. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10938. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10939. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10940. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10941. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10942. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10943. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10944. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10945. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10946. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10947. do { \
  10948. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10949. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10950. } while (0)
  10951. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10952. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10953. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10954. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10955. do { \
  10956. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10957. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10958. } while (0)
  10959. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10960. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10961. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10962. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10963. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10964. do { \
  10965. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10966. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10967. } while (0)
  10968. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10969. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10970. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10971. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10972. #define HTT_RX_PEER_MAP_BYTES 12
  10973. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10974. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10975. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10976. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10977. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10978. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10979. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10980. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10981. #define HTT_RX_PEER_UNMAP_BYTES 4
  10982. /**
  10983. * @brief target -> host rx peer map V2 message definition
  10984. *
  10985. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10986. *
  10987. * @details
  10988. * The following diagram shows the format of the rx peer map v2 message sent
  10989. * from the target to the host. This layout assumes the target operates
  10990. * as little-endian.
  10991. *
  10992. * This message always contains a SW peer ID. The main purpose of the
  10993. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10994. * with, so that the host can use that peer ID to determine which peer
  10995. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10996. * other purposes, such as identifying during tx completions which peer
  10997. * the tx frames in question were transmitted to.
  10998. *
  10999. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11000. * is used during rx --> tx frame forwarding to identify which peer the
  11001. * frame needs to be forwarded to (i.e. the peer assocated with the
  11002. * Destination MAC Address within the packet), and particularly which vdev
  11003. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11004. * This DA-based peer ID that is provided for certain rx frames
  11005. * (the rx frames that need to be re-transmitted as tx frames)
  11006. * is the ID that the HW uses for referring to the peer in question,
  11007. * rather than the peer ID that the SW+FW use to refer to the peer.
  11008. *
  11009. * The HW peer id here is the same meaning as AST_INDEX_0.
  11010. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11011. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11012. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11013. * AST is valid.
  11014. *
  11015. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11016. * |-------------------------------------------------------------------------|
  11017. * | SW peer ID | VDEV ID | msg type |
  11018. * |-------------------------------------------------------------------------|
  11019. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11020. * |-------------------------------------------------------------------------|
  11021. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11022. * |-------------------------------------------------------------------------|
  11023. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11024. * |-------------------------------------------------------------------------|
  11025. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11026. * |-------------------------------------------------------------------------|
  11027. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11028. * |-------------------------------------------------------------------------|
  11029. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11030. * |-------------------------------------------------------------------------|
  11031. * | Reserved_2 |
  11032. * |-------------------------------------------------------------------------|
  11033. * Where:
  11034. * NH = Next Hop
  11035. * ASTVM = AST valid mask
  11036. * OA = on-chip AST valid bit
  11037. * ASTFM = AST flow mask
  11038. *
  11039. * The following field definitions describe the format of the rx peer map v2
  11040. * messages sent from the target to the host.
  11041. * - MSG_TYPE
  11042. * Bits 7:0
  11043. * Purpose: identifies this as an rx peer map v2 message
  11044. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11045. * - VDEV_ID
  11046. * Bits 15:8
  11047. * Purpose: Indicates which virtual device the peer is associated with.
  11048. * Value: vdev ID (used in the host to look up the vdev object)
  11049. * - SW_PEER_ID
  11050. * Bits 31:16
  11051. * Purpose: The peer ID (index) that WAL is allocating
  11052. * Value: (rx) peer ID
  11053. * - MAC_ADDR_L32
  11054. * Bits 31:0
  11055. * Purpose: Identifies which peer node the peer ID is for.
  11056. * Value: lower 4 bytes of peer node's MAC address
  11057. * - MAC_ADDR_U16
  11058. * Bits 15:0
  11059. * Purpose: Identifies which peer node the peer ID is for.
  11060. * Value: upper 2 bytes of peer node's MAC address
  11061. * - HW_PEER_ID / AST_INDEX_0
  11062. * Bits 31:16
  11063. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11064. * address, so for rx frames marked for rx --> tx forwarding, the
  11065. * host can determine from the HW peer ID provided as meta-data with
  11066. * the rx frame which peer the frame is supposed to be forwarded to.
  11067. * Value: ID used by the MAC HW to identify the peer
  11068. * - AST_HASH_VALUE
  11069. * Bits 15:0
  11070. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11071. * override feature.
  11072. * - NEXT_HOP
  11073. * Bit 16
  11074. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11075. * (Wireless Distribution System).
  11076. * - AST_VALID_MASK
  11077. * Bits 19:17
  11078. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11079. * - ONCHIP_AST_VALID_FLAG
  11080. * Bit 20
  11081. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11082. * is valid.
  11083. * - AST_INDEX_1
  11084. * Bits 15:0
  11085. * Purpose: indicate the second AST index for this peer
  11086. * - AST_0_FLOW_MASK
  11087. * Bits 19:16
  11088. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11089. * - AST_1_FLOW_MASK
  11090. * Bits 23:20
  11091. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11092. * - AST_2_FLOW_MASK
  11093. * Bits 27:24
  11094. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11095. * - AST_3_FLOW_MASK
  11096. * Bits 31:28
  11097. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11098. * - AST_INDEX_2
  11099. * Bits 15:0
  11100. * Purpose: indicate the third AST index for this peer
  11101. * - TID_VALID_HI_PRI
  11102. * Bits 23:16
  11103. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11104. * - TID_VALID_LOW_PRI
  11105. * Bits 31:24
  11106. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11107. * - AST_INDEX_3
  11108. * Bits 15:0
  11109. * Purpose: indicate the fourth AST index for this peer
  11110. * - ONCHIP_AST_IDX / RESERVED
  11111. * Bits 31:16
  11112. * Purpose: This field is valid only when split AST feature is enabled.
  11113. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11114. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11115. * address, this ast_idx is used for LMAC modules for RXPCU.
  11116. * Value: ID used by the LMAC HW to identify the peer
  11117. */
  11118. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11119. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11120. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11121. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11122. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11123. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11124. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11125. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11126. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11127. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11128. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11129. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11130. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11131. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11132. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11133. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11134. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11135. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11136. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11137. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11138. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11139. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11140. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11141. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11142. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11143. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11144. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11145. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11146. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11147. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11148. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11149. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11150. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11151. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11152. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11153. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11154. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11155. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11156. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11157. do { \
  11158. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11159. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11160. } while (0)
  11161. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11162. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11163. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11164. do { \
  11165. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11166. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11167. } while (0)
  11168. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11169. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11170. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11171. do { \
  11172. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11173. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11174. } while (0)
  11175. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11176. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11177. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11178. do { \
  11179. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11180. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11181. } while (0)
  11182. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11183. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11184. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11185. do { \
  11186. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11187. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11188. } while (0)
  11189. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11190. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11191. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11192. do { \
  11193. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11194. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11195. } while (0)
  11196. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11197. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11198. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11199. do { \
  11200. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11201. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11202. } while (0)
  11203. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11204. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11205. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11206. do { \
  11207. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11208. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11209. } while (0)
  11210. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11211. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11212. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11213. do { \
  11214. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11215. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11216. } while (0)
  11217. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11218. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11219. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11220. do { \
  11221. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11222. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11223. } while (0)
  11224. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11225. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11226. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11227. do { \
  11228. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11229. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11230. } while (0)
  11231. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11232. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11233. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11234. do { \
  11235. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11236. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11237. } while (0)
  11238. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11239. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11240. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11241. do { \
  11242. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11243. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11244. } while (0)
  11245. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11246. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11247. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11248. do { \
  11249. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11250. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11251. } while (0)
  11252. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11253. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11254. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11255. do { \
  11256. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11257. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11258. } while (0)
  11259. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11260. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11261. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11262. do { \
  11263. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11264. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11265. } while (0)
  11266. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11267. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11268. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11269. do { \
  11270. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11271. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11272. } while (0)
  11273. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11274. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11275. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11276. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11277. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11278. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11279. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11280. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11281. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11282. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11283. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11284. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11285. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11286. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11287. /**
  11288. * @brief target -> host rx peer map V3 message definition
  11289. *
  11290. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11291. *
  11292. * @details
  11293. * The following diagram shows the format of the rx peer map v3 message sent
  11294. * from the target to the host.
  11295. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11296. * This layout assumes the target operates as little-endian.
  11297. *
  11298. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11299. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11300. * | SW peer ID | VDEV ID | msg type |
  11301. * |-----------------+--------------------+-----------------+-----------------|
  11302. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11303. * |-----------------+--------------------+-----------------+-----------------|
  11304. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11305. * |-----------------+--------+-----------+-----------------+-----------------|
  11306. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11307. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11308. * | (8bits) | | (4bits) | |
  11309. * |-----------------+--------+--+--+--+--------------------------------------|
  11310. * | RESERVED |E |O | | |
  11311. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11312. * | |V |V | | |
  11313. * |-----------------+--------------------+-----------------------------------|
  11314. * | HTT_MSDU_IDX_ | RESERVED | |
  11315. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11316. * | (8bits) | | |
  11317. * |-----------------+--------------------+-----------------------------------|
  11318. * | Reserved_2 |
  11319. * |--------------------------------------------------------------------------|
  11320. * | Reserved_3 |
  11321. * |--------------------------------------------------------------------------|
  11322. *
  11323. * Where:
  11324. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11325. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11326. * NH = Next Hop
  11327. * The following field definitions describe the format of the rx peer map v3
  11328. * messages sent from the target to the host.
  11329. * - MSG_TYPE
  11330. * Bits 7:0
  11331. * Purpose: identifies this as a peer map v3 message
  11332. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11333. * - VDEV_ID
  11334. * Bits 15:8
  11335. * Purpose: Indicates which virtual device the peer is associated with.
  11336. * - SW_PEER_ID
  11337. * Bits 31:16
  11338. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11339. * - MAC_ADDR_L32
  11340. * Bits 31:0
  11341. * Purpose: Identifies which peer node the peer ID is for.
  11342. * Value: lower 4 bytes of peer node's MAC address
  11343. * - MAC_ADDR_U16
  11344. * Bits 15:0
  11345. * Purpose: Identifies which peer node the peer ID is for.
  11346. * Value: upper 2 bytes of peer node's MAC address
  11347. * - MULTICAST_SW_PEER_ID
  11348. * Bits 31:16
  11349. * Purpose: The multicast peer ID (index)
  11350. * Value: set to HTT_INVALID_PEER if not valid
  11351. * - HW_PEER_ID / AST_INDEX
  11352. * Bits 15:0
  11353. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11354. * address, so for rx frames marked for rx --> tx forwarding, the
  11355. * host can determine from the HW peer ID provided as meta-data with
  11356. * the rx frame which peer the frame is supposed to be forwarded to.
  11357. * - CACHE_SET_NUM
  11358. * Bits 19:16
  11359. * Purpose: Cache Set Number for AST_INDEX
  11360. * Cache set number that should be used to cache the index based
  11361. * search results, for address and flow search.
  11362. * This value should be equal to LSB 4 bits of the hash value
  11363. * of match data, in case of search index points to an entry which
  11364. * may be used in content based search also. The value can be
  11365. * anything when the entry pointed by search index will not be
  11366. * used for content based search.
  11367. * - HTT_MSDU_IDX_VALID_MASK
  11368. * Bits 31:24
  11369. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11370. * - ONCHIP_AST_IDX / RESERVED
  11371. * Bits 15:0
  11372. * Purpose: This field is valid only when split AST feature is enabled.
  11373. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11374. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11375. * address, this ast_idx is used for LMAC modules for RXPCU.
  11376. * - NEXT_HOP
  11377. * Bits 16
  11378. * Purpose: Flag indicates next_hop AST entry used for WDS
  11379. * (Wireless Distribution System).
  11380. * - ONCHIP_AST_VALID
  11381. * Bits 17
  11382. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11383. * - EXT_AST_VALID
  11384. * Bits 18
  11385. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11386. * - EXT_AST_INDEX
  11387. * Bits 15:0
  11388. * Purpose: This field describes Extended AST index
  11389. * Valid if EXT_AST_VALID flag set
  11390. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11391. * Bits 31:24
  11392. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11393. */
  11394. /* dword 0 */
  11395. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11396. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11397. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11398. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11399. /* dword 1 */
  11400. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11401. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11402. /* dword 2 */
  11403. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11404. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11405. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11406. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11407. /* dword 3 */
  11408. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11409. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11410. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11411. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11412. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11413. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11414. /* dword 4 */
  11415. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11416. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11417. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11418. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11419. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11420. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11421. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11422. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11423. /* dword 5 */
  11424. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11425. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11426. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11427. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11428. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11429. do { \
  11430. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11431. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11432. } while (0)
  11433. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11434. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11435. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11436. do { \
  11437. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11438. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11439. } while (0)
  11440. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11441. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11442. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11443. do { \
  11444. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11445. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11446. } while (0)
  11447. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11448. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11449. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11450. do { \
  11451. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11452. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11453. } while (0)
  11454. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11455. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11456. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11457. do { \
  11458. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11459. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11460. } while (0)
  11461. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11462. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11463. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11464. do { \
  11465. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11466. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11467. } while (0)
  11468. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11469. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11470. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11471. do { \
  11472. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11473. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11474. } while (0)
  11475. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11476. (((word) & HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S)
  11477. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11478. do { \
  11479. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11480. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11481. } while (0)
  11482. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11483. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11484. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11485. do { \
  11486. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11487. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11488. } while (0)
  11489. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11490. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11491. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11492. do { \
  11493. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11494. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11495. } while (0)
  11496. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11497. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11498. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11499. do { \
  11500. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11501. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11502. } while (0)
  11503. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11504. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11505. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11506. do { \
  11507. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11508. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11509. } while (0)
  11510. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11511. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11512. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11513. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11514. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11515. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11516. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11517. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11518. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11519. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11520. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11521. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11522. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11523. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11524. /**
  11525. * @brief target -> host rx peer unmap V2 message definition
  11526. *
  11527. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11528. *
  11529. * The following diagram shows the format of the rx peer unmap message sent
  11530. * from the target to the host.
  11531. *
  11532. * |31 24|23 16|15 8|7 0|
  11533. * |-----------------------------------------------------------------------|
  11534. * | SW peer ID | VDEV ID | msg type |
  11535. * |-----------------------------------------------------------------------|
  11536. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11537. * |-----------------------------------------------------------------------|
  11538. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11539. * |-----------------------------------------------------------------------|
  11540. * | Peer Delete Duration |
  11541. * |-----------------------------------------------------------------------|
  11542. * | Reserved_0 | WDS Free Count |
  11543. * |-----------------------------------------------------------------------|
  11544. * | Reserved_1 |
  11545. * |-----------------------------------------------------------------------|
  11546. * | Reserved_2 |
  11547. * |-----------------------------------------------------------------------|
  11548. *
  11549. *
  11550. * The following field definitions describe the format of the rx peer unmap
  11551. * messages sent from the target to the host.
  11552. * - MSG_TYPE
  11553. * Bits 7:0
  11554. * Purpose: identifies this as an rx peer unmap v2 message
  11555. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11556. * - VDEV_ID
  11557. * Bits 15:8
  11558. * Purpose: Indicates which virtual device the peer is associated
  11559. * with.
  11560. * Value: vdev ID (used in the host to look up the vdev object)
  11561. * - SW_PEER_ID
  11562. * Bits 31:16
  11563. * Purpose: The peer ID (index) that WAL is freeing
  11564. * Value: (rx) peer ID
  11565. * - MAC_ADDR_L32
  11566. * Bits 31:0
  11567. * Purpose: Identifies which peer node the peer ID is for.
  11568. * Value: lower 4 bytes of peer node's MAC address
  11569. * - MAC_ADDR_U16
  11570. * Bits 15:0
  11571. * Purpose: Identifies which peer node the peer ID is for.
  11572. * Value: upper 2 bytes of peer node's MAC address
  11573. * - NEXT_HOP
  11574. * Bits 16
  11575. * Purpose: Bit indicates next_hop AST entry used for WDS
  11576. * (Wireless Distribution System).
  11577. * - PEER_DELETE_DURATION
  11578. * Bits 31:0
  11579. * Purpose: Time taken to delete peer, in msec,
  11580. * Used for monitoring / debugging PEER delete response delay
  11581. * - PEER_WDS_FREE_COUNT
  11582. * Bits 15:0
  11583. * Purpose: Count of WDS entries deleted associated to peer deleted
  11584. */
  11585. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11586. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11587. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11588. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11589. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11590. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11591. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11592. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11593. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11594. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11595. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11596. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11597. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11598. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11599. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11600. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11601. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11602. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11603. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11604. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11605. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11606. do { \
  11607. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11608. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11609. } while (0)
  11610. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11611. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11612. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11613. do { \
  11614. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11615. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11616. } while (0)
  11617. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11618. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11619. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11620. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11621. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11622. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11623. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11624. /**
  11625. * @brief target -> host rx peer mlo map message definition
  11626. *
  11627. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11628. *
  11629. * @details
  11630. * The following diagram shows the format of the rx mlo peer map message sent
  11631. * from the target to the host. This layout assumes the target operates
  11632. * as little-endian.
  11633. *
  11634. * MCC:
  11635. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11636. *
  11637. * WIN:
  11638. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11639. * It will be sent on the Assoc Link.
  11640. *
  11641. * This message always contains a MLO peer ID. The main purpose of the
  11642. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11643. * with, so that the host can use that MLO peer ID to determine which peer
  11644. * transmitted the rx frame.
  11645. *
  11646. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11647. * |-------------------------------------------------------------------------|
  11648. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11649. * |-------------------------------------------------------------------------|
  11650. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11651. * |-------------------------------------------------------------------------|
  11652. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11653. * |-------------------------------------------------------------------------|
  11654. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11655. * |-------------------------------------------------------------------------|
  11656. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11657. * |-------------------------------------------------------------------------|
  11658. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11659. * |-------------------------------------------------------------------------|
  11660. * |RSVD |
  11661. * |-------------------------------------------------------------------------|
  11662. * |RSVD |
  11663. * |-------------------------------------------------------------------------|
  11664. * | htt_tlv_hdr_t |
  11665. * |-------------------------------------------------------------------------|
  11666. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11667. * |-------------------------------------------------------------------------|
  11668. * | htt_tlv_hdr_t |
  11669. * |-------------------------------------------------------------------------|
  11670. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11671. * |-------------------------------------------------------------------------|
  11672. * | htt_tlv_hdr_t |
  11673. * |-------------------------------------------------------------------------|
  11674. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11675. * |-------------------------------------------------------------------------|
  11676. *
  11677. * Where:
  11678. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11679. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11680. * V (valid) - 1 Bit Bit17
  11681. * CHIPID - 3 Bits
  11682. * TIDMASK - 8 Bits
  11683. * CACHE_SET_NUM - 8 Bits
  11684. *
  11685. * The following field definitions describe the format of the rx MLO peer map
  11686. * messages sent from the target to the host.
  11687. * - MSG_TYPE
  11688. * Bits 7:0
  11689. * Purpose: identifies this as an rx mlo peer map message
  11690. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11691. *
  11692. * - MLO_PEER_ID
  11693. * Bits 23:8
  11694. * Purpose: The MLO peer ID (index).
  11695. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11696. * Value: MLO peer ID
  11697. *
  11698. * - NUMLINK
  11699. * Bits: 26:24 (3Bits)
  11700. * Purpose: Indicate the max number of logical links supported per client.
  11701. * Value: number of logical links
  11702. *
  11703. * - PRC
  11704. * Bits: 29:27 (3Bits)
  11705. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11706. * if there is migration of the primary chip.
  11707. * Value: Primary REO CHIPID
  11708. *
  11709. * - MAC_ADDR_L32
  11710. * Bits 31:0
  11711. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11712. * Value: lower 4 bytes of peer node's MAC address
  11713. *
  11714. * - MAC_ADDR_U16
  11715. * Bits 15:0
  11716. * Purpose: Identifies which peer node the peer ID is for.
  11717. * Value: upper 2 bytes of peer node's MAC address
  11718. *
  11719. * - PRIMARY_TCL_AST_IDX
  11720. * Bits 15:0
  11721. * Purpose: Primary TCL AST index for this peer.
  11722. *
  11723. * - V
  11724. * 1 Bit Position 16
  11725. * Purpose: If the ast idx is valid.
  11726. *
  11727. * - CHIPID
  11728. * Bits 19:17
  11729. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11730. *
  11731. * - TIDMASK
  11732. * Bits 27:20
  11733. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11734. *
  11735. * - CACHE_SET_NUM
  11736. * Bits 31:28
  11737. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11738. * Cache set number that should be used to cache the index based
  11739. * search results, for address and flow search.
  11740. * This value should be equal to LSB four bits of the hash value
  11741. * of match data, in case of search index points to an entry which
  11742. * may be used in content based search also. The value can be
  11743. * anything when the entry pointed by search index will not be
  11744. * used for content based search.
  11745. *
  11746. * - htt_tlv_hdr_t
  11747. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11748. *
  11749. * Bits 11:0
  11750. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11751. *
  11752. * Bits 23:12
  11753. * Purpose: Length, Length of the value that follows the header
  11754. *
  11755. * Bits 31:28
  11756. * Purpose: Reserved.
  11757. *
  11758. *
  11759. * - SW_PEER_ID
  11760. * Bits 15:0
  11761. * Purpose: The peer ID (index) that WAL is allocating
  11762. * Value: (rx) peer ID
  11763. *
  11764. * - VDEV_ID
  11765. * Bits 23:16
  11766. * Purpose: Indicates which virtual device the peer is associated with.
  11767. * Value: vdev ID (used in the host to look up the vdev object)
  11768. *
  11769. * - CHIPID
  11770. * Bits 26:24
  11771. * Purpose: Indicates which Chip id the peer is associated with.
  11772. * Value: chip ID (Provided by Host as part of QMI exchange)
  11773. */
  11774. typedef enum {
  11775. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11776. } MLO_PEER_MAP_TLV_TAG_ID;
  11777. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11778. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11779. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11780. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11781. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11782. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11783. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11784. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11785. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11786. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11787. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11788. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11789. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11790. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11791. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11792. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11793. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11794. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11795. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11796. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11797. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11798. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11799. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11800. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11801. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11802. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11803. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11804. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11805. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11806. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11807. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11808. do { \
  11809. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11810. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11811. } while (0)
  11812. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11813. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11814. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11815. do { \
  11816. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11817. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11818. } while (0)
  11819. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11820. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11821. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11822. do { \
  11823. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11824. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11825. } while (0)
  11826. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11827. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11828. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11829. do { \
  11830. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11831. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11832. } while (0)
  11833. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11834. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11835. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11836. do { \
  11837. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11838. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11839. } while (0)
  11840. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11841. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11842. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11843. do { \
  11844. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11845. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11846. } while (0)
  11847. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11848. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11849. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11850. do { \
  11851. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11852. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11853. } while (0)
  11854. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11855. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11856. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11857. do { \
  11858. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11859. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11860. } while (0)
  11861. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11862. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11863. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11864. do { \
  11865. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11866. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11867. } while (0)
  11868. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11869. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11870. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11871. do { \
  11872. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11873. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11874. } while (0)
  11875. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11876. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11877. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11878. do { \
  11879. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11880. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11881. } while (0)
  11882. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11883. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11884. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11885. do { \
  11886. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11887. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11888. } while (0)
  11889. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11890. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11891. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11892. do { \
  11893. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11894. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11895. } while (0)
  11896. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11897. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11898. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11899. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11900. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11901. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11902. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11903. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11904. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11905. *
  11906. * The following diagram shows the format of the rx mlo peer unmap message sent
  11907. * from the target to the host.
  11908. *
  11909. * |31 24|23 16|15 8|7 0|
  11910. * |-----------------------------------------------------------------------|
  11911. * | RSVD_24_31 | MLO peer ID | msg type |
  11912. * |-----------------------------------------------------------------------|
  11913. */
  11914. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11915. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11916. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11917. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11918. /**
  11919. * @brief target -> host message specifying security parameters
  11920. *
  11921. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11922. *
  11923. * @details
  11924. * The following diagram shows the format of the security specification
  11925. * message sent from the target to the host.
  11926. * This security specification message tells the host whether a PN check is
  11927. * necessary on rx data frames, and if so, how large the PN counter is.
  11928. * This message also tells the host about the security processing to apply
  11929. * to defragmented rx frames - specifically, whether a Message Integrity
  11930. * Check is required, and the Michael key to use.
  11931. *
  11932. * |31 24|23 16|15|14 8|7 0|
  11933. * |-----------------------------------------------------------------------|
  11934. * | peer ID | U| security type | msg type |
  11935. * |-----------------------------------------------------------------------|
  11936. * | Michael Key K0 |
  11937. * |-----------------------------------------------------------------------|
  11938. * | Michael Key K1 |
  11939. * |-----------------------------------------------------------------------|
  11940. * | WAPI RSC Low0 |
  11941. * |-----------------------------------------------------------------------|
  11942. * | WAPI RSC Low1 |
  11943. * |-----------------------------------------------------------------------|
  11944. * | WAPI RSC Hi0 |
  11945. * |-----------------------------------------------------------------------|
  11946. * | WAPI RSC Hi1 |
  11947. * |-----------------------------------------------------------------------|
  11948. *
  11949. * The following field definitions describe the format of the security
  11950. * indication message sent from the target to the host.
  11951. * - MSG_TYPE
  11952. * Bits 7:0
  11953. * Purpose: identifies this as a security specification message
  11954. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11955. * - SEC_TYPE
  11956. * Bits 14:8
  11957. * Purpose: specifies which type of security applies to the peer
  11958. * Value: htt_sec_type enum value
  11959. * - UNICAST
  11960. * Bit 15
  11961. * Purpose: whether this security is applied to unicast or multicast data
  11962. * Value: 1 -> unicast, 0 -> multicast
  11963. * - PEER_ID
  11964. * Bits 31:16
  11965. * Purpose: The ID number for the peer the security specification is for
  11966. * Value: peer ID
  11967. * - MICHAEL_KEY_K0
  11968. * Bits 31:0
  11969. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11970. * Value: Michael Key K0 (if security type is TKIP)
  11971. * - MICHAEL_KEY_K1
  11972. * Bits 31:0
  11973. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11974. * Value: Michael Key K1 (if security type is TKIP)
  11975. * - WAPI_RSC_LOW0
  11976. * Bits 31:0
  11977. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11978. * Value: WAPI RSC Low0 (if security type is WAPI)
  11979. * - WAPI_RSC_LOW1
  11980. * Bits 31:0
  11981. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11982. * Value: WAPI RSC Low1 (if security type is WAPI)
  11983. * - WAPI_RSC_HI0
  11984. * Bits 31:0
  11985. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11986. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11987. * - WAPI_RSC_HI1
  11988. * Bits 31:0
  11989. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11990. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11991. */
  11992. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11993. #define HTT_SEC_IND_SEC_TYPE_S 8
  11994. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11995. #define HTT_SEC_IND_UNICAST_S 15
  11996. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11997. #define HTT_SEC_IND_PEER_ID_S 16
  11998. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11999. do { \
  12000. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12001. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12002. } while (0)
  12003. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12004. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12005. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12006. do { \
  12007. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12008. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12009. } while (0)
  12010. #define HTT_SEC_IND_UNICAST_GET(word) \
  12011. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12012. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12013. do { \
  12014. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12015. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12016. } while (0)
  12017. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12018. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12019. #define HTT_SEC_IND_BYTES 28
  12020. /**
  12021. * @brief target -> host rx ADDBA / DELBA message definitions
  12022. *
  12023. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12024. *
  12025. * @details
  12026. * The following diagram shows the format of the rx ADDBA message sent
  12027. * from the target to the host:
  12028. *
  12029. * |31 20|19 16|15 8|7 0|
  12030. * |---------------------------------------------------------------------|
  12031. * | peer ID | TID | window size | msg type |
  12032. * |---------------------------------------------------------------------|
  12033. *
  12034. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12035. *
  12036. * The following diagram shows the format of the rx DELBA message sent
  12037. * from the target to the host:
  12038. *
  12039. * |31 20|19 16|15 10|9 8|7 0|
  12040. * |---------------------------------------------------------------------|
  12041. * | peer ID | TID | window size | IR| msg type |
  12042. * |---------------------------------------------------------------------|
  12043. *
  12044. * The following field definitions describe the format of the rx ADDBA
  12045. * and DELBA messages sent from the target to the host.
  12046. * - MSG_TYPE
  12047. * Bits 7:0
  12048. * Purpose: identifies this as an rx ADDBA or DELBA message
  12049. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12050. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12051. * - IR (initiator / recipient)
  12052. * Bits 9:8 (DELBA only)
  12053. * Purpose: specify whether the DELBA handshake was initiated by the
  12054. * local STA/AP, or by the peer STA/AP
  12055. * Value:
  12056. * 0 - unspecified
  12057. * 1 - initiator (a.k.a. originator)
  12058. * 2 - recipient (a.k.a. responder)
  12059. * 3 - unused / reserved
  12060. * - WIN_SIZE
  12061. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12062. * Purpose: Specifies the length of the block ack window (max = 64).
  12063. * Value:
  12064. * block ack window length specified by the received ADDBA/DELBA
  12065. * management message.
  12066. * - TID
  12067. * Bits 19:16
  12068. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12069. * Value:
  12070. * TID specified by the received ADDBA or DELBA management message.
  12071. * - PEER_ID
  12072. * Bits 31:20
  12073. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12074. * Value:
  12075. * ID (hash value) used by the host for fast, direct lookup of
  12076. * host SW peer info, including rx reorder states.
  12077. */
  12078. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12079. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12080. #define HTT_RX_ADDBA_TID_M 0xf0000
  12081. #define HTT_RX_ADDBA_TID_S 16
  12082. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12083. #define HTT_RX_ADDBA_PEER_ID_S 20
  12084. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12085. do { \
  12086. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12087. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12088. } while (0)
  12089. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12090. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12091. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12092. do { \
  12093. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12094. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12095. } while (0)
  12096. #define HTT_RX_ADDBA_TID_GET(word) \
  12097. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12098. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12099. do { \
  12100. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12101. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12102. } while (0)
  12103. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12104. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12105. #define HTT_RX_ADDBA_BYTES 4
  12106. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12107. #define HTT_RX_DELBA_INITIATOR_S 8
  12108. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12109. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12110. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12111. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12112. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12113. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12114. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12115. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12116. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12117. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12118. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12119. do { \
  12120. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12121. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12122. } while (0)
  12123. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12124. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12125. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12126. do { \
  12127. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12128. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12129. } while (0)
  12130. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12131. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12132. #define HTT_RX_DELBA_BYTES 4
  12133. /**
  12134. * @brief target -> host rx ADDBA / DELBA message definitions
  12135. *
  12136. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12137. *
  12138. * @details
  12139. * The following diagram shows the format of the rx ADDBA extn message sent
  12140. * from the target to the host:
  12141. *
  12142. * |31 20|19 16|15 13|12 8|7 0|
  12143. * |---------------------------------------------------------------------|
  12144. * | peer ID | TID | reserved | msg type |
  12145. * |---------------------------------------------------------------------|
  12146. * | reserved | window size |
  12147. * |---------------------------------------------------------------------|
  12148. *
  12149. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12150. *
  12151. * The following diagram shows the format of the rx DELBA message sent
  12152. * from the target to the host:
  12153. *
  12154. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12155. * |---------------------------------------------------------------------|
  12156. * | peer ID | TID | reserved | IR| msg type |
  12157. * |---------------------------------------------------------------------|
  12158. * | reserved | window size |
  12159. * |---------------------------------------------------------------------|
  12160. *
  12161. * The following field definitions describe the format of the rx ADDBA
  12162. * and DELBA messages sent from the target to the host.
  12163. * - MSG_TYPE
  12164. * Bits 7:0
  12165. * Purpose: identifies this as an rx ADDBA or DELBA message
  12166. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12167. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12168. * - IR (initiator / recipient)
  12169. * Bits 9:8 (DELBA only)
  12170. * Purpose: specify whether the DELBA handshake was initiated by the
  12171. * local STA/AP, or by the peer STA/AP
  12172. * Value:
  12173. * 0 - unspecified
  12174. * 1 - initiator (a.k.a. originator)
  12175. * 2 - recipient (a.k.a. responder)
  12176. * 3 - unused / reserved
  12177. * Value:
  12178. * block ack window length specified by the received ADDBA/DELBA
  12179. * management message.
  12180. * - TID
  12181. * Bits 19:16
  12182. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12183. * Value:
  12184. * TID specified by the received ADDBA or DELBA management message.
  12185. * - PEER_ID
  12186. * Bits 31:20
  12187. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12188. * Value:
  12189. * ID (hash value) used by the host for fast, direct lookup of
  12190. * host SW peer info, including rx reorder states.
  12191. * == DWORD 1
  12192. * - WIN_SIZE
  12193. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12194. * Purpose: Specifies the length of the block ack window (max = 8191).
  12195. */
  12196. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12197. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12198. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12199. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12200. /*--- Dword 0 ---*/
  12201. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12202. do { \
  12203. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12204. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12205. } while (0)
  12206. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12207. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12208. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12209. do { \
  12210. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12211. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12212. } while (0)
  12213. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12214. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12215. /*--- Dword 1 ---*/
  12216. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12217. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12218. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12219. do { \
  12220. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12221. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12222. } while (0)
  12223. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12224. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12225. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12226. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12227. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12228. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12229. #define HTT_RX_DELBA_EXTN_TID_S 16
  12230. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12231. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12232. /*--- Dword 0 ---*/
  12233. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12234. do { \
  12235. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12236. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12237. } while (0)
  12238. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12239. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12240. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12241. do { \
  12242. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12243. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12244. } while (0)
  12245. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12246. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12247. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12248. do { \
  12249. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12250. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12251. } while (0)
  12252. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12253. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12254. /*--- Dword 1 ---*/
  12255. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12256. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12257. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12258. do { \
  12259. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12260. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12261. } while (0)
  12262. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12263. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12264. #define HTT_RX_DELBA_EXTN_BYTES 8
  12265. /**
  12266. * @brief tx queue group information element definition
  12267. *
  12268. * @details
  12269. * The following diagram shows the format of the tx queue group
  12270. * information element, which can be included in target --> host
  12271. * messages to specify the number of tx "credits" (tx descriptors
  12272. * for LL, or tx buffers for HL) available to a particular group
  12273. * of host-side tx queues, and which host-side tx queues belong to
  12274. * the group.
  12275. *
  12276. * |31|30 24|23 16|15|14|13 0|
  12277. * |------------------------------------------------------------------------|
  12278. * | X| reserved | tx queue grp ID | A| S| credit count |
  12279. * |------------------------------------------------------------------------|
  12280. * | vdev ID mask | AC mask |
  12281. * |------------------------------------------------------------------------|
  12282. *
  12283. * The following definitions describe the fields within the tx queue group
  12284. * information element:
  12285. * - credit_count
  12286. * Bits 13:1
  12287. * Purpose: specify how many tx credits are available to the tx queue group
  12288. * Value: An absolute or relative, positive or negative credit value
  12289. * The 'A' bit specifies whether the value is absolute or relative.
  12290. * The 'S' bit specifies whether the value is positive or negative.
  12291. * A negative value can only be relative, not absolute.
  12292. * An absolute value replaces any prior credit value the host has for
  12293. * the tx queue group in question.
  12294. * A relative value is added to the prior credit value the host has for
  12295. * the tx queue group in question.
  12296. * - sign
  12297. * Bit 14
  12298. * Purpose: specify whether the credit count is positive or negative
  12299. * Value: 0 -> positive, 1 -> negative
  12300. * - absolute
  12301. * Bit 15
  12302. * Purpose: specify whether the credit count is absolute or relative
  12303. * Value: 0 -> relative, 1 -> absolute
  12304. * - txq_group_id
  12305. * Bits 23:16
  12306. * Purpose: indicate which tx queue group's credit and/or membership are
  12307. * being specified
  12308. * Value: 0 to max_tx_queue_groups-1
  12309. * - reserved
  12310. * Bits 30:16
  12311. * Value: 0x0
  12312. * - eXtension
  12313. * Bit 31
  12314. * Purpose: specify whether another tx queue group info element follows
  12315. * Value: 0 -> no more tx queue group information elements
  12316. * 1 -> another tx queue group information element immediately follows
  12317. * - ac_mask
  12318. * Bits 15:0
  12319. * Purpose: specify which Access Categories belong to the tx queue group
  12320. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12321. * the tx queue group.
  12322. * The AC bit-mask values are obtained by left-shifting by the
  12323. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12324. * - vdev_id_mask
  12325. * Bits 31:16
  12326. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12327. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12328. * belong to the tx queue group.
  12329. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12330. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12331. */
  12332. PREPACK struct htt_txq_group {
  12333. A_UINT32
  12334. credit_count: 14,
  12335. sign: 1,
  12336. absolute: 1,
  12337. tx_queue_group_id: 8,
  12338. reserved0: 7,
  12339. extension: 1;
  12340. A_UINT32
  12341. ac_mask: 16,
  12342. vdev_id_mask: 16;
  12343. } POSTPACK;
  12344. /* first word */
  12345. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12346. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12347. #define HTT_TXQ_GROUP_SIGN_S 14
  12348. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12349. #define HTT_TXQ_GROUP_ABS_S 15
  12350. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12351. #define HTT_TXQ_GROUP_ID_S 16
  12352. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12353. #define HTT_TXQ_GROUP_EXT_S 31
  12354. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12355. /* second word */
  12356. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12357. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12358. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12359. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12360. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12361. do { \
  12362. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12363. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12364. } while (0)
  12365. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12366. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12367. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12368. do { \
  12369. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12370. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12371. } while (0)
  12372. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12373. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12374. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12375. do { \
  12376. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12377. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12378. } while (0)
  12379. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12380. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12381. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12382. do { \
  12383. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12384. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12385. } while (0)
  12386. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12387. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12388. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12389. do { \
  12390. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12391. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12392. } while (0)
  12393. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12394. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12395. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12396. do { \
  12397. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12398. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12399. } while (0)
  12400. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12401. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12402. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12403. do { \
  12404. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12405. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12406. } while (0)
  12407. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12408. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12409. /**
  12410. * @brief target -> host TX completion indication message definition
  12411. *
  12412. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12413. *
  12414. * @details
  12415. * The following diagram shows the format of the TX completion indication sent
  12416. * from the target to the host
  12417. *
  12418. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12419. * |-------------------------------------------------------------------|
  12420. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12421. * |-------------------------------------------------------------------|
  12422. * payload:| MSDU1 ID | MSDU0 ID |
  12423. * |-------------------------------------------------------------------|
  12424. * : MSDU3 ID | MSDU2 ID :
  12425. * |-------------------------------------------------------------------|
  12426. * | struct htt_tx_compl_ind_append_retries |
  12427. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12428. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12429. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12430. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12431. * |-------------------------------------------------------------------|
  12432. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12433. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12434. * | MSDU0 tx_tsf64_low |
  12435. * |-------------------------------------------------------------------|
  12436. * | MSDU0 tx_tsf64_high |
  12437. * |-------------------------------------------------------------------|
  12438. * | MSDU1 tx_tsf64_low |
  12439. * |-------------------------------------------------------------------|
  12440. * | MSDU1 tx_tsf64_high |
  12441. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12442. * | phy_timestamp |
  12443. * |-------------------------------------------------------------------|
  12444. * | rate specs (see below) |
  12445. * |-------------------------------------------------------------------|
  12446. * | seqctrl | framectrl |
  12447. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12448. * Where:
  12449. * A0 = append (a.k.a. append0)
  12450. * A1 = append1
  12451. * TP = MSDU tx power presence
  12452. * A2 = append2
  12453. * A3 = append3
  12454. * A4 = append4
  12455. *
  12456. * The following field definitions describe the format of the TX completion
  12457. * indication sent from the target to the host
  12458. * Header fields:
  12459. * - msg_type
  12460. * Bits 7:0
  12461. * Purpose: identifies this as HTT TX completion indication
  12462. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12463. * - status
  12464. * Bits 10:8
  12465. * Purpose: the TX completion status of payload fragmentations descriptors
  12466. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12467. * - tid
  12468. * Bits 14:11
  12469. * Purpose: the tid associated with those fragmentation descriptors. It is
  12470. * valid or not, depending on the tid_invalid bit.
  12471. * Value: 0 to 15
  12472. * - tid_invalid
  12473. * Bits 15:15
  12474. * Purpose: this bit indicates whether the tid field is valid or not
  12475. * Value: 0 indicates valid; 1 indicates invalid
  12476. * - num
  12477. * Bits 23:16
  12478. * Purpose: the number of payload in this indication
  12479. * Value: 1 to 255
  12480. * - append (a.k.a. append0)
  12481. * Bits 24:24
  12482. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12483. * the number of tx retries for one MSDU at the end of this message
  12484. * Value: 0 indicates no appending; 1 indicates appending
  12485. * - append1
  12486. * Bits 25:25
  12487. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12488. * contains the timestamp info for each TX msdu id in payload.
  12489. * The order of the timestamps matches the order of the MSDU IDs.
  12490. * Note that a big-endian host needs to account for the reordering
  12491. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12492. * conversion) when determining which tx timestamp corresponds to
  12493. * which MSDU ID.
  12494. * Value: 0 indicates no appending; 1 indicates appending
  12495. * - msdu_tx_power_presence
  12496. * Bits 26:26
  12497. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12498. * for each MSDU referenced by the TX_COMPL_IND message.
  12499. * The tx power is reported in 0.5 dBm units.
  12500. * The order of the per-MSDU tx power reports matches the order
  12501. * of the MSDU IDs.
  12502. * Note that a big-endian host needs to account for the reordering
  12503. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12504. * conversion) when determining which Tx Power corresponds to
  12505. * which MSDU ID.
  12506. * Value: 0 indicates MSDU tx power reports are not appended,
  12507. * 1 indicates MSDU tx power reports are appended
  12508. * - append2
  12509. * Bits 27:27
  12510. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12511. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12512. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12513. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  12514. * for each MSDU, for convenience.
  12515. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12516. * this append2 bit is set).
  12517. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12518. * dB above the noise floor.
  12519. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12520. * 1 indicates MSDU ACK RSSI values are appended.
  12521. * - append3
  12522. * Bits 28:28
  12523. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12524. * contains the tx tsf info based on wlan global TSF for
  12525. * each TX msdu id in payload.
  12526. * The order of the tx tsf matches the order of the MSDU IDs.
  12527. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12528. * values to indicate the the lower 32 bits and higher 32 bits of
  12529. * the tx tsf.
  12530. * The tx_tsf64 here represents the time MSDU was acked and the
  12531. * tx_tsf64 has microseconds units.
  12532. * Value: 0 indicates no appending; 1 indicates appending
  12533. * - append4
  12534. * Bits 29:29
  12535. * Purpose: Indicate whether data frame control fields and fields required
  12536. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12537. * message. The order of the this message matches the order of
  12538. * the MSDU IDs.
  12539. * Value: 0 indicates frame control fields and fields required for
  12540. * radio tap header values are not appended,
  12541. * 1 indicates frame control fields and fields required for
  12542. * radio tap header values are appended.
  12543. * Payload fields:
  12544. * - hmsdu_id
  12545. * Bits 15:0
  12546. * Purpose: this ID is used to track the Tx buffer in host
  12547. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12548. */
  12549. PREPACK struct htt_tx_data_hdr_information {
  12550. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12551. A_UINT32 /* word 1 */
  12552. /* preamble:
  12553. * 0-OFDM,
  12554. * 1-CCk,
  12555. * 2-HT,
  12556. * 3-VHT
  12557. */
  12558. preamble: 2, /* [1:0] */
  12559. /* mcs:
  12560. * In case of HT preamble interpret
  12561. * MCS along with NSS.
  12562. * Valid values for HT are 0 to 7.
  12563. * HT mcs 0 with NSS 2 is mcs 8.
  12564. * Valid values for VHT are 0 to 9.
  12565. */
  12566. mcs: 4, /* [5:2] */
  12567. /* rate:
  12568. * This is applicable only for
  12569. * CCK and OFDM preamble type
  12570. * rate 0: OFDM 48 Mbps,
  12571. * 1: OFDM 24 Mbps,
  12572. * 2: OFDM 12 Mbps
  12573. * 3: OFDM 6 Mbps
  12574. * 4: OFDM 54 Mbps
  12575. * 5: OFDM 36 Mbps
  12576. * 6: OFDM 18 Mbps
  12577. * 7: OFDM 9 Mbps
  12578. * rate 0: CCK 11 Mbps Long
  12579. * 1: CCK 5.5 Mbps Long
  12580. * 2: CCK 2 Mbps Long
  12581. * 3: CCK 1 Mbps Long
  12582. * 4: CCK 11 Mbps Short
  12583. * 5: CCK 5.5 Mbps Short
  12584. * 6: CCK 2 Mbps Short
  12585. */
  12586. rate : 3, /* [ 8: 6] */
  12587. rssi : 8, /* [16: 9] units=dBm */
  12588. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12589. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12590. stbc : 1, /* [22] */
  12591. sgi : 1, /* [23] */
  12592. ldpc : 1, /* [24] */
  12593. beamformed: 1, /* [25] */
  12594. /* tx_retry_cnt:
  12595. * Indicates retry count of data tx frames provided by the host.
  12596. */
  12597. tx_retry_cnt: 6; /* [31:26] */
  12598. A_UINT32 /* word 2 */
  12599. framectrl:16, /* [15: 0] */
  12600. seqno:16; /* [31:16] */
  12601. } POSTPACK;
  12602. #define HTT_TX_COMPL_IND_STATUS_S 8
  12603. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12604. #define HTT_TX_COMPL_IND_TID_S 11
  12605. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12606. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12607. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12608. #define HTT_TX_COMPL_IND_NUM_S 16
  12609. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12610. #define HTT_TX_COMPL_IND_APPEND_S 24
  12611. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12612. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12613. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12614. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12615. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12616. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12617. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12618. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12619. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12620. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12621. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12622. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12623. do { \
  12624. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12625. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12626. } while (0)
  12627. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12628. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12629. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12630. do { \
  12631. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12632. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12633. } while (0)
  12634. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12635. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12636. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12637. do { \
  12638. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12639. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12640. } while (0)
  12641. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12642. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12643. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12644. do { \
  12645. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12646. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12647. } while (0)
  12648. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12649. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12650. HTT_TX_COMPL_IND_TID_INV_S)
  12651. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12652. do { \
  12653. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12654. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12655. } while (0)
  12656. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12657. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12658. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12659. do { \
  12660. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12661. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12662. } while (0)
  12663. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12664. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12665. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12666. do { \
  12667. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12668. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12669. } while (0)
  12670. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12671. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12672. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12673. do { \
  12674. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12675. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12676. } while (0)
  12677. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12678. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12679. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12680. do { \
  12681. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12682. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12683. } while (0)
  12684. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12685. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12686. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12687. do { \
  12688. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12689. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12690. } while (0)
  12691. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12692. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12693. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12694. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12695. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12696. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12697. #define HTT_TX_COMPL_IND_STAT_OK 0
  12698. /* DISCARD:
  12699. * current meaning:
  12700. * MSDUs were queued for transmission but filtered by HW or SW
  12701. * without any over the air attempts
  12702. * legacy meaning (HL Rome):
  12703. * MSDUs were discarded by the target FW without any over the air
  12704. * attempts due to lack of space
  12705. */
  12706. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12707. /* NO_ACK:
  12708. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12709. */
  12710. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12711. /* POSTPONE:
  12712. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12713. * be downloaded again later (in the appropriate order), when they are
  12714. * deliverable.
  12715. */
  12716. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12717. /*
  12718. * The PEER_DEL tx completion status is used for HL cases
  12719. * where the peer the frame is for has been deleted.
  12720. * The host has already discarded its copy of the frame, but
  12721. * it still needs the tx completion to restore its credit.
  12722. */
  12723. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12724. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12725. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12726. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12727. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12728. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12729. PREPACK struct htt_tx_compl_ind_base {
  12730. A_UINT32 hdr;
  12731. A_UINT16 payload[1/*or more*/];
  12732. } POSTPACK;
  12733. PREPACK struct htt_tx_compl_ind_append_retries {
  12734. A_UINT16 msdu_id;
  12735. A_UINT8 tx_retries;
  12736. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12737. 0: this is the last append_retries struct */
  12738. } POSTPACK;
  12739. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12740. A_UINT32 timestamp[1/*or more*/];
  12741. } POSTPACK;
  12742. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12743. A_UINT32 tx_tsf64_low;
  12744. A_UINT32 tx_tsf64_high;
  12745. } POSTPACK;
  12746. /* htt_tx_data_hdr_information payload extension fields: */
  12747. /* DWORD zero */
  12748. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12749. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12750. /* DWORD one */
  12751. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12752. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12753. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12754. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12755. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12756. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12757. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12758. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12759. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12760. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12761. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12762. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12763. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12764. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12765. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12766. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12767. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12768. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12769. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12770. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12771. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12772. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12773. /* DWORD two */
  12774. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12775. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12776. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12777. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12778. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12779. do { \
  12780. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12781. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12782. } while (0)
  12783. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12784. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12785. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12786. do { \
  12787. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12788. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12789. } while (0)
  12790. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12791. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12792. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12793. do { \
  12794. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12795. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12796. } while (0)
  12797. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12798. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12799. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12800. do { \
  12801. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12802. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12803. } while (0)
  12804. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12805. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12806. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12807. do { \
  12808. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12809. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12810. } while (0)
  12811. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12812. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12813. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12814. do { \
  12815. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12816. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12817. } while (0)
  12818. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12819. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12820. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12821. do { \
  12822. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12823. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12824. } while (0)
  12825. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12826. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12827. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12828. do { \
  12829. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12830. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12831. } while (0)
  12832. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12833. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12834. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12835. do { \
  12836. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12837. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12838. } while (0)
  12839. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12840. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12841. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12842. do { \
  12843. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12844. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12845. } while (0)
  12846. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12847. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12848. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12849. do { \
  12850. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12851. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12852. } while (0)
  12853. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12854. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12855. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12856. do { \
  12857. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12858. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12859. } while (0)
  12860. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12861. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12862. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12863. do { \
  12864. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12865. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12866. } while (0)
  12867. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12868. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12869. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12870. do { \
  12871. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12872. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12873. } while (0)
  12874. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12875. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12876. /**
  12877. * @brief target -> host rate-control update indication message
  12878. *
  12879. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12880. *
  12881. * @details
  12882. * The following diagram shows the format of the RC Update message
  12883. * sent from the target to the host, while processing the tx-completion
  12884. * of a transmitted PPDU.
  12885. *
  12886. * |31 24|23 16|15 8|7 0|
  12887. * |-------------------------------------------------------------|
  12888. * | peer ID | vdev ID | msg_type |
  12889. * |-------------------------------------------------------------|
  12890. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12891. * |-------------------------------------------------------------|
  12892. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12893. * |-------------------------------------------------------------|
  12894. * | : |
  12895. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12896. * | : |
  12897. * |-------------------------------------------------------------|
  12898. * | : |
  12899. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12900. * | : |
  12901. * |-------------------------------------------------------------|
  12902. * : :
  12903. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12904. *
  12905. */
  12906. typedef struct {
  12907. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12908. A_UINT32 rate_code_flags;
  12909. A_UINT32 flags; /* Encodes information such as excessive
  12910. retransmission, aggregate, some info
  12911. from .11 frame control,
  12912. STBC, LDPC, (SGI and Tx Chain Mask
  12913. are encoded in ptx_rc->flags field),
  12914. AMPDU truncation (BT/time based etc.),
  12915. RTS/CTS attempt */
  12916. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12917. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12918. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12919. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12920. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12921. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12922. } HTT_RC_TX_DONE_PARAMS;
  12923. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12924. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12925. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12926. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12927. #define HTT_RC_UPDATE_VDEVID_S 8
  12928. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12929. #define HTT_RC_UPDATE_PEERID_S 16
  12930. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12931. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12932. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12933. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12934. do { \
  12935. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12936. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12937. } while (0)
  12938. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12939. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12940. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12941. do { \
  12942. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12943. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12944. } while (0)
  12945. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12946. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12947. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12948. do { \
  12949. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12950. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12951. } while (0)
  12952. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12953. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12954. /**
  12955. * @brief target -> host rx fragment indication message definition
  12956. *
  12957. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12958. *
  12959. * @details
  12960. * The following field definitions describe the format of the rx fragment
  12961. * indication message sent from the target to the host.
  12962. * The rx fragment indication message shares the format of the
  12963. * rx indication message, but not all fields from the rx indication message
  12964. * are relevant to the rx fragment indication message.
  12965. *
  12966. *
  12967. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12968. * |-----------+-------------------+---------------------+-------------|
  12969. * | peer ID | |FV| ext TID | msg type |
  12970. * |-------------------------------------------------------------------|
  12971. * | | flush | flush |
  12972. * | | end | start |
  12973. * | | seq num | seq num |
  12974. * |-------------------------------------------------------------------|
  12975. * | reserved | FW rx desc bytes |
  12976. * |-------------------------------------------------------------------|
  12977. * | | FW MSDU Rx |
  12978. * | | desc B0 |
  12979. * |-------------------------------------------------------------------|
  12980. * Header fields:
  12981. * - MSG_TYPE
  12982. * Bits 7:0
  12983. * Purpose: identifies this as an rx fragment indication message
  12984. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12985. * - EXT_TID
  12986. * Bits 12:8
  12987. * Purpose: identify the traffic ID of the rx data, including
  12988. * special "extended" TID values for multicast, broadcast, and
  12989. * non-QoS data frames
  12990. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12991. * - FLUSH_VALID (FV)
  12992. * Bit 13
  12993. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12994. * is valid
  12995. * Value:
  12996. * 1 -> flush IE is valid and needs to be processed
  12997. * 0 -> flush IE is not valid and should be ignored
  12998. * - PEER_ID
  12999. * Bits 31:16
  13000. * Purpose: Identify, by ID, which peer sent the rx data
  13001. * Value: ID of the peer who sent the rx data
  13002. * - FLUSH_SEQ_NUM_START
  13003. * Bits 5:0
  13004. * Purpose: Indicate the start of a series of MPDUs to flush
  13005. * Not all MPDUs within this series are necessarily valid - the host
  13006. * must check each sequence number within this range to see if the
  13007. * corresponding MPDU is actually present.
  13008. * This field is only valid if the FV bit is set.
  13009. * Value:
  13010. * The sequence number for the first MPDUs to check to flush.
  13011. * The sequence number is masked by 0x3f.
  13012. * - FLUSH_SEQ_NUM_END
  13013. * Bits 11:6
  13014. * Purpose: Indicate the end of a series of MPDUs to flush
  13015. * Value:
  13016. * The sequence number one larger than the sequence number of the
  13017. * last MPDU to check to flush.
  13018. * The sequence number is masked by 0x3f.
  13019. * Not all MPDUs within this series are necessarily valid - the host
  13020. * must check each sequence number within this range to see if the
  13021. * corresponding MPDU is actually present.
  13022. * This field is only valid if the FV bit is set.
  13023. * Rx descriptor fields:
  13024. * - FW_RX_DESC_BYTES
  13025. * Bits 15:0
  13026. * Purpose: Indicate how many bytes in the Rx indication are used for
  13027. * FW Rx descriptors
  13028. * Value: 1
  13029. */
  13030. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13031. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13032. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13033. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13034. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13035. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13036. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13037. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13038. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13039. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13040. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13041. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13042. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13043. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13044. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13045. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13046. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13047. #define HTT_RX_FRAG_IND_BYTES \
  13048. (4 /* msg hdr */ + \
  13049. 4 /* flush spec */ + \
  13050. 4 /* (unused) FW rx desc bytes spec */ + \
  13051. 4 /* FW rx desc */)
  13052. /**
  13053. * @brief target -> host test message definition
  13054. *
  13055. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13056. *
  13057. * @details
  13058. * The following field definitions describe the format of the test
  13059. * message sent from the target to the host.
  13060. * The message consists of a 4-octet header, followed by a variable
  13061. * number of 32-bit integer values, followed by a variable number
  13062. * of 8-bit character values.
  13063. *
  13064. * |31 16|15 8|7 0|
  13065. * |-----------------------------------------------------------|
  13066. * | num chars | num ints | msg type |
  13067. * |-----------------------------------------------------------|
  13068. * | int 0 |
  13069. * |-----------------------------------------------------------|
  13070. * | int 1 |
  13071. * |-----------------------------------------------------------|
  13072. * | ... |
  13073. * |-----------------------------------------------------------|
  13074. * | char 3 | char 2 | char 1 | char 0 |
  13075. * |-----------------------------------------------------------|
  13076. * | | | ... | char 4 |
  13077. * |-----------------------------------------------------------|
  13078. * - MSG_TYPE
  13079. * Bits 7:0
  13080. * Purpose: identifies this as a test message
  13081. * Value: HTT_MSG_TYPE_TEST
  13082. * - NUM_INTS
  13083. * Bits 15:8
  13084. * Purpose: indicate how many 32-bit integers follow the message header
  13085. * - NUM_CHARS
  13086. * Bits 31:16
  13087. * Purpose: indicate how many 8-bit charaters follow the series of integers
  13088. */
  13089. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13090. #define HTT_RX_TEST_NUM_INTS_S 8
  13091. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13092. #define HTT_RX_TEST_NUM_CHARS_S 16
  13093. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13094. do { \
  13095. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13096. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13097. } while (0)
  13098. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13099. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13100. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13101. do { \
  13102. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13103. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13104. } while (0)
  13105. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13106. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13107. /**
  13108. * @brief target -> host packet log message
  13109. *
  13110. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13111. *
  13112. * @details
  13113. * The following field definitions describe the format of the packet log
  13114. * message sent from the target to the host.
  13115. * The message consists of a 4-octet header,followed by a variable number
  13116. * of 32-bit character values.
  13117. *
  13118. * |31 16|15 12|11 10|9 8|7 0|
  13119. * |------------------------------------------------------------------|
  13120. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13121. * |------------------------------------------------------------------|
  13122. * | payload |
  13123. * |------------------------------------------------------------------|
  13124. * - MSG_TYPE
  13125. * Bits 7:0
  13126. * Purpose: identifies this as a pktlog message
  13127. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13128. * - mac_id
  13129. * Bits 9:8
  13130. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13131. * Value: 0-3
  13132. * - pdev_id
  13133. * Bits 11:10
  13134. * Purpose: pdev_id
  13135. * Value: 0-3
  13136. * 0 (for rings at SOC level),
  13137. * 1/2/3 PDEV -> 0/1/2
  13138. * - payload_size
  13139. * Bits 31:16
  13140. * Purpose: explicitly specify the payload size
  13141. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13142. */
  13143. PREPACK struct htt_pktlog_msg {
  13144. A_UINT32 header;
  13145. A_UINT32 payload[1/* or more */];
  13146. } POSTPACK;
  13147. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13148. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13149. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13150. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13151. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13152. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13153. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13154. do { \
  13155. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13156. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13157. } while (0)
  13158. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13159. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13160. HTT_T2H_PKTLOG_MAC_ID_S)
  13161. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13162. do { \
  13163. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13164. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13165. } while (0)
  13166. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13167. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13168. HTT_T2H_PKTLOG_PDEV_ID_S)
  13169. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13170. do { \
  13171. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13172. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13173. } while (0)
  13174. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13175. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13176. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13177. /*
  13178. * Rx reorder statistics
  13179. * NB: all the fields must be defined in 4 octets size.
  13180. */
  13181. struct rx_reorder_stats {
  13182. /* Non QoS MPDUs received */
  13183. A_UINT32 deliver_non_qos;
  13184. /* MPDUs received in-order */
  13185. A_UINT32 deliver_in_order;
  13186. /* Flush due to reorder timer expired */
  13187. A_UINT32 deliver_flush_timeout;
  13188. /* Flush due to move out of window */
  13189. A_UINT32 deliver_flush_oow;
  13190. /* Flush due to DELBA */
  13191. A_UINT32 deliver_flush_delba;
  13192. /* MPDUs dropped due to FCS error */
  13193. A_UINT32 fcs_error;
  13194. /* MPDUs dropped due to monitor mode non-data packet */
  13195. A_UINT32 mgmt_ctrl;
  13196. /* Unicast-data MPDUs dropped due to invalid peer */
  13197. A_UINT32 invalid_peer;
  13198. /* MPDUs dropped due to duplication (non aggregation) */
  13199. A_UINT32 dup_non_aggr;
  13200. /* MPDUs dropped due to processed before */
  13201. A_UINT32 dup_past;
  13202. /* MPDUs dropped due to duplicate in reorder queue */
  13203. A_UINT32 dup_in_reorder;
  13204. /* Reorder timeout happened */
  13205. A_UINT32 reorder_timeout;
  13206. /* invalid bar ssn */
  13207. A_UINT32 invalid_bar_ssn;
  13208. /* reorder reset due to bar ssn */
  13209. A_UINT32 ssn_reset;
  13210. /* Flush due to delete peer */
  13211. A_UINT32 deliver_flush_delpeer;
  13212. /* Flush due to offload*/
  13213. A_UINT32 deliver_flush_offload;
  13214. /* Flush due to out of buffer*/
  13215. A_UINT32 deliver_flush_oob;
  13216. /* MPDUs dropped due to PN check fail */
  13217. A_UINT32 pn_fail;
  13218. /* MPDUs dropped due to unable to allocate memory */
  13219. A_UINT32 store_fail;
  13220. /* Number of times the tid pool alloc succeeded */
  13221. A_UINT32 tid_pool_alloc_succ;
  13222. /* Number of times the MPDU pool alloc succeeded */
  13223. A_UINT32 mpdu_pool_alloc_succ;
  13224. /* Number of times the MSDU pool alloc succeeded */
  13225. A_UINT32 msdu_pool_alloc_succ;
  13226. /* Number of times the tid pool alloc failed */
  13227. A_UINT32 tid_pool_alloc_fail;
  13228. /* Number of times the MPDU pool alloc failed */
  13229. A_UINT32 mpdu_pool_alloc_fail;
  13230. /* Number of times the MSDU pool alloc failed */
  13231. A_UINT32 msdu_pool_alloc_fail;
  13232. /* Number of times the tid pool freed */
  13233. A_UINT32 tid_pool_free;
  13234. /* Number of times the MPDU pool freed */
  13235. A_UINT32 mpdu_pool_free;
  13236. /* Number of times the MSDU pool freed */
  13237. A_UINT32 msdu_pool_free;
  13238. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13239. A_UINT32 msdu_queued;
  13240. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13241. A_UINT32 msdu_recycled;
  13242. /* Number of MPDUs with invalid peer but A2 found in AST */
  13243. A_UINT32 invalid_peer_a2_in_ast;
  13244. /* Number of MPDUs with invalid peer but A3 found in AST */
  13245. A_UINT32 invalid_peer_a3_in_ast;
  13246. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13247. A_UINT32 invalid_peer_bmc_mpdus;
  13248. /* Number of MSDUs with err attention word */
  13249. A_UINT32 rxdesc_err_att;
  13250. /* Number of MSDUs with flag of peer_idx_invalid */
  13251. A_UINT32 rxdesc_err_peer_idx_inv;
  13252. /* Number of MSDUs with flag of peer_idx_timeout */
  13253. A_UINT32 rxdesc_err_peer_idx_to;
  13254. /* Number of MSDUs with flag of overflow */
  13255. A_UINT32 rxdesc_err_ov;
  13256. /* Number of MSDUs with flag of msdu_length_err */
  13257. A_UINT32 rxdesc_err_msdu_len;
  13258. /* Number of MSDUs with flag of mpdu_length_err */
  13259. A_UINT32 rxdesc_err_mpdu_len;
  13260. /* Number of MSDUs with flag of tkip_mic_err */
  13261. A_UINT32 rxdesc_err_tkip_mic;
  13262. /* Number of MSDUs with flag of decrypt_err */
  13263. A_UINT32 rxdesc_err_decrypt;
  13264. /* Number of MSDUs with flag of fcs_err */
  13265. A_UINT32 rxdesc_err_fcs;
  13266. /* Number of Unicast (bc_mc bit is not set in attention word)
  13267. * frames with invalid peer handler
  13268. */
  13269. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13270. /* Number of unicast frame directly (direct bit is set in attention word)
  13271. * to DUT with invalid peer handler
  13272. */
  13273. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13274. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13275. * frames with invalid peer handler
  13276. */
  13277. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13278. /* Number of MSDUs dropped due to no first MSDU flag */
  13279. A_UINT32 rxdesc_no_1st_msdu;
  13280. /* Number of MSDUs droped due to ring overflow */
  13281. A_UINT32 msdu_drop_ring_ov;
  13282. /* Number of MSDUs dropped due to FC mismatch */
  13283. A_UINT32 msdu_drop_fc_mismatch;
  13284. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13285. A_UINT32 msdu_drop_mgmt_remote_ring;
  13286. /* Number of MSDUs dropped due to errors not reported in attention word */
  13287. A_UINT32 msdu_drop_misc;
  13288. /* Number of MSDUs go to offload before reorder */
  13289. A_UINT32 offload_msdu_wal;
  13290. /* Number of data frame dropped by offload after reorder */
  13291. A_UINT32 offload_msdu_reorder;
  13292. /* Number of MPDUs with sequence number in the past and within the BA window */
  13293. A_UINT32 dup_past_within_window;
  13294. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13295. A_UINT32 dup_past_outside_window;
  13296. /* Number of MSDUs with decrypt/MIC error */
  13297. A_UINT32 rxdesc_err_decrypt_mic;
  13298. /* Number of data MSDUs received on both local and remote rings */
  13299. A_UINT32 data_msdus_on_both_rings;
  13300. /* MPDUs never filled */
  13301. A_UINT32 holes_not_filled;
  13302. };
  13303. /*
  13304. * Rx Remote buffer statistics
  13305. * NB: all the fields must be defined in 4 octets size.
  13306. */
  13307. struct rx_remote_buffer_mgmt_stats {
  13308. /* Total number of MSDUs reaped for Rx processing */
  13309. A_UINT32 remote_reaped;
  13310. /* MSDUs recycled within firmware */
  13311. A_UINT32 remote_recycled;
  13312. /* MSDUs stored by Data Rx */
  13313. A_UINT32 data_rx_msdus_stored;
  13314. /* Number of HTT indications from WAL Rx MSDU */
  13315. A_UINT32 wal_rx_ind;
  13316. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13317. A_UINT32 wal_rx_ind_unconsumed;
  13318. /* Number of HTT indications from Data Rx MSDU */
  13319. A_UINT32 data_rx_ind;
  13320. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13321. A_UINT32 data_rx_ind_unconsumed;
  13322. /* Number of HTT indications from ATHBUF */
  13323. A_UINT32 athbuf_rx_ind;
  13324. /* Number of remote buffers requested for refill */
  13325. A_UINT32 refill_buf_req;
  13326. /* Number of remote buffers filled by the host */
  13327. A_UINT32 refill_buf_rsp;
  13328. /* Number of times MAC hw_index = f/w write_index */
  13329. A_INT32 mac_no_bufs;
  13330. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13331. A_INT32 fw_indices_equal;
  13332. /* Number of times f/w finds no buffers to post */
  13333. A_INT32 host_no_bufs;
  13334. };
  13335. /*
  13336. * TXBF MU/SU packets and NDPA statistics
  13337. * NB: all the fields must be defined in 4 octets size.
  13338. */
  13339. struct rx_txbf_musu_ndpa_pkts_stats {
  13340. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13341. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13342. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13343. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13344. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13345. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13346. };
  13347. /*
  13348. * htt_dbg_stats_status -
  13349. * present - The requested stats have been delivered in full.
  13350. * This indicates that either the stats information was contained
  13351. * in its entirety within this message, or else this message
  13352. * completes the delivery of the requested stats info that was
  13353. * partially delivered through earlier STATS_CONF messages.
  13354. * partial - The requested stats have been delivered in part.
  13355. * One or more subsequent STATS_CONF messages with the same
  13356. * cookie value will be sent to deliver the remainder of the
  13357. * information.
  13358. * error - The requested stats could not be delivered, for example due
  13359. * to a shortage of memory to construct a message holding the
  13360. * requested stats.
  13361. * invalid - The requested stat type is either not recognized, or the
  13362. * target is configured to not gather the stats type in question.
  13363. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13364. * series_done - This special value indicates that no further stats info
  13365. * elements are present within a series of stats info elems
  13366. * (within a stats upload confirmation message).
  13367. */
  13368. enum htt_dbg_stats_status {
  13369. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13370. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13371. HTT_DBG_STATS_STATUS_ERROR = 2,
  13372. HTT_DBG_STATS_STATUS_INVALID = 3,
  13373. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13374. };
  13375. /**
  13376. * @brief target -> host statistics upload
  13377. *
  13378. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13379. *
  13380. * @details
  13381. * The following field definitions describe the format of the HTT target
  13382. * to host stats upload confirmation message.
  13383. * The message contains a cookie echoed from the HTT host->target stats
  13384. * upload request, which identifies which request the confirmation is
  13385. * for, and a series of tag-length-value stats information elements.
  13386. * The tag-length header for each stats info element also includes a
  13387. * status field, to indicate whether the request for the stat type in
  13388. * question was fully met, partially met, unable to be met, or invalid
  13389. * (if the stat type in question is disabled in the target).
  13390. * A special value of all 1's in this status field is used to indicate
  13391. * the end of the series of stats info elements.
  13392. *
  13393. *
  13394. * |31 16|15 8|7 5|4 0|
  13395. * |------------------------------------------------------------|
  13396. * | reserved | msg type |
  13397. * |------------------------------------------------------------|
  13398. * | cookie LSBs |
  13399. * |------------------------------------------------------------|
  13400. * | cookie MSBs |
  13401. * |------------------------------------------------------------|
  13402. * | stats entry length | reserved | S |stat type|
  13403. * |------------------------------------------------------------|
  13404. * | |
  13405. * | type-specific stats info |
  13406. * | |
  13407. * |------------------------------------------------------------|
  13408. * | stats entry length | reserved | S |stat type|
  13409. * |------------------------------------------------------------|
  13410. * | |
  13411. * | type-specific stats info |
  13412. * | |
  13413. * |------------------------------------------------------------|
  13414. * | n/a | reserved | 111 | n/a |
  13415. * |------------------------------------------------------------|
  13416. * Header fields:
  13417. * - MSG_TYPE
  13418. * Bits 7:0
  13419. * Purpose: identifies this is a statistics upload confirmation message
  13420. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13421. * - COOKIE_LSBS
  13422. * Bits 31:0
  13423. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13424. * message with its preceding host->target stats request message.
  13425. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13426. * - COOKIE_MSBS
  13427. * Bits 31:0
  13428. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13429. * message with its preceding host->target stats request message.
  13430. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13431. *
  13432. * Stats Information Element tag-length header fields:
  13433. * - STAT_TYPE
  13434. * Bits 4:0
  13435. * Purpose: identifies the type of statistics info held in the
  13436. * following information element
  13437. * Value: htt_dbg_stats_type
  13438. * - STATUS
  13439. * Bits 7:5
  13440. * Purpose: indicate whether the requested stats are present
  13441. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13442. * the completion of the stats entry series
  13443. * - LENGTH
  13444. * Bits 31:16
  13445. * Purpose: indicate the stats information size
  13446. * Value: This field specifies the number of bytes of stats information
  13447. * that follows the element tag-length header.
  13448. * It is expected but not required that this length is a multiple of
  13449. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13450. * subsequent stats entry header will begin on a 4-byte aligned
  13451. * boundary.
  13452. */
  13453. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13454. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13455. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13456. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13457. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13458. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13459. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13460. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13461. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13462. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13463. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13464. do { \
  13465. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13466. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13467. } while (0)
  13468. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13469. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13470. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13471. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13472. do { \
  13473. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13474. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13475. } while (0)
  13476. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13477. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13478. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13479. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13480. do { \
  13481. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13482. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13483. } while (0)
  13484. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13485. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13486. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13487. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13488. #define HTT_MAX_AGGR 64
  13489. #define HTT_HL_MAX_AGGR 18
  13490. /**
  13491. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13492. *
  13493. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13494. *
  13495. * @details
  13496. * The following field definitions describe the format of the HTT host
  13497. * to target frag_desc/msdu_ext bank configuration message.
  13498. * The message contains the based address and the min and max id of the
  13499. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13500. * MSDU_EXT/FRAG_DESC.
  13501. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13502. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13503. * the hardware does the mapping/translation.
  13504. *
  13505. * Total banks that can be configured is configured to 16.
  13506. *
  13507. * This should be called before any TX has be initiated by the HTT
  13508. *
  13509. * |31 16|15 8|7 5|4 0|
  13510. * |------------------------------------------------------------|
  13511. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13512. * |------------------------------------------------------------|
  13513. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13514. #if HTT_PADDR64
  13515. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13516. #endif
  13517. * |------------------------------------------------------------|
  13518. * | ... |
  13519. * |------------------------------------------------------------|
  13520. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13521. #if HTT_PADDR64
  13522. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13523. #endif
  13524. * |------------------------------------------------------------|
  13525. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13526. * |------------------------------------------------------------|
  13527. * | ... |
  13528. * |------------------------------------------------------------|
  13529. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13530. * |------------------------------------------------------------|
  13531. * Header fields:
  13532. * - MSG_TYPE
  13533. * Bits 7:0
  13534. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13535. * for systems with 64-bit format for bus addresses:
  13536. * - BANKx_BASE_ADDRESS_LO
  13537. * Bits 31:0
  13538. * Purpose: Provide a mechanism to specify the base address of the
  13539. * MSDU_EXT bank physical/bus address.
  13540. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13541. * - BANKx_BASE_ADDRESS_HI
  13542. * Bits 31:0
  13543. * Purpose: Provide a mechanism to specify the base address of the
  13544. * MSDU_EXT bank physical/bus address.
  13545. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13546. * for systems with 32-bit format for bus addresses:
  13547. * - BANKx_BASE_ADDRESS
  13548. * Bits 31:0
  13549. * Purpose: Provide a mechanism to specify the base address of the
  13550. * MSDU_EXT bank physical/bus address.
  13551. * Value: MSDU_EXT bank physical / bus address
  13552. * - BANKx_MIN_ID
  13553. * Bits 15:0
  13554. * Purpose: Provide a mechanism to specify the min index that needs to
  13555. * mapped.
  13556. * - BANKx_MAX_ID
  13557. * Bits 31:16
  13558. * Purpose: Provide a mechanism to specify the max index that needs to
  13559. * mapped.
  13560. *
  13561. */
  13562. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13563. * safe value.
  13564. * @note MAX supported banks is 16.
  13565. */
  13566. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13567. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13568. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13569. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13570. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13571. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13572. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13573. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13574. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13575. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13576. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13577. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13578. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13579. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13580. do { \
  13581. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13582. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13583. } while (0)
  13584. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13585. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13586. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13587. do { \
  13588. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13589. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13590. } while (0)
  13591. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13592. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13593. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13594. do { \
  13595. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13596. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13597. } while (0)
  13598. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13599. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13600. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13601. do { \
  13602. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13603. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13604. } while (0)
  13605. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13606. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13607. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13608. do { \
  13609. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13610. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13611. } while (0)
  13612. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13613. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13614. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13615. do { \
  13616. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13617. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13618. } while (0)
  13619. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13620. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13621. /*
  13622. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13623. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13624. * addresses are stored in a XXX-bit field.
  13625. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13626. * htt_tx_frag_desc64_bank_cfg_t structs.
  13627. */
  13628. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13629. _paddr_bits_, \
  13630. _paddr__bank_base_address_) \
  13631. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13632. /** word 0 \
  13633. * msg_type: 8, \
  13634. * pdev_id: 2, \
  13635. * swap: 1, \
  13636. * reserved0: 5, \
  13637. * num_banks: 8, \
  13638. * desc_size: 8; \
  13639. */ \
  13640. A_UINT32 word0; \
  13641. /* \
  13642. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13643. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13644. * the second A_UINT32). \
  13645. */ \
  13646. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13647. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13648. } POSTPACK
  13649. /* define htt_tx_frag_desc32_bank_cfg_t */
  13650. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13651. /* define htt_tx_frag_desc64_bank_cfg_t */
  13652. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13653. /*
  13654. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13655. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13656. */
  13657. #if HTT_PADDR64
  13658. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13659. #else
  13660. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13661. #endif
  13662. /**
  13663. * @brief target -> host HTT TX Credit total count update message definition
  13664. *
  13665. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13666. *
  13667. *|31 16|15|14 9| 8 |7 0 |
  13668. *|---------------------+--+----------+-------+----------|
  13669. *|cur htt credit delta | Q| reserved | sign | msg type |
  13670. *|------------------------------------------------------|
  13671. *
  13672. * Header fields:
  13673. * - MSG_TYPE
  13674. * Bits 7:0
  13675. * Purpose: identifies this as a htt tx credit delta update message
  13676. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13677. * - SIGN
  13678. * Bits 8
  13679. * identifies whether credit delta is positive or negative
  13680. * Value:
  13681. * - 0x0: credit delta is positive, rebalance in some buffers
  13682. * - 0x1: credit delta is negative, rebalance out some buffers
  13683. * - reserved
  13684. * Bits 14:9
  13685. * Value: 0x0
  13686. * - TXQ_GRP
  13687. * Bit 15
  13688. * Purpose: indicates whether any tx queue group information elements
  13689. * are appended to the tx credit update message
  13690. * Value: 0 -> no tx queue group information element is present
  13691. * 1 -> a tx queue group information element immediately follows
  13692. * - DELTA_COUNT
  13693. * Bits 31:16
  13694. * Purpose: Specify current htt credit delta absolute count
  13695. */
  13696. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13697. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13698. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13699. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13700. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13701. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13702. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13703. do { \
  13704. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13705. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13706. } while (0)
  13707. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13708. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13709. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13710. do { \
  13711. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13712. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13713. } while (0)
  13714. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13715. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13716. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13717. do { \
  13718. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13719. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13720. } while (0)
  13721. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13722. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13723. #define HTT_TX_CREDIT_MSG_BYTES 4
  13724. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13725. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13726. /**
  13727. * @brief HTT WDI_IPA Operation Response Message
  13728. *
  13729. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13730. *
  13731. * @details
  13732. * HTT WDI_IPA Operation Response message is sent by target
  13733. * to host confirming suspend or resume operation.
  13734. * |31 24|23 16|15 8|7 0|
  13735. * |----------------+----------------+----------------+----------------|
  13736. * | op_code | Rsvd | msg_type |
  13737. * |-------------------------------------------------------------------|
  13738. * | Rsvd | Response len |
  13739. * |-------------------------------------------------------------------|
  13740. * | |
  13741. * | Response-type specific info |
  13742. * | |
  13743. * | |
  13744. * |-------------------------------------------------------------------|
  13745. * Header fields:
  13746. * - MSG_TYPE
  13747. * Bits 7:0
  13748. * Purpose: Identifies this as WDI_IPA Operation Response message
  13749. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13750. * - OP_CODE
  13751. * Bits 31:16
  13752. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13753. * value: = enum htt_wdi_ipa_op_code
  13754. * - RSP_LEN
  13755. * Bits 16:0
  13756. * Purpose: length for the response-type specific info
  13757. * value: = length in bytes for response-type specific info
  13758. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13759. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13760. */
  13761. PREPACK struct htt_wdi_ipa_op_response_t
  13762. {
  13763. /* DWORD 0: flags and meta-data */
  13764. A_UINT32
  13765. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13766. reserved1: 8,
  13767. op_code: 16;
  13768. A_UINT32
  13769. rsp_len: 16,
  13770. reserved2: 16;
  13771. } POSTPACK;
  13772. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13773. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13774. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13775. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13776. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13777. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13778. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13779. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13780. do { \
  13781. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13782. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13783. } while (0)
  13784. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13785. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13786. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13787. do { \
  13788. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13789. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13790. } while (0)
  13791. enum htt_phy_mode {
  13792. htt_phy_mode_11a = 0,
  13793. htt_phy_mode_11g = 1,
  13794. htt_phy_mode_11b = 2,
  13795. htt_phy_mode_11g_only = 3,
  13796. htt_phy_mode_11na_ht20 = 4,
  13797. htt_phy_mode_11ng_ht20 = 5,
  13798. htt_phy_mode_11na_ht40 = 6,
  13799. htt_phy_mode_11ng_ht40 = 7,
  13800. htt_phy_mode_11ac_vht20 = 8,
  13801. htt_phy_mode_11ac_vht40 = 9,
  13802. htt_phy_mode_11ac_vht80 = 10,
  13803. htt_phy_mode_11ac_vht20_2g = 11,
  13804. htt_phy_mode_11ac_vht40_2g = 12,
  13805. htt_phy_mode_11ac_vht80_2g = 13,
  13806. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13807. htt_phy_mode_11ac_vht160 = 15,
  13808. htt_phy_mode_max,
  13809. };
  13810. /**
  13811. * @brief target -> host HTT channel change indication
  13812. *
  13813. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13814. *
  13815. * @details
  13816. * Specify when a channel change occurs.
  13817. * This allows the host to precisely determine which rx frames arrived
  13818. * on the old channel and which rx frames arrived on the new channel.
  13819. *
  13820. *|31 |7 0 |
  13821. *|-------------------------------------------+----------|
  13822. *| reserved | msg type |
  13823. *|------------------------------------------------------|
  13824. *| primary_chan_center_freq_mhz |
  13825. *|------------------------------------------------------|
  13826. *| contiguous_chan1_center_freq_mhz |
  13827. *|------------------------------------------------------|
  13828. *| contiguous_chan2_center_freq_mhz |
  13829. *|------------------------------------------------------|
  13830. *| phy_mode |
  13831. *|------------------------------------------------------|
  13832. *
  13833. * Header fields:
  13834. * - MSG_TYPE
  13835. * Bits 7:0
  13836. * Purpose: identifies this as a htt channel change indication message
  13837. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13838. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13839. * Bits 31:0
  13840. * Purpose: identify the (center of the) new 20 MHz primary channel
  13841. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13842. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13843. * Bits 31:0
  13844. * Purpose: identify the (center of the) contiguous frequency range
  13845. * comprising the new channel.
  13846. * For example, if the new channel is a 80 MHz channel extending
  13847. * 60 MHz beyond the primary channel, this field would be 30 larger
  13848. * than the primary channel center frequency field.
  13849. * Value: center frequency of the contiguous frequency range comprising
  13850. * the full channel in MHz units
  13851. * (80+80 channels also use the CONTIG_CHAN2 field)
  13852. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13853. * Bits 31:0
  13854. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13855. * within a VHT 80+80 channel.
  13856. * This field is only relevant for VHT 80+80 channels.
  13857. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13858. * channel (arbitrary value for cases besides VHT 80+80)
  13859. * - PHY_MODE
  13860. * Bits 31:0
  13861. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13862. * and band
  13863. * Value: htt_phy_mode enum value
  13864. */
  13865. PREPACK struct htt_chan_change_t
  13866. {
  13867. /* DWORD 0: flags and meta-data */
  13868. A_UINT32
  13869. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13870. reserved1: 24;
  13871. A_UINT32 primary_chan_center_freq_mhz;
  13872. A_UINT32 contig_chan1_center_freq_mhz;
  13873. A_UINT32 contig_chan2_center_freq_mhz;
  13874. A_UINT32 phy_mode;
  13875. } POSTPACK;
  13876. /*
  13877. * Due to historical / backwards-compatibility reasons, maintain the
  13878. * below htt_chan_change_msg struct definition, which needs to be
  13879. * consistent with the above htt_chan_change_t struct definition
  13880. * (aside from the htt_chan_change_t definition including the msg_type
  13881. * dword within the message, and the htt_chan_change_msg only containing
  13882. * the payload of the message that follows the msg_type dword).
  13883. */
  13884. PREPACK struct htt_chan_change_msg {
  13885. A_UINT32 chan_mhz; /* frequency in mhz */
  13886. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13887. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13888. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13889. } POSTPACK;
  13890. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13891. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13892. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13893. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13894. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13895. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13896. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13897. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13898. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13899. do { \
  13900. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13901. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13902. } while (0)
  13903. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13904. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13905. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13906. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13907. do { \
  13908. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13909. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13910. } while (0)
  13911. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13912. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13913. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13914. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13915. do { \
  13916. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13917. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13918. } while (0)
  13919. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13920. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13921. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13922. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13923. do { \
  13924. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13925. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13926. } while (0)
  13927. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13928. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13929. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13930. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13931. /**
  13932. * @brief rx offload packet error message
  13933. *
  13934. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13935. *
  13936. * @details
  13937. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13938. * of target payload like mic err.
  13939. *
  13940. * |31 24|23 16|15 8|7 0|
  13941. * |----------------+----------------+----------------+----------------|
  13942. * | tid | vdev_id | msg_sub_type | msg_type |
  13943. * |-------------------------------------------------------------------|
  13944. * : (sub-type dependent content) :
  13945. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13946. * Header fields:
  13947. * - msg_type
  13948. * Bits 7:0
  13949. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13950. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13951. * - msg_sub_type
  13952. * Bits 15:8
  13953. * Purpose: Identifies which type of rx error is reported by this message
  13954. * value: htt_rx_ofld_pkt_err_type
  13955. * - vdev_id
  13956. * Bits 23:16
  13957. * Purpose: Identifies which vdev received the erroneous rx frame
  13958. * value:
  13959. * - tid
  13960. * Bits 31:24
  13961. * Purpose: Identifies the traffic type of the rx frame
  13962. * value:
  13963. *
  13964. * - The payload fields used if the sub-type == MIC error are shown below.
  13965. * Note - MIC err is per MSDU, while PN is per MPDU.
  13966. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13967. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13968. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13969. * instead of sending separate HTT messages for each wrong MSDU within
  13970. * the MPDU.
  13971. *
  13972. * |31 24|23 16|15 8|7 0|
  13973. * |----------------+----------------+----------------+----------------|
  13974. * | Rsvd | key_id | peer_id |
  13975. * |-------------------------------------------------------------------|
  13976. * | receiver MAC addr 31:0 |
  13977. * |-------------------------------------------------------------------|
  13978. * | Rsvd | receiver MAC addr 47:32 |
  13979. * |-------------------------------------------------------------------|
  13980. * | transmitter MAC addr 31:0 |
  13981. * |-------------------------------------------------------------------|
  13982. * | Rsvd | transmitter MAC addr 47:32 |
  13983. * |-------------------------------------------------------------------|
  13984. * | PN 31:0 |
  13985. * |-------------------------------------------------------------------|
  13986. * | Rsvd | PN 47:32 |
  13987. * |-------------------------------------------------------------------|
  13988. * - peer_id
  13989. * Bits 15:0
  13990. * Purpose: identifies which peer is frame is from
  13991. * value:
  13992. * - key_id
  13993. * Bits 23:16
  13994. * Purpose: identifies key_id of rx frame
  13995. * value:
  13996. * - RA_31_0 (receiver MAC addr 31:0)
  13997. * Bits 31:0
  13998. * Purpose: identifies by MAC address which vdev received the frame
  13999. * value: MAC address lower 4 bytes
  14000. * - RA_47_32 (receiver MAC addr 47:32)
  14001. * Bits 15:0
  14002. * Purpose: identifies by MAC address which vdev received the frame
  14003. * value: MAC address upper 2 bytes
  14004. * - TA_31_0 (transmitter MAC addr 31:0)
  14005. * Bits 31:0
  14006. * Purpose: identifies by MAC address which peer transmitted the frame
  14007. * value: MAC address lower 4 bytes
  14008. * - TA_47_32 (transmitter MAC addr 47:32)
  14009. * Bits 15:0
  14010. * Purpose: identifies by MAC address which peer transmitted the frame
  14011. * value: MAC address upper 2 bytes
  14012. * - PN_31_0
  14013. * Bits 31:0
  14014. * Purpose: Identifies pn of rx frame
  14015. * value: PN lower 4 bytes
  14016. * - PN_47_32
  14017. * Bits 15:0
  14018. * Purpose: Identifies pn of rx frame
  14019. * value:
  14020. * TKIP or CCMP: PN upper 2 bytes
  14021. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14022. */
  14023. enum htt_rx_ofld_pkt_err_type {
  14024. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14025. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14026. };
  14027. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14028. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14029. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14030. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14031. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14032. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14033. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14034. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14035. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14036. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14037. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14038. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14039. do { \
  14040. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14041. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14042. } while (0)
  14043. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14044. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14045. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14046. do { \
  14047. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14048. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14049. } while (0)
  14050. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14051. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14052. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14053. do { \
  14054. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14055. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14056. } while (0)
  14057. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14058. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14059. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14060. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14061. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14062. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14063. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14064. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14065. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14066. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14067. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14068. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14069. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14070. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14071. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14072. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14073. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14074. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14075. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14076. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14077. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14078. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14079. do { \
  14080. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14081. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14082. } while (0)
  14083. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14084. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14085. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14086. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14087. do { \
  14088. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14089. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14090. } while (0)
  14091. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14092. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14093. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14094. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14095. do { \
  14096. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14097. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14098. } while (0)
  14099. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14100. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14101. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14102. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14103. do { \
  14104. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14105. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14106. } while (0)
  14107. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14108. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14109. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14110. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14111. do { \
  14112. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14113. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14114. } while (0)
  14115. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14116. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14117. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14118. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14119. do { \
  14120. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14121. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14122. } while (0)
  14123. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14124. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14125. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14126. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14127. do { \
  14128. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14129. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14130. } while (0)
  14131. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14132. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14133. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14134. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14135. do { \
  14136. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14137. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14138. } while (0)
  14139. /**
  14140. * @brief target -> host peer rate report message
  14141. *
  14142. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14143. *
  14144. * @details
  14145. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14146. * justified rate of all the peers.
  14147. *
  14148. * |31 24|23 16|15 8|7 0|
  14149. * |----------------+----------------+----------------+----------------|
  14150. * | peer_count | | msg_type |
  14151. * |-------------------------------------------------------------------|
  14152. * : Payload (variant number of peer rate report) :
  14153. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14154. * Header fields:
  14155. * - msg_type
  14156. * Bits 7:0
  14157. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14158. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14159. * - reserved
  14160. * Bits 15:8
  14161. * Purpose:
  14162. * value:
  14163. * - peer_count
  14164. * Bits 31:16
  14165. * Purpose: Specify how many peer rate report elements are present in the payload.
  14166. * value:
  14167. *
  14168. * Payload:
  14169. * There are variant number of peer rate report follow the first 32 bits.
  14170. * The peer rate report is defined as follows.
  14171. *
  14172. * |31 20|19 16|15 0|
  14173. * |-----------------------+---------+---------------------------------|-
  14174. * | reserved | phy | peer_id | \
  14175. * |-------------------------------------------------------------------| -> report #0
  14176. * | rate | /
  14177. * |-----------------------+---------+---------------------------------|-
  14178. * | reserved | phy | peer_id | \
  14179. * |-------------------------------------------------------------------| -> report #1
  14180. * | rate | /
  14181. * |-----------------------+---------+---------------------------------|-
  14182. * | reserved | phy | peer_id | \
  14183. * |-------------------------------------------------------------------| -> report #2
  14184. * | rate | /
  14185. * |-------------------------------------------------------------------|-
  14186. * : :
  14187. * : :
  14188. * : :
  14189. * :-------------------------------------------------------------------:
  14190. *
  14191. * - peer_id
  14192. * Bits 15:0
  14193. * Purpose: identify the peer
  14194. * value:
  14195. * - phy
  14196. * Bits 19:16
  14197. * Purpose: identify which phy is in use
  14198. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14199. * Please see enum htt_peer_report_phy_type for detail.
  14200. * - reserved
  14201. * Bits 31:20
  14202. * Purpose:
  14203. * value:
  14204. * - rate
  14205. * Bits 31:0
  14206. * Purpose: represent the justified rate of the peer specified by peer_id
  14207. * value:
  14208. */
  14209. enum htt_peer_rate_report_phy_type {
  14210. HTT_PEER_RATE_REPORT_11B = 0,
  14211. HTT_PEER_RATE_REPORT_11A_G,
  14212. HTT_PEER_RATE_REPORT_11N,
  14213. HTT_PEER_RATE_REPORT_11AC,
  14214. };
  14215. #define HTT_PEER_RATE_REPORT_SIZE 8
  14216. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14217. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14218. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14219. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14220. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14221. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14222. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14223. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14224. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14225. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14226. do { \
  14227. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14228. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14229. } while (0)
  14230. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14231. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14232. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14233. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14234. do { \
  14235. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14236. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14237. } while (0)
  14238. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14239. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14240. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14241. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14242. do { \
  14243. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14244. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14245. } while (0)
  14246. /**
  14247. * @brief target -> host flow pool map message
  14248. *
  14249. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14250. *
  14251. * @details
  14252. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14253. * a flow of descriptors.
  14254. *
  14255. * This message is in TLV format and indicates the parameters to be setup a
  14256. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14257. * receive descriptors from a specified pool.
  14258. *
  14259. * The message would appear as follows:
  14260. *
  14261. * |31 24|23 16|15 8|7 0|
  14262. * |----------------+----------------+----------------+----------------|
  14263. * header | reserved | num_flows | msg_type |
  14264. * |-------------------------------------------------------------------|
  14265. * | |
  14266. * : payload :
  14267. * | |
  14268. * |-------------------------------------------------------------------|
  14269. *
  14270. * The header field is one DWORD long and is interpreted as follows:
  14271. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14272. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14273. * this message
  14274. * b'16-31 - reserved: These bits are reserved for future use
  14275. *
  14276. * Payload:
  14277. * The payload would contain multiple objects of the following structure. Each
  14278. * object represents a flow.
  14279. *
  14280. * |31 24|23 16|15 8|7 0|
  14281. * |----------------+----------------+----------------+----------------|
  14282. * header | reserved | num_flows | msg_type |
  14283. * |-------------------------------------------------------------------|
  14284. * payload0| flow_type |
  14285. * |-------------------------------------------------------------------|
  14286. * | flow_id |
  14287. * |-------------------------------------------------------------------|
  14288. * | reserved0 | flow_pool_id |
  14289. * |-------------------------------------------------------------------|
  14290. * | reserved1 | flow_pool_size |
  14291. * |-------------------------------------------------------------------|
  14292. * | reserved2 |
  14293. * |-------------------------------------------------------------------|
  14294. * payload1| flow_type |
  14295. * |-------------------------------------------------------------------|
  14296. * | flow_id |
  14297. * |-------------------------------------------------------------------|
  14298. * | reserved0 | flow_pool_id |
  14299. * |-------------------------------------------------------------------|
  14300. * | reserved1 | flow_pool_size |
  14301. * |-------------------------------------------------------------------|
  14302. * | reserved2 |
  14303. * |-------------------------------------------------------------------|
  14304. * | . |
  14305. * | . |
  14306. * | . |
  14307. * |-------------------------------------------------------------------|
  14308. *
  14309. * Each payload is 5 DWORDS long and is interpreted as follows:
  14310. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14311. * this flow is associated. It can be VDEV, peer,
  14312. * or tid (AC). Based on enum htt_flow_type.
  14313. *
  14314. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14315. * object. For flow_type vdev it is set to the
  14316. * vdevid, for peer it is peerid and for tid, it is
  14317. * tid_num.
  14318. *
  14319. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14320. * in the host for this flow
  14321. * b'16:31 - reserved0: This field in reserved for the future. In case
  14322. * we have a hierarchical implementation (HCM) of
  14323. * pools, it can be used to indicate the ID of the
  14324. * parent-pool.
  14325. *
  14326. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14327. * Descriptors for this flow will be
  14328. * allocated from this pool in the host.
  14329. * b'16:31 - reserved1: This field in reserved for the future. In case
  14330. * we have a hierarchical implementation of pools,
  14331. * it can be used to indicate the max number of
  14332. * descriptors in the pool. The b'0:15 can be used
  14333. * to indicate min number of descriptors in the
  14334. * HCM scheme.
  14335. *
  14336. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14337. * we have a hierarchical implementation of pools,
  14338. * b'0:15 can be used to indicate the
  14339. * priority-based borrowing (PBB) threshold of
  14340. * the flow's pool. The b'16:31 are still left
  14341. * reserved.
  14342. */
  14343. enum htt_flow_type {
  14344. FLOW_TYPE_VDEV = 0,
  14345. /* Insert new flow types above this line */
  14346. };
  14347. PREPACK struct htt_flow_pool_map_payload_t {
  14348. A_UINT32 flow_type;
  14349. A_UINT32 flow_id;
  14350. A_UINT32 flow_pool_id:16,
  14351. reserved0:16;
  14352. A_UINT32 flow_pool_size:16,
  14353. reserved1:16;
  14354. A_UINT32 reserved2;
  14355. } POSTPACK;
  14356. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14357. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14358. (sizeof(struct htt_flow_pool_map_payload_t))
  14359. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14360. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14361. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14362. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14363. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14364. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14365. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14366. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14367. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14368. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14369. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14370. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14371. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14372. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14373. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14374. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14375. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14376. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14377. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14378. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14379. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14380. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14381. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14382. do { \
  14383. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14384. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14385. } while (0)
  14386. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14387. do { \
  14388. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14389. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14390. } while (0)
  14391. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14392. do { \
  14393. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14394. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14395. } while (0)
  14396. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14397. do { \
  14398. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14399. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14400. } while (0)
  14401. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14402. do { \
  14403. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14404. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14405. } while (0)
  14406. /**
  14407. * @brief target -> host flow pool unmap message
  14408. *
  14409. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14410. *
  14411. * @details
  14412. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14413. * down a flow of descriptors.
  14414. * This message indicates that for the flow (whose ID is provided) is wanting
  14415. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14416. * pool of descriptors from where descriptors are being allocated for this
  14417. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14418. * be unmapped by the host.
  14419. *
  14420. * The message would appear as follows:
  14421. *
  14422. * |31 24|23 16|15 8|7 0|
  14423. * |----------------+----------------+----------------+----------------|
  14424. * | reserved0 | msg_type |
  14425. * |-------------------------------------------------------------------|
  14426. * | flow_type |
  14427. * |-------------------------------------------------------------------|
  14428. * | flow_id |
  14429. * |-------------------------------------------------------------------|
  14430. * | reserved1 | flow_pool_id |
  14431. * |-------------------------------------------------------------------|
  14432. *
  14433. * The message is interpreted as follows:
  14434. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14435. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14436. * b'8:31 - reserved0: Reserved for future use
  14437. *
  14438. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14439. * this flow is associated. It can be VDEV, peer,
  14440. * or tid (AC). Based on enum htt_flow_type.
  14441. *
  14442. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14443. * object. For flow_type vdev it is set to the
  14444. * vdevid, for peer it is peerid and for tid, it is
  14445. * tid_num.
  14446. *
  14447. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14448. * used in the host for this flow
  14449. * b'16:31 - reserved0: This field in reserved for the future.
  14450. *
  14451. */
  14452. PREPACK struct htt_flow_pool_unmap_t {
  14453. A_UINT32 msg_type:8,
  14454. reserved0:24;
  14455. A_UINT32 flow_type;
  14456. A_UINT32 flow_id;
  14457. A_UINT32 flow_pool_id:16,
  14458. reserved1:16;
  14459. } POSTPACK;
  14460. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14461. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14462. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14463. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14464. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14465. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14466. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14467. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14468. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14469. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14470. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14471. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14472. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14473. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14474. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14475. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14476. do { \
  14477. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14478. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14479. } while (0)
  14480. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14481. do { \
  14482. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14483. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14484. } while (0)
  14485. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14486. do { \
  14487. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14488. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14489. } while (0)
  14490. /**
  14491. * @brief target -> host SRING setup done message
  14492. *
  14493. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14494. *
  14495. * @details
  14496. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14497. * SRNG ring setup is done
  14498. *
  14499. * This message indicates whether the last setup operation is successful.
  14500. * It will be sent to host when host set respose_required bit in
  14501. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14502. * The message would appear as follows:
  14503. *
  14504. * |31 24|23 16|15 8|7 0|
  14505. * |--------------- +----------------+----------------+----------------|
  14506. * | setup_status | ring_id | pdev_id | msg_type |
  14507. * |-------------------------------------------------------------------|
  14508. *
  14509. * The message is interpreted as follows:
  14510. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14511. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14512. * b'8:15 - pdev_id:
  14513. * 0 (for rings at SOC/UMAC level),
  14514. * 1/2/3 mac id (for rings at LMAC level)
  14515. * b'16:23 - ring_id: Identify the ring which is set up
  14516. * More details can be got from enum htt_srng_ring_id
  14517. * b'24:31 - setup_status: Indicate status of setup operation
  14518. * Refer to htt_ring_setup_status
  14519. */
  14520. PREPACK struct htt_sring_setup_done_t {
  14521. A_UINT32 msg_type: 8,
  14522. pdev_id: 8,
  14523. ring_id: 8,
  14524. setup_status: 8;
  14525. } POSTPACK;
  14526. enum htt_ring_setup_status {
  14527. htt_ring_setup_status_ok = 0,
  14528. htt_ring_setup_status_error,
  14529. };
  14530. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14531. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14532. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14533. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14534. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14535. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14536. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14537. do { \
  14538. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14539. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14540. } while (0)
  14541. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14542. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14543. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14544. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14545. HTT_SRING_SETUP_DONE_RING_ID_S)
  14546. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14547. do { \
  14548. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14549. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14550. } while (0)
  14551. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14552. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14553. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14554. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14555. HTT_SRING_SETUP_DONE_STATUS_S)
  14556. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14557. do { \
  14558. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14559. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14560. } while (0)
  14561. /**
  14562. * @brief target -> flow map flow info
  14563. *
  14564. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14565. *
  14566. * @details
  14567. * HTT TX map flow entry with tqm flow pointer
  14568. * Sent from firmware to host to add tqm flow pointer in corresponding
  14569. * flow search entry. Flow metadata is replayed back to host as part of this
  14570. * struct to enable host to find the specific flow search entry
  14571. *
  14572. * The message would appear as follows:
  14573. *
  14574. * |31 28|27 18|17 14|13 8|7 0|
  14575. * |-------+------------------------------------------+----------------|
  14576. * | rsvd0 | fse_hsh_idx | msg_type |
  14577. * |-------------------------------------------------------------------|
  14578. * | rsvd1 | tid | peer_id |
  14579. * |-------------------------------------------------------------------|
  14580. * | tqm_flow_pntr_lo |
  14581. * |-------------------------------------------------------------------|
  14582. * | tqm_flow_pntr_hi |
  14583. * |-------------------------------------------------------------------|
  14584. * | fse_meta_data |
  14585. * |-------------------------------------------------------------------|
  14586. *
  14587. * The message is interpreted as follows:
  14588. *
  14589. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14590. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14591. *
  14592. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14593. * for this flow entry
  14594. *
  14595. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14596. *
  14597. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14598. *
  14599. * dword1 - b'14:17 - tid
  14600. *
  14601. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14602. *
  14603. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14604. *
  14605. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14606. *
  14607. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14608. * given by host
  14609. */
  14610. PREPACK struct htt_tx_map_flow_info {
  14611. A_UINT32
  14612. msg_type: 8,
  14613. fse_hsh_idx: 20,
  14614. rsvd0: 4;
  14615. A_UINT32
  14616. peer_id: 14,
  14617. tid: 4,
  14618. rsvd1: 14;
  14619. A_UINT32 tqm_flow_pntr_lo;
  14620. A_UINT32 tqm_flow_pntr_hi;
  14621. struct htt_tx_flow_metadata fse_meta_data;
  14622. } POSTPACK;
  14623. /* DWORD 0 */
  14624. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14625. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14626. /* DWORD 1 */
  14627. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14628. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14629. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14630. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14631. /* DWORD 0 */
  14632. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14633. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14634. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14635. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14636. do { \
  14637. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14638. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14639. } while (0)
  14640. /* DWORD 1 */
  14641. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14642. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14643. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14644. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14645. do { \
  14646. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14647. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14648. } while (0)
  14649. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14650. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14651. HTT_TX_MAP_FLOW_INFO_TID_S)
  14652. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14653. do { \
  14654. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14655. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14656. } while (0)
  14657. /*
  14658. * htt_dbg_ext_stats_status -
  14659. * present - The requested stats have been delivered in full.
  14660. * This indicates that either the stats information was contained
  14661. * in its entirety within this message, or else this message
  14662. * completes the delivery of the requested stats info that was
  14663. * partially delivered through earlier STATS_CONF messages.
  14664. * partial - The requested stats have been delivered in part.
  14665. * One or more subsequent STATS_CONF messages with the same
  14666. * cookie value will be sent to deliver the remainder of the
  14667. * information.
  14668. * error - The requested stats could not be delivered, for example due
  14669. * to a shortage of memory to construct a message holding the
  14670. * requested stats.
  14671. * invalid - The requested stat type is either not recognized, or the
  14672. * target is configured to not gather the stats type in question.
  14673. */
  14674. enum htt_dbg_ext_stats_status {
  14675. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14676. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14677. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14678. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14679. };
  14680. /**
  14681. * @brief target -> host ppdu stats upload
  14682. *
  14683. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14684. *
  14685. * @details
  14686. * The following field definitions describe the format of the HTT target
  14687. * to host ppdu stats indication message.
  14688. *
  14689. *
  14690. * |31 16|15 12|11 10|9 8|7 0 |
  14691. * |----------------------------------------------------------------------|
  14692. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14693. * |----------------------------------------------------------------------|
  14694. * | ppdu_id |
  14695. * |----------------------------------------------------------------------|
  14696. * | Timestamp in us |
  14697. * |----------------------------------------------------------------------|
  14698. * | reserved |
  14699. * |----------------------------------------------------------------------|
  14700. * | type-specific stats info |
  14701. * | (see htt_ppdu_stats.h) |
  14702. * |----------------------------------------------------------------------|
  14703. * Header fields:
  14704. * - MSG_TYPE
  14705. * Bits 7:0
  14706. * Purpose: Identifies this is a PPDU STATS indication
  14707. * message.
  14708. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14709. * - mac_id
  14710. * Bits 9:8
  14711. * Purpose: mac_id of this ppdu_id
  14712. * Value: 0-3
  14713. * - pdev_id
  14714. * Bits 11:10
  14715. * Purpose: pdev_id of this ppdu_id
  14716. * Value: 0-3
  14717. * 0 (for rings at SOC level),
  14718. * 1/2/3 PDEV -> 0/1/2
  14719. * - payload_size
  14720. * Bits 31:16
  14721. * Purpose: total tlv size
  14722. * Value: payload_size in bytes
  14723. */
  14724. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14725. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14726. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14727. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14728. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14729. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14730. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14731. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14732. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14733. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14734. do { \
  14735. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14736. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14737. } while (0)
  14738. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14739. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14740. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14741. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14742. do { \
  14743. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14744. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14745. } while (0)
  14746. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14747. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14748. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14749. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14750. do { \
  14751. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14752. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14753. } while (0)
  14754. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14755. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14756. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14757. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14758. do { \
  14759. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14760. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14761. } while (0)
  14762. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14763. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14764. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14765. /* htt_t2h_ppdu_stats_ind_hdr_t
  14766. * This struct contains the fields within the header of the
  14767. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14768. * stats info.
  14769. * This struct assumes little-endian layout, and thus is only
  14770. * suitable for use within processors known to be little-endian
  14771. * (such as the target).
  14772. * In contrast, the above macros provide endian-portable methods
  14773. * to get and set the bitfields within this PPDU_STATS_IND header.
  14774. */
  14775. typedef struct {
  14776. A_UINT32 msg_type: 8, /* bits 7:0 */
  14777. mac_id: 2, /* bits 9:8 */
  14778. pdev_id: 2, /* bits 11:10 */
  14779. reserved1: 4, /* bits 15:12 */
  14780. payload_size: 16; /* bits 31:16 */
  14781. A_UINT32 ppdu_id;
  14782. A_UINT32 timestamp_us;
  14783. A_UINT32 reserved2;
  14784. } htt_t2h_ppdu_stats_ind_hdr_t;
  14785. /**
  14786. * @brief target -> host extended statistics upload
  14787. *
  14788. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14789. *
  14790. * @details
  14791. * The following field definitions describe the format of the HTT target
  14792. * to host stats upload confirmation message.
  14793. * The message contains a cookie echoed from the HTT host->target stats
  14794. * upload request, which identifies which request the confirmation is
  14795. * for, and a single stats can span over multiple HTT stats indication
  14796. * due to the HTT message size limitation so every HTT ext stats indication
  14797. * will have tag-length-value stats information elements.
  14798. * The tag-length header for each HTT stats IND message also includes a
  14799. * status field, to indicate whether the request for the stat type in
  14800. * question was fully met, partially met, unable to be met, or invalid
  14801. * (if the stat type in question is disabled in the target).
  14802. * A Done bit 1's indicate the end of the of stats info elements.
  14803. *
  14804. *
  14805. * |31 16|15 12|11|10 8|7 5|4 0|
  14806. * |--------------------------------------------------------------|
  14807. * | reserved | msg type |
  14808. * |--------------------------------------------------------------|
  14809. * | cookie LSBs |
  14810. * |--------------------------------------------------------------|
  14811. * | cookie MSBs |
  14812. * |--------------------------------------------------------------|
  14813. * | stats entry length | rsvd | D| S | stat type |
  14814. * |--------------------------------------------------------------|
  14815. * | type-specific stats info |
  14816. * | (see htt_stats.h) |
  14817. * |--------------------------------------------------------------|
  14818. * Header fields:
  14819. * - MSG_TYPE
  14820. * Bits 7:0
  14821. * Purpose: Identifies this is a extended statistics upload confirmation
  14822. * message.
  14823. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14824. * - COOKIE_LSBS
  14825. * Bits 31:0
  14826. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14827. * message with its preceding host->target stats request message.
  14828. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14829. * - COOKIE_MSBS
  14830. * Bits 31:0
  14831. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14832. * message with its preceding host->target stats request message.
  14833. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14834. *
  14835. * Stats Information Element tag-length header fields:
  14836. * - STAT_TYPE
  14837. * Bits 7:0
  14838. * Purpose: identifies the type of statistics info held in the
  14839. * following information element
  14840. * Value: htt_dbg_ext_stats_type
  14841. * - STATUS
  14842. * Bits 10:8
  14843. * Purpose: indicate whether the requested stats are present
  14844. * Value: htt_dbg_ext_stats_status
  14845. * - DONE
  14846. * Bits 11
  14847. * Purpose:
  14848. * Indicates the completion of the stats entry, this will be the last
  14849. * stats conf HTT segment for the requested stats type.
  14850. * Value:
  14851. * 0 -> the stats retrieval is ongoing
  14852. * 1 -> the stats retrieval is complete
  14853. * - LENGTH
  14854. * Bits 31:16
  14855. * Purpose: indicate the stats information size
  14856. * Value: This field specifies the number of bytes of stats information
  14857. * that follows the element tag-length header.
  14858. * It is expected but not required that this length is a multiple of
  14859. * 4 bytes.
  14860. */
  14861. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14862. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14863. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14864. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14865. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14866. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14867. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14868. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14869. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14870. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14871. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14872. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14873. do { \
  14874. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14875. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14876. } while (0)
  14877. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14878. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14879. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14880. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14881. do { \
  14882. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14883. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14884. } while (0)
  14885. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14886. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14887. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14888. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14889. do { \
  14890. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14891. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14892. } while (0)
  14893. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14894. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14895. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14896. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14897. do { \
  14898. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14899. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14900. } while (0)
  14901. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14902. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14903. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14904. /**
  14905. * @brief target -> host streaming statistics upload
  14906. *
  14907. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  14908. *
  14909. * @details
  14910. * The following field definitions describe the format of the HTT target
  14911. * to host streaming stats upload indication message.
  14912. * The host can use a STREAMING_STATS_REQ message to enable the target to
  14913. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  14914. * use the STREAMING_STATS_REQ message to halt the target's production of
  14915. * STREAMING_STATS_IND messages.
  14916. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  14917. * the stats enabled by the host's STREAMING_STATS_REQ message.
  14918. *
  14919. * |31 8|7 0|
  14920. * |--------------------------------------------------------------|
  14921. * | reserved | msg type |
  14922. * |--------------------------------------------------------------|
  14923. * | type-specific stats info |
  14924. * | (see htt_stats.h) |
  14925. * |--------------------------------------------------------------|
  14926. * Header fields:
  14927. * - MSG_TYPE
  14928. * Bits 7:0
  14929. * Purpose: Identifies this as a streaming statistics upload indication
  14930. * message.
  14931. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  14932. */
  14933. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  14934. typedef enum {
  14935. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14936. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14937. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14938. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14939. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14940. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14941. /* Reserved from 128 - 255 for target internal use.*/
  14942. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14943. } HTT_PEER_TYPE;
  14944. /** macro to convert MAC address from char array to HTT word format */
  14945. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14946. (phtt_mac_addr)->mac_addr31to0 = \
  14947. (((c_macaddr)[0] << 0) | \
  14948. ((c_macaddr)[1] << 8) | \
  14949. ((c_macaddr)[2] << 16) | \
  14950. ((c_macaddr)[3] << 24)); \
  14951. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14952. } while (0)
  14953. /**
  14954. * @brief target -> host monitor mac header indication message
  14955. *
  14956. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14957. *
  14958. * @details
  14959. * The following diagram shows the format of the monitor mac header message
  14960. * sent from the target to the host.
  14961. * This message is primarily sent when promiscuous rx mode is enabled.
  14962. * One message is sent per rx PPDU.
  14963. *
  14964. * |31 24|23 16|15 8|7 0|
  14965. * |-------------------------------------------------------------|
  14966. * | peer_id | reserved0 | msg_type |
  14967. * |-------------------------------------------------------------|
  14968. * | reserved1 | num_mpdu |
  14969. * |-------------------------------------------------------------|
  14970. * | struct hw_rx_desc |
  14971. * | (see wal_rx_desc.h) |
  14972. * |-------------------------------------------------------------|
  14973. * | struct ieee80211_frame_addr4 |
  14974. * | (see ieee80211_defs.h) |
  14975. * |-------------------------------------------------------------|
  14976. * | struct ieee80211_frame_addr4 |
  14977. * | (see ieee80211_defs.h) |
  14978. * |-------------------------------------------------------------|
  14979. * | ...... |
  14980. * |-------------------------------------------------------------|
  14981. *
  14982. * Header fields:
  14983. * - msg_type
  14984. * Bits 7:0
  14985. * Purpose: Identifies this is a monitor mac header indication message.
  14986. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14987. * - peer_id
  14988. * Bits 31:16
  14989. * Purpose: Software peer id given by host during association,
  14990. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14991. * for rx PPDUs received from unassociated peers.
  14992. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14993. * - num_mpdu
  14994. * Bits 15:0
  14995. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14996. * delivered within the message.
  14997. * Value: 1 to 32
  14998. * num_mpdu is limited to a maximum value of 32, due to buffer
  14999. * size limits. For PPDUs with more than 32 MPDUs, only the
  15000. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  15001. * the PPDU will be provided.
  15002. */
  15003. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15004. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15005. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15006. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15007. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15008. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15009. do { \
  15010. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15011. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15012. } while (0)
  15013. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15014. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15015. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15016. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15017. do { \
  15018. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15019. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15020. } while (0)
  15021. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15022. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15023. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15024. /**
  15025. * @brief target -> host flow pool resize Message
  15026. *
  15027. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15028. *
  15029. * @details
  15030. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15031. * the flow pool associated with the specified ID is resized
  15032. *
  15033. * The message would appear as follows:
  15034. *
  15035. * |31 16|15 8|7 0|
  15036. * |---------------------------------+----------------+----------------|
  15037. * | reserved0 | Msg type |
  15038. * |-------------------------------------------------------------------|
  15039. * | flow pool new size | flow pool ID |
  15040. * |-------------------------------------------------------------------|
  15041. *
  15042. * The message is interpreted as follows:
  15043. * b'0:7 - msg_type: This will be set to 0x21
  15044. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15045. *
  15046. * b'0:15 - flow pool ID: Existing flow pool ID
  15047. *
  15048. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  15049. *
  15050. */
  15051. PREPACK struct htt_flow_pool_resize_t {
  15052. A_UINT32 msg_type:8,
  15053. reserved0:24;
  15054. A_UINT32 flow_pool_id:16,
  15055. flow_pool_new_size:16;
  15056. } POSTPACK;
  15057. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15058. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15059. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15060. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15061. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15062. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15063. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15064. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15065. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15066. do { \
  15067. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15068. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15069. } while (0)
  15070. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15071. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15072. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15073. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15074. do { \
  15075. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15076. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15077. } while (0)
  15078. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15079. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15080. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15081. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15082. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15083. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15084. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15085. /*
  15086. * The read and write indices point to the data within the host buffer.
  15087. * Because the first 4 bytes of the host buffer is used for the read index and
  15088. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15089. * The read index and write index are the byte offsets from the base of the
  15090. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15091. * Refer the ASCII text picture below.
  15092. */
  15093. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15094. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15095. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15096. /*
  15097. ***************************************************************************
  15098. *
  15099. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15100. *
  15101. ***************************************************************************
  15102. *
  15103. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15104. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15105. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15106. * written into the Host memory region mentioned below.
  15107. *
  15108. * Read index is updated by the Host. At any point of time, the read index will
  15109. * indicate the index that will next be read by the Host. The read index is
  15110. * in units of bytes offset from the base of the meta-data buffer.
  15111. *
  15112. * Write index is updated by the FW. At any point of time, the write index will
  15113. * indicate from where the FW can start writing any new data. The write index is
  15114. * in units of bytes offset from the base of the meta-data buffer.
  15115. *
  15116. * If the Host is not fast enough in reading the CFR data, any new capture data
  15117. * would be dropped if there is no space left to write the new captures.
  15118. *
  15119. * The last 4 bytes of the memory region will have the magic pattern
  15120. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15121. * not overrun the host buffer.
  15122. *
  15123. * ,--------------------. read and write indices store the
  15124. * | | byte offset from the base of the
  15125. * | ,--------+--------. meta-data buffer to the next
  15126. * | | | | location within the data buffer
  15127. * | | v v that will be read / written
  15128. * ************************************************************************
  15129. * * Read * Write * * Magic *
  15130. * * index * index * CFR data1 ...... CFR data N * pattern *
  15131. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15132. * ************************************************************************
  15133. * |<---------- data buffer ---------->|
  15134. *
  15135. * |<----------------- meta-data buffer allocated in Host ----------------|
  15136. *
  15137. * Note:
  15138. * - Considering the 4 bytes needed to store the Read index (R) and the
  15139. * Write index (W), the initial value is as follows:
  15140. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15141. * - Buffer empty condition:
  15142. * R = W
  15143. *
  15144. * Regarding CFR data format:
  15145. * --------------------------
  15146. *
  15147. * Each CFR tone is stored in HW as 16-bits with the following format:
  15148. * {bits[15:12], bits[11:6], bits[5:0]} =
  15149. * {unsigned exponent (4 bits),
  15150. * signed mantissa_real (6 bits),
  15151. * signed mantissa_imag (6 bits)}
  15152. *
  15153. * CFR_real = mantissa_real * 2^(exponent-5)
  15154. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15155. *
  15156. *
  15157. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15158. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15159. *
  15160. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15161. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15162. * .
  15163. * .
  15164. * .
  15165. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15166. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15167. */
  15168. /* Bandwidth of peer CFR captures */
  15169. typedef enum {
  15170. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15171. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15172. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15173. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15174. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15175. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15176. } HTT_PEER_CFR_CAPTURE_BW;
  15177. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15178. * was captured
  15179. */
  15180. typedef enum {
  15181. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15182. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15183. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15184. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15185. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15186. } HTT_PEER_CFR_CAPTURE_MODE;
  15187. typedef enum {
  15188. /* This message type is currently used for the below purpose:
  15189. *
  15190. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15191. * wmi_peer_cfr_capture_cmd.
  15192. * If payload_present bit is set to 0 then the associated memory region
  15193. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15194. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15195. * message; the CFR dump will be present at the end of the message,
  15196. * after the chan_phy_mode.
  15197. */
  15198. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15199. /* Always keep this last */
  15200. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15201. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15202. /**
  15203. * @brief target -> host CFR dump completion indication message definition
  15204. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15205. *
  15206. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15207. *
  15208. * @details
  15209. * The following diagram shows the format of the Channel Frequency Response
  15210. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15211. * the channel capture of a peer is copied by Firmware into the Host memory
  15212. *
  15213. * **************************************************************************
  15214. *
  15215. * Message format when the CFR capture message type is
  15216. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15217. *
  15218. * **************************************************************************
  15219. *
  15220. * |31 16|15 |8|7 0|
  15221. * |----------------------------------------------------------------|
  15222. * header: | reserved |P| msg_type |
  15223. * word 0 | | | |
  15224. * |----------------------------------------------------------------|
  15225. * payload: | cfr_capture_msg_type |
  15226. * word 1 | |
  15227. * |----------------------------------------------------------------|
  15228. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15229. * word 2 | | | | | | | | |
  15230. * |----------------------------------------------------------------|
  15231. * | mac_addr31to0 |
  15232. * word 3 | |
  15233. * |----------------------------------------------------------------|
  15234. * | unused / reserved | mac_addr47to32 |
  15235. * word 4 | | |
  15236. * |----------------------------------------------------------------|
  15237. * | index |
  15238. * word 5 | |
  15239. * |----------------------------------------------------------------|
  15240. * | length |
  15241. * word 6 | |
  15242. * |----------------------------------------------------------------|
  15243. * | timestamp |
  15244. * word 7 | |
  15245. * |----------------------------------------------------------------|
  15246. * | counter |
  15247. * word 8 | |
  15248. * |----------------------------------------------------------------|
  15249. * | chan_mhz |
  15250. * word 9 | |
  15251. * |----------------------------------------------------------------|
  15252. * | band_center_freq1 |
  15253. * word 10 | |
  15254. * |----------------------------------------------------------------|
  15255. * | band_center_freq2 |
  15256. * word 11 | |
  15257. * |----------------------------------------------------------------|
  15258. * | chan_phy_mode |
  15259. * word 12 | |
  15260. * |----------------------------------------------------------------|
  15261. * where,
  15262. * P - payload present bit (payload_present explained below)
  15263. * req_id - memory request id (mem_req_id explained below)
  15264. * S - status field (status explained below)
  15265. * capbw - capture bandwidth (capture_bw explained below)
  15266. * mode - mode of capture (mode explained below)
  15267. * sts - space time streams (sts_count explained below)
  15268. * chbw - channel bandwidth (channel_bw explained below)
  15269. * captype - capture type (cap_type explained below)
  15270. *
  15271. * The following field definitions describe the format of the CFR dump
  15272. * completion indication sent from the target to the host
  15273. *
  15274. * Header fields:
  15275. *
  15276. * Word 0
  15277. * - msg_type
  15278. * Bits 7:0
  15279. * Purpose: Identifies this as CFR TX completion indication
  15280. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15281. * - payload_present
  15282. * Bit 8
  15283. * Purpose: Identifies how CFR data is sent to host
  15284. * Value: 0 - If CFR Payload is written to host memory
  15285. * 1 - If CFR Payload is sent as part of HTT message
  15286. * (This is the requirement for SDIO/USB where it is
  15287. * not possible to write CFR data to host memory)
  15288. * - reserved
  15289. * Bits 31:9
  15290. * Purpose: Reserved
  15291. * Value: 0
  15292. *
  15293. * Payload fields:
  15294. *
  15295. * Word 1
  15296. * - cfr_capture_msg_type
  15297. * Bits 31:0
  15298. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15299. * to specify the format used for the remainder of the message
  15300. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15301. * (currently only MSG_TYPE_1 is defined)
  15302. *
  15303. * Word 2
  15304. * - mem_req_id
  15305. * Bits 6:0
  15306. * Purpose: Contain the mem request id of the region where the CFR capture
  15307. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15308. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15309. this value is invalid)
  15310. * - status
  15311. * Bit 7
  15312. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15313. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15314. * - capture_bw
  15315. * Bits 10:8
  15316. * Purpose: Carry the bandwidth of the CFR capture
  15317. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15318. * - mode
  15319. * Bits 13:11
  15320. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15321. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15322. * - sts_count
  15323. * Bits 16:14
  15324. * Purpose: Carry the number of space time streams
  15325. * Value: Number of space time streams
  15326. * - channel_bw
  15327. * Bits 19:17
  15328. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15329. * measurement
  15330. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15331. * - cap_type
  15332. * Bits 23:20
  15333. * Purpose: Carry the type of the capture
  15334. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15335. * - vdev_id
  15336. * Bits 31:24
  15337. * Purpose: Carry the virtual device id
  15338. * Value: vdev ID
  15339. *
  15340. * Word 3
  15341. * - mac_addr31to0
  15342. * Bits 31:0
  15343. * Purpose: Contain the bits 31:0 of the peer MAC address
  15344. * Value: Bits 31:0 of the peer MAC address
  15345. *
  15346. * Word 4
  15347. * - mac_addr47to32
  15348. * Bits 15:0
  15349. * Purpose: Contain the bits 47:32 of the peer MAC address
  15350. * Value: Bits 47:32 of the peer MAC address
  15351. *
  15352. * Word 5
  15353. * - index
  15354. * Bits 31:0
  15355. * Purpose: Contain the index at which this CFR dump was written in the Host
  15356. * allocated memory. This index is the number of bytes from the base address.
  15357. * Value: Index position
  15358. *
  15359. * Word 6
  15360. * - length
  15361. * Bits 31:0
  15362. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15363. * Value: Length of the CFR capture of the peer
  15364. *
  15365. * Word 7
  15366. * - timestamp
  15367. * Bits 31:0
  15368. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15369. * clock used for this timestamp is private to the target and not visible to
  15370. * the host i.e., Host can interpret only the relative timestamp deltas from
  15371. * one message to the next, but can't interpret the absolute timestamp from a
  15372. * single message.
  15373. * Value: Timestamp in microseconds
  15374. *
  15375. * Word 8
  15376. * - counter
  15377. * Bits 31:0
  15378. * Purpose: Carry the count of the current CFR capture from FW. This is
  15379. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15380. * in host memory)
  15381. * Value: Count of the current CFR capture
  15382. *
  15383. * Word 9
  15384. * - chan_mhz
  15385. * Bits 31:0
  15386. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15387. * Value: Primary 20 channel frequency
  15388. *
  15389. * Word 10
  15390. * - band_center_freq1
  15391. * Bits 31:0
  15392. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15393. * Value: Center frequency 1 in MHz
  15394. *
  15395. * Word 11
  15396. * - band_center_freq2
  15397. * Bits 31:0
  15398. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15399. * the VDEV
  15400. * 80plus80 mode
  15401. * Value: Center frequency 2 in MHz
  15402. *
  15403. * Word 12
  15404. * - chan_phy_mode
  15405. * Bits 31:0
  15406. * Purpose: Carry the phy mode of the channel, of the VDEV
  15407. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15408. */
  15409. PREPACK struct htt_cfr_dump_ind_type_1 {
  15410. A_UINT32 mem_req_id:7,
  15411. status:1,
  15412. capture_bw:3,
  15413. mode:3,
  15414. sts_count:3,
  15415. channel_bw:3,
  15416. cap_type:4,
  15417. vdev_id:8;
  15418. htt_mac_addr addr;
  15419. A_UINT32 index;
  15420. A_UINT32 length;
  15421. A_UINT32 timestamp;
  15422. A_UINT32 counter;
  15423. struct htt_chan_change_msg chan;
  15424. } POSTPACK;
  15425. PREPACK struct htt_cfr_dump_compl_ind {
  15426. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15427. union {
  15428. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15429. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15430. /* If there is a need to change the memory layout and its associated
  15431. * HTT indication format, a new CFR capture message type can be
  15432. * introduced and added into this union.
  15433. */
  15434. };
  15435. } POSTPACK;
  15436. /*
  15437. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15438. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15439. */
  15440. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15441. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15442. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15443. do { \
  15444. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15445. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15446. } while(0)
  15447. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15448. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15449. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15450. /*
  15451. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15452. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15453. */
  15454. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15455. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15456. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15457. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15458. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15459. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15460. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15461. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15462. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15463. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15464. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15465. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15466. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15467. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15468. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15469. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15470. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15471. do { \
  15472. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15473. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15474. } while (0)
  15475. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15476. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15477. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15478. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15479. do { \
  15480. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15481. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15482. } while (0)
  15483. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15484. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15485. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15486. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15487. do { \
  15488. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15489. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15490. } while (0)
  15491. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15492. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15493. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15494. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15495. do { \
  15496. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15497. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15498. } while (0)
  15499. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15500. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15501. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15502. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15503. do { \
  15504. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15505. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15506. } while (0)
  15507. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15508. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15509. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15510. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15511. do { \
  15512. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15513. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15514. } while (0)
  15515. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15516. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15517. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15518. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15519. do { \
  15520. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15521. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15522. } while (0)
  15523. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15524. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15525. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15526. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15527. do { \
  15528. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15529. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15530. } while (0)
  15531. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15532. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15533. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15534. /**
  15535. * @brief target -> host peer (PPDU) stats message
  15536. *
  15537. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15538. *
  15539. * @details
  15540. * This message is generated by FW when FW is sending stats to host
  15541. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15542. * This message is sent autonomously by the target rather than upon request
  15543. * by the host.
  15544. * The following field definitions describe the format of the HTT target
  15545. * to host peer stats indication message.
  15546. *
  15547. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15548. * or more PPDU stats records.
  15549. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15550. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15551. * then the message would start with the
  15552. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15553. * below.
  15554. *
  15555. * |31 16|15|14|13 11|10 9|8|7 0|
  15556. * |-------------------------------------------------------------|
  15557. * | reserved |MSG_TYPE |
  15558. * |-------------------------------------------------------------|
  15559. * rec 0 | TLV header |
  15560. * rec 0 |-------------------------------------------------------------|
  15561. * rec 0 | ppdu successful bytes |
  15562. * rec 0 |-------------------------------------------------------------|
  15563. * rec 0 | ppdu retry bytes |
  15564. * rec 0 |-------------------------------------------------------------|
  15565. * rec 0 | ppdu failed bytes |
  15566. * rec 0 |-------------------------------------------------------------|
  15567. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15568. * rec 0 |-------------------------------------------------------------|
  15569. * rec 0 | retried MSDUs | successful MSDUs |
  15570. * rec 0 |-------------------------------------------------------------|
  15571. * rec 0 | TX duration | failed MSDUs |
  15572. * rec 0 |-------------------------------------------------------------|
  15573. * ...
  15574. * |-------------------------------------------------------------|
  15575. * rec N | TLV header |
  15576. * rec N |-------------------------------------------------------------|
  15577. * rec N | ppdu successful bytes |
  15578. * rec N |-------------------------------------------------------------|
  15579. * rec N | ppdu retry bytes |
  15580. * rec N |-------------------------------------------------------------|
  15581. * rec N | ppdu failed bytes |
  15582. * rec N |-------------------------------------------------------------|
  15583. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15584. * rec N |-------------------------------------------------------------|
  15585. * rec N | retried MSDUs | successful MSDUs |
  15586. * rec N |-------------------------------------------------------------|
  15587. * rec N | TX duration | failed MSDUs |
  15588. * rec N |-------------------------------------------------------------|
  15589. *
  15590. * where:
  15591. * A = is A-MPDU flag
  15592. * BA = block-ack failure flags
  15593. * BW = bandwidth spec
  15594. * SG = SGI enabled spec
  15595. * S = skipped rate ctrl
  15596. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15597. *
  15598. * Header
  15599. * ------
  15600. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15601. * dword0 - b'8:31 - reserved : Reserved for future use
  15602. *
  15603. * payload include below peer_stats information
  15604. * --------------------------------------------
  15605. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15606. * @tx_success_bytes : total successful bytes in the PPDU.
  15607. * @tx_retry_bytes : total retried bytes in the PPDU.
  15608. * @tx_failed_bytes : total failed bytes in the PPDU.
  15609. * @tx_ratecode : rate code used for the PPDU.
  15610. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15611. * @ba_ack_failed : BA/ACK failed for this PPDU
  15612. * b00 -> BA received
  15613. * b01 -> BA failed once
  15614. * b10 -> BA failed twice, when HW retry is enabled.
  15615. * @bw : BW
  15616. * b00 -> 20 MHz
  15617. * b01 -> 40 MHz
  15618. * b10 -> 80 MHz
  15619. * b11 -> 160 MHz (or 80+80)
  15620. * @sg : SGI enabled
  15621. * @s : skipped ratectrl
  15622. * @peer_id : peer id
  15623. * @tx_success_msdus : successful MSDUs
  15624. * @tx_retry_msdus : retried MSDUs
  15625. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15626. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15627. */
  15628. /**
  15629. * @brief target -> host backpressure event
  15630. *
  15631. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15632. *
  15633. * @details
  15634. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15635. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15636. * This message will only be sent if the backpressure condition has existed
  15637. * continuously for an initial period (100 ms).
  15638. * Repeat messages with updated information will be sent after each
  15639. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15640. * This message indicates the ring id along with current head and tail index
  15641. * locations (i.e. write and read indices).
  15642. * The backpressure time indicates the time in ms for which continous
  15643. * backpressure has been observed in the ring.
  15644. *
  15645. * The message format is as follows:
  15646. *
  15647. * |31 24|23 16|15 8|7 0|
  15648. * |----------------+----------------+----------------+----------------|
  15649. * | ring_id | ring_type | pdev_id | msg_type |
  15650. * |-------------------------------------------------------------------|
  15651. * | tail_idx | head_idx |
  15652. * |-------------------------------------------------------------------|
  15653. * | backpressure_time_ms |
  15654. * |-------------------------------------------------------------------|
  15655. *
  15656. * The message is interpreted as follows:
  15657. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15658. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15659. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15660. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15661. the msg is for LMAC ring.
  15662. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15663. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15664. * htt_backpressure_lmac_ring_id. This represents
  15665. * the ring id for which continous backpressure is seen
  15666. *
  15667. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15668. * the ring indicated by the ring_id
  15669. *
  15670. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15671. * the ring indicated by the ring id
  15672. *
  15673. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15674. * backpressure has been seen in the ring
  15675. * indicated by the ring_id.
  15676. * Units = milliseconds
  15677. */
  15678. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15679. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15680. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15681. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15682. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15683. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15684. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15685. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15686. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15687. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15688. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15689. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15690. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15691. do { \
  15692. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15693. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15694. } while (0)
  15695. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15696. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15697. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15698. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15699. do { \
  15700. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15701. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15702. } while (0)
  15703. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15704. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15705. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15706. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15707. do { \
  15708. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15709. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15710. } while (0)
  15711. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15712. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15713. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15714. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15715. do { \
  15716. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15717. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15718. } while (0)
  15719. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15720. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15721. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15722. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15723. do { \
  15724. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15725. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15726. } while (0)
  15727. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15728. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15729. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15730. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15731. do { \
  15732. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15733. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15734. } while (0)
  15735. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15736. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15737. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15738. enum htt_backpressure_ring_type {
  15739. HTT_SW_RING_TYPE_UMAC,
  15740. HTT_SW_RING_TYPE_LMAC,
  15741. HTT_SW_RING_TYPE_MAX,
  15742. };
  15743. /* Ring id for which the message is sent to host */
  15744. enum htt_backpressure_umac_ringid {
  15745. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15746. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15747. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15748. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15749. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15750. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15751. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15752. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15753. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15754. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15755. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15756. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15757. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15758. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15759. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15760. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15761. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15762. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15763. HTT_SW_UMAC_RING_IDX_MAX,
  15764. };
  15765. enum htt_backpressure_lmac_ringid {
  15766. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15767. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15768. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15769. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15770. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15771. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15772. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15773. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15774. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15775. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15776. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15777. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15778. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15779. HTT_SW_LMAC_RING_IDX_MAX,
  15780. };
  15781. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15782. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15783. pdev_id: 8,
  15784. ring_type: 8, /* htt_backpressure_ring_type */
  15785. /*
  15786. * ring_id holds an enum value from either
  15787. * htt_backpressure_umac_ringid or
  15788. * htt_backpressure_lmac_ringid, based on
  15789. * the ring_type setting.
  15790. */
  15791. ring_id: 8;
  15792. A_UINT16 head_idx;
  15793. A_UINT16 tail_idx;
  15794. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15795. } POSTPACK;
  15796. /*
  15797. * Defines two 32 bit words that can be used by the target to indicate a per
  15798. * user RU allocation and rate information.
  15799. *
  15800. * This information is currently provided in the "sw_response_reference_ptr"
  15801. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15802. * "rx_ppdu_end_user_stats" TLV.
  15803. *
  15804. * VALID:
  15805. * The consumer of these words must explicitly check the valid bit,
  15806. * and only attempt interpretation of any of the remaining fields if
  15807. * the valid bit is set to 1.
  15808. *
  15809. * VERSION:
  15810. * The consumer of these words must also explicitly check the version bit,
  15811. * and only use the V0 definition if the VERSION field is set to 0.
  15812. *
  15813. * Version 1 is currently undefined, with the exception of the VALID and
  15814. * VERSION fields.
  15815. *
  15816. * Version 0:
  15817. *
  15818. * The fields below are duplicated per BW.
  15819. *
  15820. * The consumer must determine which BW field to use, based on the UL OFDMA
  15821. * PPDU BW indicated by HW.
  15822. *
  15823. * RU_START: RU26 start index for the user.
  15824. * Note that this is always using the RU26 index, regardless
  15825. * of the actual RU assigned to the user
  15826. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15827. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15828. *
  15829. * For example, 20MHz (the value in the top row is RU_START)
  15830. *
  15831. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15832. * RU Size 1 (52): | | | | | |
  15833. * RU Size 2 (106): | | | |
  15834. * RU Size 3 (242): | |
  15835. *
  15836. * RU_SIZE: Indicates the RU size, as defined by enum
  15837. * htt_ul_ofdma_user_info_ru_size.
  15838. *
  15839. * LDPC: LDPC enabled (if 0, BCC is used)
  15840. *
  15841. * DCM: DCM enabled
  15842. *
  15843. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15844. * |---------------------------------+--------------------------------|
  15845. * |Ver|Valid| FW internal |
  15846. * |---------------------------------+--------------------------------|
  15847. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15848. * |---------------------------------+--------------------------------|
  15849. */
  15850. enum htt_ul_ofdma_user_info_ru_size {
  15851. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15852. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15853. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15854. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15855. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15856. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15857. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15858. };
  15859. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15860. struct htt_ul_ofdma_user_info_v0 {
  15861. A_UINT32 word0;
  15862. A_UINT32 word1;
  15863. };
  15864. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15865. A_UINT32 w0_fw_rsvd:30; \
  15866. A_UINT32 w0_valid:1; \
  15867. A_UINT32 w0_version:1;
  15868. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15869. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15870. };
  15871. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15872. A_UINT32 w1_nss:3; \
  15873. A_UINT32 w1_mcs:4; \
  15874. A_UINT32 w1_ldpc:1; \
  15875. A_UINT32 w1_dcm:1; \
  15876. A_UINT32 w1_ru_start:7; \
  15877. A_UINT32 w1_ru_size:3; \
  15878. A_UINT32 w1_trig_type:4; \
  15879. A_UINT32 w1_unused:9;
  15880. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15881. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15882. };
  15883. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15884. A_UINT32 w0_fw_rsvd:27; \
  15885. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15886. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15887. A_UINT32 w0_version:1; /* set to a value of “1” to indicate picking htt_ul_ofdma_user_info_v1_bitmap (field aligns with V0 definition) */
  15888. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15889. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15890. };
  15891. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15892. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15893. A_UINT32 w1_trig_type:4; \
  15894. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15895. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15896. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15897. };
  15898. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15899. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15900. union {
  15901. A_UINT32 word0;
  15902. struct {
  15903. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15904. };
  15905. };
  15906. union {
  15907. A_UINT32 word1;
  15908. struct {
  15909. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15910. };
  15911. };
  15912. } POSTPACK;
  15913. /*
  15914. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15915. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15916. * this should be picked.
  15917. */
  15918. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15919. union {
  15920. A_UINT32 word0;
  15921. struct {
  15922. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15923. };
  15924. };
  15925. union {
  15926. A_UINT32 word1;
  15927. struct {
  15928. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15929. };
  15930. };
  15931. } POSTPACK;
  15932. enum HTT_UL_OFDMA_TRIG_TYPE {
  15933. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15934. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15935. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15936. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15937. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15938. };
  15939. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15940. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15941. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15942. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15943. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15944. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15945. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15946. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15947. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15948. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15949. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15950. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15951. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15952. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15953. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15954. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15955. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15956. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15957. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15958. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15959. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15960. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15961. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15962. /*--- word 0 ---*/
  15963. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15964. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15965. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15966. do { \
  15967. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15968. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15969. } while (0)
  15970. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15971. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15972. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15973. do { \
  15974. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15975. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15976. } while (0)
  15977. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15978. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15979. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15980. do { \
  15981. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15982. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15983. } while (0)
  15984. /*--- word 1 ---*/
  15985. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15986. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15987. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15988. do { \
  15989. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15990. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15991. } while (0)
  15992. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15993. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15994. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15995. do { \
  15996. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15997. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15998. } while (0)
  15999. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  16000. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  16001. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  16002. do { \
  16003. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16004. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16005. } while (0)
  16006. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16007. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16008. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16009. do { \
  16010. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16011. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16012. } while (0)
  16013. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16014. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16015. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16016. do { \
  16017. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16018. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16019. } while (0)
  16020. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16021. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16022. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16023. do { \
  16024. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16025. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16026. } while (0)
  16027. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16028. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16029. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16030. do { \
  16031. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16032. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16033. } while (0)
  16034. /**
  16035. * @brief target -> host channel calibration data message
  16036. *
  16037. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16038. *
  16039. * @brief host -> target channel calibration data message
  16040. *
  16041. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16042. *
  16043. * @details
  16044. * The following field definitions describe the format of the channel
  16045. * calibration data message sent from the target to the host when
  16046. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16047. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16048. * The message is defined as htt_chan_caldata_msg followed by a variable
  16049. * number of 32-bit character values.
  16050. *
  16051. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16052. * |------------------------------------------------------------------|
  16053. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16054. * |------------------------------------------------------------------|
  16055. * | payload size | mhz |
  16056. * |------------------------------------------------------------------|
  16057. * | center frequency 2 | center frequency 1 |
  16058. * |------------------------------------------------------------------|
  16059. * | check sum |
  16060. * |------------------------------------------------------------------|
  16061. * | payload |
  16062. * |------------------------------------------------------------------|
  16063. * message info field:
  16064. * - MSG_TYPE
  16065. * Bits 7:0
  16066. * Purpose: identifies this as a channel calibration data message
  16067. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16068. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16069. * - SUB_TYPE
  16070. * Bits 11:8
  16071. * Purpose: T2H: indicates whether target is providing chan cal data
  16072. * to the host to store, or requesting that the host
  16073. * download previously-stored data.
  16074. * H2T: indicates whether the host is providing the requested
  16075. * channel cal data, or if it is rejecting the data
  16076. * request because it does not have the requested data.
  16077. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16078. * - CHKSUM_VALID
  16079. * Bit 12
  16080. * Purpose: indicates if the checksum field is valid
  16081. * value:
  16082. * - FRAG
  16083. * Bit 19:16
  16084. * Purpose: indicates the fragment index for message
  16085. * value: 0 for first fragment, 1 for second fragment, ...
  16086. * - APPEND
  16087. * Bit 20
  16088. * Purpose: indicates if this is the last fragment
  16089. * value: 0 = final fragment, 1 = more fragments will be appended
  16090. *
  16091. * channel and payload size field
  16092. * - MHZ
  16093. * Bits 15:0
  16094. * Purpose: indicates the channel primary frequency
  16095. * Value:
  16096. * - PAYLOAD_SIZE
  16097. * Bits 31:16
  16098. * Purpose: indicates the bytes of calibration data in payload
  16099. * Value:
  16100. *
  16101. * center frequency field
  16102. * - CENTER FREQUENCY 1
  16103. * Bits 15:0
  16104. * Purpose: indicates the channel center frequency
  16105. * Value: channel center frequency, in MHz units
  16106. * - CENTER FREQUENCY 2
  16107. * Bits 31:16
  16108. * Purpose: indicates the secondary channel center frequency,
  16109. * only for 11acvht 80plus80 mode
  16110. * Value: secondary channel center frequeny, in MHz units, if applicable
  16111. *
  16112. * checksum field
  16113. * - CHECK_SUM
  16114. * Bits 31:0
  16115. * Purpose: check the payload data, it is just for this fragment.
  16116. * This is intended for the target to check that the channel
  16117. * calibration data returned by the host is the unmodified data
  16118. * that was previously provided to the host by the target.
  16119. * value: checksum of fragment payload
  16120. */
  16121. PREPACK struct htt_chan_caldata_msg {
  16122. /* DWORD 0: message info */
  16123. A_UINT32
  16124. msg_type: 8,
  16125. sub_type: 4 ,
  16126. chksum_valid: 1, /** 1:valid, 0:invalid */
  16127. reserved1: 3,
  16128. frag_idx: 4, /** fragment index for calibration data */
  16129. appending: 1, /** 0: no fragment appending,
  16130. * 1: extra fragment appending */
  16131. reserved2: 11;
  16132. /* DWORD 1: channel and payload size */
  16133. A_UINT32
  16134. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16135. payload_size: 16; /** unit: bytes */
  16136. /* DWORD 2: center frequency */
  16137. A_UINT32
  16138. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16139. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16140. * valid only for 11acvht 80plus80 mode */
  16141. /* DWORD 3: check sum */
  16142. A_UINT32 chksum;
  16143. /* variable length for calibration data */
  16144. A_UINT32 payload[1/* or more */];
  16145. } POSTPACK;
  16146. /* T2H SUBTYPE */
  16147. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16148. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16149. /* H2T SUBTYPE */
  16150. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16151. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16152. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16153. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16154. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16155. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16156. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16157. do { \
  16158. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16159. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16160. } while (0)
  16161. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16162. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16163. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16164. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16165. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16166. do { \
  16167. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16168. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16169. } while (0)
  16170. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16171. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16172. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16173. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16174. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16175. do { \
  16176. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16177. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16178. } while (0)
  16179. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16180. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16181. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16182. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16183. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16184. do { \
  16185. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16186. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16187. } while (0)
  16188. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16189. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16190. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16191. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16192. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16193. do { \
  16194. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16195. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16196. } while (0)
  16197. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16198. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16199. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16200. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16201. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16202. do { \
  16203. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16204. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16205. } while (0)
  16206. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16207. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16208. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16209. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16210. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16211. do { \
  16212. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16213. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16214. } while (0)
  16215. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16216. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16217. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16218. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16219. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16220. do { \
  16221. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16222. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16223. } while (0)
  16224. /**
  16225. * @brief target -> host FSE CMEM based send
  16226. *
  16227. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16228. *
  16229. * @details
  16230. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16231. * FSE placement in CMEM is enabled.
  16232. *
  16233. * This message sends the non-secure CMEM base address.
  16234. * It will be sent to host in response to message
  16235. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16236. * The message would appear as follows:
  16237. *
  16238. * |31 24|23 16|15 8|7 0|
  16239. * |----------------+----------------+----------------+----------------|
  16240. * | reserved | num_entries | msg_type |
  16241. * |----------------+----------------+----------------+----------------|
  16242. * | base_address_lo |
  16243. * |----------------+----------------+----------------+----------------|
  16244. * | base_address_hi |
  16245. * |-------------------------------------------------------------------|
  16246. *
  16247. * The message is interpreted as follows:
  16248. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16249. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16250. * b'8:15 - number_entries: Indicated the number of entries
  16251. * programmed.
  16252. * b'16:31 - reserved.
  16253. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16254. * CMEM base address
  16255. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16256. * CMEM base address
  16257. */
  16258. PREPACK struct htt_cmem_base_send_t {
  16259. A_UINT32 msg_type: 8,
  16260. num_entries: 8,
  16261. reserved: 16;
  16262. A_UINT32 base_address_lo;
  16263. A_UINT32 base_address_hi;
  16264. } POSTPACK;
  16265. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16266. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16267. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16268. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16269. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16270. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16271. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16272. do { \
  16273. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16274. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16275. } while (0)
  16276. /**
  16277. * @brief - HTT PPDU ID format
  16278. *
  16279. * @details
  16280. * The following field definitions describe the format of the PPDU ID.
  16281. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16282. *
  16283. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16284. * +--------------------------------------------------------------------------
  16285. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16286. * +--------------------------------------------------------------------------
  16287. *
  16288. * sch id :Schedule command id
  16289. * Bits [11 : 0] : monotonically increasing counter to track the
  16290. * PPDU posted to a specific transmit queue.
  16291. *
  16292. * hwq_id: Hardware Queue ID.
  16293. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16294. *
  16295. * mac_id: MAC ID
  16296. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16297. *
  16298. * seq_idx: Sequence index.
  16299. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16300. * a particular TXOP.
  16301. *
  16302. * tqm_cmd: HWSCH/TQM flag.
  16303. * Bit [23] : Always set to 0.
  16304. *
  16305. * seq_cmd_type: Sequence command type.
  16306. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16307. * Refer to enum HTT_STATS_FTYPE for values.
  16308. */
  16309. PREPACK struct htt_ppdu_id {
  16310. A_UINT32
  16311. sch_id: 12,
  16312. hwq_id: 5,
  16313. mac_id: 2,
  16314. seq_idx: 2,
  16315. reserved1: 2,
  16316. tqm_cmd: 1,
  16317. seq_cmd_type: 6,
  16318. reserved2: 2;
  16319. } POSTPACK;
  16320. #define HTT_PPDU_ID_SCH_ID_S 0
  16321. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16322. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16323. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16324. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16325. do { \
  16326. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16327. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16328. } while (0)
  16329. #define HTT_PPDU_ID_HWQ_ID_S 12
  16330. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16331. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16332. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16333. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16334. do { \
  16335. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16336. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16337. } while (0)
  16338. #define HTT_PPDU_ID_MAC_ID_S 17
  16339. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16340. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16341. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16342. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16343. do { \
  16344. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16345. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16346. } while (0)
  16347. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16348. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16349. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16350. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16351. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16352. do { \
  16353. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16354. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16355. } while (0)
  16356. #define HTT_PPDU_ID_TQM_CMD_S 23
  16357. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16358. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16359. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16360. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16361. do { \
  16362. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16363. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16364. } while (0)
  16365. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16366. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16367. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16368. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16369. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16370. do { \
  16371. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16372. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16373. } while (0)
  16374. /**
  16375. * @brief target -> RX PEER METADATA V0 format
  16376. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16377. * message from target, and will confirm to the target which peer metadata
  16378. * version to use in the wmi_init message.
  16379. *
  16380. * The following diagram shows the format of the RX PEER METADATA.
  16381. *
  16382. * |31 24|23 16|15 8|7 0|
  16383. * |-----------------------------------------------------------------------|
  16384. * | Reserved | VDEV ID | PEER ID |
  16385. * |-----------------------------------------------------------------------|
  16386. */
  16387. PREPACK struct htt_rx_peer_metadata_v0 {
  16388. A_UINT32
  16389. peer_id: 16,
  16390. vdev_id: 8,
  16391. reserved1: 8;
  16392. } POSTPACK;
  16393. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16394. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16395. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16396. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16397. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16398. do { \
  16399. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16400. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16401. } while (0)
  16402. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16403. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16404. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16405. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16406. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16407. do { \
  16408. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16409. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16410. } while (0)
  16411. /**
  16412. * @brief target -> RX PEER METADATA V1 format
  16413. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16414. * message from target, and will confirm to the target which peer metadata
  16415. * version to use in the wmi_init message.
  16416. *
  16417. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16418. *
  16419. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16420. * |-----------------------------------------------------------------------|
  16421. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  16422. * |-----------------------------------------------------------------------|
  16423. */
  16424. PREPACK struct htt_rx_peer_metadata_v1 {
  16425. A_UINT32
  16426. peer_id: 13,
  16427. ml_peer_valid: 1,
  16428. reserved1: 2,
  16429. vdev_id: 8,
  16430. lmac_id: 2,
  16431. chip_id: 3,
  16432. reserved2: 3;
  16433. } POSTPACK;
  16434. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16435. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16436. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16437. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16438. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16439. do { \
  16440. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16441. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16442. } while (0)
  16443. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16444. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16445. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16446. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16447. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16448. do { \
  16449. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16450. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16451. } while (0)
  16452. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16453. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16454. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16455. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16456. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16457. do { \
  16458. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16459. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16460. } while (0)
  16461. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16462. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16463. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16464. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16465. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16466. do { \
  16467. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16468. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16469. } while (0)
  16470. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16471. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16472. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16473. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16474. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16475. do { \
  16476. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16477. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16478. } while (0)
  16479. /*
  16480. * In some systems, the host SW wants to specify priorities between
  16481. * different MSDU / flow queues within the same peer-TID.
  16482. * The below enums are used for the host to identify to the target
  16483. * which MSDU queue's priority it wants to adjust.
  16484. */
  16485. /*
  16486. * The MSDUQ index describe index of TCL HW, where each index is
  16487. * used for queuing particular types of MSDUs.
  16488. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16489. */
  16490. enum HTT_MSDUQ_INDEX {
  16491. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16492. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16493. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16494. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16495. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16496. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16497. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16498. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16499. HTT_MSDUQ_MAX_INDEX,
  16500. };
  16501. /* MSDU qtype definition */
  16502. enum HTT_MSDU_QTYPE {
  16503. /*
  16504. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16505. * relative priority. Instead, the relative priority of CRIT_0 versus
  16506. * CRIT_1 is controlled by the FW, through the configuration parameters
  16507. * it applies to the queues.
  16508. */
  16509. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16510. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16511. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16512. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16513. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16514. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16515. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16516. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16517. /* New MSDU_QTYPE should be added above this line */
  16518. /*
  16519. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16520. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16521. * any host/target message definitions. The QTYPE_MAX value can
  16522. * only be used internally within the host or within the target.
  16523. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16524. * it must regard the unexpected value as a default qtype value,
  16525. * or ignore it.
  16526. */
  16527. HTT_MSDU_QTYPE_MAX,
  16528. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16529. };
  16530. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16531. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16532. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16533. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16534. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16535. };
  16536. /**
  16537. * @brief target -> host mlo timestamp offset indication
  16538. *
  16539. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16540. *
  16541. * @details
  16542. * The following field definitions describe the format of the HTT target
  16543. * to host mlo timestamp offset indication message.
  16544. *
  16545. *
  16546. * |31 16|15 12|11 10|9 8|7 0 |
  16547. * |----------------------------------------------------------------------|
  16548. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16549. * |----------------------------------------------------------------------|
  16550. * | Sync time stamp lo in us |
  16551. * |----------------------------------------------------------------------|
  16552. * | Sync time stamp hi in us |
  16553. * |----------------------------------------------------------------------|
  16554. * | mlo time stamp offset lo in us |
  16555. * |----------------------------------------------------------------------|
  16556. * | mlo time stamp offset hi in us |
  16557. * |----------------------------------------------------------------------|
  16558. * | mlo time stamp offset clocks in clock ticks |
  16559. * |----------------------------------------------------------------------|
  16560. * |31 26|25 16|15 0 |
  16561. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16562. * | | compensation in clks | |
  16563. * |----------------------------------------------------------------------|
  16564. * |31 22|21 0 |
  16565. * | rsvd 3 | mlo time stamp comp timer period |
  16566. * |----------------------------------------------------------------------|
  16567. * The message is interpreted as follows:
  16568. *
  16569. * dword0 - b'0:7 - msg_type: This will be set to
  16570. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16571. * value: 0x28
  16572. *
  16573. * dword0 - b'9:8 - pdev_id
  16574. *
  16575. * dword0 - b'11:10 - chip_id
  16576. *
  16577. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16578. *
  16579. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16580. *
  16581. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16582. * which last sync interrupt was received
  16583. *
  16584. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16585. * which last sync interrupt was received
  16586. *
  16587. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16588. *
  16589. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16590. *
  16591. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16592. *
  16593. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16594. *
  16595. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16596. * for sub us resolution
  16597. *
  16598. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16599. *
  16600. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16601. * is applied, in us
  16602. *
  16603. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16604. */
  16605. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16606. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16607. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16608. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16609. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16610. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16611. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16612. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16613. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16614. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16615. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16616. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16617. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16618. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16619. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16620. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16621. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16622. do { \
  16623. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16624. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16625. } while (0)
  16626. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16627. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16628. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16629. do { \
  16630. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16631. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16632. } while (0)
  16633. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16634. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16635. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16636. do { \
  16637. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16638. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16639. } while (0)
  16640. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16641. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16642. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16643. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16644. do { \
  16645. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16646. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16647. } while (0)
  16648. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16649. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16650. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16651. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16652. do { \
  16653. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16654. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16655. } while (0)
  16656. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16657. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16658. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16659. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16660. do { \
  16661. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16662. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16663. } while (0)
  16664. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16665. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16666. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16667. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16668. do { \
  16669. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16670. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16671. } while (0)
  16672. typedef struct {
  16673. A_UINT32 msg_type: 8, /* bits 7:0 */
  16674. pdev_id: 2, /* bits 9:8 */
  16675. chip_id: 2, /* bits 11:10 */
  16676. reserved1: 4, /* bits 15:12 */
  16677. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16678. A_UINT32 sync_timestamp_lo_us;
  16679. A_UINT32 sync_timestamp_hi_us;
  16680. A_UINT32 mlo_timestamp_offset_lo_us;
  16681. A_UINT32 mlo_timestamp_offset_hi_us;
  16682. A_UINT32 mlo_timestamp_offset_clks;
  16683. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16684. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16685. reserved2: 6; /* bits 31:26 */
  16686. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16687. reserved3: 10; /* bits 31:22 */
  16688. } htt_t2h_mlo_offset_ind_t;
  16689. /*
  16690. * @brief target -> host VDEV TX RX STATS
  16691. *
  16692. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16693. *
  16694. * @details
  16695. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16696. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16697. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16698. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16699. * periodically by target even in the absence of any further HTT request
  16700. * messages from host.
  16701. *
  16702. * The message is formatted as follows:
  16703. *
  16704. * |31 16|15 8|7 0|
  16705. * |---------------------------------+----------------+----------------|
  16706. * | payload_size | pdev_id | msg_type |
  16707. * |---------------------------------+----------------+----------------|
  16708. * | reserved0 |
  16709. * |-------------------------------------------------------------------|
  16710. * | reserved1 |
  16711. * |-------------------------------------------------------------------|
  16712. * | reserved2 |
  16713. * |-------------------------------------------------------------------|
  16714. * | |
  16715. * | VDEV specific Tx Rx stats info |
  16716. * | |
  16717. * |-------------------------------------------------------------------|
  16718. *
  16719. * The message is interpreted as follows:
  16720. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16721. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16722. * b'8:15 - pdev_id
  16723. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16724. * message header fields (msg_type through reserved2)
  16725. * dword1 - b'0:31 - reserved0.
  16726. * dword2 - b'0:31 - reserved1.
  16727. * dword3 - b'0:31 - reserved2.
  16728. */
  16729. typedef struct {
  16730. A_UINT32 msg_type: 8,
  16731. pdev_id: 8,
  16732. payload_size: 16;
  16733. A_UINT32 reserved0;
  16734. A_UINT32 reserved1;
  16735. A_UINT32 reserved2;
  16736. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16737. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16738. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16739. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16740. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16741. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16742. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16743. do { \
  16744. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16745. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16746. } while (0)
  16747. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16748. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16749. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16750. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16751. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16752. do { \
  16753. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16754. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16755. } while (0)
  16756. /* SOC related stats */
  16757. typedef struct {
  16758. htt_tlv_hdr_t tlv_hdr;
  16759. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16760. * This can be due to either the peer is deleted or deletion is ongoing
  16761. * */
  16762. A_UINT32 inv_peers_msdu_drop_count_lo;
  16763. A_UINT32 inv_peers_msdu_drop_count_hi;
  16764. } htt_t2h_soc_txrx_stats_common_tlv;
  16765. /* VDEV HW Tx/Rx stats */
  16766. typedef struct {
  16767. htt_tlv_hdr_t tlv_hdr;
  16768. A_UINT32 vdev_id;
  16769. /* Rx msdu byte cnt */
  16770. A_UINT32 rx_msdu_byte_cnt_lo;
  16771. A_UINT32 rx_msdu_byte_cnt_hi;
  16772. /* Rx msdu cnt */
  16773. A_UINT32 rx_msdu_cnt_lo;
  16774. A_UINT32 rx_msdu_cnt_hi;
  16775. /* tx msdu byte cnt */
  16776. A_UINT32 tx_msdu_byte_cnt_lo;
  16777. A_UINT32 tx_msdu_byte_cnt_hi;
  16778. /* tx msdu cnt */
  16779. A_UINT32 tx_msdu_cnt_lo;
  16780. A_UINT32 tx_msdu_cnt_hi;
  16781. /* tx excessive retry discarded msdu cnt */
  16782. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16783. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16784. /* TX congestion ctrl msdu drop cnt */
  16785. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16786. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16787. /* discarded tx msdus cnt coz of time to live expiry */
  16788. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16789. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16790. /* tx excessive retry discarded msdu byte cnt */
  16791. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16792. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16793. /* TX congestion ctrl msdu drop byte cnt */
  16794. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16795. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16796. /* discarded tx msdus byte cnt coz of time to live expiry */
  16797. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16798. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16799. /* TQM bypass frame cnt */
  16800. A_UINT32 tqm_bypass_frame_cnt_lo;
  16801. A_UINT32 tqm_bypass_frame_cnt_hi;
  16802. /* TQM bypass byte cnt */
  16803. A_UINT32 tqm_bypass_byte_cnt_lo;
  16804. A_UINT32 tqm_bypass_byte_cnt_hi;
  16805. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16806. /*
  16807. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16808. *
  16809. * @details
  16810. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16811. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16812. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16813. * the default MSDU queues of each of the specified TIDs for the peer
  16814. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16815. * If the default MSDU queues of a given TID within the peer are not linked
  16816. * to a service class, the svc_class_id field for that TID will have a
  16817. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16818. * queues for that TID are not mapped to any service class.
  16819. *
  16820. * |31 16|15 8|7 0|
  16821. * |------------------------------+--------------+--------------|
  16822. * | peer ID | reserved | msg type |
  16823. * |------------------------------+--------------+------+-------|
  16824. * | reserved | svc class ID | TID |
  16825. * |------------------------------------------------------------|
  16826. * ...
  16827. * |------------------------------------------------------------|
  16828. * | reserved | svc class ID | TID |
  16829. * |------------------------------------------------------------|
  16830. * Header fields:
  16831. * dword0 - b'7:0 - msg_type: This will be set to
  16832. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16833. * b'31:16 - peer ID
  16834. * dword1 - b'7:0 - TID
  16835. * b'15:8 - svc class ID
  16836. * (dword2, etc. same format as dword1)
  16837. */
  16838. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16839. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16840. A_UINT32 msg_type :8,
  16841. reserved0 :8,
  16842. peer_id :16;
  16843. struct {
  16844. A_UINT32 tid :8,
  16845. svc_class_id :8,
  16846. reserved1 :16;
  16847. } tid_reports[1/*or more*/];
  16848. } POSTPACK;
  16849. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16850. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16851. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16852. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16853. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16854. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16855. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16856. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16857. do { \
  16858. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16859. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16860. } while (0)
  16861. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16862. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16863. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16864. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16865. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16866. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16867. do { \
  16868. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16869. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16870. } while (0)
  16871. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16872. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16873. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16874. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16875. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16876. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16877. do { \
  16878. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16879. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16880. } while (0)
  16881. /*
  16882. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16883. *
  16884. * @details
  16885. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16886. * flow if the flow is seen the associated service class is conveyed to the
  16887. * target via TCL Data Command. Target on the other hand internally creates the
  16888. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16889. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16890. * the newly created MSDUQ
  16891. *
  16892. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16893. * |------------------------------+------------------------+--------------|
  16894. * | peer ID | HTT qtype | msg type |
  16895. * |---------------------------------+--------------+--+---+-------+------|
  16896. * | reserved |AST list index|FO|WC | HLOS | remap|
  16897. * | | | | | TID | TID |
  16898. * |---------------------+------------------------------------------------|
  16899. * | reserved1 | tgt_opaque_id |
  16900. * |---------------------+------------------------------------------------|
  16901. *
  16902. * Header fields:
  16903. *
  16904. * dword0 - b'7:0 - msg_type: This will be set to
  16905. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16906. * b'15:8 - HTT qtype
  16907. * b'31:16 - peer ID
  16908. *
  16909. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16910. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16911. * hlos_tid : Common to Lithium and Beryllium
  16912. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16913. * TCL Data Command : Beryllium
  16914. * b10 - flow_override (FO), as sent by host in
  16915. * TCL Data Command: Beryllium
  16916. * b11:14 - ast_list_idx
  16917. * Array index into the list of extension AST entries
  16918. * (not the actual AST 16-bit index).
  16919. * The ast_list_idx is one-based, with the following
  16920. * range of values:
  16921. * - legacy targets supporting 16 user-defined
  16922. * MSDU queues: 1-2
  16923. * - legacy targets supporting 48 user-defined
  16924. * MSDU queues: 1-6
  16925. * - new targets: 0 (peer_id is used instead)
  16926. * Note that since ast_list_idx is one-based,
  16927. * the host will need to subtract 1 to use it as an
  16928. * index into a list of extension AST entries.
  16929. * b15:31 - reserved
  16930. *
  16931. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16932. * unique MSDUQ id in firmware
  16933. * b'24:31 - reserved1
  16934. */
  16935. PREPACK struct htt_t2h_sawf_msduq_event {
  16936. A_UINT32 msg_type : 8,
  16937. htt_qtype : 8,
  16938. peer_id :16;
  16939. A_UINT32 remap_tid : 4,
  16940. hlos_tid : 4,
  16941. who_classify_info_sel : 2,
  16942. flow_override : 1,
  16943. ast_list_idx : 4,
  16944. reserved :17;
  16945. A_UINT32 tgt_opaque_id :24,
  16946. reserved1 : 8;
  16947. } POSTPACK;
  16948. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16949. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16950. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16951. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16952. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16953. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16954. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16955. do { \
  16956. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16957. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16958. } while (0)
  16959. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16960. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16961. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16962. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16963. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16964. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16965. do { \
  16966. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16967. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16968. } while (0)
  16969. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16970. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16971. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16972. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16973. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16974. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16975. do { \
  16976. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16977. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16978. } while (0)
  16979. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16980. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16981. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16982. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16983. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16984. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16985. do { \
  16986. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16987. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16988. } while (0)
  16989. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16990. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16991. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16992. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16993. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16994. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16995. do { \
  16996. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16997. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16998. } while (0)
  16999. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  17000. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  17001. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  17002. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  17003. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17004. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17005. do { \
  17006. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17007. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17008. } while (0)
  17009. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17010. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17011. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17012. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17013. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17014. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17015. do { \
  17016. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17017. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17018. } while (0)
  17019. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17020. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17021. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17022. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17023. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17024. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17025. do { \
  17026. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17027. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17028. } while (0)
  17029. /**
  17030. * @brief target -> PPDU id format indication
  17031. *
  17032. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17033. *
  17034. * @details
  17035. * The following field definitions describe the format of the HTT target
  17036. * to host PPDU ID format indication message.
  17037. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17038. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17039. * seq_idx :- Sequence control index of this PPDU.
  17040. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17041. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17042. * tqm_cmd:-
  17043. *
  17044. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17045. * |--------------------------------------------------+------------------------|
  17046. * | rsvd0 | msg type |
  17047. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17048. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17049. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17050. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17051. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17052. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17053. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17054. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17055. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17056. * Where: OF = bit offset, NB = number of bits, V = valid
  17057. * The message is interpreted as follows:
  17058. *
  17059. * dword0 - b'7:0 - msg_type: This will be set to
  17060. * HTT_T2H_PPDU_ID_FMT_IND
  17061. * value: 0x30
  17062. *
  17063. * dword0 - b'31:8 - reserved
  17064. *
  17065. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17066. *
  17067. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17068. *
  17069. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17070. *
  17071. * dword1 - b'15:11 - reserved for future use
  17072. *
  17073. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17074. *
  17075. * dword1 - b'21:17 - number of bits in ring_id
  17076. *
  17077. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17078. *
  17079. * dword1 - b'31:27 - reserved for future use
  17080. *
  17081. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17082. *
  17083. * dword2 - b'5:1 - number of bits in sequence index
  17084. *
  17085. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17086. *
  17087. * dword2 - b'15:11 - reserved for future use
  17088. *
  17089. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17090. *
  17091. * dword2 - b'21:17 - number of bits in link_id
  17092. *
  17093. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17094. *
  17095. * dword2 - b'31:27 - reserved for future use
  17096. *
  17097. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17098. *
  17099. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17100. *
  17101. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17102. *
  17103. * dword3 - b'15:11 - reserved for future use
  17104. *
  17105. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17106. *
  17107. * dword3 - b'21:17 - number of bits in tqm_cmd
  17108. *
  17109. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17110. *
  17111. * dword3 - b'31:27 - reserved for future use
  17112. *
  17113. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17114. *
  17115. * dword4 - b'5:1 - number of bits in mac_id
  17116. *
  17117. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17118. *
  17119. * dword4 - b'15:11 - reserved for future use
  17120. *
  17121. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17122. *
  17123. * dword4 - b'21:17 - number of bits in crc
  17124. *
  17125. * dword4 - b'26:22 - offset of crc (in number of bits)
  17126. *
  17127. * dword4 - b'31:27 - reserved for future use
  17128. *
  17129. */
  17130. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17131. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17132. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17133. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17134. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17135. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17136. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17137. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17138. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17139. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17140. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17141. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17142. /* macros for accessing lower 16 bits in dword */
  17143. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17144. do { \
  17145. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17146. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17147. } while (0)
  17148. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17149. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17150. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17151. do { \
  17152. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17153. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17154. } while (0)
  17155. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17156. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17157. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17158. do { \
  17159. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17160. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17161. } while (0)
  17162. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17163. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17164. /* macros for accessing upper 16 bits in dword */
  17165. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17166. do { \
  17167. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17168. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17169. } while (0)
  17170. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17171. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17172. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17173. do { \
  17174. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17175. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17176. } while (0)
  17177. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17178. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17179. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17180. do { \
  17181. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17182. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17183. } while (0)
  17184. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17185. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17186. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17187. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17188. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17189. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17190. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17191. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17192. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17193. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17194. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17195. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17196. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17197. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17198. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17199. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17200. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17201. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17202. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17203. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17204. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17205. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17206. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17207. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17208. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17209. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17210. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17211. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17212. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17213. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17214. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17215. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17216. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17217. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17218. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17219. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17220. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17221. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17222. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17223. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17224. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17225. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17226. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17227. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17228. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17229. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17230. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17231. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17232. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17233. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17234. /* offsets in number dwords */
  17235. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17236. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17237. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17238. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17239. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17240. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17241. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17242. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17243. typedef struct {
  17244. A_UINT32 msg_type: 8, /* bits 7:0 */
  17245. rsvd0: 24;/* bits 31:8 */
  17246. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17247. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17248. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17249. rsvd1: 5, /* bits 15:11 */
  17250. ring_id_valid: 1, /* bits 16:16 */
  17251. ring_id_bits: 5, /* bits 21:17 */
  17252. ring_id_offset: 5, /* bits 26:22 */
  17253. rsvd2: 5; /* bits 31:27 */
  17254. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17255. seq_idx_bits: 5, /* bits 5:1 */
  17256. seq_idx_offset: 5, /* bits 10:6 */
  17257. rsvd3: 5, /* bits 15:11 */
  17258. link_id_valid: 1, /* bits 16:16 */
  17259. link_id_bits: 5, /* bits 21:17 */
  17260. link_id_offset: 5, /* bits 26:22 */
  17261. rsvd4: 5; /* bits 31:27 */
  17262. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17263. seq_cmd_type_bits: 5, /* bits 5:1 */
  17264. seq_cmd_type_offset: 5, /* bits 10:6 */
  17265. rsvd5: 5, /* bits 15:11 */
  17266. tqm_cmd_valid: 1, /* bits 16:16 */
  17267. tqm_cmd_bits: 5, /* bits 21:17 */
  17268. tqm_cmd_offset: 5, /* bits 26:12 */
  17269. rsvd6: 5; /* bits 31:27 */
  17270. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17271. mac_id_bits: 5, /* bits 5:1 */
  17272. mac_id_offset: 5, /* bits 10:6 */
  17273. rsvd8: 5, /* bits 15:11 */
  17274. crc_valid: 1, /* bits 16:16 */
  17275. crc_bits: 5, /* bits 21:17 */
  17276. crc_offset: 5, /* bits 26:12 */
  17277. rsvd9: 5; /* bits 31:27 */
  17278. } htt_t2h_ppdu_id_fmt_ind_t;
  17279. #endif