htt.h 878 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100
  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_MAX_TAG,
  726. } htt_stats_tlv_tag_t;
  727. /* retain deprecated enum name as an alias for the current enum name */
  728. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  729. #define HTT_STATS_TLV_TAG_M 0x00000fff
  730. #define HTT_STATS_TLV_TAG_S 0
  731. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  732. #define HTT_STATS_TLV_LENGTH_S 12
  733. #define HTT_STATS_TLV_TAG_GET(_var) \
  734. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  735. HTT_STATS_TLV_TAG_S)
  736. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  737. do { \
  738. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  739. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  740. } while (0)
  741. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  742. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  743. HTT_STATS_TLV_LENGTH_S)
  744. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  745. do { \
  746. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  747. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  748. } while (0)
  749. /*=== host -> target messages ===============================================*/
  750. enum htt_h2t_msg_type {
  751. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  752. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  753. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  754. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  755. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  756. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  757. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  758. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  759. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  760. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  761. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  762. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  763. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  764. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  765. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  766. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  767. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  768. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  769. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  770. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  771. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  772. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  773. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  774. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  775. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  776. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  777. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  778. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  779. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  780. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  781. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  782. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  783. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  784. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  785. /* keep this last */
  786. HTT_H2T_NUM_MSGS
  787. };
  788. /*
  789. * HTT host to target message type -
  790. * stored in bits 7:0 of the first word of the message
  791. */
  792. #define HTT_H2T_MSG_TYPE_M 0xff
  793. #define HTT_H2T_MSG_TYPE_S 0
  794. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  795. do { \
  796. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  797. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  798. } while (0)
  799. #define HTT_H2T_MSG_TYPE_GET(word) \
  800. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  801. /**
  802. * @brief host -> target version number request message definition
  803. *
  804. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  805. *
  806. *
  807. * |31 24|23 16|15 8|7 0|
  808. * |----------------+----------------+----------------+----------------|
  809. * | reserved | msg type |
  810. * |-------------------------------------------------------------------|
  811. * : option request TLV (optional) |
  812. * :...................................................................:
  813. *
  814. * The VER_REQ message may consist of a single 4-byte word, or may be
  815. * extended with TLVs that specify which HTT options the host is requesting
  816. * from the target.
  817. * The following option TLVs may be appended to the VER_REQ message:
  818. * - HL_SUPPRESS_TX_COMPL_IND
  819. * - HL_MAX_TX_QUEUE_GROUPS
  820. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  821. * may be appended to the VER_REQ message (but only one TLV of each type).
  822. *
  823. * Header fields:
  824. * - MSG_TYPE
  825. * Bits 7:0
  826. * Purpose: identifies this as a version number request message
  827. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  828. */
  829. #define HTT_VER_REQ_BYTES 4
  830. /* TBDXXX: figure out a reasonable number */
  831. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  832. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  833. /**
  834. * @brief HTT tx MSDU descriptor
  835. *
  836. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  837. *
  838. * @details
  839. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  840. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  841. * the target firmware needs for the FW's tx processing, particularly
  842. * for creating the HW msdu descriptor.
  843. * The same HTT tx descriptor is used for HL and LL systems, though
  844. * a few fields within the tx descriptor are used only by LL or
  845. * only by HL.
  846. * The HTT tx descriptor is defined in two manners: by a struct with
  847. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  848. * definitions.
  849. * The target should use the struct def, for simplicitly and clarity,
  850. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  851. * neutral. Specifically, the host shall use the get/set macros built
  852. * around the mask + shift defs.
  853. */
  854. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  855. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  856. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  857. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  858. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  859. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  860. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  861. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  862. #define HTT_TX_VDEV_ID_WORD 0
  863. #define HTT_TX_VDEV_ID_MASK 0x3f
  864. #define HTT_TX_VDEV_ID_SHIFT 16
  865. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  866. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  867. #define HTT_TX_MSDU_LEN_DWORD 1
  868. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  869. /*
  870. * HTT_VAR_PADDR macros
  871. * Allow physical / bus addresses to be either a single 32-bit value,
  872. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  873. */
  874. #define HTT_VAR_PADDR32(var_name) \
  875. A_UINT32 var_name
  876. #define HTT_VAR_PADDR64_LE(var_name) \
  877. struct { \
  878. /* little-endian: lo precedes hi */ \
  879. A_UINT32 lo; \
  880. A_UINT32 hi; \
  881. } var_name
  882. /*
  883. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  884. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  885. * addresses are stored in a XXX-bit field.
  886. * This macro is used to define both htt_tx_msdu_desc32_t and
  887. * htt_tx_msdu_desc64_t structs.
  888. */
  889. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  890. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  891. { \
  892. /* DWORD 0: flags and meta-data */ \
  893. A_UINT32 \
  894. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  895. \
  896. /* pkt_subtype - \
  897. * Detailed specification of the tx frame contents, extending the \
  898. * general specification provided by pkt_type. \
  899. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  900. * pkt_type | pkt_subtype \
  901. * ============================================================== \
  902. * 802.3 | bit 0:3 - Reserved \
  903. * | bit 4: 0x0 - Copy-Engine Classification Results \
  904. * | not appended to the HTT message \
  905. * | 0x1 - Copy-Engine Classification Results \
  906. * | appended to the HTT message in the \
  907. * | format: \
  908. * | [HTT tx desc, frame header, \
  909. * | CE classification results] \
  910. * | The CE classification results begin \
  911. * | at the next 4-byte boundary after \
  912. * | the frame header. \
  913. * ------------+------------------------------------------------- \
  914. * Eth2 | bit 0:3 - Reserved \
  915. * | bit 4: 0x0 - Copy-Engine Classification Results \
  916. * | not appended to the HTT message \
  917. * | 0x1 - Copy-Engine Classification Results \
  918. * | appended to the HTT message. \
  919. * | See the above specification of the \
  920. * | CE classification results location. \
  921. * ------------+------------------------------------------------- \
  922. * native WiFi | bit 0:3 - Reserved \
  923. * | bit 4: 0x0 - Copy-Engine Classification Results \
  924. * | not appended to the HTT message \
  925. * | 0x1 - Copy-Engine Classification Results \
  926. * | appended to the HTT message. \
  927. * | See the above specification of the \
  928. * | CE classification results location. \
  929. * ------------+------------------------------------------------- \
  930. * mgmt | 0x0 - 802.11 MAC header absent \
  931. * | 0x1 - 802.11 MAC header present \
  932. * ------------+------------------------------------------------- \
  933. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  934. * | 0x1 - 802.11 MAC header present \
  935. * | bit 1: 0x0 - allow aggregation \
  936. * | 0x1 - don't allow aggregation \
  937. * | bit 2: 0x0 - perform encryption \
  938. * | 0x1 - don't perform encryption \
  939. * | bit 3: 0x0 - perform tx classification / queuing \
  940. * | 0x1 - don't perform tx classification; \
  941. * | insert the frame into the "misc" \
  942. * | tx queue \
  943. * | bit 4: 0x0 - Copy-Engine Classification Results \
  944. * | not appended to the HTT message \
  945. * | 0x1 - Copy-Engine Classification Results \
  946. * | appended to the HTT message. \
  947. * | See the above specification of the \
  948. * | CE classification results location. \
  949. */ \
  950. pkt_subtype: 5, \
  951. \
  952. /* pkt_type - \
  953. * General specification of the tx frame contents. \
  954. * The htt_pkt_type enum should be used to specify and check the \
  955. * value of this field. \
  956. */ \
  957. pkt_type: 3, \
  958. \
  959. /* vdev_id - \
  960. * ID for the vdev that is sending this tx frame. \
  961. * For certain non-standard packet types, e.g. pkt_type == raw \
  962. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  963. * This field is used primarily for determining where to queue \
  964. * broadcast and multicast frames. \
  965. */ \
  966. vdev_id: 6, \
  967. /* ext_tid - \
  968. * The extended traffic ID. \
  969. * If the TID is unknown, the extended TID is set to \
  970. * HTT_TX_EXT_TID_INVALID. \
  971. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  972. * value of the QoS TID. \
  973. * If the tx frame is non-QoS data, then the extended TID is set to \
  974. * HTT_TX_EXT_TID_NON_QOS. \
  975. * If the tx frame is multicast or broadcast, then the extended TID \
  976. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  977. */ \
  978. ext_tid: 5, \
  979. \
  980. /* postponed - \
  981. * This flag indicates whether the tx frame has been downloaded to \
  982. * the target before but discarded by the target, and now is being \
  983. * downloaded again; or if this is a new frame that is being \
  984. * downloaded for the first time. \
  985. * This flag allows the target to determine the correct order for \
  986. * transmitting new vs. old frames. \
  987. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  988. * This flag only applies to HL systems, since in LL systems, \
  989. * the tx flow control is handled entirely within the target. \
  990. */ \
  991. postponed: 1, \
  992. \
  993. /* extension - \
  994. * This flag indicates whether a HTT tx MSDU extension descriptor \
  995. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  996. * \
  997. * 0x0 - no extension MSDU descriptor is present \
  998. * 0x1 - an extension MSDU descriptor immediately follows the \
  999. * regular MSDU descriptor \
  1000. */ \
  1001. extension: 1, \
  1002. \
  1003. /* cksum_offload - \
  1004. * This flag indicates whether checksum offload is enabled or not \
  1005. * for this frame. Target FW use this flag to turn on HW checksumming \
  1006. * 0x0 - No checksum offload \
  1007. * 0x1 - L3 header checksum only \
  1008. * 0x2 - L4 checksum only \
  1009. * 0x3 - L3 header checksum + L4 checksum \
  1010. */ \
  1011. cksum_offload: 2, \
  1012. \
  1013. /* tx_comp_req - \
  1014. * This flag indicates whether Tx Completion \
  1015. * from fw is required or not. \
  1016. * This flag is only relevant if tx completion is not \
  1017. * universally enabled. \
  1018. * For all LL systems, tx completion is mandatory, \
  1019. * so this flag will be irrelevant. \
  1020. * For HL systems tx completion is optional, but HL systems in which \
  1021. * the bus throughput exceeds the WLAN throughput will \
  1022. * probably want to always use tx completion, and thus \
  1023. * would not check this flag. \
  1024. * This flag is required when tx completions are not used universally, \
  1025. * but are still required for certain tx frames for which \
  1026. * an OTA delivery acknowledgment is needed by the host. \
  1027. * In practice, this would be for HL systems in which the \
  1028. * bus throughput is less than the WLAN throughput. \
  1029. * \
  1030. * 0x0 - Tx Completion Indication from Fw not required \
  1031. * 0x1 - Tx Completion Indication from Fw is required \
  1032. */ \
  1033. tx_compl_req: 1; \
  1034. \
  1035. \
  1036. /* DWORD 1: MSDU length and ID */ \
  1037. A_UINT32 \
  1038. len: 16, /* MSDU length, in bytes */ \
  1039. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1040. * and this id is used to calculate fragmentation \
  1041. * descriptor pointer inside the target based on \
  1042. * the base address, configured inside the target. \
  1043. */ \
  1044. \
  1045. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1046. /* frags_desc_ptr - \
  1047. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1048. * where the tx frame's fragments reside in memory. \
  1049. * This field only applies to LL systems, since in HL systems the \
  1050. * (degenerate single-fragment) fragmentation descriptor is created \
  1051. * within the target. \
  1052. */ \
  1053. _paddr__frags_desc_ptr_; \
  1054. \
  1055. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1056. /* \
  1057. * Peer ID : Target can use this value to know which peer-id packet \
  1058. * destined to. \
  1059. * It's intended to be specified by host in case of NAWDS. \
  1060. */ \
  1061. A_UINT16 peerid; \
  1062. \
  1063. /* \
  1064. * Channel frequency: This identifies the desired channel \
  1065. * frequency (in mhz) for tx frames. This is used by FW to help \
  1066. * determine when it is safe to transmit or drop frames for \
  1067. * off-channel operation. \
  1068. * The default value of zero indicates to FW that the corresponding \
  1069. * VDEV's home channel (if there is one) is the desired channel \
  1070. * frequency. \
  1071. */ \
  1072. A_UINT16 chanfreq; \
  1073. \
  1074. /* Reason reserved is commented is increasing the htt structure size \
  1075. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1076. * A_UINT32 reserved_dword3_bits0_31; \
  1077. */ \
  1078. } POSTPACK
  1079. /* define a htt_tx_msdu_desc32_t type */
  1080. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1081. /* define a htt_tx_msdu_desc64_t type */
  1082. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1083. /*
  1084. * Make htt_tx_msdu_desc_t be an alias for either
  1085. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1086. */
  1087. #if HTT_PADDR64
  1088. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1089. #else
  1090. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1091. #endif
  1092. /* decriptor information for Management frame*/
  1093. /*
  1094. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1095. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1096. */
  1097. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1098. extern A_UINT32 mgmt_hdr_len;
  1099. PREPACK struct htt_mgmt_tx_desc_t {
  1100. A_UINT32 msg_type;
  1101. #if HTT_PADDR64
  1102. A_UINT64 frag_paddr; /* DMAble address of the data */
  1103. #else
  1104. A_UINT32 frag_paddr; /* DMAble address of the data */
  1105. #endif
  1106. A_UINT32 desc_id; /* returned to host during completion
  1107. * to free the meory*/
  1108. A_UINT32 len; /* Fragment length */
  1109. A_UINT32 vdev_id; /* virtual device ID*/
  1110. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1111. } POSTPACK;
  1112. PREPACK struct htt_mgmt_tx_compl_ind {
  1113. A_UINT32 desc_id;
  1114. A_UINT32 status;
  1115. } POSTPACK;
  1116. /*
  1117. * This SDU header size comes from the summation of the following:
  1118. * 1. Max of:
  1119. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1120. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1121. * b. 802.11 header, for raw frames: 36 bytes
  1122. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1123. * QoS header, HT header)
  1124. * c. 802.3 header, for ethernet frames: 14 bytes
  1125. * (destination address, source address, ethertype / length)
  1126. * 2. Max of:
  1127. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1128. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1129. * 3. 802.1Q VLAN header: 4 bytes
  1130. * 4. LLC/SNAP header: 8 bytes
  1131. */
  1132. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1133. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1134. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1135. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1136. A_COMPILE_TIME_ASSERT(
  1137. htt_encap_hdr_size_max_check_nwifi,
  1138. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1139. A_COMPILE_TIME_ASSERT(
  1140. htt_encap_hdr_size_max_check_enet,
  1141. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1142. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1143. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1144. #define HTT_TX_HDR_SIZE_802_1Q 4
  1145. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1146. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1147. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1148. HTT_TX_HDR_SIZE_802_1Q + \
  1149. HTT_TX_HDR_SIZE_LLC_SNAP)
  1150. #define HTT_HL_TX_FRM_HDR_LEN \
  1151. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1152. #define HTT_LL_TX_FRM_HDR_LEN \
  1153. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1154. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1155. /* dword 0 */
  1156. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1157. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1158. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1159. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1160. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1161. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1162. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1163. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1164. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1165. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1166. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1167. #define HTT_TX_DESC_PKT_TYPE_S 13
  1168. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1169. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1170. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1171. #define HTT_TX_DESC_VDEV_ID_S 16
  1172. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1173. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1174. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1175. #define HTT_TX_DESC_EXT_TID_S 22
  1176. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1177. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1178. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1179. #define HTT_TX_DESC_POSTPONED_S 27
  1180. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1181. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1182. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1183. #define HTT_TX_DESC_EXTENSION_S 28
  1184. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1185. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1186. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1187. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1188. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1189. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1190. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1191. #define HTT_TX_DESC_TX_COMP_S 31
  1192. /* dword 1 */
  1193. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1194. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1195. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1196. #define HTT_TX_DESC_FRM_LEN_S 0
  1197. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1198. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1199. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1200. #define HTT_TX_DESC_FRM_ID_S 16
  1201. /* dword 2 */
  1202. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1203. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1204. /* for systems using 64-bit format for bus addresses */
  1205. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1206. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1207. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1208. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1209. /* for systems using 32-bit format for bus addresses */
  1210. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1211. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1212. /* dword 3 */
  1213. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1214. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1215. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1216. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1217. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1218. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1219. #if HTT_PADDR64
  1220. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1221. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1222. #else
  1223. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1224. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1225. #endif
  1226. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1227. #define HTT_TX_DESC_PEER_ID_S 0
  1228. /*
  1229. * TEMPORARY:
  1230. * The original definitions for the PEER_ID fields contained typos
  1231. * (with _DESC_PADDR appended to this PEER_ID field name).
  1232. * Retain deprecated original names for PEER_ID fields until all code that
  1233. * refers to them has been updated.
  1234. */
  1235. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1236. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1237. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1238. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1239. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1240. HTT_TX_DESC_PEER_ID_M
  1241. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1242. HTT_TX_DESC_PEER_ID_S
  1243. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1244. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1245. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1246. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1247. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1248. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1249. #if HTT_PADDR64
  1250. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1251. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1252. #else
  1253. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1254. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1255. #endif
  1256. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1257. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1258. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1259. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1260. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1261. do { \
  1262. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1263. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1264. } while (0)
  1265. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1266. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1267. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1268. do { \
  1269. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1270. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1271. } while (0)
  1272. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1273. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1274. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1275. do { \
  1276. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1277. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1278. } while (0)
  1279. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1280. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1281. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1282. do { \
  1283. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1284. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1285. } while (0)
  1286. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1287. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1288. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1289. do { \
  1290. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1291. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1292. } while (0)
  1293. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1294. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1295. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1296. do { \
  1297. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1298. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1299. } while (0)
  1300. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1301. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1302. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1303. do { \
  1304. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1305. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1306. } while (0)
  1307. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1308. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1309. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1312. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1313. } while (0)
  1314. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1315. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1316. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1317. do { \
  1318. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1319. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1320. } while (0)
  1321. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1322. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1323. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1324. do { \
  1325. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1326. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1327. } while (0)
  1328. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1329. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1330. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1331. do { \
  1332. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1333. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1334. } while (0)
  1335. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1336. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1337. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1338. do { \
  1339. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1340. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1341. } while (0)
  1342. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1343. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1344. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1345. do { \
  1346. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1347. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1348. } while (0)
  1349. /* enums used in the HTT tx MSDU extension descriptor */
  1350. enum {
  1351. htt_tx_guard_interval_regular = 0,
  1352. htt_tx_guard_interval_short = 1,
  1353. };
  1354. enum {
  1355. htt_tx_preamble_type_ofdm = 0,
  1356. htt_tx_preamble_type_cck = 1,
  1357. htt_tx_preamble_type_ht = 2,
  1358. htt_tx_preamble_type_vht = 3,
  1359. };
  1360. enum {
  1361. htt_tx_bandwidth_5MHz = 0,
  1362. htt_tx_bandwidth_10MHz = 1,
  1363. htt_tx_bandwidth_20MHz = 2,
  1364. htt_tx_bandwidth_40MHz = 3,
  1365. htt_tx_bandwidth_80MHz = 4,
  1366. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1367. };
  1368. /**
  1369. * @brief HTT tx MSDU extension descriptor
  1370. * @details
  1371. * If the target supports HTT tx MSDU extension descriptors, the host has
  1372. * the option of appending the following struct following the regular
  1373. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1374. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1375. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1376. * tx specs for each frame.
  1377. */
  1378. PREPACK struct htt_tx_msdu_desc_ext_t {
  1379. /* DWORD 0: flags */
  1380. A_UINT32
  1381. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1382. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1383. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1384. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1385. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1386. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1387. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1388. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1389. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1390. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1391. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1392. /* DWORD 1: tx power, tx rate, tx BW */
  1393. A_UINT32
  1394. /* pwr -
  1395. * Specify what power the tx frame needs to be transmitted at.
  1396. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1397. * The value needs to be appropriately sign-extended when extracting
  1398. * the value from the message and storing it in a variable that is
  1399. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1400. * automatically handles this sign-extension.)
  1401. * If the transmission uses multiple tx chains, this power spec is
  1402. * the total transmit power, assuming incoherent combination of
  1403. * per-chain power to produce the total power.
  1404. */
  1405. pwr: 8,
  1406. /* mcs_mask -
  1407. * Specify the allowable values for MCS index (modulation and coding)
  1408. * to use for transmitting the frame.
  1409. *
  1410. * For HT / VHT preamble types, this mask directly corresponds to
  1411. * the HT or VHT MCS indices that are allowed. For each bit N set
  1412. * within the mask, MCS index N is allowed for transmitting the frame.
  1413. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1414. * rates versus OFDM rates, so the host has the option of specifying
  1415. * that the target must transmit the frame with CCK or OFDM rates
  1416. * (not HT or VHT), but leaving the decision to the target whether
  1417. * to use CCK or OFDM.
  1418. *
  1419. * For CCK and OFDM, the bits within this mask are interpreted as
  1420. * follows:
  1421. * bit 0 -> CCK 1 Mbps rate is allowed
  1422. * bit 1 -> CCK 2 Mbps rate is allowed
  1423. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1424. * bit 3 -> CCK 11 Mbps rate is allowed
  1425. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1426. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1427. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1428. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1429. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1430. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1431. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1432. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1433. *
  1434. * The MCS index specification needs to be compatible with the
  1435. * bandwidth mask specification. For example, a MCS index == 9
  1436. * specification is inconsistent with a preamble type == VHT,
  1437. * Nss == 1, and channel bandwidth == 20 MHz.
  1438. *
  1439. * Furthermore, the host has only a limited ability to specify to
  1440. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1441. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1442. */
  1443. mcs_mask: 12,
  1444. /* nss_mask -
  1445. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1446. * Each bit in this mask corresponds to a Nss value:
  1447. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1448. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1449. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1450. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1451. * The values in the Nss mask must be suitable for the recipient, e.g.
  1452. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1453. * recipient which only supports 2x2 MIMO.
  1454. */
  1455. nss_mask: 4,
  1456. /* guard_interval -
  1457. * Specify a htt_tx_guard_interval enum value to indicate whether
  1458. * the transmission should use a regular guard interval or a
  1459. * short guard interval.
  1460. */
  1461. guard_interval: 1,
  1462. /* preamble_type_mask -
  1463. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1464. * may choose from for transmitting this frame.
  1465. * The bits in this mask correspond to the values in the
  1466. * htt_tx_preamble_type enum. For example, to allow the target
  1467. * to transmit the frame as either CCK or OFDM, this field would
  1468. * be set to
  1469. * (1 << htt_tx_preamble_type_ofdm) |
  1470. * (1 << htt_tx_preamble_type_cck)
  1471. */
  1472. preamble_type_mask: 4,
  1473. reserved1_31_29: 3; /* unused, set to 0x0 */
  1474. /* DWORD 2: tx chain mask, tx retries */
  1475. A_UINT32
  1476. /* chain_mask - specify which chains to transmit from */
  1477. chain_mask: 4,
  1478. /* retry_limit -
  1479. * Specify the maximum number of transmissions, including the
  1480. * initial transmission, to attempt before giving up if no ack
  1481. * is received.
  1482. * If the tx rate is specified, then all retries shall use the
  1483. * same rate as the initial transmission.
  1484. * If no tx rate is specified, the target can choose whether to
  1485. * retain the original rate during the retransmissions, or to
  1486. * fall back to a more robust rate.
  1487. */
  1488. retry_limit: 4,
  1489. /* bandwidth_mask -
  1490. * Specify what channel widths may be used for the transmission.
  1491. * A value of zero indicates "don't care" - the target may choose
  1492. * the transmission bandwidth.
  1493. * The bits within this mask correspond to the htt_tx_bandwidth
  1494. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1495. * The bandwidth_mask must be consistent with the preamble_type_mask
  1496. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1497. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1498. */
  1499. bandwidth_mask: 6,
  1500. reserved2_31_14: 18; /* unused, set to 0x0 */
  1501. /* DWORD 3: tx expiry time (TSF) LSBs */
  1502. A_UINT32 expire_tsf_lo;
  1503. /* DWORD 4: tx expiry time (TSF) MSBs */
  1504. A_UINT32 expire_tsf_hi;
  1505. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1506. } POSTPACK;
  1507. /* DWORD 0 */
  1508. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1509. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1510. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1511. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1512. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1514. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1515. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1518. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1519. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1520. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1521. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1522. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1523. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1526. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1528. /* DWORD 1 */
  1529. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1530. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1531. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1532. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1533. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1534. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1535. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1536. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1537. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1538. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1539. /* DWORD 2 */
  1540. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1541. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1542. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1543. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1544. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1545. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1546. /* DWORD 0 */
  1547. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1548. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1549. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1550. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1551. do { \
  1552. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1553. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1554. } while (0)
  1555. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1556. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1557. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1558. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1559. do { \
  1560. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1561. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1562. } while (0)
  1563. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1564. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1565. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1566. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1567. do { \
  1568. HTT_CHECK_SET_VAL( \
  1569. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1570. ((_var) |= ((_val) \
  1571. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1572. } while (0)
  1573. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1574. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1575. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1576. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1577. do { \
  1578. HTT_CHECK_SET_VAL( \
  1579. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1580. ((_var) |= ((_val) \
  1581. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1582. } while (0)
  1583. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1584. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1585. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1586. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1587. do { \
  1588. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1589. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1590. } while (0)
  1591. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1592. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1593. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1594. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1595. do { \
  1596. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1597. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1598. } while (0)
  1599. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1600. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1601. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1602. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1603. do { \
  1604. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1605. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1606. } while (0)
  1607. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1608. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1609. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1610. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1611. do { \
  1612. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1613. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1614. } while (0)
  1615. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1616. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1617. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1618. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1619. do { \
  1620. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1621. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1622. } while (0)
  1623. /* DWORD 1 */
  1624. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1625. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1626. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1627. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1628. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1629. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1630. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1631. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1632. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1633. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1634. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1635. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1636. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1637. do { \
  1638. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1639. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1640. } while (0)
  1641. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1642. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1643. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1644. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1647. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1648. } while (0)
  1649. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1650. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1651. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1652. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1653. do { \
  1654. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1655. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1656. } while (0)
  1657. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1658. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1659. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1660. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1661. do { \
  1662. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1663. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1664. } while (0)
  1665. /* DWORD 2 */
  1666. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1667. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1668. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1669. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1670. do { \
  1671. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1672. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1673. } while (0)
  1674. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1675. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1676. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1677. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1678. do { \
  1679. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1680. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1681. } while (0)
  1682. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1683. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1684. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1685. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1686. do { \
  1687. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1688. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1689. } while (0)
  1690. typedef enum {
  1691. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1692. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1693. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1694. } htt_11ax_ltf_subtype_t;
  1695. typedef enum {
  1696. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1697. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1698. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1699. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1700. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1701. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1702. } htt_tx_ext2_preamble_type_t;
  1703. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1704. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1705. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1706. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1707. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1708. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1709. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1710. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1711. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1712. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1713. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1714. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1715. /**
  1716. * @brief HTT tx MSDU extension descriptor v2
  1717. * @details
  1718. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1719. * is received as tcl_exit_base->host_meta_info in firmware.
  1720. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1721. * are already part of tcl_exit_base.
  1722. */
  1723. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1724. /* DWORD 0: flags */
  1725. A_UINT32
  1726. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1727. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1728. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1729. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1730. valid_retries : 1, /* if set, tx retries spec is valid */
  1731. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1732. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1733. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1734. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1735. valid_key_flags : 1, /* if set, key flags is valid */
  1736. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1737. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1738. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1739. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1740. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1741. 1 = ENCRYPT,
  1742. 2 ~ 3 - Reserved */
  1743. /* retry_limit -
  1744. * Specify the maximum number of transmissions, including the
  1745. * initial transmission, to attempt before giving up if no ack
  1746. * is received.
  1747. * If the tx rate is specified, then all retries shall use the
  1748. * same rate as the initial transmission.
  1749. * If no tx rate is specified, the target can choose whether to
  1750. * retain the original rate during the retransmissions, or to
  1751. * fall back to a more robust rate.
  1752. */
  1753. retry_limit : 4,
  1754. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1755. * Valid only for 11ax preamble types HE_SU
  1756. * and HE_EXT_SU
  1757. */
  1758. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1759. * Valid only for 11ax preamble types HE_SU
  1760. * and HE_EXT_SU
  1761. */
  1762. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1763. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1764. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1765. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1766. */
  1767. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1768. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1769. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1770. * Use cases:
  1771. * Any time firmware uses TQM-BYPASS for Data
  1772. * TID, firmware expect host to set this bit.
  1773. */
  1774. /* DWORD 1: tx power, tx rate */
  1775. A_UINT32
  1776. power : 8, /* unit of the power field is 0.5 dbm
  1777. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1778. * signed value ranging from -64dbm to 63.5 dbm
  1779. */
  1780. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1781. * Setting more than one MCS isn't currently
  1782. * supported by the target (but is supported
  1783. * in the interface in case in the future
  1784. * the target supports specifications of
  1785. * a limited set of MCS values.
  1786. */
  1787. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1788. * Setting more than one Nss isn't currently
  1789. * supported by the target (but is supported
  1790. * in the interface in case in the future
  1791. * the target supports specifications of
  1792. * a limited set of Nss values.
  1793. */
  1794. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1795. update_peer_cache : 1; /* When set these custom values will be
  1796. * used for all packets, until the next
  1797. * update via this ext header.
  1798. * This is to make sure not all packets
  1799. * need to include this header.
  1800. */
  1801. /* DWORD 2: tx chain mask, tx retries */
  1802. A_UINT32
  1803. /* chain_mask - specify which chains to transmit from */
  1804. chain_mask : 8,
  1805. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1806. * TODO: Update Enum values for key_flags
  1807. */
  1808. /*
  1809. * Channel frequency: This identifies the desired channel
  1810. * frequency (in MHz) for tx frames. This is used by FW to help
  1811. * determine when it is safe to transmit or drop frames for
  1812. * off-channel operation.
  1813. * The default value of zero indicates to FW that the corresponding
  1814. * VDEV's home channel (if there is one) is the desired channel
  1815. * frequency.
  1816. */
  1817. chanfreq : 16;
  1818. /* DWORD 3: tx expiry time (TSF) LSBs */
  1819. A_UINT32 expire_tsf_lo;
  1820. /* DWORD 4: tx expiry time (TSF) MSBs */
  1821. A_UINT32 expire_tsf_hi;
  1822. /* DWORD 5: flags to control routing / processing of the MSDU */
  1823. A_UINT32
  1824. /* learning_frame
  1825. * When this flag is set, this frame will be dropped by FW
  1826. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1827. */
  1828. learning_frame : 1,
  1829. /* send_as_standalone
  1830. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1831. * i.e. with no A-MSDU or A-MPDU aggregation.
  1832. * The scope is extended to other use-cases.
  1833. */
  1834. send_as_standalone : 1,
  1835. /* is_host_opaque_valid
  1836. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1837. * with valid information.
  1838. */
  1839. is_host_opaque_valid : 1,
  1840. traffic_end_indication: 1,
  1841. rsvd0 : 28;
  1842. /* DWORD 6 : Host opaque cookie for special frames */
  1843. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1844. rsvd1 : 16;
  1845. /*
  1846. * This structure can be expanded further up to 40 bytes
  1847. * by adding further DWORDs as needed.
  1848. */
  1849. } POSTPACK;
  1850. /* DWORD 0 */
  1851. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1852. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1853. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1854. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1855. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1857. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1877. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1878. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1879. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1880. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1881. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1882. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1883. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1884. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1885. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1886. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1887. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1888. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1889. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1890. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1891. /* DWORD 1 */
  1892. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1893. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1894. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1895. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1896. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1897. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1898. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1899. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1900. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1901. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1902. /* DWORD 2 */
  1903. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1904. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1905. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1906. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1907. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1908. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1909. /* DWORD 5 */
  1910. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1911. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1912. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1913. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1914. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1915. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1916. /* DWORD 6 */
  1917. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1918. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1919. /* DWORD 0 */
  1920. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1921. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1922. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1923. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1924. do { \
  1925. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1926. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1927. } while (0)
  1928. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1929. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1930. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1931. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1932. do { \
  1933. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1934. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1935. } while (0)
  1936. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1937. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1938. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1939. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1940. do { \
  1941. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1942. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1943. } while (0)
  1944. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1945. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1946. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1947. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1948. do { \
  1949. HTT_CHECK_SET_VAL( \
  1950. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1951. ((_var) |= ((_val) \
  1952. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1953. } while (0)
  1954. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1955. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1956. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1957. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1958. do { \
  1959. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1960. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1961. } while (0)
  1962. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1963. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1964. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1965. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1966. do { \
  1967. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1968. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1969. } while (0)
  1970. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1971. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1972. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1973. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1974. do { \
  1975. HTT_CHECK_SET_VAL( \
  1976. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1977. ((_var) |= ((_val) \
  1978. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1979. } while (0)
  1980. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1981. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1982. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1983. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1984. do { \
  1985. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1986. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1987. } while (0)
  1988. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1989. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1990. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1991. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1992. do { \
  1993. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1994. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1995. } while (0)
  1996. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1997. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1998. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1999. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2000. do { \
  2001. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2002. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2003. } while (0)
  2004. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2005. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2006. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2007. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2008. do { \
  2009. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2010. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2011. } while (0)
  2012. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2013. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2014. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2015. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2016. do { \
  2017. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2018. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2019. } while (0)
  2020. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2021. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2022. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2023. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2024. do { \
  2025. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2026. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2027. } while (0)
  2028. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2029. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2030. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2031. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2032. do { \
  2033. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2034. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2035. } while (0)
  2036. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2037. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2038. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2039. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2040. do { \
  2041. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2042. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2043. } while (0)
  2044. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2045. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2046. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2047. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2048. do { \
  2049. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2050. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2051. } while (0)
  2052. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2053. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2054. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2055. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2056. do { \
  2057. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2058. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2059. } while (0)
  2060. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2061. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2062. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2063. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2064. do { \
  2065. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2066. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2067. } while (0)
  2068. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2069. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2070. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2071. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2072. do { \
  2073. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2074. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2075. } while (0)
  2076. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2077. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2078. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2079. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2080. do { \
  2081. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2082. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2083. } while (0)
  2084. /* DWORD 1 */
  2085. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2086. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2087. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2088. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2089. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2090. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2091. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2092. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2093. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2094. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2095. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2096. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2097. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2098. do { \
  2099. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2100. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2101. } while (0)
  2102. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2103. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2104. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2105. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2106. do { \
  2107. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2108. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2109. } while (0)
  2110. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2111. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2112. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2113. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2114. do { \
  2115. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2116. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2117. } while (0)
  2118. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2119. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2120. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2121. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2122. do { \
  2123. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2124. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2125. } while (0)
  2126. /* DWORD 2 */
  2127. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2128. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2129. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2130. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2131. do { \
  2132. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2133. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2134. } while (0)
  2135. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2136. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2137. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2138. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2139. do { \
  2140. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2141. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2142. } while (0)
  2143. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2144. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2145. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2146. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2147. do { \
  2148. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2149. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2150. } while (0)
  2151. /* DWORD 5 */
  2152. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2153. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2154. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2155. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2156. do { \
  2157. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2158. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2159. } while (0)
  2160. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2161. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2162. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2163. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2166. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2167. } while (0)
  2168. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2169. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2170. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2171. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2172. do { \
  2173. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2174. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2175. } while (0)
  2176. /* DWORD 6 */
  2177. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2178. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2179. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2180. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2181. do { \
  2182. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2183. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2184. } while (0)
  2185. typedef enum {
  2186. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2187. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2188. } htt_tcl_metadata_type;
  2189. /**
  2190. * @brief HTT TCL command number format
  2191. * @details
  2192. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2193. * available to firmware as tcl_exit_base->tcl_status_number.
  2194. * For regular / multicast packets host will send vdev and mac id and for
  2195. * NAWDS packets, host will send peer id.
  2196. * A_UINT32 is used to avoid endianness conversion problems.
  2197. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2198. */
  2199. typedef struct {
  2200. A_UINT32
  2201. type: 1, /* vdev_id based or peer_id based */
  2202. rsvd: 31;
  2203. } htt_tx_tcl_vdev_or_peer_t;
  2204. typedef struct {
  2205. A_UINT32
  2206. type: 1, /* vdev_id based or peer_id based */
  2207. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2208. vdev_id: 8,
  2209. pdev_id: 2,
  2210. host_inspected:1,
  2211. rsvd: 19;
  2212. } htt_tx_tcl_vdev_metadata;
  2213. typedef struct {
  2214. A_UINT32
  2215. type: 1, /* vdev_id based or peer_id based */
  2216. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2217. peer_id: 14,
  2218. rsvd: 16;
  2219. } htt_tx_tcl_peer_metadata;
  2220. PREPACK struct htt_tx_tcl_metadata {
  2221. union {
  2222. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2223. htt_tx_tcl_vdev_metadata vdev_meta;
  2224. htt_tx_tcl_peer_metadata peer_meta;
  2225. };
  2226. } POSTPACK;
  2227. /* DWORD 0 */
  2228. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2229. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2230. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2231. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2232. /* VDEV metadata */
  2233. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2234. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2235. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2236. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2237. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2238. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2239. /* PEER metadata */
  2240. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2241. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2242. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2243. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2244. HTT_TX_TCL_METADATA_TYPE_S)
  2245. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2246. do { \
  2247. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2248. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2249. } while (0)
  2250. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2251. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2252. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2253. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2254. do { \
  2255. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2256. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2257. } while (0)
  2258. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2259. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2260. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2261. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2262. do { \
  2263. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2264. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2265. } while (0)
  2266. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2267. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2268. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2269. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2270. do { \
  2271. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2272. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2273. } while (0)
  2274. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2275. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2276. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2277. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2278. do { \
  2279. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2280. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2281. } while (0)
  2282. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2283. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2284. HTT_TX_TCL_METADATA_PEER_ID_S)
  2285. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2286. do { \
  2287. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2288. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2289. } while (0)
  2290. /*------------------------------------------------------------------
  2291. * V2 Version of TCL Data Command
  2292. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2293. * MLO global_seq all flavours of TCL Data Cmd.
  2294. *-----------------------------------------------------------------*/
  2295. typedef enum {
  2296. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2297. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2298. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2299. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2300. } htt_tcl_metadata_type_v2;
  2301. /**
  2302. * @brief HTT TCL command number format
  2303. * @details
  2304. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2305. * available to firmware as tcl_exit_base->tcl_status_number.
  2306. * A_UINT32 is used to avoid endianness conversion problems.
  2307. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2308. */
  2309. typedef struct {
  2310. A_UINT32
  2311. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2312. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2313. vdev_id: 8,
  2314. pdev_id: 2,
  2315. host_inspected:1,
  2316. rsvd: 2,
  2317. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2318. } htt_tx_tcl_vdev_metadata_v2;
  2319. typedef struct {
  2320. A_UINT32
  2321. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2322. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2323. peer_id: 13,
  2324. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2325. } htt_tx_tcl_peer_metadata_v2;
  2326. typedef struct {
  2327. A_UINT32
  2328. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2329. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2330. svc_class_id: 8,
  2331. rsvd: 5,
  2332. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2333. } htt_tx_tcl_svc_class_id_metadata;
  2334. typedef struct {
  2335. A_UINT32
  2336. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2337. host_inspected: 1,
  2338. global_seq_no: 12,
  2339. rsvd: 1,
  2340. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2341. } htt_tx_tcl_global_seq_metadata;
  2342. PREPACK struct htt_tx_tcl_metadata_v2 {
  2343. union {
  2344. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2345. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2346. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2347. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2348. };
  2349. } POSTPACK;
  2350. /* DWORD 0 */
  2351. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2352. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2353. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2354. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2355. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2356. /* VDEV V2 metadata */
  2357. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2358. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2359. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2360. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2361. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2362. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2363. /* PEER V2 metadata */
  2364. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2365. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2366. /* SVC_CLASS_ID metadata */
  2367. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2368. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2369. /* Global Seq no metadata */
  2370. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2371. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2372. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2373. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2374. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2375. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2376. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2377. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2378. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2379. do { \
  2380. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2381. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2382. } while (0)
  2383. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2384. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2385. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2386. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2387. do { \
  2388. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2389. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2390. } while (0)
  2391. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2392. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2393. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2394. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2395. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2396. do { \
  2397. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2398. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2399. } while (0)
  2400. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2401. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2402. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2403. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2404. do { \
  2405. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2406. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2407. } while (0)
  2408. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2409. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2410. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2411. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2412. do { \
  2413. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2414. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2415. } while (0)
  2416. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2417. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2418. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2419. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2420. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2421. do { \
  2422. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2423. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2424. } while (0)
  2425. /*----- Get and Set V2 type field in Service Class fields ----*/
  2426. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2427. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2428. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2429. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2430. do { \
  2431. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2432. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2433. } while (0)
  2434. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2435. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2436. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2437. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2438. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2439. do { \
  2440. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2441. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2442. } while (0)
  2443. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2444. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2445. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2446. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2447. do { \
  2448. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2449. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2450. } while (0)
  2451. /*------------------------------------------------------------------
  2452. * End V2 Version of TCL Data Command
  2453. *-----------------------------------------------------------------*/
  2454. typedef enum {
  2455. HTT_TX_FW2WBM_TX_STATUS_OK,
  2456. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2457. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2458. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2459. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2460. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2461. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2462. HTT_TX_FW2WBM_TX_STATUS_MAX
  2463. } htt_tx_fw2wbm_tx_status_t;
  2464. typedef enum {
  2465. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2466. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2467. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2468. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2469. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2470. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2471. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2472. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2473. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2474. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2475. } htt_tx_fw2wbm_reinject_reason_t;
  2476. /**
  2477. * @brief HTT TX WBM Completion from firmware to host
  2478. * @details
  2479. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2480. * DWORD 3 and 4 for software based completions (Exception frames and
  2481. * TQM bypass frames)
  2482. * For software based completions, wbm_release_ring->release_source_module will
  2483. * be set to release_source_fw
  2484. */
  2485. PREPACK struct htt_tx_wbm_completion {
  2486. A_UINT32
  2487. sch_cmd_id: 24,
  2488. exception_frame: 1, /* If set, this packet was queued via exception path */
  2489. rsvd0_31_25: 7;
  2490. A_UINT32
  2491. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2492. * reception of an ACK or BA, this field indicates
  2493. * the RSSI of the received ACK or BA frame.
  2494. * When the frame is removed as result of a direct
  2495. * remove command from the SW, this field is set
  2496. * to 0x0 (which is never a valid value when real
  2497. * RSSI is available).
  2498. * Units: dB w.r.t noise floor
  2499. */
  2500. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2501. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2502. rsvd1_31_16: 16;
  2503. } POSTPACK;
  2504. /* DWORD 0 */
  2505. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2506. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2507. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2508. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2509. /* DWORD 1 */
  2510. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2511. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2512. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2513. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2514. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2515. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2516. /* DWORD 0 */
  2517. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2518. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2519. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2520. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2521. do { \
  2522. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2523. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2524. } while (0)
  2525. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2526. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2527. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2528. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2529. do { \
  2530. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2531. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2532. } while (0)
  2533. /* DWORD 1 */
  2534. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2535. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2536. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2537. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2538. do { \
  2539. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2540. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2541. } while (0)
  2542. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2543. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2544. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2545. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2546. do { \
  2547. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2548. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2549. } while (0)
  2550. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2551. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2552. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2553. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2554. do { \
  2555. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2556. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2557. } while (0)
  2558. /**
  2559. * @brief HTT TX WBM Completion from firmware to host
  2560. * @details
  2561. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2562. * (WBM) offload HW.
  2563. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2564. * For software based completions, release_source_module will
  2565. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2566. * struct wbm_release_ring and then switch to this after looking at
  2567. * release_source_module.
  2568. */
  2569. PREPACK struct htt_tx_wbm_completion_v2 {
  2570. A_UINT32
  2571. used_by_hw0; /* Refer to struct wbm_release_ring */
  2572. A_UINT32
  2573. used_by_hw1; /* Refer to struct wbm_release_ring */
  2574. A_UINT32
  2575. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2576. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2577. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2578. exception_frame: 1,
  2579. rsvd0: 12, /* For future use */
  2580. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2581. rsvd1: 1; /* For future use */
  2582. A_UINT32
  2583. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2584. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2585. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2586. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2587. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2588. */
  2589. A_UINT32
  2590. data1: 32;
  2591. A_UINT32
  2592. data2: 32;
  2593. A_UINT32
  2594. used_by_hw3; /* Refer to struct wbm_release_ring */
  2595. } POSTPACK;
  2596. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2597. /* DWORD 3 */
  2598. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2599. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2600. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2601. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2602. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2603. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2604. /* DWORD 3 */
  2605. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2606. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2607. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2608. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2609. do { \
  2610. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2611. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2612. } while (0)
  2613. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2614. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2615. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2616. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2617. do { \
  2618. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2619. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2620. } while (0)
  2621. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2622. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2623. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2624. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2625. do { \
  2626. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2627. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2628. } while (0)
  2629. /**
  2630. * @brief HTT TX WBM Completion from firmware to host (V3)
  2631. * @details
  2632. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2633. * (WBM) offload HW.
  2634. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2635. * For software based completions, release_source_module will
  2636. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2637. * struct wbm_release_ring and then switch to this after looking at
  2638. * release_source_module.
  2639. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2640. * by new generations of targets.
  2641. */
  2642. PREPACK struct htt_tx_wbm_completion_v3 {
  2643. A_UINT32
  2644. used_by_hw0; /* Refer to struct wbm_release_ring */
  2645. A_UINT32
  2646. used_by_hw1; /* Refer to struct wbm_release_ring */
  2647. A_UINT32
  2648. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2649. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2650. used_by_hw3: 15;
  2651. A_UINT32
  2652. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2653. exception_frame: 1,
  2654. rsvd0: 27; /* For future use */
  2655. A_UINT32
  2656. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2657. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2658. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2659. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2660. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2661. */
  2662. A_UINT32
  2663. data1: 32;
  2664. A_UINT32
  2665. data2: 32;
  2666. A_UINT32
  2667. rsvd1: 20,
  2668. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2669. } POSTPACK;
  2670. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2671. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2672. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2673. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2674. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2675. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2676. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2677. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2678. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2679. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2680. do { \
  2681. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2682. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2683. } while (0)
  2684. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2685. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2686. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2687. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2688. do { \
  2689. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2690. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2691. } while (0)
  2692. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2693. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2694. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2695. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2696. do { \
  2697. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2698. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2699. } while (0)
  2700. typedef enum {
  2701. TX_FRAME_TYPE_UNDEFINED = 0,
  2702. TX_FRAME_TYPE_EAPOL = 1,
  2703. } htt_tx_wbm_status_frame_type;
  2704. /**
  2705. * @brief HTT TX WBM transmit status from firmware to host
  2706. * @details
  2707. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2708. * (WBM) offload HW.
  2709. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2710. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2711. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2712. */
  2713. PREPACK struct htt_tx_wbm_transmit_status {
  2714. A_UINT32
  2715. sch_cmd_id: 24,
  2716. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2717. * reception of an ACK or BA, this field indicates
  2718. * the RSSI of the received ACK or BA frame.
  2719. * When the frame is removed as result of a direct
  2720. * remove command from the SW, this field is set
  2721. * to 0x0 (which is never a valid value when real
  2722. * RSSI is available).
  2723. * Units: dB w.r.t noise floor
  2724. */
  2725. A_UINT32
  2726. sw_peer_id: 16,
  2727. tid_num: 5,
  2728. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2729. * and tid_num fields contain valid data.
  2730. * If this "valid" flag is not set, the
  2731. * sw_peer_id and tid_num fields must be ignored.
  2732. */
  2733. mcast: 1,
  2734. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2735. * contains valid data.
  2736. */
  2737. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2738. reserved: 4;
  2739. A_UINT32
  2740. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2741. * packets in the wbm completion path
  2742. */
  2743. } POSTPACK;
  2744. /* DWORD 4 */
  2745. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2746. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2747. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2748. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2749. /* DWORD 5 */
  2750. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2751. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2752. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2753. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2754. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2755. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2756. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2757. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2758. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2759. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2760. /* DWORD 4 */
  2761. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2762. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2763. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2764. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2765. do { \
  2766. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2767. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2768. } while (0)
  2769. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2770. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2771. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2772. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2773. do { \
  2774. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2775. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2776. } while (0)
  2777. /* DWORD 5 */
  2778. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2779. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2780. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2781. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2782. do { \
  2783. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2784. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2785. } while (0)
  2786. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2787. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2788. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2789. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2790. do { \
  2791. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2792. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2793. } while (0)
  2794. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2795. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2796. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2797. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2798. do { \
  2799. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2800. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2801. } while (0)
  2802. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2803. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2804. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2805. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2806. do { \
  2807. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2808. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2809. } while (0)
  2810. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2811. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2812. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2813. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2814. do { \
  2815. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2816. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2817. } while (0)
  2818. /**
  2819. * @brief HTT TX WBM reinject status from firmware to host
  2820. * @details
  2821. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2822. * (WBM) offload HW.
  2823. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2824. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2825. */
  2826. PREPACK struct htt_tx_wbm_reinject_status {
  2827. A_UINT32
  2828. reserved0: 32;
  2829. A_UINT32
  2830. reserved1: 32;
  2831. A_UINT32
  2832. reserved2: 32;
  2833. } POSTPACK;
  2834. /**
  2835. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2836. * @details
  2837. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2838. * (WBM) offload HW.
  2839. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2840. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2841. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2842. * STA side.
  2843. */
  2844. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2845. A_UINT32
  2846. mec_sa_addr_31_0;
  2847. A_UINT32
  2848. mec_sa_addr_47_32: 16,
  2849. sa_ast_index: 16;
  2850. A_UINT32
  2851. vdev_id: 8,
  2852. reserved0: 24;
  2853. } POSTPACK;
  2854. /* DWORD 4 - mec_sa_addr_31_0 */
  2855. /* DWORD 5 */
  2856. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2857. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2858. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2859. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2860. /* DWORD 6 */
  2861. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2862. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2863. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2864. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2865. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2866. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2867. do { \
  2868. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2869. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2870. } while (0)
  2871. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2872. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2873. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2874. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2875. do { \
  2876. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2877. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2878. } while (0)
  2879. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2880. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2881. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2882. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2883. do { \
  2884. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2885. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2886. } while (0)
  2887. typedef enum {
  2888. TX_FLOW_PRIORITY_BE,
  2889. TX_FLOW_PRIORITY_HIGH,
  2890. TX_FLOW_PRIORITY_LOW,
  2891. } htt_tx_flow_priority_t;
  2892. typedef enum {
  2893. TX_FLOW_LATENCY_SENSITIVE,
  2894. TX_FLOW_LATENCY_INSENSITIVE,
  2895. } htt_tx_flow_latency_t;
  2896. typedef enum {
  2897. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2898. TX_FLOW_INTERACTIVE_TRAFFIC,
  2899. TX_FLOW_PERIODIC_TRAFFIC,
  2900. TX_FLOW_BURSTY_TRAFFIC,
  2901. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2902. } htt_tx_flow_traffic_pattern_t;
  2903. /**
  2904. * @brief HTT TX Flow search metadata format
  2905. * @details
  2906. * Host will set this metadata in flow table's flow search entry along with
  2907. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2908. * firmware and TQM ring if the flow search entry wins.
  2909. * This metadata is available to firmware in that first MSDU's
  2910. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2911. * to one of the available flows for specific tid and returns the tqm flow
  2912. * pointer as part of htt_tx_map_flow_info message.
  2913. */
  2914. PREPACK struct htt_tx_flow_metadata {
  2915. A_UINT32
  2916. rsvd0_1_0: 2,
  2917. tid: 4,
  2918. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2919. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2920. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2921. * Else choose final tid based on latency, priority.
  2922. */
  2923. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2924. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2925. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2926. } POSTPACK;
  2927. /* DWORD 0 */
  2928. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2929. #define HTT_TX_FLOW_METADATA_TID_S 2
  2930. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2931. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2932. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2933. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2934. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2935. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2936. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2937. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2938. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2939. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2940. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2941. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2942. /* DWORD 0 */
  2943. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2944. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2945. HTT_TX_FLOW_METADATA_TID_S)
  2946. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2947. do { \
  2948. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2949. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2950. } while (0)
  2951. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2952. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2953. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2954. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2955. do { \
  2956. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2957. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2958. } while (0)
  2959. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2960. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2961. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2962. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2963. do { \
  2964. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2965. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2966. } while (0)
  2967. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2968. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2969. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2970. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2971. do { \
  2972. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2973. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2974. } while (0)
  2975. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2976. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2977. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2978. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2979. do { \
  2980. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2981. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2982. } while (0)
  2983. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2984. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2985. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2986. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2987. do { \
  2988. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2989. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2990. } while (0)
  2991. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2992. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2993. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2994. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2995. do { \
  2996. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2997. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2998. } while (0)
  2999. /**
  3000. * @brief host -> target ADD WDS Entry
  3001. *
  3002. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3003. *
  3004. * @brief host -> target DELETE WDS Entry
  3005. *
  3006. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3007. *
  3008. * @details
  3009. * HTT wds entry from source port learning
  3010. * Host will learn wds entries from rx and send this message to firmware
  3011. * to enable firmware to configure/delete AST entries for wds clients.
  3012. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3013. * and when SA's entry is deleted, firmware removes this AST entry
  3014. *
  3015. * The message would appear as follows:
  3016. *
  3017. * |31 30|29 |17 16|15 8|7 0|
  3018. * |----------------+----------------+----------------+----------------|
  3019. * | rsvd0 |PDVID| vdev_id | msg_type |
  3020. * |-------------------------------------------------------------------|
  3021. * | sa_addr_31_0 |
  3022. * |-------------------------------------------------------------------|
  3023. * | | ta_peer_id | sa_addr_47_32 |
  3024. * |-------------------------------------------------------------------|
  3025. * Where PDVID = pdev_id
  3026. *
  3027. * The message is interpreted as follows:
  3028. *
  3029. * dword0 - b'0:7 - msg_type: This will be set to
  3030. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3031. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3032. *
  3033. * dword0 - b'8:15 - vdev_id
  3034. *
  3035. * dword0 - b'16:17 - pdev_id
  3036. *
  3037. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3038. *
  3039. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3040. *
  3041. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3042. *
  3043. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3044. */
  3045. PREPACK struct htt_wds_entry {
  3046. A_UINT32
  3047. msg_type: 8,
  3048. vdev_id: 8,
  3049. pdev_id: 2,
  3050. rsvd0: 14;
  3051. A_UINT32 sa_addr_31_0;
  3052. A_UINT32
  3053. sa_addr_47_32: 16,
  3054. ta_peer_id: 14,
  3055. rsvd2: 2;
  3056. } POSTPACK;
  3057. /* DWORD 0 */
  3058. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3059. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3060. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3061. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3062. /* DWORD 2 */
  3063. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3064. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3065. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3066. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3067. /* DWORD 0 */
  3068. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3069. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3070. HTT_WDS_ENTRY_VDEV_ID_S)
  3071. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3072. do { \
  3073. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3074. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3075. } while (0)
  3076. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3077. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3078. HTT_WDS_ENTRY_PDEV_ID_S)
  3079. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3080. do { \
  3081. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3082. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3083. } while (0)
  3084. /* DWORD 2 */
  3085. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3086. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3087. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3088. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3089. do { \
  3090. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3091. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3092. } while (0)
  3093. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3094. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3095. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3096. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3097. do { \
  3098. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3099. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3100. } while (0)
  3101. /**
  3102. * @brief MAC DMA rx ring setup specification
  3103. *
  3104. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3105. *
  3106. * @details
  3107. * To allow for dynamic rx ring reconfiguration and to avoid race
  3108. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3109. * it uses. Instead, it sends this message to the target, indicating how
  3110. * the rx ring used by the host should be set up and maintained.
  3111. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3112. * specifications.
  3113. *
  3114. * |31 16|15 8|7 0|
  3115. * |---------------------------------------------------------------|
  3116. * header: | reserved | num rings | msg type |
  3117. * |---------------------------------------------------------------|
  3118. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3119. #if HTT_PADDR64
  3120. * | FW_IDX shadow register physical address (bits 63:32) |
  3121. #endif
  3122. * |---------------------------------------------------------------|
  3123. * | rx ring base physical address (bits 31:0) |
  3124. #if HTT_PADDR64
  3125. * | rx ring base physical address (bits 63:32) |
  3126. #endif
  3127. * |---------------------------------------------------------------|
  3128. * | rx ring buffer size | rx ring length |
  3129. * |---------------------------------------------------------------|
  3130. * | FW_IDX initial value | enabled flags |
  3131. * |---------------------------------------------------------------|
  3132. * | MSDU payload offset | 802.11 header offset |
  3133. * |---------------------------------------------------------------|
  3134. * | PPDU end offset | PPDU start offset |
  3135. * |---------------------------------------------------------------|
  3136. * | MPDU end offset | MPDU start offset |
  3137. * |---------------------------------------------------------------|
  3138. * | MSDU end offset | MSDU start offset |
  3139. * |---------------------------------------------------------------|
  3140. * | frag info offset | rx attention offset |
  3141. * |---------------------------------------------------------------|
  3142. * payload 2, if present, has the same format as payload 1
  3143. * Header fields:
  3144. * - MSG_TYPE
  3145. * Bits 7:0
  3146. * Purpose: identifies this as an rx ring configuration message
  3147. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3148. * - NUM_RINGS
  3149. * Bits 15:8
  3150. * Purpose: indicates whether the host is setting up one rx ring or two
  3151. * Value: 1 or 2
  3152. * Payload:
  3153. * for systems using 64-bit format for bus addresses:
  3154. * - IDX_SHADOW_REG_PADDR_LO
  3155. * Bits 31:0
  3156. * Value: lower 4 bytes of physical address of the host's
  3157. * FW_IDX shadow register
  3158. * - IDX_SHADOW_REG_PADDR_HI
  3159. * Bits 31:0
  3160. * Value: upper 4 bytes of physical address of the host's
  3161. * FW_IDX shadow register
  3162. * - RING_BASE_PADDR_LO
  3163. * Bits 31:0
  3164. * Value: lower 4 bytes of physical address of the host's rx ring
  3165. * - RING_BASE_PADDR_HI
  3166. * Bits 31:0
  3167. * Value: uppper 4 bytes of physical address of the host's rx ring
  3168. * for systems using 32-bit format for bus addresses:
  3169. * - IDX_SHADOW_REG_PADDR
  3170. * Bits 31:0
  3171. * Value: physical address of the host's FW_IDX shadow register
  3172. * - RING_BASE_PADDR
  3173. * Bits 31:0
  3174. * Value: physical address of the host's rx ring
  3175. * - RING_LEN
  3176. * Bits 15:0
  3177. * Value: number of elements in the rx ring
  3178. * - RING_BUF_SZ
  3179. * Bits 31:16
  3180. * Value: size of the buffers referenced by the rx ring, in byte units
  3181. * - ENABLED_FLAGS
  3182. * Bits 15:0
  3183. * Value: 1-bit flags to show whether different rx fields are enabled
  3184. * bit 0: 802.11 header enabled (1) or disabled (0)
  3185. * bit 1: MSDU payload enabled (1) or disabled (0)
  3186. * bit 2: PPDU start enabled (1) or disabled (0)
  3187. * bit 3: PPDU end enabled (1) or disabled (0)
  3188. * bit 4: MPDU start enabled (1) or disabled (0)
  3189. * bit 5: MPDU end enabled (1) or disabled (0)
  3190. * bit 6: MSDU start enabled (1) or disabled (0)
  3191. * bit 7: MSDU end enabled (1) or disabled (0)
  3192. * bit 8: rx attention enabled (1) or disabled (0)
  3193. * bit 9: frag info enabled (1) or disabled (0)
  3194. * bit 10: unicast rx enabled (1) or disabled (0)
  3195. * bit 11: multicast rx enabled (1) or disabled (0)
  3196. * bit 12: ctrl rx enabled (1) or disabled (0)
  3197. * bit 13: mgmt rx enabled (1) or disabled (0)
  3198. * bit 14: null rx enabled (1) or disabled (0)
  3199. * bit 15: phy data rx enabled (1) or disabled (0)
  3200. * - IDX_INIT_VAL
  3201. * Bits 31:16
  3202. * Purpose: Specify the initial value for the FW_IDX.
  3203. * Value: the number of buffers initially present in the host's rx ring
  3204. * - OFFSET_802_11_HDR
  3205. * Bits 15:0
  3206. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3207. * - OFFSET_MSDU_PAYLOAD
  3208. * Bits 31:16
  3209. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3210. * - OFFSET_PPDU_START
  3211. * Bits 15:0
  3212. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3213. * - OFFSET_PPDU_END
  3214. * Bits 31:16
  3215. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3216. * - OFFSET_MPDU_START
  3217. * Bits 15:0
  3218. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3219. * - OFFSET_MPDU_END
  3220. * Bits 31:16
  3221. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3222. * - OFFSET_MSDU_START
  3223. * Bits 15:0
  3224. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3225. * - OFFSET_MSDU_END
  3226. * Bits 31:16
  3227. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3228. * - OFFSET_RX_ATTN
  3229. * Bits 15:0
  3230. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3231. * - OFFSET_FRAG_INFO
  3232. * Bits 31:16
  3233. * Value: offset in QUAD-bytes of frag info table
  3234. */
  3235. /* header fields */
  3236. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3237. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3238. /* payload fields */
  3239. /* for systems using a 64-bit format for bus addresses */
  3240. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3241. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3242. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3243. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3244. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3245. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3246. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3247. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3248. /* for systems using a 32-bit format for bus addresses */
  3249. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3250. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3251. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3252. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3253. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3254. #define HTT_RX_RING_CFG_LEN_S 0
  3255. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3256. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3257. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3258. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3259. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3260. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3261. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3262. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3263. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3264. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3265. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3266. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3267. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3268. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3269. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3270. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3271. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3272. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3273. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3274. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3275. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3276. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3277. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3278. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3279. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3280. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3281. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3282. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3283. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3284. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3285. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3286. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3287. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3288. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3289. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3290. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3291. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3292. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3293. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3294. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3295. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3296. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3297. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3298. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3299. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3300. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3301. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3302. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3303. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3304. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3305. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3306. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3307. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3308. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3309. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3310. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3311. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3312. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3313. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3314. #if HTT_PADDR64
  3315. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3316. #else
  3317. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3318. #endif
  3319. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3320. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3321. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3322. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3323. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3324. do { \
  3325. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3326. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3327. } while (0)
  3328. /* degenerate case for 32-bit fields */
  3329. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3330. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3331. ((_var) = (_val))
  3332. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3333. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3334. ((_var) = (_val))
  3335. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3336. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3337. ((_var) = (_val))
  3338. /* degenerate case for 32-bit fields */
  3339. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3340. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3341. ((_var) = (_val))
  3342. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3343. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3344. ((_var) = (_val))
  3345. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3346. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3347. ((_var) = (_val))
  3348. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3349. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3350. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3351. do { \
  3352. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3353. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3354. } while (0)
  3355. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3356. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3357. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3358. do { \
  3359. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3360. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3361. } while (0)
  3362. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3363. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3364. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3365. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3366. do { \
  3367. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3368. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3369. } while (0)
  3370. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3371. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3372. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3373. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3374. do { \
  3375. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3376. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3377. } while (0)
  3378. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3379. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3380. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3381. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3382. do { \
  3383. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3384. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3385. } while (0)
  3386. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3387. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3388. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3389. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3390. do { \
  3391. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3392. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3393. } while (0)
  3394. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3395. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3396. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3397. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3398. do { \
  3399. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3400. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3401. } while (0)
  3402. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3403. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3404. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3405. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3406. do { \
  3407. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3408. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3409. } while (0)
  3410. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3411. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3412. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3413. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3414. do { \
  3415. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3416. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3417. } while (0)
  3418. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3419. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3420. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3421. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3422. do { \
  3423. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3424. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3425. } while (0)
  3426. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3427. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3428. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3429. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3430. do { \
  3431. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3432. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3433. } while (0)
  3434. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3435. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3436. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3437. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3438. do { \
  3439. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3440. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3441. } while (0)
  3442. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3443. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3444. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3445. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3446. do { \
  3447. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3448. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3449. } while (0)
  3450. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3451. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3452. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3453. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3454. do { \
  3455. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3456. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3457. } while (0)
  3458. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3459. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3460. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3461. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3462. do { \
  3463. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3464. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3465. } while (0)
  3466. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3467. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3468. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3469. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3470. do { \
  3471. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3472. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3473. } while (0)
  3474. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3475. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3476. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3477. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3478. do { \
  3479. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3480. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3481. } while (0)
  3482. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3483. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3484. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3485. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3486. do { \
  3487. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3488. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3489. } while (0)
  3490. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3491. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3492. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3493. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3494. do { \
  3495. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3496. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3497. } while (0)
  3498. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3499. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3500. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3501. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3502. do { \
  3503. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3504. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3505. } while (0)
  3506. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3507. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3508. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3509. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3510. do { \
  3511. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3512. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3513. } while (0)
  3514. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3515. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3516. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3517. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3518. do { \
  3519. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3520. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3521. } while (0)
  3522. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3523. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3524. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3525. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3526. do { \
  3527. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3528. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3529. } while (0)
  3530. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3531. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3532. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3533. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3534. do { \
  3535. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3536. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3537. } while (0)
  3538. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3539. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3540. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3541. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3542. do { \
  3543. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3544. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3545. } while (0)
  3546. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3547. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3548. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3549. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3550. do { \
  3551. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3552. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3553. } while (0)
  3554. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3555. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3556. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3557. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3558. do { \
  3559. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3560. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3561. } while (0)
  3562. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3563. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3564. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3565. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3566. do { \
  3567. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3568. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3569. } while (0)
  3570. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3571. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3572. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3573. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3574. do { \
  3575. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3576. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3577. } while (0)
  3578. /**
  3579. * @brief host -> target FW statistics retrieve
  3580. *
  3581. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3582. *
  3583. * @details
  3584. * The following field definitions describe the format of the HTT host
  3585. * to target FW stats retrieve message. The message specifies the type of
  3586. * stats host wants to retrieve.
  3587. *
  3588. * |31 24|23 16|15 8|7 0|
  3589. * |-----------------------------------------------------------|
  3590. * | stats types request bitmask | msg type |
  3591. * |-----------------------------------------------------------|
  3592. * | stats types reset bitmask | reserved |
  3593. * |-----------------------------------------------------------|
  3594. * | stats type | config value |
  3595. * |-----------------------------------------------------------|
  3596. * | cookie LSBs |
  3597. * |-----------------------------------------------------------|
  3598. * | cookie MSBs |
  3599. * |-----------------------------------------------------------|
  3600. * Header fields:
  3601. * - MSG_TYPE
  3602. * Bits 7:0
  3603. * Purpose: identifies this is a stats upload request message
  3604. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3605. * - UPLOAD_TYPES
  3606. * Bits 31:8
  3607. * Purpose: identifies which types of FW statistics to upload
  3608. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3609. * - RESET_TYPES
  3610. * Bits 31:8
  3611. * Purpose: identifies which types of FW statistics to reset
  3612. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3613. * - CFG_VAL
  3614. * Bits 23:0
  3615. * Purpose: give an opaque configuration value to the specified stats type
  3616. * Value: stats-type specific configuration value
  3617. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3618. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3619. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3620. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3621. * - CFG_STAT_TYPE
  3622. * Bits 31:24
  3623. * Purpose: specify which stats type (if any) the config value applies to
  3624. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3625. * a valid configuration specification
  3626. * - COOKIE_LSBS
  3627. * Bits 31:0
  3628. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3629. * message with its preceding host->target stats request message.
  3630. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3631. * - COOKIE_MSBS
  3632. * Bits 31:0
  3633. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3634. * message with its preceding host->target stats request message.
  3635. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3636. */
  3637. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3638. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3639. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3640. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3641. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3642. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3643. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3644. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3645. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3646. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3647. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3648. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3649. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3650. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3651. do { \
  3652. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3653. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3654. } while (0)
  3655. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3656. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3657. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3658. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3659. do { \
  3660. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3661. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3662. } while (0)
  3663. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3664. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3665. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3666. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3667. do { \
  3668. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3669. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3670. } while (0)
  3671. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3672. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3673. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3674. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3675. do { \
  3676. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3677. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3678. } while (0)
  3679. /**
  3680. * @brief host -> target HTT out-of-band sync request
  3681. *
  3682. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3683. *
  3684. * @details
  3685. * The HTT SYNC tells the target to suspend processing of subsequent
  3686. * HTT host-to-target messages until some other target agent locally
  3687. * informs the target HTT FW that the current sync counter is equal to
  3688. * or greater than (in a modulo sense) the sync counter specified in
  3689. * the SYNC message.
  3690. * This allows other host-target components to synchronize their operation
  3691. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3692. * security key has been downloaded to and activated by the target.
  3693. * In the absence of any explicit synchronization counter value
  3694. * specification, the target HTT FW will use zero as the default current
  3695. * sync value.
  3696. *
  3697. * |31 24|23 16|15 8|7 0|
  3698. * |-----------------------------------------------------------|
  3699. * | reserved | sync count | msg type |
  3700. * |-----------------------------------------------------------|
  3701. * Header fields:
  3702. * - MSG_TYPE
  3703. * Bits 7:0
  3704. * Purpose: identifies this as a sync message
  3705. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3706. * - SYNC_COUNT
  3707. * Bits 15:8
  3708. * Purpose: specifies what sync value the HTT FW will wait for from
  3709. * an out-of-band specification to resume its operation
  3710. * Value: in-band sync counter value to compare against the out-of-band
  3711. * counter spec.
  3712. * The HTT target FW will suspend its host->target message processing
  3713. * as long as
  3714. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3715. */
  3716. #define HTT_H2T_SYNC_MSG_SZ 4
  3717. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3718. #define HTT_H2T_SYNC_COUNT_S 8
  3719. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3720. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3721. HTT_H2T_SYNC_COUNT_S)
  3722. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3723. do { \
  3724. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3725. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3726. } while (0)
  3727. /**
  3728. * @brief host -> target HTT aggregation configuration
  3729. *
  3730. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3731. */
  3732. #define HTT_AGGR_CFG_MSG_SZ 4
  3733. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3734. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3735. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3736. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3737. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3738. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3739. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3740. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3741. do { \
  3742. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3743. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3744. } while (0)
  3745. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3746. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3747. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3748. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3749. do { \
  3750. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3751. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3752. } while (0)
  3753. /**
  3754. * @brief host -> target HTT configure max amsdu info per vdev
  3755. *
  3756. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3757. *
  3758. * @details
  3759. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3760. *
  3761. * |31 21|20 16|15 8|7 0|
  3762. * |-----------------------------------------------------------|
  3763. * | reserved | vdev id | max amsdu | msg type |
  3764. * |-----------------------------------------------------------|
  3765. * Header fields:
  3766. * - MSG_TYPE
  3767. * Bits 7:0
  3768. * Purpose: identifies this as a aggr cfg ex message
  3769. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3770. * - MAX_NUM_AMSDU_SUBFRM
  3771. * Bits 15:8
  3772. * Purpose: max MSDUs per A-MSDU
  3773. * - VDEV_ID
  3774. * Bits 20:16
  3775. * Purpose: ID of the vdev to which this limit is applied
  3776. */
  3777. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3778. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3779. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3780. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3781. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3782. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3783. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3784. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3785. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3786. do { \
  3787. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3788. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3789. } while (0)
  3790. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3791. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3792. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3793. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3794. do { \
  3795. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3796. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3797. } while (0)
  3798. /**
  3799. * @brief HTT WDI_IPA Config Message
  3800. *
  3801. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3802. *
  3803. * @details
  3804. * The HTT WDI_IPA config message is created/sent by host at driver
  3805. * init time. It contains information about data structures used on
  3806. * WDI_IPA TX and RX path.
  3807. * TX CE ring is used for pushing packet metadata from IPA uC
  3808. * to WLAN FW
  3809. * TX Completion ring is used for generating TX completions from
  3810. * WLAN FW to IPA uC
  3811. * RX Indication ring is used for indicating RX packets from FW
  3812. * to IPA uC
  3813. * RX Ring2 is used as either completion ring or as second
  3814. * indication ring. when Ring2 is used as completion ring, IPA uC
  3815. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3816. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3817. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3818. * indicated in RX Indication ring. Please see WDI_IPA specification
  3819. * for more details.
  3820. * |31 24|23 16|15 8|7 0|
  3821. * |----------------+----------------+----------------+----------------|
  3822. * | tx pkt pool size | Rsvd | msg_type |
  3823. * |-------------------------------------------------------------------|
  3824. * | tx comp ring base (bits 31:0) |
  3825. #if HTT_PADDR64
  3826. * | tx comp ring base (bits 63:32) |
  3827. #endif
  3828. * |-------------------------------------------------------------------|
  3829. * | tx comp ring size |
  3830. * |-------------------------------------------------------------------|
  3831. * | tx comp WR_IDX physical address (bits 31:0) |
  3832. #if HTT_PADDR64
  3833. * | tx comp WR_IDX physical address (bits 63:32) |
  3834. #endif
  3835. * |-------------------------------------------------------------------|
  3836. * | tx CE WR_IDX physical address (bits 31:0) |
  3837. #if HTT_PADDR64
  3838. * | tx CE WR_IDX physical address (bits 63:32) |
  3839. #endif
  3840. * |-------------------------------------------------------------------|
  3841. * | rx indication ring base (bits 31:0) |
  3842. #if HTT_PADDR64
  3843. * | rx indication ring base (bits 63:32) |
  3844. #endif
  3845. * |-------------------------------------------------------------------|
  3846. * | rx indication ring size |
  3847. * |-------------------------------------------------------------------|
  3848. * | rx ind RD_IDX physical address (bits 31:0) |
  3849. #if HTT_PADDR64
  3850. * | rx ind RD_IDX physical address (bits 63:32) |
  3851. #endif
  3852. * |-------------------------------------------------------------------|
  3853. * | rx ind WR_IDX physical address (bits 31:0) |
  3854. #if HTT_PADDR64
  3855. * | rx ind WR_IDX physical address (bits 63:32) |
  3856. #endif
  3857. * |-------------------------------------------------------------------|
  3858. * |-------------------------------------------------------------------|
  3859. * | rx ring2 base (bits 31:0) |
  3860. #if HTT_PADDR64
  3861. * | rx ring2 base (bits 63:32) |
  3862. #endif
  3863. * |-------------------------------------------------------------------|
  3864. * | rx ring2 size |
  3865. * |-------------------------------------------------------------------|
  3866. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3867. #if HTT_PADDR64
  3868. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3869. #endif
  3870. * |-------------------------------------------------------------------|
  3871. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3872. #if HTT_PADDR64
  3873. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3874. #endif
  3875. * |-------------------------------------------------------------------|
  3876. *
  3877. * Header fields:
  3878. * Header fields:
  3879. * - MSG_TYPE
  3880. * Bits 7:0
  3881. * Purpose: Identifies this as WDI_IPA config message
  3882. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3883. * - TX_PKT_POOL_SIZE
  3884. * Bits 15:0
  3885. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3886. * WDI_IPA TX path
  3887. * For systems using 32-bit format for bus addresses:
  3888. * - TX_COMP_RING_BASE_ADDR
  3889. * Bits 31:0
  3890. * Purpose: TX Completion Ring base address in DDR
  3891. * - TX_COMP_RING_SIZE
  3892. * Bits 31:0
  3893. * Purpose: TX Completion Ring size (must be power of 2)
  3894. * - TX_COMP_WR_IDX_ADDR
  3895. * Bits 31:0
  3896. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3897. * updates the Write Index for WDI_IPA TX completion ring
  3898. * - TX_CE_WR_IDX_ADDR
  3899. * Bits 31:0
  3900. * Purpose: DDR address where IPA uC
  3901. * updates the WR Index for TX CE ring
  3902. * (needed for fusion platforms)
  3903. * - RX_IND_RING_BASE_ADDR
  3904. * Bits 31:0
  3905. * Purpose: RX Indication Ring base address in DDR
  3906. * - RX_IND_RING_SIZE
  3907. * Bits 31:0
  3908. * Purpose: RX Indication Ring size
  3909. * - RX_IND_RD_IDX_ADDR
  3910. * Bits 31:0
  3911. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3912. * RX indication ring
  3913. * - RX_IND_WR_IDX_ADDR
  3914. * Bits 31:0
  3915. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3916. * updates the Write Index for WDI_IPA RX indication ring
  3917. * - RX_RING2_BASE_ADDR
  3918. * Bits 31:0
  3919. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3920. * - RX_RING2_SIZE
  3921. * Bits 31:0
  3922. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3923. * - RX_RING2_RD_IDX_ADDR
  3924. * Bits 31:0
  3925. * Purpose: If Second RX ring is Indication ring, DDR address where
  3926. * IPA uC updates the Read Index for Ring2.
  3927. * If Second RX ring is completion ring, this is NOT used
  3928. * - RX_RING2_WR_IDX_ADDR
  3929. * Bits 31:0
  3930. * Purpose: If Second RX ring is Indication ring, DDR address where
  3931. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3932. * If second RX ring is completion ring, DDR address where
  3933. * IPA uC updates the Write Index for Ring 2.
  3934. * For systems using 64-bit format for bus addresses:
  3935. * - TX_COMP_RING_BASE_ADDR_LO
  3936. * Bits 31:0
  3937. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3938. * - TX_COMP_RING_BASE_ADDR_HI
  3939. * Bits 31:0
  3940. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3941. * - TX_COMP_RING_SIZE
  3942. * Bits 31:0
  3943. * Purpose: TX Completion Ring size (must be power of 2)
  3944. * - TX_COMP_WR_IDX_ADDR_LO
  3945. * Bits 31:0
  3946. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3947. * Lower 4 bytes of DDR address where WIFI FW
  3948. * updates the Write Index for WDI_IPA TX completion ring
  3949. * - TX_COMP_WR_IDX_ADDR_HI
  3950. * Bits 31:0
  3951. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3952. * Higher 4 bytes of DDR address where WIFI FW
  3953. * updates the Write Index for WDI_IPA TX completion ring
  3954. * - TX_CE_WR_IDX_ADDR_LO
  3955. * Bits 31:0
  3956. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3957. * updates the WR Index for TX CE ring
  3958. * (needed for fusion platforms)
  3959. * - TX_CE_WR_IDX_ADDR_HI
  3960. * Bits 31:0
  3961. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3962. * updates the WR Index for TX CE ring
  3963. * (needed for fusion platforms)
  3964. * - RX_IND_RING_BASE_ADDR_LO
  3965. * Bits 31:0
  3966. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3967. * - RX_IND_RING_BASE_ADDR_HI
  3968. * Bits 31:0
  3969. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3970. * - RX_IND_RING_SIZE
  3971. * Bits 31:0
  3972. * Purpose: RX Indication Ring size
  3973. * - RX_IND_RD_IDX_ADDR_LO
  3974. * Bits 31:0
  3975. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3976. * for WDI_IPA RX indication ring
  3977. * - RX_IND_RD_IDX_ADDR_HI
  3978. * Bits 31:0
  3979. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3980. * for WDI_IPA RX indication ring
  3981. * - RX_IND_WR_IDX_ADDR_LO
  3982. * Bits 31:0
  3983. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3984. * Lower 4 bytes of DDR address where WIFI FW
  3985. * updates the Write Index for WDI_IPA RX indication ring
  3986. * - RX_IND_WR_IDX_ADDR_HI
  3987. * Bits 31:0
  3988. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3989. * Higher 4 bytes of DDR address where WIFI FW
  3990. * updates the Write Index for WDI_IPA RX indication ring
  3991. * - RX_RING2_BASE_ADDR_LO
  3992. * Bits 31:0
  3993. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3994. * - RX_RING2_BASE_ADDR_HI
  3995. * Bits 31:0
  3996. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3997. * - RX_RING2_SIZE
  3998. * Bits 31:0
  3999. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4000. * - RX_RING2_RD_IDX_ADDR_LO
  4001. * Bits 31:0
  4002. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4003. * DDR address where IPA uC updates the Read Index for Ring2.
  4004. * If Second RX ring is completion ring, this is NOT used
  4005. * - RX_RING2_RD_IDX_ADDR_HI
  4006. * Bits 31:0
  4007. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4008. * DDR address where IPA uC updates the Read Index for Ring2.
  4009. * If Second RX ring is completion ring, this is NOT used
  4010. * - RX_RING2_WR_IDX_ADDR_LO
  4011. * Bits 31:0
  4012. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4013. * DDR address where WIFI FW updates the Write Index
  4014. * for WDI_IPA RX ring2
  4015. * If second RX ring is completion ring, lower 4 bytes of
  4016. * DDR address where IPA uC updates the Write Index for Ring 2.
  4017. * - RX_RING2_WR_IDX_ADDR_HI
  4018. * Bits 31:0
  4019. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4020. * DDR address where WIFI FW updates the Write Index
  4021. * for WDI_IPA RX ring2
  4022. * If second RX ring is completion ring, higher 4 bytes of
  4023. * DDR address where IPA uC updates the Write Index for Ring 2.
  4024. */
  4025. #if HTT_PADDR64
  4026. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4027. #else
  4028. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4029. #endif
  4030. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4031. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4032. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4033. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4034. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4035. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4036. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4037. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4038. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4039. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4040. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4041. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4042. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4043. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4044. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4045. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4046. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4047. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4048. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4049. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4050. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4051. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4052. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4053. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4054. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4055. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4056. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4057. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4058. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4059. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4060. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4061. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4062. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4063. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4064. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4065. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4066. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4067. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4068. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4069. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4070. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4071. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4072. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4073. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4074. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4075. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4076. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4077. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4078. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4079. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4080. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4081. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4082. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4083. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4084. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4085. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4086. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4087. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4088. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4089. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4090. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4091. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4092. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4093. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4094. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4095. do { \
  4096. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4097. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4098. } while (0)
  4099. /* for systems using 32-bit format for bus addr */
  4100. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4101. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4102. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4103. do { \
  4104. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4105. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4106. } while (0)
  4107. /* for systems using 64-bit format for bus addr */
  4108. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4109. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4110. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4111. do { \
  4112. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4113. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4114. } while (0)
  4115. /* for systems using 64-bit format for bus addr */
  4116. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4117. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4118. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4119. do { \
  4120. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4121. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4122. } while (0)
  4123. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4124. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4125. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4126. do { \
  4127. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4128. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4129. } while (0)
  4130. /* for systems using 32-bit format for bus addr */
  4131. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4132. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4133. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4134. do { \
  4135. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4136. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4137. } while (0)
  4138. /* for systems using 64-bit format for bus addr */
  4139. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4140. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4141. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4142. do { \
  4143. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4144. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4145. } while (0)
  4146. /* for systems using 64-bit format for bus addr */
  4147. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4148. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4149. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4150. do { \
  4151. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4152. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4153. } while (0)
  4154. /* for systems using 32-bit format for bus addr */
  4155. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4156. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4157. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4158. do { \
  4159. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4160. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4161. } while (0)
  4162. /* for systems using 64-bit format for bus addr */
  4163. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4164. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4165. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4166. do { \
  4167. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4168. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4169. } while (0)
  4170. /* for systems using 64-bit format for bus addr */
  4171. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4172. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4173. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4174. do { \
  4175. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4176. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4177. } while (0)
  4178. /* for systems using 32-bit format for bus addr */
  4179. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4180. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4181. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4182. do { \
  4183. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4184. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4185. } while (0)
  4186. /* for systems using 64-bit format for bus addr */
  4187. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4188. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4189. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4190. do { \
  4191. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4192. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4193. } while (0)
  4194. /* for systems using 64-bit format for bus addr */
  4195. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4196. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4197. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4198. do { \
  4199. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4200. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4201. } while (0)
  4202. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4203. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4204. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4205. do { \
  4206. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4207. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4208. } while (0)
  4209. /* for systems using 32-bit format for bus addr */
  4210. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4211. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4212. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4213. do { \
  4214. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4215. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4216. } while (0)
  4217. /* for systems using 64-bit format for bus addr */
  4218. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4219. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4220. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4221. do { \
  4222. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4223. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4224. } while (0)
  4225. /* for systems using 64-bit format for bus addr */
  4226. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4227. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4228. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4229. do { \
  4230. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4231. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4232. } while (0)
  4233. /* for systems using 32-bit format for bus addr */
  4234. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4235. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4236. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4237. do { \
  4238. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4239. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4240. } while (0)
  4241. /* for systems using 64-bit format for bus addr */
  4242. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4243. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4244. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4245. do { \
  4246. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4247. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4248. } while (0)
  4249. /* for systems using 64-bit format for bus addr */
  4250. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4251. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4252. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4253. do { \
  4254. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4255. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4256. } while (0)
  4257. /* for systems using 32-bit format for bus addr */
  4258. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4259. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4260. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4261. do { \
  4262. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4263. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4264. } while (0)
  4265. /* for systems using 64-bit format for bus addr */
  4266. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4267. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4268. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4269. do { \
  4270. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4271. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4272. } while (0)
  4273. /* for systems using 64-bit format for bus addr */
  4274. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4275. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4276. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4277. do { \
  4278. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4279. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4280. } while (0)
  4281. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4282. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4283. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4284. do { \
  4285. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4286. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4287. } while (0)
  4288. /* for systems using 32-bit format for bus addr */
  4289. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4290. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4291. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4292. do { \
  4293. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4294. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4295. } while (0)
  4296. /* for systems using 64-bit format for bus addr */
  4297. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4298. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4299. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4300. do { \
  4301. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4302. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4303. } while (0)
  4304. /* for systems using 64-bit format for bus addr */
  4305. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4306. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4307. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4308. do { \
  4309. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4310. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4311. } while (0)
  4312. /* for systems using 32-bit format for bus addr */
  4313. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4314. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4315. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4316. do { \
  4317. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4318. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4319. } while (0)
  4320. /* for systems using 64-bit format for bus addr */
  4321. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4322. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4323. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4324. do { \
  4325. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4326. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4327. } while (0)
  4328. /* for systems using 64-bit format for bus addr */
  4329. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4330. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4331. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4332. do { \
  4333. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4334. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4335. } while (0)
  4336. /*
  4337. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4338. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4339. * addresses are stored in a XXX-bit field.
  4340. * This macro is used to define both htt_wdi_ipa_config32_t and
  4341. * htt_wdi_ipa_config64_t structs.
  4342. */
  4343. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4344. _paddr__tx_comp_ring_base_addr_, \
  4345. _paddr__tx_comp_wr_idx_addr_, \
  4346. _paddr__tx_ce_wr_idx_addr_, \
  4347. _paddr__rx_ind_ring_base_addr_, \
  4348. _paddr__rx_ind_rd_idx_addr_, \
  4349. _paddr__rx_ind_wr_idx_addr_, \
  4350. _paddr__rx_ring2_base_addr_,\
  4351. _paddr__rx_ring2_rd_idx_addr_,\
  4352. _paddr__rx_ring2_wr_idx_addr_) \
  4353. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4354. { \
  4355. /* DWORD 0: flags and meta-data */ \
  4356. A_UINT32 \
  4357. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4358. reserved: 8, \
  4359. tx_pkt_pool_size: 16;\
  4360. /* DWORD 1 */\
  4361. _paddr__tx_comp_ring_base_addr_;\
  4362. /* DWORD 2 (or 3)*/\
  4363. A_UINT32 tx_comp_ring_size;\
  4364. /* DWORD 3 (or 4)*/\
  4365. _paddr__tx_comp_wr_idx_addr_;\
  4366. /* DWORD 4 (or 6)*/\
  4367. _paddr__tx_ce_wr_idx_addr_;\
  4368. /* DWORD 5 (or 8)*/\
  4369. _paddr__rx_ind_ring_base_addr_;\
  4370. /* DWORD 6 (or 10)*/\
  4371. A_UINT32 rx_ind_ring_size;\
  4372. /* DWORD 7 (or 11)*/\
  4373. _paddr__rx_ind_rd_idx_addr_;\
  4374. /* DWORD 8 (or 13)*/\
  4375. _paddr__rx_ind_wr_idx_addr_;\
  4376. /* DWORD 9 (or 15)*/\
  4377. _paddr__rx_ring2_base_addr_;\
  4378. /* DWORD 10 (or 17) */\
  4379. A_UINT32 rx_ring2_size;\
  4380. /* DWORD 11 (or 18) */\
  4381. _paddr__rx_ring2_rd_idx_addr_;\
  4382. /* DWORD 12 (or 20) */\
  4383. _paddr__rx_ring2_wr_idx_addr_;\
  4384. } POSTPACK
  4385. /* define a htt_wdi_ipa_config32_t type */
  4386. 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));
  4387. /* define a htt_wdi_ipa_config64_t type */
  4388. 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));
  4389. #if HTT_PADDR64
  4390. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4391. #else
  4392. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4393. #endif
  4394. enum htt_wdi_ipa_op_code {
  4395. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4396. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4397. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4398. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4399. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4400. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4401. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4402. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4403. /* keep this last */
  4404. HTT_WDI_IPA_OPCODE_MAX
  4405. };
  4406. /**
  4407. * @brief HTT WDI_IPA Operation Request Message
  4408. *
  4409. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4410. *
  4411. * @details
  4412. * HTT WDI_IPA Operation Request message is sent by host
  4413. * to either suspend or resume WDI_IPA TX or RX path.
  4414. * |31 24|23 16|15 8|7 0|
  4415. * |----------------+----------------+----------------+----------------|
  4416. * | op_code | Rsvd | msg_type |
  4417. * |-------------------------------------------------------------------|
  4418. *
  4419. * Header fields:
  4420. * - MSG_TYPE
  4421. * Bits 7:0
  4422. * Purpose: Identifies this as WDI_IPA Operation Request message
  4423. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4424. * - OP_CODE
  4425. * Bits 31:16
  4426. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4427. * value: = enum htt_wdi_ipa_op_code
  4428. */
  4429. PREPACK struct htt_wdi_ipa_op_request_t
  4430. {
  4431. /* DWORD 0: flags and meta-data */
  4432. A_UINT32
  4433. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4434. reserved: 8,
  4435. op_code: 16;
  4436. } POSTPACK;
  4437. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4438. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4439. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4440. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4441. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4442. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4443. do { \
  4444. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4445. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4446. } while (0)
  4447. /*
  4448. * @brief host -> target HTT_MSI_SETUP message
  4449. *
  4450. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4451. *
  4452. * @details
  4453. * After target is booted up, host can send MSI setup message so that
  4454. * target sets up HW registers based on setup message.
  4455. *
  4456. * The message would appear as follows:
  4457. * |31 24|23 16|15|14 8|7 0|
  4458. * |---------------+-----------------+-----------------+-----------------|
  4459. * | reserved | msi_type | pdev_id | msg_type |
  4460. * |---------------------------------------------------------------------|
  4461. * | msi_addr_lo |
  4462. * |---------------------------------------------------------------------|
  4463. * | msi_addr_hi |
  4464. * |---------------------------------------------------------------------|
  4465. * | msi_data |
  4466. * |---------------------------------------------------------------------|
  4467. *
  4468. * The message is interpreted as follows:
  4469. * dword0 - b'0:7 - msg_type: This will be set to
  4470. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4471. * b'8:15 - pdev_id:
  4472. * 0 (for rings at SOC/UMAC level),
  4473. * 1/2/3 mac id (for rings at LMAC level)
  4474. * b'16:23 - msi_type: identify which msi registers need to be setup
  4475. * more details can be got from enum htt_msi_setup_type
  4476. * b'24:31 - reserved
  4477. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4478. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4479. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4480. */
  4481. PREPACK struct htt_msi_setup_t {
  4482. A_UINT32 msg_type: 8,
  4483. pdev_id: 8,
  4484. msi_type: 8,
  4485. reserved: 8;
  4486. A_UINT32 msi_addr_lo;
  4487. A_UINT32 msi_addr_hi;
  4488. A_UINT32 msi_data;
  4489. } POSTPACK;
  4490. enum htt_msi_setup_type {
  4491. HTT_PPDU_END_MSI_SETUP_TYPE,
  4492. /* Insert new types here*/
  4493. };
  4494. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4495. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4496. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4497. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4498. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4499. HTT_MSI_SETUP_PDEV_ID_S)
  4500. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4501. do { \
  4502. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4503. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4504. } while (0)
  4505. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4506. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4507. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4508. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4509. HTT_MSI_SETUP_MSI_TYPE_S)
  4510. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4511. do { \
  4512. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4513. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4514. } while (0)
  4515. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4516. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4517. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4518. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4519. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4520. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4521. do { \
  4522. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4523. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4524. } while (0)
  4525. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4526. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4527. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4528. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4529. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4530. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4531. do { \
  4532. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4533. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4534. } while (0)
  4535. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4536. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4537. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4538. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4539. HTT_MSI_SETUP_MSI_DATA_S)
  4540. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4541. do { \
  4542. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4543. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4544. } while (0)
  4545. /*
  4546. * @brief host -> target HTT_SRING_SETUP message
  4547. *
  4548. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4549. *
  4550. * @details
  4551. * After target is booted up, Host can send SRING setup message for
  4552. * each host facing LMAC SRING. Target setups up HW registers based
  4553. * on setup message and confirms back to Host if response_required is set.
  4554. * Host should wait for confirmation message before sending new SRING
  4555. * setup message
  4556. *
  4557. * The message would appear as follows:
  4558. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4559. * |--------------- +-----------------+-----------------+-----------------|
  4560. * | ring_type | ring_id | pdev_id | msg_type |
  4561. * |----------------------------------------------------------------------|
  4562. * | ring_base_addr_lo |
  4563. * |----------------------------------------------------------------------|
  4564. * | ring_base_addr_hi |
  4565. * |----------------------------------------------------------------------|
  4566. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4567. * |----------------------------------------------------------------------|
  4568. * | ring_head_offset32_remote_addr_lo |
  4569. * |----------------------------------------------------------------------|
  4570. * | ring_head_offset32_remote_addr_hi |
  4571. * |----------------------------------------------------------------------|
  4572. * | ring_tail_offset32_remote_addr_lo |
  4573. * |----------------------------------------------------------------------|
  4574. * | ring_tail_offset32_remote_addr_hi |
  4575. * |----------------------------------------------------------------------|
  4576. * | ring_msi_addr_lo |
  4577. * |----------------------------------------------------------------------|
  4578. * | ring_msi_addr_hi |
  4579. * |----------------------------------------------------------------------|
  4580. * | ring_msi_data |
  4581. * |----------------------------------------------------------------------|
  4582. * | intr_timer_th |IM| intr_batch_counter_th |
  4583. * |----------------------------------------------------------------------|
  4584. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4585. * |----------------------------------------------------------------------|
  4586. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4587. * |----------------------------------------------------------------------|
  4588. * Where
  4589. * IM = sw_intr_mode
  4590. * RR = response_required
  4591. * PTCF = prefetch_timer_cfg
  4592. * IP = IPA drop flag
  4593. *
  4594. * The message is interpreted as follows:
  4595. * dword0 - b'0:7 - msg_type: This will be set to
  4596. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4597. * b'8:15 - pdev_id:
  4598. * 0 (for rings at SOC/UMAC level),
  4599. * 1/2/3 mac id (for rings at LMAC level)
  4600. * b'16:23 - ring_id: identify which ring is to setup,
  4601. * more details can be got from enum htt_srng_ring_id
  4602. * b'24:31 - ring_type: identify type of host rings,
  4603. * more details can be got from enum htt_srng_ring_type
  4604. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4605. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4606. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4607. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4608. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4609. * SW_TO_HW_RING.
  4610. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4611. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4612. * Lower 32 bits of memory address of the remote variable
  4613. * storing the 4-byte word offset that identifies the head
  4614. * element within the ring.
  4615. * (The head offset variable has type A_UINT32.)
  4616. * Valid for HW_TO_SW and SW_TO_SW rings.
  4617. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4618. * Upper 32 bits of memory address of the remote variable
  4619. * storing the 4-byte word offset that identifies the head
  4620. * element within the ring.
  4621. * (The head offset variable has type A_UINT32.)
  4622. * Valid for HW_TO_SW and SW_TO_SW rings.
  4623. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4624. * Lower 32 bits of memory address of the remote variable
  4625. * storing the 4-byte word offset that identifies the tail
  4626. * element within the ring.
  4627. * (The tail offset variable has type A_UINT32.)
  4628. * Valid for HW_TO_SW and SW_TO_SW rings.
  4629. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4630. * Upper 32 bits of memory address of the remote variable
  4631. * storing the 4-byte word offset that identifies the tail
  4632. * element within the ring.
  4633. * (The tail offset variable has type A_UINT32.)
  4634. * Valid for HW_TO_SW and SW_TO_SW rings.
  4635. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4636. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4637. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4638. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4639. * dword10 - b'0:31 - ring_msi_data: MSI data
  4640. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4641. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4642. * dword11 - b'0:14 - intr_batch_counter_th:
  4643. * batch counter threshold is in units of 4-byte words.
  4644. * HW internally maintains and increments batch count.
  4645. * (see SRING spec for detail description).
  4646. * When batch count reaches threshold value, an interrupt
  4647. * is generated by HW.
  4648. * b'15 - sw_intr_mode:
  4649. * This configuration shall be static.
  4650. * Only programmed at power up.
  4651. * 0: generate pulse style sw interrupts
  4652. * 1: generate level style sw interrupts
  4653. * b'16:31 - intr_timer_th:
  4654. * The timer init value when timer is idle or is
  4655. * initialized to start downcounting.
  4656. * In 8us units (to cover a range of 0 to 524 ms)
  4657. * dword12 - b'0:15 - intr_low_threshold:
  4658. * Used only by Consumer ring to generate ring_sw_int_p.
  4659. * Ring entries low threshold water mark, that is used
  4660. * in combination with the interrupt timer as well as
  4661. * the the clearing of the level interrupt.
  4662. * b'16:18 - prefetch_timer_cfg:
  4663. * Used only by Consumer ring to set timer mode to
  4664. * support Application prefetch handling.
  4665. * The external tail offset/pointer will be updated
  4666. * at following intervals:
  4667. * 3'b000: (Prefetch feature disabled; used only for debug)
  4668. * 3'b001: 1 usec
  4669. * 3'b010: 4 usec
  4670. * 3'b011: 8 usec (default)
  4671. * 3'b100: 16 usec
  4672. * Others: Reserverd
  4673. * b'19 - response_required:
  4674. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4675. * b'20 - ipa_drop_flag:
  4676. Indicates that host will config ipa drop threshold percentage
  4677. * b'21:31 - reserved: reserved for future use
  4678. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4679. * b'8:15 - ipa drop high threshold percentage:
  4680. * b'16:31 - Reserved
  4681. */
  4682. PREPACK struct htt_sring_setup_t {
  4683. A_UINT32 msg_type: 8,
  4684. pdev_id: 8,
  4685. ring_id: 8,
  4686. ring_type: 8;
  4687. A_UINT32 ring_base_addr_lo;
  4688. A_UINT32 ring_base_addr_hi;
  4689. A_UINT32 ring_size: 16,
  4690. ring_entry_size: 8,
  4691. ring_misc_cfg_flag: 8;
  4692. A_UINT32 ring_head_offset32_remote_addr_lo;
  4693. A_UINT32 ring_head_offset32_remote_addr_hi;
  4694. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4695. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4696. A_UINT32 ring_msi_addr_lo;
  4697. A_UINT32 ring_msi_addr_hi;
  4698. A_UINT32 ring_msi_data;
  4699. A_UINT32 intr_batch_counter_th: 15,
  4700. sw_intr_mode: 1,
  4701. intr_timer_th: 16;
  4702. A_UINT32 intr_low_threshold: 16,
  4703. prefetch_timer_cfg: 3,
  4704. response_required: 1,
  4705. ipa_drop_flag: 1,
  4706. reserved1: 11;
  4707. A_UINT32 ipa_drop_low_threshold: 8,
  4708. ipa_drop_high_threshold: 8,
  4709. reserved: 16;
  4710. } POSTPACK;
  4711. enum htt_srng_ring_type {
  4712. HTT_HW_TO_SW_RING = 0,
  4713. HTT_SW_TO_HW_RING,
  4714. HTT_SW_TO_SW_RING,
  4715. /* Insert new ring types above this line */
  4716. };
  4717. enum htt_srng_ring_id {
  4718. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4719. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4720. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4721. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4722. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4723. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4724. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4725. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4726. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4727. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4728. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4729. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4730. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4731. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4732. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4733. /* Add Other SRING which can't be directly configured by host software above this line */
  4734. };
  4735. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4736. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4737. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4738. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4739. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4740. HTT_SRING_SETUP_PDEV_ID_S)
  4741. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4742. do { \
  4743. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4744. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4745. } while (0)
  4746. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4747. #define HTT_SRING_SETUP_RING_ID_S 16
  4748. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4749. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4750. HTT_SRING_SETUP_RING_ID_S)
  4751. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4752. do { \
  4753. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4754. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4755. } while (0)
  4756. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4757. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4758. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4759. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4760. HTT_SRING_SETUP_RING_TYPE_S)
  4761. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4762. do { \
  4763. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4764. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4765. } while (0)
  4766. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4767. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4768. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4769. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4770. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4771. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4772. do { \
  4773. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4774. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4775. } while (0)
  4776. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4777. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4778. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4779. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4780. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4781. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4782. do { \
  4783. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4784. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4785. } while (0)
  4786. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4787. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4788. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4789. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4790. HTT_SRING_SETUP_RING_SIZE_S)
  4791. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4792. do { \
  4793. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4794. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4795. } while (0)
  4796. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4797. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4798. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4799. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4800. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4801. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4802. do { \
  4803. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4804. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4805. } while (0)
  4806. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4807. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4808. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4809. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4810. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4811. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4812. do { \
  4813. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4814. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4815. } while (0)
  4816. /* This control bit is applicable to only Producer, which updates Ring ID field
  4817. * of each descriptor before pushing into the ring.
  4818. * 0: updates ring_id(default)
  4819. * 1: ring_id updating disabled */
  4820. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4821. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4822. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4823. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4824. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4825. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4826. do { \
  4827. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4828. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4829. } while (0)
  4830. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4831. * of each descriptor before pushing into the ring.
  4832. * 0: updates Loopcnt(default)
  4833. * 1: Loopcnt updating disabled */
  4834. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4835. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4836. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4837. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4838. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4839. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4840. do { \
  4841. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4842. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4843. } while (0)
  4844. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4845. * into security_id port of GXI/AXI. */
  4846. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4847. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4848. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4849. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4850. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4851. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4852. do { \
  4853. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4854. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4855. } while (0)
  4856. /* During MSI write operation, SRNG drives value of this register bit into
  4857. * swap bit of GXI/AXI. */
  4858. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4859. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4860. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4861. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4862. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4863. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4864. do { \
  4865. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4866. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4867. } while (0)
  4868. /* During Pointer write operation, SRNG drives value of this register bit into
  4869. * swap bit of GXI/AXI. */
  4870. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4871. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4872. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4873. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4874. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4875. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4876. do { \
  4877. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4878. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4879. } while (0)
  4880. /* During any data or TLV write operation, SRNG drives value of this register
  4881. * bit into swap bit of GXI/AXI. */
  4882. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4883. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4884. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4885. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4886. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4887. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4888. do { \
  4889. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4890. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4891. } while (0)
  4892. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4893. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4894. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4895. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4896. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4897. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4898. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4899. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4900. do { \
  4901. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4902. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4903. } while (0)
  4904. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4905. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4906. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4907. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4908. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4909. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4910. do { \
  4911. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4912. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4913. } while (0)
  4914. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4915. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4916. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4917. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4918. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4919. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4920. do { \
  4921. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4922. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4923. } while (0)
  4924. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4925. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4926. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4927. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4928. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4929. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4930. do { \
  4931. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4932. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4933. } while (0)
  4934. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4935. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4936. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4937. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4938. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4939. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4940. do { \
  4941. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4942. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4943. } while (0)
  4944. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4945. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4946. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4947. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4948. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4949. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4950. do { \
  4951. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4952. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4953. } while (0)
  4954. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4955. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4956. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4957. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4958. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4959. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4960. do { \
  4961. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4962. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4963. } while (0)
  4964. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4965. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4966. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4967. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4968. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4969. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4970. do { \
  4971. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4972. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4973. } while (0)
  4974. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4975. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4976. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4977. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4978. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4979. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4980. do { \
  4981. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4982. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4983. } while (0)
  4984. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4985. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4986. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4987. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4988. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4989. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4990. do { \
  4991. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4992. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4993. } while (0)
  4994. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4995. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4996. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4997. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4998. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4999. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5000. do { \
  5001. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5002. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5003. } while (0)
  5004. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5005. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5006. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5007. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5008. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5009. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5010. do { \
  5011. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5012. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5013. } while (0)
  5014. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5015. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5016. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5017. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5018. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5019. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5020. do { \
  5021. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5022. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5023. } while (0)
  5024. /**
  5025. * @brief host -> target RX ring selection config message
  5026. *
  5027. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5028. *
  5029. * @details
  5030. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5031. * configure RXDMA rings.
  5032. * The configuration is per ring based and includes both packet subtypes
  5033. * and PPDU/MPDU TLVs.
  5034. *
  5035. * The message would appear as follows:
  5036. *
  5037. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5038. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5039. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5040. * |-------------------------------------------------------------------|
  5041. * | rsvd2 | ring_buffer_size |
  5042. * |-------------------------------------------------------------------|
  5043. * | packet_type_enable_flags_0 |
  5044. * |-------------------------------------------------------------------|
  5045. * | packet_type_enable_flags_1 |
  5046. * |-------------------------------------------------------------------|
  5047. * | packet_type_enable_flags_2 |
  5048. * |-------------------------------------------------------------------|
  5049. * | packet_type_enable_flags_3 |
  5050. * |-------------------------------------------------------------------|
  5051. * | tlv_filter_in_flags |
  5052. * |-------------------------------------------------------------------|
  5053. * | rx_header_offset | rx_packet_offset |
  5054. * |-------------------------------------------------------------------|
  5055. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5056. * |-------------------------------------------------------------------|
  5057. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5058. * |-------------------------------------------------------------------|
  5059. * | rsvd3 | rx_attention_offset |
  5060. * |-------------------------------------------------------------------|
  5061. * | rsvd4 | mo| fp| rx_drop_threshold |
  5062. * | |ndp|ndp| |
  5063. * |-------------------------------------------------------------------|
  5064. * Where:
  5065. * PS = pkt_swap
  5066. * SS = status_swap
  5067. * OV = rx_offsets_valid
  5068. * DT = drop_thresh_valid
  5069. * The message is interpreted as follows:
  5070. * dword0 - b'0:7 - msg_type: This will be set to
  5071. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5072. * b'8:15 - pdev_id:
  5073. * 0 (for rings at SOC/UMAC level),
  5074. * 1/2/3 mac id (for rings at LMAC level)
  5075. * b'16:23 - ring_id : Identify the ring to configure.
  5076. * More details can be got from enum htt_srng_ring_id
  5077. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5078. * BUF_RING_CFG_0 defs within HW .h files,
  5079. * e.g. wmac_top_reg_seq_hwioreg.h
  5080. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5081. * BUF_RING_CFG_0 defs within HW .h files,
  5082. * e.g. wmac_top_reg_seq_hwioreg.h
  5083. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5084. * configuration fields are valid
  5085. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5086. * rx_drop_threshold field is valid
  5087. * b'28 - rx_mon_global_en: Enable/Disable global register
  5088. 8 configuration in Rx monitor module.
  5089. * b'29:31 - rsvd1: reserved for future use
  5090. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5091. * in byte units.
  5092. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5093. * b'16:18 - config_length_mgmt (MGMT):
  5094. * Represents the length of mpdu bytes for mgmt pkt.
  5095. * valid values:
  5096. * 001 - 64bytes
  5097. * 010 - 128bytes
  5098. * 100 - 256bytes
  5099. * 111 - Full mpdu bytes
  5100. * b'19:21 - config_length_ctrl (CTRL):
  5101. * Represents the length of mpdu bytes for ctrl pkt.
  5102. * valid values:
  5103. * 001 - 64bytes
  5104. * 010 - 128bytes
  5105. * 100 - 256bytes
  5106. * 111 - Full mpdu bytes
  5107. * b'22:24 - config_length_data (DATA):
  5108. * Represents the length of mpdu bytes for data pkt.
  5109. * valid values:
  5110. * 001 - 64bytes
  5111. * 010 - 128bytes
  5112. * 100 - 256bytes
  5113. * 111 - Full mpdu bytes
  5114. * b'25:26 - rx_hdr_len:
  5115. * Specifies the number of bytes of recvd packet to copy
  5116. * into the rx_hdr tlv.
  5117. * supported values for now by host:
  5118. * 01 - 64bytes
  5119. * 10 - 128bytes
  5120. * 11 - 256bytes
  5121. * default - 128 bytes
  5122. * b'27:31 - rsvd2: Reserved for future use
  5123. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5124. * Enable MGMT packet from 0b0000 to 0b1001
  5125. * bits from low to high: FP, MD, MO - 3 bits
  5126. * FP: Filter_Pass
  5127. * MD: Monitor_Direct
  5128. * MO: Monitor_Other
  5129. * 10 mgmt subtypes * 3 bits -> 30 bits
  5130. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5131. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5132. * Enable MGMT packet from 0b1010 to 0b1111
  5133. * bits from low to high: FP, MD, MO - 3 bits
  5134. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5135. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5136. * Enable CTRL packet from 0b0000 to 0b1001
  5137. * bits from low to high: FP, MD, MO - 3 bits
  5138. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5139. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5140. * Enable CTRL packet from 0b1010 to 0b1111,
  5141. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5142. * bits from low to high: FP, MD, MO - 3 bits
  5143. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5144. * dword6 - b'0:31 - tlv_filter_in_flags:
  5145. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5146. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5147. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5148. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5149. * A value of 0 will be considered as ignore this config.
  5150. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5151. * e.g. wmac_top_reg_seq_hwioreg.h
  5152. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5153. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5154. * A value of 0 will be considered as ignore this config.
  5155. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5156. * e.g. wmac_top_reg_seq_hwioreg.h
  5157. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5158. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5159. * A value of 0 will be considered as ignore this config.
  5160. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5161. * e.g. wmac_top_reg_seq_hwioreg.h
  5162. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5163. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5164. * A value of 0 will be considered as ignore this config.
  5165. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5166. * e.g. wmac_top_reg_seq_hwioreg.h
  5167. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5168. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5169. * A value of 0 will be considered as ignore this config.
  5170. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5171. * e.g. wmac_top_reg_seq_hwioreg.h
  5172. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5173. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5174. * A value of 0 will be considered as ignore this config.
  5175. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5176. * e.g. wmac_top_reg_seq_hwioreg.h
  5177. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5178. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5179. * A value of 0 will be considered as ignore this config.
  5180. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5181. * e.g. wmac_top_reg_seq_hwioreg.h
  5182. * - b'16:31 - rsvd3 for future use
  5183. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5184. * to source rings. Consumer drops packets if the available
  5185. * words in the ring falls below the configured threshold
  5186. * value.
  5187. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5188. * by host. 1 -> subscribed
  5189. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5190. * by host. 1 -> subscribed
  5191. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5192. * subscribed by host. 1 -> subscribed
  5193. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5194. * selection for the FP PHY ERR status tlv.
  5195. * 0 - wbm2rxdma_buf_source_ring
  5196. * 1 - fw2rxdma_buf_source_ring
  5197. * 2 - sw2rxdma_buf_source_ring
  5198. * 3 - no_buffer_ring
  5199. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5200. * selection for the FP PHY ERR status tlv.
  5201. * 0 - rxdma_release_ring
  5202. * 1 - rxdma2fw_ring
  5203. * 2 - rxdma2sw_ring
  5204. * 3 - rxdma2reo_ring
  5205. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5206. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5207. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5208. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5209. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5210. * 0: MSDU level logging
  5211. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5212. * 0: MSDU level logging
  5213. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5214. * 0: MSDU level logging
  5215. * - b'23 - word_mask_compaction: enable/disable word mask for
  5216. * mpdu/msdu start/end tlvs
  5217. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5218. * manager override
  5219. * - b'25:28 - rbm_override_val: return buffer manager override value
  5220. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5221. * which have to be posted to host from phy.
  5222. * Corresponding to errors defined in
  5223. * phyrx_abort_request_reason enums 0 to 31.
  5224. * Refer to RXPCU register definition header files for the
  5225. * phyrx_abort_request_reason enum definition.
  5226. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5227. * errors which have to be posted to host from phy.
  5228. * Corresponding to errors defined in
  5229. * phyrx_abort_request_reason enums 32 to 63.
  5230. * Refer to RXPCU register definition header files for the
  5231. * phyrx_abort_request_reason enum definition.
  5232. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5233. * applicable if word mask enabled
  5234. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5235. * applicable if word mask enabled
  5236. * - b'19:31 - rsvd7
  5237. * dword15- b'0:16 - rx_msdu_end_word_mask
  5238. * - b'17:31 - rsvd5
  5239. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5240. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5241. * buffer
  5242. * 1: RX_PKT TLV logging at specified offset for the
  5243. * subsequent buffer
  5244. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5245. */
  5246. PREPACK struct htt_rx_ring_selection_cfg_t {
  5247. A_UINT32 msg_type: 8,
  5248. pdev_id: 8,
  5249. ring_id: 8,
  5250. status_swap: 1,
  5251. pkt_swap: 1,
  5252. rx_offsets_valid: 1,
  5253. drop_thresh_valid: 1,
  5254. rx_mon_global_en: 1,
  5255. rsvd1: 3;
  5256. A_UINT32 ring_buffer_size: 16,
  5257. config_length_mgmt:3,
  5258. config_length_ctrl:3,
  5259. config_length_data:3,
  5260. rx_hdr_len: 2,
  5261. rsvd2: 5;
  5262. A_UINT32 packet_type_enable_flags_0;
  5263. A_UINT32 packet_type_enable_flags_1;
  5264. A_UINT32 packet_type_enable_flags_2;
  5265. A_UINT32 packet_type_enable_flags_3;
  5266. A_UINT32 tlv_filter_in_flags;
  5267. A_UINT32 rx_packet_offset: 16,
  5268. rx_header_offset: 16;
  5269. A_UINT32 rx_mpdu_end_offset: 16,
  5270. rx_mpdu_start_offset: 16;
  5271. A_UINT32 rx_msdu_end_offset: 16,
  5272. rx_msdu_start_offset: 16;
  5273. A_UINT32 rx_attn_offset: 16,
  5274. rsvd3: 16;
  5275. A_UINT32 rx_drop_threshold: 10,
  5276. fp_ndp: 1,
  5277. mo_ndp: 1,
  5278. fp_phy_err: 1,
  5279. fp_phy_err_buf_src: 2,
  5280. fp_phy_err_buf_dest: 2,
  5281. pkt_type_enable_msdu_or_mpdu_logging:3,
  5282. dma_mpdu_mgmt: 1,
  5283. dma_mpdu_ctrl: 1,
  5284. dma_mpdu_data: 1,
  5285. word_mask_compaction_enable:1,
  5286. rbm_override_enable: 1,
  5287. rbm_override_val: 4,
  5288. rsvd4: 3;
  5289. A_UINT32 phy_err_mask;
  5290. A_UINT32 phy_err_mask_cont;
  5291. A_UINT32 rx_mpdu_start_word_mask:16,
  5292. rx_mpdu_end_word_mask: 3,
  5293. rsvd7: 13;
  5294. A_UINT32 rx_msdu_end_word_mask: 17,
  5295. rsvd5: 15;
  5296. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5297. rx_pkt_tlv_offset: 15,
  5298. rsvd6: 16;
  5299. } POSTPACK;
  5300. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5301. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5302. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5303. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5304. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5305. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5306. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5307. do { \
  5308. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5309. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5310. } while (0)
  5311. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5312. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5313. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5314. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5315. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5316. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5317. do { \
  5318. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5319. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5320. } while (0)
  5321. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5322. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5323. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5324. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5325. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5326. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5327. do { \
  5328. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5329. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5330. } while (0)
  5331. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5332. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5333. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5334. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5335. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5336. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5337. do { \
  5338. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5339. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5340. } while (0)
  5341. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5342. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5343. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5344. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5345. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5346. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5347. do { \
  5348. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5349. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5350. } while (0)
  5351. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5352. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5353. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5354. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5355. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5356. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5357. do { \
  5358. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5359. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5360. } while (0)
  5361. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5362. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5363. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5364. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5365. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5366. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5367. do { \
  5368. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5369. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5370. } while (0)
  5371. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5372. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5373. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5374. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5375. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5376. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5377. do { \
  5378. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5379. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5380. } while (0)
  5381. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5382. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5383. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5384. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5385. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5386. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5387. do { \
  5388. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5389. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5390. } while (0)
  5391. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5392. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5393. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5394. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5395. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5396. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5397. do { \
  5398. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5399. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5400. } while (0)
  5401. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5402. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5403. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5404. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5405. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5406. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5407. do { \
  5408. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5409. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5410. } while (0)
  5411. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5412. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5413. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5414. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5415. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5416. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5417. do { \
  5418. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5419. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5420. } while(0)
  5421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5423. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5424. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5425. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5427. do { \
  5428. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5429. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5430. } while (0)
  5431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5434. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5435. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5437. do { \
  5438. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5439. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5440. } while (0)
  5441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5444. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5445. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5447. do { \
  5448. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5449. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5450. } while (0)
  5451. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5452. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5454. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5455. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5457. do { \
  5458. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5459. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5460. } while (0)
  5461. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5462. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5463. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5464. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5465. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5466. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5467. do { \
  5468. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5469. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5470. } while (0)
  5471. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5472. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5473. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5474. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5475. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5476. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5477. do { \
  5478. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5479. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5480. } while (0)
  5481. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5482. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5483. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5484. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5485. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5486. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5487. do { \
  5488. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5489. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5490. } while (0)
  5491. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5492. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5493. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5494. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5495. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5496. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5497. do { \
  5498. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5499. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5500. } while (0)
  5501. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5502. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5503. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5504. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5505. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5506. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5507. do { \
  5508. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5509. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5510. } while (0)
  5511. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5512. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5513. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5514. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5515. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5516. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5517. do { \
  5518. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5519. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5520. } while (0)
  5521. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5522. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5523. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5524. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5525. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5526. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5527. do { \
  5528. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5529. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5530. } while (0)
  5531. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5532. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5533. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5534. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5535. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5536. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5537. do { \
  5538. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5539. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5540. } while (0)
  5541. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5542. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5543. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5544. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5545. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5546. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5547. do { \
  5548. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5549. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5550. } while (0)
  5551. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5552. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5553. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5554. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5555. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5556. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5557. do { \
  5558. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5559. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5560. } while (0)
  5561. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5562. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5563. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5564. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5565. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5566. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5567. do { \
  5568. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5569. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5570. } while (0)
  5571. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5572. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5573. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5574. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5575. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5576. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5577. do { \
  5578. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5579. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5580. } while (0)
  5581. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5582. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5583. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5584. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5585. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5586. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5587. do { \
  5588. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5589. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5590. } while (0)
  5591. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5592. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5593. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5594. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5595. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5596. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5597. do { \
  5598. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5599. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5600. } while (0)
  5601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5602. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5604. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5605. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5607. do { \
  5608. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5609. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5610. } while (0)
  5611. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5612. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5613. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5614. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5615. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5616. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5617. do { \
  5618. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5619. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5620. } while (0)
  5621. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5622. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5623. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5624. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5625. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5626. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5627. do { \
  5628. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5629. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5630. } while (0)
  5631. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5632. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5633. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5634. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5635. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5636. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5637. do { \
  5638. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5639. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5640. } while (0)
  5641. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5642. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5643. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5644. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5645. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5646. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5647. do { \
  5648. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5649. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5650. } while (0)
  5651. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5652. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5653. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5654. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5655. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5656. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5657. do { \
  5658. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5659. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5660. } while (0)
  5661. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5662. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5663. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5664. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5665. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5666. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5667. do { \
  5668. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5669. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5670. } while (0)
  5671. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5672. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5673. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5674. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5675. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5676. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5677. do { \
  5678. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5679. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5680. } while (0)
  5681. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5682. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5683. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5684. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5685. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5686. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5687. do { \
  5688. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5689. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5690. } while (0)
  5691. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5692. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5693. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5694. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5695. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5696. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5697. do { \
  5698. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5699. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5700. } while (0)
  5701. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5702. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5703. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5704. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5705. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5706. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5707. do { \
  5708. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5709. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5710. } while (0)
  5711. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5712. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5713. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5714. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5715. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5716. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5717. do { \
  5718. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5719. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5720. } while (0)
  5721. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5722. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5723. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5724. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5725. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5726. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5727. do { \
  5728. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5729. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5730. } while (0)
  5731. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5732. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5733. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5734. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5735. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5736. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5737. do { \
  5738. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5739. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5740. } while (0)
  5741. /*
  5742. * Subtype based MGMT frames enable bits.
  5743. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5744. */
  5745. /* association request */
  5746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5752. /* association response */
  5753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5759. /* Reassociation request */
  5760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5766. /* Reassociation response */
  5767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5773. /* Probe request */
  5774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5780. /* Probe response */
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5787. /* Timing Advertisement */
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5794. /* Reserved */
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5801. /* Beacon */
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5808. /* ATIM */
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5815. /* Disassociation */
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5822. /* Authentication */
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5829. /* Deauthentication */
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5836. /* Action */
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5843. /* Action No Ack */
  5844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5850. /* Reserved */
  5851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5857. /*
  5858. * Subtype based CTRL frames enable bits.
  5859. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5860. */
  5861. /* Reserved */
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5868. /* Reserved */
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5875. /* Reserved */
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5882. /* Reserved */
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5889. /* Reserved */
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5896. /* Reserved */
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5903. /* Reserved */
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5910. /* Control Wrapper */
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5917. /* Block Ack Request */
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5924. /* Block Ack*/
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5931. /* PS-POLL */
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5938. /* RTS */
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5945. /* CTS */
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5952. /* ACK */
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5959. /* CF-END */
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5966. /* CF-END + CF-ACK */
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5973. /* Multicast data */
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5980. /* Unicast data */
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5987. /* NULL data */
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5995. do { \
  5996. HTT_CHECK_SET_VAL(httsym, value); \
  5997. (word) |= (value) << httsym##_S; \
  5998. } while (0)
  5999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6000. (((word) & httsym##_M) >> httsym##_S)
  6001. #define htt_rx_ring_pkt_enable_subtype_set( \
  6002. word, flag, mode, type, subtype, val) \
  6003. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6004. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6005. #define htt_rx_ring_pkt_enable_subtype_get( \
  6006. word, flag, mode, type, subtype) \
  6007. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6008. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6009. /* Definition to filter in TLVs */
  6010. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6011. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6012. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6013. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6014. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6021. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6022. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6023. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6024. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6025. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6026. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6027. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6028. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6029. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6030. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6031. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6032. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6033. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6034. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6035. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6036. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6037. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6038. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6039. do { \
  6040. HTT_CHECK_SET_VAL(httsym, enable); \
  6041. (word) |= (enable) << httsym##_S; \
  6042. } while (0)
  6043. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6044. (((word) & httsym##_M) >> httsym##_S)
  6045. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6046. HTT_RX_RING_TLV_ENABLE_SET( \
  6047. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6048. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6049. HTT_RX_RING_TLV_ENABLE_GET( \
  6050. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6051. /**
  6052. * @brief host -> target TX monitor config message
  6053. *
  6054. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6055. *
  6056. * @details
  6057. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6058. * configure RXDMA rings.
  6059. * The configuration is per ring based and includes both packet types
  6060. * and PPDU/MPDU TLVs.
  6061. *
  6062. * The message would appear as follows:
  6063. *
  6064. * |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|
  6065. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6066. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6067. * |-----------+--------+--------+-----+------------------------------------|
  6068. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6069. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6070. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6071. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6072. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6073. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6074. * |------------------------------------------------------------------------|
  6075. * | tlv_filter_mask_in0 |
  6076. * |------------------------------------------------------------------------|
  6077. * | tlv_filter_mask_in1 |
  6078. * |------------------------------------------------------------------------|
  6079. * | tlv_filter_mask_in2 |
  6080. * |------------------------------------------------------------------------|
  6081. * | tlv_filter_mask_in3 |
  6082. * |-----------------+-----------------+---------------------+--------------|
  6083. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6084. * |------------------------------------------------------------------------|
  6085. * | pcu_ppdu_setup_word_mask |
  6086. * |--------------------+--+--+--+-----+---------------------+--------------|
  6087. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6088. * |------------------------------------------------------------------------|
  6089. *
  6090. * Where:
  6091. * PS = pkt_swap
  6092. * SS = status_swap
  6093. * The message is interpreted as follows:
  6094. * dword0 - b'0:7 - msg_type: This will be set to
  6095. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6096. * b'8:15 - pdev_id:
  6097. * 0 (for rings at SOC level),
  6098. * 1/2/3 mac id (for rings at LMAC level)
  6099. * b'16:23 - ring_id : Identify the ring to configure.
  6100. * More details can be got from enum htt_srng_ring_id
  6101. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6102. * BUF_RING_CFG_0 defs within HW .h files,
  6103. * e.g. wmac_top_reg_seq_hwioreg.h
  6104. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6105. * BUF_RING_CFG_0 defs within HW .h files,
  6106. * e.g. wmac_top_reg_seq_hwioreg.h
  6107. * b'26 - tx_mon_global_en: Enable/Disable global register
  6108. * configuration in Tx monitor module.
  6109. * b'27:31 - rsvd1: reserved for future use
  6110. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6111. * in byte units.
  6112. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6113. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6114. * 64, 128, 256.
  6115. * If all 3 bits are set config length is > 256.
  6116. * if val is '0', then ignore this field.
  6117. * b'19:21 - config_length_ctrl(CTRL) for CTRL: 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'22:24 - config_length_data(DATA) for DATA: 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'25:31 - rsvd2: Reserved for future use
  6126. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6127. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6128. * If packet_type_enable_flags is '1' for MGMT type,
  6129. * monitor will ignore this bit and allow this TLV.
  6130. * If packet_type_enable_flags is '0' for MGMT type,
  6131. * monitor will use this bit to enable/disable logging
  6132. * of this TLV.
  6133. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6134. * If packet_type_enable_flags is '1' for CTRL type,
  6135. * monitor will ignore this bit and allow this TLV.
  6136. * If packet_type_enable_flags is '0' for CTRL type,
  6137. * monitor will use this bit to enable/disable logging
  6138. * of this TLV.
  6139. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6140. * If packet_type_enable_flags is '1' for DATA type,
  6141. * monitor will ignore this bit and allow this TLV.
  6142. * If packet_type_enable_flags is '0' for DATA type,
  6143. * monitor will use this bit to enable/disable logging
  6144. * of this TLV.
  6145. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6146. * If packet_type_enable_flags is '1' for MGMT type,
  6147. * monitor will ignore this bit and allow this TLV.
  6148. * If packet_type_enable_flags is '0' for MGMT type,
  6149. * monitor will use this bit to enable/disable logging
  6150. * of this TLV.
  6151. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6152. * If packet_type_enable_flags is '1' for CTRL type,
  6153. * monitor will ignore this bit and allow this TLV.
  6154. * If packet_type_enable_flags is '0' for CTRL type,
  6155. * monitor will use this bit to enable/disable logging
  6156. * of this TLV.
  6157. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6158. * If packet_type_enable_flags is '1' for DATA type,
  6159. * monitor will ignore this bit and allow this TLV.
  6160. * If packet_type_enable_flags is '0' for DATA type,
  6161. * monitor will use this bit to enable/disable logging
  6162. * of this TLV.
  6163. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6164. * If packet_type_enable_flags is '1' for MGMT type,
  6165. * monitor will ignore this bit and allow this TLV.
  6166. * If packet_type_enable_flags is '0' for MGMT type,
  6167. * monitor will use this bit to enable/disable logging
  6168. * of this TLV.
  6169. * If filter_in_TX_MPDU_START = 1 it is recommended
  6170. * to set this bit.
  6171. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6172. * If packet_type_enable_flags is '1' for CTRL type,
  6173. * monitor will ignore this bit and allow this TLV.
  6174. * If packet_type_enable_flags is '0' for CTRL type,
  6175. * monitor will use this bit to enable/disable logging
  6176. * of this TLV.
  6177. * If filter_in_TX_MPDU_START = 1 it is recommended
  6178. * to set this bit.
  6179. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6180. * If packet_type_enable_flags is '1' for DATA type,
  6181. * monitor will ignore this bit and allow this TLV.
  6182. * If packet_type_enable_flags is '0' for DATA type,
  6183. * monitor will use this bit to enable/disable logging
  6184. * of this TLV.
  6185. * If filter_in_TX_MPDU_START = 1 it is recommended
  6186. * to set this bit.
  6187. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6188. * If packet_type_enable_flags is '1' for MGMT type,
  6189. * monitor will ignore this bit and allow this TLV.
  6190. * If packet_type_enable_flags is '0' for MGMT type,
  6191. * monitor will use this bit to enable/disable logging
  6192. * of this TLV.
  6193. * If filter_in_TX_MSDU_START = 1 it is recommended
  6194. * to set this bit.
  6195. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6196. * If packet_type_enable_flags is '1' for CTRL type,
  6197. * monitor will ignore this bit and allow this TLV.
  6198. * If packet_type_enable_flags is '0' for CTRL type,
  6199. * monitor will use this bit to enable/disable logging
  6200. * of this TLV.
  6201. * If filter_in_TX_MSDU_START = 1 it is recommended
  6202. * to set this bit.
  6203. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6204. * If packet_type_enable_flags is '1' for DATA type,
  6205. * monitor will ignore this bit and allow this TLV.
  6206. * If packet_type_enable_flags is '0' for DATA type,
  6207. * monitor will use this bit to enable/disable logging
  6208. * of this TLV.
  6209. * If filter_in_TX_MSDU_START = 1 it is recommended
  6210. * to set this bit.
  6211. * b'15:31 - rsvd3: Reserved for future use
  6212. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6213. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6214. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6215. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6216. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6217. * - b'8:15 - tx_peer_entry_word_mask:
  6218. * - b'16:23 - tx_queue_ext_word_mask:
  6219. * - b'24:31 - tx_msdu_start_word_mask:
  6220. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6221. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6222. * - b'8:15 - rxpcu_user_setup_word_mask:
  6223. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6224. * MGMT, CTRL, DATA
  6225. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6226. * 0 -> MSDU level logging is enabled
  6227. * (valid only if bit is set in
  6228. * pkt_type_enable_msdu_or_mpdu_logging)
  6229. * 1 -> MPDU level logging is enabled
  6230. * (valid only if bit is set in
  6231. * pkt_type_enable_msdu_or_mpdu_logging)
  6232. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6233. * 0 -> MSDU level logging is enabled
  6234. * (valid only if bit is set in
  6235. * pkt_type_enable_msdu_or_mpdu_logging)
  6236. * 1 -> MPDU level logging is enabled
  6237. * (valid only if bit is set in
  6238. * pkt_type_enable_msdu_or_mpdu_logging)
  6239. * - b'21 - dma_mpdu_data(D) : For DATA
  6240. * 0 -> MSDU level logging is enabled
  6241. * (valid only if bit is set in
  6242. * pkt_type_enable_msdu_or_mpdu_logging)
  6243. * 1 -> MPDU level logging is enabled
  6244. * (valid only if bit is set in
  6245. * pkt_type_enable_msdu_or_mpdu_logging)
  6246. * - b'22:31 - rsvd4 for future use
  6247. */
  6248. PREPACK struct htt_tx_monitor_cfg_t {
  6249. A_UINT32 msg_type: 8,
  6250. pdev_id: 8,
  6251. ring_id: 8,
  6252. status_swap: 1,
  6253. pkt_swap: 1,
  6254. tx_mon_global_en: 1,
  6255. rsvd1: 5;
  6256. A_UINT32 ring_buffer_size: 16,
  6257. config_length_mgmt: 3,
  6258. config_length_ctrl: 3,
  6259. config_length_data: 3,
  6260. rsvd2: 7;
  6261. A_UINT32 pkt_type_enable_flags: 3,
  6262. filter_in_tx_mpdu_start_mgmt: 1,
  6263. filter_in_tx_mpdu_start_ctrl: 1,
  6264. filter_in_tx_mpdu_start_data: 1,
  6265. filter_in_tx_msdu_start_mgmt: 1,
  6266. filter_in_tx_msdu_start_ctrl: 1,
  6267. filter_in_tx_msdu_start_data: 1,
  6268. filter_in_tx_mpdu_end_mgmt: 1,
  6269. filter_in_tx_mpdu_end_ctrl: 1,
  6270. filter_in_tx_mpdu_end_data: 1,
  6271. filter_in_tx_msdu_end_mgmt: 1,
  6272. filter_in_tx_msdu_end_ctrl: 1,
  6273. filter_in_tx_msdu_end_data: 1,
  6274. rsvd3: 17;
  6275. A_UINT32 tlv_filter_mask_in0;
  6276. A_UINT32 tlv_filter_mask_in1;
  6277. A_UINT32 tlv_filter_mask_in2;
  6278. A_UINT32 tlv_filter_mask_in3;
  6279. A_UINT32 tx_fes_setup_word_mask: 8,
  6280. tx_peer_entry_word_mask: 8,
  6281. tx_queue_ext_word_mask: 8,
  6282. tx_msdu_start_word_mask: 8;
  6283. A_UINT32 pcu_ppdu_setup_word_mask;
  6284. A_UINT32 tx_mpdu_start_word_mask: 8,
  6285. rxpcu_user_setup_word_mask: 8,
  6286. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6287. dma_mpdu_mgmt: 1,
  6288. dma_mpdu_ctrl: 1,
  6289. dma_mpdu_data: 1,
  6290. rsvd4: 10;
  6291. } POSTPACK;
  6292. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6293. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6294. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6295. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6296. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6297. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6298. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6299. do { \
  6300. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6301. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6302. } while (0)
  6303. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6304. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6305. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6306. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6307. HTT_TX_MONITOR_CFG_RING_ID_S)
  6308. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6309. do { \
  6310. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6311. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6312. } while (0)
  6313. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6314. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6315. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6316. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6317. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6318. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6319. do { \
  6320. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6321. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6322. } while (0)
  6323. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6324. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6325. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6326. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6327. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6328. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6329. do { \
  6330. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6331. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6332. } while (0)
  6333. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6334. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6335. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6336. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6337. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6338. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6339. do { \
  6340. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6341. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6342. } while (0)
  6343. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6344. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6345. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6346. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6347. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6348. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6349. do { \
  6350. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6351. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6352. } while (0)
  6353. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6354. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6355. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6356. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6357. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6358. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6359. do { \
  6360. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6361. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6362. } while (0)
  6363. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6364. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6365. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6366. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6367. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6368. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6369. do { \
  6370. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6371. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6372. } while (0)
  6373. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6374. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6375. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6376. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6377. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6378. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6379. do { \
  6380. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6381. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6382. } while (0)
  6383. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6384. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6385. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6386. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6387. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6388. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6389. do { \
  6390. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6391. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6392. } while (0)
  6393. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6394. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6395. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6396. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6397. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6398. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6399. do { \
  6400. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6401. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6402. } while (0)
  6403. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6404. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6405. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6406. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6407. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6408. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6409. do { \
  6410. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6411. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6412. } while (0)
  6413. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6414. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6415. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6416. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6417. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6418. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6419. do { \
  6420. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6421. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6422. } while (0)
  6423. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6424. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6425. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6426. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6427. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6428. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6429. do { \
  6430. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6431. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6432. } while (0)
  6433. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6434. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6435. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6436. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6437. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6438. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6439. do { \
  6440. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6441. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6442. } while (0)
  6443. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6444. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6445. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6446. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6447. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6448. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6449. do { \
  6450. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6451. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6452. } while (0)
  6453. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6454. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6455. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6456. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6457. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6458. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6459. do { \
  6460. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6461. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6462. } while (0)
  6463. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6464. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6465. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6466. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6467. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6468. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6469. do { \
  6470. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6471. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6472. } while (0)
  6473. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6474. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6475. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6476. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6477. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6478. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6479. do { \
  6480. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6481. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6482. } while (0)
  6483. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6484. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6485. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6486. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6487. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6488. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6489. do { \
  6490. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6491. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6492. } while (0)
  6493. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6494. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6495. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6496. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6497. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6498. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6499. do { \
  6500. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6501. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6502. } while (0)
  6503. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6504. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6505. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6506. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6507. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6508. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6509. do { \
  6510. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6511. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6512. } while (0)
  6513. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6514. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6515. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6516. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6517. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6518. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6519. do { \
  6520. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6521. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6522. } while (0)
  6523. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6524. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6525. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6526. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6527. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6528. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6529. do { \
  6530. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6531. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6532. } while (0)
  6533. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6534. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6535. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6536. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6537. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6538. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6539. do { \
  6540. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6541. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6542. } while (0)
  6543. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6544. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6545. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6546. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6547. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6548. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6549. do { \
  6550. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6551. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6552. } while (0)
  6553. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6554. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6555. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6556. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6557. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6558. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6559. do { \
  6560. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6561. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6562. } while (0)
  6563. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6564. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6565. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6566. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6567. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6568. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6569. do { \
  6570. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6571. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6572. } while (0)
  6573. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6574. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6575. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6576. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6577. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6578. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6579. do { \
  6580. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6581. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6582. } while (0)
  6583. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6584. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6585. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6586. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6587. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6588. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6589. do { \
  6590. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6591. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6592. } while (0)
  6593. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6594. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6595. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6596. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6597. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6598. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6599. do { \
  6600. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6601. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6602. } while (0)
  6603. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6604. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6605. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6606. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6607. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6608. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6609. do { \
  6610. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6611. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6612. } while (0)
  6613. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6614. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6615. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6616. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6617. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6618. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6619. do { \
  6620. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6621. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6622. } while (0)
  6623. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6624. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6625. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6626. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6627. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6628. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6629. do { \
  6630. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6631. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6632. } while (0)
  6633. /*
  6634. * pkt_type_enable_flags
  6635. */
  6636. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6637. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6638. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6639. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6640. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6641. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6642. /*
  6643. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6644. */
  6645. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6646. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6647. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6648. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6649. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6650. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6651. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6652. do { \
  6653. HTT_CHECK_SET_VAL(httsym, value); \
  6654. (word) |= (value) << httsym##_S; \
  6655. } while (0)
  6656. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6657. (((word) & httsym##_M) >> httsym##_S)
  6658. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6659. * type -> MGMT, CTRL, DATA*/
  6660. #define htt_tx_ring_pkt_type_set( \
  6661. word, mode, type, val) \
  6662. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6663. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6664. #define htt_tx_ring_pkt_type_get( \
  6665. word, mode, type) \
  6666. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6667. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6668. /* Definition to filter in TLVs */
  6669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6718. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6719. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6720. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6721. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6722. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6723. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6724. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6725. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6726. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6727. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6728. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6729. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6730. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6733. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6734. do { \
  6735. HTT_CHECK_SET_VAL(httsym, enable); \
  6736. (word) |= (enable) << httsym##_S; \
  6737. } while (0)
  6738. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6739. (((word) & httsym##_M) >> httsym##_S)
  6740. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6741. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6742. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6743. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6744. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6745. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6797. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6798. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6799. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6800. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6801. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6802. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6803. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6804. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6805. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6806. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6807. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6810. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6811. do { \
  6812. HTT_CHECK_SET_VAL(httsym, enable); \
  6813. (word) |= (enable) << httsym##_S; \
  6814. } while (0)
  6815. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6816. (((word) & httsym##_M) >> httsym##_S)
  6817. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6818. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6819. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6820. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6821. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6822. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6873. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6874. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6875. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6876. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6877. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6878. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6879. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6880. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6881. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6882. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6883. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6884. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6887. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6888. do { \
  6889. HTT_CHECK_SET_VAL(httsym, enable); \
  6890. (word) |= (enable) << httsym##_S; \
  6891. } while (0)
  6892. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6893. (((word) & httsym##_M) >> httsym##_S)
  6894. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6895. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6896. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6897. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6898. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6899. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6944. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6945. do { \
  6946. HTT_CHECK_SET_VAL(httsym, enable); \
  6947. (word) |= (enable) << httsym##_S; \
  6948. } while (0)
  6949. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6950. (((word) & httsym##_M) >> httsym##_S)
  6951. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6952. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6953. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6954. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6955. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6956. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6957. /**
  6958. * @brief host --> target Receive Flow Steering configuration message definition
  6959. *
  6960. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6961. *
  6962. * host --> target Receive Flow Steering configuration message definition.
  6963. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6964. * The reason for this is we want RFS to be configured and ready before MAC
  6965. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6966. *
  6967. * |31 24|23 16|15 9|8|7 0|
  6968. * |----------------+----------------+----------------+----------------|
  6969. * | reserved |E| msg type |
  6970. * |-------------------------------------------------------------------|
  6971. * Where E = RFS enable flag
  6972. *
  6973. * The RFS_CONFIG message consists of a single 4-byte word.
  6974. *
  6975. * Header fields:
  6976. * - MSG_TYPE
  6977. * Bits 7:0
  6978. * Purpose: identifies this as a RFS config msg
  6979. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6980. * - RFS_CONFIG
  6981. * Bit 8
  6982. * Purpose: Tells target whether to enable (1) or disable (0)
  6983. * flow steering feature when sending rx indication messages to host
  6984. */
  6985. #define HTT_H2T_RFS_CONFIG_M 0x100
  6986. #define HTT_H2T_RFS_CONFIG_S 8
  6987. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6988. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6989. HTT_H2T_RFS_CONFIG_S)
  6990. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6991. do { \
  6992. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6993. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6994. } while (0)
  6995. #define HTT_RFS_CFG_REQ_BYTES 4
  6996. /**
  6997. * @brief host -> target FW extended statistics request
  6998. *
  6999. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7000. *
  7001. * @details
  7002. * The following field definitions describe the format of the HTT host
  7003. * to target FW extended stats retrieve message.
  7004. * The message specifies the type of stats the host wants to retrieve.
  7005. *
  7006. * |31 24|23 16|15 8|7 0|
  7007. * |-----------------------------------------------------------|
  7008. * | reserved | stats type | pdev_mask | msg type |
  7009. * |-----------------------------------------------------------|
  7010. * | config param [0] |
  7011. * |-----------------------------------------------------------|
  7012. * | config param [1] |
  7013. * |-----------------------------------------------------------|
  7014. * | config param [2] |
  7015. * |-----------------------------------------------------------|
  7016. * | config param [3] |
  7017. * |-----------------------------------------------------------|
  7018. * | reserved |
  7019. * |-----------------------------------------------------------|
  7020. * | cookie LSBs |
  7021. * |-----------------------------------------------------------|
  7022. * | cookie MSBs |
  7023. * |-----------------------------------------------------------|
  7024. * Header fields:
  7025. * - MSG_TYPE
  7026. * Bits 7:0
  7027. * Purpose: identifies this is a extended stats upload request message
  7028. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7029. * - PDEV_MASK
  7030. * Bits 8:15
  7031. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7032. * Value: This is a overloaded field, refer to usage and interpretation of
  7033. * PDEV in interface document.
  7034. * Bit 8 : Reserved for SOC stats
  7035. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7036. * Indicates MACID_MASK in DBS
  7037. * - STATS_TYPE
  7038. * Bits 23:16
  7039. * Purpose: identifies which FW statistics to upload
  7040. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7041. * - Reserved
  7042. * Bits 31:24
  7043. * - CONFIG_PARAM [0]
  7044. * Bits 31:0
  7045. * Purpose: give an opaque configuration value to the specified stats type
  7046. * Value: stats-type specific configuration value
  7047. * Refer to htt_stats.h for interpretation for each stats sub_type
  7048. * - CONFIG_PARAM [1]
  7049. * Bits 31:0
  7050. * Purpose: give an opaque configuration value to the specified stats type
  7051. * Value: stats-type specific configuration value
  7052. * Refer to htt_stats.h for interpretation for each stats sub_type
  7053. * - CONFIG_PARAM [2]
  7054. * Bits 31:0
  7055. * Purpose: give an opaque configuration value to the specified stats type
  7056. * Value: stats-type specific configuration value
  7057. * Refer to htt_stats.h for interpretation for each stats sub_type
  7058. * - CONFIG_PARAM [3]
  7059. * Bits 31:0
  7060. * Purpose: give an opaque configuration value to the specified stats type
  7061. * Value: stats-type specific configuration value
  7062. * Refer to htt_stats.h for interpretation for each stats sub_type
  7063. * - Reserved [31:0] for future use.
  7064. * - COOKIE_LSBS
  7065. * Bits 31:0
  7066. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7067. * message with its preceding host->target stats request message.
  7068. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7069. * - COOKIE_MSBS
  7070. * Bits 31:0
  7071. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7072. * message with its preceding host->target stats request message.
  7073. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7074. */
  7075. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7076. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7077. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7078. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7079. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7080. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7081. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7082. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7083. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7084. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7085. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7086. do { \
  7087. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7088. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7089. } while (0)
  7090. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7091. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7092. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7093. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7094. do { \
  7095. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7096. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7097. } while (0)
  7098. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7099. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7100. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7101. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7102. do { \
  7103. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7104. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7105. } while (0)
  7106. /**
  7107. * @brief host -> target FW streaming statistics request
  7108. *
  7109. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7110. *
  7111. * @details
  7112. * The following field definitions describe the format of the HTT host
  7113. * to target message that requests the target to start or stop producing
  7114. * ongoing stats of the specified type.
  7115. *
  7116. * |31|30 |23 16|15 8|7 0|
  7117. * |-----------------------------------------------------------|
  7118. * |EN| reserved | stats type | reserved | msg type |
  7119. * |-----------------------------------------------------------|
  7120. * | config param [0] |
  7121. * |-----------------------------------------------------------|
  7122. * | config param [1] |
  7123. * |-----------------------------------------------------------|
  7124. * | config param [2] |
  7125. * |-----------------------------------------------------------|
  7126. * | config param [3] |
  7127. * |-----------------------------------------------------------|
  7128. * Where:
  7129. * - EN is an enable/disable flag
  7130. * Header fields:
  7131. * - MSG_TYPE
  7132. * Bits 7:0
  7133. * Purpose: identifies this is a streaming stats upload request message
  7134. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7135. * - STATS_TYPE
  7136. * Bits 23:16
  7137. * Purpose: identifies which FW statistics to upload
  7138. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7139. * Only the htt_dbg_ext_stats_type values identified as streaming
  7140. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7141. * - ENABLE
  7142. * Bit 31
  7143. * Purpose: enable/disable the target's ongoing stats of the specified type
  7144. * Value:
  7145. * 0 - disable ongoing production of the specified stats type
  7146. * 1 - enable ongoing production of the specified stats type
  7147. * - CONFIG_PARAM [0]
  7148. * Bits 31:0
  7149. * Purpose: give an opaque configuration value to the specified stats type
  7150. * Value: stats-type specific configuration value
  7151. * Refer to htt_stats.h for interpretation for each stats sub_type
  7152. * - CONFIG_PARAM [1]
  7153. * Bits 31:0
  7154. * Purpose: give an opaque configuration value to the specified stats type
  7155. * Value: stats-type specific configuration value
  7156. * Refer to htt_stats.h for interpretation for each stats sub_type
  7157. * - CONFIG_PARAM [2]
  7158. * Bits 31:0
  7159. * Purpose: give an opaque configuration value to the specified stats type
  7160. * Value: stats-type specific configuration value
  7161. * Refer to htt_stats.h for interpretation for each stats sub_type
  7162. * - CONFIG_PARAM [3]
  7163. * Bits 31:0
  7164. * Purpose: give an opaque configuration value to the specified stats type
  7165. * Value: stats-type specific configuration value
  7166. * Refer to htt_stats.h for interpretation for each stats sub_type
  7167. */
  7168. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7169. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7170. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7171. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7172. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7173. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7174. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7175. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7176. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7177. do { \
  7178. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7179. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7180. } while (0)
  7181. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7182. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7183. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7184. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7185. do { \
  7186. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7187. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7188. } while (0)
  7189. /**
  7190. * @brief host -> target FW PPDU_STATS request message
  7191. *
  7192. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7193. *
  7194. * @details
  7195. * The following field definitions describe the format of the HTT host
  7196. * to target FW for PPDU_STATS_CFG msg.
  7197. * The message allows the host to configure the PPDU_STATS_IND messages
  7198. * produced by the target.
  7199. *
  7200. * |31 24|23 16|15 8|7 0|
  7201. * |-----------------------------------------------------------|
  7202. * | REQ bit mask | pdev_mask | msg type |
  7203. * |-----------------------------------------------------------|
  7204. * Header fields:
  7205. * - MSG_TYPE
  7206. * Bits 7:0
  7207. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7208. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7209. * - PDEV_MASK
  7210. * Bits 8:15
  7211. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7212. * Value: This is a overloaded field, refer to usage and interpretation of
  7213. * PDEV in interface document.
  7214. * Bit 8 : Reserved for SOC stats
  7215. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7216. * Indicates MACID_MASK in DBS
  7217. * - REQ_TLV_BIT_MASK
  7218. * Bits 16:31
  7219. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7220. * needs to be included in the target's PPDU_STATS_IND messages.
  7221. * Value: refer htt_ppdu_stats_tlv_tag_t
  7222. *
  7223. */
  7224. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7225. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7226. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7227. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7228. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7229. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7230. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7231. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7232. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7233. do { \
  7234. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7235. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7236. } while (0)
  7237. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7238. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7239. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7240. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7241. do { \
  7242. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7243. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7244. } while (0)
  7245. /**
  7246. * @brief Host-->target HTT RX FSE setup message
  7247. *
  7248. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7249. *
  7250. * @details
  7251. * Through this message, the host will provide details of the flow tables
  7252. * in host DDR along with hash keys.
  7253. * This message can be sent per SOC or per PDEV, which is differentiated
  7254. * by pdev id values.
  7255. * The host will allocate flow search table and sends table size,
  7256. * physical DMA address of flow table, and hash keys to firmware to
  7257. * program into the RXOLE FSE HW block.
  7258. *
  7259. * The following field definitions describe the format of the RX FSE setup
  7260. * message sent from the host to target
  7261. *
  7262. * Header fields:
  7263. * dword0 - b'7:0 - msg_type: This will be set to
  7264. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7265. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7266. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7267. * pdev's LMAC ring.
  7268. * b'31:16 - reserved : Reserved for future use
  7269. * dword1 - b'19:0 - number of records: This field indicates the number of
  7270. * entries in the flow table. For example: 8k number of
  7271. * records is equivalent to
  7272. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7273. * b'27:20 - max search: This field specifies the skid length to FSE
  7274. * parser HW module whenever match is not found at the
  7275. * exact index pointed by hash.
  7276. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7277. * Refer htt_ip_da_sa_prefix below for more details.
  7278. * b'31:30 - reserved: Reserved for future use
  7279. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7280. * table allocated by host in DDR
  7281. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7282. * table allocated by host in DDR
  7283. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7284. * entry hashing
  7285. *
  7286. *
  7287. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7288. * |---------------------------------------------------------------|
  7289. * | reserved | pdev_id | MSG_TYPE |
  7290. * |---------------------------------------------------------------|
  7291. * |resvd|IPDSA| max_search | Number of records |
  7292. * |---------------------------------------------------------------|
  7293. * | base address lo |
  7294. * |---------------------------------------------------------------|
  7295. * | base address high |
  7296. * |---------------------------------------------------------------|
  7297. * | toeplitz key 31_0 |
  7298. * |---------------------------------------------------------------|
  7299. * | toeplitz key 63_32 |
  7300. * |---------------------------------------------------------------|
  7301. * | toeplitz key 95_64 |
  7302. * |---------------------------------------------------------------|
  7303. * | toeplitz key 127_96 |
  7304. * |---------------------------------------------------------------|
  7305. * | toeplitz key 159_128 |
  7306. * |---------------------------------------------------------------|
  7307. * | toeplitz key 191_160 |
  7308. * |---------------------------------------------------------------|
  7309. * | toeplitz key 223_192 |
  7310. * |---------------------------------------------------------------|
  7311. * | toeplitz key 255_224 |
  7312. * |---------------------------------------------------------------|
  7313. * | toeplitz key 287_256 |
  7314. * |---------------------------------------------------------------|
  7315. * | reserved | toeplitz key 314_288(26:0 bits) |
  7316. * |---------------------------------------------------------------|
  7317. * where:
  7318. * IPDSA = ip_da_sa
  7319. */
  7320. /**
  7321. * @brief: htt_ip_da_sa_prefix
  7322. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7323. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7324. * documentation per RFC3849
  7325. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7326. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7327. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7328. */
  7329. enum htt_ip_da_sa_prefix {
  7330. HTT_RX_IPV6_20010db8,
  7331. HTT_RX_IPV4_MAPPED_IPV6,
  7332. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7333. HTT_RX_IPV6_64FF9B,
  7334. };
  7335. /**
  7336. * @brief Host-->target HTT RX FISA configure and enable
  7337. *
  7338. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7339. *
  7340. * @details
  7341. * The host will send this command down to configure and enable the FISA
  7342. * operational params.
  7343. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7344. * register.
  7345. * Should configure both the MACs.
  7346. *
  7347. * dword0 - b'7:0 - msg_type:
  7348. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7349. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7350. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7351. * pdev's LMAC ring.
  7352. * b'31:16 - reserved : Reserved for future use
  7353. *
  7354. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7355. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7356. * packets. 1 flow search will be skipped
  7357. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7358. * tcp,udp packets
  7359. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7360. * calculation
  7361. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7362. * calculation
  7363. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7364. * calculation
  7365. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7366. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7367. * length
  7368. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7369. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7370. * length
  7371. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7372. * num jump
  7373. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7374. * num jump
  7375. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7376. * data type switch has happend for MPDU Sequence num jump
  7377. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7378. * for MPDU Sequence num jump
  7379. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7380. * for decrypt errors
  7381. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7382. * while aggregating a msdu
  7383. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7384. * The aggregation is done until (number of MSDUs aggregated
  7385. * < LIMIT + 1)
  7386. * b'31:18 - Reserved
  7387. *
  7388. * fisa_control_value - 32bit value FW can write to register
  7389. *
  7390. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7391. * Threshold value for FISA timeout (units are microseconds).
  7392. * When the global timestamp exceeds this threshold, FISA
  7393. * aggregation will be restarted.
  7394. * A value of 0 means timeout is disabled.
  7395. * Compare the threshold register with timestamp field in
  7396. * flow entry to generate timeout for the flow.
  7397. *
  7398. * |31 18 |17 16|15 8|7 0|
  7399. * |-------------------------------------------------------------|
  7400. * | reserved | pdev_mask | msg type |
  7401. * |-------------------------------------------------------------|
  7402. * | reserved | FISA_CTRL |
  7403. * |-------------------------------------------------------------|
  7404. * | FISA_TIMEOUT_THRESH |
  7405. * |-------------------------------------------------------------|
  7406. */
  7407. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7408. A_UINT32 msg_type:8,
  7409. pdev_id:8,
  7410. reserved0:16;
  7411. /**
  7412. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7413. * [17:0]
  7414. */
  7415. union {
  7416. /*
  7417. * fisa_control_bits structure is deprecated.
  7418. * Please use fisa_control_bits_v2 going forward.
  7419. */
  7420. struct {
  7421. A_UINT32 fisa_enable: 1,
  7422. ipsec_skip_search: 1,
  7423. nontcp_skip_search: 1,
  7424. add_ipv4_fixed_hdr_len: 1,
  7425. add_ipv6_fixed_hdr_len: 1,
  7426. add_tcp_fixed_hdr_len: 1,
  7427. add_udp_hdr_len: 1,
  7428. chksum_cum_ip_len_en: 1,
  7429. disable_tid_check: 1,
  7430. disable_ta_check: 1,
  7431. disable_qos_check: 1,
  7432. disable_raw_check: 1,
  7433. disable_decrypt_err_check: 1,
  7434. disable_msdu_drop_check: 1,
  7435. fisa_aggr_limit: 4,
  7436. reserved: 14;
  7437. } fisa_control_bits;
  7438. struct {
  7439. A_UINT32 fisa_enable: 1,
  7440. fisa_aggr_limit: 4,
  7441. reserved: 27;
  7442. } fisa_control_bits_v2;
  7443. A_UINT32 fisa_control_value;
  7444. } u_fisa_control;
  7445. /**
  7446. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7447. * timeout threshold for aggregation. Unit in usec.
  7448. * [31:0]
  7449. */
  7450. A_UINT32 fisa_timeout_threshold;
  7451. } POSTPACK;
  7452. /* DWord 0: pdev-ID */
  7453. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7454. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7455. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7456. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7457. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7458. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7459. do { \
  7460. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7461. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7462. } while (0)
  7463. /* Dword 1: fisa_control_value fisa config */
  7464. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7465. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7466. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7467. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7468. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7469. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7470. do { \
  7471. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7472. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7473. } while (0)
  7474. /* Dword 1: fisa_control_value ipsec_skip_search */
  7475. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7476. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7477. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7478. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7479. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7480. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7481. do { \
  7482. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7483. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7484. } while (0)
  7485. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7486. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7487. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7488. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7489. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7490. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7491. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7492. do { \
  7493. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7494. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7495. } while (0)
  7496. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7497. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7498. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7499. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7500. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7501. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7502. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7503. do { \
  7504. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7505. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7506. } while (0)
  7507. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7508. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7509. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7510. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7511. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7512. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7513. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7514. do { \
  7515. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7516. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7517. } while (0)
  7518. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7519. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7520. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7521. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7522. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7523. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7524. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7525. do { \
  7526. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7527. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7528. } while (0)
  7529. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7530. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7531. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7532. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7533. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7534. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7535. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7536. do { \
  7537. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7538. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7539. } while (0)
  7540. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7541. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7542. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7543. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7544. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7545. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7546. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7547. do { \
  7548. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7549. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7550. } while (0)
  7551. /* Dword 1: fisa_control_value disable_tid_check */
  7552. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7553. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7554. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7555. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7556. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7557. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7558. do { \
  7559. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7560. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7561. } while (0)
  7562. /* Dword 1: fisa_control_value disable_ta_check */
  7563. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7564. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7565. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7566. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7567. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7568. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7569. do { \
  7570. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7571. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7572. } while (0)
  7573. /* Dword 1: fisa_control_value disable_qos_check */
  7574. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7575. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7576. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7577. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7578. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7579. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7580. do { \
  7581. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7582. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7583. } while (0)
  7584. /* Dword 1: fisa_control_value disable_raw_check */
  7585. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7586. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7587. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7588. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7589. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7590. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7591. do { \
  7592. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7593. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7594. } while (0)
  7595. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7596. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7597. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7598. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7599. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7600. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7601. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7602. do { \
  7603. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7604. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7605. } while (0)
  7606. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7607. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7608. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7609. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7610. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7611. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7612. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7613. do { \
  7614. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7615. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7616. } while (0)
  7617. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7618. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7619. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7620. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7621. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7622. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7623. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7624. do { \
  7625. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7626. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7627. } while (0)
  7628. /* Dword 1: fisa_control_value fisa config */
  7629. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7630. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7631. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7632. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7633. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7634. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7635. do { \
  7636. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7637. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7638. } while (0)
  7639. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7640. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7641. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7642. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7643. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7644. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7645. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7646. do { \
  7647. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7648. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7649. } while (0)
  7650. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7651. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7652. pdev_id:8,
  7653. reserved0:16;
  7654. A_UINT32 num_records:20,
  7655. max_search:8,
  7656. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7657. reserved1:2;
  7658. A_UINT32 base_addr_lo;
  7659. A_UINT32 base_addr_hi;
  7660. A_UINT32 toeplitz31_0;
  7661. A_UINT32 toeplitz63_32;
  7662. A_UINT32 toeplitz95_64;
  7663. A_UINT32 toeplitz127_96;
  7664. A_UINT32 toeplitz159_128;
  7665. A_UINT32 toeplitz191_160;
  7666. A_UINT32 toeplitz223_192;
  7667. A_UINT32 toeplitz255_224;
  7668. A_UINT32 toeplitz287_256;
  7669. A_UINT32 toeplitz314_288:27,
  7670. reserved2:5;
  7671. } POSTPACK;
  7672. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7673. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7674. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7675. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7676. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7677. /* DWORD 0: Pdev ID */
  7678. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7679. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7680. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7681. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7682. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7683. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7684. do { \
  7685. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7686. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7687. } while (0)
  7688. /* DWORD 1:num of records */
  7689. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7690. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7691. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7692. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7693. HTT_RX_FSE_SETUP_NUM_REC_S)
  7694. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7695. do { \
  7696. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7697. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7698. } while (0)
  7699. /* DWORD 1:max_search */
  7700. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7701. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7702. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7703. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7704. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7705. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7706. do { \
  7707. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7708. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7709. } while (0)
  7710. /* DWORD 1:ip_da_sa prefix */
  7711. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7712. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7713. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7714. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7715. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7716. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7717. do { \
  7718. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7719. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7720. } while (0)
  7721. /* DWORD 2: Base Address LO */
  7722. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7723. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7724. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7725. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7726. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7727. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7728. do { \
  7729. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7730. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7731. } while (0)
  7732. /* DWORD 3: Base Address High */
  7733. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7734. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7735. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7736. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7737. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7738. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7739. do { \
  7740. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7741. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7742. } while (0)
  7743. /* DWORD 4-12: Hash Value */
  7744. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7745. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7746. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7747. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7748. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7749. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7750. do { \
  7751. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7752. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7753. } while (0)
  7754. /* DWORD 13: Hash Value 314:288 bits */
  7755. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7756. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7757. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7758. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7759. do { \
  7760. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7761. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7762. } while (0)
  7763. /**
  7764. * @brief Host-->target HTT RX FSE operation message
  7765. *
  7766. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7767. *
  7768. * @details
  7769. * The host will send this Flow Search Engine (FSE) operation message for
  7770. * every flow add/delete operation.
  7771. * The FSE operation includes FSE full cache invalidation or individual entry
  7772. * invalidation.
  7773. * This message can be sent per SOC or per PDEV which is differentiated
  7774. * by pdev id values.
  7775. *
  7776. * |31 16|15 8|7 1|0|
  7777. * |-------------------------------------------------------------|
  7778. * | reserved | pdev_id | MSG_TYPE |
  7779. * |-------------------------------------------------------------|
  7780. * | reserved | operation |I|
  7781. * |-------------------------------------------------------------|
  7782. * | ip_src_addr_31_0 |
  7783. * |-------------------------------------------------------------|
  7784. * | ip_src_addr_63_32 |
  7785. * |-------------------------------------------------------------|
  7786. * | ip_src_addr_95_64 |
  7787. * |-------------------------------------------------------------|
  7788. * | ip_src_addr_127_96 |
  7789. * |-------------------------------------------------------------|
  7790. * | ip_dst_addr_31_0 |
  7791. * |-------------------------------------------------------------|
  7792. * | ip_dst_addr_63_32 |
  7793. * |-------------------------------------------------------------|
  7794. * | ip_dst_addr_95_64 |
  7795. * |-------------------------------------------------------------|
  7796. * | ip_dst_addr_127_96 |
  7797. * |-------------------------------------------------------------|
  7798. * | l4_dst_port | l4_src_port |
  7799. * | (32-bit SPI incase of IPsec) |
  7800. * |-------------------------------------------------------------|
  7801. * | reserved | l4_proto |
  7802. * |-------------------------------------------------------------|
  7803. *
  7804. * where I is 1-bit ipsec_valid.
  7805. *
  7806. * The following field definitions describe the format of the RX FSE operation
  7807. * message sent from the host to target for every add/delete flow entry to flow
  7808. * table.
  7809. *
  7810. * Header fields:
  7811. * dword0 - b'7:0 - msg_type: This will be set to
  7812. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7813. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7814. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7815. * specified pdev's LMAC ring.
  7816. * b'31:16 - reserved : Reserved for future use
  7817. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7818. * (Internet Protocol Security).
  7819. * IPsec describes the framework for providing security at
  7820. * IP layer. IPsec is defined for both versions of IP:
  7821. * IPV4 and IPV6.
  7822. * Please refer to htt_rx_flow_proto enumeration below for
  7823. * more info.
  7824. * ipsec_valid = 1 for IPSEC packets
  7825. * ipsec_valid = 0 for IP Packets
  7826. * b'7:1 - operation: This indicates types of FSE operation.
  7827. * Refer to htt_rx_fse_operation enumeration:
  7828. * 0 - No Cache Invalidation required
  7829. * 1 - Cache invalidate only one entry given by IP
  7830. * src/dest address at DWORD[2:9]
  7831. * 2 - Complete FSE Cache Invalidation
  7832. * 3 - FSE Disable
  7833. * 4 - FSE Enable
  7834. * b'31:8 - reserved: Reserved for future use
  7835. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7836. * for per flow addition/deletion
  7837. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7838. * and the subsequent 3 A_UINT32 will be padding bytes.
  7839. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7840. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7841. * from 0 to 65535 but only 0 to 1023 are designated as
  7842. * well-known ports. Refer to [RFC1700] for more details.
  7843. * This field is valid only if
  7844. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7845. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7846. * range from 0 to 65535 but only 0 to 1023 are designated
  7847. * as well-known ports. Refer to [RFC1700] for more details.
  7848. * This field is valid only if
  7849. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7850. * - SPI (31:0): Security Parameters Index is an
  7851. * identification tag added to the header while using IPsec
  7852. * for tunneling the IP traffici.
  7853. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7854. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7855. * Assigned Internet Protocol Numbers.
  7856. * l4_proto numbers for standard protocol like UDP/TCP
  7857. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7858. * l4_proto = 17 for UDP etc.
  7859. * b'31:8 - reserved: Reserved for future use.
  7860. *
  7861. */
  7862. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7863. A_UINT32 msg_type:8,
  7864. pdev_id:8,
  7865. reserved0:16;
  7866. A_UINT32 ipsec_valid:1,
  7867. operation:7,
  7868. reserved1:24;
  7869. A_UINT32 ip_src_addr_31_0;
  7870. A_UINT32 ip_src_addr_63_32;
  7871. A_UINT32 ip_src_addr_95_64;
  7872. A_UINT32 ip_src_addr_127_96;
  7873. A_UINT32 ip_dest_addr_31_0;
  7874. A_UINT32 ip_dest_addr_63_32;
  7875. A_UINT32 ip_dest_addr_95_64;
  7876. A_UINT32 ip_dest_addr_127_96;
  7877. union {
  7878. A_UINT32 spi;
  7879. struct {
  7880. A_UINT32 l4_src_port:16,
  7881. l4_dest_port:16;
  7882. } ip;
  7883. } u;
  7884. A_UINT32 l4_proto:8,
  7885. reserved:24;
  7886. } POSTPACK;
  7887. /**
  7888. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7889. *
  7890. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7891. *
  7892. * @details
  7893. * The host will send this Full monitor mode register configuration message.
  7894. * This message can be sent per SOC or per PDEV which is differentiated
  7895. * by pdev id values.
  7896. *
  7897. * |31 16|15 11|10 8|7 3|2|1|0|
  7898. * |-------------------------------------------------------------|
  7899. * | reserved | pdev_id | MSG_TYPE |
  7900. * |-------------------------------------------------------------|
  7901. * | reserved |Release Ring |N|Z|E|
  7902. * |-------------------------------------------------------------|
  7903. *
  7904. * where E is 1-bit full monitor mode enable/disable.
  7905. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7906. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7907. *
  7908. * The following field definitions describe the format of the full monitor
  7909. * mode configuration message sent from the host to target for each pdev.
  7910. *
  7911. * Header fields:
  7912. * dword0 - b'7:0 - msg_type: This will be set to
  7913. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7914. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7915. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7916. * specified pdev's LMAC ring.
  7917. * b'31:16 - reserved : Reserved for future use.
  7918. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7919. * monitor mode rxdma register is to be enabled or disabled.
  7920. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7921. * additional descriptors at ppdu end for zero mpdus
  7922. * enabled or disabled.
  7923. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7924. * additional descriptors at ppdu end for non zero mpdus
  7925. * enabled or disabled.
  7926. * b'10:3 - release_ring: This indicates the destination ring
  7927. * selection for the descriptor at the end of PPDU
  7928. * 0 - REO ring select
  7929. * 1 - FW ring select
  7930. * 2 - SW ring select
  7931. * 3 - Release ring select
  7932. * Refer to htt_rx_full_mon_release_ring.
  7933. * b'31:11 - reserved for future use
  7934. */
  7935. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7936. A_UINT32 msg_type:8,
  7937. pdev_id:8,
  7938. reserved0:16;
  7939. A_UINT32 full_monitor_mode_enable:1,
  7940. addnl_descs_zero_mpdus_end:1,
  7941. addnl_descs_non_zero_mpdus_end:1,
  7942. release_ring:8,
  7943. reserved1:21;
  7944. } POSTPACK;
  7945. /**
  7946. * Enumeration for full monitor mode destination ring select
  7947. * 0 - REO destination ring select
  7948. * 1 - FW destination ring select
  7949. * 2 - SW destination ring select
  7950. * 3 - Release destination ring select
  7951. */
  7952. enum htt_rx_full_mon_release_ring {
  7953. HTT_RX_MON_RING_REO,
  7954. HTT_RX_MON_RING_FW,
  7955. HTT_RX_MON_RING_SW,
  7956. HTT_RX_MON_RING_RELEASE,
  7957. };
  7958. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7959. /* DWORD 0: Pdev ID */
  7960. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7961. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7962. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7963. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7964. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7965. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7966. do { \
  7967. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7968. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7969. } while (0)
  7970. /* DWORD 1:ENABLE */
  7971. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7972. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7973. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7974. do { \
  7975. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7976. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7977. } while (0)
  7978. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7979. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7980. /* DWORD 1:ZERO_MPDU */
  7981. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7982. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7983. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7984. do { \
  7985. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7986. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7987. } while (0)
  7988. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7989. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7990. /* DWORD 1:NON_ZERO_MPDU */
  7991. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7992. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7993. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7994. do { \
  7995. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7996. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7997. } while (0)
  7998. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7999. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8000. /* DWORD 1:RELEASE_RINGS */
  8001. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8002. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8003. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8004. do { \
  8005. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8006. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8007. } while (0)
  8008. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8009. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8010. /**
  8011. * Enumeration for IP Protocol or IPSEC Protocol
  8012. * IPsec describes the framework for providing security at IP layer.
  8013. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8014. */
  8015. enum htt_rx_flow_proto {
  8016. HTT_RX_FLOW_IP_PROTO,
  8017. HTT_RX_FLOW_IPSEC_PROTO,
  8018. };
  8019. /**
  8020. * Enumeration for FSE Cache Invalidation
  8021. * 0 - No Cache Invalidation required
  8022. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8023. * 2 - Complete FSE Cache Invalidation
  8024. * 3 - FSE Disable
  8025. * 4 - FSE Enable
  8026. */
  8027. enum htt_rx_fse_operation {
  8028. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8029. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8030. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8031. HTT_RX_FSE_DISABLE,
  8032. HTT_RX_FSE_ENABLE,
  8033. };
  8034. /* DWORD 0: Pdev ID */
  8035. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8036. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8037. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8038. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8039. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8040. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8041. do { \
  8042. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8043. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8044. } while (0)
  8045. /* DWORD 1:IP PROTO or IPSEC */
  8046. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8047. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8048. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8049. do { \
  8050. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8051. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8052. } while (0)
  8053. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8054. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8055. /* DWORD 1:FSE Operation */
  8056. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8057. #define HTT_RX_FSE_OPERATION_S 1
  8058. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8059. do { \
  8060. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8061. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8062. } while (0)
  8063. #define HTT_RX_FSE_OPERATION_GET(word) \
  8064. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8065. /* DWORD 2-9:IP Address */
  8066. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8067. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8068. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8069. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8070. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8071. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8072. do { \
  8073. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8074. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8075. } while (0)
  8076. /* DWORD 10:Source Port Number */
  8077. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8078. #define HTT_RX_FSE_SOURCEPORT_S 0
  8079. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8080. do { \
  8081. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8082. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8083. } while (0)
  8084. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8085. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8086. /* DWORD 11:Destination Port Number */
  8087. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8088. #define HTT_RX_FSE_DESTPORT_S 16
  8089. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8090. do { \
  8091. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8092. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8093. } while (0)
  8094. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8095. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8096. /* DWORD 10-11:SPI (In case of IPSEC) */
  8097. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8098. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8099. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8100. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8101. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8102. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8103. do { \
  8104. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8105. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8106. } while (0)
  8107. /* DWORD 12:L4 PROTO */
  8108. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8109. #define HTT_RX_FSE_L4_PROTO_S 0
  8110. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8111. do { \
  8112. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8113. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8114. } while (0)
  8115. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8116. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8117. /**
  8118. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8119. *
  8120. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8121. *
  8122. * |31 24|23 |15 8|7 2|1|0|
  8123. * |----------------+----------------+----------------+----------------|
  8124. * | reserved | pdev_id | msg_type |
  8125. * |---------------------------------+----------------+----------------|
  8126. * | reserved |E|F|
  8127. * |---------------------------------+----------------+----------------|
  8128. * Where E = Configure the target to provide the 3-tuple hash value in
  8129. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8130. * F = Configure the target to provide the 3-tuple hash value in
  8131. * flow_id_toeplitz field of rx_msdu_start tlv
  8132. *
  8133. * The following field definitions describe the format of the 3 tuple hash value
  8134. * message sent from the host to target as part of initialization sequence.
  8135. *
  8136. * Header fields:
  8137. * dword0 - b'7:0 - msg_type: This will be set to
  8138. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8139. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8140. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8141. * specified pdev's LMAC ring.
  8142. * b'31:16 - reserved : Reserved for future use
  8143. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8144. * b'1 - toeplitz_hash_2_or_4_field_enable
  8145. * b'31:2 - reserved : Reserved for future use
  8146. * ---------+------+----------------------------------------------------------
  8147. * bit1 | bit0 | Functionality
  8148. * ---------+------+----------------------------------------------------------
  8149. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8150. * | | in flow_id_toeplitz field
  8151. * ---------+------+----------------------------------------------------------
  8152. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8153. * | | in toeplitz_hash_2_or_4 field
  8154. * ---------+------+----------------------------------------------------------
  8155. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8156. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8157. * ---------+------+----------------------------------------------------------
  8158. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8159. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8160. * | | toeplitz_hash_2_or_4 field
  8161. *----------------------------------------------------------------------------
  8162. */
  8163. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8164. A_UINT32 msg_type :8,
  8165. pdev_id :8,
  8166. reserved0 :16;
  8167. A_UINT32 flow_id_toeplitz_field_enable :1,
  8168. toeplitz_hash_2_or_4_field_enable :1,
  8169. reserved1 :30;
  8170. } POSTPACK;
  8171. /* DWORD0 : pdev_id configuration Macros */
  8172. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8173. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8174. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8175. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8176. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8177. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8178. do { \
  8179. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8180. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8181. } while (0)
  8182. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8183. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8184. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8185. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8186. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8187. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8188. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8189. do { \
  8190. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8191. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8192. } while (0)
  8193. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8194. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8195. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8196. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8197. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8198. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8199. do { \
  8200. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8201. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8202. } while (0)
  8203. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8204. /**
  8205. * @brief host --> target Host PA Address Size
  8206. *
  8207. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8208. *
  8209. * @details
  8210. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8211. * provide the physical start address and size of each of the memory
  8212. * areas within host DDR that the target FW may need to access.
  8213. *
  8214. * For example, the host can use this message to allow the target FW
  8215. * to set up access to the host's pools of TQM link descriptors.
  8216. * The message would appear as follows:
  8217. *
  8218. * |31 24|23 16|15 8|7 0|
  8219. * |----------------+----------------+----------------+----------------|
  8220. * | reserved | num_entries | msg_type |
  8221. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8222. * | mem area 0 size |
  8223. * |----------------+----------------+----------------+----------------|
  8224. * | mem area 0 physical_address_lo |
  8225. * |----------------+----------------+----------------+----------------|
  8226. * | mem area 0 physical_address_hi |
  8227. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8228. * | mem area 1 size |
  8229. * |----------------+----------------+----------------+----------------|
  8230. * | mem area 1 physical_address_lo |
  8231. * |----------------+----------------+----------------+----------------|
  8232. * | mem area 1 physical_address_hi |
  8233. * |----------------+----------------+----------------+----------------|
  8234. * ...
  8235. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8236. * | mem area N size |
  8237. * |----------------+----------------+----------------+----------------|
  8238. * | mem area N physical_address_lo |
  8239. * |----------------+----------------+----------------+----------------|
  8240. * | mem area N physical_address_hi |
  8241. * |----------------+----------------+----------------+----------------|
  8242. *
  8243. * The message is interpreted as follows:
  8244. * dword0 - b'0:7 - msg_type: This will be set to
  8245. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8246. * b'8:15 - number_entries: Indicated the number of host memory
  8247. * areas specified within the remainder of the message
  8248. * b'16:31 - reserved.
  8249. * dword1 - b'0:31 - memory area 0 size in bytes
  8250. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8251. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8252. * and similar for memory area 1 through memory area N.
  8253. */
  8254. PREPACK struct htt_h2t_host_paddr_size {
  8255. A_UINT32 msg_type: 8,
  8256. num_entries: 8,
  8257. reserved: 16;
  8258. } POSTPACK;
  8259. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8260. A_UINT32 size;
  8261. A_UINT32 physical_address_lo;
  8262. A_UINT32 physical_address_hi;
  8263. } POSTPACK;
  8264. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8265. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8266. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8267. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8268. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8269. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8270. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8271. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8272. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8273. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8274. do { \
  8275. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8276. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8277. } while (0)
  8278. /**
  8279. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8280. *
  8281. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8282. *
  8283. * @details
  8284. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8285. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8286. *
  8287. * The message would appear as follows:
  8288. *
  8289. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8290. * |---------------------------------+---+---+----------+-+-----------|
  8291. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8292. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8293. *
  8294. *
  8295. * The message is interpreted as follows:
  8296. * dword0 - b'0:7 - msg_type: This will be set to
  8297. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8298. * b'8 - override bit to drive MSDUs to PPE ring
  8299. * b'9:13 - REO destination ring indication
  8300. * b'14 - Multi buffer msdu override enable bit
  8301. * b'15 - Intra BSS override
  8302. * b'16 - Decap raw override
  8303. * b'17 - Decap Native wifi override
  8304. * b'18 - IP frag override
  8305. * b'19:31 - reserved
  8306. */
  8307. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8308. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8309. override: 1,
  8310. reo_destination_indication: 5,
  8311. multi_buffer_msdu_override_en: 1,
  8312. intra_bss_override: 1,
  8313. decap_raw_override: 1,
  8314. decap_nwifi_override: 1,
  8315. ip_frag_override: 1,
  8316. reserved: 13;
  8317. } POSTPACK;
  8318. /* DWORD 0: Override */
  8319. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8320. #define HTT_PPE_CFG_OVERRIDE_S 8
  8321. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8322. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8323. HTT_PPE_CFG_OVERRIDE_S)
  8324. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8325. do { \
  8326. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8327. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8328. } while (0)
  8329. /* DWORD 0: REO Destination Indication*/
  8330. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8331. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8332. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8333. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8334. HTT_PPE_CFG_REO_DEST_IND_S)
  8335. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8336. do { \
  8337. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8338. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8339. } while (0)
  8340. /* DWORD 0: Multi buffer MSDU override */
  8341. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8342. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8343. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8344. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8345. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8346. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8347. do { \
  8348. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8349. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8350. } while (0)
  8351. /* DWORD 0: Intra BSS override */
  8352. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8353. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8354. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8355. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8356. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8357. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8358. do { \
  8359. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8360. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8361. } while (0)
  8362. /* DWORD 0: Decap RAW override */
  8363. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8364. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8365. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8366. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8367. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8368. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8369. do { \
  8370. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8371. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8372. } while (0)
  8373. /* DWORD 0: Decap NWIFI override */
  8374. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8375. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8376. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8377. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8378. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8379. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8380. do { \
  8381. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8382. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8383. } while (0)
  8384. /* DWORD 0: IP frag override */
  8385. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8386. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8387. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8388. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8389. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8390. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8391. do { \
  8392. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8393. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8394. } while (0)
  8395. /*
  8396. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8397. *
  8398. * @details
  8399. * The following field definitions describe the format of the HTT host
  8400. * to target FW VDEV TX RX stats retrieve message.
  8401. * The message specifies the type of stats the host wants to retrieve.
  8402. *
  8403. * |31 27|26 25|24 17|16|15 8|7 0|
  8404. * |-----------------------------------------------------------|
  8405. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8406. * |-----------------------------------------------------------|
  8407. * | vdev_id lower bitmask |
  8408. * |-----------------------------------------------------------|
  8409. * | vdev_id upper bitmask |
  8410. * |-----------------------------------------------------------|
  8411. * Header fields:
  8412. * Where:
  8413. * dword0 - b'7:0 - msg_type: This will be set to
  8414. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8415. * b'15:8 - pdev id
  8416. * b'16(E) - Enable/Disable the vdev HW stats
  8417. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8418. * b'25:26(R) - Reset stats bits
  8419. * 0: don't reset stats
  8420. * 1: reset stats once
  8421. * 2: reset stats at the start of each periodic interval
  8422. * b'27:31 - reserved for future use
  8423. * dword1 - b'0:31 - vdev_id lower bitmask
  8424. * dword2 - b'0:31 - vdev_id upper bitmask
  8425. */
  8426. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8427. A_UINT32 msg_type :8,
  8428. pdev_id :8,
  8429. enable :1,
  8430. periodic_interval :8,
  8431. reset_stats_bits :2,
  8432. reserved0 :5;
  8433. A_UINT32 vdev_id_lower_bitmask;
  8434. A_UINT32 vdev_id_upper_bitmask;
  8435. } POSTPACK;
  8436. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8437. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8438. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8439. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8440. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8441. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8442. do { \
  8443. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8444. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8445. } while (0)
  8446. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8447. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8448. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8449. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8450. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8451. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8452. do { \
  8453. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8454. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8455. } while (0)
  8456. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8457. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8458. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8459. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8460. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8461. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8462. do { \
  8463. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8464. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8465. } while (0)
  8466. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8467. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8468. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8469. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8470. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8471. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8472. do { \
  8473. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8474. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8475. } while (0)
  8476. /*
  8477. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8478. *
  8479. * @details
  8480. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8481. * the default MSDU queues for one of the TIDs within the specified peer
  8482. * to the specified service class.
  8483. * The TID is indirectly specified - each service class is associated
  8484. * with a TID. All default MSDU queues for this peer-TID will be
  8485. * linked to the service class in question.
  8486. *
  8487. * |31 16|15 8|7 0|
  8488. * |------------------------------+--------------+--------------|
  8489. * | peer ID | svc class ID | msg type |
  8490. * |------------------------------------------------------------|
  8491. * Header fields:
  8492. * dword0 - b'7:0 - msg_type: This will be set to
  8493. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8494. * b'15:8 - service class ID
  8495. * b'31:16 - peer ID
  8496. */
  8497. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8498. A_UINT32 msg_type :8,
  8499. svc_class_id :8,
  8500. peer_id :16;
  8501. } POSTPACK;
  8502. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8503. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8504. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8505. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8506. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8507. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8508. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8509. do { \
  8510. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8511. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8512. } while (0)
  8513. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8514. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8515. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8516. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8517. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8518. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8519. do { \
  8520. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8521. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8522. } while (0)
  8523. /*
  8524. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8525. *
  8526. * @details
  8527. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8528. * remove the linkage of the specified peer-TID's MSDU queues to
  8529. * service classes.
  8530. *
  8531. * |31 16|15 8|7 0|
  8532. * |------------------------------+--------------+--------------|
  8533. * | peer ID | svc class ID | msg type |
  8534. * |------------------------------------------------------------|
  8535. * Header fields:
  8536. * dword0 - b'7:0 - msg_type: This will be set to
  8537. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8538. * b'15:8 - service class ID
  8539. * b'31:16 - peer ID
  8540. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8541. * value for peer ID indicates that the target should
  8542. * apply the UNMAP_REQ to all peers.
  8543. */
  8544. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8545. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8546. A_UINT32 msg_type :8,
  8547. svc_class_id :8,
  8548. peer_id :16;
  8549. } POSTPACK;
  8550. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8551. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8552. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8553. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8554. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8555. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8556. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8557. do { \
  8558. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8559. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8560. } while (0)
  8561. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8562. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8563. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8564. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8565. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8566. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8567. do { \
  8568. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8569. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8570. } while (0)
  8571. /*
  8572. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8573. *
  8574. * @details
  8575. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8576. * request the target to report what service class the default MSDU queues
  8577. * of the specified TIDs within the peer are linked to.
  8578. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8579. * to report what service class (if any) the default MSDU queues for
  8580. * each of the specified TIDs are linked to.
  8581. *
  8582. * |31 16|15 8|7 1| 0|
  8583. * |------------------------------+--------------+--------------|
  8584. * | peer ID | TID mask | msg type |
  8585. * |------------------------------------------------------------|
  8586. * | reserved |ETO|
  8587. * |------------------------------------------------------------|
  8588. * Header fields:
  8589. * dword0 - b'7:0 - msg_type: This will be set to
  8590. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8591. * b'15:8 - TID mask
  8592. * b'31:16 - peer ID
  8593. * dword1 - b'0 - "Existing Tids Only" flag
  8594. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8595. * message generated by this REQ will only show the
  8596. * mapping for TIDs that actually exist in the target's
  8597. * peer object.
  8598. * Any TIDs that are covered by a MAP_REQ but which
  8599. * do not actually exist will be shown as being
  8600. * unmapped (i.e. svc class ID 0xff).
  8601. * If this flag is cleared, the MAP_REPORT_CONF message
  8602. * will consider not only the mapping of TIDs currently
  8603. * existing in the peer, but also the mapping that will
  8604. * be applied for any TID objects created within this
  8605. * peer in the future.
  8606. * b'31:1 - reserved for future use
  8607. */
  8608. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8609. A_UINT32 msg_type :8,
  8610. tid_mask :8,
  8611. peer_id :16;
  8612. A_UINT32 existing_tids_only:1,
  8613. reserved :31;
  8614. } POSTPACK;
  8615. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8616. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8617. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8618. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8619. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8620. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8621. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8622. do { \
  8623. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8624. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8625. } while (0)
  8626. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8627. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8628. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8629. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8630. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8631. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8632. do { \
  8633. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8634. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8635. } while (0)
  8636. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8637. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8638. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8639. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8640. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8641. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8642. do { \
  8643. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8644. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8645. } while (0)
  8646. /**
  8647. * @brief Format of shared memory between Host and Target
  8648. * for UMAC hang recovery feature messaging.
  8649. * @details
  8650. * This is shared memory between Host and Target allocated
  8651. * and used in chips where UMAC hang recovery feature is supported.
  8652. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8653. * then host interprets it as a new message from target.
  8654. * Host clears that particular read bit in t2h_msg after each read
  8655. * operation. It is vice versa for h2t_msg. At any given point
  8656. * of time there is expected to be only one bit set
  8657. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8658. *
  8659. * The message is interpreted as follows:
  8660. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8661. * added for debuggability purpose.
  8662. * dword1 - b'0 - do_pre_reset
  8663. * b'1 - do_post_reset_start
  8664. * b'2 - do_post_reset_complete
  8665. * b'3:31 - rsvd_t2h
  8666. * dword2 - b'0 - pre_reset_done
  8667. * b'1 - post_reset_start_done
  8668. * b'2 - post_reset_complete_done
  8669. * b'3:31 - rsvd_h2t
  8670. */
  8671. PREPACK typedef struct {
  8672. /** Magic number added for debuggability. */
  8673. A_UINT32 magic_num;
  8674. union {
  8675. /*
  8676. * BIT [0] :- T2H msg to do pre-reset
  8677. * BIT [1] :- T2H msg to do post-reset start
  8678. * BIT [2] :- T2H msg to do post-reset complete
  8679. * BIT [31 : 3] :- reserved
  8680. */
  8681. A_UINT32 t2h_msg;
  8682. struct {
  8683. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8684. do_post_reset_start : 1, /* BIT [1] */
  8685. do_post_reset_complete : 1, /* BIT [2] */
  8686. rsvd_t2h : 29; /* BIT [31 : 3] */
  8687. };
  8688. };
  8689. union {
  8690. /*
  8691. * BIT [0] :- H2T msg to send pre-reset done
  8692. * BIT [1] :- H2T msg to send post-reset start done
  8693. * BIT [2] :- H2T msg to send post-reset complete done
  8694. * BIT [31 : 3] :- reserved
  8695. */
  8696. A_UINT32 h2t_msg;
  8697. struct {
  8698. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8699. post_reset_start_done : 1, /* BIT [1] */
  8700. post_reset_complete_done : 1, /* BIT [2] */
  8701. rsvd_h2t : 29; /* BIT [31 : 3] */
  8702. };
  8703. };
  8704. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8705. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8706. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8707. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8708. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8709. /* dword1 - b'0 - do_pre_reset */
  8710. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8711. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8712. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8713. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8714. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8715. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8716. do { \
  8717. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8718. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8719. } while (0)
  8720. /* dword1 - b'1 - do_post_reset_start */
  8721. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8722. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8723. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8724. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8725. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8726. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8727. do { \
  8728. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8729. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8730. } while (0)
  8731. /* dword1 - b'2 - do_post_reset_complete */
  8732. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8733. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8734. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8735. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8736. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8737. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  8738. do { \
  8739. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  8740. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  8741. } while (0)
  8742. /* dword2 - b'0 - pre_reset_done */
  8743. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  8744. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  8745. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  8746. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  8747. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  8748. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  8749. do { \
  8750. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  8751. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  8752. } while (0)
  8753. /* dword2 - b'1 - post_reset_start_done */
  8754. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  8755. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  8756. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  8757. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  8758. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  8759. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  8760. do { \
  8761. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  8762. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  8763. } while (0)
  8764. /* dword2 - b'2 - post_reset_complete_done */
  8765. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  8766. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  8767. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  8768. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  8769. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  8770. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  8771. do { \
  8772. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  8773. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  8774. } while (0)
  8775. /**
  8776. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  8777. *
  8778. * @details
  8779. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  8780. * by the host to provide prerequisite info to target for the UMAC hang
  8781. * recovery feature.
  8782. * The info sent in this H2T message are T2H message method, H2T message
  8783. * method, T2H MSI interrupt number and physical start address, size of
  8784. * the shared memory (refers to the shared memory dedicated for messaging
  8785. * between host and target when the DUT is in UMAC hang recovery mode).
  8786. * This H2T message is expected to be only sent if the WMI service bit
  8787. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  8788. *
  8789. * |31 16|15 12|11 8|7 0|
  8790. * |-------------------------------+--------------+--------------+------------|
  8791. * | reserved |h2t msg method|t2h msg method| msg_type |
  8792. * |--------------------------------------------------------------------------|
  8793. * | t2h msi interrupt number |
  8794. * |--------------------------------------------------------------------------|
  8795. * | shared memory area size |
  8796. * |--------------------------------------------------------------------------|
  8797. * | shared memory area physical address low |
  8798. * |--------------------------------------------------------------------------|
  8799. * | shared memory area physical address high |
  8800. * |--------------------------------------------------------------------------|
  8801. *
  8802. * The message is interpreted as follows:
  8803. * dword0 - b'0:7 - msg_type (= HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SETUP)
  8804. * b'8:11 - t2h_msg_method: indicates method to be used for
  8805. * T2H communication in UMAC hang recovery mode.
  8806. * Value zero indicates MSI interrupt (default method).
  8807. * Refer to htt_umac_hang_recovery_msg_method enum.
  8808. * b'12:15 - h2t_msg_method: indicates method to be used for
  8809. * H2T communication in UMAC hang recovery mode.
  8810. * Value zero indicates polling by target for this h2t msg
  8811. * during UMAC hang recovery mode.
  8812. * Refer to htt_umac_hang_recovery_msg_method enum.
  8813. * b'16:31 - reserved.
  8814. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  8815. * T2H communication in UMAC hang recovery mode.
  8816. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  8817. * only when in UMAC hang recovery mode.
  8818. * This refers to size in bytes.
  8819. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  8820. * of the shared memory dedicated for messaging only when
  8821. * in UMAC hang recovery mode.
  8822. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  8823. * of the shared memory dedicated for messaging only when
  8824. * in UMAC hang recovery mode.
  8825. */
  8826. /* t2h_msg_method and h2t_msg_method */
  8827. enum htt_umac_hang_recovery_msg_method {
  8828. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  8829. };
  8830. PREPACK typedef struct {
  8831. A_UINT32 msg_type : 8,
  8832. t2h_msg_method : 4,
  8833. h2t_msg_method : 4,
  8834. reserved : 16;
  8835. A_UINT32 t2h_msi_data;
  8836. /* size bytes and physical address of shared memory. */
  8837. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  8838. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  8839. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  8840. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  8841. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  8842. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  8843. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  8844. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  8845. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  8846. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  8847. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  8848. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  8849. do { \
  8850. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  8851. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  8852. } while (0)
  8853. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  8854. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  8855. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  8856. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  8857. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  8858. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  8859. do { \
  8860. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  8861. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  8862. } while (0)
  8863. /*=== target -> host messages ===============================================*/
  8864. enum htt_t2h_msg_type {
  8865. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8866. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8867. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8868. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8869. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8870. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8871. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8872. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8873. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8874. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8875. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8876. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8877. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8878. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8879. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8880. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8881. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8882. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8883. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8884. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8885. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8886. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8887. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8888. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8889. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8890. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8891. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8892. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8893. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8894. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8895. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8896. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8897. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8898. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8899. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8900. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8901. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8902. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8903. /* TX_OFFLOAD_DELIVER_IND:
  8904. * Forward the target's locally-generated packets to the host,
  8905. * to provide to the monitor mode interface.
  8906. */
  8907. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8908. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8909. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8910. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8911. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8912. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8913. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8914. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8915. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8916. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  8917. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  8918. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  8919. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  8920. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  8921. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  8922. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  8923. HTT_T2H_MSG_TYPE_TEST,
  8924. /* keep this last */
  8925. HTT_T2H_NUM_MSGS
  8926. };
  8927. /*
  8928. * HTT target to host message type -
  8929. * stored in bits 7:0 of the first word of the message
  8930. */
  8931. #define HTT_T2H_MSG_TYPE_M 0xff
  8932. #define HTT_T2H_MSG_TYPE_S 0
  8933. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8934. do { \
  8935. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8936. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8937. } while (0)
  8938. #define HTT_T2H_MSG_TYPE_GET(word) \
  8939. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8940. /**
  8941. * @brief target -> host version number confirmation message definition
  8942. *
  8943. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8944. *
  8945. * |31 24|23 16|15 8|7 0|
  8946. * |----------------+----------------+----------------+----------------|
  8947. * | reserved | major number | minor number | msg type |
  8948. * |-------------------------------------------------------------------|
  8949. * : option request TLV (optional) |
  8950. * :...................................................................:
  8951. *
  8952. * The VER_CONF message may consist of a single 4-byte word, or may be
  8953. * extended with TLVs that specify HTT options selected by the target.
  8954. * The following option TLVs may be appended to the VER_CONF message:
  8955. * - LL_BUS_ADDR_SIZE
  8956. * - HL_SUPPRESS_TX_COMPL_IND
  8957. * - MAX_TX_QUEUE_GROUPS
  8958. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8959. * may be appended to the VER_CONF message (but only one TLV of each type).
  8960. *
  8961. * Header fields:
  8962. * - MSG_TYPE
  8963. * Bits 7:0
  8964. * Purpose: identifies this as a version number confirmation message
  8965. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8966. * - VER_MINOR
  8967. * Bits 15:8
  8968. * Purpose: Specify the minor number of the HTT message library version
  8969. * in use by the target firmware.
  8970. * The minor number specifies the specific revision within a range
  8971. * of fundamentally compatible HTT message definition revisions.
  8972. * Compatible revisions involve adding new messages or perhaps
  8973. * adding new fields to existing messages, in a backwards-compatible
  8974. * manner.
  8975. * Incompatible revisions involve changing the message type values,
  8976. * or redefining existing messages.
  8977. * Value: minor number
  8978. * - VER_MAJOR
  8979. * Bits 15:8
  8980. * Purpose: Specify the major number of the HTT message library version
  8981. * in use by the target firmware.
  8982. * The major number specifies the family of minor revisions that are
  8983. * fundamentally compatible with each other, but not with prior or
  8984. * later families.
  8985. * Value: major number
  8986. */
  8987. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8988. #define HTT_VER_CONF_MINOR_S 8
  8989. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8990. #define HTT_VER_CONF_MAJOR_S 16
  8991. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8992. do { \
  8993. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8994. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8995. } while (0)
  8996. #define HTT_VER_CONF_MINOR_GET(word) \
  8997. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8998. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8999. do { \
  9000. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9001. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9002. } while (0)
  9003. #define HTT_VER_CONF_MAJOR_GET(word) \
  9004. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9005. #define HTT_VER_CONF_BYTES 4
  9006. /**
  9007. * @brief - target -> host HTT Rx In order indication message
  9008. *
  9009. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9010. *
  9011. * @details
  9012. *
  9013. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9014. * |----------------+-------------------+---------------------+---------------|
  9015. * | peer ID | P| F| O| ext TID | msg type |
  9016. * |--------------------------------------------------------------------------|
  9017. * | MSDU count | Reserved | vdev id |
  9018. * |--------------------------------------------------------------------------|
  9019. * | MSDU 0 bus address (bits 31:0) |
  9020. #if HTT_PADDR64
  9021. * | MSDU 0 bus address (bits 63:32) |
  9022. #endif
  9023. * |--------------------------------------------------------------------------|
  9024. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9025. * |--------------------------------------------------------------------------|
  9026. * | MSDU 1 bus address (bits 31:0) |
  9027. #if HTT_PADDR64
  9028. * | MSDU 1 bus address (bits 63:32) |
  9029. #endif
  9030. * |--------------------------------------------------------------------------|
  9031. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9032. * |--------------------------------------------------------------------------|
  9033. */
  9034. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9035. *
  9036. * @details
  9037. * bits
  9038. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9039. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9040. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9041. * | | frag | | | | fail |chksum fail|
  9042. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9043. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9044. */
  9045. struct htt_rx_in_ord_paddr_ind_hdr_t
  9046. {
  9047. A_UINT32 /* word 0 */
  9048. msg_type: 8,
  9049. ext_tid: 5,
  9050. offload: 1,
  9051. frag: 1,
  9052. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9053. peer_id: 16;
  9054. A_UINT32 /* word 1 */
  9055. vap_id: 8,
  9056. /* NOTE:
  9057. * This reserved_1 field is not truly reserved - certain targets use
  9058. * this field internally to store debug information, and do not zero
  9059. * out the contents of the field before uploading the message to the
  9060. * host. Thus, any host-target communication supported by this field
  9061. * is limited to using values that are never used by the debug
  9062. * information stored by certain targets in the reserved_1 field.
  9063. * In particular, the targets in question don't use the value 0x3
  9064. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9065. * so this previously-unused value within these bits is available to
  9066. * use as the host / target PKT_CAPTURE_MODE flag.
  9067. */
  9068. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9069. /* if pkt_capture_mode == 0x3, host should
  9070. * send rx frames to monitor mode interface
  9071. */
  9072. msdu_cnt: 16;
  9073. };
  9074. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9075. {
  9076. A_UINT32 dma_addr;
  9077. A_UINT32
  9078. length: 16,
  9079. fw_desc: 8,
  9080. msdu_info:8;
  9081. };
  9082. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9083. {
  9084. A_UINT32 dma_addr_lo;
  9085. A_UINT32 dma_addr_hi;
  9086. A_UINT32
  9087. length: 16,
  9088. fw_desc: 8,
  9089. msdu_info:8;
  9090. };
  9091. #if HTT_PADDR64
  9092. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9093. #else
  9094. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9095. #endif
  9096. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9097. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9098. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9099. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9100. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9101. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9102. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9103. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9104. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9105. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9106. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9107. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9108. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9109. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9110. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9111. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9112. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9113. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9114. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9115. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9116. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9117. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9118. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9119. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9120. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9121. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9122. /* for systems using 64-bit format for bus addresses */
  9123. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9124. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9125. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9126. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9127. /* for systems using 32-bit format for bus addresses */
  9128. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9129. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9130. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9131. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9132. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9133. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9134. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9135. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9136. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9137. do { \
  9138. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9139. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9140. } while (0)
  9141. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9142. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9143. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9144. do { \
  9145. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9146. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9147. } while (0)
  9148. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9149. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9150. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9151. do { \
  9152. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9153. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9154. } while (0)
  9155. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9156. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9157. /*
  9158. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9159. * deliver the rx frames to the monitor mode interface.
  9160. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9161. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9162. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9163. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9164. */
  9165. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9166. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9167. do { \
  9168. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9169. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9170. } while (0)
  9171. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9172. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9173. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9174. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9175. do { \
  9176. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9177. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9178. } while (0)
  9179. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9180. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9181. /* for systems using 64-bit format for bus addresses */
  9182. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9183. do { \
  9184. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9185. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9186. } while (0)
  9187. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9188. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9189. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9190. do { \
  9191. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9192. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9193. } while (0)
  9194. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9195. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9196. /* for systems using 32-bit format for bus addresses */
  9197. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9198. do { \
  9199. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9200. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9201. } while (0)
  9202. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9203. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9204. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9205. do { \
  9206. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9207. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9208. } while (0)
  9209. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9210. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9211. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9212. do { \
  9213. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9214. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9215. } while (0)
  9216. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9217. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9218. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9219. do { \
  9220. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9221. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9222. } while (0)
  9223. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9224. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9225. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9226. do { \
  9227. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9228. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9229. } while (0)
  9230. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9231. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9232. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9233. do { \
  9234. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9235. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9236. } while (0)
  9237. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9238. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9239. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9240. do { \
  9241. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9242. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9243. } while (0)
  9244. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9245. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9246. /* definitions used within target -> host rx indication message */
  9247. PREPACK struct htt_rx_ind_hdr_prefix_t
  9248. {
  9249. A_UINT32 /* word 0 */
  9250. msg_type: 8,
  9251. ext_tid: 5,
  9252. release_valid: 1,
  9253. flush_valid: 1,
  9254. reserved0: 1,
  9255. peer_id: 16;
  9256. A_UINT32 /* word 1 */
  9257. flush_start_seq_num: 6,
  9258. flush_end_seq_num: 6,
  9259. release_start_seq_num: 6,
  9260. release_end_seq_num: 6,
  9261. num_mpdu_ranges: 8;
  9262. } POSTPACK;
  9263. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9264. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9265. #define HTT_TGT_RSSI_INVALID 0x80
  9266. PREPACK struct htt_rx_ppdu_desc_t
  9267. {
  9268. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9269. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9270. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9271. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9272. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9273. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9274. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9275. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9276. A_UINT32 /* word 0 */
  9277. rssi_cmb: 8,
  9278. timestamp_submicrosec: 8,
  9279. phy_err_code: 8,
  9280. phy_err: 1,
  9281. legacy_rate: 4,
  9282. legacy_rate_sel: 1,
  9283. end_valid: 1,
  9284. start_valid: 1;
  9285. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9286. union {
  9287. A_UINT32 /* word 1 */
  9288. rssi0_pri20: 8,
  9289. rssi0_ext20: 8,
  9290. rssi0_ext40: 8,
  9291. rssi0_ext80: 8;
  9292. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9293. } u0;
  9294. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9295. union {
  9296. A_UINT32 /* word 2 */
  9297. rssi1_pri20: 8,
  9298. rssi1_ext20: 8,
  9299. rssi1_ext40: 8,
  9300. rssi1_ext80: 8;
  9301. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9302. } u1;
  9303. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9304. union {
  9305. A_UINT32 /* word 3 */
  9306. rssi2_pri20: 8,
  9307. rssi2_ext20: 8,
  9308. rssi2_ext40: 8,
  9309. rssi2_ext80: 8;
  9310. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9311. } u2;
  9312. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9313. union {
  9314. A_UINT32 /* word 4 */
  9315. rssi3_pri20: 8,
  9316. rssi3_ext20: 8,
  9317. rssi3_ext40: 8,
  9318. rssi3_ext80: 8;
  9319. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9320. } u3;
  9321. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9322. A_UINT32 tsf32; /* word 5 */
  9323. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9324. A_UINT32 timestamp_microsec; /* word 6 */
  9325. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9326. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9327. A_UINT32 /* word 7 */
  9328. vht_sig_a1: 24,
  9329. preamble_type: 8;
  9330. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9331. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9332. A_UINT32 /* word 8 */
  9333. vht_sig_a2: 24,
  9334. /* sa_ant_matrix
  9335. * For cases where a single rx chain has options to be connected to
  9336. * different rx antennas, show which rx antennas were in use during
  9337. * receipt of a given PPDU.
  9338. * This sa_ant_matrix provides a bitmask of the antennas used while
  9339. * receiving this frame.
  9340. */
  9341. sa_ant_matrix: 8;
  9342. } POSTPACK;
  9343. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9344. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9345. PREPACK struct htt_rx_ind_hdr_suffix_t
  9346. {
  9347. A_UINT32 /* word 0 */
  9348. fw_rx_desc_bytes: 16,
  9349. reserved0: 16;
  9350. } POSTPACK;
  9351. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9352. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9353. PREPACK struct htt_rx_ind_hdr_t
  9354. {
  9355. struct htt_rx_ind_hdr_prefix_t prefix;
  9356. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9357. struct htt_rx_ind_hdr_suffix_t suffix;
  9358. } POSTPACK;
  9359. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9360. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9361. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9362. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9363. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9364. /*
  9365. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9366. * the offset into the HTT rx indication message at which the
  9367. * FW rx PPDU descriptor resides
  9368. */
  9369. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9370. /*
  9371. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9372. * the offset into the HTT rx indication message at which the
  9373. * header suffix (FW rx MSDU byte count) resides
  9374. */
  9375. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9376. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9377. /*
  9378. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9379. * the offset into the HTT rx indication message at which the per-MSDU
  9380. * information starts
  9381. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9382. * per-MSDU information portion of the message. The per-MSDU info itself
  9383. * starts at byte 12.
  9384. */
  9385. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9386. /**
  9387. * @brief target -> host rx indication message definition
  9388. *
  9389. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9390. *
  9391. * @details
  9392. * The following field definitions describe the format of the rx indication
  9393. * message sent from the target to the host.
  9394. * The message consists of three major sections:
  9395. * 1. a fixed-length header
  9396. * 2. a variable-length list of firmware rx MSDU descriptors
  9397. * 3. one or more 4-octet MPDU range information elements
  9398. * The fixed length header itself has two sub-sections
  9399. * 1. the message meta-information, including identification of the
  9400. * sender and type of the received data, and a 4-octet flush/release IE
  9401. * 2. the firmware rx PPDU descriptor
  9402. *
  9403. * The format of the message is depicted below.
  9404. * in this depiction, the following abbreviations are used for information
  9405. * elements within the message:
  9406. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9407. * elements associated with the PPDU start are valid.
  9408. * Specifically, the following fields are valid only if SV is set:
  9409. * RSSI (all variants), L, legacy rate, preamble type, service,
  9410. * VHT-SIG-A
  9411. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9412. * elements associated with the PPDU end are valid.
  9413. * Specifically, the following fields are valid only if EV is set:
  9414. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9415. * - L - Legacy rate selector - if legacy rates are used, this flag
  9416. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9417. * (L == 0) PHY.
  9418. * - P - PHY error flag - boolean indication of whether the rx frame had
  9419. * a PHY error
  9420. *
  9421. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9422. * |----------------+-------------------+---------------------+---------------|
  9423. * | peer ID | |RV|FV| ext TID | msg type |
  9424. * |--------------------------------------------------------------------------|
  9425. * | num | release | release | flush | flush |
  9426. * | MPDU | end | start | end | start |
  9427. * | ranges | seq num | seq num | seq num | seq num |
  9428. * |==========================================================================|
  9429. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9430. * |V|V| | rate | | | timestamp | RSSI |
  9431. * |--------------------------------------------------------------------------|
  9432. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9433. * |--------------------------------------------------------------------------|
  9434. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9435. * |--------------------------------------------------------------------------|
  9436. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9437. * |--------------------------------------------------------------------------|
  9438. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9439. * |--------------------------------------------------------------------------|
  9440. * | TSF LSBs |
  9441. * |--------------------------------------------------------------------------|
  9442. * | microsec timestamp |
  9443. * |--------------------------------------------------------------------------|
  9444. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9445. * |--------------------------------------------------------------------------|
  9446. * | service | HT-SIG / VHT-SIG-A2 |
  9447. * |==========================================================================|
  9448. * | reserved | FW rx desc bytes |
  9449. * |--------------------------------------------------------------------------|
  9450. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9451. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9452. * |--------------------------------------------------------------------------|
  9453. * : : :
  9454. * |--------------------------------------------------------------------------|
  9455. * | alignment | MSDU Rx |
  9456. * | padding | desc Bn |
  9457. * |--------------------------------------------------------------------------|
  9458. * | reserved | MPDU range status | MPDU count |
  9459. * |--------------------------------------------------------------------------|
  9460. * : reserved : MPDU range status : MPDU count :
  9461. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9462. *
  9463. * Header fields:
  9464. * - MSG_TYPE
  9465. * Bits 7:0
  9466. * Purpose: identifies this as an rx indication message
  9467. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9468. * - EXT_TID
  9469. * Bits 12:8
  9470. * Purpose: identify the traffic ID of the rx data, including
  9471. * special "extended" TID values for multicast, broadcast, and
  9472. * non-QoS data frames
  9473. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9474. * - FLUSH_VALID (FV)
  9475. * Bit 13
  9476. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9477. * is valid
  9478. * Value:
  9479. * 1 -> flush IE is valid and needs to be processed
  9480. * 0 -> flush IE is not valid and should be ignored
  9481. * - REL_VALID (RV)
  9482. * Bit 13
  9483. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9484. * is valid
  9485. * Value:
  9486. * 1 -> release IE is valid and needs to be processed
  9487. * 0 -> release IE is not valid and should be ignored
  9488. * - PEER_ID
  9489. * Bits 31:16
  9490. * Purpose: Identify, by ID, which peer sent the rx data
  9491. * Value: ID of the peer who sent the rx data
  9492. * - FLUSH_SEQ_NUM_START
  9493. * Bits 5:0
  9494. * Purpose: Indicate the start of a series of MPDUs to flush
  9495. * Not all MPDUs within this series are necessarily valid - the host
  9496. * must check each sequence number within this range to see if the
  9497. * corresponding MPDU is actually present.
  9498. * This field is only valid if the FV bit is set.
  9499. * Value:
  9500. * The sequence number for the first MPDUs to check to flush.
  9501. * The sequence number is masked by 0x3f.
  9502. * - FLUSH_SEQ_NUM_END
  9503. * Bits 11:6
  9504. * Purpose: Indicate the end of a series of MPDUs to flush
  9505. * Value:
  9506. * The sequence number one larger than the sequence number of the
  9507. * last MPDU to check to flush.
  9508. * The sequence number is masked by 0x3f.
  9509. * Not all MPDUs within this series are necessarily valid - the host
  9510. * must check each sequence number within this range to see if the
  9511. * corresponding MPDU is actually present.
  9512. * This field is only valid if the FV bit is set.
  9513. * - REL_SEQ_NUM_START
  9514. * Bits 17:12
  9515. * Purpose: Indicate the start of a series of MPDUs to release.
  9516. * All MPDUs within this series are present and valid - the host
  9517. * need not check each sequence number within this range to see if
  9518. * the corresponding MPDU is actually present.
  9519. * This field is only valid if the RV bit is set.
  9520. * Value:
  9521. * The sequence number for the first MPDUs to check to release.
  9522. * The sequence number is masked by 0x3f.
  9523. * - REL_SEQ_NUM_END
  9524. * Bits 23:18
  9525. * Purpose: Indicate the end of a series of MPDUs to release.
  9526. * Value:
  9527. * The sequence number one larger than the sequence number of the
  9528. * last MPDU to check to release.
  9529. * The sequence number is masked by 0x3f.
  9530. * All MPDUs within this series are present and valid - the host
  9531. * need not check each sequence number within this range to see if
  9532. * the corresponding MPDU is actually present.
  9533. * This field is only valid if the RV bit is set.
  9534. * - NUM_MPDU_RANGES
  9535. * Bits 31:24
  9536. * Purpose: Indicate how many ranges of MPDUs are present.
  9537. * Each MPDU range consists of a series of contiguous MPDUs within the
  9538. * rx frame sequence which all have the same MPDU status.
  9539. * Value: 1-63 (typically a small number, like 1-3)
  9540. *
  9541. * Rx PPDU descriptor fields:
  9542. * - RSSI_CMB
  9543. * Bits 7:0
  9544. * Purpose: Combined RSSI from all active rx chains, across the active
  9545. * bandwidth.
  9546. * Value: RSSI dB units w.r.t. noise floor
  9547. * - TIMESTAMP_SUBMICROSEC
  9548. * Bits 15:8
  9549. * Purpose: high-resolution timestamp
  9550. * Value:
  9551. * Sub-microsecond time of PPDU reception.
  9552. * This timestamp ranges from [0,MAC clock MHz).
  9553. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9554. * to form a high-resolution, large range rx timestamp.
  9555. * - PHY_ERR_CODE
  9556. * Bits 23:16
  9557. * Purpose:
  9558. * If the rx frame processing resulted in a PHY error, indicate what
  9559. * type of rx PHY error occurred.
  9560. * Value:
  9561. * This field is valid if the "P" (PHY_ERR) flag is set.
  9562. * TBD: document/specify the values for this field
  9563. * - PHY_ERR
  9564. * Bit 24
  9565. * Purpose: indicate whether the rx PPDU had a PHY error
  9566. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9567. * - LEGACY_RATE
  9568. * Bits 28:25
  9569. * Purpose:
  9570. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9571. * specify which rate was used.
  9572. * Value:
  9573. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9574. * flag.
  9575. * If LEGACY_RATE_SEL is 0:
  9576. * 0x8: OFDM 48 Mbps
  9577. * 0x9: OFDM 24 Mbps
  9578. * 0xA: OFDM 12 Mbps
  9579. * 0xB: OFDM 6 Mbps
  9580. * 0xC: OFDM 54 Mbps
  9581. * 0xD: OFDM 36 Mbps
  9582. * 0xE: OFDM 18 Mbps
  9583. * 0xF: OFDM 9 Mbps
  9584. * If LEGACY_RATE_SEL is 1:
  9585. * 0x8: CCK 11 Mbps long preamble
  9586. * 0x9: CCK 5.5 Mbps long preamble
  9587. * 0xA: CCK 2 Mbps long preamble
  9588. * 0xB: CCK 1 Mbps long preamble
  9589. * 0xC: CCK 11 Mbps short preamble
  9590. * 0xD: CCK 5.5 Mbps short preamble
  9591. * 0xE: CCK 2 Mbps short preamble
  9592. * - LEGACY_RATE_SEL
  9593. * Bit 29
  9594. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9595. * Value:
  9596. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9597. * used a legacy rate.
  9598. * 0 -> OFDM, 1 -> CCK
  9599. * - END_VALID
  9600. * Bit 30
  9601. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9602. * the start of the PPDU are valid. Specifically, the following
  9603. * fields are only valid if END_VALID is set:
  9604. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9605. * TIMESTAMP_SUBMICROSEC
  9606. * Value:
  9607. * 0 -> rx PPDU desc end fields are not valid
  9608. * 1 -> rx PPDU desc end fields are valid
  9609. * - START_VALID
  9610. * Bit 31
  9611. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9612. * the end of the PPDU are valid. Specifically, the following
  9613. * fields are only valid if START_VALID is set:
  9614. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9615. * VHT-SIG-A
  9616. * Value:
  9617. * 0 -> rx PPDU desc start fields are not valid
  9618. * 1 -> rx PPDU desc start fields are valid
  9619. * - RSSI0_PRI20
  9620. * Bits 7:0
  9621. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9622. * Value: RSSI dB units w.r.t. noise floor
  9623. *
  9624. * - RSSI0_EXT20
  9625. * Bits 7:0
  9626. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9627. * (if the rx bandwidth was >= 40 MHz)
  9628. * Value: RSSI dB units w.r.t. noise floor
  9629. * - RSSI0_EXT40
  9630. * Bits 7:0
  9631. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9632. * (if the rx bandwidth was >= 80 MHz)
  9633. * Value: RSSI dB units w.r.t. noise floor
  9634. * - RSSI0_EXT80
  9635. * Bits 7:0
  9636. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9637. * (if the rx bandwidth was >= 160 MHz)
  9638. * Value: RSSI dB units w.r.t. noise floor
  9639. *
  9640. * - RSSI1_PRI20
  9641. * Bits 7:0
  9642. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9643. * Value: RSSI dB units w.r.t. noise floor
  9644. * - RSSI1_EXT20
  9645. * Bits 7:0
  9646. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9647. * (if the rx bandwidth was >= 40 MHz)
  9648. * Value: RSSI dB units w.r.t. noise floor
  9649. * - RSSI1_EXT40
  9650. * Bits 7:0
  9651. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9652. * (if the rx bandwidth was >= 80 MHz)
  9653. * Value: RSSI dB units w.r.t. noise floor
  9654. * - RSSI1_EXT80
  9655. * Bits 7:0
  9656. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9657. * (if the rx bandwidth was >= 160 MHz)
  9658. * Value: RSSI dB units w.r.t. noise floor
  9659. *
  9660. * - RSSI2_PRI20
  9661. * Bits 7:0
  9662. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9663. * Value: RSSI dB units w.r.t. noise floor
  9664. * - RSSI2_EXT20
  9665. * Bits 7:0
  9666. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9667. * (if the rx bandwidth was >= 40 MHz)
  9668. * Value: RSSI dB units w.r.t. noise floor
  9669. * - RSSI2_EXT40
  9670. * Bits 7:0
  9671. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9672. * (if the rx bandwidth was >= 80 MHz)
  9673. * Value: RSSI dB units w.r.t. noise floor
  9674. * - RSSI2_EXT80
  9675. * Bits 7:0
  9676. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9677. * (if the rx bandwidth was >= 160 MHz)
  9678. * Value: RSSI dB units w.r.t. noise floor
  9679. *
  9680. * - RSSI3_PRI20
  9681. * Bits 7:0
  9682. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9683. * Value: RSSI dB units w.r.t. noise floor
  9684. * - RSSI3_EXT20
  9685. * Bits 7:0
  9686. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9687. * (if the rx bandwidth was >= 40 MHz)
  9688. * Value: RSSI dB units w.r.t. noise floor
  9689. * - RSSI3_EXT40
  9690. * Bits 7:0
  9691. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9692. * (if the rx bandwidth was >= 80 MHz)
  9693. * Value: RSSI dB units w.r.t. noise floor
  9694. * - RSSI3_EXT80
  9695. * Bits 7:0
  9696. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9697. * (if the rx bandwidth was >= 160 MHz)
  9698. * Value: RSSI dB units w.r.t. noise floor
  9699. *
  9700. * - TSF32
  9701. * Bits 31:0
  9702. * Purpose: specify the time the rx PPDU was received, in TSF units
  9703. * Value: 32 LSBs of the TSF
  9704. * - TIMESTAMP_MICROSEC
  9705. * Bits 31:0
  9706. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9707. * Value: PPDU rx time, in microseconds
  9708. * - VHT_SIG_A1
  9709. * Bits 23:0
  9710. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9711. * from the rx PPDU
  9712. * Value:
  9713. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9714. * VHT-SIG-A1 data.
  9715. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9716. * first 24 bits of the HT-SIG data.
  9717. * Otherwise, this field is invalid.
  9718. * Refer to the the 802.11 protocol for the definition of the
  9719. * HT-SIG and VHT-SIG-A1 fields
  9720. * - VHT_SIG_A2
  9721. * Bits 23:0
  9722. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9723. * from the rx PPDU
  9724. * Value:
  9725. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9726. * VHT-SIG-A2 data.
  9727. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9728. * last 24 bits of the HT-SIG data.
  9729. * Otherwise, this field is invalid.
  9730. * Refer to the the 802.11 protocol for the definition of the
  9731. * HT-SIG and VHT-SIG-A2 fields
  9732. * - PREAMBLE_TYPE
  9733. * Bits 31:24
  9734. * Purpose: indicate the PHY format of the received burst
  9735. * Value:
  9736. * 0x4: Legacy (OFDM/CCK)
  9737. * 0x8: HT
  9738. * 0x9: HT with TxBF
  9739. * 0xC: VHT
  9740. * 0xD: VHT with TxBF
  9741. * - SERVICE
  9742. * Bits 31:24
  9743. * Purpose: TBD
  9744. * Value: TBD
  9745. *
  9746. * Rx MSDU descriptor fields:
  9747. * - FW_RX_DESC_BYTES
  9748. * Bits 15:0
  9749. * Purpose: Indicate how many bytes in the Rx indication are used for
  9750. * FW Rx descriptors
  9751. *
  9752. * Payload fields:
  9753. * - MPDU_COUNT
  9754. * Bits 7:0
  9755. * Purpose: Indicate how many sequential MPDUs share the same status.
  9756. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9757. * - MPDU_STATUS
  9758. * Bits 15:8
  9759. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9760. * received successfully.
  9761. * Value:
  9762. * 0x1: success
  9763. * 0x2: FCS error
  9764. * 0x3: duplicate error
  9765. * 0x4: replay error
  9766. * 0x5: invalid peer
  9767. */
  9768. /* header fields */
  9769. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9770. #define HTT_RX_IND_EXT_TID_S 8
  9771. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9772. #define HTT_RX_IND_FLUSH_VALID_S 13
  9773. #define HTT_RX_IND_REL_VALID_M 0x4000
  9774. #define HTT_RX_IND_REL_VALID_S 14
  9775. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9776. #define HTT_RX_IND_PEER_ID_S 16
  9777. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9778. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9779. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9780. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9781. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9782. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9783. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9784. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9785. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9786. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9787. /* rx PPDU descriptor fields */
  9788. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9789. #define HTT_RX_IND_RSSI_CMB_S 0
  9790. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9791. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9792. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9793. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9794. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9795. #define HTT_RX_IND_PHY_ERR_S 24
  9796. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9797. #define HTT_RX_IND_LEGACY_RATE_S 25
  9798. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9799. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9800. #define HTT_RX_IND_END_VALID_M 0x40000000
  9801. #define HTT_RX_IND_END_VALID_S 30
  9802. #define HTT_RX_IND_START_VALID_M 0x80000000
  9803. #define HTT_RX_IND_START_VALID_S 31
  9804. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9805. #define HTT_RX_IND_RSSI_PRI20_S 0
  9806. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9807. #define HTT_RX_IND_RSSI_EXT20_S 8
  9808. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9809. #define HTT_RX_IND_RSSI_EXT40_S 16
  9810. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9811. #define HTT_RX_IND_RSSI_EXT80_S 24
  9812. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9813. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9814. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9815. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9816. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9817. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9818. #define HTT_RX_IND_SERVICE_M 0xff000000
  9819. #define HTT_RX_IND_SERVICE_S 24
  9820. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9821. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9822. /* rx MSDU descriptor fields */
  9823. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9824. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9825. /* payload fields */
  9826. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9827. #define HTT_RX_IND_MPDU_COUNT_S 0
  9828. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9829. #define HTT_RX_IND_MPDU_STATUS_S 8
  9830. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9831. do { \
  9832. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9833. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9834. } while (0)
  9835. #define HTT_RX_IND_EXT_TID_GET(word) \
  9836. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9837. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9838. do { \
  9839. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9840. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9841. } while (0)
  9842. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9843. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9844. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9845. do { \
  9846. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9847. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9848. } while (0)
  9849. #define HTT_RX_IND_REL_VALID_GET(word) \
  9850. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9851. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9852. do { \
  9853. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9854. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9855. } while (0)
  9856. #define HTT_RX_IND_PEER_ID_GET(word) \
  9857. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9858. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9859. do { \
  9860. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9861. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9862. } while (0)
  9863. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9864. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9865. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9866. do { \
  9867. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9868. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9869. } while (0)
  9870. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9871. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9872. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9873. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9874. do { \
  9875. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9876. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9877. } while (0)
  9878. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9879. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9880. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9881. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9882. do { \
  9883. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9884. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9885. } while (0)
  9886. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9887. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9888. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9889. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9890. do { \
  9891. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9892. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9893. } while (0)
  9894. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9895. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9896. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9897. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9898. do { \
  9899. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9900. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9901. } while (0)
  9902. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9903. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9904. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9905. /* FW rx PPDU descriptor fields */
  9906. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9907. do { \
  9908. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9909. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9910. } while (0)
  9911. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9912. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9913. HTT_RX_IND_RSSI_CMB_S)
  9914. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9915. do { \
  9916. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9917. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9918. } while (0)
  9919. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9920. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9921. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9922. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9923. do { \
  9924. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9925. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9926. } while (0)
  9927. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9928. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9929. HTT_RX_IND_PHY_ERR_CODE_S)
  9930. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9931. do { \
  9932. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9933. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9934. } while (0)
  9935. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9936. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9937. HTT_RX_IND_PHY_ERR_S)
  9938. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9939. do { \
  9940. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9941. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9942. } while (0)
  9943. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9944. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9945. HTT_RX_IND_LEGACY_RATE_S)
  9946. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9947. do { \
  9948. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9949. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9950. } while (0)
  9951. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9952. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9953. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9954. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9955. do { \
  9956. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9957. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9958. } while (0)
  9959. #define HTT_RX_IND_END_VALID_GET(word) \
  9960. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9961. HTT_RX_IND_END_VALID_S)
  9962. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9963. do { \
  9964. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9965. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9966. } while (0)
  9967. #define HTT_RX_IND_START_VALID_GET(word) \
  9968. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9969. HTT_RX_IND_START_VALID_S)
  9970. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9971. do { \
  9972. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9973. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9974. } while (0)
  9975. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9976. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9977. HTT_RX_IND_RSSI_PRI20_S)
  9978. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9979. do { \
  9980. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9981. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9982. } while (0)
  9983. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9984. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9985. HTT_RX_IND_RSSI_EXT20_S)
  9986. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9987. do { \
  9988. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9989. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9990. } while (0)
  9991. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9992. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9993. HTT_RX_IND_RSSI_EXT40_S)
  9994. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9995. do { \
  9996. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9997. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9998. } while (0)
  9999. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10000. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10001. HTT_RX_IND_RSSI_EXT80_S)
  10002. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10003. do { \
  10004. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10005. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10006. } while (0)
  10007. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10008. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10009. HTT_RX_IND_VHT_SIG_A1_S)
  10010. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10011. do { \
  10012. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10013. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10014. } while (0)
  10015. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10016. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10017. HTT_RX_IND_VHT_SIG_A2_S)
  10018. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10019. do { \
  10020. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10021. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10022. } while (0)
  10023. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10024. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10025. HTT_RX_IND_PREAMBLE_TYPE_S)
  10026. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10027. do { \
  10028. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10029. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10030. } while (0)
  10031. #define HTT_RX_IND_SERVICE_GET(word) \
  10032. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10033. HTT_RX_IND_SERVICE_S)
  10034. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10035. do { \
  10036. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10037. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10038. } while (0)
  10039. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10040. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10041. HTT_RX_IND_SA_ANT_MATRIX_S)
  10042. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10043. do { \
  10044. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10045. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10046. } while (0)
  10047. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10048. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10049. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10050. do { \
  10051. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10052. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10053. } while (0)
  10054. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10055. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10056. #define HTT_RX_IND_HL_BYTES \
  10057. (HTT_RX_IND_HDR_BYTES + \
  10058. 4 /* single FW rx MSDU descriptor */ + \
  10059. 4 /* single MPDU range information element */)
  10060. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10061. /* Could we use one macro entry? */
  10062. #define HTT_WORD_SET(word, field, value) \
  10063. do { \
  10064. HTT_CHECK_SET_VAL(field, value); \
  10065. (word) |= ((value) << field ## _S); \
  10066. } while (0)
  10067. #define HTT_WORD_GET(word, field) \
  10068. (((word) & field ## _M) >> field ## _S)
  10069. PREPACK struct hl_htt_rx_ind_base {
  10070. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10071. } POSTPACK;
  10072. /*
  10073. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10074. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10075. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10076. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10077. * htt_rx_ind_hl_rx_desc_t.
  10078. */
  10079. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10080. struct htt_rx_ind_hl_rx_desc_t {
  10081. A_UINT8 ver;
  10082. A_UINT8 len;
  10083. struct {
  10084. A_UINT8
  10085. first_msdu: 1,
  10086. last_msdu: 1,
  10087. c3_failed: 1,
  10088. c4_failed: 1,
  10089. ipv6: 1,
  10090. tcp: 1,
  10091. udp: 1,
  10092. reserved: 1;
  10093. } flags;
  10094. /* NOTE: no reserved space - don't append any new fields here */
  10095. };
  10096. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10097. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10098. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10099. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10100. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10101. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10102. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10103. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10104. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10105. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10106. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10107. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10108. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10109. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10110. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10111. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10112. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10113. /* This structure is used in HL, the basic descriptor information
  10114. * used by host. the structure is translated by FW from HW desc
  10115. * or generated by FW. But in HL monitor mode, the host would use
  10116. * the same structure with LL.
  10117. */
  10118. PREPACK struct hl_htt_rx_desc_base {
  10119. A_UINT32
  10120. seq_num:12,
  10121. encrypted:1,
  10122. chan_info_present:1,
  10123. resv0:2,
  10124. mcast_bcast:1,
  10125. fragment:1,
  10126. key_id_oct:8,
  10127. resv1:6;
  10128. A_UINT32
  10129. pn_31_0;
  10130. union {
  10131. struct {
  10132. A_UINT16 pn_47_32;
  10133. A_UINT16 pn_63_48;
  10134. } pn16;
  10135. A_UINT32 pn_63_32;
  10136. } u0;
  10137. A_UINT32
  10138. pn_95_64;
  10139. A_UINT32
  10140. pn_127_96;
  10141. } POSTPACK;
  10142. /*
  10143. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10144. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10145. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10146. * Please see htt_chan_change_t for description of the fields.
  10147. */
  10148. PREPACK struct htt_chan_info_t
  10149. {
  10150. A_UINT32 primary_chan_center_freq_mhz: 16,
  10151. contig_chan1_center_freq_mhz: 16;
  10152. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10153. phy_mode: 8,
  10154. reserved: 8;
  10155. } POSTPACK;
  10156. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10157. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10158. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10159. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10160. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10161. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10162. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10163. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10164. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10165. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10166. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10167. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10168. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10169. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10170. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10171. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10172. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10173. /* Channel information */
  10174. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10175. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10176. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10177. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10178. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10179. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10180. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10181. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10182. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10183. do { \
  10184. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10185. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10186. } while (0)
  10187. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10188. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10189. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10190. do { \
  10191. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10192. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10193. } while (0)
  10194. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10195. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10196. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10197. do { \
  10198. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10199. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10200. } while (0)
  10201. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10202. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10203. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10204. do { \
  10205. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10206. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10207. } while (0)
  10208. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10209. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10210. /*
  10211. * @brief target -> host message definition for FW offloaded pkts
  10212. *
  10213. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10214. *
  10215. * @details
  10216. * The following field definitions describe the format of the firmware
  10217. * offload deliver message sent from the target to the host.
  10218. *
  10219. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10220. *
  10221. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10222. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10223. * | reserved_1 | msg type |
  10224. * |--------------------------------------------------------------------------|
  10225. * | phy_timestamp_l32 |
  10226. * |--------------------------------------------------------------------------|
  10227. * | WORD2 (see below) |
  10228. * |--------------------------------------------------------------------------|
  10229. * | seqno | framectrl |
  10230. * |--------------------------------------------------------------------------|
  10231. * | reserved_3 | vdev_id | tid_num|
  10232. * |--------------------------------------------------------------------------|
  10233. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10234. * |--------------------------------------------------------------------------|
  10235. *
  10236. * where:
  10237. * STAT = status
  10238. * F = format (802.3 vs. 802.11)
  10239. *
  10240. * definition for word 2
  10241. *
  10242. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10243. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10244. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10245. * |--------------------------------------------------------------------------|
  10246. *
  10247. * where:
  10248. * PR = preamble
  10249. * BF = beamformed
  10250. */
  10251. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10252. {
  10253. A_UINT32 /* word 0 */
  10254. msg_type:8, /* [ 7: 0] */
  10255. reserved_1:24; /* [31: 8] */
  10256. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10257. A_UINT32 /* word 2 */
  10258. /* preamble:
  10259. * 0-OFDM,
  10260. * 1-CCk,
  10261. * 2-HT,
  10262. * 3-VHT
  10263. */
  10264. preamble: 2, /* [1:0] */
  10265. /* mcs:
  10266. * In case of HT preamble interpret
  10267. * MCS along with NSS.
  10268. * Valid values for HT are 0 to 7.
  10269. * HT mcs 0 with NSS 2 is mcs 8.
  10270. * Valid values for VHT are 0 to 9.
  10271. */
  10272. mcs: 4, /* [5:2] */
  10273. /* rate:
  10274. * This is applicable only for
  10275. * CCK and OFDM preamble type
  10276. * rate 0: OFDM 48 Mbps,
  10277. * 1: OFDM 24 Mbps,
  10278. * 2: OFDM 12 Mbps
  10279. * 3: OFDM 6 Mbps
  10280. * 4: OFDM 54 Mbps
  10281. * 5: OFDM 36 Mbps
  10282. * 6: OFDM 18 Mbps
  10283. * 7: OFDM 9 Mbps
  10284. * rate 0: CCK 11 Mbps Long
  10285. * 1: CCK 5.5 Mbps Long
  10286. * 2: CCK 2 Mbps Long
  10287. * 3: CCK 1 Mbps Long
  10288. * 4: CCK 11 Mbps Short
  10289. * 5: CCK 5.5 Mbps Short
  10290. * 6: CCK 2 Mbps Short
  10291. */
  10292. rate : 3, /* [ 8: 6] */
  10293. rssi : 8, /* [16: 9] units=dBm */
  10294. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10295. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10296. stbc : 1, /* [22] */
  10297. sgi : 1, /* [23] */
  10298. ldpc : 1, /* [24] */
  10299. beamformed: 1, /* [25] */
  10300. reserved_2: 6; /* [31:26] */
  10301. A_UINT32 /* word 3 */
  10302. framectrl:16, /* [15: 0] */
  10303. seqno:16; /* [31:16] */
  10304. A_UINT32 /* word 4 */
  10305. tid_num:5, /* [ 4: 0] actual TID number */
  10306. vdev_id:8, /* [12: 5] */
  10307. reserved_3:19; /* [31:13] */
  10308. A_UINT32 /* word 5 */
  10309. /* status:
  10310. * 0: tx_ok
  10311. * 1: retry
  10312. * 2: drop
  10313. * 3: filtered
  10314. * 4: abort
  10315. * 5: tid delete
  10316. * 6: sw abort
  10317. * 7: dropped by peer migration
  10318. */
  10319. status:3, /* [2:0] */
  10320. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10321. tx_mpdu_bytes:16, /* [19:4] */
  10322. /* Indicates retry count of offloaded/local generated Data tx frames */
  10323. tx_retry_cnt:6, /* [25:20] */
  10324. reserved_4:6; /* [31:26] */
  10325. } POSTPACK;
  10326. /* FW offload deliver ind message header fields */
  10327. /* DWORD one */
  10328. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10329. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10330. /* DWORD two */
  10331. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10332. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10333. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10334. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10335. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10336. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10337. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10338. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10339. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10340. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10341. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10342. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10343. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10344. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10345. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10346. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10347. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10348. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10349. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10350. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10351. /* DWORD three*/
  10352. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10353. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10354. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10355. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10356. /* DWORD four */
  10357. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10358. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10359. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10360. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10361. /* DWORD five */
  10362. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10363. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10364. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10365. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10366. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10367. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10368. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10369. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10370. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10371. do { \
  10372. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10373. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10374. } while (0)
  10375. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10376. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10377. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10378. do { \
  10379. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10380. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10381. } while (0)
  10382. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10383. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10384. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10385. do { \
  10386. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10387. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10388. } while (0)
  10389. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10390. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10391. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10392. do { \
  10393. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10394. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10395. } while (0)
  10396. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10397. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10398. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10399. do { \
  10400. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10401. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10402. } while (0)
  10403. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10404. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10405. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10406. do { \
  10407. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10408. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10409. } while (0)
  10410. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10411. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10412. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10413. do { \
  10414. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10415. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10416. } while (0)
  10417. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10418. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10419. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10420. do { \
  10421. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10422. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10423. } while (0)
  10424. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10425. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10426. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10427. do { \
  10428. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10429. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10430. } while (0)
  10431. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10432. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10433. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10434. do { \
  10435. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10436. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10437. } while (0)
  10438. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10439. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10440. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10441. do { \
  10442. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10443. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10444. } while (0)
  10445. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10446. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10447. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10448. do { \
  10449. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10450. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10451. } while (0)
  10452. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10453. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10454. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10455. do { \
  10456. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10457. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10458. } while (0)
  10459. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10460. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10461. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10462. do { \
  10463. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10464. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10465. } while (0)
  10466. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10467. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10468. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10469. do { \
  10470. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10471. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10472. } while (0)
  10473. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10474. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10475. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10476. do { \
  10477. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10478. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10479. } while (0)
  10480. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10481. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10482. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10483. do { \
  10484. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10485. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10486. } while (0)
  10487. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10488. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10489. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10490. do { \
  10491. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10492. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10493. } while (0)
  10494. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10495. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10496. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10497. do { \
  10498. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10499. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10500. } while (0)
  10501. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10502. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10503. /*
  10504. * @brief target -> host rx reorder flush message definition
  10505. *
  10506. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10507. *
  10508. * @details
  10509. * The following field definitions describe the format of the rx flush
  10510. * message sent from the target to the host.
  10511. * The message consists of a 4-octet header, followed by one or more
  10512. * 4-octet payload information elements.
  10513. *
  10514. * |31 24|23 8|7 0|
  10515. * |--------------------------------------------------------------|
  10516. * | TID | peer ID | msg type |
  10517. * |--------------------------------------------------------------|
  10518. * | seq num end | seq num start | MPDU status | reserved |
  10519. * |--------------------------------------------------------------|
  10520. * First DWORD:
  10521. * - MSG_TYPE
  10522. * Bits 7:0
  10523. * Purpose: identifies this as an rx flush message
  10524. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10525. * - PEER_ID
  10526. * Bits 23:8 (only bits 18:8 actually used)
  10527. * Purpose: identify which peer's rx data is being flushed
  10528. * Value: (rx) peer ID
  10529. * - TID
  10530. * Bits 31:24 (only bits 27:24 actually used)
  10531. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10532. * Value: traffic identifier
  10533. * Second DWORD:
  10534. * - MPDU_STATUS
  10535. * Bits 15:8
  10536. * Purpose:
  10537. * Indicate whether the flushed MPDUs should be discarded or processed.
  10538. * Value:
  10539. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10540. * stages of rx processing
  10541. * other: discard the MPDUs
  10542. * It is anticipated that flush messages will always have
  10543. * MPDU status == 1, but the status flag is included for
  10544. * flexibility.
  10545. * - SEQ_NUM_START
  10546. * Bits 23:16
  10547. * Purpose:
  10548. * Indicate the start of a series of consecutive MPDUs being flushed.
  10549. * Not all MPDUs within this range are necessarily valid - the host
  10550. * must check each sequence number within this range to see if the
  10551. * corresponding MPDU is actually present.
  10552. * Value:
  10553. * The sequence number for the first MPDU in the sequence.
  10554. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10555. * - SEQ_NUM_END
  10556. * Bits 30:24
  10557. * Purpose:
  10558. * Indicate the end of a series of consecutive MPDUs being flushed.
  10559. * Value:
  10560. * The sequence number one larger than the sequence number of the
  10561. * last MPDU being flushed.
  10562. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10563. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10564. * are to be released for further rx processing.
  10565. * Not all MPDUs within this range are necessarily valid - the host
  10566. * must check each sequence number within this range to see if the
  10567. * corresponding MPDU is actually present.
  10568. */
  10569. /* first DWORD */
  10570. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10571. #define HTT_RX_FLUSH_PEER_ID_S 8
  10572. #define HTT_RX_FLUSH_TID_M 0xff000000
  10573. #define HTT_RX_FLUSH_TID_S 24
  10574. /* second DWORD */
  10575. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10576. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10577. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10578. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10579. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10580. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10581. #define HTT_RX_FLUSH_BYTES 8
  10582. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10583. do { \
  10584. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10585. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10586. } while (0)
  10587. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10588. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10589. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10590. do { \
  10591. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10592. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10593. } while (0)
  10594. #define HTT_RX_FLUSH_TID_GET(word) \
  10595. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10596. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10597. do { \
  10598. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10599. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10600. } while (0)
  10601. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10602. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10603. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10604. do { \
  10605. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10606. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10607. } while (0)
  10608. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10609. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10610. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10611. do { \
  10612. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10613. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10614. } while (0)
  10615. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10616. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10617. /*
  10618. * @brief target -> host rx pn check indication message
  10619. *
  10620. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10621. *
  10622. * @details
  10623. * The following field definitions describe the format of the Rx PN check
  10624. * indication message sent from the target to the host.
  10625. * The message consists of a 4-octet header, followed by the start and
  10626. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10627. * IE is one octet containing the sequence number that failed the PN
  10628. * check.
  10629. *
  10630. * |31 24|23 8|7 0|
  10631. * |--------------------------------------------------------------|
  10632. * | TID | peer ID | msg type |
  10633. * |--------------------------------------------------------------|
  10634. * | Reserved | PN IE count | seq num end | seq num start|
  10635. * |--------------------------------------------------------------|
  10636. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10637. * |--------------------------------------------------------------|
  10638. * First DWORD:
  10639. * - MSG_TYPE
  10640. * Bits 7:0
  10641. * Purpose: Identifies this as an rx pn check indication message
  10642. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10643. * - PEER_ID
  10644. * Bits 23:8 (only bits 18:8 actually used)
  10645. * Purpose: identify which peer
  10646. * Value: (rx) peer ID
  10647. * - TID
  10648. * Bits 31:24 (only bits 27:24 actually used)
  10649. * Purpose: identify traffic identifier
  10650. * Value: traffic identifier
  10651. * Second DWORD:
  10652. * - SEQ_NUM_START
  10653. * Bits 7:0
  10654. * Purpose:
  10655. * Indicates the starting sequence number of the MPDU in this
  10656. * series of MPDUs that went though PN check.
  10657. * Value:
  10658. * The sequence number for the first MPDU in the sequence.
  10659. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10660. * - SEQ_NUM_END
  10661. * Bits 15:8
  10662. * Purpose:
  10663. * Indicates the ending sequence number of the MPDU in this
  10664. * series of MPDUs that went though PN check.
  10665. * Value:
  10666. * The sequence number one larger then the sequence number of the last
  10667. * MPDU being flushed.
  10668. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10669. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10670. * for invalid PN numbers and are ready to be released for further processing.
  10671. * Not all MPDUs within this range are necessarily valid - the host
  10672. * must check each sequence number within this range to see if the
  10673. * corresponding MPDU is actually present.
  10674. * - PN_IE_COUNT
  10675. * Bits 23:16
  10676. * Purpose:
  10677. * Used to determine the variable number of PN information elements in this
  10678. * message
  10679. *
  10680. * PN information elements:
  10681. * - PN_IE_x-
  10682. * Purpose:
  10683. * Each PN information element contains the sequence number of the MPDU that
  10684. * has failed the target PN check.
  10685. * Value:
  10686. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10687. * that failed the PN check.
  10688. */
  10689. /* first DWORD */
  10690. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10691. #define HTT_RX_PN_IND_PEER_ID_S 8
  10692. #define HTT_RX_PN_IND_TID_M 0xff000000
  10693. #define HTT_RX_PN_IND_TID_S 24
  10694. /* second DWORD */
  10695. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10696. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10697. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10698. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10699. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10700. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10701. #define HTT_RX_PN_IND_BYTES 8
  10702. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10703. do { \
  10704. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10705. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10706. } while (0)
  10707. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10708. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10709. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10710. do { \
  10711. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10712. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10713. } while (0)
  10714. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10715. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10716. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10717. do { \
  10718. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10719. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10720. } while (0)
  10721. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10722. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10723. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10724. do { \
  10725. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10726. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10727. } while (0)
  10728. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10729. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10730. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10731. do { \
  10732. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10733. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10734. } while (0)
  10735. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10736. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10737. /*
  10738. * @brief target -> host rx offload deliver message for LL system
  10739. *
  10740. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10741. *
  10742. * @details
  10743. * In a low latency system this message is sent whenever the offload
  10744. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10745. * The DMA of the actual packets into host memory is done before sending out
  10746. * this message. This message indicates only how many MSDUs to reap. The
  10747. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10748. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10749. * DMA'd by the MAC directly into host memory these packets do not contain
  10750. * the MAC descriptors in the header portion of the packet. Instead they contain
  10751. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10752. * message, the packets are delivered directly to the NW stack without going
  10753. * through the regular reorder buffering and PN checking path since it has
  10754. * already been done in target.
  10755. *
  10756. * |31 24|23 16|15 8|7 0|
  10757. * |-----------------------------------------------------------------------|
  10758. * | Total MSDU count | reserved | msg type |
  10759. * |-----------------------------------------------------------------------|
  10760. *
  10761. * @brief target -> host rx offload deliver message for HL system
  10762. *
  10763. * @details
  10764. * In a high latency system this message is sent whenever the offload manager
  10765. * flushes out the packets it has coalesced in its coalescing buffer. The
  10766. * actual packets are also carried along with this message. When the host
  10767. * receives this message, it is expected to deliver these packets to the NW
  10768. * stack directly instead of routing them through the reorder buffering and
  10769. * PN checking path since it has already been done in target.
  10770. *
  10771. * |31 24|23 16|15 8|7 0|
  10772. * |-----------------------------------------------------------------------|
  10773. * | Total MSDU count | reserved | msg type |
  10774. * |-----------------------------------------------------------------------|
  10775. * | peer ID | MSDU length |
  10776. * |-----------------------------------------------------------------------|
  10777. * | MSDU payload | FW Desc | tid | vdev ID |
  10778. * |-----------------------------------------------------------------------|
  10779. * | MSDU payload contd. |
  10780. * |-----------------------------------------------------------------------|
  10781. * | peer ID | MSDU length |
  10782. * |-----------------------------------------------------------------------|
  10783. * | MSDU payload | FW Desc | tid | vdev ID |
  10784. * |-----------------------------------------------------------------------|
  10785. * | MSDU payload contd. |
  10786. * |-----------------------------------------------------------------------|
  10787. *
  10788. */
  10789. /* first DWORD */
  10790. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10791. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10792. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10793. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10794. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10795. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10796. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10797. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10798. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10799. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10800. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10801. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10802. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10803. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10804. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10805. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10806. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10807. do { \
  10808. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10809. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10810. } while (0)
  10811. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10812. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10813. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10814. do { \
  10815. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10816. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10817. } while (0)
  10818. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10819. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10820. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10821. do { \
  10822. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10823. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10824. } while (0)
  10825. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10826. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10827. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10828. do { \
  10829. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10830. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10831. } while (0)
  10832. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10833. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10834. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10835. do { \
  10836. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10837. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10838. } while (0)
  10839. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10840. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10841. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10842. do { \
  10843. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10844. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10845. } while (0)
  10846. /**
  10847. * @brief target -> host rx peer map/unmap message definition
  10848. *
  10849. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10850. *
  10851. * @details
  10852. * The following diagram shows the format of the rx peer map message sent
  10853. * from the target to the host. This layout assumes the target operates
  10854. * as little-endian.
  10855. *
  10856. * This message always contains a SW peer ID. The main purpose of the
  10857. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10858. * with, so that the host can use that peer ID to determine which peer
  10859. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10860. * other purposes, such as identifying during tx completions which peer
  10861. * the tx frames in question were transmitted to.
  10862. *
  10863. * In certain generations of chips, the peer map message also contains
  10864. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10865. * to identify which peer the frame needs to be forwarded to (i.e. the
  10866. * peer assocated with the Destination MAC Address within the packet),
  10867. * and particularly which vdev needs to transmit the frame (for cases
  10868. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10869. * meaning as AST_INDEX_0.
  10870. * This DA-based peer ID that is provided for certain rx frames
  10871. * (the rx frames that need to be re-transmitted as tx frames)
  10872. * is the ID that the HW uses for referring to the peer in question,
  10873. * rather than the peer ID that the SW+FW use to refer to the peer.
  10874. *
  10875. *
  10876. * |31 24|23 16|15 8|7 0|
  10877. * |-----------------------------------------------------------------------|
  10878. * | SW peer ID | VDEV ID | msg type |
  10879. * |-----------------------------------------------------------------------|
  10880. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10881. * |-----------------------------------------------------------------------|
  10882. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10883. * |-----------------------------------------------------------------------|
  10884. *
  10885. *
  10886. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10887. *
  10888. * The following diagram shows the format of the rx peer unmap message sent
  10889. * from the target to the host.
  10890. *
  10891. * |31 24|23 16|15 8|7 0|
  10892. * |-----------------------------------------------------------------------|
  10893. * | SW peer ID | VDEV ID | msg type |
  10894. * |-----------------------------------------------------------------------|
  10895. *
  10896. * The following field definitions describe the format of the rx peer map
  10897. * and peer unmap messages sent from the target to the host.
  10898. * - MSG_TYPE
  10899. * Bits 7:0
  10900. * Purpose: identifies this as an rx peer map or peer unmap message
  10901. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10902. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10903. * - VDEV_ID
  10904. * Bits 15:8
  10905. * Purpose: Indicates which virtual device the peer is associated
  10906. * with.
  10907. * Value: vdev ID (used in the host to look up the vdev object)
  10908. * - PEER_ID (a.k.a. SW_PEER_ID)
  10909. * Bits 31:16
  10910. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10911. * freeing (unmap)
  10912. * Value: (rx) peer ID
  10913. * - MAC_ADDR_L32 (peer map only)
  10914. * Bits 31:0
  10915. * Purpose: Identifies which peer node the peer ID is for.
  10916. * Value: lower 4 bytes of peer node's MAC address
  10917. * - MAC_ADDR_U16 (peer map only)
  10918. * Bits 15:0
  10919. * Purpose: Identifies which peer node the peer ID is for.
  10920. * Value: upper 2 bytes of peer node's MAC address
  10921. * - HW_PEER_ID
  10922. * Bits 31:16
  10923. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10924. * address, so for rx frames marked for rx --> tx forwarding, the
  10925. * host can determine from the HW peer ID provided as meta-data with
  10926. * the rx frame which peer the frame is supposed to be forwarded to.
  10927. * Value: ID used by the MAC HW to identify the peer
  10928. */
  10929. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10930. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10931. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10932. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10933. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10934. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10935. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10936. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10937. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10938. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10939. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10940. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10941. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10942. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10943. do { \
  10944. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10945. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10946. } while (0)
  10947. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10948. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10949. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10950. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10951. do { \
  10952. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10953. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10954. } while (0)
  10955. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10956. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10957. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10958. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10959. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10960. do { \
  10961. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10962. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10963. } while (0)
  10964. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10965. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10966. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10967. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10968. #define HTT_RX_PEER_MAP_BYTES 12
  10969. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10970. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10971. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10972. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10973. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10974. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10975. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10976. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10977. #define HTT_RX_PEER_UNMAP_BYTES 4
  10978. /**
  10979. * @brief target -> host rx peer map V2 message definition
  10980. *
  10981. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10982. *
  10983. * @details
  10984. * The following diagram shows the format of the rx peer map v2 message sent
  10985. * from the target to the host. This layout assumes the target operates
  10986. * as little-endian.
  10987. *
  10988. * This message always contains a SW peer ID. The main purpose of the
  10989. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10990. * with, so that the host can use that peer ID to determine which peer
  10991. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10992. * other purposes, such as identifying during tx completions which peer
  10993. * the tx frames in question were transmitted to.
  10994. *
  10995. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10996. * is used during rx --> tx frame forwarding to identify which peer the
  10997. * frame needs to be forwarded to (i.e. the peer assocated with the
  10998. * Destination MAC Address within the packet), and particularly which vdev
  10999. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11000. * This DA-based peer ID that is provided for certain rx frames
  11001. * (the rx frames that need to be re-transmitted as tx frames)
  11002. * is the ID that the HW uses for referring to the peer in question,
  11003. * rather than the peer ID that the SW+FW use to refer to the peer.
  11004. *
  11005. * The HW peer id here is the same meaning as AST_INDEX_0.
  11006. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11007. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11008. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11009. * AST is valid.
  11010. *
  11011. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11012. * |-------------------------------------------------------------------------|
  11013. * | SW peer ID | VDEV ID | msg type |
  11014. * |-------------------------------------------------------------------------|
  11015. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11016. * |-------------------------------------------------------------------------|
  11017. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11018. * |-------------------------------------------------------------------------|
  11019. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11020. * |-------------------------------------------------------------------------|
  11021. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11022. * |-------------------------------------------------------------------------|
  11023. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11024. * |-------------------------------------------------------------------------|
  11025. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11026. * |-------------------------------------------------------------------------|
  11027. * | Reserved_2 |
  11028. * |-------------------------------------------------------------------------|
  11029. * Where:
  11030. * NH = Next Hop
  11031. * ASTVM = AST valid mask
  11032. * OA = on-chip AST valid bit
  11033. * ASTFM = AST flow mask
  11034. *
  11035. * The following field definitions describe the format of the rx peer map v2
  11036. * messages sent from the target to the host.
  11037. * - MSG_TYPE
  11038. * Bits 7:0
  11039. * Purpose: identifies this as an rx peer map v2 message
  11040. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11041. * - VDEV_ID
  11042. * Bits 15:8
  11043. * Purpose: Indicates which virtual device the peer is associated with.
  11044. * Value: vdev ID (used in the host to look up the vdev object)
  11045. * - SW_PEER_ID
  11046. * Bits 31:16
  11047. * Purpose: The peer ID (index) that WAL is allocating
  11048. * Value: (rx) peer ID
  11049. * - MAC_ADDR_L32
  11050. * Bits 31:0
  11051. * Purpose: Identifies which peer node the peer ID is for.
  11052. * Value: lower 4 bytes of peer node's MAC address
  11053. * - MAC_ADDR_U16
  11054. * Bits 15:0
  11055. * Purpose: Identifies which peer node the peer ID is for.
  11056. * Value: upper 2 bytes of peer node's MAC address
  11057. * - HW_PEER_ID / AST_INDEX_0
  11058. * Bits 31:16
  11059. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11060. * address, so for rx frames marked for rx --> tx forwarding, the
  11061. * host can determine from the HW peer ID provided as meta-data with
  11062. * the rx frame which peer the frame is supposed to be forwarded to.
  11063. * Value: ID used by the MAC HW to identify the peer
  11064. * - AST_HASH_VALUE
  11065. * Bits 15:0
  11066. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11067. * override feature.
  11068. * - NEXT_HOP
  11069. * Bit 16
  11070. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11071. * (Wireless Distribution System).
  11072. * - AST_VALID_MASK
  11073. * Bits 19:17
  11074. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11075. * - ONCHIP_AST_VALID_FLAG
  11076. * Bit 20
  11077. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11078. * is valid.
  11079. * - AST_INDEX_1
  11080. * Bits 15:0
  11081. * Purpose: indicate the second AST index for this peer
  11082. * - AST_0_FLOW_MASK
  11083. * Bits 19:16
  11084. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11085. * - AST_1_FLOW_MASK
  11086. * Bits 23:20
  11087. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11088. * - AST_2_FLOW_MASK
  11089. * Bits 27:24
  11090. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11091. * - AST_3_FLOW_MASK
  11092. * Bits 31:28
  11093. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11094. * - AST_INDEX_2
  11095. * Bits 15:0
  11096. * Purpose: indicate the third AST index for this peer
  11097. * - TID_VALID_HI_PRI
  11098. * Bits 23:16
  11099. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11100. * - TID_VALID_LOW_PRI
  11101. * Bits 31:24
  11102. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11103. * - AST_INDEX_3
  11104. * Bits 15:0
  11105. * Purpose: indicate the fourth AST index for this peer
  11106. * - ONCHIP_AST_IDX / RESERVED
  11107. * Bits 31:16
  11108. * Purpose: This field is valid only when split AST feature is enabled.
  11109. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11110. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11111. * address, this ast_idx is used for LMAC modules for RXPCU.
  11112. * Value: ID used by the LMAC HW to identify the peer
  11113. */
  11114. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11115. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11116. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11117. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11118. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11119. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11120. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11121. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11122. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11123. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11124. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11125. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11126. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11127. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11128. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11129. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11130. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11131. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11132. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11133. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11134. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11135. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11136. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11137. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11138. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11139. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11140. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11141. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11142. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11143. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11144. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11145. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11146. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11147. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11148. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11149. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11150. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11151. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11152. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11153. do { \
  11154. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11155. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11156. } while (0)
  11157. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11158. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11159. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11160. do { \
  11161. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11162. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11163. } while (0)
  11164. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11165. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11166. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11167. do { \
  11168. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11169. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11170. } while (0)
  11171. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11172. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11173. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11174. do { \
  11175. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11176. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11177. } while (0)
  11178. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11179. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11180. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11181. do { \
  11182. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11183. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11184. } while (0)
  11185. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11186. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11187. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11188. do { \
  11189. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11190. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11191. } while (0)
  11192. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11193. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11194. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11195. do { \
  11196. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11197. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11198. } while (0)
  11199. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11200. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11201. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11202. do { \
  11203. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11204. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11205. } while (0)
  11206. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11207. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11208. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11209. do { \
  11210. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11211. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11212. } while (0)
  11213. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11214. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11215. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11216. do { \
  11217. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11218. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11219. } while (0)
  11220. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11221. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11222. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11223. do { \
  11224. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11225. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11226. } while (0)
  11227. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11228. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11229. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11230. do { \
  11231. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11232. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11233. } while (0)
  11234. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11235. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11236. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11237. do { \
  11238. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11239. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11240. } while (0)
  11241. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11242. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11243. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11244. do { \
  11245. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11246. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11247. } while (0)
  11248. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11249. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11250. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11251. do { \
  11252. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11253. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11254. } while (0)
  11255. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11256. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11257. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11258. do { \
  11259. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11260. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11261. } while (0)
  11262. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11263. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11264. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11265. do { \
  11266. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11267. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11268. } while (0)
  11269. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11270. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11271. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11272. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11273. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11274. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11275. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11276. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11277. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11278. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11279. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11280. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11281. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11282. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11283. /**
  11284. * @brief target -> host rx peer map V3 message definition
  11285. *
  11286. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11287. *
  11288. * @details
  11289. * The following diagram shows the format of the rx peer map v3 message sent
  11290. * from the target to the host.
  11291. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11292. * This layout assumes the target operates as little-endian.
  11293. *
  11294. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11295. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11296. * | SW peer ID | VDEV ID | msg type |
  11297. * |-----------------+--------------------+-----------------+-----------------|
  11298. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11299. * |-----------------+--------------------+-----------------+-----------------|
  11300. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11301. * |-----------------+--------+-----------+-----------------+-----------------|
  11302. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11303. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11304. * | (8bits) | | (4bits) | |
  11305. * |-----------------+--------+--+--+--+--------------------------------------|
  11306. * | RESERVED |E |O | | |
  11307. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11308. * | |V |V | | |
  11309. * |-----------------+--------------------+-----------------------------------|
  11310. * | HTT_MSDU_IDX_ | RESERVED | |
  11311. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11312. * | (8bits) | | |
  11313. * |-----------------+--------------------+-----------------------------------|
  11314. * | Reserved_2 |
  11315. * |--------------------------------------------------------------------------|
  11316. * | Reserved_3 |
  11317. * |--------------------------------------------------------------------------|
  11318. *
  11319. * Where:
  11320. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11321. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11322. * NH = Next Hop
  11323. * The following field definitions describe the format of the rx peer map v3
  11324. * messages sent from the target to the host.
  11325. * - MSG_TYPE
  11326. * Bits 7:0
  11327. * Purpose: identifies this as a peer map v3 message
  11328. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11329. * - VDEV_ID
  11330. * Bits 15:8
  11331. * Purpose: Indicates which virtual device the peer is associated with.
  11332. * - SW_PEER_ID
  11333. * Bits 31:16
  11334. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11335. * - MAC_ADDR_L32
  11336. * Bits 31:0
  11337. * Purpose: Identifies which peer node the peer ID is for.
  11338. * Value: lower 4 bytes of peer node's MAC address
  11339. * - MAC_ADDR_U16
  11340. * Bits 15:0
  11341. * Purpose: Identifies which peer node the peer ID is for.
  11342. * Value: upper 2 bytes of peer node's MAC address
  11343. * - MULTICAST_SW_PEER_ID
  11344. * Bits 31:16
  11345. * Purpose: The multicast peer ID (index)
  11346. * Value: set to HTT_INVALID_PEER if not valid
  11347. * - HW_PEER_ID / AST_INDEX
  11348. * Bits 15:0
  11349. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11350. * address, so for rx frames marked for rx --> tx forwarding, the
  11351. * host can determine from the HW peer ID provided as meta-data with
  11352. * the rx frame which peer the frame is supposed to be forwarded to.
  11353. * - CACHE_SET_NUM
  11354. * Bits 19:16
  11355. * Purpose: Cache Set Number for AST_INDEX
  11356. * Cache set number that should be used to cache the index based
  11357. * search results, for address and flow search.
  11358. * This value should be equal to LSB 4 bits of the hash value
  11359. * of match data, in case of search index points to an entry which
  11360. * may be used in content based search also. The value can be
  11361. * anything when the entry pointed by search index will not be
  11362. * used for content based search.
  11363. * - HTT_MSDU_IDX_VALID_MASK
  11364. * Bits 31:24
  11365. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11366. * - ONCHIP_AST_IDX / RESERVED
  11367. * Bits 15:0
  11368. * Purpose: This field is valid only when split AST feature is enabled.
  11369. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11370. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11371. * address, this ast_idx is used for LMAC modules for RXPCU.
  11372. * - NEXT_HOP
  11373. * Bits 16
  11374. * Purpose: Flag indicates next_hop AST entry used for WDS
  11375. * (Wireless Distribution System).
  11376. * - ONCHIP_AST_VALID
  11377. * Bits 17
  11378. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11379. * - EXT_AST_VALID
  11380. * Bits 18
  11381. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11382. * - EXT_AST_INDEX
  11383. * Bits 15:0
  11384. * Purpose: This field describes Extended AST index
  11385. * Valid if EXT_AST_VALID flag set
  11386. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11387. * Bits 31:24
  11388. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11389. */
  11390. /* dword 0 */
  11391. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11392. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11393. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11394. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11395. /* dword 1 */
  11396. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11397. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11398. /* dword 2 */
  11399. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11400. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11401. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11402. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11403. /* dword 3 */
  11404. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11405. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11406. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11407. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11408. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11409. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11410. /* dword 4 */
  11411. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11412. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11413. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11414. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11415. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11416. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11417. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11418. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11419. /* dword 5 */
  11420. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11421. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11422. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11423. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11424. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11425. do { \
  11426. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11427. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11428. } while (0)
  11429. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11430. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11431. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11432. do { \
  11433. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11434. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11435. } while (0)
  11436. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11437. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11438. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11439. do { \
  11440. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11441. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11442. } while (0)
  11443. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11444. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11445. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11446. do { \
  11447. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11448. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11449. } while (0)
  11450. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11451. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11452. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11453. do { \
  11454. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11455. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11456. } while (0)
  11457. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11458. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11459. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11460. do { \
  11461. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11462. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11463. } while (0)
  11464. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11465. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11466. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11467. do { \
  11468. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11469. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11470. } while (0)
  11471. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11472. (((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)
  11473. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11474. do { \
  11475. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11476. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11477. } while (0)
  11478. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11479. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11480. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11481. do { \
  11482. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11483. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11484. } while (0)
  11485. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11486. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11487. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11488. do { \
  11489. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11490. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11491. } while (0)
  11492. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11493. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11494. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11495. do { \
  11496. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11497. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11498. } while (0)
  11499. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11500. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11501. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11502. do { \
  11503. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11504. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11505. } while (0)
  11506. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11507. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11508. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11509. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11510. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11511. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11512. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11513. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11514. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11515. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11516. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11517. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11518. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11519. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11520. /**
  11521. * @brief target -> host rx peer unmap V2 message definition
  11522. *
  11523. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11524. *
  11525. * The following diagram shows the format of the rx peer unmap message sent
  11526. * from the target to the host.
  11527. *
  11528. * |31 24|23 16|15 8|7 0|
  11529. * |-----------------------------------------------------------------------|
  11530. * | SW peer ID | VDEV ID | msg type |
  11531. * |-----------------------------------------------------------------------|
  11532. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11533. * |-----------------------------------------------------------------------|
  11534. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11535. * |-----------------------------------------------------------------------|
  11536. * | Peer Delete Duration |
  11537. * |-----------------------------------------------------------------------|
  11538. * | Reserved_0 | WDS Free Count |
  11539. * |-----------------------------------------------------------------------|
  11540. * | Reserved_1 |
  11541. * |-----------------------------------------------------------------------|
  11542. * | Reserved_2 |
  11543. * |-----------------------------------------------------------------------|
  11544. *
  11545. *
  11546. * The following field definitions describe the format of the rx peer unmap
  11547. * messages sent from the target to the host.
  11548. * - MSG_TYPE
  11549. * Bits 7:0
  11550. * Purpose: identifies this as an rx peer unmap v2 message
  11551. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11552. * - VDEV_ID
  11553. * Bits 15:8
  11554. * Purpose: Indicates which virtual device the peer is associated
  11555. * with.
  11556. * Value: vdev ID (used in the host to look up the vdev object)
  11557. * - SW_PEER_ID
  11558. * Bits 31:16
  11559. * Purpose: The peer ID (index) that WAL is freeing
  11560. * Value: (rx) peer ID
  11561. * - MAC_ADDR_L32
  11562. * Bits 31:0
  11563. * Purpose: Identifies which peer node the peer ID is for.
  11564. * Value: lower 4 bytes of peer node's MAC address
  11565. * - MAC_ADDR_U16
  11566. * Bits 15:0
  11567. * Purpose: Identifies which peer node the peer ID is for.
  11568. * Value: upper 2 bytes of peer node's MAC address
  11569. * - NEXT_HOP
  11570. * Bits 16
  11571. * Purpose: Bit indicates next_hop AST entry used for WDS
  11572. * (Wireless Distribution System).
  11573. * - PEER_DELETE_DURATION
  11574. * Bits 31:0
  11575. * Purpose: Time taken to delete peer, in msec,
  11576. * Used for monitoring / debugging PEER delete response delay
  11577. * - PEER_WDS_FREE_COUNT
  11578. * Bits 15:0
  11579. * Purpose: Count of WDS entries deleted associated to peer deleted
  11580. */
  11581. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11582. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11583. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11584. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11585. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11586. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11587. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11588. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11589. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11590. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11591. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11592. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11593. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11594. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11595. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11596. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11597. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11598. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11599. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11600. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11601. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11602. do { \
  11603. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11604. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11605. } while (0)
  11606. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11607. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11608. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11609. do { \
  11610. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11611. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11612. } while (0)
  11613. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11614. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11615. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11616. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11617. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11618. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11619. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11620. /**
  11621. * @brief target -> host rx peer mlo map message definition
  11622. *
  11623. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11624. *
  11625. * @details
  11626. * The following diagram shows the format of the rx mlo peer map message sent
  11627. * from the target to the host. This layout assumes the target operates
  11628. * as little-endian.
  11629. *
  11630. * MCC:
  11631. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11632. *
  11633. * WIN:
  11634. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11635. * It will be sent on the Assoc Link.
  11636. *
  11637. * This message always contains a MLO peer ID. The main purpose of the
  11638. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11639. * with, so that the host can use that MLO peer ID to determine which peer
  11640. * transmitted the rx frame.
  11641. *
  11642. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11643. * |-------------------------------------------------------------------------|
  11644. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11645. * |-------------------------------------------------------------------------|
  11646. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11647. * |-------------------------------------------------------------------------|
  11648. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11649. * |-------------------------------------------------------------------------|
  11650. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11651. * |-------------------------------------------------------------------------|
  11652. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11653. * |-------------------------------------------------------------------------|
  11654. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11655. * |-------------------------------------------------------------------------|
  11656. * |RSVD |
  11657. * |-------------------------------------------------------------------------|
  11658. * |RSVD |
  11659. * |-------------------------------------------------------------------------|
  11660. * | htt_tlv_hdr_t |
  11661. * |-------------------------------------------------------------------------|
  11662. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  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. *
  11673. * Where:
  11674. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11675. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11676. * V (valid) - 1 Bit Bit17
  11677. * CHIPID - 3 Bits
  11678. * TIDMASK - 8 Bits
  11679. * CACHE_SET_NUM - 8 Bits
  11680. *
  11681. * The following field definitions describe the format of the rx MLO peer map
  11682. * messages sent from the target to the host.
  11683. * - MSG_TYPE
  11684. * Bits 7:0
  11685. * Purpose: identifies this as an rx mlo peer map message
  11686. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11687. *
  11688. * - MLO_PEER_ID
  11689. * Bits 23:8
  11690. * Purpose: The MLO peer ID (index).
  11691. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11692. * Value: MLO peer ID
  11693. *
  11694. * - NUMLINK
  11695. * Bits: 26:24 (3Bits)
  11696. * Purpose: Indicate the max number of logical links supported per client.
  11697. * Value: number of logical links
  11698. *
  11699. * - PRC
  11700. * Bits: 29:27 (3Bits)
  11701. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11702. * if there is migration of the primary chip.
  11703. * Value: Primary REO CHIPID
  11704. *
  11705. * - MAC_ADDR_L32
  11706. * Bits 31:0
  11707. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11708. * Value: lower 4 bytes of peer node's MAC address
  11709. *
  11710. * - MAC_ADDR_U16
  11711. * Bits 15:0
  11712. * Purpose: Identifies which peer node the peer ID is for.
  11713. * Value: upper 2 bytes of peer node's MAC address
  11714. *
  11715. * - PRIMARY_TCL_AST_IDX
  11716. * Bits 15:0
  11717. * Purpose: Primary TCL AST index for this peer.
  11718. *
  11719. * - V
  11720. * 1 Bit Position 16
  11721. * Purpose: If the ast idx is valid.
  11722. *
  11723. * - CHIPID
  11724. * Bits 19:17
  11725. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11726. *
  11727. * - TIDMASK
  11728. * Bits 27:20
  11729. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11730. *
  11731. * - CACHE_SET_NUM
  11732. * Bits 31:28
  11733. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11734. * Cache set number that should be used to cache the index based
  11735. * search results, for address and flow search.
  11736. * This value should be equal to LSB four bits of the hash value
  11737. * of match data, in case of search index points to an entry which
  11738. * may be used in content based search also. The value can be
  11739. * anything when the entry pointed by search index will not be
  11740. * used for content based search.
  11741. *
  11742. * - htt_tlv_hdr_t
  11743. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11744. *
  11745. * Bits 11:0
  11746. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11747. *
  11748. * Bits 23:12
  11749. * Purpose: Length, Length of the value that follows the header
  11750. *
  11751. * Bits 31:28
  11752. * Purpose: Reserved.
  11753. *
  11754. *
  11755. * - SW_PEER_ID
  11756. * Bits 15:0
  11757. * Purpose: The peer ID (index) that WAL is allocating
  11758. * Value: (rx) peer ID
  11759. *
  11760. * - VDEV_ID
  11761. * Bits 23:16
  11762. * Purpose: Indicates which virtual device the peer is associated with.
  11763. * Value: vdev ID (used in the host to look up the vdev object)
  11764. *
  11765. * - CHIPID
  11766. * Bits 26:24
  11767. * Purpose: Indicates which Chip id the peer is associated with.
  11768. * Value: chip ID (Provided by Host as part of QMI exchange)
  11769. */
  11770. typedef enum {
  11771. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11772. } MLO_PEER_MAP_TLV_TAG_ID;
  11773. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11774. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11775. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11776. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11777. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11778. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11779. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11780. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11781. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11782. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11783. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11784. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11785. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11786. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11787. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11788. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11789. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11790. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11791. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11792. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11793. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11794. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11795. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11796. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11797. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11798. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11799. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11800. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11801. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11802. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11803. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11804. do { \
  11805. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11806. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11807. } while (0)
  11808. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11809. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11810. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11811. do { \
  11812. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11813. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11814. } while (0)
  11815. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11816. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11817. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11818. do { \
  11819. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11820. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11821. } while (0)
  11822. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11823. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11824. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11825. do { \
  11826. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11827. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11828. } while (0)
  11829. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11830. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11831. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11832. do { \
  11833. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11834. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11835. } while (0)
  11836. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11837. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11838. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11839. do { \
  11840. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11841. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11842. } while (0)
  11843. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11844. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11845. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11846. do { \
  11847. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11848. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11849. } while (0)
  11850. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11851. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11852. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11853. do { \
  11854. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11855. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11856. } while (0)
  11857. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11858. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11859. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11860. do { \
  11861. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11862. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11863. } while (0)
  11864. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11865. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11866. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11867. do { \
  11868. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11869. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11870. } while (0)
  11871. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11872. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11873. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11874. do { \
  11875. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11876. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11877. } while (0)
  11878. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11879. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11880. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11881. do { \
  11882. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11883. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11884. } while (0)
  11885. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11886. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11887. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11888. do { \
  11889. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11890. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11891. } while (0)
  11892. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11893. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11894. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11895. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11896. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11897. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11898. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11899. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11900. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11901. *
  11902. * The following diagram shows the format of the rx mlo peer unmap message sent
  11903. * from the target to the host.
  11904. *
  11905. * |31 24|23 16|15 8|7 0|
  11906. * |-----------------------------------------------------------------------|
  11907. * | RSVD_24_31 | MLO peer ID | msg type |
  11908. * |-----------------------------------------------------------------------|
  11909. */
  11910. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11911. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11912. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11913. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11914. /**
  11915. * @brief target -> host message specifying security parameters
  11916. *
  11917. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11918. *
  11919. * @details
  11920. * The following diagram shows the format of the security specification
  11921. * message sent from the target to the host.
  11922. * This security specification message tells the host whether a PN check is
  11923. * necessary on rx data frames, and if so, how large the PN counter is.
  11924. * This message also tells the host about the security processing to apply
  11925. * to defragmented rx frames - specifically, whether a Message Integrity
  11926. * Check is required, and the Michael key to use.
  11927. *
  11928. * |31 24|23 16|15|14 8|7 0|
  11929. * |-----------------------------------------------------------------------|
  11930. * | peer ID | U| security type | msg type |
  11931. * |-----------------------------------------------------------------------|
  11932. * | Michael Key K0 |
  11933. * |-----------------------------------------------------------------------|
  11934. * | Michael Key K1 |
  11935. * |-----------------------------------------------------------------------|
  11936. * | WAPI RSC Low0 |
  11937. * |-----------------------------------------------------------------------|
  11938. * | WAPI RSC Low1 |
  11939. * |-----------------------------------------------------------------------|
  11940. * | WAPI RSC Hi0 |
  11941. * |-----------------------------------------------------------------------|
  11942. * | WAPI RSC Hi1 |
  11943. * |-----------------------------------------------------------------------|
  11944. *
  11945. * The following field definitions describe the format of the security
  11946. * indication message sent from the target to the host.
  11947. * - MSG_TYPE
  11948. * Bits 7:0
  11949. * Purpose: identifies this as a security specification message
  11950. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11951. * - SEC_TYPE
  11952. * Bits 14:8
  11953. * Purpose: specifies which type of security applies to the peer
  11954. * Value: htt_sec_type enum value
  11955. * - UNICAST
  11956. * Bit 15
  11957. * Purpose: whether this security is applied to unicast or multicast data
  11958. * Value: 1 -> unicast, 0 -> multicast
  11959. * - PEER_ID
  11960. * Bits 31:16
  11961. * Purpose: The ID number for the peer the security specification is for
  11962. * Value: peer ID
  11963. * - MICHAEL_KEY_K0
  11964. * Bits 31:0
  11965. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11966. * Value: Michael Key K0 (if security type is TKIP)
  11967. * - MICHAEL_KEY_K1
  11968. * Bits 31:0
  11969. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11970. * Value: Michael Key K1 (if security type is TKIP)
  11971. * - WAPI_RSC_LOW0
  11972. * Bits 31:0
  11973. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11974. * Value: WAPI RSC Low0 (if security type is WAPI)
  11975. * - WAPI_RSC_LOW1
  11976. * Bits 31:0
  11977. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11978. * Value: WAPI RSC Low1 (if security type is WAPI)
  11979. * - WAPI_RSC_HI0
  11980. * Bits 31:0
  11981. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11982. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11983. * - WAPI_RSC_HI1
  11984. * Bits 31:0
  11985. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11986. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11987. */
  11988. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11989. #define HTT_SEC_IND_SEC_TYPE_S 8
  11990. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11991. #define HTT_SEC_IND_UNICAST_S 15
  11992. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11993. #define HTT_SEC_IND_PEER_ID_S 16
  11994. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11995. do { \
  11996. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11997. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11998. } while (0)
  11999. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12000. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12001. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12002. do { \
  12003. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12004. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12005. } while (0)
  12006. #define HTT_SEC_IND_UNICAST_GET(word) \
  12007. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12008. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12009. do { \
  12010. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12011. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12012. } while (0)
  12013. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12014. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12015. #define HTT_SEC_IND_BYTES 28
  12016. /**
  12017. * @brief target -> host rx ADDBA / DELBA message definitions
  12018. *
  12019. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12020. *
  12021. * @details
  12022. * The following diagram shows the format of the rx ADDBA message sent
  12023. * from the target to the host:
  12024. *
  12025. * |31 20|19 16|15 8|7 0|
  12026. * |---------------------------------------------------------------------|
  12027. * | peer ID | TID | window size | msg type |
  12028. * |---------------------------------------------------------------------|
  12029. *
  12030. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12031. *
  12032. * The following diagram shows the format of the rx DELBA message sent
  12033. * from the target to the host:
  12034. *
  12035. * |31 20|19 16|15 10|9 8|7 0|
  12036. * |---------------------------------------------------------------------|
  12037. * | peer ID | TID | window size | IR| msg type |
  12038. * |---------------------------------------------------------------------|
  12039. *
  12040. * The following field definitions describe the format of the rx ADDBA
  12041. * and DELBA messages sent from the target to the host.
  12042. * - MSG_TYPE
  12043. * Bits 7:0
  12044. * Purpose: identifies this as an rx ADDBA or DELBA message
  12045. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12046. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12047. * - IR (initiator / recipient)
  12048. * Bits 9:8 (DELBA only)
  12049. * Purpose: specify whether the DELBA handshake was initiated by the
  12050. * local STA/AP, or by the peer STA/AP
  12051. * Value:
  12052. * 0 - unspecified
  12053. * 1 - initiator (a.k.a. originator)
  12054. * 2 - recipient (a.k.a. responder)
  12055. * 3 - unused / reserved
  12056. * - WIN_SIZE
  12057. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12058. * Purpose: Specifies the length of the block ack window (max = 64).
  12059. * Value:
  12060. * block ack window length specified by the received ADDBA/DELBA
  12061. * management message.
  12062. * - TID
  12063. * Bits 19:16
  12064. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12065. * Value:
  12066. * TID specified by the received ADDBA or DELBA management message.
  12067. * - PEER_ID
  12068. * Bits 31:20
  12069. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12070. * Value:
  12071. * ID (hash value) used by the host for fast, direct lookup of
  12072. * host SW peer info, including rx reorder states.
  12073. */
  12074. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12075. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12076. #define HTT_RX_ADDBA_TID_M 0xf0000
  12077. #define HTT_RX_ADDBA_TID_S 16
  12078. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12079. #define HTT_RX_ADDBA_PEER_ID_S 20
  12080. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12081. do { \
  12082. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12083. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12084. } while (0)
  12085. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12086. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12087. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12088. do { \
  12089. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12090. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12091. } while (0)
  12092. #define HTT_RX_ADDBA_TID_GET(word) \
  12093. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12094. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12095. do { \
  12096. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12097. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12098. } while (0)
  12099. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12100. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12101. #define HTT_RX_ADDBA_BYTES 4
  12102. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12103. #define HTT_RX_DELBA_INITIATOR_S 8
  12104. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12105. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12106. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12107. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12108. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12109. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12110. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12111. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12112. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12113. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12114. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12115. do { \
  12116. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12117. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12118. } while (0)
  12119. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12120. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12121. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12122. do { \
  12123. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12124. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12125. } while (0)
  12126. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12127. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12128. #define HTT_RX_DELBA_BYTES 4
  12129. /**
  12130. * @brief target -> host rx ADDBA / DELBA message definitions
  12131. *
  12132. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12133. *
  12134. * @details
  12135. * The following diagram shows the format of the rx ADDBA extn message sent
  12136. * from the target to the host:
  12137. *
  12138. * |31 20|19 16|15 13|12 8|7 0|
  12139. * |---------------------------------------------------------------------|
  12140. * | peer ID | TID | reserved | msg type |
  12141. * |---------------------------------------------------------------------|
  12142. * | reserved | window size |
  12143. * |---------------------------------------------------------------------|
  12144. *
  12145. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12146. *
  12147. * The following diagram shows the format of the rx DELBA message sent
  12148. * from the target to the host:
  12149. *
  12150. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12151. * |---------------------------------------------------------------------|
  12152. * | peer ID | TID | reserved | IR| msg type |
  12153. * |---------------------------------------------------------------------|
  12154. * | reserved | window size |
  12155. * |---------------------------------------------------------------------|
  12156. *
  12157. * The following field definitions describe the format of the rx ADDBA
  12158. * and DELBA messages sent from the target to the host.
  12159. * - MSG_TYPE
  12160. * Bits 7:0
  12161. * Purpose: identifies this as an rx ADDBA or DELBA message
  12162. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12163. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12164. * - IR (initiator / recipient)
  12165. * Bits 9:8 (DELBA only)
  12166. * Purpose: specify whether the DELBA handshake was initiated by the
  12167. * local STA/AP, or by the peer STA/AP
  12168. * Value:
  12169. * 0 - unspecified
  12170. * 1 - initiator (a.k.a. originator)
  12171. * 2 - recipient (a.k.a. responder)
  12172. * 3 - unused / reserved
  12173. * Value:
  12174. * block ack window length specified by the received ADDBA/DELBA
  12175. * management message.
  12176. * - TID
  12177. * Bits 19:16
  12178. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12179. * Value:
  12180. * TID specified by the received ADDBA or DELBA management message.
  12181. * - PEER_ID
  12182. * Bits 31:20
  12183. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12184. * Value:
  12185. * ID (hash value) used by the host for fast, direct lookup of
  12186. * host SW peer info, including rx reorder states.
  12187. * == DWORD 1
  12188. * - WIN_SIZE
  12189. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12190. * Purpose: Specifies the length of the block ack window (max = 8191).
  12191. */
  12192. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12193. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12194. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12195. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12196. /*--- Dword 0 ---*/
  12197. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12198. do { \
  12199. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12200. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12201. } while (0)
  12202. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12203. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12204. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12205. do { \
  12206. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12207. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12208. } while (0)
  12209. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12210. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12211. /*--- Dword 1 ---*/
  12212. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12213. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12214. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12215. do { \
  12216. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12217. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12218. } while (0)
  12219. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12220. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12221. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12222. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12223. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12224. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12225. #define HTT_RX_DELBA_EXTN_TID_S 16
  12226. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12227. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12228. /*--- Dword 0 ---*/
  12229. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12230. do { \
  12231. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12232. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12233. } while (0)
  12234. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12235. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12236. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12237. do { \
  12238. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12239. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12240. } while (0)
  12241. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12242. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12243. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12244. do { \
  12245. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12246. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12247. } while (0)
  12248. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12249. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12250. /*--- Dword 1 ---*/
  12251. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12252. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12253. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12254. do { \
  12255. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12256. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12257. } while (0)
  12258. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12259. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12260. #define HTT_RX_DELBA_EXTN_BYTES 8
  12261. /**
  12262. * @brief tx queue group information element definition
  12263. *
  12264. * @details
  12265. * The following diagram shows the format of the tx queue group
  12266. * information element, which can be included in target --> host
  12267. * messages to specify the number of tx "credits" (tx descriptors
  12268. * for LL, or tx buffers for HL) available to a particular group
  12269. * of host-side tx queues, and which host-side tx queues belong to
  12270. * the group.
  12271. *
  12272. * |31|30 24|23 16|15|14|13 0|
  12273. * |------------------------------------------------------------------------|
  12274. * | X| reserved | tx queue grp ID | A| S| credit count |
  12275. * |------------------------------------------------------------------------|
  12276. * | vdev ID mask | AC mask |
  12277. * |------------------------------------------------------------------------|
  12278. *
  12279. * The following definitions describe the fields within the tx queue group
  12280. * information element:
  12281. * - credit_count
  12282. * Bits 13:1
  12283. * Purpose: specify how many tx credits are available to the tx queue group
  12284. * Value: An absolute or relative, positive or negative credit value
  12285. * The 'A' bit specifies whether the value is absolute or relative.
  12286. * The 'S' bit specifies whether the value is positive or negative.
  12287. * A negative value can only be relative, not absolute.
  12288. * An absolute value replaces any prior credit value the host has for
  12289. * the tx queue group in question.
  12290. * A relative value is added to the prior credit value the host has for
  12291. * the tx queue group in question.
  12292. * - sign
  12293. * Bit 14
  12294. * Purpose: specify whether the credit count is positive or negative
  12295. * Value: 0 -> positive, 1 -> negative
  12296. * - absolute
  12297. * Bit 15
  12298. * Purpose: specify whether the credit count is absolute or relative
  12299. * Value: 0 -> relative, 1 -> absolute
  12300. * - txq_group_id
  12301. * Bits 23:16
  12302. * Purpose: indicate which tx queue group's credit and/or membership are
  12303. * being specified
  12304. * Value: 0 to max_tx_queue_groups-1
  12305. * - reserved
  12306. * Bits 30:16
  12307. * Value: 0x0
  12308. * - eXtension
  12309. * Bit 31
  12310. * Purpose: specify whether another tx queue group info element follows
  12311. * Value: 0 -> no more tx queue group information elements
  12312. * 1 -> another tx queue group information element immediately follows
  12313. * - ac_mask
  12314. * Bits 15:0
  12315. * Purpose: specify which Access Categories belong to the tx queue group
  12316. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12317. * the tx queue group.
  12318. * The AC bit-mask values are obtained by left-shifting by the
  12319. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12320. * - vdev_id_mask
  12321. * Bits 31:16
  12322. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12323. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12324. * belong to the tx queue group.
  12325. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12326. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12327. */
  12328. PREPACK struct htt_txq_group {
  12329. A_UINT32
  12330. credit_count: 14,
  12331. sign: 1,
  12332. absolute: 1,
  12333. tx_queue_group_id: 8,
  12334. reserved0: 7,
  12335. extension: 1;
  12336. A_UINT32
  12337. ac_mask: 16,
  12338. vdev_id_mask: 16;
  12339. } POSTPACK;
  12340. /* first word */
  12341. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12342. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12343. #define HTT_TXQ_GROUP_SIGN_S 14
  12344. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12345. #define HTT_TXQ_GROUP_ABS_S 15
  12346. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12347. #define HTT_TXQ_GROUP_ID_S 16
  12348. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12349. #define HTT_TXQ_GROUP_EXT_S 31
  12350. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12351. /* second word */
  12352. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12353. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12354. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12355. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12356. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12357. do { \
  12358. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12359. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12360. } while (0)
  12361. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12362. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12363. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12364. do { \
  12365. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12366. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12367. } while (0)
  12368. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12369. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12370. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12371. do { \
  12372. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12373. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12374. } while (0)
  12375. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12376. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12377. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12378. do { \
  12379. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12380. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12381. } while (0)
  12382. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12383. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12384. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12385. do { \
  12386. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12387. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12388. } while (0)
  12389. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12390. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12391. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12392. do { \
  12393. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12394. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12395. } while (0)
  12396. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12397. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12398. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12399. do { \
  12400. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12401. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12402. } while (0)
  12403. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12404. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12405. /**
  12406. * @brief target -> host TX completion indication message definition
  12407. *
  12408. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12409. *
  12410. * @details
  12411. * The following diagram shows the format of the TX completion indication sent
  12412. * from the target to the host
  12413. *
  12414. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12415. * |-------------------------------------------------------------------|
  12416. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12417. * |-------------------------------------------------------------------|
  12418. * payload:| MSDU1 ID | MSDU0 ID |
  12419. * |-------------------------------------------------------------------|
  12420. * : MSDU3 ID | MSDU2 ID :
  12421. * |-------------------------------------------------------------------|
  12422. * | struct htt_tx_compl_ind_append_retries |
  12423. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12424. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12425. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12426. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12427. * |-------------------------------------------------------------------|
  12428. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12429. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12430. * | MSDU0 tx_tsf64_low |
  12431. * |-------------------------------------------------------------------|
  12432. * | MSDU0 tx_tsf64_high |
  12433. * |-------------------------------------------------------------------|
  12434. * | MSDU1 tx_tsf64_low |
  12435. * |-------------------------------------------------------------------|
  12436. * | MSDU1 tx_tsf64_high |
  12437. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12438. * | phy_timestamp |
  12439. * |-------------------------------------------------------------------|
  12440. * | rate specs (see below) |
  12441. * |-------------------------------------------------------------------|
  12442. * | seqctrl | framectrl |
  12443. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12444. * Where:
  12445. * A0 = append (a.k.a. append0)
  12446. * A1 = append1
  12447. * TP = MSDU tx power presence
  12448. * A2 = append2
  12449. * A3 = append3
  12450. * A4 = append4
  12451. *
  12452. * The following field definitions describe the format of the TX completion
  12453. * indication sent from the target to the host
  12454. * Header fields:
  12455. * - msg_type
  12456. * Bits 7:0
  12457. * Purpose: identifies this as HTT TX completion indication
  12458. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12459. * - status
  12460. * Bits 10:8
  12461. * Purpose: the TX completion status of payload fragmentations descriptors
  12462. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12463. * - tid
  12464. * Bits 14:11
  12465. * Purpose: the tid associated with those fragmentation descriptors. It is
  12466. * valid or not, depending on the tid_invalid bit.
  12467. * Value: 0 to 15
  12468. * - tid_invalid
  12469. * Bits 15:15
  12470. * Purpose: this bit indicates whether the tid field is valid or not
  12471. * Value: 0 indicates valid; 1 indicates invalid
  12472. * - num
  12473. * Bits 23:16
  12474. * Purpose: the number of payload in this indication
  12475. * Value: 1 to 255
  12476. * - append (a.k.a. append0)
  12477. * Bits 24:24
  12478. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12479. * the number of tx retries for one MSDU at the end of this message
  12480. * Value: 0 indicates no appending; 1 indicates appending
  12481. * - append1
  12482. * Bits 25:25
  12483. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12484. * contains the timestamp info for each TX msdu id in payload.
  12485. * The order of the timestamps matches the order of the MSDU IDs.
  12486. * Note that a big-endian host needs to account for the reordering
  12487. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12488. * conversion) when determining which tx timestamp corresponds to
  12489. * which MSDU ID.
  12490. * Value: 0 indicates no appending; 1 indicates appending
  12491. * - msdu_tx_power_presence
  12492. * Bits 26:26
  12493. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12494. * for each MSDU referenced by the TX_COMPL_IND message.
  12495. * The tx power is reported in 0.5 dBm units.
  12496. * The order of the per-MSDU tx power reports matches the order
  12497. * of the MSDU IDs.
  12498. * Note that a big-endian host needs to account for the reordering
  12499. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12500. * conversion) when determining which Tx Power corresponds to
  12501. * which MSDU ID.
  12502. * Value: 0 indicates MSDU tx power reports are not appended,
  12503. * 1 indicates MSDU tx power reports are appended
  12504. * - append2
  12505. * Bits 27:27
  12506. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12507. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12508. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12509. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  12510. * for each MSDU, for convenience.
  12511. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12512. * this append2 bit is set).
  12513. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12514. * dB above the noise floor.
  12515. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12516. * 1 indicates MSDU ACK RSSI values are appended.
  12517. * - append3
  12518. * Bits 28:28
  12519. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12520. * contains the tx tsf info based on wlan global TSF for
  12521. * each TX msdu id in payload.
  12522. * The order of the tx tsf matches the order of the MSDU IDs.
  12523. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12524. * values to indicate the the lower 32 bits and higher 32 bits of
  12525. * the tx tsf.
  12526. * The tx_tsf64 here represents the time MSDU was acked and the
  12527. * tx_tsf64 has microseconds units.
  12528. * Value: 0 indicates no appending; 1 indicates appending
  12529. * - append4
  12530. * Bits 29:29
  12531. * Purpose: Indicate whether data frame control fields and fields required
  12532. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12533. * message. The order of the this message matches the order of
  12534. * the MSDU IDs.
  12535. * Value: 0 indicates frame control fields and fields required for
  12536. * radio tap header values are not appended,
  12537. * 1 indicates frame control fields and fields required for
  12538. * radio tap header values are appended.
  12539. * Payload fields:
  12540. * - hmsdu_id
  12541. * Bits 15:0
  12542. * Purpose: this ID is used to track the Tx buffer in host
  12543. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12544. */
  12545. PREPACK struct htt_tx_data_hdr_information {
  12546. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12547. A_UINT32 /* word 1 */
  12548. /* preamble:
  12549. * 0-OFDM,
  12550. * 1-CCk,
  12551. * 2-HT,
  12552. * 3-VHT
  12553. */
  12554. preamble: 2, /* [1:0] */
  12555. /* mcs:
  12556. * In case of HT preamble interpret
  12557. * MCS along with NSS.
  12558. * Valid values for HT are 0 to 7.
  12559. * HT mcs 0 with NSS 2 is mcs 8.
  12560. * Valid values for VHT are 0 to 9.
  12561. */
  12562. mcs: 4, /* [5:2] */
  12563. /* rate:
  12564. * This is applicable only for
  12565. * CCK and OFDM preamble type
  12566. * rate 0: OFDM 48 Mbps,
  12567. * 1: OFDM 24 Mbps,
  12568. * 2: OFDM 12 Mbps
  12569. * 3: OFDM 6 Mbps
  12570. * 4: OFDM 54 Mbps
  12571. * 5: OFDM 36 Mbps
  12572. * 6: OFDM 18 Mbps
  12573. * 7: OFDM 9 Mbps
  12574. * rate 0: CCK 11 Mbps Long
  12575. * 1: CCK 5.5 Mbps Long
  12576. * 2: CCK 2 Mbps Long
  12577. * 3: CCK 1 Mbps Long
  12578. * 4: CCK 11 Mbps Short
  12579. * 5: CCK 5.5 Mbps Short
  12580. * 6: CCK 2 Mbps Short
  12581. */
  12582. rate : 3, /* [ 8: 6] */
  12583. rssi : 8, /* [16: 9] units=dBm */
  12584. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12585. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12586. stbc : 1, /* [22] */
  12587. sgi : 1, /* [23] */
  12588. ldpc : 1, /* [24] */
  12589. beamformed: 1, /* [25] */
  12590. /* tx_retry_cnt:
  12591. * Indicates retry count of data tx frames provided by the host.
  12592. */
  12593. tx_retry_cnt: 6; /* [31:26] */
  12594. A_UINT32 /* word 2 */
  12595. framectrl:16, /* [15: 0] */
  12596. seqno:16; /* [31:16] */
  12597. } POSTPACK;
  12598. #define HTT_TX_COMPL_IND_STATUS_S 8
  12599. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12600. #define HTT_TX_COMPL_IND_TID_S 11
  12601. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12602. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12603. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12604. #define HTT_TX_COMPL_IND_NUM_S 16
  12605. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12606. #define HTT_TX_COMPL_IND_APPEND_S 24
  12607. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12608. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12609. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12610. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12611. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12612. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12613. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12614. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12615. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12616. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12617. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12618. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12619. do { \
  12620. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12621. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12622. } while (0)
  12623. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12624. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12625. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12626. do { \
  12627. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12628. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12629. } while (0)
  12630. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12631. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12632. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12633. do { \
  12634. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12635. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12636. } while (0)
  12637. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12638. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12639. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12640. do { \
  12641. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12642. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12643. } while (0)
  12644. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12645. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12646. HTT_TX_COMPL_IND_TID_INV_S)
  12647. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12648. do { \
  12649. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12650. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12651. } while (0)
  12652. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12653. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12654. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12655. do { \
  12656. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12657. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12658. } while (0)
  12659. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12660. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12661. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12662. do { \
  12663. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12664. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12665. } while (0)
  12666. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12667. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12668. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12669. do { \
  12670. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12671. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12672. } while (0)
  12673. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12674. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12675. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12676. do { \
  12677. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12678. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12679. } while (0)
  12680. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12681. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12682. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12683. do { \
  12684. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12685. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12686. } while (0)
  12687. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12688. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12689. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12690. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12691. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12692. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12693. #define HTT_TX_COMPL_IND_STAT_OK 0
  12694. /* DISCARD:
  12695. * current meaning:
  12696. * MSDUs were queued for transmission but filtered by HW or SW
  12697. * without any over the air attempts
  12698. * legacy meaning (HL Rome):
  12699. * MSDUs were discarded by the target FW without any over the air
  12700. * attempts due to lack of space
  12701. */
  12702. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12703. /* NO_ACK:
  12704. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12705. */
  12706. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12707. /* POSTPONE:
  12708. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12709. * be downloaded again later (in the appropriate order), when they are
  12710. * deliverable.
  12711. */
  12712. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12713. /*
  12714. * The PEER_DEL tx completion status is used for HL cases
  12715. * where the peer the frame is for has been deleted.
  12716. * The host has already discarded its copy of the frame, but
  12717. * it still needs the tx completion to restore its credit.
  12718. */
  12719. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12720. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12721. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12722. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12723. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12724. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12725. PREPACK struct htt_tx_compl_ind_base {
  12726. A_UINT32 hdr;
  12727. A_UINT16 payload[1/*or more*/];
  12728. } POSTPACK;
  12729. PREPACK struct htt_tx_compl_ind_append_retries {
  12730. A_UINT16 msdu_id;
  12731. A_UINT8 tx_retries;
  12732. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12733. 0: this is the last append_retries struct */
  12734. } POSTPACK;
  12735. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12736. A_UINT32 timestamp[1/*or more*/];
  12737. } POSTPACK;
  12738. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12739. A_UINT32 tx_tsf64_low;
  12740. A_UINT32 tx_tsf64_high;
  12741. } POSTPACK;
  12742. /* htt_tx_data_hdr_information payload extension fields: */
  12743. /* DWORD zero */
  12744. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12745. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12746. /* DWORD one */
  12747. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12748. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12749. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12750. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12751. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12752. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12753. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12754. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12755. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12756. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12757. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12758. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12759. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12760. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12761. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12762. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12763. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12764. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12765. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12766. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12767. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12768. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12769. /* DWORD two */
  12770. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12771. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12772. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12773. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12774. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12775. do { \
  12776. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12777. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12778. } while (0)
  12779. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12780. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12781. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12782. do { \
  12783. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12784. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12785. } while (0)
  12786. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12787. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12788. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12789. do { \
  12790. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12791. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12792. } while (0)
  12793. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12794. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12795. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12796. do { \
  12797. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12798. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12799. } while (0)
  12800. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12801. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12802. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12803. do { \
  12804. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12805. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12806. } while (0)
  12807. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12808. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12809. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12810. do { \
  12811. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12812. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12813. } while (0)
  12814. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12815. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12816. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12817. do { \
  12818. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12819. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12820. } while (0)
  12821. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12822. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12823. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12824. do { \
  12825. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12826. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12827. } while (0)
  12828. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12829. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12830. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12831. do { \
  12832. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12833. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12834. } while (0)
  12835. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12836. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12837. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12838. do { \
  12839. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12840. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12841. } while (0)
  12842. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12843. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12844. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12845. do { \
  12846. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12847. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12848. } while (0)
  12849. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12850. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12851. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12852. do { \
  12853. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12854. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12855. } while (0)
  12856. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12857. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12858. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12859. do { \
  12860. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12861. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12862. } while (0)
  12863. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12864. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12865. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12866. do { \
  12867. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12868. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12869. } while (0)
  12870. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12871. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12872. /**
  12873. * @brief target -> host rate-control update indication message
  12874. *
  12875. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12876. *
  12877. * @details
  12878. * The following diagram shows the format of the RC Update message
  12879. * sent from the target to the host, while processing the tx-completion
  12880. * of a transmitted PPDU.
  12881. *
  12882. * |31 24|23 16|15 8|7 0|
  12883. * |-------------------------------------------------------------|
  12884. * | peer ID | vdev ID | msg_type |
  12885. * |-------------------------------------------------------------|
  12886. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12887. * |-------------------------------------------------------------|
  12888. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12889. * |-------------------------------------------------------------|
  12890. * | : |
  12891. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12892. * | : |
  12893. * |-------------------------------------------------------------|
  12894. * | : |
  12895. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12896. * | : |
  12897. * |-------------------------------------------------------------|
  12898. * : :
  12899. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12900. *
  12901. */
  12902. typedef struct {
  12903. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12904. A_UINT32 rate_code_flags;
  12905. A_UINT32 flags; /* Encodes information such as excessive
  12906. retransmission, aggregate, some info
  12907. from .11 frame control,
  12908. STBC, LDPC, (SGI and Tx Chain Mask
  12909. are encoded in ptx_rc->flags field),
  12910. AMPDU truncation (BT/time based etc.),
  12911. RTS/CTS attempt */
  12912. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12913. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12914. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12915. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12916. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12917. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12918. } HTT_RC_TX_DONE_PARAMS;
  12919. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12920. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12921. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12922. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12923. #define HTT_RC_UPDATE_VDEVID_S 8
  12924. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12925. #define HTT_RC_UPDATE_PEERID_S 16
  12926. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12927. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12928. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12929. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12930. do { \
  12931. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12932. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12933. } while (0)
  12934. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12935. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12936. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12937. do { \
  12938. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12939. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12940. } while (0)
  12941. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12942. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12943. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12944. do { \
  12945. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12946. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12947. } while (0)
  12948. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12949. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12950. /**
  12951. * @brief target -> host rx fragment indication message definition
  12952. *
  12953. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12954. *
  12955. * @details
  12956. * The following field definitions describe the format of the rx fragment
  12957. * indication message sent from the target to the host.
  12958. * The rx fragment indication message shares the format of the
  12959. * rx indication message, but not all fields from the rx indication message
  12960. * are relevant to the rx fragment indication message.
  12961. *
  12962. *
  12963. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12964. * |-----------+-------------------+---------------------+-------------|
  12965. * | peer ID | |FV| ext TID | msg type |
  12966. * |-------------------------------------------------------------------|
  12967. * | | flush | flush |
  12968. * | | end | start |
  12969. * | | seq num | seq num |
  12970. * |-------------------------------------------------------------------|
  12971. * | reserved | FW rx desc bytes |
  12972. * |-------------------------------------------------------------------|
  12973. * | | FW MSDU Rx |
  12974. * | | desc B0 |
  12975. * |-------------------------------------------------------------------|
  12976. * Header fields:
  12977. * - MSG_TYPE
  12978. * Bits 7:0
  12979. * Purpose: identifies this as an rx fragment indication message
  12980. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12981. * - EXT_TID
  12982. * Bits 12:8
  12983. * Purpose: identify the traffic ID of the rx data, including
  12984. * special "extended" TID values for multicast, broadcast, and
  12985. * non-QoS data frames
  12986. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12987. * - FLUSH_VALID (FV)
  12988. * Bit 13
  12989. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12990. * is valid
  12991. * Value:
  12992. * 1 -> flush IE is valid and needs to be processed
  12993. * 0 -> flush IE is not valid and should be ignored
  12994. * - PEER_ID
  12995. * Bits 31:16
  12996. * Purpose: Identify, by ID, which peer sent the rx data
  12997. * Value: ID of the peer who sent the rx data
  12998. * - FLUSH_SEQ_NUM_START
  12999. * Bits 5:0
  13000. * Purpose: Indicate the start of a series of MPDUs to flush
  13001. * Not all MPDUs within this series are necessarily valid - the host
  13002. * must check each sequence number within this range to see if the
  13003. * corresponding MPDU is actually present.
  13004. * This field is only valid if the FV bit is set.
  13005. * Value:
  13006. * The sequence number for the first MPDUs to check to flush.
  13007. * The sequence number is masked by 0x3f.
  13008. * - FLUSH_SEQ_NUM_END
  13009. * Bits 11:6
  13010. * Purpose: Indicate the end of a series of MPDUs to flush
  13011. * Value:
  13012. * The sequence number one larger than the sequence number of the
  13013. * last MPDU to check to flush.
  13014. * The sequence number is masked by 0x3f.
  13015. * Not all MPDUs within this series are necessarily valid - the host
  13016. * must check each sequence number within this range to see if the
  13017. * corresponding MPDU is actually present.
  13018. * This field is only valid if the FV bit is set.
  13019. * Rx descriptor fields:
  13020. * - FW_RX_DESC_BYTES
  13021. * Bits 15:0
  13022. * Purpose: Indicate how many bytes in the Rx indication are used for
  13023. * FW Rx descriptors
  13024. * Value: 1
  13025. */
  13026. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13027. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13028. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13029. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13030. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13031. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13032. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13033. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13034. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13035. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13036. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13037. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13038. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13039. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13040. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13041. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13042. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13043. #define HTT_RX_FRAG_IND_BYTES \
  13044. (4 /* msg hdr */ + \
  13045. 4 /* flush spec */ + \
  13046. 4 /* (unused) FW rx desc bytes spec */ + \
  13047. 4 /* FW rx desc */)
  13048. /**
  13049. * @brief target -> host test message definition
  13050. *
  13051. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13052. *
  13053. * @details
  13054. * The following field definitions describe the format of the test
  13055. * message sent from the target to the host.
  13056. * The message consists of a 4-octet header, followed by a variable
  13057. * number of 32-bit integer values, followed by a variable number
  13058. * of 8-bit character values.
  13059. *
  13060. * |31 16|15 8|7 0|
  13061. * |-----------------------------------------------------------|
  13062. * | num chars | num ints | msg type |
  13063. * |-----------------------------------------------------------|
  13064. * | int 0 |
  13065. * |-----------------------------------------------------------|
  13066. * | int 1 |
  13067. * |-----------------------------------------------------------|
  13068. * | ... |
  13069. * |-----------------------------------------------------------|
  13070. * | char 3 | char 2 | char 1 | char 0 |
  13071. * |-----------------------------------------------------------|
  13072. * | | | ... | char 4 |
  13073. * |-----------------------------------------------------------|
  13074. * - MSG_TYPE
  13075. * Bits 7:0
  13076. * Purpose: identifies this as a test message
  13077. * Value: HTT_MSG_TYPE_TEST
  13078. * - NUM_INTS
  13079. * Bits 15:8
  13080. * Purpose: indicate how many 32-bit integers follow the message header
  13081. * - NUM_CHARS
  13082. * Bits 31:16
  13083. * Purpose: indicate how many 8-bit charaters follow the series of integers
  13084. */
  13085. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13086. #define HTT_RX_TEST_NUM_INTS_S 8
  13087. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13088. #define HTT_RX_TEST_NUM_CHARS_S 16
  13089. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13090. do { \
  13091. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13092. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13093. } while (0)
  13094. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13095. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13096. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13097. do { \
  13098. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13099. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13100. } while (0)
  13101. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13102. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13103. /**
  13104. * @brief target -> host packet log message
  13105. *
  13106. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13107. *
  13108. * @details
  13109. * The following field definitions describe the format of the packet log
  13110. * message sent from the target to the host.
  13111. * The message consists of a 4-octet header,followed by a variable number
  13112. * of 32-bit character values.
  13113. *
  13114. * |31 16|15 12|11 10|9 8|7 0|
  13115. * |------------------------------------------------------------------|
  13116. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13117. * |------------------------------------------------------------------|
  13118. * | payload |
  13119. * |------------------------------------------------------------------|
  13120. * - MSG_TYPE
  13121. * Bits 7:0
  13122. * Purpose: identifies this as a pktlog message
  13123. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13124. * - mac_id
  13125. * Bits 9:8
  13126. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13127. * Value: 0-3
  13128. * - pdev_id
  13129. * Bits 11:10
  13130. * Purpose: pdev_id
  13131. * Value: 0-3
  13132. * 0 (for rings at SOC level),
  13133. * 1/2/3 PDEV -> 0/1/2
  13134. * - payload_size
  13135. * Bits 31:16
  13136. * Purpose: explicitly specify the payload size
  13137. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13138. */
  13139. PREPACK struct htt_pktlog_msg {
  13140. A_UINT32 header;
  13141. A_UINT32 payload[1/* or more */];
  13142. } POSTPACK;
  13143. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13144. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13145. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13146. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13147. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13148. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13149. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13150. do { \
  13151. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13152. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13153. } while (0)
  13154. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13155. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13156. HTT_T2H_PKTLOG_MAC_ID_S)
  13157. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13158. do { \
  13159. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13160. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13161. } while (0)
  13162. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13163. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13164. HTT_T2H_PKTLOG_PDEV_ID_S)
  13165. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13166. do { \
  13167. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13168. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13169. } while (0)
  13170. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13171. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13172. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13173. /*
  13174. * Rx reorder statistics
  13175. * NB: all the fields must be defined in 4 octets size.
  13176. */
  13177. struct rx_reorder_stats {
  13178. /* Non QoS MPDUs received */
  13179. A_UINT32 deliver_non_qos;
  13180. /* MPDUs received in-order */
  13181. A_UINT32 deliver_in_order;
  13182. /* Flush due to reorder timer expired */
  13183. A_UINT32 deliver_flush_timeout;
  13184. /* Flush due to move out of window */
  13185. A_UINT32 deliver_flush_oow;
  13186. /* Flush due to DELBA */
  13187. A_UINT32 deliver_flush_delba;
  13188. /* MPDUs dropped due to FCS error */
  13189. A_UINT32 fcs_error;
  13190. /* MPDUs dropped due to monitor mode non-data packet */
  13191. A_UINT32 mgmt_ctrl;
  13192. /* Unicast-data MPDUs dropped due to invalid peer */
  13193. A_UINT32 invalid_peer;
  13194. /* MPDUs dropped due to duplication (non aggregation) */
  13195. A_UINT32 dup_non_aggr;
  13196. /* MPDUs dropped due to processed before */
  13197. A_UINT32 dup_past;
  13198. /* MPDUs dropped due to duplicate in reorder queue */
  13199. A_UINT32 dup_in_reorder;
  13200. /* Reorder timeout happened */
  13201. A_UINT32 reorder_timeout;
  13202. /* invalid bar ssn */
  13203. A_UINT32 invalid_bar_ssn;
  13204. /* reorder reset due to bar ssn */
  13205. A_UINT32 ssn_reset;
  13206. /* Flush due to delete peer */
  13207. A_UINT32 deliver_flush_delpeer;
  13208. /* Flush due to offload*/
  13209. A_UINT32 deliver_flush_offload;
  13210. /* Flush due to out of buffer*/
  13211. A_UINT32 deliver_flush_oob;
  13212. /* MPDUs dropped due to PN check fail */
  13213. A_UINT32 pn_fail;
  13214. /* MPDUs dropped due to unable to allocate memory */
  13215. A_UINT32 store_fail;
  13216. /* Number of times the tid pool alloc succeeded */
  13217. A_UINT32 tid_pool_alloc_succ;
  13218. /* Number of times the MPDU pool alloc succeeded */
  13219. A_UINT32 mpdu_pool_alloc_succ;
  13220. /* Number of times the MSDU pool alloc succeeded */
  13221. A_UINT32 msdu_pool_alloc_succ;
  13222. /* Number of times the tid pool alloc failed */
  13223. A_UINT32 tid_pool_alloc_fail;
  13224. /* Number of times the MPDU pool alloc failed */
  13225. A_UINT32 mpdu_pool_alloc_fail;
  13226. /* Number of times the MSDU pool alloc failed */
  13227. A_UINT32 msdu_pool_alloc_fail;
  13228. /* Number of times the tid pool freed */
  13229. A_UINT32 tid_pool_free;
  13230. /* Number of times the MPDU pool freed */
  13231. A_UINT32 mpdu_pool_free;
  13232. /* Number of times the MSDU pool freed */
  13233. A_UINT32 msdu_pool_free;
  13234. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13235. A_UINT32 msdu_queued;
  13236. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13237. A_UINT32 msdu_recycled;
  13238. /* Number of MPDUs with invalid peer but A2 found in AST */
  13239. A_UINT32 invalid_peer_a2_in_ast;
  13240. /* Number of MPDUs with invalid peer but A3 found in AST */
  13241. A_UINT32 invalid_peer_a3_in_ast;
  13242. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13243. A_UINT32 invalid_peer_bmc_mpdus;
  13244. /* Number of MSDUs with err attention word */
  13245. A_UINT32 rxdesc_err_att;
  13246. /* Number of MSDUs with flag of peer_idx_invalid */
  13247. A_UINT32 rxdesc_err_peer_idx_inv;
  13248. /* Number of MSDUs with flag of peer_idx_timeout */
  13249. A_UINT32 rxdesc_err_peer_idx_to;
  13250. /* Number of MSDUs with flag of overflow */
  13251. A_UINT32 rxdesc_err_ov;
  13252. /* Number of MSDUs with flag of msdu_length_err */
  13253. A_UINT32 rxdesc_err_msdu_len;
  13254. /* Number of MSDUs with flag of mpdu_length_err */
  13255. A_UINT32 rxdesc_err_mpdu_len;
  13256. /* Number of MSDUs with flag of tkip_mic_err */
  13257. A_UINT32 rxdesc_err_tkip_mic;
  13258. /* Number of MSDUs with flag of decrypt_err */
  13259. A_UINT32 rxdesc_err_decrypt;
  13260. /* Number of MSDUs with flag of fcs_err */
  13261. A_UINT32 rxdesc_err_fcs;
  13262. /* Number of Unicast (bc_mc bit is not set in attention word)
  13263. * frames with invalid peer handler
  13264. */
  13265. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13266. /* Number of unicast frame directly (direct bit is set in attention word)
  13267. * to DUT with invalid peer handler
  13268. */
  13269. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13270. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13271. * frames with invalid peer handler
  13272. */
  13273. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13274. /* Number of MSDUs dropped due to no first MSDU flag */
  13275. A_UINT32 rxdesc_no_1st_msdu;
  13276. /* Number of MSDUs droped due to ring overflow */
  13277. A_UINT32 msdu_drop_ring_ov;
  13278. /* Number of MSDUs dropped due to FC mismatch */
  13279. A_UINT32 msdu_drop_fc_mismatch;
  13280. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13281. A_UINT32 msdu_drop_mgmt_remote_ring;
  13282. /* Number of MSDUs dropped due to errors not reported in attention word */
  13283. A_UINT32 msdu_drop_misc;
  13284. /* Number of MSDUs go to offload before reorder */
  13285. A_UINT32 offload_msdu_wal;
  13286. /* Number of data frame dropped by offload after reorder */
  13287. A_UINT32 offload_msdu_reorder;
  13288. /* Number of MPDUs with sequence number in the past and within the BA window */
  13289. A_UINT32 dup_past_within_window;
  13290. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13291. A_UINT32 dup_past_outside_window;
  13292. /* Number of MSDUs with decrypt/MIC error */
  13293. A_UINT32 rxdesc_err_decrypt_mic;
  13294. /* Number of data MSDUs received on both local and remote rings */
  13295. A_UINT32 data_msdus_on_both_rings;
  13296. /* MPDUs never filled */
  13297. A_UINT32 holes_not_filled;
  13298. };
  13299. /*
  13300. * Rx Remote buffer statistics
  13301. * NB: all the fields must be defined in 4 octets size.
  13302. */
  13303. struct rx_remote_buffer_mgmt_stats {
  13304. /* Total number of MSDUs reaped for Rx processing */
  13305. A_UINT32 remote_reaped;
  13306. /* MSDUs recycled within firmware */
  13307. A_UINT32 remote_recycled;
  13308. /* MSDUs stored by Data Rx */
  13309. A_UINT32 data_rx_msdus_stored;
  13310. /* Number of HTT indications from WAL Rx MSDU */
  13311. A_UINT32 wal_rx_ind;
  13312. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13313. A_UINT32 wal_rx_ind_unconsumed;
  13314. /* Number of HTT indications from Data Rx MSDU */
  13315. A_UINT32 data_rx_ind;
  13316. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13317. A_UINT32 data_rx_ind_unconsumed;
  13318. /* Number of HTT indications from ATHBUF */
  13319. A_UINT32 athbuf_rx_ind;
  13320. /* Number of remote buffers requested for refill */
  13321. A_UINT32 refill_buf_req;
  13322. /* Number of remote buffers filled by the host */
  13323. A_UINT32 refill_buf_rsp;
  13324. /* Number of times MAC hw_index = f/w write_index */
  13325. A_INT32 mac_no_bufs;
  13326. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13327. A_INT32 fw_indices_equal;
  13328. /* Number of times f/w finds no buffers to post */
  13329. A_INT32 host_no_bufs;
  13330. };
  13331. /*
  13332. * TXBF MU/SU packets and NDPA statistics
  13333. * NB: all the fields must be defined in 4 octets size.
  13334. */
  13335. struct rx_txbf_musu_ndpa_pkts_stats {
  13336. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13337. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13338. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13339. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13340. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13341. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13342. };
  13343. /*
  13344. * htt_dbg_stats_status -
  13345. * present - The requested stats have been delivered in full.
  13346. * This indicates that either the stats information was contained
  13347. * in its entirety within this message, or else this message
  13348. * completes the delivery of the requested stats info that was
  13349. * partially delivered through earlier STATS_CONF messages.
  13350. * partial - The requested stats have been delivered in part.
  13351. * One or more subsequent STATS_CONF messages with the same
  13352. * cookie value will be sent to deliver the remainder of the
  13353. * information.
  13354. * error - The requested stats could not be delivered, for example due
  13355. * to a shortage of memory to construct a message holding the
  13356. * requested stats.
  13357. * invalid - The requested stat type is either not recognized, or the
  13358. * target is configured to not gather the stats type in question.
  13359. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13360. * series_done - This special value indicates that no further stats info
  13361. * elements are present within a series of stats info elems
  13362. * (within a stats upload confirmation message).
  13363. */
  13364. enum htt_dbg_stats_status {
  13365. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13366. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13367. HTT_DBG_STATS_STATUS_ERROR = 2,
  13368. HTT_DBG_STATS_STATUS_INVALID = 3,
  13369. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13370. };
  13371. /**
  13372. * @brief target -> host statistics upload
  13373. *
  13374. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13375. *
  13376. * @details
  13377. * The following field definitions describe the format of the HTT target
  13378. * to host stats upload confirmation message.
  13379. * The message contains a cookie echoed from the HTT host->target stats
  13380. * upload request, which identifies which request the confirmation is
  13381. * for, and a series of tag-length-value stats information elements.
  13382. * The tag-length header for each stats info element also includes a
  13383. * status field, to indicate whether the request for the stat type in
  13384. * question was fully met, partially met, unable to be met, or invalid
  13385. * (if the stat type in question is disabled in the target).
  13386. * A special value of all 1's in this status field is used to indicate
  13387. * the end of the series of stats info elements.
  13388. *
  13389. *
  13390. * |31 16|15 8|7 5|4 0|
  13391. * |------------------------------------------------------------|
  13392. * | reserved | msg type |
  13393. * |------------------------------------------------------------|
  13394. * | cookie LSBs |
  13395. * |------------------------------------------------------------|
  13396. * | cookie MSBs |
  13397. * |------------------------------------------------------------|
  13398. * | stats entry length | reserved | S |stat type|
  13399. * |------------------------------------------------------------|
  13400. * | |
  13401. * | type-specific stats info |
  13402. * | |
  13403. * |------------------------------------------------------------|
  13404. * | stats entry length | reserved | S |stat type|
  13405. * |------------------------------------------------------------|
  13406. * | |
  13407. * | type-specific stats info |
  13408. * | |
  13409. * |------------------------------------------------------------|
  13410. * | n/a | reserved | 111 | n/a |
  13411. * |------------------------------------------------------------|
  13412. * Header fields:
  13413. * - MSG_TYPE
  13414. * Bits 7:0
  13415. * Purpose: identifies this is a statistics upload confirmation message
  13416. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13417. * - COOKIE_LSBS
  13418. * Bits 31:0
  13419. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13420. * message with its preceding host->target stats request message.
  13421. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13422. * - COOKIE_MSBS
  13423. * Bits 31:0
  13424. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13425. * message with its preceding host->target stats request message.
  13426. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13427. *
  13428. * Stats Information Element tag-length header fields:
  13429. * - STAT_TYPE
  13430. * Bits 4:0
  13431. * Purpose: identifies the type of statistics info held in the
  13432. * following information element
  13433. * Value: htt_dbg_stats_type
  13434. * - STATUS
  13435. * Bits 7:5
  13436. * Purpose: indicate whether the requested stats are present
  13437. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13438. * the completion of the stats entry series
  13439. * - LENGTH
  13440. * Bits 31:16
  13441. * Purpose: indicate the stats information size
  13442. * Value: This field specifies the number of bytes of stats information
  13443. * that follows the element tag-length header.
  13444. * It is expected but not required that this length is a multiple of
  13445. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13446. * subsequent stats entry header will begin on a 4-byte aligned
  13447. * boundary.
  13448. */
  13449. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13450. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13451. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13452. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13453. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13454. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13455. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13456. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13457. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13458. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13459. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13460. do { \
  13461. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13462. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13463. } while (0)
  13464. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13465. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13466. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13467. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13468. do { \
  13469. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13470. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13471. } while (0)
  13472. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13473. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13474. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13475. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13476. do { \
  13477. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13478. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13479. } while (0)
  13480. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13481. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13482. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13483. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13484. #define HTT_MAX_AGGR 64
  13485. #define HTT_HL_MAX_AGGR 18
  13486. /**
  13487. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13488. *
  13489. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13490. *
  13491. * @details
  13492. * The following field definitions describe the format of the HTT host
  13493. * to target frag_desc/msdu_ext bank configuration message.
  13494. * The message contains the based address and the min and max id of the
  13495. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13496. * MSDU_EXT/FRAG_DESC.
  13497. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13498. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13499. * the hardware does the mapping/translation.
  13500. *
  13501. * Total banks that can be configured is configured to 16.
  13502. *
  13503. * This should be called before any TX has be initiated by the HTT
  13504. *
  13505. * |31 16|15 8|7 5|4 0|
  13506. * |------------------------------------------------------------|
  13507. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13508. * |------------------------------------------------------------|
  13509. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13510. #if HTT_PADDR64
  13511. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13512. #endif
  13513. * |------------------------------------------------------------|
  13514. * | ... |
  13515. * |------------------------------------------------------------|
  13516. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13517. #if HTT_PADDR64
  13518. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13519. #endif
  13520. * |------------------------------------------------------------|
  13521. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13522. * |------------------------------------------------------------|
  13523. * | ... |
  13524. * |------------------------------------------------------------|
  13525. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13526. * |------------------------------------------------------------|
  13527. * Header fields:
  13528. * - MSG_TYPE
  13529. * Bits 7:0
  13530. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13531. * for systems with 64-bit format for bus addresses:
  13532. * - BANKx_BASE_ADDRESS_LO
  13533. * Bits 31:0
  13534. * Purpose: Provide a mechanism to specify the base address of the
  13535. * MSDU_EXT bank physical/bus address.
  13536. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13537. * - BANKx_BASE_ADDRESS_HI
  13538. * Bits 31:0
  13539. * Purpose: Provide a mechanism to specify the base address of the
  13540. * MSDU_EXT bank physical/bus address.
  13541. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13542. * for systems with 32-bit format for bus addresses:
  13543. * - BANKx_BASE_ADDRESS
  13544. * Bits 31:0
  13545. * Purpose: Provide a mechanism to specify the base address of the
  13546. * MSDU_EXT bank physical/bus address.
  13547. * Value: MSDU_EXT bank physical / bus address
  13548. * - BANKx_MIN_ID
  13549. * Bits 15:0
  13550. * Purpose: Provide a mechanism to specify the min index that needs to
  13551. * mapped.
  13552. * - BANKx_MAX_ID
  13553. * Bits 31:16
  13554. * Purpose: Provide a mechanism to specify the max index that needs to
  13555. * mapped.
  13556. *
  13557. */
  13558. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13559. * safe value.
  13560. * @note MAX supported banks is 16.
  13561. */
  13562. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13563. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13564. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13565. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13566. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13567. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13568. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13569. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13570. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13571. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13572. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13573. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13574. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13575. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13576. do { \
  13577. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13578. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13579. } while (0)
  13580. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13581. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13582. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13583. do { \
  13584. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13585. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13586. } while (0)
  13587. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13588. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13589. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13590. do { \
  13591. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13592. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13593. } while (0)
  13594. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13595. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13596. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13597. do { \
  13598. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13599. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13600. } while (0)
  13601. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13602. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13603. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13604. do { \
  13605. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13606. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13607. } while (0)
  13608. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13609. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13610. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13611. do { \
  13612. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13613. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13614. } while (0)
  13615. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13616. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13617. /*
  13618. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13619. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13620. * addresses are stored in a XXX-bit field.
  13621. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13622. * htt_tx_frag_desc64_bank_cfg_t structs.
  13623. */
  13624. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13625. _paddr_bits_, \
  13626. _paddr__bank_base_address_) \
  13627. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13628. /** word 0 \
  13629. * msg_type: 8, \
  13630. * pdev_id: 2, \
  13631. * swap: 1, \
  13632. * reserved0: 5, \
  13633. * num_banks: 8, \
  13634. * desc_size: 8; \
  13635. */ \
  13636. A_UINT32 word0; \
  13637. /* \
  13638. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13639. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13640. * the second A_UINT32). \
  13641. */ \
  13642. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13643. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13644. } POSTPACK
  13645. /* define htt_tx_frag_desc32_bank_cfg_t */
  13646. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13647. /* define htt_tx_frag_desc64_bank_cfg_t */
  13648. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13649. /*
  13650. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13651. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13652. */
  13653. #if HTT_PADDR64
  13654. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13655. #else
  13656. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13657. #endif
  13658. /**
  13659. * @brief target -> host HTT TX Credit total count update message definition
  13660. *
  13661. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13662. *
  13663. *|31 16|15|14 9| 8 |7 0 |
  13664. *|---------------------+--+----------+-------+----------|
  13665. *|cur htt credit delta | Q| reserved | sign | msg type |
  13666. *|------------------------------------------------------|
  13667. *
  13668. * Header fields:
  13669. * - MSG_TYPE
  13670. * Bits 7:0
  13671. * Purpose: identifies this as a htt tx credit delta update message
  13672. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13673. * - SIGN
  13674. * Bits 8
  13675. * identifies whether credit delta is positive or negative
  13676. * Value:
  13677. * - 0x0: credit delta is positive, rebalance in some buffers
  13678. * - 0x1: credit delta is negative, rebalance out some buffers
  13679. * - reserved
  13680. * Bits 14:9
  13681. * Value: 0x0
  13682. * - TXQ_GRP
  13683. * Bit 15
  13684. * Purpose: indicates whether any tx queue group information elements
  13685. * are appended to the tx credit update message
  13686. * Value: 0 -> no tx queue group information element is present
  13687. * 1 -> a tx queue group information element immediately follows
  13688. * - DELTA_COUNT
  13689. * Bits 31:16
  13690. * Purpose: Specify current htt credit delta absolute count
  13691. */
  13692. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13693. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13694. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13695. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13696. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13697. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13698. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13699. do { \
  13700. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13701. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13702. } while (0)
  13703. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13704. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13705. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13706. do { \
  13707. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13708. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13709. } while (0)
  13710. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13711. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13712. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13713. do { \
  13714. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13715. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13716. } while (0)
  13717. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13718. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13719. #define HTT_TX_CREDIT_MSG_BYTES 4
  13720. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13721. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13722. /**
  13723. * @brief HTT WDI_IPA Operation Response Message
  13724. *
  13725. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13726. *
  13727. * @details
  13728. * HTT WDI_IPA Operation Response message is sent by target
  13729. * to host confirming suspend or resume operation.
  13730. * |31 24|23 16|15 8|7 0|
  13731. * |----------------+----------------+----------------+----------------|
  13732. * | op_code | Rsvd | msg_type |
  13733. * |-------------------------------------------------------------------|
  13734. * | Rsvd | Response len |
  13735. * |-------------------------------------------------------------------|
  13736. * | |
  13737. * | Response-type specific info |
  13738. * | |
  13739. * | |
  13740. * |-------------------------------------------------------------------|
  13741. * Header fields:
  13742. * - MSG_TYPE
  13743. * Bits 7:0
  13744. * Purpose: Identifies this as WDI_IPA Operation Response message
  13745. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13746. * - OP_CODE
  13747. * Bits 31:16
  13748. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13749. * value: = enum htt_wdi_ipa_op_code
  13750. * - RSP_LEN
  13751. * Bits 16:0
  13752. * Purpose: length for the response-type specific info
  13753. * value: = length in bytes for response-type specific info
  13754. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13755. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13756. */
  13757. PREPACK struct htt_wdi_ipa_op_response_t
  13758. {
  13759. /* DWORD 0: flags and meta-data */
  13760. A_UINT32
  13761. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13762. reserved1: 8,
  13763. op_code: 16;
  13764. A_UINT32
  13765. rsp_len: 16,
  13766. reserved2: 16;
  13767. } POSTPACK;
  13768. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13769. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13770. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13771. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13772. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13773. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13774. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13775. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13776. do { \
  13777. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13778. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13779. } while (0)
  13780. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13781. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13782. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13783. do { \
  13784. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13785. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13786. } while (0)
  13787. enum htt_phy_mode {
  13788. htt_phy_mode_11a = 0,
  13789. htt_phy_mode_11g = 1,
  13790. htt_phy_mode_11b = 2,
  13791. htt_phy_mode_11g_only = 3,
  13792. htt_phy_mode_11na_ht20 = 4,
  13793. htt_phy_mode_11ng_ht20 = 5,
  13794. htt_phy_mode_11na_ht40 = 6,
  13795. htt_phy_mode_11ng_ht40 = 7,
  13796. htt_phy_mode_11ac_vht20 = 8,
  13797. htt_phy_mode_11ac_vht40 = 9,
  13798. htt_phy_mode_11ac_vht80 = 10,
  13799. htt_phy_mode_11ac_vht20_2g = 11,
  13800. htt_phy_mode_11ac_vht40_2g = 12,
  13801. htt_phy_mode_11ac_vht80_2g = 13,
  13802. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13803. htt_phy_mode_11ac_vht160 = 15,
  13804. htt_phy_mode_max,
  13805. };
  13806. /**
  13807. * @brief target -> host HTT channel change indication
  13808. *
  13809. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13810. *
  13811. * @details
  13812. * Specify when a channel change occurs.
  13813. * This allows the host to precisely determine which rx frames arrived
  13814. * on the old channel and which rx frames arrived on the new channel.
  13815. *
  13816. *|31 |7 0 |
  13817. *|-------------------------------------------+----------|
  13818. *| reserved | msg type |
  13819. *|------------------------------------------------------|
  13820. *| primary_chan_center_freq_mhz |
  13821. *|------------------------------------------------------|
  13822. *| contiguous_chan1_center_freq_mhz |
  13823. *|------------------------------------------------------|
  13824. *| contiguous_chan2_center_freq_mhz |
  13825. *|------------------------------------------------------|
  13826. *| phy_mode |
  13827. *|------------------------------------------------------|
  13828. *
  13829. * Header fields:
  13830. * - MSG_TYPE
  13831. * Bits 7:0
  13832. * Purpose: identifies this as a htt channel change indication message
  13833. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13834. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13835. * Bits 31:0
  13836. * Purpose: identify the (center of the) new 20 MHz primary channel
  13837. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13838. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13839. * Bits 31:0
  13840. * Purpose: identify the (center of the) contiguous frequency range
  13841. * comprising the new channel.
  13842. * For example, if the new channel is a 80 MHz channel extending
  13843. * 60 MHz beyond the primary channel, this field would be 30 larger
  13844. * than the primary channel center frequency field.
  13845. * Value: center frequency of the contiguous frequency range comprising
  13846. * the full channel in MHz units
  13847. * (80+80 channels also use the CONTIG_CHAN2 field)
  13848. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13849. * Bits 31:0
  13850. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13851. * within a VHT 80+80 channel.
  13852. * This field is only relevant for VHT 80+80 channels.
  13853. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13854. * channel (arbitrary value for cases besides VHT 80+80)
  13855. * - PHY_MODE
  13856. * Bits 31:0
  13857. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13858. * and band
  13859. * Value: htt_phy_mode enum value
  13860. */
  13861. PREPACK struct htt_chan_change_t
  13862. {
  13863. /* DWORD 0: flags and meta-data */
  13864. A_UINT32
  13865. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13866. reserved1: 24;
  13867. A_UINT32 primary_chan_center_freq_mhz;
  13868. A_UINT32 contig_chan1_center_freq_mhz;
  13869. A_UINT32 contig_chan2_center_freq_mhz;
  13870. A_UINT32 phy_mode;
  13871. } POSTPACK;
  13872. /*
  13873. * Due to historical / backwards-compatibility reasons, maintain the
  13874. * below htt_chan_change_msg struct definition, which needs to be
  13875. * consistent with the above htt_chan_change_t struct definition
  13876. * (aside from the htt_chan_change_t definition including the msg_type
  13877. * dword within the message, and the htt_chan_change_msg only containing
  13878. * the payload of the message that follows the msg_type dword).
  13879. */
  13880. PREPACK struct htt_chan_change_msg {
  13881. A_UINT32 chan_mhz; /* frequency in mhz */
  13882. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13883. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13884. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13885. } POSTPACK;
  13886. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13887. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13888. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13889. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13890. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13891. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13892. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13893. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13894. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13895. do { \
  13896. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13897. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13898. } while (0)
  13899. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13900. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13901. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13902. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13903. do { \
  13904. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13905. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13906. } while (0)
  13907. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13908. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13909. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13910. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13911. do { \
  13912. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13913. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13914. } while (0)
  13915. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13916. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13917. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13918. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13919. do { \
  13920. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13921. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13922. } while (0)
  13923. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13924. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13925. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13926. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13927. /**
  13928. * @brief rx offload packet error message
  13929. *
  13930. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13931. *
  13932. * @details
  13933. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13934. * of target payload like mic err.
  13935. *
  13936. * |31 24|23 16|15 8|7 0|
  13937. * |----------------+----------------+----------------+----------------|
  13938. * | tid | vdev_id | msg_sub_type | msg_type |
  13939. * |-------------------------------------------------------------------|
  13940. * : (sub-type dependent content) :
  13941. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13942. * Header fields:
  13943. * - msg_type
  13944. * Bits 7:0
  13945. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13946. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13947. * - msg_sub_type
  13948. * Bits 15:8
  13949. * Purpose: Identifies which type of rx error is reported by this message
  13950. * value: htt_rx_ofld_pkt_err_type
  13951. * - vdev_id
  13952. * Bits 23:16
  13953. * Purpose: Identifies which vdev received the erroneous rx frame
  13954. * value:
  13955. * - tid
  13956. * Bits 31:24
  13957. * Purpose: Identifies the traffic type of the rx frame
  13958. * value:
  13959. *
  13960. * - The payload fields used if the sub-type == MIC error are shown below.
  13961. * Note - MIC err is per MSDU, while PN is per MPDU.
  13962. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13963. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13964. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13965. * instead of sending separate HTT messages for each wrong MSDU within
  13966. * the MPDU.
  13967. *
  13968. * |31 24|23 16|15 8|7 0|
  13969. * |----------------+----------------+----------------+----------------|
  13970. * | Rsvd | key_id | peer_id |
  13971. * |-------------------------------------------------------------------|
  13972. * | receiver MAC addr 31:0 |
  13973. * |-------------------------------------------------------------------|
  13974. * | Rsvd | receiver MAC addr 47:32 |
  13975. * |-------------------------------------------------------------------|
  13976. * | transmitter MAC addr 31:0 |
  13977. * |-------------------------------------------------------------------|
  13978. * | Rsvd | transmitter MAC addr 47:32 |
  13979. * |-------------------------------------------------------------------|
  13980. * | PN 31:0 |
  13981. * |-------------------------------------------------------------------|
  13982. * | Rsvd | PN 47:32 |
  13983. * |-------------------------------------------------------------------|
  13984. * - peer_id
  13985. * Bits 15:0
  13986. * Purpose: identifies which peer is frame is from
  13987. * value:
  13988. * - key_id
  13989. * Bits 23:16
  13990. * Purpose: identifies key_id of rx frame
  13991. * value:
  13992. * - RA_31_0 (receiver MAC addr 31:0)
  13993. * Bits 31:0
  13994. * Purpose: identifies by MAC address which vdev received the frame
  13995. * value: MAC address lower 4 bytes
  13996. * - RA_47_32 (receiver MAC addr 47:32)
  13997. * Bits 15:0
  13998. * Purpose: identifies by MAC address which vdev received the frame
  13999. * value: MAC address upper 2 bytes
  14000. * - TA_31_0 (transmitter MAC addr 31:0)
  14001. * Bits 31:0
  14002. * Purpose: identifies by MAC address which peer transmitted the frame
  14003. * value: MAC address lower 4 bytes
  14004. * - TA_47_32 (transmitter MAC addr 47:32)
  14005. * Bits 15:0
  14006. * Purpose: identifies by MAC address which peer transmitted the frame
  14007. * value: MAC address upper 2 bytes
  14008. * - PN_31_0
  14009. * Bits 31:0
  14010. * Purpose: Identifies pn of rx frame
  14011. * value: PN lower 4 bytes
  14012. * - PN_47_32
  14013. * Bits 15:0
  14014. * Purpose: Identifies pn of rx frame
  14015. * value:
  14016. * TKIP or CCMP: PN upper 2 bytes
  14017. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14018. */
  14019. enum htt_rx_ofld_pkt_err_type {
  14020. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14021. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14022. };
  14023. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14024. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14025. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14026. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14027. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14028. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14029. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14030. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14031. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14032. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14033. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14034. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14035. do { \
  14036. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14037. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14038. } while (0)
  14039. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14040. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14041. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14042. do { \
  14043. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14044. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14045. } while (0)
  14046. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14047. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14048. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14049. do { \
  14050. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14051. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14052. } while (0)
  14053. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14054. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14055. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14056. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14057. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14058. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14059. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14060. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14061. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14062. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14063. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14064. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14065. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14066. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14067. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14068. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14069. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14070. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14071. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14072. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14073. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14074. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14075. do { \
  14076. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14077. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14078. } while (0)
  14079. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14080. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14081. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14082. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14083. do { \
  14084. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14085. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14086. } while (0)
  14087. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14088. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14089. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14090. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14091. do { \
  14092. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14093. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14094. } while (0)
  14095. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14096. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14097. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14098. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14099. do { \
  14100. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14101. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14102. } while (0)
  14103. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14104. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14105. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14106. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14107. do { \
  14108. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14109. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14110. } while (0)
  14111. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14112. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14113. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14114. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14115. do { \
  14116. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14117. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14118. } while (0)
  14119. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14120. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14121. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14122. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14123. do { \
  14124. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14125. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14126. } while (0)
  14127. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14128. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14129. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14130. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14131. do { \
  14132. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14133. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14134. } while (0)
  14135. /**
  14136. * @brief target -> host peer rate report message
  14137. *
  14138. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14139. *
  14140. * @details
  14141. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14142. * justified rate of all the peers.
  14143. *
  14144. * |31 24|23 16|15 8|7 0|
  14145. * |----------------+----------------+----------------+----------------|
  14146. * | peer_count | | msg_type |
  14147. * |-------------------------------------------------------------------|
  14148. * : Payload (variant number of peer rate report) :
  14149. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14150. * Header fields:
  14151. * - msg_type
  14152. * Bits 7:0
  14153. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14154. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14155. * - reserved
  14156. * Bits 15:8
  14157. * Purpose:
  14158. * value:
  14159. * - peer_count
  14160. * Bits 31:16
  14161. * Purpose: Specify how many peer rate report elements are present in the payload.
  14162. * value:
  14163. *
  14164. * Payload:
  14165. * There are variant number of peer rate report follow the first 32 bits.
  14166. * The peer rate report is defined as follows.
  14167. *
  14168. * |31 20|19 16|15 0|
  14169. * |-----------------------+---------+---------------------------------|-
  14170. * | reserved | phy | peer_id | \
  14171. * |-------------------------------------------------------------------| -> report #0
  14172. * | rate | /
  14173. * |-----------------------+---------+---------------------------------|-
  14174. * | reserved | phy | peer_id | \
  14175. * |-------------------------------------------------------------------| -> report #1
  14176. * | rate | /
  14177. * |-----------------------+---------+---------------------------------|-
  14178. * | reserved | phy | peer_id | \
  14179. * |-------------------------------------------------------------------| -> report #2
  14180. * | rate | /
  14181. * |-------------------------------------------------------------------|-
  14182. * : :
  14183. * : :
  14184. * : :
  14185. * :-------------------------------------------------------------------:
  14186. *
  14187. * - peer_id
  14188. * Bits 15:0
  14189. * Purpose: identify the peer
  14190. * value:
  14191. * - phy
  14192. * Bits 19:16
  14193. * Purpose: identify which phy is in use
  14194. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14195. * Please see enum htt_peer_report_phy_type for detail.
  14196. * - reserved
  14197. * Bits 31:20
  14198. * Purpose:
  14199. * value:
  14200. * - rate
  14201. * Bits 31:0
  14202. * Purpose: represent the justified rate of the peer specified by peer_id
  14203. * value:
  14204. */
  14205. enum htt_peer_rate_report_phy_type {
  14206. HTT_PEER_RATE_REPORT_11B = 0,
  14207. HTT_PEER_RATE_REPORT_11A_G,
  14208. HTT_PEER_RATE_REPORT_11N,
  14209. HTT_PEER_RATE_REPORT_11AC,
  14210. };
  14211. #define HTT_PEER_RATE_REPORT_SIZE 8
  14212. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14213. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14214. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14215. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14216. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14217. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14218. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14219. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14220. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14221. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14222. do { \
  14223. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14224. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14225. } while (0)
  14226. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14227. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14228. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14229. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14230. do { \
  14231. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14232. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14233. } while (0)
  14234. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14235. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14236. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14237. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14238. do { \
  14239. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14240. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14241. } while (0)
  14242. /**
  14243. * @brief target -> host flow pool map message
  14244. *
  14245. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14246. *
  14247. * @details
  14248. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14249. * a flow of descriptors.
  14250. *
  14251. * This message is in TLV format and indicates the parameters to be setup a
  14252. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14253. * receive descriptors from a specified pool.
  14254. *
  14255. * The message would appear as follows:
  14256. *
  14257. * |31 24|23 16|15 8|7 0|
  14258. * |----------------+----------------+----------------+----------------|
  14259. * header | reserved | num_flows | msg_type |
  14260. * |-------------------------------------------------------------------|
  14261. * | |
  14262. * : payload :
  14263. * | |
  14264. * |-------------------------------------------------------------------|
  14265. *
  14266. * The header field is one DWORD long and is interpreted as follows:
  14267. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14268. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14269. * this message
  14270. * b'16-31 - reserved: These bits are reserved for future use
  14271. *
  14272. * Payload:
  14273. * The payload would contain multiple objects of the following structure. Each
  14274. * object represents a flow.
  14275. *
  14276. * |31 24|23 16|15 8|7 0|
  14277. * |----------------+----------------+----------------+----------------|
  14278. * header | reserved | num_flows | msg_type |
  14279. * |-------------------------------------------------------------------|
  14280. * payload0| flow_type |
  14281. * |-------------------------------------------------------------------|
  14282. * | flow_id |
  14283. * |-------------------------------------------------------------------|
  14284. * | reserved0 | flow_pool_id |
  14285. * |-------------------------------------------------------------------|
  14286. * | reserved1 | flow_pool_size |
  14287. * |-------------------------------------------------------------------|
  14288. * | reserved2 |
  14289. * |-------------------------------------------------------------------|
  14290. * payload1| flow_type |
  14291. * |-------------------------------------------------------------------|
  14292. * | flow_id |
  14293. * |-------------------------------------------------------------------|
  14294. * | reserved0 | flow_pool_id |
  14295. * |-------------------------------------------------------------------|
  14296. * | reserved1 | flow_pool_size |
  14297. * |-------------------------------------------------------------------|
  14298. * | reserved2 |
  14299. * |-------------------------------------------------------------------|
  14300. * | . |
  14301. * | . |
  14302. * | . |
  14303. * |-------------------------------------------------------------------|
  14304. *
  14305. * Each payload is 5 DWORDS long and is interpreted as follows:
  14306. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14307. * this flow is associated. It can be VDEV, peer,
  14308. * or tid (AC). Based on enum htt_flow_type.
  14309. *
  14310. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14311. * object. For flow_type vdev it is set to the
  14312. * vdevid, for peer it is peerid and for tid, it is
  14313. * tid_num.
  14314. *
  14315. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14316. * in the host for this flow
  14317. * b'16:31 - reserved0: This field in reserved for the future. In case
  14318. * we have a hierarchical implementation (HCM) of
  14319. * pools, it can be used to indicate the ID of the
  14320. * parent-pool.
  14321. *
  14322. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14323. * Descriptors for this flow will be
  14324. * allocated from this pool in the host.
  14325. * b'16:31 - reserved1: This field in reserved for the future. In case
  14326. * we have a hierarchical implementation of pools,
  14327. * it can be used to indicate the max number of
  14328. * descriptors in the pool. The b'0:15 can be used
  14329. * to indicate min number of descriptors in the
  14330. * HCM scheme.
  14331. *
  14332. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14333. * we have a hierarchical implementation of pools,
  14334. * b'0:15 can be used to indicate the
  14335. * priority-based borrowing (PBB) threshold of
  14336. * the flow's pool. The b'16:31 are still left
  14337. * reserved.
  14338. */
  14339. enum htt_flow_type {
  14340. FLOW_TYPE_VDEV = 0,
  14341. /* Insert new flow types above this line */
  14342. };
  14343. PREPACK struct htt_flow_pool_map_payload_t {
  14344. A_UINT32 flow_type;
  14345. A_UINT32 flow_id;
  14346. A_UINT32 flow_pool_id:16,
  14347. reserved0:16;
  14348. A_UINT32 flow_pool_size:16,
  14349. reserved1:16;
  14350. A_UINT32 reserved2;
  14351. } POSTPACK;
  14352. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14353. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14354. (sizeof(struct htt_flow_pool_map_payload_t))
  14355. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14356. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14357. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14358. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14359. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14360. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14361. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14362. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14363. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14364. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14365. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14366. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14367. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14368. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14369. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14370. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14371. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14372. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14373. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14374. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14375. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14376. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14377. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14378. do { \
  14379. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14380. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14381. } while (0)
  14382. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14383. do { \
  14384. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14385. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14386. } while (0)
  14387. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14388. do { \
  14389. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14390. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14391. } while (0)
  14392. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14393. do { \
  14394. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14395. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14396. } while (0)
  14397. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14398. do { \
  14399. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14400. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14401. } while (0)
  14402. /**
  14403. * @brief target -> host flow pool unmap message
  14404. *
  14405. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14406. *
  14407. * @details
  14408. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14409. * down a flow of descriptors.
  14410. * This message indicates that for the flow (whose ID is provided) is wanting
  14411. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14412. * pool of descriptors from where descriptors are being allocated for this
  14413. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14414. * be unmapped by the host.
  14415. *
  14416. * The message would appear as follows:
  14417. *
  14418. * |31 24|23 16|15 8|7 0|
  14419. * |----------------+----------------+----------------+----------------|
  14420. * | reserved0 | msg_type |
  14421. * |-------------------------------------------------------------------|
  14422. * | flow_type |
  14423. * |-------------------------------------------------------------------|
  14424. * | flow_id |
  14425. * |-------------------------------------------------------------------|
  14426. * | reserved1 | flow_pool_id |
  14427. * |-------------------------------------------------------------------|
  14428. *
  14429. * The message is interpreted as follows:
  14430. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14431. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14432. * b'8:31 - reserved0: Reserved for future use
  14433. *
  14434. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14435. * this flow is associated. It can be VDEV, peer,
  14436. * or tid (AC). Based on enum htt_flow_type.
  14437. *
  14438. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14439. * object. For flow_type vdev it is set to the
  14440. * vdevid, for peer it is peerid and for tid, it is
  14441. * tid_num.
  14442. *
  14443. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14444. * used in the host for this flow
  14445. * b'16:31 - reserved0: This field in reserved for the future.
  14446. *
  14447. */
  14448. PREPACK struct htt_flow_pool_unmap_t {
  14449. A_UINT32 msg_type:8,
  14450. reserved0:24;
  14451. A_UINT32 flow_type;
  14452. A_UINT32 flow_id;
  14453. A_UINT32 flow_pool_id:16,
  14454. reserved1:16;
  14455. } POSTPACK;
  14456. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14457. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14458. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14459. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14460. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14461. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14462. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14463. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14464. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14465. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14466. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14467. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14468. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14469. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14470. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14471. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14472. do { \
  14473. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14474. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14475. } while (0)
  14476. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14477. do { \
  14478. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14479. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14480. } while (0)
  14481. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14482. do { \
  14483. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14484. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14485. } while (0)
  14486. /**
  14487. * @brief target -> host SRING setup done message
  14488. *
  14489. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14490. *
  14491. * @details
  14492. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14493. * SRNG ring setup is done
  14494. *
  14495. * This message indicates whether the last setup operation is successful.
  14496. * It will be sent to host when host set respose_required bit in
  14497. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14498. * The message would appear as follows:
  14499. *
  14500. * |31 24|23 16|15 8|7 0|
  14501. * |--------------- +----------------+----------------+----------------|
  14502. * | setup_status | ring_id | pdev_id | msg_type |
  14503. * |-------------------------------------------------------------------|
  14504. *
  14505. * The message is interpreted as follows:
  14506. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14507. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14508. * b'8:15 - pdev_id:
  14509. * 0 (for rings at SOC/UMAC level),
  14510. * 1/2/3 mac id (for rings at LMAC level)
  14511. * b'16:23 - ring_id: Identify the ring which is set up
  14512. * More details can be got from enum htt_srng_ring_id
  14513. * b'24:31 - setup_status: Indicate status of setup operation
  14514. * Refer to htt_ring_setup_status
  14515. */
  14516. PREPACK struct htt_sring_setup_done_t {
  14517. A_UINT32 msg_type: 8,
  14518. pdev_id: 8,
  14519. ring_id: 8,
  14520. setup_status: 8;
  14521. } POSTPACK;
  14522. enum htt_ring_setup_status {
  14523. htt_ring_setup_status_ok = 0,
  14524. htt_ring_setup_status_error,
  14525. };
  14526. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14527. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14528. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14529. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14530. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14531. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14532. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14533. do { \
  14534. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14535. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14536. } while (0)
  14537. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14538. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14539. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14540. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14541. HTT_SRING_SETUP_DONE_RING_ID_S)
  14542. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14543. do { \
  14544. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14545. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14546. } while (0)
  14547. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14548. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14549. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14550. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14551. HTT_SRING_SETUP_DONE_STATUS_S)
  14552. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14553. do { \
  14554. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14555. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14556. } while (0)
  14557. /**
  14558. * @brief target -> flow map flow info
  14559. *
  14560. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14561. *
  14562. * @details
  14563. * HTT TX map flow entry with tqm flow pointer
  14564. * Sent from firmware to host to add tqm flow pointer in corresponding
  14565. * flow search entry. Flow metadata is replayed back to host as part of this
  14566. * struct to enable host to find the specific flow search entry
  14567. *
  14568. * The message would appear as follows:
  14569. *
  14570. * |31 28|27 18|17 14|13 8|7 0|
  14571. * |-------+------------------------------------------+----------------|
  14572. * | rsvd0 | fse_hsh_idx | msg_type |
  14573. * |-------------------------------------------------------------------|
  14574. * | rsvd1 | tid | peer_id |
  14575. * |-------------------------------------------------------------------|
  14576. * | tqm_flow_pntr_lo |
  14577. * |-------------------------------------------------------------------|
  14578. * | tqm_flow_pntr_hi |
  14579. * |-------------------------------------------------------------------|
  14580. * | fse_meta_data |
  14581. * |-------------------------------------------------------------------|
  14582. *
  14583. * The message is interpreted as follows:
  14584. *
  14585. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14586. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14587. *
  14588. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14589. * for this flow entry
  14590. *
  14591. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14592. *
  14593. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14594. *
  14595. * dword1 - b'14:17 - tid
  14596. *
  14597. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14598. *
  14599. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14600. *
  14601. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14602. *
  14603. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14604. * given by host
  14605. */
  14606. PREPACK struct htt_tx_map_flow_info {
  14607. A_UINT32
  14608. msg_type: 8,
  14609. fse_hsh_idx: 20,
  14610. rsvd0: 4;
  14611. A_UINT32
  14612. peer_id: 14,
  14613. tid: 4,
  14614. rsvd1: 14;
  14615. A_UINT32 tqm_flow_pntr_lo;
  14616. A_UINT32 tqm_flow_pntr_hi;
  14617. struct htt_tx_flow_metadata fse_meta_data;
  14618. } POSTPACK;
  14619. /* DWORD 0 */
  14620. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14621. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14622. /* DWORD 1 */
  14623. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14624. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14625. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14626. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14627. /* DWORD 0 */
  14628. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14629. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14630. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14631. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14632. do { \
  14633. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14634. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14635. } while (0)
  14636. /* DWORD 1 */
  14637. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14638. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14639. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14640. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14641. do { \
  14642. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14643. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14644. } while (0)
  14645. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14646. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14647. HTT_TX_MAP_FLOW_INFO_TID_S)
  14648. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14649. do { \
  14650. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14651. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14652. } while (0)
  14653. /*
  14654. * htt_dbg_ext_stats_status -
  14655. * present - The requested stats have been delivered in full.
  14656. * This indicates that either the stats information was contained
  14657. * in its entirety within this message, or else this message
  14658. * completes the delivery of the requested stats info that was
  14659. * partially delivered through earlier STATS_CONF messages.
  14660. * partial - The requested stats have been delivered in part.
  14661. * One or more subsequent STATS_CONF messages with the same
  14662. * cookie value will be sent to deliver the remainder of the
  14663. * information.
  14664. * error - The requested stats could not be delivered, for example due
  14665. * to a shortage of memory to construct a message holding the
  14666. * requested stats.
  14667. * invalid - The requested stat type is either not recognized, or the
  14668. * target is configured to not gather the stats type in question.
  14669. */
  14670. enum htt_dbg_ext_stats_status {
  14671. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14672. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14673. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14674. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14675. };
  14676. /**
  14677. * @brief target -> host ppdu stats upload
  14678. *
  14679. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14680. *
  14681. * @details
  14682. * The following field definitions describe the format of the HTT target
  14683. * to host ppdu stats indication message.
  14684. *
  14685. *
  14686. * |31 16|15 12|11 10|9 8|7 0 |
  14687. * |----------------------------------------------------------------------|
  14688. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14689. * |----------------------------------------------------------------------|
  14690. * | ppdu_id |
  14691. * |----------------------------------------------------------------------|
  14692. * | Timestamp in us |
  14693. * |----------------------------------------------------------------------|
  14694. * | reserved |
  14695. * |----------------------------------------------------------------------|
  14696. * | type-specific stats info |
  14697. * | (see htt_ppdu_stats.h) |
  14698. * |----------------------------------------------------------------------|
  14699. * Header fields:
  14700. * - MSG_TYPE
  14701. * Bits 7:0
  14702. * Purpose: Identifies this is a PPDU STATS indication
  14703. * message.
  14704. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14705. * - mac_id
  14706. * Bits 9:8
  14707. * Purpose: mac_id of this ppdu_id
  14708. * Value: 0-3
  14709. * - pdev_id
  14710. * Bits 11:10
  14711. * Purpose: pdev_id of this ppdu_id
  14712. * Value: 0-3
  14713. * 0 (for rings at SOC level),
  14714. * 1/2/3 PDEV -> 0/1/2
  14715. * - payload_size
  14716. * Bits 31:16
  14717. * Purpose: total tlv size
  14718. * Value: payload_size in bytes
  14719. */
  14720. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14721. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14722. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14723. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14724. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14725. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14726. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14727. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14728. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14729. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14730. do { \
  14731. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14732. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14733. } while (0)
  14734. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14735. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14736. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14737. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14738. do { \
  14739. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14740. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14741. } while (0)
  14742. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14743. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14744. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14745. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14746. do { \
  14747. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14748. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14749. } while (0)
  14750. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14751. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14752. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14753. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14754. do { \
  14755. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14756. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14757. } while (0)
  14758. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14759. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14760. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14761. /* htt_t2h_ppdu_stats_ind_hdr_t
  14762. * This struct contains the fields within the header of the
  14763. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14764. * stats info.
  14765. * This struct assumes little-endian layout, and thus is only
  14766. * suitable for use within processors known to be little-endian
  14767. * (such as the target).
  14768. * In contrast, the above macros provide endian-portable methods
  14769. * to get and set the bitfields within this PPDU_STATS_IND header.
  14770. */
  14771. typedef struct {
  14772. A_UINT32 msg_type: 8, /* bits 7:0 */
  14773. mac_id: 2, /* bits 9:8 */
  14774. pdev_id: 2, /* bits 11:10 */
  14775. reserved1: 4, /* bits 15:12 */
  14776. payload_size: 16; /* bits 31:16 */
  14777. A_UINT32 ppdu_id;
  14778. A_UINT32 timestamp_us;
  14779. A_UINT32 reserved2;
  14780. } htt_t2h_ppdu_stats_ind_hdr_t;
  14781. /**
  14782. * @brief target -> host extended statistics upload
  14783. *
  14784. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14785. *
  14786. * @details
  14787. * The following field definitions describe the format of the HTT target
  14788. * to host stats upload confirmation message.
  14789. * The message contains a cookie echoed from the HTT host->target stats
  14790. * upload request, which identifies which request the confirmation is
  14791. * for, and a single stats can span over multiple HTT stats indication
  14792. * due to the HTT message size limitation so every HTT ext stats indication
  14793. * will have tag-length-value stats information elements.
  14794. * The tag-length header for each HTT stats IND message also includes a
  14795. * status field, to indicate whether the request for the stat type in
  14796. * question was fully met, partially met, unable to be met, or invalid
  14797. * (if the stat type in question is disabled in the target).
  14798. * A Done bit 1's indicate the end of the of stats info elements.
  14799. *
  14800. *
  14801. * |31 16|15 12|11|10 8|7 5|4 0|
  14802. * |--------------------------------------------------------------|
  14803. * | reserved | msg type |
  14804. * |--------------------------------------------------------------|
  14805. * | cookie LSBs |
  14806. * |--------------------------------------------------------------|
  14807. * | cookie MSBs |
  14808. * |--------------------------------------------------------------|
  14809. * | stats entry length | rsvd | D| S | stat type |
  14810. * |--------------------------------------------------------------|
  14811. * | type-specific stats info |
  14812. * | (see htt_stats.h) |
  14813. * |--------------------------------------------------------------|
  14814. * Header fields:
  14815. * - MSG_TYPE
  14816. * Bits 7:0
  14817. * Purpose: Identifies this is a extended statistics upload confirmation
  14818. * message.
  14819. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14820. * - COOKIE_LSBS
  14821. * Bits 31:0
  14822. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14823. * message with its preceding host->target stats request message.
  14824. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14825. * - COOKIE_MSBS
  14826. * Bits 31:0
  14827. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14828. * message with its preceding host->target stats request message.
  14829. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14830. *
  14831. * Stats Information Element tag-length header fields:
  14832. * - STAT_TYPE
  14833. * Bits 7:0
  14834. * Purpose: identifies the type of statistics info held in the
  14835. * following information element
  14836. * Value: htt_dbg_ext_stats_type
  14837. * - STATUS
  14838. * Bits 10:8
  14839. * Purpose: indicate whether the requested stats are present
  14840. * Value: htt_dbg_ext_stats_status
  14841. * - DONE
  14842. * Bits 11
  14843. * Purpose:
  14844. * Indicates the completion of the stats entry, this will be the last
  14845. * stats conf HTT segment for the requested stats type.
  14846. * Value:
  14847. * 0 -> the stats retrieval is ongoing
  14848. * 1 -> the stats retrieval is complete
  14849. * - LENGTH
  14850. * Bits 31:16
  14851. * Purpose: indicate the stats information size
  14852. * Value: This field specifies the number of bytes of stats information
  14853. * that follows the element tag-length header.
  14854. * It is expected but not required that this length is a multiple of
  14855. * 4 bytes.
  14856. */
  14857. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14858. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14859. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14860. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14861. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14862. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14863. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14864. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14865. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14866. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14867. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14868. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14869. do { \
  14870. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14871. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14872. } while (0)
  14873. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14874. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14875. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14876. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14877. do { \
  14878. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14879. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14880. } while (0)
  14881. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14882. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14883. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14884. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14885. do { \
  14886. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14887. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14888. } while (0)
  14889. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14890. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14891. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14892. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14893. do { \
  14894. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14895. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14896. } while (0)
  14897. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14898. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14899. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14900. /**
  14901. * @brief target -> host streaming statistics upload
  14902. *
  14903. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  14904. *
  14905. * @details
  14906. * The following field definitions describe the format of the HTT target
  14907. * to host streaming stats upload indication message.
  14908. * The host can use a STREAMING_STATS_REQ message to enable the target to
  14909. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  14910. * use the STREAMING_STATS_REQ message to halt the target's production of
  14911. * STREAMING_STATS_IND messages.
  14912. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  14913. * the stats enabled by the host's STREAMING_STATS_REQ message.
  14914. *
  14915. * |31 8|7 0|
  14916. * |--------------------------------------------------------------|
  14917. * | reserved | msg type |
  14918. * |--------------------------------------------------------------|
  14919. * | type-specific stats info |
  14920. * | (see htt_stats.h) |
  14921. * |--------------------------------------------------------------|
  14922. * Header fields:
  14923. * - MSG_TYPE
  14924. * Bits 7:0
  14925. * Purpose: Identifies this as a streaming statistics upload indication
  14926. * message.
  14927. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  14928. */
  14929. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  14930. typedef enum {
  14931. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14932. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14933. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14934. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14935. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14936. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14937. /* Reserved from 128 - 255 for target internal use.*/
  14938. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14939. } HTT_PEER_TYPE;
  14940. /** macro to convert MAC address from char array to HTT word format */
  14941. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14942. (phtt_mac_addr)->mac_addr31to0 = \
  14943. (((c_macaddr)[0] << 0) | \
  14944. ((c_macaddr)[1] << 8) | \
  14945. ((c_macaddr)[2] << 16) | \
  14946. ((c_macaddr)[3] << 24)); \
  14947. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14948. } while (0)
  14949. /**
  14950. * @brief target -> host monitor mac header indication message
  14951. *
  14952. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14953. *
  14954. * @details
  14955. * The following diagram shows the format of the monitor mac header message
  14956. * sent from the target to the host.
  14957. * This message is primarily sent when promiscuous rx mode is enabled.
  14958. * One message is sent per rx PPDU.
  14959. *
  14960. * |31 24|23 16|15 8|7 0|
  14961. * |-------------------------------------------------------------|
  14962. * | peer_id | reserved0 | msg_type |
  14963. * |-------------------------------------------------------------|
  14964. * | reserved1 | num_mpdu |
  14965. * |-------------------------------------------------------------|
  14966. * | struct hw_rx_desc |
  14967. * | (see wal_rx_desc.h) |
  14968. * |-------------------------------------------------------------|
  14969. * | struct ieee80211_frame_addr4 |
  14970. * | (see ieee80211_defs.h) |
  14971. * |-------------------------------------------------------------|
  14972. * | struct ieee80211_frame_addr4 |
  14973. * | (see ieee80211_defs.h) |
  14974. * |-------------------------------------------------------------|
  14975. * | ...... |
  14976. * |-------------------------------------------------------------|
  14977. *
  14978. * Header fields:
  14979. * - msg_type
  14980. * Bits 7:0
  14981. * Purpose: Identifies this is a monitor mac header indication message.
  14982. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14983. * - peer_id
  14984. * Bits 31:16
  14985. * Purpose: Software peer id given by host during association,
  14986. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14987. * for rx PPDUs received from unassociated peers.
  14988. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14989. * - num_mpdu
  14990. * Bits 15:0
  14991. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14992. * delivered within the message.
  14993. * Value: 1 to 32
  14994. * num_mpdu is limited to a maximum value of 32, due to buffer
  14995. * size limits. For PPDUs with more than 32 MPDUs, only the
  14996. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14997. * the PPDU will be provided.
  14998. */
  14999. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15000. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15001. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15002. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15003. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15004. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15005. do { \
  15006. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15007. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15008. } while (0)
  15009. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15010. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15011. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15012. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15013. do { \
  15014. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15015. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15016. } while (0)
  15017. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15018. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15019. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15020. /**
  15021. * @brief target -> host flow pool resize Message
  15022. *
  15023. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15024. *
  15025. * @details
  15026. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15027. * the flow pool associated with the specified ID is resized
  15028. *
  15029. * The message would appear as follows:
  15030. *
  15031. * |31 16|15 8|7 0|
  15032. * |---------------------------------+----------------+----------------|
  15033. * | reserved0 | Msg type |
  15034. * |-------------------------------------------------------------------|
  15035. * | flow pool new size | flow pool ID |
  15036. * |-------------------------------------------------------------------|
  15037. *
  15038. * The message is interpreted as follows:
  15039. * b'0:7 - msg_type: This will be set to 0x21
  15040. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15041. *
  15042. * b'0:15 - flow pool ID: Existing flow pool ID
  15043. *
  15044. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  15045. *
  15046. */
  15047. PREPACK struct htt_flow_pool_resize_t {
  15048. A_UINT32 msg_type:8,
  15049. reserved0:24;
  15050. A_UINT32 flow_pool_id:16,
  15051. flow_pool_new_size:16;
  15052. } POSTPACK;
  15053. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15054. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15055. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15056. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15057. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15058. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15059. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15060. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15061. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15062. do { \
  15063. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15064. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15065. } while (0)
  15066. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15067. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15068. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15069. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15070. do { \
  15071. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15072. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15073. } while (0)
  15074. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15075. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15076. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15077. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15078. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15079. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15080. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15081. /*
  15082. * The read and write indices point to the data within the host buffer.
  15083. * Because the first 4 bytes of the host buffer is used for the read index and
  15084. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15085. * The read index and write index are the byte offsets from the base of the
  15086. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15087. * Refer the ASCII text picture below.
  15088. */
  15089. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15090. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15091. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15092. /*
  15093. ***************************************************************************
  15094. *
  15095. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15096. *
  15097. ***************************************************************************
  15098. *
  15099. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15100. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15101. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15102. * written into the Host memory region mentioned below.
  15103. *
  15104. * Read index is updated by the Host. At any point of time, the read index will
  15105. * indicate the index that will next be read by the Host. The read index is
  15106. * in units of bytes offset from the base of the meta-data buffer.
  15107. *
  15108. * Write index is updated by the FW. At any point of time, the write index will
  15109. * indicate from where the FW can start writing any new data. The write index is
  15110. * in units of bytes offset from the base of the meta-data buffer.
  15111. *
  15112. * If the Host is not fast enough in reading the CFR data, any new capture data
  15113. * would be dropped if there is no space left to write the new captures.
  15114. *
  15115. * The last 4 bytes of the memory region will have the magic pattern
  15116. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15117. * not overrun the host buffer.
  15118. *
  15119. * ,--------------------. read and write indices store the
  15120. * | | byte offset from the base of the
  15121. * | ,--------+--------. meta-data buffer to the next
  15122. * | | | | location within the data buffer
  15123. * | | v v that will be read / written
  15124. * ************************************************************************
  15125. * * Read * Write * * Magic *
  15126. * * index * index * CFR data1 ...... CFR data N * pattern *
  15127. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15128. * ************************************************************************
  15129. * |<---------- data buffer ---------->|
  15130. *
  15131. * |<----------------- meta-data buffer allocated in Host ----------------|
  15132. *
  15133. * Note:
  15134. * - Considering the 4 bytes needed to store the Read index (R) and the
  15135. * Write index (W), the initial value is as follows:
  15136. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15137. * - Buffer empty condition:
  15138. * R = W
  15139. *
  15140. * Regarding CFR data format:
  15141. * --------------------------
  15142. *
  15143. * Each CFR tone is stored in HW as 16-bits with the following format:
  15144. * {bits[15:12], bits[11:6], bits[5:0]} =
  15145. * {unsigned exponent (4 bits),
  15146. * signed mantissa_real (6 bits),
  15147. * signed mantissa_imag (6 bits)}
  15148. *
  15149. * CFR_real = mantissa_real * 2^(exponent-5)
  15150. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15151. *
  15152. *
  15153. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15154. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15155. *
  15156. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15157. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15158. * .
  15159. * .
  15160. * .
  15161. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15162. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15163. */
  15164. /* Bandwidth of peer CFR captures */
  15165. typedef enum {
  15166. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15167. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15168. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15169. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15170. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15171. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15172. } HTT_PEER_CFR_CAPTURE_BW;
  15173. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15174. * was captured
  15175. */
  15176. typedef enum {
  15177. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15178. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15179. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15180. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15181. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15182. } HTT_PEER_CFR_CAPTURE_MODE;
  15183. typedef enum {
  15184. /* This message type is currently used for the below purpose:
  15185. *
  15186. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15187. * wmi_peer_cfr_capture_cmd.
  15188. * If payload_present bit is set to 0 then the associated memory region
  15189. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15190. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15191. * message; the CFR dump will be present at the end of the message,
  15192. * after the chan_phy_mode.
  15193. */
  15194. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15195. /* Always keep this last */
  15196. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15197. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15198. /**
  15199. * @brief target -> host CFR dump completion indication message definition
  15200. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15201. *
  15202. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15203. *
  15204. * @details
  15205. * The following diagram shows the format of the Channel Frequency Response
  15206. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15207. * the channel capture of a peer is copied by Firmware into the Host memory
  15208. *
  15209. * **************************************************************************
  15210. *
  15211. * Message format when the CFR capture message type is
  15212. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15213. *
  15214. * **************************************************************************
  15215. *
  15216. * |31 16|15 |8|7 0|
  15217. * |----------------------------------------------------------------|
  15218. * header: | reserved |P| msg_type |
  15219. * word 0 | | | |
  15220. * |----------------------------------------------------------------|
  15221. * payload: | cfr_capture_msg_type |
  15222. * word 1 | |
  15223. * |----------------------------------------------------------------|
  15224. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15225. * word 2 | | | | | | | | |
  15226. * |----------------------------------------------------------------|
  15227. * | mac_addr31to0 |
  15228. * word 3 | |
  15229. * |----------------------------------------------------------------|
  15230. * | unused / reserved | mac_addr47to32 |
  15231. * word 4 | | |
  15232. * |----------------------------------------------------------------|
  15233. * | index |
  15234. * word 5 | |
  15235. * |----------------------------------------------------------------|
  15236. * | length |
  15237. * word 6 | |
  15238. * |----------------------------------------------------------------|
  15239. * | timestamp |
  15240. * word 7 | |
  15241. * |----------------------------------------------------------------|
  15242. * | counter |
  15243. * word 8 | |
  15244. * |----------------------------------------------------------------|
  15245. * | chan_mhz |
  15246. * word 9 | |
  15247. * |----------------------------------------------------------------|
  15248. * | band_center_freq1 |
  15249. * word 10 | |
  15250. * |----------------------------------------------------------------|
  15251. * | band_center_freq2 |
  15252. * word 11 | |
  15253. * |----------------------------------------------------------------|
  15254. * | chan_phy_mode |
  15255. * word 12 | |
  15256. * |----------------------------------------------------------------|
  15257. * where,
  15258. * P - payload present bit (payload_present explained below)
  15259. * req_id - memory request id (mem_req_id explained below)
  15260. * S - status field (status explained below)
  15261. * capbw - capture bandwidth (capture_bw explained below)
  15262. * mode - mode of capture (mode explained below)
  15263. * sts - space time streams (sts_count explained below)
  15264. * chbw - channel bandwidth (channel_bw explained below)
  15265. * captype - capture type (cap_type explained below)
  15266. *
  15267. * The following field definitions describe the format of the CFR dump
  15268. * completion indication sent from the target to the host
  15269. *
  15270. * Header fields:
  15271. *
  15272. * Word 0
  15273. * - msg_type
  15274. * Bits 7:0
  15275. * Purpose: Identifies this as CFR TX completion indication
  15276. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15277. * - payload_present
  15278. * Bit 8
  15279. * Purpose: Identifies how CFR data is sent to host
  15280. * Value: 0 - If CFR Payload is written to host memory
  15281. * 1 - If CFR Payload is sent as part of HTT message
  15282. * (This is the requirement for SDIO/USB where it is
  15283. * not possible to write CFR data to host memory)
  15284. * - reserved
  15285. * Bits 31:9
  15286. * Purpose: Reserved
  15287. * Value: 0
  15288. *
  15289. * Payload fields:
  15290. *
  15291. * Word 1
  15292. * - cfr_capture_msg_type
  15293. * Bits 31:0
  15294. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15295. * to specify the format used for the remainder of the message
  15296. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15297. * (currently only MSG_TYPE_1 is defined)
  15298. *
  15299. * Word 2
  15300. * - mem_req_id
  15301. * Bits 6:0
  15302. * Purpose: Contain the mem request id of the region where the CFR capture
  15303. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15304. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15305. this value is invalid)
  15306. * - status
  15307. * Bit 7
  15308. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15309. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15310. * - capture_bw
  15311. * Bits 10:8
  15312. * Purpose: Carry the bandwidth of the CFR capture
  15313. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15314. * - mode
  15315. * Bits 13:11
  15316. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15317. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15318. * - sts_count
  15319. * Bits 16:14
  15320. * Purpose: Carry the number of space time streams
  15321. * Value: Number of space time streams
  15322. * - channel_bw
  15323. * Bits 19:17
  15324. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15325. * measurement
  15326. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15327. * - cap_type
  15328. * Bits 23:20
  15329. * Purpose: Carry the type of the capture
  15330. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15331. * - vdev_id
  15332. * Bits 31:24
  15333. * Purpose: Carry the virtual device id
  15334. * Value: vdev ID
  15335. *
  15336. * Word 3
  15337. * - mac_addr31to0
  15338. * Bits 31:0
  15339. * Purpose: Contain the bits 31:0 of the peer MAC address
  15340. * Value: Bits 31:0 of the peer MAC address
  15341. *
  15342. * Word 4
  15343. * - mac_addr47to32
  15344. * Bits 15:0
  15345. * Purpose: Contain the bits 47:32 of the peer MAC address
  15346. * Value: Bits 47:32 of the peer MAC address
  15347. *
  15348. * Word 5
  15349. * - index
  15350. * Bits 31:0
  15351. * Purpose: Contain the index at which this CFR dump was written in the Host
  15352. * allocated memory. This index is the number of bytes from the base address.
  15353. * Value: Index position
  15354. *
  15355. * Word 6
  15356. * - length
  15357. * Bits 31:0
  15358. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15359. * Value: Length of the CFR capture of the peer
  15360. *
  15361. * Word 7
  15362. * - timestamp
  15363. * Bits 31:0
  15364. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15365. * clock used for this timestamp is private to the target and not visible to
  15366. * the host i.e., Host can interpret only the relative timestamp deltas from
  15367. * one message to the next, but can't interpret the absolute timestamp from a
  15368. * single message.
  15369. * Value: Timestamp in microseconds
  15370. *
  15371. * Word 8
  15372. * - counter
  15373. * Bits 31:0
  15374. * Purpose: Carry the count of the current CFR capture from FW. This is
  15375. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15376. * in host memory)
  15377. * Value: Count of the current CFR capture
  15378. *
  15379. * Word 9
  15380. * - chan_mhz
  15381. * Bits 31:0
  15382. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15383. * Value: Primary 20 channel frequency
  15384. *
  15385. * Word 10
  15386. * - band_center_freq1
  15387. * Bits 31:0
  15388. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15389. * Value: Center frequency 1 in MHz
  15390. *
  15391. * Word 11
  15392. * - band_center_freq2
  15393. * Bits 31:0
  15394. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15395. * the VDEV
  15396. * 80plus80 mode
  15397. * Value: Center frequency 2 in MHz
  15398. *
  15399. * Word 12
  15400. * - chan_phy_mode
  15401. * Bits 31:0
  15402. * Purpose: Carry the phy mode of the channel, of the VDEV
  15403. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15404. */
  15405. PREPACK struct htt_cfr_dump_ind_type_1 {
  15406. A_UINT32 mem_req_id:7,
  15407. status:1,
  15408. capture_bw:3,
  15409. mode:3,
  15410. sts_count:3,
  15411. channel_bw:3,
  15412. cap_type:4,
  15413. vdev_id:8;
  15414. htt_mac_addr addr;
  15415. A_UINT32 index;
  15416. A_UINT32 length;
  15417. A_UINT32 timestamp;
  15418. A_UINT32 counter;
  15419. struct htt_chan_change_msg chan;
  15420. } POSTPACK;
  15421. PREPACK struct htt_cfr_dump_compl_ind {
  15422. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15423. union {
  15424. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15425. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15426. /* If there is a need to change the memory layout and its associated
  15427. * HTT indication format, a new CFR capture message type can be
  15428. * introduced and added into this union.
  15429. */
  15430. };
  15431. } POSTPACK;
  15432. /*
  15433. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15434. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15435. */
  15436. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15437. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15438. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15439. do { \
  15440. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15441. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15442. } while(0)
  15443. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15444. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15445. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15446. /*
  15447. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15448. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15449. */
  15450. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15451. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15452. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15453. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15454. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15455. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15456. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15457. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15458. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15459. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15460. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15461. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15462. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15463. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15464. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15465. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15466. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15467. do { \
  15468. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15469. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15470. } while (0)
  15471. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15472. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15473. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15474. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15475. do { \
  15476. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15477. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15478. } while (0)
  15479. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15480. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15481. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15482. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15483. do { \
  15484. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15485. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15486. } while (0)
  15487. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15488. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15489. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15490. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15491. do { \
  15492. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15493. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15494. } while (0)
  15495. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15496. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15497. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15498. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15499. do { \
  15500. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15501. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15502. } while (0)
  15503. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15504. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15505. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15506. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15507. do { \
  15508. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15509. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15510. } while (0)
  15511. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15512. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15513. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15514. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15515. do { \
  15516. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15517. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15518. } while (0)
  15519. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15520. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15521. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15522. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15523. do { \
  15524. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15525. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15526. } while (0)
  15527. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15528. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15529. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15530. /**
  15531. * @brief target -> host peer (PPDU) stats message
  15532. *
  15533. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15534. *
  15535. * @details
  15536. * This message is generated by FW when FW is sending stats to host
  15537. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15538. * This message is sent autonomously by the target rather than upon request
  15539. * by the host.
  15540. * The following field definitions describe the format of the HTT target
  15541. * to host peer stats indication message.
  15542. *
  15543. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15544. * or more PPDU stats records.
  15545. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15546. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15547. * then the message would start with the
  15548. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15549. * below.
  15550. *
  15551. * |31 16|15|14|13 11|10 9|8|7 0|
  15552. * |-------------------------------------------------------------|
  15553. * | reserved |MSG_TYPE |
  15554. * |-------------------------------------------------------------|
  15555. * rec 0 | TLV header |
  15556. * rec 0 |-------------------------------------------------------------|
  15557. * rec 0 | ppdu successful bytes |
  15558. * rec 0 |-------------------------------------------------------------|
  15559. * rec 0 | ppdu retry bytes |
  15560. * rec 0 |-------------------------------------------------------------|
  15561. * rec 0 | ppdu failed bytes |
  15562. * rec 0 |-------------------------------------------------------------|
  15563. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15564. * rec 0 |-------------------------------------------------------------|
  15565. * rec 0 | retried MSDUs | successful MSDUs |
  15566. * rec 0 |-------------------------------------------------------------|
  15567. * rec 0 | TX duration | failed MSDUs |
  15568. * rec 0 |-------------------------------------------------------------|
  15569. * ...
  15570. * |-------------------------------------------------------------|
  15571. * rec N | TLV header |
  15572. * rec N |-------------------------------------------------------------|
  15573. * rec N | ppdu successful bytes |
  15574. * rec N |-------------------------------------------------------------|
  15575. * rec N | ppdu retry bytes |
  15576. * rec N |-------------------------------------------------------------|
  15577. * rec N | ppdu failed bytes |
  15578. * rec N |-------------------------------------------------------------|
  15579. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15580. * rec N |-------------------------------------------------------------|
  15581. * rec N | retried MSDUs | successful MSDUs |
  15582. * rec N |-------------------------------------------------------------|
  15583. * rec N | TX duration | failed MSDUs |
  15584. * rec N |-------------------------------------------------------------|
  15585. *
  15586. * where:
  15587. * A = is A-MPDU flag
  15588. * BA = block-ack failure flags
  15589. * BW = bandwidth spec
  15590. * SG = SGI enabled spec
  15591. * S = skipped rate ctrl
  15592. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15593. *
  15594. * Header
  15595. * ------
  15596. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15597. * dword0 - b'8:31 - reserved : Reserved for future use
  15598. *
  15599. * payload include below peer_stats information
  15600. * --------------------------------------------
  15601. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15602. * @tx_success_bytes : total successful bytes in the PPDU.
  15603. * @tx_retry_bytes : total retried bytes in the PPDU.
  15604. * @tx_failed_bytes : total failed bytes in the PPDU.
  15605. * @tx_ratecode : rate code used for the PPDU.
  15606. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15607. * @ba_ack_failed : BA/ACK failed for this PPDU
  15608. * b00 -> BA received
  15609. * b01 -> BA failed once
  15610. * b10 -> BA failed twice, when HW retry is enabled.
  15611. * @bw : BW
  15612. * b00 -> 20 MHz
  15613. * b01 -> 40 MHz
  15614. * b10 -> 80 MHz
  15615. * b11 -> 160 MHz (or 80+80)
  15616. * @sg : SGI enabled
  15617. * @s : skipped ratectrl
  15618. * @peer_id : peer id
  15619. * @tx_success_msdus : successful MSDUs
  15620. * @tx_retry_msdus : retried MSDUs
  15621. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15622. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15623. */
  15624. /**
  15625. * @brief target -> host backpressure event
  15626. *
  15627. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15628. *
  15629. * @details
  15630. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15631. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15632. * This message will only be sent if the backpressure condition has existed
  15633. * continuously for an initial period (100 ms).
  15634. * Repeat messages with updated information will be sent after each
  15635. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15636. * This message indicates the ring id along with current head and tail index
  15637. * locations (i.e. write and read indices).
  15638. * The backpressure time indicates the time in ms for which continous
  15639. * backpressure has been observed in the ring.
  15640. *
  15641. * The message format is as follows:
  15642. *
  15643. * |31 24|23 16|15 8|7 0|
  15644. * |----------------+----------------+----------------+----------------|
  15645. * | ring_id | ring_type | pdev_id | msg_type |
  15646. * |-------------------------------------------------------------------|
  15647. * | tail_idx | head_idx |
  15648. * |-------------------------------------------------------------------|
  15649. * | backpressure_time_ms |
  15650. * |-------------------------------------------------------------------|
  15651. *
  15652. * The message is interpreted as follows:
  15653. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15654. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15655. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15656. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15657. the msg is for LMAC ring.
  15658. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15659. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15660. * htt_backpressure_lmac_ring_id. This represents
  15661. * the ring id for which continous backpressure is seen
  15662. *
  15663. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15664. * the ring indicated by the ring_id
  15665. *
  15666. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15667. * the ring indicated by the ring id
  15668. *
  15669. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15670. * backpressure has been seen in the ring
  15671. * indicated by the ring_id.
  15672. * Units = milliseconds
  15673. */
  15674. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15675. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15676. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15677. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15678. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15679. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15680. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15681. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15682. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15683. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15684. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15685. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15686. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15687. do { \
  15688. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15689. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15690. } while (0)
  15691. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15692. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15693. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15694. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15695. do { \
  15696. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15697. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15698. } while (0)
  15699. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15700. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15701. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15702. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15703. do { \
  15704. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15705. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15706. } while (0)
  15707. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15708. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15709. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15710. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15711. do { \
  15712. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15713. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15714. } while (0)
  15715. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15716. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15717. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15718. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15719. do { \
  15720. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15721. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15722. } while (0)
  15723. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15724. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15725. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15726. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15727. do { \
  15728. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15729. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15730. } while (0)
  15731. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15732. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15733. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15734. enum htt_backpressure_ring_type {
  15735. HTT_SW_RING_TYPE_UMAC,
  15736. HTT_SW_RING_TYPE_LMAC,
  15737. HTT_SW_RING_TYPE_MAX,
  15738. };
  15739. /* Ring id for which the message is sent to host */
  15740. enum htt_backpressure_umac_ringid {
  15741. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15742. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15743. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15744. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15745. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15746. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15747. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15748. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15749. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15750. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15751. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15752. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15753. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15754. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15755. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15756. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15757. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15758. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15759. HTT_SW_UMAC_RING_IDX_MAX,
  15760. };
  15761. enum htt_backpressure_lmac_ringid {
  15762. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15763. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15764. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15765. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15766. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15767. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15768. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15769. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15770. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15771. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15772. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15773. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15774. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15775. HTT_SW_LMAC_RING_IDX_MAX,
  15776. };
  15777. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15778. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15779. pdev_id: 8,
  15780. ring_type: 8, /* htt_backpressure_ring_type */
  15781. /*
  15782. * ring_id holds an enum value from either
  15783. * htt_backpressure_umac_ringid or
  15784. * htt_backpressure_lmac_ringid, based on
  15785. * the ring_type setting.
  15786. */
  15787. ring_id: 8;
  15788. A_UINT16 head_idx;
  15789. A_UINT16 tail_idx;
  15790. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15791. } POSTPACK;
  15792. /*
  15793. * Defines two 32 bit words that can be used by the target to indicate a per
  15794. * user RU allocation and rate information.
  15795. *
  15796. * This information is currently provided in the "sw_response_reference_ptr"
  15797. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15798. * "rx_ppdu_end_user_stats" TLV.
  15799. *
  15800. * VALID:
  15801. * The consumer of these words must explicitly check the valid bit,
  15802. * and only attempt interpretation of any of the remaining fields if
  15803. * the valid bit is set to 1.
  15804. *
  15805. * VERSION:
  15806. * The consumer of these words must also explicitly check the version bit,
  15807. * and only use the V0 definition if the VERSION field is set to 0.
  15808. *
  15809. * Version 1 is currently undefined, with the exception of the VALID and
  15810. * VERSION fields.
  15811. *
  15812. * Version 0:
  15813. *
  15814. * The fields below are duplicated per BW.
  15815. *
  15816. * The consumer must determine which BW field to use, based on the UL OFDMA
  15817. * PPDU BW indicated by HW.
  15818. *
  15819. * RU_START: RU26 start index for the user.
  15820. * Note that this is always using the RU26 index, regardless
  15821. * of the actual RU assigned to the user
  15822. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15823. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15824. *
  15825. * For example, 20MHz (the value in the top row is RU_START)
  15826. *
  15827. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15828. * RU Size 1 (52): | | | | | |
  15829. * RU Size 2 (106): | | | |
  15830. * RU Size 3 (242): | |
  15831. *
  15832. * RU_SIZE: Indicates the RU size, as defined by enum
  15833. * htt_ul_ofdma_user_info_ru_size.
  15834. *
  15835. * LDPC: LDPC enabled (if 0, BCC is used)
  15836. *
  15837. * DCM: DCM enabled
  15838. *
  15839. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15840. * |---------------------------------+--------------------------------|
  15841. * |Ver|Valid| FW internal |
  15842. * |---------------------------------+--------------------------------|
  15843. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15844. * |---------------------------------+--------------------------------|
  15845. */
  15846. enum htt_ul_ofdma_user_info_ru_size {
  15847. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15848. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15849. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15850. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15851. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15852. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15853. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15854. };
  15855. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15856. struct htt_ul_ofdma_user_info_v0 {
  15857. A_UINT32 word0;
  15858. A_UINT32 word1;
  15859. };
  15860. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15861. A_UINT32 w0_fw_rsvd:30; \
  15862. A_UINT32 w0_valid:1; \
  15863. A_UINT32 w0_version:1;
  15864. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15865. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15866. };
  15867. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15868. A_UINT32 w1_nss:3; \
  15869. A_UINT32 w1_mcs:4; \
  15870. A_UINT32 w1_ldpc:1; \
  15871. A_UINT32 w1_dcm:1; \
  15872. A_UINT32 w1_ru_start:7; \
  15873. A_UINT32 w1_ru_size:3; \
  15874. A_UINT32 w1_trig_type:4; \
  15875. A_UINT32 w1_unused:9;
  15876. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15877. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15878. };
  15879. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15880. A_UINT32 w0_fw_rsvd:27; \
  15881. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15882. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15883. 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) */
  15884. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15885. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15886. };
  15887. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15888. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15889. A_UINT32 w1_trig_type:4; \
  15890. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15891. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15892. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15893. };
  15894. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15895. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15896. union {
  15897. A_UINT32 word0;
  15898. struct {
  15899. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15900. };
  15901. };
  15902. union {
  15903. A_UINT32 word1;
  15904. struct {
  15905. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15906. };
  15907. };
  15908. } POSTPACK;
  15909. /*
  15910. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15911. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15912. * this should be picked.
  15913. */
  15914. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15915. union {
  15916. A_UINT32 word0;
  15917. struct {
  15918. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15919. };
  15920. };
  15921. union {
  15922. A_UINT32 word1;
  15923. struct {
  15924. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15925. };
  15926. };
  15927. } POSTPACK;
  15928. enum HTT_UL_OFDMA_TRIG_TYPE {
  15929. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15930. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15931. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15932. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15933. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15934. };
  15935. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15936. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15937. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15938. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15939. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15940. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15941. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15942. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15943. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15944. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15945. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15946. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15947. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15948. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15949. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15950. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15951. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15952. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15953. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15954. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15955. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15956. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15957. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15958. /*--- word 0 ---*/
  15959. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15960. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15961. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15962. do { \
  15963. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15964. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15965. } while (0)
  15966. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15967. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15968. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15969. do { \
  15970. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15971. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15972. } while (0)
  15973. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15974. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15975. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15976. do { \
  15977. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15978. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15979. } while (0)
  15980. /*--- word 1 ---*/
  15981. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15982. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15983. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15984. do { \
  15985. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15986. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15987. } while (0)
  15988. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15989. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15990. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15991. do { \
  15992. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15993. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15994. } while (0)
  15995. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15996. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15997. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  15998. do { \
  15999. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16000. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16001. } while (0)
  16002. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16003. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16004. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16005. do { \
  16006. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16007. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16008. } while (0)
  16009. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16010. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16011. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16012. do { \
  16013. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16014. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16015. } while (0)
  16016. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16017. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16018. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16019. do { \
  16020. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16021. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16022. } while (0)
  16023. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16024. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16025. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16026. do { \
  16027. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16028. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16029. } while (0)
  16030. /**
  16031. * @brief target -> host channel calibration data message
  16032. *
  16033. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16034. *
  16035. * @brief host -> target channel calibration data message
  16036. *
  16037. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16038. *
  16039. * @details
  16040. * The following field definitions describe the format of the channel
  16041. * calibration data message sent from the target to the host when
  16042. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16043. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16044. * The message is defined as htt_chan_caldata_msg followed by a variable
  16045. * number of 32-bit character values.
  16046. *
  16047. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16048. * |------------------------------------------------------------------|
  16049. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16050. * |------------------------------------------------------------------|
  16051. * | payload size | mhz |
  16052. * |------------------------------------------------------------------|
  16053. * | center frequency 2 | center frequency 1 |
  16054. * |------------------------------------------------------------------|
  16055. * | check sum |
  16056. * |------------------------------------------------------------------|
  16057. * | payload |
  16058. * |------------------------------------------------------------------|
  16059. * message info field:
  16060. * - MSG_TYPE
  16061. * Bits 7:0
  16062. * Purpose: identifies this as a channel calibration data message
  16063. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16064. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16065. * - SUB_TYPE
  16066. * Bits 11:8
  16067. * Purpose: T2H: indicates whether target is providing chan cal data
  16068. * to the host to store, or requesting that the host
  16069. * download previously-stored data.
  16070. * H2T: indicates whether the host is providing the requested
  16071. * channel cal data, or if it is rejecting the data
  16072. * request because it does not have the requested data.
  16073. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16074. * - CHKSUM_VALID
  16075. * Bit 12
  16076. * Purpose: indicates if the checksum field is valid
  16077. * value:
  16078. * - FRAG
  16079. * Bit 19:16
  16080. * Purpose: indicates the fragment index for message
  16081. * value: 0 for first fragment, 1 for second fragment, ...
  16082. * - APPEND
  16083. * Bit 20
  16084. * Purpose: indicates if this is the last fragment
  16085. * value: 0 = final fragment, 1 = more fragments will be appended
  16086. *
  16087. * channel and payload size field
  16088. * - MHZ
  16089. * Bits 15:0
  16090. * Purpose: indicates the channel primary frequency
  16091. * Value:
  16092. * - PAYLOAD_SIZE
  16093. * Bits 31:16
  16094. * Purpose: indicates the bytes of calibration data in payload
  16095. * Value:
  16096. *
  16097. * center frequency field
  16098. * - CENTER FREQUENCY 1
  16099. * Bits 15:0
  16100. * Purpose: indicates the channel center frequency
  16101. * Value: channel center frequency, in MHz units
  16102. * - CENTER FREQUENCY 2
  16103. * Bits 31:16
  16104. * Purpose: indicates the secondary channel center frequency,
  16105. * only for 11acvht 80plus80 mode
  16106. * Value: secondary channel center frequeny, in MHz units, if applicable
  16107. *
  16108. * checksum field
  16109. * - CHECK_SUM
  16110. * Bits 31:0
  16111. * Purpose: check the payload data, it is just for this fragment.
  16112. * This is intended for the target to check that the channel
  16113. * calibration data returned by the host is the unmodified data
  16114. * that was previously provided to the host by the target.
  16115. * value: checksum of fragment payload
  16116. */
  16117. PREPACK struct htt_chan_caldata_msg {
  16118. /* DWORD 0: message info */
  16119. A_UINT32
  16120. msg_type: 8,
  16121. sub_type: 4 ,
  16122. chksum_valid: 1, /** 1:valid, 0:invalid */
  16123. reserved1: 3,
  16124. frag_idx: 4, /** fragment index for calibration data */
  16125. appending: 1, /** 0: no fragment appending,
  16126. * 1: extra fragment appending */
  16127. reserved2: 11;
  16128. /* DWORD 1: channel and payload size */
  16129. A_UINT32
  16130. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16131. payload_size: 16; /** unit: bytes */
  16132. /* DWORD 2: center frequency */
  16133. A_UINT32
  16134. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16135. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16136. * valid only for 11acvht 80plus80 mode */
  16137. /* DWORD 3: check sum */
  16138. A_UINT32 chksum;
  16139. /* variable length for calibration data */
  16140. A_UINT32 payload[1/* or more */];
  16141. } POSTPACK;
  16142. /* T2H SUBTYPE */
  16143. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16144. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16145. /* H2T SUBTYPE */
  16146. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16147. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16148. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16149. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16150. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16151. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16152. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16153. do { \
  16154. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16155. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16156. } while (0)
  16157. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16158. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16159. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16160. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16161. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16162. do { \
  16163. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16164. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16165. } while (0)
  16166. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16167. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16168. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16169. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16170. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16171. do { \
  16172. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16173. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16174. } while (0)
  16175. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16176. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16177. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16178. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16179. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16180. do { \
  16181. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16182. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16183. } while (0)
  16184. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16185. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16186. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16187. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16188. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16189. do { \
  16190. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16191. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16192. } while (0)
  16193. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16194. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16195. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16196. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16197. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16198. do { \
  16199. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16200. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16201. } while (0)
  16202. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16203. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16204. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16205. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16206. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16207. do { \
  16208. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16209. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16210. } while (0)
  16211. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16212. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16213. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16214. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16215. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16216. do { \
  16217. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16218. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16219. } while (0)
  16220. /**
  16221. * @brief target -> host FSE CMEM based send
  16222. *
  16223. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16224. *
  16225. * @details
  16226. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16227. * FSE placement in CMEM is enabled.
  16228. *
  16229. * This message sends the non-secure CMEM base address.
  16230. * It will be sent to host in response to message
  16231. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16232. * The message would appear as follows:
  16233. *
  16234. * |31 24|23 16|15 8|7 0|
  16235. * |----------------+----------------+----------------+----------------|
  16236. * | reserved | num_entries | msg_type |
  16237. * |----------------+----------------+----------------+----------------|
  16238. * | base_address_lo |
  16239. * |----------------+----------------+----------------+----------------|
  16240. * | base_address_hi |
  16241. * |-------------------------------------------------------------------|
  16242. *
  16243. * The message is interpreted as follows:
  16244. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16245. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16246. * b'8:15 - number_entries: Indicated the number of entries
  16247. * programmed.
  16248. * b'16:31 - reserved.
  16249. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16250. * CMEM base address
  16251. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16252. * CMEM base address
  16253. */
  16254. PREPACK struct htt_cmem_base_send_t {
  16255. A_UINT32 msg_type: 8,
  16256. num_entries: 8,
  16257. reserved: 16;
  16258. A_UINT32 base_address_lo;
  16259. A_UINT32 base_address_hi;
  16260. } POSTPACK;
  16261. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16262. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16263. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16264. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16265. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16266. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16267. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16268. do { \
  16269. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16270. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16271. } while (0)
  16272. /**
  16273. * @brief - HTT PPDU ID format
  16274. *
  16275. * @details
  16276. * The following field definitions describe the format of the PPDU ID.
  16277. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16278. *
  16279. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16280. * +--------------------------------------------------------------------------
  16281. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16282. * +--------------------------------------------------------------------------
  16283. *
  16284. * sch id :Schedule command id
  16285. * Bits [11 : 0] : monotonically increasing counter to track the
  16286. * PPDU posted to a specific transmit queue.
  16287. *
  16288. * hwq_id: Hardware Queue ID.
  16289. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16290. *
  16291. * mac_id: MAC ID
  16292. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16293. *
  16294. * seq_idx: Sequence index.
  16295. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16296. * a particular TXOP.
  16297. *
  16298. * tqm_cmd: HWSCH/TQM flag.
  16299. * Bit [23] : Always set to 0.
  16300. *
  16301. * seq_cmd_type: Sequence command type.
  16302. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16303. * Refer to enum HTT_STATS_FTYPE for values.
  16304. */
  16305. PREPACK struct htt_ppdu_id {
  16306. A_UINT32
  16307. sch_id: 12,
  16308. hwq_id: 5,
  16309. mac_id: 2,
  16310. seq_idx: 2,
  16311. reserved1: 2,
  16312. tqm_cmd: 1,
  16313. seq_cmd_type: 6,
  16314. reserved2: 2;
  16315. } POSTPACK;
  16316. #define HTT_PPDU_ID_SCH_ID_S 0
  16317. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16318. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16319. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16320. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16321. do { \
  16322. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16323. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16324. } while (0)
  16325. #define HTT_PPDU_ID_HWQ_ID_S 12
  16326. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16327. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16328. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16329. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16330. do { \
  16331. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16332. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16333. } while (0)
  16334. #define HTT_PPDU_ID_MAC_ID_S 17
  16335. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16336. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16337. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16338. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16339. do { \
  16340. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16341. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16342. } while (0)
  16343. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16344. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16345. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16346. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16347. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16348. do { \
  16349. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16350. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16351. } while (0)
  16352. #define HTT_PPDU_ID_TQM_CMD_S 23
  16353. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16354. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16355. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16356. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16357. do { \
  16358. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16359. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16360. } while (0)
  16361. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16362. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16363. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16364. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16365. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16366. do { \
  16367. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16368. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16369. } while (0)
  16370. /**
  16371. * @brief target -> RX PEER METADATA V0 format
  16372. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16373. * message from target, and will confirm to the target which peer metadata
  16374. * version to use in the wmi_init message.
  16375. *
  16376. * The following diagram shows the format of the RX PEER METADATA.
  16377. *
  16378. * |31 24|23 16|15 8|7 0|
  16379. * |-----------------------------------------------------------------------|
  16380. * | Reserved | VDEV ID | PEER ID |
  16381. * |-----------------------------------------------------------------------|
  16382. */
  16383. PREPACK struct htt_rx_peer_metadata_v0 {
  16384. A_UINT32
  16385. peer_id: 16,
  16386. vdev_id: 8,
  16387. reserved1: 8;
  16388. } POSTPACK;
  16389. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16390. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16391. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16392. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16393. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16394. do { \
  16395. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16396. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16397. } while (0)
  16398. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16399. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16400. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16401. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16402. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16403. do { \
  16404. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16405. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16406. } while (0)
  16407. /**
  16408. * @brief target -> RX PEER METADATA V1 format
  16409. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16410. * message from target, and will confirm to the target which peer metadata
  16411. * version to use in the wmi_init message.
  16412. *
  16413. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16414. *
  16415. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16416. * |-----------------------------------------------------------------------|
  16417. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  16418. * |-----------------------------------------------------------------------|
  16419. */
  16420. PREPACK struct htt_rx_peer_metadata_v1 {
  16421. A_UINT32
  16422. peer_id: 13,
  16423. ml_peer_valid: 1,
  16424. reserved1: 2,
  16425. vdev_id: 8,
  16426. lmac_id: 2,
  16427. chip_id: 3,
  16428. reserved2: 3;
  16429. } POSTPACK;
  16430. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16431. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16432. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16433. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16434. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16435. do { \
  16436. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16437. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16438. } while (0)
  16439. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16440. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16441. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16442. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16443. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16444. do { \
  16445. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16446. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16447. } while (0)
  16448. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16449. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16450. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16451. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16452. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16453. do { \
  16454. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16455. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16456. } while (0)
  16457. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16458. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16459. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16460. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16461. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16462. do { \
  16463. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16464. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16465. } while (0)
  16466. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16467. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16468. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16469. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16470. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16471. do { \
  16472. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16473. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16474. } while (0)
  16475. /*
  16476. * In some systems, the host SW wants to specify priorities between
  16477. * different MSDU / flow queues within the same peer-TID.
  16478. * The below enums are used for the host to identify to the target
  16479. * which MSDU queue's priority it wants to adjust.
  16480. */
  16481. /*
  16482. * The MSDUQ index describe index of TCL HW, where each index is
  16483. * used for queuing particular types of MSDUs.
  16484. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16485. */
  16486. enum HTT_MSDUQ_INDEX {
  16487. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16488. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16489. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16490. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16491. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16492. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16493. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16494. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16495. HTT_MSDUQ_MAX_INDEX,
  16496. };
  16497. /* MSDU qtype definition */
  16498. enum HTT_MSDU_QTYPE {
  16499. /*
  16500. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16501. * relative priority. Instead, the relative priority of CRIT_0 versus
  16502. * CRIT_1 is controlled by the FW, through the configuration parameters
  16503. * it applies to the queues.
  16504. */
  16505. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16506. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16507. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16508. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16509. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16510. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16511. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16512. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16513. /* New MSDU_QTYPE should be added above this line */
  16514. /*
  16515. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16516. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16517. * any host/target message definitions. The QTYPE_MAX value can
  16518. * only be used internally within the host or within the target.
  16519. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16520. * it must regard the unexpected value as a default qtype value,
  16521. * or ignore it.
  16522. */
  16523. HTT_MSDU_QTYPE_MAX,
  16524. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16525. };
  16526. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16527. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16528. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16529. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16530. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16531. };
  16532. /**
  16533. * @brief target -> host mlo timestamp offset indication
  16534. *
  16535. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16536. *
  16537. * @details
  16538. * The following field definitions describe the format of the HTT target
  16539. * to host mlo timestamp offset indication message.
  16540. *
  16541. *
  16542. * |31 16|15 12|11 10|9 8|7 0 |
  16543. * |----------------------------------------------------------------------|
  16544. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16545. * |----------------------------------------------------------------------|
  16546. * | Sync time stamp lo in us |
  16547. * |----------------------------------------------------------------------|
  16548. * | Sync time stamp hi in us |
  16549. * |----------------------------------------------------------------------|
  16550. * | mlo time stamp offset lo in us |
  16551. * |----------------------------------------------------------------------|
  16552. * | mlo time stamp offset hi in us |
  16553. * |----------------------------------------------------------------------|
  16554. * | mlo time stamp offset clocks in clock ticks |
  16555. * |----------------------------------------------------------------------|
  16556. * |31 26|25 16|15 0 |
  16557. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16558. * | | compensation in clks | |
  16559. * |----------------------------------------------------------------------|
  16560. * |31 22|21 0 |
  16561. * | rsvd 3 | mlo time stamp comp timer period |
  16562. * |----------------------------------------------------------------------|
  16563. * The message is interpreted as follows:
  16564. *
  16565. * dword0 - b'0:7 - msg_type: This will be set to
  16566. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16567. * value: 0x28
  16568. *
  16569. * dword0 - b'9:8 - pdev_id
  16570. *
  16571. * dword0 - b'11:10 - chip_id
  16572. *
  16573. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16574. *
  16575. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16576. *
  16577. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16578. * which last sync interrupt was received
  16579. *
  16580. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16581. * which last sync interrupt was received
  16582. *
  16583. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16584. *
  16585. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16586. *
  16587. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16588. *
  16589. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16590. *
  16591. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16592. * for sub us resolution
  16593. *
  16594. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16595. *
  16596. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16597. * is applied, in us
  16598. *
  16599. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16600. */
  16601. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16602. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16603. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16604. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16605. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16606. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16607. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16608. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16609. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16610. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16611. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16612. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16613. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16614. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16615. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16616. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16617. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16618. do { \
  16619. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16620. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16621. } while (0)
  16622. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16623. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16624. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16625. do { \
  16626. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16627. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16628. } while (0)
  16629. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16630. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16631. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16632. do { \
  16633. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16634. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16635. } while (0)
  16636. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16637. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16638. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16639. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16640. do { \
  16641. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16642. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16643. } while (0)
  16644. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16645. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16646. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16647. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16648. do { \
  16649. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16650. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16651. } while (0)
  16652. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16653. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16654. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16655. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16656. do { \
  16657. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16658. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16659. } while (0)
  16660. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16661. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16662. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16663. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16664. do { \
  16665. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16666. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16667. } while (0)
  16668. typedef struct {
  16669. A_UINT32 msg_type: 8, /* bits 7:0 */
  16670. pdev_id: 2, /* bits 9:8 */
  16671. chip_id: 2, /* bits 11:10 */
  16672. reserved1: 4, /* bits 15:12 */
  16673. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16674. A_UINT32 sync_timestamp_lo_us;
  16675. A_UINT32 sync_timestamp_hi_us;
  16676. A_UINT32 mlo_timestamp_offset_lo_us;
  16677. A_UINT32 mlo_timestamp_offset_hi_us;
  16678. A_UINT32 mlo_timestamp_offset_clks;
  16679. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16680. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16681. reserved2: 6; /* bits 31:26 */
  16682. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16683. reserved3: 10; /* bits 31:22 */
  16684. } htt_t2h_mlo_offset_ind_t;
  16685. /*
  16686. * @brief target -> host VDEV TX RX STATS
  16687. *
  16688. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16689. *
  16690. * @details
  16691. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16692. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16693. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16694. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16695. * periodically by target even in the absence of any further HTT request
  16696. * messages from host.
  16697. *
  16698. * The message is formatted as follows:
  16699. *
  16700. * |31 16|15 8|7 0|
  16701. * |---------------------------------+----------------+----------------|
  16702. * | payload_size | pdev_id | msg_type |
  16703. * |---------------------------------+----------------+----------------|
  16704. * | reserved0 |
  16705. * |-------------------------------------------------------------------|
  16706. * | reserved1 |
  16707. * |-------------------------------------------------------------------|
  16708. * | reserved2 |
  16709. * |-------------------------------------------------------------------|
  16710. * | |
  16711. * | VDEV specific Tx Rx stats info |
  16712. * | |
  16713. * |-------------------------------------------------------------------|
  16714. *
  16715. * The message is interpreted as follows:
  16716. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16717. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16718. * b'8:15 - pdev_id
  16719. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16720. * message header fields (msg_type through reserved2)
  16721. * dword1 - b'0:31 - reserved0.
  16722. * dword2 - b'0:31 - reserved1.
  16723. * dword3 - b'0:31 - reserved2.
  16724. */
  16725. typedef struct {
  16726. A_UINT32 msg_type: 8,
  16727. pdev_id: 8,
  16728. payload_size: 16;
  16729. A_UINT32 reserved0;
  16730. A_UINT32 reserved1;
  16731. A_UINT32 reserved2;
  16732. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16733. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16734. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16735. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16736. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16737. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16738. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16739. do { \
  16740. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16741. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16742. } while (0)
  16743. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16744. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16745. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16746. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16747. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16748. do { \
  16749. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16750. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16751. } while (0)
  16752. /* SOC related stats */
  16753. typedef struct {
  16754. htt_tlv_hdr_t tlv_hdr;
  16755. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16756. * This can be due to either the peer is deleted or deletion is ongoing
  16757. * */
  16758. A_UINT32 inv_peers_msdu_drop_count_lo;
  16759. A_UINT32 inv_peers_msdu_drop_count_hi;
  16760. } htt_t2h_soc_txrx_stats_common_tlv;
  16761. /* VDEV HW Tx/Rx stats */
  16762. typedef struct {
  16763. htt_tlv_hdr_t tlv_hdr;
  16764. A_UINT32 vdev_id;
  16765. /* Rx msdu byte cnt */
  16766. A_UINT32 rx_msdu_byte_cnt_lo;
  16767. A_UINT32 rx_msdu_byte_cnt_hi;
  16768. /* Rx msdu cnt */
  16769. A_UINT32 rx_msdu_cnt_lo;
  16770. A_UINT32 rx_msdu_cnt_hi;
  16771. /* tx msdu byte cnt */
  16772. A_UINT32 tx_msdu_byte_cnt_lo;
  16773. A_UINT32 tx_msdu_byte_cnt_hi;
  16774. /* tx msdu cnt */
  16775. A_UINT32 tx_msdu_cnt_lo;
  16776. A_UINT32 tx_msdu_cnt_hi;
  16777. /* tx excessive retry discarded msdu cnt */
  16778. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16779. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16780. /* TX congestion ctrl msdu drop cnt */
  16781. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16782. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16783. /* discarded tx msdus cnt coz of time to live expiry */
  16784. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16785. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16786. /* tx excessive retry discarded msdu byte cnt */
  16787. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16788. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16789. /* TX congestion ctrl msdu drop byte cnt */
  16790. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16791. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16792. /* discarded tx msdus byte cnt coz of time to live expiry */
  16793. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16794. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16795. /* TQM bypass frame cnt */
  16796. A_UINT32 tqm_bypass_frame_cnt_lo;
  16797. A_UINT32 tqm_bypass_frame_cnt_hi;
  16798. /* TQM bypass byte cnt */
  16799. A_UINT32 tqm_bypass_byte_cnt_lo;
  16800. A_UINT32 tqm_bypass_byte_cnt_hi;
  16801. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16802. /*
  16803. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16804. *
  16805. * @details
  16806. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16807. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16808. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16809. * the default MSDU queues of each of the specified TIDs for the peer
  16810. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16811. * If the default MSDU queues of a given TID within the peer are not linked
  16812. * to a service class, the svc_class_id field for that TID will have a
  16813. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16814. * queues for that TID are not mapped to any service class.
  16815. *
  16816. * |31 16|15 8|7 0|
  16817. * |------------------------------+--------------+--------------|
  16818. * | peer ID | reserved | msg type |
  16819. * |------------------------------+--------------+------+-------|
  16820. * | reserved | svc class ID | TID |
  16821. * |------------------------------------------------------------|
  16822. * ...
  16823. * |------------------------------------------------------------|
  16824. * | reserved | svc class ID | TID |
  16825. * |------------------------------------------------------------|
  16826. * Header fields:
  16827. * dword0 - b'7:0 - msg_type: This will be set to
  16828. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16829. * b'31:16 - peer ID
  16830. * dword1 - b'7:0 - TID
  16831. * b'15:8 - svc class ID
  16832. * (dword2, etc. same format as dword1)
  16833. */
  16834. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16835. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16836. A_UINT32 msg_type :8,
  16837. reserved0 :8,
  16838. peer_id :16;
  16839. struct {
  16840. A_UINT32 tid :8,
  16841. svc_class_id :8,
  16842. reserved1 :16;
  16843. } tid_reports[1/*or more*/];
  16844. } POSTPACK;
  16845. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16846. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16847. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16848. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16849. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16850. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16851. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16852. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16853. do { \
  16854. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16855. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16856. } while (0)
  16857. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16858. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16859. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16860. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16861. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16862. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16863. do { \
  16864. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16865. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16866. } while (0)
  16867. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16868. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16869. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16870. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16871. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16872. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16873. do { \
  16874. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16875. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16876. } while (0)
  16877. /*
  16878. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16879. *
  16880. * @details
  16881. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16882. * flow if the flow is seen the associated service class is conveyed to the
  16883. * target via TCL Data Command. Target on the other hand internally creates the
  16884. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16885. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16886. * the newly created MSDUQ
  16887. *
  16888. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16889. * |------------------------------+------------------------+--------------|
  16890. * | peer ID | HTT qtype | msg type |
  16891. * |---------------------------------+--------------+--+---+-------+------|
  16892. * | reserved |AST list index|FO|WC | HLOS | remap|
  16893. * | | | | | TID | TID |
  16894. * |---------------------+------------------------------------------------|
  16895. * | reserved1 | tgt_opaque_id |
  16896. * |---------------------+------------------------------------------------|
  16897. *
  16898. * Header fields:
  16899. *
  16900. * dword0 - b'7:0 - msg_type: This will be set to
  16901. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16902. * b'15:8 - HTT qtype
  16903. * b'31:16 - peer ID
  16904. *
  16905. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16906. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16907. * hlos_tid : Common to Lithium and Beryllium
  16908. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16909. * TCL Data Command : Beryllium
  16910. * b10 - flow_override (FO), as sent by host in
  16911. * TCL Data Command: Beryllium
  16912. * b11:14 - ast_list_idx
  16913. * Array index into the list of extension AST entries
  16914. * (not the actual AST 16-bit index).
  16915. * The ast_list_idx is one-based, with the following
  16916. * range of values:
  16917. * - legacy targets supporting 16 user-defined
  16918. * MSDU queues: 1-2
  16919. * - legacy targets supporting 48 user-defined
  16920. * MSDU queues: 1-6
  16921. * - new targets: 0 (peer_id is used instead)
  16922. * Note that since ast_list_idx is one-based,
  16923. * the host will need to subtract 1 to use it as an
  16924. * index into a list of extension AST entries.
  16925. * b15:31 - reserved
  16926. *
  16927. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16928. * unique MSDUQ id in firmware
  16929. * b'24:31 - reserved1
  16930. */
  16931. PREPACK struct htt_t2h_sawf_msduq_event {
  16932. A_UINT32 msg_type : 8,
  16933. htt_qtype : 8,
  16934. peer_id :16;
  16935. A_UINT32 remap_tid : 4,
  16936. hlos_tid : 4,
  16937. who_classify_info_sel : 2,
  16938. flow_override : 1,
  16939. ast_list_idx : 4,
  16940. reserved :17;
  16941. A_UINT32 tgt_opaque_id :24,
  16942. reserved1 : 8;
  16943. } POSTPACK;
  16944. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16945. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16946. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16947. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16948. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16949. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16950. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16951. do { \
  16952. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16953. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16954. } while (0)
  16955. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16956. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16957. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16958. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16959. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16960. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16961. do { \
  16962. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16963. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16964. } while (0)
  16965. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16966. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16967. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16968. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16969. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16970. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16971. do { \
  16972. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16973. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16974. } while (0)
  16975. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16976. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16977. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16978. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16979. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16980. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16981. do { \
  16982. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16983. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16984. } while (0)
  16985. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16986. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16987. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16988. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16989. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16990. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16991. do { \
  16992. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16993. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16994. } while (0)
  16995. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  16996. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  16997. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  16998. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  16999. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17000. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17001. do { \
  17002. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17003. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17004. } while (0)
  17005. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17006. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17007. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17008. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17009. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17010. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17011. do { \
  17012. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17013. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17014. } while (0)
  17015. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17016. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17017. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17018. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17019. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17020. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17021. do { \
  17022. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17023. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17024. } while (0)
  17025. /**
  17026. * @brief target -> PPDU id format indication
  17027. *
  17028. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17029. *
  17030. * @details
  17031. * The following field definitions describe the format of the HTT target
  17032. * to host PPDU ID format indication message.
  17033. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17034. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17035. * seq_idx :- Sequence control index of this PPDU.
  17036. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17037. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17038. * tqm_cmd:-
  17039. *
  17040. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17041. * |--------------------------------------------------+------------------------|
  17042. * | rsvd0 | msg type |
  17043. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17044. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17045. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17046. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17047. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17048. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17049. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17050. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17051. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17052. * Where: OF = bit offset, NB = number of bits, V = valid
  17053. * The message is interpreted as follows:
  17054. *
  17055. * dword0 - b'7:0 - msg_type: This will be set to
  17056. * HTT_T2H_PPDU_ID_FMT_IND
  17057. * value: 0x30
  17058. *
  17059. * dword0 - b'31:8 - reserved
  17060. *
  17061. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17062. *
  17063. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17064. *
  17065. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17066. *
  17067. * dword1 - b'15:11 - reserved for future use
  17068. *
  17069. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17070. *
  17071. * dword1 - b'21:17 - number of bits in ring_id
  17072. *
  17073. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17074. *
  17075. * dword1 - b'31:27 - reserved for future use
  17076. *
  17077. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17078. *
  17079. * dword2 - b'5:1 - number of bits in sequence index
  17080. *
  17081. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17082. *
  17083. * dword2 - b'15:11 - reserved for future use
  17084. *
  17085. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17086. *
  17087. * dword2 - b'21:17 - number of bits in link_id
  17088. *
  17089. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17090. *
  17091. * dword2 - b'31:27 - reserved for future use
  17092. *
  17093. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17094. *
  17095. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17096. *
  17097. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17098. *
  17099. * dword3 - b'15:11 - reserved for future use
  17100. *
  17101. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17102. *
  17103. * dword3 - b'21:17 - number of bits in tqm_cmd
  17104. *
  17105. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17106. *
  17107. * dword3 - b'31:27 - reserved for future use
  17108. *
  17109. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17110. *
  17111. * dword4 - b'5:1 - number of bits in mac_id
  17112. *
  17113. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17114. *
  17115. * dword4 - b'15:11 - reserved for future use
  17116. *
  17117. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17118. *
  17119. * dword4 - b'21:17 - number of bits in crc
  17120. *
  17121. * dword4 - b'26:22 - offset of crc (in number of bits)
  17122. *
  17123. * dword4 - b'31:27 - reserved for future use
  17124. *
  17125. */
  17126. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17127. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17128. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17129. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17130. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17131. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17132. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17133. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17134. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17135. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17136. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17137. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17138. /* macros for accessing lower 16 bits in dword */
  17139. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17140. do { \
  17141. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17142. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17143. } while (0)
  17144. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17145. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17146. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17147. do { \
  17148. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17149. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17150. } while (0)
  17151. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17152. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17153. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17154. do { \
  17155. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17156. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17157. } while (0)
  17158. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17159. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17160. /* macros for accessing upper 16 bits in dword */
  17161. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17162. do { \
  17163. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17164. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17165. } while (0)
  17166. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17167. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17168. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17169. do { \
  17170. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17171. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17172. } while (0)
  17173. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17174. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17175. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17176. do { \
  17177. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17178. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17179. } while (0)
  17180. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17181. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17182. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17183. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17184. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17185. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17186. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17187. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17188. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17189. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17190. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17191. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17192. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17193. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17194. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17195. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17196. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17197. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17198. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17199. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17200. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17201. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17202. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17203. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17204. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17205. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17206. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17207. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17208. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17209. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17210. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17211. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17212. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17213. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17214. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17215. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17216. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17217. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17218. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17219. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17220. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17221. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17222. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17223. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17224. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17225. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17226. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17227. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17228. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17229. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17230. /* offsets in number dwords */
  17231. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17232. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17233. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17234. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17235. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17236. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17237. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17238. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17239. typedef struct {
  17240. A_UINT32 msg_type: 8, /* bits 7:0 */
  17241. rsvd0: 24;/* bits 31:8 */
  17242. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17243. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17244. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17245. rsvd1: 5, /* bits 15:11 */
  17246. ring_id_valid: 1, /* bits 16:16 */
  17247. ring_id_bits: 5, /* bits 21:17 */
  17248. ring_id_offset: 5, /* bits 26:22 */
  17249. rsvd2: 5; /* bits 31:27 */
  17250. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17251. seq_idx_bits: 5, /* bits 5:1 */
  17252. seq_idx_offset: 5, /* bits 10:6 */
  17253. rsvd3: 5, /* bits 15:11 */
  17254. link_id_valid: 1, /* bits 16:16 */
  17255. link_id_bits: 5, /* bits 21:17 */
  17256. link_id_offset: 5, /* bits 26:22 */
  17257. rsvd4: 5; /* bits 31:27 */
  17258. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17259. seq_cmd_type_bits: 5, /* bits 5:1 */
  17260. seq_cmd_type_offset: 5, /* bits 10:6 */
  17261. rsvd5: 5, /* bits 15:11 */
  17262. tqm_cmd_valid: 1, /* bits 16:16 */
  17263. tqm_cmd_bits: 5, /* bits 21:17 */
  17264. tqm_cmd_offset: 5, /* bits 26:12 */
  17265. rsvd6: 5; /* bits 31:27 */
  17266. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17267. mac_id_bits: 5, /* bits 5:1 */
  17268. mac_id_offset: 5, /* bits 10:6 */
  17269. rsvd8: 5, /* bits 15:11 */
  17270. crc_valid: 1, /* bits 16:16 */
  17271. crc_bits: 5, /* bits 21:17 */
  17272. crc_offset: 5, /* bits 26:12 */
  17273. rsvd9: 5; /* bits 31:27 */
  17274. } htt_t2h_ppdu_id_fmt_ind_t;
  17275. #endif